Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions

SoColTabMultiTexture2 Class Reference

List of all members.

Public Types

enum  Operator { BLEND, ADD, REPLACE }
enum  Component { RED = 1, GREEN = 2, BLUE = 4, OPACITY = 8 }

Public Member Functions

 SoColTabMultiTexture2 ()
void GLRender (SoGLRenderAction *)
void callback (SoCallbackAction *)
void rayPick (SoRayPickAction *)
void setNrThreads (int)

Static Public Member Functions

static void initClass ()
static int getMaxSize ()

Public Attributes

SoMFImagei32 image
SoMFShort numcolor
SoMFShort opacity
SoSFImage colors
SoMFEnum operation
SoMFShort component
SoMFBool enabled
SoSFColor blendColor
SoSFEnum wrapS
SoSFEnum wrapT
SoSFEnum model

Protected Member Functions

void doAction (SoAction *)
 ~SoColTabMultiTexture2 ()
const unsigned char * createImage (SbVec2s &, int &)

Static Protected Member Functions

static void imageChangeCB (void *, SoSensor *)
static bool findTransperancy (const unsigned char *colors, int ncol, int nc, const unsigned char *idxs=0, int nidx=0)

Protected Attributes

SoFieldSensor * imagesensor_
SoFieldSensor * numcolorsensor_
SoFieldSensor * colorssensor_
SoFieldSensor * operationsensor_
SoFieldSensor * componentsensor_
SoFieldSensor * enabledsensor_
SoFieldSensor * opacitysensor_
SbMutex * glimagemutex_
bool glimagevalid_
SoGLImage * glimage_
const unsigned char * imagedata_
SbVec2s imagesize_
int imagenc_
int nrthreads_

Private Member Functions

 SO_NODE_HEADER (SoColTabMultiTexture2)

Detailed Description

SoColTabMultiTexture2 combines one or more textures of the same size into one. All textures are put in a sequence in SoColTabMultiTexture2::image, and the sequence is processed from the start to the end to create one texture.


Member Enumeration Documentation

Specifies which components that are affected by the current texture.

Enumerator:
RED 
GREEN 
BLUE 
OPACITY 

Specifies how a texture should interact with the previous texture(s).

Enumerator:
BLEND 

The current texture is mixed with the previous texture(s) depending on the value of the opacity component.

ADD 

The average between the previous texture(s) and the current texture is taken.

REPLACE 

The old texture(s) is replaced by the current one.


Constructor & Destructor Documentation

SoColTabMultiTexture2::SoColTabMultiTexture2 (  ) 
SoColTabMultiTexture2::~SoColTabMultiTexture2 (  )  [protected]

Member Function Documentation

void SoColTabMultiTexture2::callback ( SoCallbackAction *   ) 
const unsigned char* SoColTabMultiTexture2::createImage ( SbVec2s &  ,
int &   
) [protected]
void SoColTabMultiTexture2::doAction ( SoAction *   )  [protected]
static bool SoColTabMultiTexture2::findTransperancy ( const unsigned char *  colors,
int  ncol,
int  nc,
const unsigned char *  idxs = 0,
int  nidx = 0 
) [static, protected]

Checks if any of the colors in colors has a transparency. If idxs and nidx are set, only the colors that are indexed by idxs are checked.

static int SoColTabMultiTexture2::getMaxSize (  )  [static]
void SoColTabMultiTexture2::GLRender ( SoGLRenderAction *   ) 
static void SoColTabMultiTexture2::imageChangeCB ( void *  ,
SoSensor *   
) [static, protected]
static void SoColTabMultiTexture2::initClass (  )  [static]
void SoColTabMultiTexture2::rayPick ( SoRayPickAction *   ) 
void SoColTabMultiTexture2::setNrThreads ( int   ) 
Note:
Must be called before first GLRender.
SoColTabMultiTexture2::SO_NODE_HEADER ( SoColTabMultiTexture2   )  [private]

Member Data Documentation

See SoTexture2 for documentation.

Colortables for all images. The colortable for image N starts at index=numcolor[0] + numcolor[1] + numcolor[2] + ... + numcolor[N-2] + numcolor[N-1] .

SoFieldSensor* SoColTabMultiTexture2::colorssensor_ [protected]

Component for each image.

SoFieldSensor* SoColTabMultiTexture2::componentsensor_ [protected]
SoFieldSensor* SoColTabMultiTexture2::enabledsensor_ [protected]
SoGLImage* SoColTabMultiTexture2::glimage_ [protected]

The images themselves.

const unsigned char* SoColTabMultiTexture2::imagedata_ [protected]
SoFieldSensor* SoColTabMultiTexture2::imagesensor_ [protected]
SbVec2s SoColTabMultiTexture2::imagesize_ [protected]

See SoTexture2 for documentation.

Number of colors in colortable for each image. If nonzero, the corresponding image must be 1 byte per pixel and map to the colortable.

SoFieldSensor* SoColTabMultiTexture2::numcolorsensor_ [protected]

Specifies the maximum opacity of each image. 0 is completely transperant, 255 is completely opaque.

SoFieldSensor* SoColTabMultiTexture2::opacitysensor_ [protected]

Operation for each image.

SoFieldSensor* SoColTabMultiTexture2::operationsensor_ [protected]

See SoTexture2 for documentation.

See SoTexture2 for documentation.