24#ifndef __ODGIPALETTE_H__
25#define __ODGIPALETTE_H__
122 : m_nBaseOffset(nBaseOffset)
123 , m_nGridDivs(nGridDivs)
124 , m_fIntensity(fIntensity)
209 : m_nBaseOffset(nBaseOffset)
210 , m_nGridDivs(nGridDivs)
211 , m_fIntensity(fIntensity)
276 : m_nSrcFrom(nFrom), m_nDstTo(nTo), m_nNumColors(nNum)
278 bool validate()
const {
return ((m_nSrcFrom + m_nNumColors) <= 256) && ((m_nDstTo + m_nNumColors) <= 256); }
279 bool fullRange()
const {
return (m_nSrcFrom == 0) && (m_nDstTo == 0) && (m_nNumColors == 256); }
302 return m_colors[nColor];
310 return GETBIT(m_activities[nColor >> 6], 1ULL << (
OdUInt64(nColor) & 63));
320 m_colors[nColor] = color;
329 SETBIT(m_activities[nColor >> 6], 1ULL << (
OdUInt64(nColor) & 63), bActivity);
345 return m_pColorCube.
get();
352 resetColorCube(pColorCube);
359 resetColorCube(NULL);
367 return m_pGrayRamp.
get();
374 resetGrayRamp(pGrayRamp);
448 m_colors[nColor] = color;
449 setEntryActivity(nColor,
true);
476 { setPaletteOverride(pTraits, pOverride); }
OdSmartPtr< OdGiColorCube > OdGiColorCubePtr
OdSmartPtr< OdGiPalette > OdGiPalettePtr
OdSmartPtr< OdGiGrayRamp > OdGiGrayRampPtr
#define SETBIT(flags, bit, value)
#define GETBIT(flags, bit)
OdSmartPtr< OdGiColorCube > cloneIfNeed() const
OdInt32 baseOffset() const
static OdSmartPtr< OdGiColorCube > createDynamic(OdGiIntRGB nGridDivs=OdGiIntRGB(2, 2, 2), float fIntensity=1.0f, OdInt32 nBaseOffset=0)
virtual bool isDynamic() const
ODCOLORREF color(OdInt32 nColor) const
OdInt32 closestMatch(ODCOLORREF cref) const
const OdGiIntRGB & offsets() const
OdGiColorCube(OdGiIntRGB nGridDivs=OdGiIntRGB(2, 2, 2), float fIntensity=1.0f, OdInt32 nBaseOffset=0)
const OdGiIntRGB & dimensions() const
virtual OdRxObjectPtr clone() const
OdInt32 ditheredMatch(ODCOLORREF cref, DtMatchResult &results) const
const OdGiIntRGB & gridDivisions() const
virtual OdRxObjectPtr clone() const
OdGiGrayRamp(OdInt32 nGridDivs=2, float fIntensity=1.0f, OdInt32 nBaseOffset=0)
static OdSmartPtr< OdGiGrayRamp > createDynamic(OdInt32 nGridDivs=2, float fIntensity=1.0f, OdInt32 nBaseOffset=0)
OdInt32 dimension() const
OdSmartPtr< OdGiGrayRamp > cloneIfNeed() const
OdInt32 gridDivisions() const
ODCOLORREF color(OdInt32 nColor) const
OdInt32 closestMatch(ODCOLORREF cref) const
virtual bool isDynamic() const
OdInt32 baseOffset() const
void setColorCube(const OdGiColorCube *pColorCube)
bool install(ODCOLORREF const *const pColors, bool bForceUpdate=false, const Addressation &address=Addressation())
void setColor(OdInt32 nColor, ODCOLORREF color)
void setColorImpl(OdInt32 nColor, ODCOLORREF color)
void setGrayRamp(const OdGiGrayRamp *pGrayRamp)
const OdGiGrayRamp * grayRamp() const
OdInt32 firstAvailableBlock(OdInt32 blockSize) const
virtual bool isDynamic() const
const OdGiColorCube * colorCube() const
static OdSmartPtr< OdGiPalette > createDynamic()
bool entryActivity(OdInt32 nColor) const
OdGiPalette(const OdGiPalette &obj)
OdSmartPtr< OdGiPalette > cloneIfNeed() const
void setEntryActivity(OdInt32 nColor, bool bActivity)
bool install(const OdGiPalette *pPalette, bool bForceUpdate=false, const Addressation &address=Addressation())
void resetGrayRamp(const OdGiGrayRamp *pGrayRamp)
OdGiColorCubePtr m_pColorCube
OdGiGrayRampPtr m_pGrayRamp
OdInt32 closestMatch(ODCOLORREF cref, bool bThroughPal=false) const
ODCOLORREF color(OdInt32 nColor) const
bool install(const OdGiColorCube *pColorCube, bool bForceUpdate=false)
bool remove(const OdGiPalette *pPalette, bool bForceUpdate=false, const Addressation &address=Addressation())
const ODCOLORREF * asArray() const
void resetColorCube(const OdGiColorCube *pColorCube)
virtual OdRxObjectPtr clone() const
bool install(const OdGiGrayRamp *pGrayRamp, bool bForceUpdate=false)
bool isEqualTo(const OdGiPalette *pPalette, const Addressation &address=Addressation()) const
OdGiSubEntityTraits * m_pTraits
OdGiPaletteOverrideHelper(OdGiSubEntityTraits &pTraits, const OdGiPalette &pOverride)
OdGiPaletteOverrideHelper()
void setPaletteOverride(OdGiSubEntityTraits &pTraits, const OdGiPalette &pOverride)
~OdGiPaletteOverrideHelper()
OdGiIntRGB(OdInt32 _r, OdInt32 _g, OdInt32 _b)
void setColor(ODCOLORREF cref)
void setGreen(OdInt32 _g)
OdGiIntRGB(ODCOLORREF cref)
void setRGB(OdInt32 _r, OdInt32 _g, OdInt32 _b)
Addressation(OdInt32 nFrom=0, OdInt32 nTo=0, OdInt32 nNum=256)