TK_Texture
-
class
TK_Texture Handles the TKE_Texture opcode.
TK_Textureprovides 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.
Inherits from:
BBaseOpcodeHandlerIndex
Methods
Clone()GetAlphaMapping()GetApplicationMode()GetBlueMapping()GetCamera()GetCamera()GetDecimation()GetFlags()GetGreenMapping()GetImage()GetImage()GetInterpolation()GetLayout()GetName()GetName()GetParameterFunction()GetParameterOffset()GetParameterSource()GetRedMapping()GetShaderSource()GetShaderSource()GetTiling()GetTransform()GetTransform()GetValueScale()Read()ReadAscii()Reset()set_image()set_image()set_name()set_name()set_transform()set_transform()SetAlphaMapping()SetApplicationMode()SetBlueMapping()SetCamera()SetCamera()SetDecimation()SetFlags()SetGreenMapping()SetImage()SetImage()SetInterpolation()SetLayout()SetName()SetName()SetParameterFunction()SetParameterOffset()SetParameterSource()SetRedMapping()SetShaderSource()SetShaderSource()SetTiling()SetTransform()SetTransform()SetValueScale()TK_Texture()Write()WriteAscii()~TK_Texture()
Variables
m_alpha_mappingm_apply_modem_blue_mappingm_cameram_camera_lengthm_decimationm_flagsm_green_mappingm_imagem_image_lengthm_interpolationm_layoutm_namem_name_lengthm_param_functionm_param_offsetm_param_sourcem_red_mappingm_shader_sourcem_shader_source_lengthm_source_dimensionsm_substagem_tilingm_transformm_value_scale
Methods
-
void
TK_Texture::set_name(int length) protected
for internal use only
-
void
TK_Texture::set_name(char const *name) protected
for internal use only
-
void
TK_Texture::set_image(int length) protected
for internal use only
-
void
TK_Texture::set_image(char const *image) protected
for internal use only
-
void
TK_Texture::set_transform(int length) protected
for internal use only
-
void
TK_Texture::set_transform(char const *transform) protected
for internal use only
-
TK_Texture::TK_Texture() constructor
-
TK_Texture::~TK_Texture()
-
TK_Status
TK_Texture::Read(BStreamFileToolkit &tk) 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.Parameters
tk: A reference to theBStreamFileToolkitobject.Returns
The result of the function call.
-
TK_Status
TK_Texture::Write(BStreamFileToolkit &tk) 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.Parameters
tk: A reference to theBStreamFileToolkitobject.Returns
The result of the function call.
-
TK_Status
TK_Texture::Clone(BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const const virtual
Copies the opcode handler
Parameters
tk: A reference to the
BStreamFileToolkitobject.handler: A pointer to the opcode handler object. Passed by reference.
Returns
The result of the function call.
-
TK_Status
TK_Texture::ReadAscii(BStreamFileToolkit &tk) Deprecated.
-
TK_Status
TK_Texture::WriteAscii(BStreamFileToolkit &tk) Deprecated.
-
void
TK_Texture::Reset() 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.
-
void
TK_Texture::SetName(char const *name) Sets the texture name. Allocates the buffer and copies the name string
-
void
TK_Texture::SetName(int length) Sets the texture name buffer. Allocates a buffer large enough to hold a string of ‘length’ characters
-
char const *
TK_Texture::GetName() const const
Returns the texture name
-
char *
TK_Texture::GetName() Returns the texture name buffer, which can be modified directly
-
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
-
char const *
TK_Texture::GetShaderSource() const const
Returns the texture shader source
-
char *
TK_Texture::GetShaderSource() Returns the texture shader source buffer, which can be modified directly
-
void
TK_Texture::SetImage(char const *image) Sets the image name. Allocates the buffer and copies the name string
-
void
TK_Texture::SetImage(int length) Sets the image name buffer. Allocates a buffer large enough to hold a string of ‘length’ characters
-
char const *
TK_Texture::GetImage() const const
Returns the image name
-
char *
TK_Texture::GetImage() Returns the image name buffer, which can be modified directly
-
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
-
char const *
TK_Texture::GetCamera() const const
Returns the camera segment name
-
char *
TK_Texture::GetCamera() Returns the camera segment name buffer, which can be modified directly
-
void
TK_Texture::SetFlags(int f) Sets the mask indicating which texture options are specified. Options are defined in
TKO_Texture_Option_Bits.
-
int
TK_Texture::GetFlags() const const
Returns the mask indicating which texture options are specified. Options are defined in
TKO_Texture_Option_Bits.
-
void
TK_Texture::SetParameterSource(int p) Sets the parameterization source. Options are defined in
TKO_Texture_Param_Sources
-
int
TK_Texture::GetParameterSource() const const
Returns the parameterization source. Options are defined in
TKO_Texture_Param_Sources
-
void
TK_Texture::SetInterpolation(int p) Sets the interpolation filter. Filter types are defined in
TKO_Texture_Filters.
-
int
TK_Texture::GetInterpolation() const const
Returns the interpolation filter. Filter types are defined in
TKO_Texture_Filters.
-
void
TK_Texture::SetDecimation(int p) Sets the decimation filter. Filter types are defined in
TKO_Texture_Filters.
-
int
TK_Texture::GetDecimation() const const
Returns the decimation filter. Filter types are defined in
TKO_Texture_Filters.
-
void
TK_Texture::SetRedMapping(int p) Sets the red channel mapping. Mappings are defined in
TKO_Texture_Channel_Mappings.
-
int
TK_Texture::GetRedMapping() const const
Returns the red channel mapping. Mappings are defined in
TKO_Texture_Channel_Mappings.
-
void
TK_Texture::SetGreenMapping(int p) Sets the green channel mapping. Mappings are defined in
TKO_Texture_Channel_Mappings.
-
int
TK_Texture::GetGreenMapping() const const
Returns the green channel mapping. Mappings are defined in
TKO_Texture_Channel_Mappings.
-
void
TK_Texture::SetBlueMapping(int p) Sets the blue channel mapping. Mappings are defined in
TKO_Texture_Channel_Mappings.
-
int
TK_Texture::GetBlueMapping() const const
Returns the blue channel mapping. Mappings are defined in
TKO_Texture_Channel_Mappings.
-
void
TK_Texture::SetAlphaMapping(int p) Sets the alpha channel mapping. Mappings are defined in
TKO_Texture_Channel_Mappings.
-
int
TK_Texture::GetAlphaMapping() const const
Returns the alpha channel mapping. Mappings are defined in
TKO_Texture_Channel_Mappings.
-
void
TK_Texture::SetParameterFunction(int p) Sets the parameterization function. Functions are defined in
TKO_Texture_Param_Functions.
-
int
TK_Texture::GetParameterFunction() const const
Returns the parameterization function. Functions are defined in
TKO_Texture_Param_Functions.
-
void
TK_Texture::SetLayout(int p) Sets the layout of the data in the image. Layouts are specified in
TKO_Texture_Layouts.
-
int
TK_Texture::GetLayout() const const
Returns the layout of the data in the image. Layouts are specified in
TKO_Texture_Layouts.
-
void
TK_Texture::SetTiling(int p) Sets the texture tiling mode. Tiling modes are specified in
TKO_Texture_Tilings.
-
int
TK_Texture::GetTiling() const const
Returns the texture tiling mode. Tiling modes are specified in
TKO_Texture_Tilings.
-
void
TK_Texture::SetValueScale(float v1, float v2) Sets the value scale & offset factors
-
float const *
TK_Texture::GetValueScale() const const
Returns the value scale & offset factors
-
void
TK_Texture::SetApplicationMode(int p) Sets the decal & modulate modes. Modes are specified in TKO_Texture_Application_Modes.
-
int
TK_Texture::GetApplicationMode() const const
Returns the decal & modulate mode. Tiling modes are specified in TKO_Texture_Application_Modes.
-
void
TK_Texture::SetParameterOffset(int p) Sets the parameter offset.
-
int
TK_Texture::GetParameterOffset() const const
Returns the parameter offset.
-
void
TK_Texture::SetTransform(char const *transform) Sets the name of the segment containing a texture transform matrix. Allocates the buffer and copies the string
-
void
TK_Texture::SetTransform(int length) Sets the buffer to contain the name of a transform segment. Allocates a buffer large enough to hold ‘length’ characters
-
char const *
TK_Texture::GetTransform() const const
Returns the transform segment name
-
char *
TK_Texture::GetTransform() Returns the transform segment name buffer, which may be modified directly
Variables
-
char *
TK_Texture::m_name protected
charinternal use; Texture name
-
char *
TK_Texture::m_shader_source protected
charinternal use; Shader source code (null if not a shader)
-
char *
TK_Texture::m_image protected
charinternal use; Source image name
-
char *
TK_Texture::m_camera protected
charinternal use; Camera segment name
-
int
TK_Texture::m_name_length protected
intinternal use; current name length
-
int
TK_Texture::m_shader_source_length protected
intinternal use; Shader source code length
-
int
TK_Texture::m_image_length protected
intinternal use; Current image name length
-
int
TK_Texture::m_camera_length protected
intinternal use; camera name length
-
int
TK_Texture::m_flags protected
intinternal use; Flags indicating presence of optional values
-
int
TK_Texture::m_substage protected
intinternal use: write/read progress
-
char
TK_Texture::m_param_source protected
charinternal use; Source of parameters used for texture lookup
-
char
TK_Texture::m_interpolation protected
charinternal use; Method of pixel interpolation (pixel falls between texture samples)
-
char
TK_Texture::m_decimation protected
charinternal use; Method of pixel decimation (pixel covers large portion of texture)
-
char
TK_Texture::m_red_mapping protected
charinternal use; Method for remapping red channel value
-
char
TK_Texture::m_green_mapping protected
charinternal use; Method for remapping green channel value
-
char
TK_Texture::m_blue_mapping protected
charinternal use; Method for remapping blue channel value
-
char
TK_Texture::m_alpha_mapping protected
charinternal use; Method for remapping alpha channel value
-
char
TK_Texture::m_param_function protected
charinternal use; Basic parameter remapping methods
-
char
TK_Texture::m_layout protected
charinternal use; Format of “picture” within source image
-
char
TK_Texture::m_tiling protected
charinternal use; Handling of parametric values outside 0 to 1 range
-
float
TK_Texture::m_value_scale[2] protected
floatinternal use; “Brightness & Contrast” scaling of texture values
-
int
TK_Texture::m_source_dimensions[3] protected
intinternal use; The number of images in each direction (e.g. for 3d textures)
-
char *
TK_Texture::m_transform protected
charinternal use; Segment containing transform matrix
-
char
TK_Texture::m_apply_mode protected
charinternal use; bits showing setting of decal and/or modulate
-
char
TK_Texture::m_param_offset protected
charinternal use; offset into parameter value array