WT_Image Class Reference
[Drawable objects]

#include <image.h>

Inheritance diagram for WT_Image:

Inheritance graph
[legend]
Collaboration diagram for WT_Image:

Collaboration graph
[legend]
List of all members.

Detailed Description

A drawable describing an image (bitonal, color mapped, RGB, RGBA, JPEG.).

An example of creating all of the different image types is provided in the sample app W2DTest accompanying the WHIP! Toolkit source distribution. It is too lengthy to be included here in this API doc.

Definition at line 74 of file image.h.

Public Types

enum  WT_Image_Format
 The format of the image contained in the WT_Image object.
enum  

Public Member Functions

 WT_Image (WT_Image const &)
WT_Imageoperator= (WT_Image const &)
 WT_Image ()
 Constructs a WT_Image object.
 WT_Image (int image_type)
 Constructs a WT_Image object of the given type (one of enum WT_Image_Format.).
 WT_Image (WT_Unsigned_Integer16 rows, WT_Unsigned_Integer16 columns, WT_Image_Format format, WT_Integer32 identifier, WT_Color_Map const *color_map, WT_Integer32 data_size, WT_Byte *data, WT_Logical_Point const &min_corner, WT_Logical_Point const &max_corner, WT_Boolean copy, WT_Integer32 dpi=-1) throw (WT_Result)
 Constructs a WT_Image object with the given data.
virtual ~WT_Image ()
 Destroys a WT_Image object.
WT_Color_Map const * color_map () const
 Returns the color map associated with this image (if any.).
WT_Unsigned_Integer16 columns () const
 Returns the width of the image in pixels.
WT_Unsigned_Integer16columns ()
WT_Byte const * data () const
 Returns the raw pixel data.
WT_Integer32 data_size () const
 Returns the size (in bytes) of the raw pixel data available through the data() method.
WT_Byte format () const
 Returns the WT_Image_Format value for this image.
WT_Byteformat ()
WT_Integer32 identifier () const
 Returns the unique image number.
WT_Integer32 const & dpi () const
WT_Integer32dpi ()
WT_Logical_Point const & max_corner () const
 The upper-right corner of the image.
WT_Logical_Pointmax_corner ()
WT_Logical_Point const & min_corner () const
 The lower-left corner of the image.
WT_Logical_Pointmin_corner ()
WT_Unsigned_Integer16 rows () const
 The height of the image in pixels.
WT_Unsigned_Integer16rows ()
WT_Result convert_bitonal_to_group_3X ()
 Converts the current bitonal image to a Group3X_Mapped image.
WT_Result convert_group_3X_to_bitonal ()
 Converts the current Group3X_Mapped image to a bitonal image.
WT_Result convert_group_3X_to_mapped ()
 Converts the current Group3X_Mapped image to a Mapped image.
virtual void de_relativize (WT_File &file)
 Returns the min and max corner points to absolute values based on their relative positions to last materialized point.
virtual void relativize (WT_File &file)
 Relativizes the min and max corner points to the last serialized point.
virtual void transform (WT_Transform const &transform)
 Applies the given transform to the min and max corner points.
WT_ID object_id () const
 Returns the WT_ID for this object.
WT_Result serialize (WT_File &file) const
 Causes the serialization of the object to the file.
WT_Result materialize (WT_Opcode const &opcode, WT_File &file)
 Materializes the contents of the object from the file and the given opcode.
WT_Result skip_operand (WT_Opcode const &opcode, WT_File &file)
 Causes the file reading to proceed to the end of this object.
WT_Result process (WT_File &file)
 Calls the configured action handler for this object (passes in the file reference.).
virtual void update_bounds (WT_File *file)
 Forces the drawable bounds to be updated.

Static Public Member Functions

static WT_Result default_process (WT_Image &item, WT_File &file)
 Provides a default action handler for this object.

Public Attributes

WT_Unsigned_Integer16 m_rows
WT_Unsigned_Integer16 m_columns
WT_Byte m_format
WT_Integer32 m_identifier
WT_Integer32 m_dpi
WT_Color_Mapm_color_map
WT_Integer32 m_data_size
WT_Bytem_data
WT_Logical_Point m_min_corner
WT_Logical_Point m_max_corner
WT_Boolean m_transformed
WT_Boolean m_relativized
WT_Boolean m_local_data_copy
WT_Boolean m_local_color_map_copy
WT_Bytem_source_data
int m_src_byte_position
int m_src_bits_used
int m_dst_bits_used
int m_data_allocated
WT_Opcode m_colormap_opcode

Friends

class WT_W2D_Class_Factory
class WT_Opcode


Constructor & Destructor Documentation

WT_Image::WT_Image WT_Unsigned_Integer16  rows,
WT_Unsigned_Integer16  columns,
WT_Image_Format  format,
WT_Integer32  identifier,
WT_Color_Map const *  color_map,
WT_Integer32  data_size,
WT_Byte data,
WT_Logical_Point const &  min_corner,
WT_Logical_Point const &  max_corner,
WT_Boolean  copy,
WT_Integer32  dpi = -1
throw (WT_Result)
 

Constructs a WT_Image object with the given data.

Parameters:
rows  Height of the image in pixels.
columns  Width of the image in pixels.
format  The image format (one of enum WT_Image_Format.)
identifier  The unique numeric identifier of the image in the graphics collection.
color_map  The color map the image should use (if any.)
data_size  The size (in bytes) of the raw image data contained in the data argument.
data  The raw pixel data.
min_corner  The lower-left corner of the image.
max_corner  The upper-right corner of the image.
copy  Whether the pixel data should be copied or if it should be used directly from the buffer.
dpi  Scanned resolution for the image.


Member Function Documentation

WT_Result WT_Image::convert_bitonal_to_group_3X  ) 
 

Converts the current bitonal image to a Group3X_Mapped image.

Return values:
WT_Result::Success The operation was successful.
WT_Result::Toolkit_Usage_Error The image is not bitonal.
WT_Result::Corrupt_File_Error There is no image data.

WT_Result WT_Image::convert_group_3X_to_bitonal  ) 
 

Converts the current Group3X_Mapped image to a bitonal image.

Return values:
WT_Result::Success The operation was successful.
WT_Result::Toolkit_Usage_Error The image is not Group3X_Mapped.

WT_Result WT_Image::convert_group_3X_to_mapped  ) 
 

Converts the current Group3X_Mapped image to a Mapped image.

Return values:
WT_Result::Success The operation was successful.
WT_Result::Toolkit_Usage_Error The image is not Group3X_Mapped.

static WT_Result WT_Image::default_process WT_Image item,
WT_File file
[static]
 

Provides a default action handler for this object.

Warning:
This is used by the framework and should not be called by client code.
Parameters:
item  The object to process.
file  The file being read.

WT_Result WT_Image::materialize WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Materializes the contents of the object from the file and the given opcode.

Reads in the object data and causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
WT_Result::Opcode_Not_Valid_For_This_Object The object does not support the opcode type.
WT_Result::Internal_Error Something went very wrong.

Implements WT_Object.

WT_Result WT_Image::process WT_File file  )  [virtual]
 

Calls the configured action handler for this object (passes in the file reference.).

Warning:
This is used by the framework and should not be called by client code.

Implements WT_Object.

WT_Result WT_Image::serialize WT_File file  )  const [virtual]
 

Causes the serialization of the object to the file.

If this is a WT_Drawable derived object, this method may cause the object to be delayed (in case a coincident like-object follows) and/or merged (in case a coincident like-object preceeded) so as to optimize the output.

Return values:
WT_Result::Success The operation was successful.

Implements WT_Object.

WT_Result WT_Image::skip_operand WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Bug:
Not all objects perform skip_operand() correctly; this is a known problem. For best results, if client code must use WT_File::get_next_object_shell() manually, it should also call the corresponding WT_Object::materialize() method to avoid this problem.
See also:
WT_File::get_next_object_shell(), WT_File_Heuristics::set_deferred_delete().

Reimplemented from WT_Object.


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