#include <BOpcodeHandler.h>
Public Member Functions | |
TK_Status | Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const |
TK_Status | compress_image_ascii (BStreamFileToolkit &tk) |
char * | GetBytes () |
char const * | GetBytes () const |
int | GetCompression () const |
double const * | GetDPosition () const |
int | GetFormat () const |
char * | GetName () |
char const * | GetName () const |
int | GetOptions () const |
float const * | GetPosition () const |
char * | GetReference () |
char const * | GetReference () const |
int const * | GetSize () const |
TK_Status | Read (BStreamFileToolkit &tk) |
TK_Status | ReadAscii (BStreamFileToolkit &tk) |
Deprecated. | |
void | Reset () |
void | SetBytes (int size, char const *bytes=0, unsigned char data_format=TKO_Compression_None) |
void | SetCompression (int c) |
void | SetDPosition (double const *p) |
void | SetDPosition (double x, double y, double z) |
void | SetFormat (int f) |
void | SetName (int length) |
void | SetName (char const *string) |
void | SetOptions (int f) |
void | SetPosition (float const *p) |
void | SetPosition (float x, float y, float z) |
void | SetReference (int length) |
void | SetReference (char const *string) |
void | SetSize (int const *s) |
void | SetSize (int w, int h) |
TK_Image () | |
TK_Status | Write (BStreamFileToolkit &tk) |
TK_Status | WriteAscii (BStreamFileToolkit &tk) |
Deprecated. | |
Protected Member Functions | |
TK_Status | compress_image (BStreamFileToolkit &tk, int active_work_area=0) |
internal use | |
TK_Status | decompress_image (BStreamFileToolkit &tk, int active_work_area=0) |
internal use | |
TK_Status | read_jpeg_header () |
internal use | |
void | set_data (int size, char const *bytes=0, unsigned char data_format=TKO_Compression_None) |
internal use | |
void | set_name (int length) |
internal use | |
void | set_name (char const *string) |
internal use | |
Protected Attributes | |
char * | m_bytes |
unsigned char | m_bytes_format |
unsigned char | m_compression |
float | m_compression_quality |
int | m_data_size |
double | m_dposition [3] |
float | m_explicit_size [2] |
unsigned char | m_explicit_units [2] |
unsigned char | m_format |
bool | m_jpeg_native |
char * | m_name |
int | m_name_length |
unsigned int | m_options |
float | m_position [3] |
char * | m_reference |
int | m_reference_length |
int | m_size [2] |
TK_Image_Data_Buffer | m_work_area [2] |
TK_Image provides support for writing/reading the TKE_Image opcode object to/from an HSF file.
The HOOPS/3dGS scene-graph supports 'image' primitives which are defined by a position, size (width and height), and an array of bytes which is interpretted according to the specified format.
TK_Image::TK_Image | ( | ) |
constructor
TK_Status TK_Image::Clone | ( | BStreamFileToolkit & | tk, | |
BBaseOpcodeHandler ** | handler | |||
) | const [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.
Reimplemented in HTK_Image.
char* TK_Image::GetBytes | ( | ) | [inline] |
Returns the address of the data buffer, which may be modified directly
char const* TK_Image::GetBytes | ( | ) | const [inline] |
Returns the address of the data buffer
int TK_Image::GetCompression | ( | ) | const [inline] |
Returns how the image data is compressed. Compression types are specified in TKO_Compression.
double const* TK_Image::GetDPosition | ( | ) | const [inline] |
Returns the text position as the address of a float triplet
int TK_Image::GetFormat | ( | ) | const [inline] |
Returns the format of the image. Formats are specified in TKO_Image_Formats.
char* TK_Image::GetName | ( | ) | [inline] |
Returns the image name string buffer, which may be modified directly
char const* TK_Image::GetName | ( | ) | const [inline] |
Returns the image name string
int TK_Image::GetOptions | ( | ) | const [inline] |
Returns the options of the image. Options are specified in TKO_Image_Formats.
float const* TK_Image::GetPosition | ( | ) | const [inline] |
Returns the text position as the address of a float triplet
char* TK_Image::GetReference | ( | ) | [inline] |
Returns the reference string buffer, which may be modified directly
char const* TK_Image::GetReference | ( | ) | const [inline] |
Returns the reference string
int const* TK_Image::GetSize | ( | ) | const [inline] |
Returns the size of the image as the address of a pair of integers
TK_Status TK_Image::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.
tk | A reference to the BStreamFileToolkit object. |
Implements BBaseOpcodeHandler.
void TK_Image::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.
Reimplemented from BBaseOpcodeHandler.
void TK_Image::SetBytes | ( | int | size, | |
char const * | bytes = 0 , |
|||
unsigned char | data_format = TKO_Compression_None | |||
) | [inline] |
Sets the image data. Allocates a buffer which can hold 'size' bytes, and if specified, copies the data from 'bytes' to the buffer
void TK_Image::SetCompression | ( | int | c | ) | [inline] |
Sets how the image data is compressed. Compression types are specified in TKO_Compression.
void TK_Image::SetDPosition | ( | double const * | p | ) | [inline] |
Sets the text position using a float triplet
void TK_Image::SetDPosition | ( | double | x, | |
double | y, | |||
double | z | |||
) | [inline] |
Sets the text position using discrete double values
void TK_Image::SetFormat | ( | int | f | ) | [inline] |
Sets the format of the image. Formats are specified in TKO_Image_Formats.
References TKO_Image_Format_Mask.
void TK_Image::SetName | ( | int | length | ) | [inline] |
Sets the name buffer. Allocates a buffer large enough to hold a string of 'length' characters
void TK_Image::SetName | ( | char const * | string | ) | [inline] |
Sets the name of the image. Allocates the buffer and copies the string
void TK_Image::SetOptions | ( | int | f | ) | [inline] |
Sets the options of the image. Options are specified in TKO_Image_Formats.
References TKO_Image_Options_Mask.
void TK_Image::SetPosition | ( | float const * | p | ) | [inline] |
Sets the text position using a float triplet
void TK_Image::SetPosition | ( | float | x, | |
float | y, | |||
float | z | |||
) | [inline] |
Sets the text position using discrete float values
void TK_Image::SetReference | ( | int | length | ) |
Sets the reference buffer. Allocates a buffer large enough to hold a string of 'length' characters
void TK_Image::SetReference | ( | char const * | string | ) |
Sets the reference to the image data. Allocates the buffer and copies the string
void TK_Image::SetSize | ( | int const * | s | ) | [inline] |
Sets the size of the image using an array of integer values
void TK_Image::SetSize | ( | int | w, | |
int | h | |||
) | [inline] |
Sets the size of the image using discrete integer values
TK_Status TK_Image::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.
tk | A reference to the BStreamFileToolkit object. |
Implements BBaseOpcodeHandler.
char* TK_Image::m_bytes [protected] |
internal use; Image data
unsigned char TK_Image::m_bytes_format [protected] |
internal use; Indicates if input data is already compressed
unsigned char TK_Image::m_compression [protected] |
internal use; How (or if) data is compressed in stream
float TK_Image::m_compression_quality [protected] |
internal use; Hint to the graphics system on how much to compress.
int TK_Image::m_data_size [protected] |
internal use; Explicit length of data block used only for precompressed images (dxt or jpeg) passed straight through.
double TK_Image::m_dposition[3] [protected] |
internal use; Insertion point
float TK_Image::m_explicit_size[2] [protected] |
internal use; non-pixel sizing
unsigned char TK_Image::m_explicit_units[2] [protected] |
internal use; non-pixel units
unsigned char TK_Image::m_format [protected] |
internal use; Format of data
bool TK_Image::m_jpeg_native [protected] |
TK_Image subclasses which talk to graphics systems that are able to insert jpeg directly should set this to true
char* TK_Image::m_name [protected] |
internal use; name applied to image (if any)
int TK_Image::m_name_length [protected] |
internal use; Length of name
unsigned int TK_Image::m_options [protected] |
internal use; Extra options (named, explicit size)
float TK_Image::m_position[3] [protected] |
internal use; Insertion point
char* TK_Image::m_reference [protected] |
internal use; external reference to image data (if any)
int TK_Image::m_reference_length [protected] |
internal use; Length of reference
int TK_Image::m_size[2] [protected] |
internal use; Width & Height
TK_Image_Data_Buffer TK_Image::m_work_area[2] [protected] |
internal use; Buffers for compression data