MGD::DEVICE_RASTER_COLORMAPPED Class Reference

#include <mi32/mg2rastc.h>

Inheritance diagram for MGD::DEVICE_RASTER_COLORMAPPED:
Inheritance graph
[legend]

List of all members.

Public Types

enum  COLORPOLICY { COLORPOLICY_UseClosest = 0, COLORPOLICY_AddColor = 1, COLORPOLICY_Transparent = 2, COLORPOLICY_Fallback = 3 }

Public Member Functions

 DEVICE_RASTER_COLORMAPPED ()
virtual ~DEVICE_RASTER_COLORMAPPED ()
ERRVALUE Create (RVC::OBJITEM &ObjItem, RVC::RASTER::MAKEPARMS &MakeParms, const COLOR_ARRAY &cmap, const char *Source=0)
ERRVALUE Open (const RVC::OBJITEM &ObjItem)
void SetColorPolicy (COLORPOLICY policy)
void SetFallbackPixel (PIXEL pixel)

Private Member Functions

virtual CONTEXTv_CreateContext ()
virtual ERRVALUE v_Flush ()
virtual const COLOR_ARRAYv_GetColorMap () const
virtual PIXEL v_GetColorPixel (const COLOR &color)
virtual COLORSPACE v_GetColorSpace () const
virtual void v_GetPixelColor (PIXEL pixel, COLOR &color) const

Member Enumeration Documentation

How to deal with SetColor() if the color isn't in the colormap.

Enumerator:
COLORPOLICY_UseClosest 

Use the closest matching color.

COLORPOLICY_AddColor 

Add the color to the colormap (falls back to UseClosest once colormap is full).

COLORPOLICY_Transparent 

Treat it as a transparent color.

COLORPOLICY_Fallback 

Fallback to value set via SetFallbackPixel() (default = 0).


Constructor & Destructor Documentation

MGD::DEVICE_RASTER_COLORMAPPED::DEVICE_RASTER_COLORMAPPED (  ) 

Construct a colormapped raster device.

After constructing, you should call Create()

virtual MGD::DEVICE_RASTER_COLORMAPPED::~DEVICE_RASTER_COLORMAPPED (  )  [virtual]

Destructor.


Member Function Documentation

ERRVALUE MGD::DEVICE_RASTER_COLORMAPPED::Create ( RVC::OBJITEM ObjItem,
RVC::RASTER::MAKEPARMS MakeParms,
const COLOR_ARRAY cmap,
const char *  Source = 0 
)

Create a raster to draw into To draw into an existing raster, call Open.

Parameters:
cmap Initial colormap
ERRVALUE MGD::DEVICE_RASTER_COLORMAPPED::Open ( const RVC::OBJITEM ObjItem  ) 

Open a raster to draw into.

To draw into an existing raster, call Open

Reimplemented from MGD::DEVICE_RASTER_GRAY8.

void MGD::DEVICE_RASTER_COLORMAPPED::SetColorPolicy ( COLORPOLICY  policy  )  [inline]
void MGD::DEVICE_RASTER_COLORMAPPED::SetFallbackPixel ( PIXEL  pixel  )  [inline]

Set the pixel value to fallback to if using COLORPOLICY_Fallback.

virtual CONTEXT* MGD::DEVICE_RASTER_COLORMAPPED::v_CreateContext (  )  [private, virtual]

Create a GC for drawing.

Derived classes may override this and make it return anything derived from MGD_GC. MGD_GC's constructor is private, so this is the only way for calling code to create a GC.

Reimplemented from MGD::DEVICE_RASTER_GRAY8.

virtual ERRVALUE MGD::DEVICE_RASTER_COLORMAPPED::v_Flush (  )  [private, virtual]

Called by WritePixArray just before it starts writing Colormapped derived class can use this to update colormap.

Reimplemented from MGD::DEVICE_RASTER_GRAY8.

virtual const COLOR_ARRAY* MGD::DEVICE_RASTER_COLORMAPPED::v_GetColorMap (  )  const [private, virtual]

Get color palette, default implementation returns NULL.

Reimplemented from MGD::DEVICE.

virtual PIXEL MGD::DEVICE_RASTER_COLORMAPPED::v_GetColorPixel ( const COLOR color  )  [private, virtual]

Given a color, return the pixel value that matches or is as close as possible.

Reimplemented from MGD::DEVICE_MEM8G.

virtual COLORSPACE MGD::DEVICE_RASTER_COLORMAPPED::v_GetColorSpace (  )  const [inline, private, virtual]

Return the "native" COLORSPACE used by the display.

We fake it and look up the color later

Reimplemented from MGD::DEVICE_MEM8G.

virtual void MGD::DEVICE_RASTER_COLORMAPPED::v_GetPixelColor ( PIXEL  pixel,
COLOR color 
) const [private, virtual]

Given a pixel value, return the color it represents.

This should NOT take ICM into account. The context will translate the color back through the inverse ICM transform (if any)

Reimplemented from MGD::DEVICE_MEM8G.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:35:16 2012 for TNTsdk 2012 by  doxygen 1.6.1