Mako 7.5.0 API
Loading...
Searching...
No Matches
IDOMColor Class Referenceabstract

Holds a single color value. The color values themselves are held as floating point values for all color spaces. For some spaces (such as indexed color spaces) the values will be integral, but still stored as floats. More...

#include <idomcolor.h>

Inheritance diagram for IDOMColor:

Public Member Functions

virtual float getAlpha () const =0
 Retrieves the alpha channel value. The alpha channel value specifies the transparency of the color.
 
virtual void setAlpha (float a)=0
 Sets the alpha channel value.
 
virtual IDOMColorSpacePtr getColorSpace ()=0
 Retrieves the color space.
 
virtual void setColorSpace (const IDOMColorSpacePtr &colorSpace, bool setDefaultColor=true)=0
 Set the color space.
 
virtual void setColorSpace (const IDOMColorSpacePtr &colorSpace, eRenderingIntent intent, eBlackPointCompensation bpc, IEDLClassFactory *pFactory)=0
 Set the color space, converting color values from the previous color space to the new.
 
virtual float getComponentValue (uint32 component)=0
 Retrieves the value of a component.
 
virtual void setComponentValue (uint32 component, float value)=0
 Sets a component value. The value will be clipped to the range of the color space, if known.
 
virtual bool testGamut (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &colorSpace, eRenderingIntent intent, eBlackPointCompensation bpc)=0
 Tests the color is within the color gamut for the given color space.
 
- Public Member Functions inherited from IEDLObject
virtual const CClassIDgetClassID () const =0
 Returns class ID of IEDLObject.
 
virtual bool init (CClassParams *pData)
 The init() method is called to perform any post-construction initialization of an IEDLObject that has been created by the EDL class factory, before it is actually returned by the factory.
 
virtual bool clone (IEDLObjectPtr &ptrObject, IEDLClassFactory *pFactory)
 Create a copy of EDLObject.
 
- Public Member Functions inherited from IRCObject
virtual void addRef () const =0
 Increases the reference count of the actual object pointed to. This would take place during an assignment or copying.
 
virtual bool decRef () const =0
 Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to.
 
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to.
 
- Public Member Functions inherited from IDOMHashable
virtual ~IDOMHashable ()
 Virtual destructor.
 
virtual bool hash (uint64 &hash)=0
 Retrieve a hash for this object.
 
virtual uint64 hashE ()
 As hash(), but throws an exception if the operation fails.
 

Static Public Member Functions

static IDOMColorPtr createSolidGray (IEDLClassFactory *pFactory, float gray=0.0f)
 Simplified color creation for DeviceGray colors. Default parameters will yield an opaque DeviceGray black.
 
static IDOMColorPtr createSolidRgb (IEDLClassFactory *pFactory, float r=0.0f, float g=0.0f, float b=0.0f)
 Simplified color creation for DeviceRGB colors. Default parameters will yield an opaque DeviceRGB black.
 
static IDOMColorPtr createSolidCmyk (IEDLClassFactory *pFactory, float c=0.0f, float m=0.0f, float y=0.0f, float k=0.0f)
 Simplified color creation for DeviceCMYK colors. Default parameters will yield an opaque DeviceCMYK white.
 
static EDL_API IDOMColorPtr create (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component)
 Simplified color creation routine for color spaces using a single component. Throws an IEDLError on failure.
 
static EDL_API IDOMColorPtr create (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2)
 Simplified color creation routine for color spaces using two components. Throws an IEDLError on failure.
 
static EDL_API IDOMColorPtr create (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3)
 Simplified color creation routine for color spaces using three components. Throws an IEDLError on failure.
 
static EDL_API IDOMColorPtr create (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4)
 Simplified color creation routine for color spaces that take four components. Throws an IEDLError on failure.
 
static EDL_API IDOMColorPtr create (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4, double component5)
 Simplified color creation routine for color spaces that take five components. Throws an IEDLError on failure.
 
static EDL_API IDOMColorPtr create (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4, double component5, double component6)
 Simplified color creation routine for color spaces that take six components. Throws an IEDLError on failure.
 
static EDL_API IDOMColorPtr create (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4, double component5, double component6, double component7, double component8=0.0, double component9=0.0, double component10=0.0, double component11=0.0, double component12=0.0, double component13=0.0, double component14=0.0, double component15=0.0, double component16=0.0, double component17=0.0, double component18=0.0, double component19=0.0, double component20=0.0, double component21=0.0, double component22=0.0, double component23=0.0, double component24=0.0, double component25=0.0, double component26=0.0, double component27=0.0, double component28=0.0, double component29=0.0, double component30=0.0, double component31=0.0, double component32=0.0)
 Simplified color creation routine for color spaces that take any number of components from 7 through to the maximum of 32. Throws an IEDLError on failure.
 
static EDL_API IDOMColorPtr createFromVect (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, float alpha, const CEDLVector< float > &components)
 Simplified color creation routine. Throws an IEDLError on failure.
 
static EDL_API IDOMColorPtr createFromArray (IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, float alpha, const float *components)
 Simplified color creation routine. Throws an IEDLError on failure.
 
static const CClassIDclassID ()
 Retrieves the class id of IDOMColor.
 

Additional Inherited Members

- Protected Member Functions inherited from IRCObject
virtual ~IRCObject ()
 Virtual destructor.
 

Detailed Description

Holds a single color value. The color values themselves are held as floating point values for all color spaces. For some spaces (such as indexed color spaces) the values will be integral, but still stored as floats.

The color values themselves cannot be interpreted without reference to the referenced color space.

IDOMColor nodes are used to specify the colors of lines and strokes, not of images. Hence if an ArcSegment is drawn with a blue line, the blue is specified by an IDOMColor node.

Member Function Documentation

◆ classID()

static const CClassID & IDOMColor::classID ( )
inlinestatic

Retrieves the class id of IDOMColor.

Returns
CClassID Returns the class id of the element.

◆ create() [1/7]

static EDL_API IDOMColorPtr IDOMColor::create ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
double alpha,
double component )
static

Simplified color creation routine for color spaces using a single component. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use. This must take one color component.
alphaThe alpha to use.
componentThe color components to use.
Returns
IDOMColorPtr The new color.

◆ create() [2/7]

static EDL_API IDOMColorPtr IDOMColor::create ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
double alpha,
double component1,
double component2 )
static

Simplified color creation routine for color spaces using two components. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use. This must take two color components.
alphaThe alpha to use.
component1The first color components to use.
component2The second color components to use.
Returns
IDOMColorPtr The new color.

◆ create() [3/7]

static EDL_API IDOMColorPtr IDOMColor::create ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
double alpha,
double component1,
double component2,
double component3 )
static

Simplified color creation routine for color spaces using three components. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use. This must take three color components.
alphaThe alpha to use.
component1The first color components to use.
component2The second color components to use.
component3The third color components to use.
Returns
IDOMColorPtr The new color.

◆ create() [4/7]

static EDL_API IDOMColorPtr IDOMColor::create ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
double alpha,
double component1,
double component2,
double component3,
double component4 )
static

Simplified color creation routine for color spaces that take four components. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use. This must take four color components.
alphaThe alpha to use.
component1The first color components to use.
component2The second color components to use.
component3The third color components to use.
component4The fourth color components to use.
Returns
IDOMColorPtr The new color.

◆ create() [5/7]

static EDL_API IDOMColorPtr IDOMColor::create ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
double alpha,
double component1,
double component2,
double component3,
double component4,
double component5 )
static

Simplified color creation routine for color spaces that take five components. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use. This must take five color components.
alphaThe alpha to use.
component1The first color components to use.
component2The second color components to use.
component3The third color components to use.
component4The fourth color components to use.
component5The fifth color components to use.
Returns
IDOMColorPtr The new color.

◆ create() [6/7]

static EDL_API IDOMColorPtr IDOMColor::create ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
double alpha,
double component1,
double component2,
double component3,
double component4,
double component5,
double component6 )
static

Simplified color creation routine for color spaces that take six components. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use. This must take six color components.
alphaThe alpha to use.
component1The first color components to use.
component2The second color components to use.
component3The third color components to use.
component4The fourth color components to use.
component5The fifth color components to use.
component6The sixth color components to use.
Returns
IDOMColorPtr The new color.

◆ create() [7/7]

static EDL_API IDOMColorPtr IDOMColor::create ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
double alpha,
double component1,
double component2,
double component3,
double component4,
double component5,
double component6,
double component7,
double component8 = 0.0,
double component9 = 0.0,
double component10 = 0.0,
double component11 = 0.0,
double component12 = 0.0,
double component13 = 0.0,
double component14 = 0.0,
double component15 = 0.0,
double component16 = 0.0,
double component17 = 0.0,
double component18 = 0.0,
double component19 = 0.0,
double component20 = 0.0,
double component21 = 0.0,
double component22 = 0.0,
double component23 = 0.0,
double component24 = 0.0,
double component25 = 0.0,
double component26 = 0.0,
double component27 = 0.0,
double component28 = 0.0,
double component29 = 0.0,
double component30 = 0.0,
double component31 = 0.0,
double component32 = 0.0 )
static

Simplified color creation routine for color spaces that take any number of components from 7 through to the maximum of 32. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use. This must take between 7 and 32 color components.
alphaThe alpha to use.
component1The first color component to use.
component2The second color component to use.
component3The third color component to use.
component4The fourth color component to use.
component5The fifth color component to use.
component6The sixth color component to use.
component7The seventh color component to use.
component8The eighth color component to use (if applicable).
component9The ninth color component to use (if applicable).
component10The tenth color component to use (if applicable).
component11The eleventh color component to use (if applicable).
component12The twelth color component to use (if applicable).
component13The thirteenth color component to use (if applicable).
component14The fourteenth color component to use (if applicable).
component15The fifteenth color component to use (if applicable).
component16The sixteenth color component to use (if applicable).
component17The seventeenth color component to use (if applicable).
component18The eightteenth color component to use (if applicable).
component19The nineteenth color component to use (if applicable).
component20The twentieth color component to use (if applicable).
component21The twenty-first color component to use (if applicable).
component22The twenty-second color component to use (if applicable).
component23The twenty-third color component to use (if applicable).
component24The twenty-fourth color component to use (if applicable).
component25The twenty-fifth color component to use (if applicable).
component26The twenty-sixth color component to use (if applicable).
component27The twenty-seventh color component to use (if applicable).
component28The twenty-eighth color component to use (if applicable).
component29The twenty-ninth color component to use (if applicable).
component30The thirtieth color component to use (if applicable).
component31The thirty-first color component to use (if applicable).
component32The thirty-second color component to use (if applicable).
Returns
IDOMColorPtr The new color.

◆ createFromArray()

static EDL_API IDOMColorPtr IDOMColor::createFromArray ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
float alpha,
const float * components )
static

Simplified color creation routine. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use.
alphaThe alpha to use.
componentsAn array of color components to use, as floats or doubles. The number of floats MUST match the number of components expected of the color space.
Returns
IDOMColorPtr The new color.

◆ createFromVect()

static EDL_API IDOMColorPtr IDOMColor::createFromVect ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & space,
float alpha,
const CEDLVector< float > & components )
static

Simplified color creation routine. Throws an IEDLError on failure.

Parameters
pFactoryThe EDL Class factory to use.
spaceThe color space to use.
alphaThe alpha to use.
componentsA vector of color components to use, as floats. The number of components MUST match the number of components expected of the color space.
Returns
IDOMColorPtr The new color.

◆ createSolidCmyk()

static IDOMColorPtr IDOMColor::createSolidCmyk ( IEDLClassFactory * pFactory,
float c = 0.0f,
float m = 0.0f,
float y = 0.0f,
float k = 0.0f )
inlinestatic

Simplified color creation for DeviceCMYK colors. Default parameters will yield an opaque DeviceCMYK white.

Parameters
pFactoryThe EDL Class factory to use.
cThe cyan level to use.
mThe magenta level to use.
yThe yellow level to use.
kThe black level to use.
Returns
IDOMColorPtr The new brush.

◆ createSolidGray()

static IDOMColorPtr IDOMColor::createSolidGray ( IEDLClassFactory * pFactory,
float gray = 0.0f )
inlinestatic

Simplified color creation for DeviceGray colors. Default parameters will yield an opaque DeviceGray black.

Parameters
pFactoryThe EDL Class factory to use.
grayThe gray level to use (0 is black).
Returns
IDOMColorPtr The new brush.

◆ createSolidRgb()

static IDOMColorPtr IDOMColor::createSolidRgb ( IEDLClassFactory * pFactory,
float r = 0.0f,
float g = 0.0f,
float b = 0.0f )
inlinestatic

Simplified color creation for DeviceRGB colors. Default parameters will yield an opaque DeviceRGB black.

Parameters
pFactoryThe EDL Class factory to use.
rThe red level to use.
gThe green level to use.
bThe blue level to use.
Returns
IDOMColorPtr The new brush.

◆ getAlpha()

virtual float IDOMColor::getAlpha ( ) const
pure virtual

Retrieves the alpha channel value. The alpha channel value specifies the transparency of the color.

Alpha values are between zero and 1. A value of 0 means that the color does not have any coverage information and is fully transparent; a value of 1 means that the color is fully opaque because the geometry completely overlapped the pixel.

Returns
float The alpha channel value

◆ getColorSpace()

virtual IDOMColorSpacePtr IDOMColor::getColorSpace ( )
pure virtual

Retrieves the color space.

A device color space simply describes the range of colors, or gamut, that a camera can see, a printer can print, or a monitor can display. Editing color spaces, on the other hand, such as Adobe RGB or sRGB, are device-independent. They also determine a color range you can work in. Their design allows you to edit images in a controlled, consistent manner. A device color space is tied to the device it describes. An editing space, on the other hand, is gray-balanced colors with equal amounts of red, green, and blue appear neutral. Editing spaces also are perceptually uniform; that is, changes to lightness, hue, or saturation are applied equally to all the colors in the image.

Returns
smartptr Smart pointer to the colorspace.

◆ getComponentValue()

virtual float IDOMColor::getComponentValue ( uint32 component)
pure virtual

Retrieves the value of a component.

Parameters
componentIndex of the component.
Returns
float Component value

◆ setAlpha()

virtual void IDOMColor::setAlpha ( float a)
pure virtual

Sets the alpha channel value.

Parameters
aDesired new alpha channel value.

◆ setColorSpace() [1/2]

virtual void IDOMColor::setColorSpace ( const IDOMColorSpacePtr & colorSpace,
bool setDefaultColor = true )
pure virtual

Set the color space.

If the new color space has has the same number of components as the old, the values will be retained and clipped to the range of the new color space, if applicable. Otherwise if setDefaultColor is true, a default value will be set based on the minima of the range of the new color space.

Parameters
colorSpaceSmart pointer to the desired new color space
setDefaultColorIf true, and the new space has a different number of components than the previous space, a default color will be set.

◆ setColorSpace() [2/2]

virtual void IDOMColor::setColorSpace ( const IDOMColorSpacePtr & colorSpace,
eRenderingIntent intent,
eBlackPointCompensation bpc,
IEDLClassFactory * pFactory )
pure virtual

Set the color space, converting color values from the previous color space to the new.

The destination color space must not be an Indexed or DeviceN color space. If the current color space is a DeviceN or Indexed space, if will be converted to the Alternate or Underlying color space before color conversion takes place. Further, if the resulting color is not visible (due to a DeviceN colorspace containing nothing but the special "None" colorant, then the resulting color will be given zero alpha and the default components for the destination color space will be set.

Parameters
colorSpaceSmart pointer to the desired new color space.
intentThe rendering intent to be used for conversion. The rendering intent refers to the way the CMM (Color Management Module) will handle out-of-gamut colors during a conversion from one color space to another. The ICC specification includes four different rendering intents: perceptual, relative colorimetric, absolute colorimetric, and saturation.
See also
eRenderingIntent
Parameters
bpcBlack point compensation handling. Black point compensation refers to the way the CMM (Color Management Module) will handle shadows in color conversion where the black point of the input and output color spaces differ. If in doubt, use eBPCDefault.
pFactoryThe EDL class factory.

◆ setComponentValue()

virtual void IDOMColor::setComponentValue ( uint32 component,
float value )
pure virtual

Sets a component value. The value will be clipped to the range of the color space, if known.

Parameters
componentIndex of the component.
valueNew value of the component.

◆ testGamut()

virtual bool IDOMColor::testGamut ( IEDLClassFactory * pFactory,
const IDOMColorSpacePtr & colorSpace,
eRenderingIntent intent,
eBlackPointCompensation bpc )
pure virtual

Tests the color is within the color gamut for the given color space.

The color space must not be an Indexed or DeviceN color space. If the current color space is a DeviceN or Indexed space, if will be converted to the Alternate or Underlying color space before color conversion takes place.

Parameters
pFactoryThe EDL class factory.
colorSpaceSmart pointer to the color space to test against.
intentThe rendering intent to be used for conversion. The rendering intent refers to the way the CMM (Color Management Module) will handle out-of-gamut colors during a conversion from one color space to another. The ICC specification includes four different rendering intents: perceptual, relative colorimetric, absolute colorimetric, and saturation.
See also
eRenderingIntent
Parameters
bpcBlack point compensation handling. Black point compensation refers to the way the CMM (Color Management Module) will handle shadows in color conversion where the black point of the input and output color spaces differ. If in doubt, use eBPCDefault.
Returns
bool false, if the color is Out-Of-Gamut, or true if within gamut.

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