OpenImageIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
TextureOptions Class Reference

#include <texture.h>

Public Types

enum  Wrap {
  WrapDefault, WrapBlack, WrapClamp, WrapPeriodic,
  WrapMirror, WrapLast
}
 
enum  MipMode {
  MipModeDefault, MipModeNoMIP, MipModeOneLevel, MipModeTrilinear,
  MipModeAniso
}
 
enum  InterpMode { InterpClosest, InterpBilinear, InterpBicubic, InterpSmartBicubic }
 

Public Member Functions

 TextureOptions ()
 
 TextureOptions (const TextureOpt &opt)
 

Static Public Member Functions

static Wrap decode_wrapmode (const char *name)
 
static Wrap decode_wrapmode (ustring name)
 
static void parse_wrapmodes (const char *wrapmodes, TextureOptions::Wrap &swrapcode, TextureOptions::Wrap &twrapcode)
 

Public Attributes

int firstchannel
 First channel of the lookup.
 
int nchannels
 Number of channels to look up.
 
int subimage
 Subimage or face ID.
 
ustring subimagename
 Subimage name.
 
Wrap swrap
 Wrap mode in the s direction.
 
Wrap twrap
 Wrap mode in the t direction.
 
MipMode mipmode
 Mip mode.
 
InterpMode interpmode
 Interpolation mode.
 
int anisotropic
 Maximum anisotropic ratio.
 
bool conservative_filter
 True == over-blur rather than alias.
 
VaryingRef< float > sblur
 
VaryingRef< float > tblur
 Blur amount.
 
VaryingRef< float > swidth
 
VaryingRef< float > twidth
 Multiplier for derivatives.
 
VaryingRef< float > time
 Time.
 
VaryingRef< float > bias
 Bias.
 
VaryingRef< float > fill
 Fill value for missing channels.
 
VaryingRef< float > missingcolor
 Color for missing texture.
 
VaryingRef< int > samples
 Number of samples.
 
float * dresultds
 Deriv of the result along s (if not NULL)
 
float * dresultdt
 Deriv of the result along t (if not NULL)
 
Wrap rwrap
 Wrap mode in the r direction.
 
VaryingRef< float > rblur
 Blur amount in the r direction.
 
VaryingRef< float > rwidth
 Multiplier for derivatives in r direction.
 
float * dresultdr
 Deriv of the result along r (if not NULL)
 

Friends

class pvt::TextureSystemImpl
 
class TextureOpt
 

Detailed Description

Encapsulate all the options needed for texture lookups. Making these options all separate parameters to the texture API routines is very ugly and also a big pain whenever we think of new options to add. So instead we collect all those little options into one structure that can just be passed by reference to the texture API routines.

Member Enumeration Documentation

Interp mode determines how we sample within a mipmap level

Enumerator:
InterpClosest 

Force closest texel.

InterpBilinear 

Force bilinear lookup within a mip level.

InterpBicubic 

Force cubic lookup within a mip level.

InterpSmartBicubic 

Bicubic when maxifying, else bilinear.

Mip mode determines if/how we use mipmaps

Enumerator:
MipModeDefault 

Default high-quality lookup.

MipModeNoMIP 

Just use highest-res image, no MIP mapping.

MipModeOneLevel 

Use just one mipmap level.

MipModeTrilinear 

Use two MIPmap levels (trilinear)

MipModeAniso 

Use two MIPmap levels w/ anisotropic.

Wrap mode describes what happens when texture coordinates describe a value outside the usual [0,1] range where a texture is defined.

Enumerator:
WrapDefault 

Use the default found in the file.

WrapBlack 

Black outside [0..1].

WrapClamp 

Clamp to [0..1].

WrapPeriodic 

Periodic mod 1.

WrapMirror 

Mirror the image.

WrapLast 

Mark the end – don't use this!

Constructor & Destructor Documentation

TextureOptions::TextureOptions ( )

Create a TextureOptions with all fields initialized to reasonable defaults.

TextureOptions::TextureOptions ( const TextureOpt opt)

Convert a TextureOpt for one point into a TextureOptions with uninform values.

Member Function Documentation

static Wrap TextureOptions::decode_wrapmode ( const char *  name)
inlinestatic

Utility: Return the Wrap enum corresponding to a wrap name: "default", "black", "clamp", "periodic", "mirror".

static void TextureOptions::parse_wrapmodes ( const char *  wrapmodes,
TextureOptions::Wrap swrapcode,
TextureOptions::Wrap twrapcode 
)
inlinestatic

Utility: Parse a single wrap mode (e.g., "periodic") or a comma-separated wrap modes string (e.g., "black,clamp") into separate Wrap enums for s and t.

Member Data Documentation

int TextureOptions::anisotropic

Maximum anisotropic ratio.

VaryingRef<float> TextureOptions::bias

Bias.

bool TextureOptions::conservative_filter

True == over-blur rather than alias.

float* TextureOptions::dresultdr

Deriv of the result along r (if not NULL)

float* TextureOptions::dresultds

Deriv of the result along s (if not NULL)

float* TextureOptions::dresultdt

Deriv of the result along t (if not NULL)

VaryingRef<float> TextureOptions::fill

Fill value for missing channels.

int TextureOptions::firstchannel

First channel of the lookup.

InterpMode TextureOptions::interpmode

Interpolation mode.

MipMode TextureOptions::mipmode

Mip mode.

VaryingRef<float> TextureOptions::missingcolor

Color for missing texture.

int TextureOptions::nchannels

Number of channels to look up.

VaryingRef<float> TextureOptions::rblur

Blur amount in the r direction.

VaryingRef<float> TextureOptions::rwidth

Multiplier for derivatives in r direction.

Wrap TextureOptions::rwrap

Wrap mode in the r direction.

VaryingRef<int> TextureOptions::samples

Number of samples.

int TextureOptions::subimage

Subimage or face ID.

ustring TextureOptions::subimagename

Subimage name.

Wrap TextureOptions::swrap

Wrap mode in the s direction.

VaryingRef<float> TextureOptions::tblur

Blur amount.

VaryingRef<float> TextureOptions::time

Time.

VaryingRef<float> TextureOptions::twidth

Multiplier for derivatives.

Wrap TextureOptions::twrap

Wrap mode in the t direction.


The documentation for this class was generated from the following file: