TK_Image Class Reference

#include <BOpcodeHandler.h>

Inheritance diagram for TK_Image:

Inheritance graph
[legend]
Collaboration diagram for TK_Image:

Collaboration graph
[legend]
List of all members.

Detailed Description

Handles the TKE_Image opcode.

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.

Definition at line 6934 of file BOpcodeHandler.h.

Public Member Functions

 TK_Image ()
TK_Status Read (BStreamFileToolkit &tk) alter
TK_Status Write (BStreamFileToolkit &tk) alter
TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
void Reset (void) alter
void SetBytes (int size, char const *bytes=0, unsigned char data_format=TKO_Compression_None) alter
char const * GetBytes (void) const
char alter * GetBytes (void) alter
void SetName (char const *string) alter
void SetName (int length) alter
char const * GetName (void) const
char alter * GetName (void) alter
void SetReference (char const *string) alter
void SetReference (int length) alter
char const * GetReference (void) const
char alter * GetReference (void) alter
void SetPosition (float x, float y, float z) alter
void SetPosition (float const *p) alter
float const * GetPosition (void) const
void SetSize (int w, int h) alter
void SetSize (int const *s) alter
int const * GetSize (void) const
void SetFormat (int f) alter
int GetFormat (void) const
void SetOptions (int f) alter
int GetOptions (void) const
void SetCompression (int c) alter
int GetCompression (void) const

Protected Member Functions

void set_data (int size, char const *bytes=0, unsigned char data_format=TKO_Compression_None) alter
 internal use
void set_name (char const *string) alter
 internal use
void set_name (int length) alter
 internal use
TK_Status compress_image (BStreamFileToolkit &tk, int active_work_area=0) alter
 internal use
TK_Status decompress_image (BStreamFileToolkit &tk, int active_work_area=0) alter
 internal use
TK_Status read_jpeg_header (void) alter
 internal use

Protected Attributes

char * m_bytes
char * m_name
char * m_reference
float m_position [3]
int m_size [2]
int m_name_length
int m_reference_length
unsigned char m_format
unsigned char m_options
unsigned char m_compression
unsigned char m_bytes_format
float m_explicit_size [2]
unsigned char m_explicit_units [2]
TK_Image_Data_Buffer m_work_area [2]


Constructor & Destructor Documentation

TK_Image::TK_Image  ) 
 

constructor


Member Function Documentation

TK_Status TK_Image::Clone BStreamFileToolkit tk,
BBaseOpcodeHandler **  handler
const [virtual]
 

Copies the opcode handler

Parameters:
tk A reference to the BStreamFileToolkit object.
handler A pointer to the opcode handler object. Passed by reference.
Returns:
The result of the function call.

Reimplemented from BBaseOpcodeHandler.

char alter* TK_Image::GetBytes void   )  [inline]
 

Returns the address of the data buffer, which may be modified directly

Definition at line 6995 of file BOpcodeHandler.h.

char const* TK_Image::GetBytes void   )  const [inline]
 

Returns the address of the data buffer

Definition at line 6993 of file BOpcodeHandler.h.

int TK_Image::GetCompression void   )  const [inline]
 

Returns how the image data is compressed. Compression types are specified in TKO_Compression.

Definition at line 7043 of file BOpcodeHandler.h.

int TK_Image::GetFormat void   )  const [inline]
 

Returns the format of the image. Formats are specified in TKO_Image_Formats.

Definition at line 7033 of file BOpcodeHandler.h.

char alter* TK_Image::GetName void   )  [inline]
 

Returns the image name string buffer, which may be modified directly

Definition at line 7004 of file BOpcodeHandler.h.

char const* TK_Image::GetName void   )  const [inline]
 

Returns the image name string

Definition at line 7002 of file BOpcodeHandler.h.

int TK_Image::GetOptions void   )  const [inline]
 

Returns the options of the image. Options are specified in TKO_Image_Formats.

Definition at line 7038 of file BOpcodeHandler.h.

float const* TK_Image::GetPosition void   )  const [inline]
 

Returns the text position as the address of a float triplet

Definition at line 7021 of file BOpcodeHandler.h.

char alter* TK_Image::GetReference void   )  [inline]
 

Returns the reference string buffer, which may be modified directly

Definition at line 7013 of file BOpcodeHandler.h.

char const* TK_Image::GetReference void   )  const [inline]
 

Returns the reference string

Definition at line 7011 of file BOpcodeHandler.h.

int const* TK_Image::GetSize void   )  const [inline]
 

Returns the size of the image as the address of a pair of integers

Definition at line 7028 of file BOpcodeHandler.h.

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.

Parameters:
tk A reference to the BStreamFileToolkit object.
Returns:
The result of the function call.

Implements BBaseOpcodeHandler.

void TK_Image::Reset void   )  [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

Definition at line 6989 of file BOpcodeHandler.h.

void TK_Image::SetCompression int  c  )  [inline]
 

Sets how the image data is compressed. Compression types are specified in TKO_Compression.

Definition at line 7041 of file BOpcodeHandler.h.

void TK_Image::SetFormat int  f  )  [inline]
 

Sets the format of the image. Formats are specified in TKO_Image_Formats.

Definition at line 7031 of file BOpcodeHandler.h.

void TK_Image::SetName int  length  )  [inline]
 

Sets the name buffer. Allocates a buffer large enough to hold a string of 'length' characters

Definition at line 7000 of file BOpcodeHandler.h.

void TK_Image::SetName char const *  string  )  [inline]
 

Sets the name of the image. Allocates the buffer and copies the string

Definition at line 6998 of file BOpcodeHandler.h.

void TK_Image::SetOptions int  f  )  [inline]
 

Sets the options of the image. Options are specified in TKO_Image_Formats.

Definition at line 7036 of file BOpcodeHandler.h.

void TK_Image::SetPosition float const *  p  )  [inline]
 

Sets the text position using a float triplet

Definition at line 7019 of file BOpcodeHandler.h.

void TK_Image::SetPosition float  x,
float  y,
float  z
[inline]
 

Sets the text position using discrete float values

Definition at line 7016 of file BOpcodeHandler.h.

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

Definition at line 7026 of file BOpcodeHandler.h.

void TK_Image::SetSize int  w,
int  h
[inline]
 

Sets the size of the image using discrete integer values

Definition at line 7024 of file BOpcodeHandler.h.

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.

Parameters:
tk A reference to the BStreamFileToolkit object.
Returns:
The result of the function call.

Implements BBaseOpcodeHandler.


Member Data Documentation

char* TK_Image::m_bytes [protected]
 

internal use; Image data

Definition at line 6940 of file BOpcodeHandler.h.

unsigned char TK_Image::m_bytes_format [protected]
 

internal use; Indicates if input data is already compressed

Definition at line 6950 of file BOpcodeHandler.h.

unsigned char TK_Image::m_compression [protected]
 

internal use; How (or if) data is compressed in stream

Definition at line 6949 of file BOpcodeHandler.h.

float TK_Image::m_explicit_size[2] [protected]
 

internal use; non-pixel sizing

Definition at line 6951 of file BOpcodeHandler.h.

unsigned char TK_Image::m_explicit_units[2] [protected]
 

internal use; non-pixel units

Definition at line 6952 of file BOpcodeHandler.h.

unsigned char TK_Image::m_format [protected]
 

internal use; Format of data

Definition at line 6947 of file BOpcodeHandler.h.

char* TK_Image::m_name [protected]
 

internal use; name applied to image (if any)

Definition at line 6941 of file BOpcodeHandler.h.

int TK_Image::m_name_length [protected]
 

internal use; Length of name

Definition at line 6945 of file BOpcodeHandler.h.

unsigned char TK_Image::m_options [protected]
 

internal use; Extra options (named, explicit size)

Definition at line 6948 of file BOpcodeHandler.h.

float TK_Image::m_position[3] [protected]
 

internal use; Insertion point

Definition at line 6943 of file BOpcodeHandler.h.

char* TK_Image::m_reference [protected]
 

internal use; external reference to image data (if any)

Definition at line 6942 of file BOpcodeHandler.h.

int TK_Image::m_reference_length [protected]
 

internal use; Length of reference

Definition at line 6946 of file BOpcodeHandler.h.

int TK_Image::m_size[2] [protected]
 

internal use; Width & Height

Definition at line 6944 of file BOpcodeHandler.h.

TK_Image_Data_Buffer TK_Image::m_work_area[2] [protected]
 

internal use; Buffers for compression data

Definition at line 6953 of file BOpcodeHandler.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:41:43 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5