CFx SDK Documentation  2022 SP0
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
OdGiPalette Class Reference

#include <GiPalette.h>

Classes

struct  PalEntry
 

Public Member Functions

 OdGiPalette ()
 
ODCOLORREF color (OdUInt32 nColor) const
 
OdInt32 entryHelper (OdUInt32 nColor) const
 
void setColor (OdUInt32 nColor, ODCOLORREF color)
 
void setEntryHelper (OdUInt32 nColor, OdInt32 entryHelper)
 
const OdGiColorCubecolorCube () const
 
void setColorCube (const OdGiColorCube &colorCube)
 
void resetColorCube ()
 
const OdGiGrayRampgrayRamp () const
 
void setGrayRamp (const OdGiGrayRamp &grayRamp)
 
void resetGrayRamp ()
 
bool install (const OdGiColorCube &cb)
 
bool install (const OdGiGrayRamp &gr)
 
bool install (const OdGiPalette &pal2)
 
OdInt32 closestMatch (ODCOLORREF cref, bool bThroughPal=false) const
 
OdInt32 firstAvailableBlock (OdInt32 blockSize) const
 
bool isEqualTo (const OdGiPalette &pal2) const
 
bool remove (const OdGiPalette &pal2)
 
void clear ()
 

Protected Types

typedef OdArray< PalEntry, OdMemoryAllocator< PalEntry > > PalEntryArray
 

Protected Member Functions

void initPalette ()
 
void resetColorCube (OdGiColorCube *pColorCube)
 
void resetGrayRamp (OdGiGrayRamp *pGrayRamp)
 
void setColor (OdInt32 nColor, ODCOLORREF color)
 

Protected Attributes

PalEntryArray m_palette
 
OdSharedPtr< OdGiColorCubem_pColorCube
 
OdSharedPtr< OdGiGrayRampm_pGrayRamp
 

Detailed Description

This class represents 256 colors palette. Corresponding C++ library: TD_Gi <group OdGi_Classes>

Definition at line 240 of file GiPalette.h.

Member Typedef Documentation

◆ PalEntryArray

Definition at line 248 of file GiPalette.h.

Constructor & Destructor Documentation

◆ OdGiPalette()

OdGiPalette::OdGiPalette ( )
inline

Definition at line 254 of file GiPalette.h.

Member Function Documentation

◆ clear()

void OdGiPalette::clear ( )

Clear palette.

◆ closestMatch()

OdInt32 OdGiPalette::closestMatch ( ODCOLORREF  cref,
bool  bThroughPal = false 
) const

Compute closest palette color index.

Parameters
cref[in] Input color.
bThroughPal[in] Skip usage of linked color cube and gray ramp in calculations.

◆ color()

ODCOLORREF OdGiPalette::color ( OdUInt32  nColor) const
inline

Returns palette color.

Parameters
nColor[in] Color index.

Definition at line 264 of file GiPalette.h.

◆ colorCube()

const OdGiColorCube* OdGiPalette::colorCube ( ) const
inline

Returns color cube linked with this palette.

Definition at line 299 of file GiPalette.h.

◆ entryHelper()

OdInt32 OdGiPalette::entryHelper ( OdUInt32  nColor) const
inline

Returns palette entry helper.

Parameters
nColor[in] Color index.

Definition at line 272 of file GiPalette.h.

◆ firstAvailableBlock()

OdInt32 OdGiPalette::firstAvailableBlock ( OdInt32  blockSize) const

Find start index of first available free block in palette.

Parameters
blockSize[in] Size of free block for search.

◆ grayRamp()

const OdGiGrayRamp* OdGiPalette::grayRamp ( ) const
inline

Returns gray ramp linked with this palette.

Definition at line 321 of file GiPalette.h.

◆ initPalette()

void OdGiPalette::initPalette ( )
protected

◆ install() [1/3]

bool OdGiPalette::install ( const OdGiColorCube cb)

Setup palette for specified color cube.

Parameters
cb[in] Input color cube.

◆ install() [2/3]

bool OdGiPalette::install ( const OdGiGrayRamp gr)

Setup palette for specified gray ramp.

Parameters
gr[in] Input gray ramp.

◆ install() [3/3]

bool OdGiPalette::install ( const OdGiPalette pal2)

Setup palette as a clone of another palette.

Parameters
pal2[in] Input palette.

◆ isEqualTo()

bool OdGiPalette::isEqualTo ( const OdGiPalette pal2) const

Check does this palette is equal with another one.

Parameters
pal2[in] Palette for check.

◆ remove()

bool OdGiPalette::remove ( const OdGiPalette pal2)

Remove equal sub-palette from current palette.

Parameters
pal2[in] Palette for remove.

◆ resetColorCube() [1/2]

void OdGiPalette::resetColorCube ( )
inline

Reset linkage of color cube with this palette.

Definition at line 313 of file GiPalette.h.

◆ resetColorCube() [2/2]

void OdGiPalette::resetColorCube ( OdGiColorCube pColorCube)
protected

◆ resetGrayRamp() [1/2]

void OdGiPalette::resetGrayRamp ( )
inline

Reset linkage of gray ramp with this palette.

Definition at line 335 of file GiPalette.h.

◆ resetGrayRamp() [2/2]

void OdGiPalette::resetGrayRamp ( OdGiGrayRamp pGrayRamp)
protected

◆ setColor() [1/2]

void OdGiPalette::setColor ( OdInt32  nColor,
ODCOLORREF  color 
)
protected

◆ setColor() [2/2]

void OdGiPalette::setColor ( OdUInt32  nColor,
ODCOLORREF  color 
)
inline

Sets palette color.

Parameters
nColor[in] Color index.
color[in] Input color.

Definition at line 282 of file GiPalette.h.

◆ setColorCube()

void OdGiPalette::setColorCube ( const OdGiColorCube colorCube)
inline

Link color cube with this palette.

Definition at line 306 of file GiPalette.h.

◆ setEntryHelper()

void OdGiPalette::setEntryHelper ( OdUInt32  nColor,
OdInt32  entryHelper 
)
inline

Sets palette entry helper.

Parameters
nColor[in] Color index.
entryHelper[in] New palette entry helper value.

Definition at line 291 of file GiPalette.h.

◆ setGrayRamp()

void OdGiPalette::setGrayRamp ( const OdGiGrayRamp grayRamp)
inline

Link gray ramp with this palette.

Definition at line 328 of file GiPalette.h.

Member Data Documentation

◆ m_palette

PalEntryArray OdGiPalette::m_palette
protected

Definition at line 250 of file GiPalette.h.

◆ m_pColorCube

OdSharedPtr<OdGiColorCube> OdGiPalette::m_pColorCube
protected

Definition at line 251 of file GiPalette.h.

◆ m_pGrayRamp

OdSharedPtr<OdGiGrayRamp> OdGiPalette::m_pGrayRamp
protected

Definition at line 252 of file GiPalette.h.


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