WT_Color Class Reference
[Rendition attributes]

#include <color.h>

Inheritance diagram for WT_Color:

Inheritance graph
[legend]
Collaboration diagram for WT_Color:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing the currrent color.

See also:
WT_Rendition
Examples:

WhipExamples/Visibility.cpp.

Definition at line 40 of file color.h.

Public Types

enum  WT_Color_Map_Mode
 Indicates how searching for a color match in the map should proceed.

Public Member Functions

 WT_Color ()
 Constructs a WT_Color object. (Defaults to white.).
 WT_Color (WT_RGBA32 color, WT_Color_Map_Mode m=No_Mapping)
 Constructs a WT_Color object with the given color and optional mapping mode.
 WT_Color (int red, int green, int blue, WT_Color_Map_Mode m=No_Mapping)
 Constructs a WT_Color object with the given color and optional mapping mode.
 WT_Color (int red, int green, int blue, int alpha, WT_Color_Map_Mode m=No_Mapping)
 Constructs a WT_Color object with the given color and optional mapping mode.
 WT_Color (WT_Color_Index index, WT_Color_Map const &color_map)
 Constructs a WT_Color object from the given index and corresponding color map.
 WT_Color (WT_Color const &copy)
 Constructs a WT_Color object from another color.
virtual ~WT_Color ()
const int index () const
 Returns the color index (if any), may be WD_NO_COLOR_INDEX. */.
const WT_RGBA32rgba () const
 Returns the RGBA value of the color.
const WT_Color_Map_Modemode () const
 Returns the color mapping mode.
WT_Color const & operator= (WT_RGBA32 const &oColor)
 Sets the color with the given color, turns off mapping.
void set (WT_Color_Index index, WT_Color_Map const &color_map)
 Sets the colors from the given index and corresponding color map.
void set (int red, int green, int blue, int alpha, WT_Color_Map_Mode m=No_Mapping)
 Sets the color with the given color and optional mapping mode.
void set (int red, int green, int blue, WT_Color_Map_Mode m=No_Mapping)
 Sets the color with the given color and optional mapping mode.
void set (WT_RGBA32 color, WT_Color_Map_Mode m=No_Mapping)
 Sets the color with the given color and optional mapping mode.
void set (WT_Color const &copy)
 Sets the color from another.
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 int map_to_index (WT_RGBA32 color, WT_Color_Map_Mode mode, WT_Color_Map const &map)
 Returns the index of the color in the color map.
static WT_Result default_process (WT_Color &item, WT_File &file)
 Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

Friends

class WT_Background
class WT_Rendition
class WT_PDFBackground
class WT_W2D_Class_Factory
class WT_PDFClassFactory
class WT_Opcode
class WT_File
class WT_Color_Map
class WT_Class_Factory


Constructor & Destructor Documentation

WT_Color::WT_Color  )  [inline]
 

Constructs a WT_Color object. (Defaults to white.).

The color index will be set to WD_NO_COLOR_INDEX.

Definition at line 64 of file color.h.

WT_Color::WT_Color WT_RGBA32  color,
WT_Color_Map_Mode  m = No_Mapping
[inline]
 

Constructs a WT_Color object with the given color and optional mapping mode.

The color index will be set to WD_NO_COLOR_INDEX.

Parameters:
color  The color.
m  Optional mapping mode.

Definition at line 70 of file color.h.

WT_Color::WT_Color int  red,
int  green,
int  blue,
WT_Color_Map_Mode  m = No_Mapping
[inline]
 

Constructs a WT_Color object with the given color and optional mapping mode.

The color index will be set to WD_NO_COLOR_INDEX.

Parameters:
red  Red coponent of RGB color.
green  Green coponent of RGB color.
blue  Blue coponent of RGB color.
m  Optional mapping mode.

Definition at line 79 of file color.h.

WT_Color::WT_Color int  red,
int  green,
int  blue,
int  alpha,
WT_Color_Map_Mode  m = No_Mapping
[inline]
 

Constructs a WT_Color object with the given color and optional mapping mode.

The color index will be set to WD_NO_COLOR_INDEX.

Parameters:
red  Red coponent of RGBA color.
green  Green coponent of RGBA color.
blue  Blue coponent of RGBA color.
alpha  Alpha component of RGBA color (0 = transparent, 255 = opaque.)
m  Optional mapping mode.

Definition at line 90 of file color.h.

WT_Color::WT_Color WT_Color_Index  index,
WT_Color_Map const &  color_map
[inline]
 

Constructs a WT_Color object from the given index and corresponding color map.

Exceptions:
WT_Result::Toolkit_Usage_Error The index is greater than the size of the color map.
Parameters:
index  The color index into the color_map.
color_map  The map to search.

Definition at line 103 of file color.h.

WT_Color::WT_Color WT_Color const &  copy  )  [inline]
 

Constructs a WT_Color object from another color.

Exceptions:
WT_Result::Toolkit_Usage_Error The index is greater than the size of the color map.
Parameters:
copy  The color to copy from.

Definition at line 114 of file color.h.


Member Function Documentation

static WT_Result WT_Color::default_process WT_Color 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.

static int WT_Color::map_to_index WT_RGBA32  color,
WT_Color_Map_Mode  mode,
WT_Color_Map const &  map
[static]
 

Returns the index of the color in the color map.

Return values:
int The index of the color in the map (or nearest match - based on the search mode)
WD_NO_COLOR_INDEX An exact match was desired, and one was not found.
Parameters:
color  The color to search for.
mode  The search mode.
map  The map to search.

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

void WT_Color::set WT_RGBA32  color,
WT_Color_Map_Mode  m = No_Mapping
[inline]
 

Sets the color with the given color and optional mapping mode.

Parameters:
color  The color.
m  Optional mapping mode.

Definition at line 166 of file color.h.

void WT_Color::set int  red,
int  green,
int  blue,
WT_Color_Map_Mode  m = No_Mapping
[inline]
 

Sets the color with the given color and optional mapping mode.

Parameters:
red  Red coponent of RGBA color.
green  Green coponent of RGBA color.
blue  Blue coponent of RGBA color.
m  Optional mapping mode.

Definition at line 157 of file color.h.

void WT_Color::set int  red,
int  green,
int  blue,
int  alpha,
WT_Color_Map_Mode  m = No_Mapping
[inline]
 

Sets the color with the given color and optional mapping mode.

Parameters:
red  Red coponent of RGBA color.
green  Green coponent of RGBA color.
blue  Blue coponent of RGBA color.
alpha  Alpha component of RGBA color (0 = transparent, 255 = opaque.)
m  Optional mapping mode.

Definition at line 147 of file color.h.

void WT_Color::set WT_Color_Index  index,
WT_Color_Map const &  color_map
 

Sets the colors from the given index and corresponding color map.

Exceptions:
WT_Result::Toolkit_Usage_Error The index is greater than the size of the color map.
Parameters:
index  The color index into the color_map.
color_map  The map to search.

WT_Result WT_Color::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::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