HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TextureOpt Class Reference

#include <texture.h>

Public Types

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

Public Member Functions

 TextureOpt ()
 
 TextureOpt (const TextureOptions &opt, int index)
 

Static Public Member Functions

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

Public Attributes

int firstchannel
 First channel of the lookup. More...
 
int subimage
 Subimage or face ID. More...
 
ustring subimagename
 Subimage name. More...
 
Wrap swrap
 Wrap mode in the s direction. More...
 
Wrap twrap
 Wrap mode in the t direction. More...
 
MipMode mipmode
 Mip mode. More...
 
InterpMode interpmode
 Interpolation mode. More...
 
int anisotropic
 Maximum anisotropic ratio. More...
 
bool conservative_filter
 True == over-blur rather than alias. More...
 
float sblur
 
float tblur
 Blur amount. More...
 
float swidth
 
float twidth
 Multiplier for derivatives. More...
 
float fill
 Fill value for missing channels. More...
 
const float * missingcolor
 Color for missing texture. More...
 
float time
 Time (for time-dependent texture lookups) More...
 
float bias
 Bias for shadows. More...
 
int samples
 Number of samples for shadows. More...
 
Wrap rwrap
 Wrap mode in the r direction. More...
 
float rblur
 Blur amount in the r direction. More...
 
float rwidth
 Multiplier for derivatives in r direction. More...
 

Friends

class pvt::TextureSystemImpl
 

Detailed Description

TextureOpt is a structure that holds many options controlling single-point texture lookups. Because each texture lookup API call takes a reference to a TextureOpt, the call signatures remain uncluttered rather than having an ever-growing list of parameters, most of which will never vary from their defaults.

Definition at line 171 of file texture.h.

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.

Definition at line 198 of file texture.h.

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.

Definition at line 188 of file texture.h.

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.

WrapPeriodicPow2 
WrapPeriodicSharedBorder 
WrapLast 

Definition at line 175 of file texture.h.

Constructor & Destructor Documentation

TextureOpt::TextureOpt ( )
inline

Create a TextureOpt with all fields initialized to reasonable defaults.

Definition at line 208 of file texture.h.

TextureOpt::TextureOpt ( const TextureOptions opt,
int  index 
)

Convert a TextureOptions for one index into a TextureOpt.

Member Function Documentation

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

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

Definition at line 250 of file texture.h.

static Wrap TextureOpt::decode_wrapmode ( ustring  name)
inlinestatic

Definition at line 254 of file texture.h.

static void TextureOpt::parse_wrapmodes ( const char *  wrapmodes,
TextureOpt::Wrap swrapcode,
TextureOpt::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.

Definition at line 262 of file texture.h.

Friends And Related Function Documentation

friend class pvt::TextureSystemImpl
friend

Definition at line 274 of file texture.h.

Member Data Documentation

int TextureOpt::anisotropic

Maximum anisotropic ratio.

Definition at line 233 of file texture.h.

float TextureOpt::bias

Bias for shadows.

Definition at line 240 of file texture.h.

bool TextureOpt::conservative_filter

True == over-blur rather than alias.

Definition at line 234 of file texture.h.

float TextureOpt::fill

Fill value for missing channels.

Definition at line 237 of file texture.h.

int TextureOpt::firstchannel

First channel of the lookup.

Definition at line 226 of file texture.h.

InterpMode TextureOpt::interpmode

Interpolation mode.

Definition at line 232 of file texture.h.

MipMode TextureOpt::mipmode

Mip mode.

Definition at line 231 of file texture.h.

const float* TextureOpt::missingcolor

Color for missing texture.

Definition at line 238 of file texture.h.

float TextureOpt::rblur

Blur amount in the r direction.

Definition at line 245 of file texture.h.

float TextureOpt::rwidth

Multiplier for derivatives in r direction.

Definition at line 246 of file texture.h.

Wrap TextureOpt::rwrap

Wrap mode in the r direction.

Definition at line 244 of file texture.h.

int TextureOpt::samples

Number of samples for shadows.

Definition at line 241 of file texture.h.

float TextureOpt::sblur

Definition at line 235 of file texture.h.

int TextureOpt::subimage

Subimage or face ID.

Definition at line 227 of file texture.h.

ustring TextureOpt::subimagename

Subimage name.

Definition at line 228 of file texture.h.

float TextureOpt::swidth

Definition at line 236 of file texture.h.

Wrap TextureOpt::swrap

Wrap mode in the s direction.

Definition at line 229 of file texture.h.

float TextureOpt::tblur

Blur amount.

Definition at line 235 of file texture.h.

float TextureOpt::time

Time (for time-dependent texture lookups)

Definition at line 239 of file texture.h.

float TextureOpt::twidth

Multiplier for derivatives.

Definition at line 236 of file texture.h.

Wrap TextureOpt::twrap

Wrap mode in the t direction.

Definition at line 230 of file texture.h.


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