Handles the TKE_Texture opcode. More...
#include <BOpcodeHandler.h>
Public Member Functions | |
TK_Status | Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const |
int | GetAlphaMapping () const |
int | GetApplicationMode () const |
int | GetBlueMapping () const |
char const * | GetCamera () const |
char alter * | GetCamera () alter |
int | GetDecimation () const |
int | GetFlags () const |
int | GetGreenMapping () const |
char const * | GetImage () const |
char alter * | GetImage () alter |
int | GetInterpolation () const |
int | GetLayout () const |
char const * | GetName () const |
char alter * | GetName () alter |
int | GetParameterFunction () const |
int | GetParameterOffset () const |
int | GetParameterSource () const |
int | GetRedMapping () const |
char const * | GetShaderSource () const |
char alter * | GetShaderSource () alter |
int | GetTiling () const |
char const * | GetTransform () const |
char alter * | GetTransform () alter |
float const * | GetValueScale () const |
TK_Status | Read (BStreamFileToolkit &tk) alter |
TK_Status | ReadAscii (BStreamFileToolkit &tk) alter |
Deprecated. | |
void | Reset () alter |
void | SetAlphaMapping (int p) alter |
void | SetApplicationMode (int p) alter |
void | SetBlueMapping (int p) alter |
void | SetCamera (char const *camera) alter |
void | SetCamera (int length) alter |
void | SetDecimation (int p) alter |
void | SetFlags (int f) alter |
void | SetGreenMapping (int p) alter |
void | SetImage (char const *image) alter |
void | SetImage (int length) alter |
void | SetInterpolation (int p) alter |
void | SetLayout (int p) alter |
void | SetName (char const *name) alter |
void | SetName (int length) alter |
void | SetParameterFunction (int p) alter |
void | SetParameterOffset (int p) alter |
void | SetParameterSource (int p) alter |
void | SetRedMapping (int p) alter |
void | SetShaderSource (char const *shader_source) alter |
void | SetShaderSource (int length) alter |
void | SetTiling (int p) alter |
void | SetTransform (char const *transform) alter |
void | SetTransform (int length) alter |
void | SetValueScale (float v1, float v2) alter |
TK_Texture () | |
TK_Status | Write (BStreamFileToolkit &tk) alter |
TK_Status | WriteAscii (BStreamFileToolkit &tk) alter |
Deprecated. | |
![]() | |
BBaseOpcodeHandler (int op) | |
virtual TK_Status | Execute (BStreamFileToolkit &tk) alter |
char const * | GetLoggingString () const |
char alter * | GetLoggingString () alter |
virtual TK_Status | Interpret (BStreamFileToolkit &tk, ID_Key key, int variant=0) alter |
virtual TK_Status | Interpret (BStreamFileToolkit &tk, ID_Key key, char const *special) alter |
void | LogDebug (BStreamFileToolkit &tk, char const *string=0) alter |
virtual bool | Match_Instance (BStreamFileToolkit const &tk, Recorded_Instance alter *instance) alter |
virtual bool | NeedsContext (BStreamFileToolkit &tk) const |
bool | NeedsTag () const |
unsigned char | Opcode () const |
int | Pass (BStreamFileToolkit &tk) const |
void | SetLoggingString (char const *segment) alter |
void | SetLoggingString (int length) alter |
void | SetNeedsTag (bool n) alter |
TK_Status | Tag (BStreamFileToolkit &tk, int variant=-1) const |
bool | Tagging (BStreamFileToolkit &tk) const |
![]() | |
void | operator delete (void *p) |
force deallocation to happen in the stream toolkit's scope | |
void * | operator new (size_t size) |
force allocation to happen in the stream toolkit's scope | |
Protected Member Functions | |
void | set_image (int length) alter |
for internal use only | |
void | set_image (char const *image) alter |
for internal use only | |
void | set_name (int length) alter |
for internal use only | |
void | set_name (char const *name) alter |
for internal use only | |
void | set_transform (int length) alter |
for internal use only | |
void | set_transform (char const *transform) alter |
for internal use only | |
![]() | |
void | add_segment (BStreamFileToolkit &tk, ID_Key key) alter |
for internal use only | |
void | adjust_written (BStreamFileToolkit &tk, int count) alter |
for internal use only | |
void | bytes_to_floats (unsigned char const *in, float alter *out, int count) const |
for internal use only | |
void | decrease_nesting (BStreamFileToolkit &tk, int amount=1) alter |
for internal use only | |
bool | Find_Instance (BStreamFileToolkit &tk, int val1, int val2, int val3) alter |
bool | Find_Item (BStreamFileToolkit &tk, ID_Key key) const |
void | fix (int *i, int n) |
for internal use only | |
void | fix (short *s, int n) |
for internal use only | |
void | fix_in (float *f, int n) |
for internal use only | |
void | fix_out (float *f, int n) |
for internal use only | |
short | flip (short s) |
for internal use only | |
int | flip (int i) |
for internal use only | |
void | floats_to_bytes (float const *in, unsigned char alter *out, int count) const |
for internal use only | |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, int *rInts, unsigned int n) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char &value) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, char &value) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short &value) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, short &value) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, int &value) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, float &value) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, float *rFloats, unsigned int n) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, char *m_string, unsigned int n) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char *m_string, unsigned int n) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, int *rInts, unsigned int n) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, short *rShorts, unsigned int n) alter |
TK_Status | GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short *rShorts, unsigned int n) alter |
TK_Status | GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned char &value) alter |
TK_Status | GetAsciiHex (BStreamFileToolkit &tk, const char *tag, int &value) alter |
TK_Status | GetAsciiHex (BStreamFileToolkit &tk, const char *tag, char &value) alter |
TK_Status | GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned short &value) alter |
TK_Status | GetAsciiImageData (BStreamFileToolkit &tk, const char *tag, unsigned char *rValues, unsigned int n) alter |
TK_Status | GetData (BStreamFileToolkit &tk, char *b, int n) alter |
TK_Status | GetData (BStreamFileToolkit &tk, short *s, int n) alter |
TK_Status | GetData (BStreamFileToolkit &tk, int *i, int n) alter |
TK_Status | GetData (BStreamFileToolkit &tk, float *f, int n) alter |
TK_Status | GetData (BStreamFileToolkit &tk, unsigned char *b, int n) alter |
TK_Status | GetData (BStreamFileToolkit &tk, unsigned short *s, int n) alter |
TK_Status | GetData (BStreamFileToolkit &tk, unsigned int *i, int n) alter |
TK_Status | GetData (BStreamFileToolkit &tk, char &c) alter |
TK_Status | GetData (BStreamFileToolkit &tk, short &s) alter |
TK_Status | GetData (BStreamFileToolkit &tk, int &i) alter |
TK_Status | GetData (BStreamFileToolkit &tk, unsigned char &b) alter |
TK_Status | GetData (BStreamFileToolkit &tk, unsigned short &s) alter |
TK_Status | GetData (BStreamFileToolkit &tk, unsigned int &i) alter |
TK_Status | GetData (BStreamFileToolkit &tk, float &f) alter |
void | increase_nesting (BStreamFileToolkit &tk, int amount=1) alter |
for internal use only | |
ID_Key | last_key (BStreamFileToolkit &tk) const |
obsolete | |
void | log_opcode (BStreamFileToolkit &tk, unsigned int sequence, unsigned char opcode) alter |
for internal use only | |
TK_Status | LookatData (BStreamFileToolkit &tk, unsigned char &b) alter |
BBaseOpcodeHandler alter * | Opcode_Handler (BStreamFileToolkit &tk, unsigned char op) const |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const *b, int n) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const *s, int n) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const *i, int n) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const *f, int n) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const *b, int n) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const *s, int n) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const *i, int n) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const &c) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const &s) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const &i) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const &b) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const &s) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const &i) alter |
TK_Status | PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const &f) alter |
TK_Status | PutAsciiFlag (BStreamFileToolkit &tk, char const *tag, int const &i) alter |
TK_Status | PutAsciiHex (BStreamFileToolkit &tk, char const *tag, int const &i) alter |
TK_Status | PutAsciiMask (BStreamFileToolkit &tk, char const *tag, int const &i) alter |
TK_Status | PutAsciiOpcode (BStreamFileToolkit &tk, int adjust=1, bool is_end=false, bool want_newline=true) alter |
TK_Status | PutData (BStreamFileToolkit &tk, char const *b, int n) alter |
TK_Status | PutData (BStreamFileToolkit &tk, short const *s, int n) alter |
TK_Status | PutData (BStreamFileToolkit &tk, int const *i, int n) alter |
TK_Status | PutData (BStreamFileToolkit &tk, float const *f, int n) alter |
TK_Status | PutData (BStreamFileToolkit &tk, unsigned char const *b, int n) alter |
TK_Status | PutData (BStreamFileToolkit &tk, unsigned short const *s, int n) alter |
TK_Status | PutData (BStreamFileToolkit &tk, unsigned int const *i, int n) alter |
TK_Status | PutData (BStreamFileToolkit &tk, char const &c) alter |
TK_Status | PutData (BStreamFileToolkit &tk, short const &s) alter |
TK_Status | PutData (BStreamFileToolkit &tk, int const &i) alter |
TK_Status | PutData (BStreamFileToolkit &tk, unsigned char const &b) alter |
TK_Status | PutData (BStreamFileToolkit &tk, unsigned short const &s) alter |
TK_Status | PutData (BStreamFileToolkit &tk, unsigned int const &i) alter |
TK_Status | PutData (BStreamFileToolkit &tk, float const &f) alter |
TK_Status | PutEndXMLTag (BStreamFileToolkit &tk, char const *tag) alter |
TK_Status | PutOpcode (BStreamFileToolkit &tk, int adjust=1) alter |
TK_Status | PutStartXMLTag (BStreamFileToolkit &tk, char const *tag) alter |
TK_Status | Read_Referenced_Segment (BStreamFileToolkit &tk, int &i_progress) alter |
TK_Status | ReadAsciiLine (BStreamFileToolkit &tk, unsigned int *readSize=0) alter |
TK_Status | ReadAsciiWord (BStreamFileToolkit &tk, unsigned int *readSize=0) alter |
TK_Status | ReadEndOpcode (BStreamFileToolkit &tk) alter |
void | Record_Instance (BStreamFileToolkit &tk, ID_Key key, int variant, int val1, int val2, int val3) const |
void | Remember_Item (BStreamFileToolkit &tk, ID_Key key) const |
ID_Key | remove_segment (BStreamFileToolkit &tk) alter |
for internal use only | |
bool | RemoveAngularBrackets (char *string) alter |
bool | RemoveQuotes (char *string) alter |
void | Revisit (BStreamFileToolkit &tk, float priority=0.0f, int variant=0) const |
void | set_last_key (BStreamFileToolkit &tk, ID_Key key) alter |
sets the given key as "most recent" on the toolkit for the purposes of associating keys with indices | |
TK_Status | SkipNewlineAndTabs (BStreamFileToolkit &tk, unsigned int *readSize=0) alter |
bool | validate_count (int count, int limit=1<< 24) const |
Protected Attributes | |
char | m_alpha_mapping |
char | m_apply_mode |
char | m_blue_mapping |
char * | m_camera |
int | m_camera_length |
char | m_decimation |
int | m_flags |
char | m_green_mapping |
char * | m_image |
int | m_image_length |
char | m_interpolation |
char | m_layout |
char * | m_name |
int | m_name_length |
char | m_param_function |
char | m_param_offset |
char | m_param_source |
char | m_red_mapping |
char * | m_shader_source |
int | m_shader_source_length |
int | m_source_dimensions [3] |
int | m_substage |
char | m_tiling |
char * | m_transform |
float | m_value_scale [2] |
![]() | |
char * | m_ascii_buffer |
int | m_ascii_length |
int | m_ascii_progress |
Tracks the amount of data that has been read/written so far by GetAscii functions. | |
int | m_ascii_size |
int | m_ascii_stage |
unsigned char | m_byte |
temporary | |
char | m_char |
temporary | |
int | m_debug_allocated |
int | m_debug_length |
char * | m_debug_string |
int | m_int |
temporary | |
bool | m_needs_tag |
Indicate if this object explicitly needs tagging. | |
unsigned char | m_opcode |
The opcode being handled by this particular object. | |
int | m_progress |
Tracks the amount of data that has been read/written so far. | |
int | m_stage |
The writing stage. | |
unsigned short | m_unsigned_short |
temporary | |
Additional Inherited Members | |
![]() | |
static float | read_float (char const *cp, char const *alter *newcpp=0) |
static float | read_float (char const *cp, char alter *alter *newcpp) |
for internal use only | |
static char * | write_float (char *buffer, double f) |
for internal use only | |
Handles the TKE_Texture opcode.
TK_Texture provides support for writing/reading the TKE_Texture opcode object to/from an HSF file.
The HOOPS/3dGS scene-graph supports 'textures', which define an image that can be applied to a HOOPS/3dGS shell or mesh primitive.
|
inline |
constructor
|
virtual |
Copies the opcode handler
tk | A reference to the BStreamFileToolkit object. |
handler | A pointer to the opcode handler object. Passed by reference. |
Reimplemented from BBaseOpcodeHandler.
|
inline |
Returns the alpha channel mapping. Mappings are defined in TKO_Texture_Channel_Mappings.
|
inline |
Returns the decal & modulate mode. Tiling modes are specified in TKO_Texture_Application_Modes.
|
inline |
Returns the blue channel mapping. Mappings are defined in TKO_Texture_Channel_Mappings.
|
inline |
Returns the camera segment name
|
inline |
Returns the camera segment name buffer, which can be modified directly
|
inline |
Returns the decimation filter. Filter types are defined in TKO_Texture_Filters.
|
inline |
Returns the mask indicating which texture options are specified. Options are defined in TKO_Texture_Option_Bits.
|
inline |
Returns the green channel mapping. Mappings are defined in TKO_Texture_Channel_Mappings.
|
inline |
Returns the image name
|
inline |
Returns the image name buffer, which can be modified directly
|
inline |
Returns the interpolation filter. Filter types are defined in TKO_Texture_Filters.
|
inline |
Returns the layout of the data in the image. Layouts are specified in TKO_Texture_Layouts.
|
inline |
Returns the texture name
|
inline |
Returns the texture name buffer, which can be modified directly
|
inline |
Returns the parameterization function. Functions are defined in TKO_Texture_Param_Functions.
|
inline |
Returns the parameter offset.
|
inline |
Returns the parameterization source. Options are defined in TKO_Texture_Param_Sources
|
inline |
Returns the red channel mapping. Mappings are defined in TKO_Texture_Channel_Mappings.
|
inline |
Returns the texture shader source
|
inline |
Returns the texture shader source buffer, which can be modified directly
|
inline |
Returns the texture tiling mode. Tiling modes are specified in TKO_Texture_Tilings.
|
inline |
Returns the transform segment name
|
inline |
Returns the transform segment name buffer, which may be modified directly
|
inline |
Returns the value scale & offset factors
|
virtual |
Reads data from the toolkit buffer, decodes/decompresses it, and maps it to the opcode handlers data members. User-defined classes which need to write out custom data should utilize one of the available GetData() methods.
tk | A reference to the BStreamFileToolkit object. |
Implements BBaseOpcodeHandler.
|
virtual |
Resets the current opcode handler. This is called by the toolkit when it is done processing an opcode. This method reinitializes any opcode handler variables and frees up temporary data.
Reimplemented from BBaseOpcodeHandler.
|
inline |
Sets the alpha channel mapping. Mappings are defined in TKO_Texture_Channel_Mappings.
|
inline |
Sets the decal & modulate modes. Modes are specified in TKO_Texture_Application_Modes.
|
inline |
Sets the blue channel mapping. Mappings are defined in TKO_Texture_Channel_Mappings.
void TK_Texture::SetCamera | ( | char const * | camera | ) |
Sets the camera segment name. Allocates the buffer and copies the name string
void TK_Texture::SetCamera | ( | int | length | ) |
Sets the camera segment name buffer. Allocates a buffer large enough to hold a string of 'length' characters
|
inline |
Sets the decimation filter. Filter types are defined in TKO_Texture_Filters.
|
inline |
Sets the mask indicating which texture options are specified. Options are defined in TKO_Texture_Option_Bits.
References TKO_Texture_Extended.
|
inline |
Sets the green channel mapping. Mappings are defined in TKO_Texture_Channel_Mappings.
|
inline |
Sets the image name. Allocates the buffer and copies the name string
|
inline |
Sets the image name buffer. Allocates a buffer large enough to hold a string of 'length' characters
|
inline |
Sets the interpolation filter. Filter types are defined in TKO_Texture_Filters.
|
inline |
Sets the layout of the data in the image. Layouts are specified in TKO_Texture_Layouts.
|
inline |
Sets the texture name. Allocates the buffer and copies the name string
|
inline |
Sets the texture name buffer. Allocates a buffer large enough to hold a string of 'length' characters
|
inline |
Sets the parameterization function. Functions are defined in TKO_Texture_Param_Functions.
|
inline |
Sets the parameter offset.
|
inline |
Sets the parameterization source. Options are defined in TKO_Texture_Param_Sources
|
inline |
Sets the red channel mapping. Mappings are defined in TKO_Texture_Channel_Mappings.
void TK_Texture::SetShaderSource | ( | char const * | shader_source | ) |
Sets the texture shader source. Allocates the buffer and copies the shader source string
void TK_Texture::SetShaderSource | ( | int | length | ) |
Sets the texture shader source buffer. Allocates a buffer large enough to hold a string of 'length' characters
|
inline |
Sets the texture tiling mode. Tiling modes are specified in TKO_Texture_Tilings.
|
inline |
Sets the name of the segment containing a texture transform matrix. Allocates the buffer and copies the string
|
inline |
Sets the buffer to contain the name of a transform segment. Allocates a buffer large enough to hold 'length' characters
|
inline |
Sets the value scale & offset factors
|
virtual |
Encodes/compresses data and writes data to the toolkit buffer. User-defined classes which need to write out custom data should utilize one of the available PutData() methods, and first write out the opcode associated with the group of binary data followed by the data itself.
tk | A reference to the BStreamFileToolkit object. |
Implements BBaseOpcodeHandler.
|
protected |
internal use; Method for remapping alpha channel value
|
protected |
internal use; bits showing setting of decal and/or modulate
|
protected |
internal use; Method for remapping blue channel value
|
protected |
internal use; Camera segment name
|
protected |
internal use; camera name length
|
protected |
internal use; Method of pixel decimation (pixel covers large portion of texture)
|
protected |
internal use; Flags indicating presence of optional values
|
protected |
internal use; Method for remapping green channel value
|
protected |
internal use; Source image name
|
protected |
internal use; Current image name length
|
protected |
internal use; Method of pixel interpolation (pixel falls between texture samples)
|
protected |
internal use; Format of "picture" within source image
|
protected |
internal use; Texture name
|
protected |
internal use; current name length
|
protected |
internal use; Basic parameter remapping methods
|
protected |
internal use; offset into parameter value array
|
protected |
internal use; Source of parameters used for texture lookup
|
protected |
internal use; Method for remapping red channel value
|
protected |
internal use; Shader source code (null if not a shader)
|
protected |
internal use; Shader source code length
|
protected |
internal use; The number of images in each direction (e.g. for 3d textures)
|
protected |
internal use: write/read progress
|
protected |
internal use; Handling of parametric values outside 0 to 1 range
|
protected |
internal use; Segment containing transform matrix
|
protected |
internal use; "Brightness & Contrast" scaling of texture values