CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OdGiPalette Class Reference

#include <GiPalette.h>

Inheritance diagram for OdGiPalette:
OdStaticRxObject< OdRxObject > OdRxObject

Classes

struct  Addressation
 

Public Member Functions

 OdGiPalette ()
 
 OdGiPalette (const OdGiPalette &obj)
 
OdGiPaletteoperator= (const OdGiPalette &obj)
 
virtual OdRxObjectPtr clone () const
 
OdSmartPtr< OdGiPalettecloneIfNeed () const
 
ODCOLORREF color (OdInt32 nColor) const
 
bool entryActivity (OdInt32 nColor) const
 
void setColor (OdInt32 nColor, ODCOLORREF color)
 
void setEntryActivity (OdInt32 nColor, bool bActivity)
 
const ODCOLORREFasArray () const
 
const OdGiColorCubecolorCube () const
 
void setColorCube (const OdGiColorCube *pColorCube)
 
void resetColorCube ()
 
const OdGiGrayRampgrayRamp () const
 
void setGrayRamp (const OdGiGrayRamp *pGrayRamp)
 
void resetGrayRamp ()
 
bool install (const OdGiColorCube *pColorCube, bool bForceUpdate=false)
 
bool install (const OdGiGrayRamp *pGrayRamp, bool bForceUpdate=false)
 
bool install (const OdGiPalette *pPalette, bool bForceUpdate=false, const Addressation &address=Addressation())
 
bool install (ODCOLORREF const *const pColors, bool bForceUpdate=false, const Addressation &address=Addressation())
 
OdInt32 closestMatch (ODCOLORREF cref, bool bThroughPal=false) const
 
OdInt32 firstAvailableBlock (OdInt32 blockSize) const
 
bool isEqualTo (const OdGiPalette *pPalette, const Addressation &address=Addressation()) const
 
bool remove (const OdGiPalette *pPalette, bool bForceUpdate=false, const Addressation &address=Addressation())
 
void clear ()
 
- Public Member Functions inherited from OdStaticRxObject< OdRxObject >
void addRef ()
 
void release ()
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Static Public Member Functions

static OdSmartPtr< OdGiPalettecreateDynamic ()
 
- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Protected Member Functions

virtual bool isDynamic () const
 
void initPalette ()
 
void resetColorCube (const OdGiColorCube *pColorCube)
 
void resetGrayRamp (const OdGiGrayRamp *pGrayRamp)
 
void setColorImpl (OdInt32 nColor, ODCOLORREF color)
 

Protected Attributes

ODCOLORREF m_colors [256]
 
OdUInt64 m_activities [4]
 
OdGiColorCubePtr m_pColorCube
 
OdGiGrayRampPtr m_pGrayRamp
 

Detailed Description

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

Definition at line 262 of file GiPalette.h.

Constructor & Destructor Documentation

◆ OdGiPalette() [1/2]

OdGiPalette::OdGiPalette ( )
inline

Definition at line 284 of file GiPalette.h.

◆ OdGiPalette() [2/2]

OdGiPalette::OdGiPalette ( const OdGiPalette obj)

Member Function Documentation

◆ asArray()

const ODCOLORREF * OdGiPalette::asArray ( ) const
inline

Returns palette colors as array pointer.

Definition at line 335 of file GiPalette.h.

◆ clear()

void OdGiPalette::clear ( )

Clear palette.

◆ clone()

virtual OdRxObjectPtr OdGiPalette::clone ( ) const
virtual

Creates a clone of this object, and returns a pointer to the clone.

Reimplemented from OdRxObject.

◆ cloneIfNeed()

OdSmartPtr< OdGiPalette > OdGiPalette::cloneIfNeed ( ) const
inline

Definition at line 294 of file GiPalette.h.

◆ 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 ( OdInt32  nColor) const
inline

Returns palette color.

Parameters
nColor[in] Color index.

Definition at line 300 of file GiPalette.h.

◆ colorCube()

const OdGiColorCube * OdGiPalette::colorCube ( ) const
inline

Returns color cube linked with this palette.

Definition at line 343 of file GiPalette.h.

◆ createDynamic()

static OdSmartPtr< OdGiPalette > OdGiPalette::createDynamic ( )
static

◆ entryActivity()

bool OdGiPalette::entryActivity ( OdInt32  nColor) const
inline

Returns palette entry activity flag.

Parameters
nColor[in] Color index.

Definition at line 308 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 365 of file GiPalette.h.

◆ initPalette()

void OdGiPalette::initPalette ( )
protected

◆ install() [1/4]

bool OdGiPalette::install ( const OdGiColorCube pColorCube,
bool  bForceUpdate = false 
)

Setup palette for specified color cube.

Parameters
pColorCube[in] Input color cube.
bForceUpdate[in] Update palette color even if it is already set.

◆ install() [2/4]

bool OdGiPalette::install ( const OdGiGrayRamp pGrayRamp,
bool  bForceUpdate = false 
)

Setup palette for specified gray ramp.

Parameters
pGrayRamp[in] Input gray ramp.
bForceUpdate[in] Update palette color even if it is already set.

◆ install() [3/4]

bool OdGiPalette::install ( const OdGiPalette pPalette,
bool  bForceUpdate = false,
const Addressation address = Addressation() 
)

Setup palette as a clone of another palette.

Parameters
pPalette[in] Input palette.
address[in] Palette insertion offsets.

◆ install() [4/4]

bool OdGiPalette::install ( ODCOLORREF const *const  pColors,
bool  bForceUpdate = false,
const Addressation address = Addressation() 
)

Setup palette from specified palette array.

Parameters
pColors[in] Array of palette colors.
bForceUpdate[in] Update palette color even if it is already set.
address[in] Palette insertion offsets.

◆ isDynamic()

virtual bool OdGiPalette::isDynamic ( ) const
inlineprotectedvirtual

Definition at line 282 of file GiPalette.h.

◆ isEqualTo()

bool OdGiPalette::isEqualTo ( const OdGiPalette pPalette,
const Addressation address = Addressation() 
) const

Check does this palette is equal with another one.

Parameters
pPalette[in] Palette for check.
address[in] Palette insertion offsets.

◆ operator=()

OdGiPalette & OdGiPalette::operator= ( const OdGiPalette obj)

◆ remove()

bool OdGiPalette::remove ( const OdGiPalette pPalette,
bool  bForceUpdate = false,
const Addressation address = Addressation() 
)

Remove equal sub-palette from current palette.

Parameters
pPalette[in] Palette for remove.
address[in] Palette insertion offsets.

◆ resetColorCube() [1/2]

void OdGiPalette::resetColorCube ( )
inline

Reset linkage of color cube with this palette.

Definition at line 357 of file GiPalette.h.

◆ resetColorCube() [2/2]

void OdGiPalette::resetColorCube ( const OdGiColorCube pColorCube)
protected

◆ resetGrayRamp() [1/2]

void OdGiPalette::resetGrayRamp ( )
inline

Reset linkage of gray ramp with this palette.

Definition at line 379 of file GiPalette.h.

◆ resetGrayRamp() [2/2]

void OdGiPalette::resetGrayRamp ( const OdGiGrayRamp pGrayRamp)
protected

◆ setColor()

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

Sets palette color.

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

Definition at line 318 of file GiPalette.h.

◆ setColorCube()

void OdGiPalette::setColorCube ( const OdGiColorCube pColorCube)
inline

Link color cube with this palette.

Definition at line 350 of file GiPalette.h.

◆ setColorImpl()

void OdGiPalette::setColorImpl ( OdInt32  nColor,
ODCOLORREF  color 
)
inlineprotected

Definition at line 446 of file GiPalette.h.

◆ setEntryActivity()

void OdGiPalette::setEntryActivity ( OdInt32  nColor,
bool  bActivity 
)
inline

Sets palette entry activity flag.

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

Definition at line 327 of file GiPalette.h.

◆ setGrayRamp()

void OdGiPalette::setGrayRamp ( const OdGiGrayRamp pGrayRamp)
inline

Link gray ramp with this palette.

Definition at line 372 of file GiPalette.h.

Member Data Documentation

◆ m_activities

OdUInt64 OdGiPalette::m_activities[4]
protected

Definition at line 266 of file GiPalette.h.

◆ m_colors

ODCOLORREF OdGiPalette::m_colors[256]
protected

Definition at line 265 of file GiPalette.h.

◆ m_pColorCube

OdGiColorCubePtr OdGiPalette::m_pColorCube
protected

Definition at line 267 of file GiPalette.h.

◆ m_pGrayRamp

OdGiGrayRampPtr OdGiPalette::m_pGrayRamp
protected

Definition at line 268 of file GiPalette.h.


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