Skip to content

Commit 7f6c10b

Browse files
lgritzscott-wilson
authored andcommitted
api(texture.h): get rid of texture deprecations (AcademySoftwareFoundation#4339)
* Old version of TextureOptions we haven't used since OIIO 1.x. * Texture methods that were based on the VaryingRef helper. These are actually remnants of early OSL needs when it was more Reyes-like, BEFORE we used LLVM! * Get rid of the varyingref.h header, no longer needed by anything. Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Scott Wilson <scott@propersquid.com>
1 parent a2e38bb commit 7f6c10b

File tree

11 files changed

+21
-769
lines changed

11 files changed

+21
-769
lines changed

docs/Deprecations-3.0.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,22 @@ long-deprecated API facets. This document lists the deprecations and removals.
6868
notation.
6969

7070

71+
# texture.h
72+
73+
* Removed stochastic-related tokens from the MipMode and InterpMode enums.
74+
These were originally experimental but never removed.
75+
* Removed the `bias` field from the TextureOpt structure. This was originally
76+
there for the sake of shadow maps, but was never used because we never
77+
implemented shadow maps in OIIO's TextureSystem.
78+
* Removed the TextureOptions, which hasn't been used since OIIO 1.x. We
79+
switched to the alternate TextureOpt structure in OIIO 2.0.
80+
* Fully removed the long-deprecated methods of TextureSystem that operated
81+
on batches using the VaryingRef class. These were replaced by alternatives
82+
a long time ago.
83+
84+
# varyinref.h
85+
86+
* This header has been removed completely, since we no longer use the classes
87+
it defines.
88+
89+

src/doc/mainpage.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ rely on them in their own apps.
7070
\li \ref timer.h : A simple \ref Timer class.
7171
\li \ref typedesc.h : The TypeDesc class.
7272
\li \ref ustring.h : The ustring class.
73-
\li \ref varyingref.h : The VaryingRef template.
7473
7574
*/
7675

src/include/OpenImageIO/texture.h

Lines changed: 1 addition & 215 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <OpenImageIO/imageio.h>
1414
#include <OpenImageIO/simd.h>
1515
#include <OpenImageIO/ustring.h>
16-
#include <OpenImageIO/varyingref.h>
1716
#include <OpenImageIO/vecparam.h>
1817

1918

@@ -111,8 +110,6 @@ enum class MipMode {
111110
OneLevel, ///< Use just one mipmap level
112111
Trilinear, ///< Use two MIPmap levels (trilinear)
113112
Aniso, ///< Use two MIPmap levels w/ anisotropic
114-
StochasticTrilinear, ///< DEPRECATED Stochastic trilinear
115-
StochasticAniso, ///< DEPRECATED Stochastic anisotropic
116113
};
117114

118115
/// Interp mode determines how we sample within a mipmap level
@@ -210,8 +207,6 @@ class OIIO_API TextureOpt {
210207
MipModeOneLevel, ///< Use just one mipmap level
211208
MipModeTrilinear, ///< Use two MIPmap levels (trilinear)
212209
MipModeAniso, ///< Use two MIPmap levels w/ anisotropic
213-
MipModeStochasticTrilinear, ///< DEPRECATED Stochastic trilinear
214-
MipModeStochasticAniso, ///< DEPRECATED Stochastic anisotropic
215210
};
216211

217212
/// Interp mode determines how we sample within a mipmap level
@@ -257,10 +252,7 @@ class OIIO_API TextureOpt {
257252
float fill; ///< Fill value for missing channels
258253
const float* missingcolor; ///< Color for missing texture
259254
float time; ///< Time (for time-dependent texture lookups)
260-
union {
261-
float bias; ///< Bias for shadows (DEPRECATED)
262-
float rnd; ///< Stratified sample value
263-
};
255+
float rnd; ///< Stratified sample value
264256
int samples; ///< Number of samples for shadows
265257

266258
// For 3D volume texture lookups only:
@@ -357,119 +349,6 @@ class OIIO_API TextureOptBatch {
357349

358350

359351

360-
// DEPRECATED(1.8)
361-
// Encapsulate all the options needed for texture lookups. Making
362-
// these options all separate parameters to the texture API routines is
363-
// very ugly and also a big pain whenever we think of new options to
364-
// add. So instead we collect all those little options into one
365-
// structure that can just be passed by reference to the texture API
366-
// routines.
367-
class OIIO_API TextureOptions {
368-
public:
369-
/// Wrap mode describes what happens when texture coordinates describe
370-
/// a value outside the usual [0,1] range where a texture is defined.
371-
enum Wrap {
372-
WrapDefault, ///< Use the default found in the file
373-
WrapBlack, ///< Black outside [0..1]
374-
WrapClamp, ///< Clamp to [0..1]
375-
WrapPeriodic, ///< Periodic mod 1
376-
WrapMirror, ///< Mirror the image
377-
WrapPeriodicPow2, ///< Periodic, but only for powers of 2!!!
378-
WrapPeriodicSharedBorder, ///< Periodic with shared border (env)
379-
WrapLast ///< Mark the end -- don't use this!
380-
};
381-
382-
/// Mip mode determines if/how we use mipmaps
383-
///
384-
enum MipMode {
385-
MipModeDefault, ///< Default high-quality lookup
386-
MipModeNoMIP, ///< Just use highest-res image, no MIP mapping
387-
MipModeOneLevel, ///< Use just one mipmap level
388-
MipModeTrilinear, ///< Use two MIPmap levels (trilinear)
389-
MipModeAniso ///< Use two MIPmap levels w/ anisotropic
390-
};
391-
392-
/// Interp mode determines how we sample within a mipmap level
393-
///
394-
enum InterpMode {
395-
InterpClosest, ///< Force closest texel
396-
InterpBilinear, ///< Force bilinear lookup within a mip level
397-
InterpBicubic, ///< Force cubic lookup within a mip level
398-
InterpSmartBicubic ///< Bicubic when magnifying, else bilinear
399-
};
400-
401-
/// Create a TextureOptions with all fields initialized to reasonable
402-
/// defaults.
403-
OIIO_DEPRECATED("no longer used since OIIO 1.8")
404-
TextureOptions();
405-
406-
/// Convert a TextureOpt for one point into a TextureOptions with
407-
/// uniform values.
408-
OIIO_DEPRECATED("no longer used since OIIO 1.8")
409-
TextureOptions(const TextureOpt& opt);
410-
411-
// Options that must be the same for all points we're texturing at once
412-
int firstchannel; ///< First channel of the lookup
413-
int subimage; ///< Subimage or face ID
414-
ustring subimagename; ///< Subimage name
415-
Wrap swrap; ///< Wrap mode in the s direction
416-
Wrap twrap; ///< Wrap mode in the t direction
417-
MipMode mipmode; ///< Mip mode
418-
InterpMode interpmode; ///< Interpolation mode
419-
int anisotropic; ///< Maximum anisotropic ratio
420-
bool conservative_filter; ///< True == over-blur rather than alias
421-
422-
// Options that may be different for each point we're texturing
423-
VaryingRef<float> sblur, tblur; ///< Blur amount
424-
VaryingRef<float> swidth, twidth; ///< Multiplier for derivatives
425-
VaryingRef<float> time; ///< Time
426-
VaryingRef<float> bias; ///< Bias
427-
VaryingRef<float> fill; ///< Fill value for missing channels
428-
VaryingRef<float> missingcolor; ///< Color for missing texture
429-
VaryingRef<int> samples; ///< Number of samples
430-
431-
// For 3D volume texture lookups only:
432-
Wrap rwrap; ///< Wrap mode in the r direction
433-
VaryingRef<float> rblur; ///< Blur amount in the r direction
434-
VaryingRef<float> rwidth; ///< Multiplier for derivatives in r direction
435-
436-
/// Utility: Return the Wrap enum corresponding to a wrap name:
437-
/// "default", "black", "clamp", "periodic", "mirror".
438-
static Wrap decode_wrapmode(const char* name)
439-
{
440-
return (Wrap)Tex::decode_wrapmode(name);
441-
}
442-
static Wrap decode_wrapmode(ustring name)
443-
{
444-
return (Wrap)Tex::decode_wrapmode(name);
445-
}
446-
static Wrap decode_wrapmode(ustringhash name)
447-
{
448-
return (Wrap)Tex::decode_wrapmode(name);
449-
}
450-
451-
/// Utility: Parse a single wrap mode (e.g., "periodic") or a
452-
/// comma-separated wrap modes string (e.g., "black,clamp") into
453-
/// separate Wrap enums for s and t.
454-
OIIO_DEPRECATED("TextureOptions is deprecated, use TextureOpt (1.8)")
455-
static void parse_wrapmodes(const char* wrapmodes,
456-
TextureOptions::Wrap& swrapcode,
457-
TextureOptions::Wrap& twrapcode)
458-
{
459-
Tex::parse_wrapmodes(wrapmodes, *(Tex::Wrap*)&swrapcode,
460-
*(Tex::Wrap*)&twrapcode);
461-
}
462-
463-
private:
464-
// Options set INTERNALLY by libtexture after the options are passed
465-
// by the user. Users should not attempt to alter these!
466-
friend class pvt::TextureSystemImpl;
467-
friend class TextureOpt;
468-
};
469-
470-
471-
472-
473352
/// Define an API to an abstract class that that manages texture files,
474353
/// caches of open file handles as well as tiles of texels so that truly
475354
/// huge amounts of texture may be accessed by an application with low
@@ -1202,28 +1081,6 @@ class OIIO_API TextureSystem {
12021081
float *dresultds=nullptr,
12031082
float *dresultdt=nullptr) = 0;
12041083

1205-
#ifndef OIIO_DOXYGEN
1206-
// Old multi-point API call.
1207-
// DEPRECATED (1.8)
1208-
OIIO_DEPRECATED("no longer support this multi-point call (1.8)")
1209-
virtual bool texture (ustring filename, TextureOptions &options,
1210-
Runflag *runflags, int beginactive, int endactive,
1211-
VaryingRef<float> s, VaryingRef<float> t,
1212-
VaryingRef<float> dsdx, VaryingRef<float> dtdx,
1213-
VaryingRef<float> dsdy, VaryingRef<float> dtdy,
1214-
int nchannels, float *result,
1215-
float *dresultds=nullptr, float *dresultdt=nullptr) = 0;
1216-
OIIO_DEPRECATED("no longer support this multi-point call (1.8)")
1217-
virtual bool texture (TextureHandle *texture_handle,
1218-
Perthread *thread_info, TextureOptions &options,
1219-
Runflag *runflags, int beginactive, int endactive,
1220-
VaryingRef<float> s, VaryingRef<float> t,
1221-
VaryingRef<float> dsdx, VaryingRef<float> dtdx,
1222-
VaryingRef<float> dsdy, VaryingRef<float> dtdy,
1223-
int nchannels, float *result,
1224-
float *dresultds=nullptr, float *dresultdt=nullptr) = 0;
1225-
#endif
1226-
12271084
/// Perform filtered 3D volumetric texture lookups on a batch of
12281085
/// positions from the same texture, all at once. The "point-like"
12291086
/// parameters `P`, `dPdx`, `dPdy`, and `dPdz` are each a pointers to
@@ -1290,32 +1147,6 @@ class OIIO_API TextureSystem {
12901147
float *dresultds=nullptr, float *dresultdt=nullptr,
12911148
float *dresultdr=nullptr) = 0;
12921149

1293-
#ifndef OIIO_DOXYGEN
1294-
// Retrieve a 3D texture lookup at many points at once.
1295-
// DEPRECATED(1.8)
1296-
OIIO_DEPRECATED("no longer support this multi-point call (1.8)")
1297-
virtual bool texture3d (ustring filename, TextureOptions &options,
1298-
Runflag *runflags, int beginactive, int endactive,
1299-
VaryingRef<Imath::V3f> P,
1300-
VaryingRef<Imath::V3f> dPdx,
1301-
VaryingRef<Imath::V3f> dPdy,
1302-
VaryingRef<Imath::V3f> dPdz,
1303-
int nchannels, float *result,
1304-
float *dresultds=nullptr, float *dresultdt=nullptr,
1305-
float *dresultdr=nullptr) = 0;
1306-
OIIO_DEPRECATED("no longer support this multi-point call (1.8)")
1307-
virtual bool texture3d (TextureHandle *texture_handle,
1308-
Perthread *thread_info, TextureOptions &options,
1309-
Runflag *runflags, int beginactive, int endactive,
1310-
VaryingRef<Imath::V3f> P,
1311-
VaryingRef<Imath::V3f> dPdx,
1312-
VaryingRef<Imath::V3f> dPdy,
1313-
VaryingRef<Imath::V3f> dPdz,
1314-
int nchannels, float *result,
1315-
float *dresultds=nullptr, float *dresultdt=nullptr,
1316-
float *dresultdr=nullptr) = 0;
1317-
#endif
1318-
13191150
/// Perform filtered directional environment map lookups on a batch of
13201151
/// directions from the same texture, all at once. The "point-like"
13211152
/// parameters `R`, `dRdx`, and `dRdy` are each a pointers to arrays of
@@ -1377,29 +1208,6 @@ class OIIO_API TextureSystem {
13771208
int nchannels, float *result,
13781209
float *dresultds=nullptr, float *dresultdt=nullptr) = 0;
13791210

1380-
#ifndef OIIO_DOXYGEN
1381-
// Retrieve an environment map lookup for direction R, for many
1382-
// points at once.
1383-
// DEPRECATED(1.8)
1384-
OIIO_DEPRECATED("no longer support this multi-point call (1.8)")
1385-
virtual bool environment (ustring filename, TextureOptions &options,
1386-
Runflag *runflags, int beginactive, int endactive,
1387-
VaryingRef<Imath::V3f> R,
1388-
VaryingRef<Imath::V3f> dRdx,
1389-
VaryingRef<Imath::V3f> dRdy,
1390-
int nchannels, float *result,
1391-
float *dresultds=nullptr, float *dresultdt=nullptr) = 0;
1392-
OIIO_DEPRECATED("no longer support this multi-point call (1.8)")
1393-
virtual bool environment (TextureHandle *texture_handle,
1394-
Perthread *thread_info, TextureOptions &options,
1395-
Runflag *runflags, int beginactive, int endactive,
1396-
VaryingRef<Imath::V3f> R,
1397-
VaryingRef<Imath::V3f> dRdx,
1398-
VaryingRef<Imath::V3f> dRdy,
1399-
int nchannels, float *result,
1400-
float *dresultds=nullptr, float *dresultdt=nullptr) = 0;
1401-
#endif
1402-
14031211
// Batched shadow lookups
14041212
virtual bool shadow (ustring filename,
14051213
TextureOptBatch &options, Tex::RunMask mask,
@@ -1410,28 +1218,6 @@ class OIIO_API TextureSystem {
14101218
const float *P, const float *dPdx, const float *dPdy,
14111219
float *result, float *dresultds=nullptr, float *dresultdt=nullptr) = 0;
14121220

1413-
#ifndef OIIO_DOXYGEN
1414-
// Retrieve a shadow lookup for position P at many points at once.
1415-
// DEPRECATED(1.8)
1416-
OIIO_DEPRECATED("no longer support this multi-point call (1.8)")
1417-
virtual bool shadow (ustring filename, TextureOptions &options,
1418-
Runflag *runflags, int beginactive, int endactive,
1419-
VaryingRef<Imath::V3f> P,
1420-
VaryingRef<Imath::V3f> dPdx,
1421-
VaryingRef<Imath::V3f> dPdy,
1422-
float *result,
1423-
float *dresultds=nullptr, float *dresultdt=nullptr) = 0;
1424-
OIIO_DEPRECATED("no longer support this multi-point call (1.8)")
1425-
virtual bool shadow (TextureHandle *texture_handle, Perthread *thread_info,
1426-
TextureOptions &options,
1427-
Runflag *runflags, int beginactive, int endactive,
1428-
VaryingRef<Imath::V3f> P,
1429-
VaryingRef<Imath::V3f> dPdx,
1430-
VaryingRef<Imath::V3f> dPdy,
1431-
float *result,
1432-
float *dresultds=nullptr, float *dresultdt=nullptr) = 0;
1433-
#endif
1434-
14351221
/// @}
14361222

14371223

0 commit comments

Comments
 (0)