WT_Color_Map Class Reference
[Rendition attributes]

#include <colormap.h>

Inheritance diagram for WT_Color_Map:

Inheritance graph
[legend]
Collaboration diagram for WT_Color_Map:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing the currrent color map.

See also:
WT_Rendition
Examples:

WhipExamples/ColorMap.cpp.

Definition at line 40 of file colormap.h.

Public Member Functions

 WT_Color_Map (int file_revision_being_used=REVISION_WHEN_DEFAULT_COLORMAP_WAS_CHANGED) throw (WT_Result)
 Constructs a WT_Color_Map object for the optional specific file revision. Can be used a default constructor.
 WT_Color_Map (int count, WT_RGBA32 const *map, WT_File &file) throw (WT_Result)
 Constructs a WT_Color_Map object for the given size and map, for the given file.
 WT_Color_Map (int count, WT_RGB const *map, WT_File &file) throw (WT_Result)
 Constructs a WT_Color_Map object for the given size and map, for the given file.
 WT_Color_Map (WT_Color_Map const &cmap) throw (WT_Result)
 Constructs a WT_Color_Map object. Copy constructor.
virtual ~WT_Color_Map ()
 Destroys a WT_Color_Map object.
void clear ()
 Clears the color map.
int closest_index (WT_Color const &desired) const
 Returns the index of the closest matching color in the map to the given color, or WD_NO_COLOR_INDEX if map is empty.
int exact_index (WT_Color const &desired) const
 Returns the index of the matching color in the map to the given color, or WD_NO_COLOR_INDEX if not found.
int exact_index (WT_RGBA32 const &rgba) const
 Returns the index of the matching color in the map to the given color, or -1 if not found.
WT_RGBA32map () const
 Returns the raw map colors.
WT_RGBA32 map (WT_Byte index) const
 Returns the color at the given index.
WT_Result set (int count, WT_RGBA32 const *map, WT_File &file)
 Sets the map with the given size and map, for the given file.
WT_Result set (int count, WT_RGB const *map, WT_File &file)
 Sets the map with the given size and map, for the given file.
int size () const
 Returns the size of the color map.
WT_Color_Map const & operator= (WT_Color_Map const &cmap) throw (WT_Result)
 Assignment operator. Assigns the given attribute contents to this one.
WT_ID object_id () const
 Returns the WT_ID for this object.
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 process (WT_File &file)
 Calls the configured action handler for this object (passes in the file reference.).
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 serialize (WT_File &file) const
 Forces the serialization of the object to the file.
WT_Result sync (WT_File &file) const
 Serializes the attribute out to the file, if necessary.
WT_Boolean operator== (WT_Attribute const &attrib) const
 Returns WD_True if the attributes are equal.

Static Public Member Functions

static WT_Result default_process (WT_Color_Map &item, WT_File &file)
 Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

Friends

class WT_Image
class WT_Pen_Pattern
class WT_PNG_Group4_Image
class WT_Rendition
class WT_W2D_Class_Factory
class WT_Opcode
class WT_File_Heuristics
class WT_DWF_Header
class WT_Color
class WT_PDFPen_Pattern


Constructor & Destructor Documentation

WT_Color_Map::WT_Color_Map int  file_revision_being_used = REVISION_WHEN_DEFAULT_COLORMAP_WAS_CHANGED  )  throw (WT_Result)
 

Constructs a WT_Color_Map object for the optional specific file revision. Can be used a default constructor.

Parameters:
file_revision_being_used  The file decimal revision for which to create the map.

WT_Color_Map::WT_Color_Map int  count,
WT_RGBA32 const *  map,
WT_File file
throw (WT_Result)
 

Constructs a WT_Color_Map object for the given size and map, for the given file.

Parameters:
count  Size of the color array in the map argument.
map  An array of colors.
file  The current file (used for its incarnation value.)

WT_Color_Map::WT_Color_Map int  count,
WT_RGB const *  map,
WT_File file
throw (WT_Result)
 

Constructs a WT_Color_Map object for the given size and map, for the given file.

Parameters:
count  Size of the color array in the map argument.
map  An array of colors.
file  The current file (used for its incarnation value.)


Member Function Documentation

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

Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

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

WT_RGBA32 WT_Color_Map::map WT_Byte  index  )  const [inline]
 

Returns the color at the given index.

Warning:
This could overflow the array. Clients should call size() to determine the map size before calling this method.

Definition at line 112 of file colormap.h.

WT_Result WT_Color_Map::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_Color_Map::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_Color_Map::serialize WT_File file  )  const [virtual]
 

Forces the serialization of the object to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.

Implements WT_Attribute.

WT_Result WT_Color_Map::set int  count,
WT_RGB const *  map,
WT_File file
 

Sets the map with the given size and map, for the given file.

Parameters:
count  Size of the color array in the map argument.
map  An array of colors.
file  The current file (used for its incarnation value.)

WT_Result WT_Color_Map::set int  count,
WT_RGBA32 const *  map,
WT_File file
 

Sets the map with the given size and map, for the given file.

Parameters:
count  Size of the color array in the map argument.
map  An array of colors.
file  The current file (used for its incarnation value.)

WT_Result WT_Color_Map::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.

WT_Result WT_Color_Map::sync WT_File file  )  const [virtual]
 

Serializes the attribute out to the file, if necessary.

Only outputs relevant desired rendition changes to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
See also:
WT_File::desired_rendition().

Implements WT_Attribute.


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