InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IColorSystemUtils Class Referenceabstract

#include <IColorSystemUtils.h>

Inheritance diagram for IColorSystemUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICOLORSYSTEMUTILS }
 

Public Member Functions

virtual PMString GetColorInfoString (const int32 &colorSpace, const ColorArray &colorValueArray, bool16 doUseComma)=0
 
virtual IPMUnknownQueryBaseRenderObject (IDataBase *iDataBase, UID renderObjectUID, PMIID iidToQuery=IID_IUNKNOWN)=0
 
virtual IPMUnknownQueryBaseRenderObject (IPMUnknown *object, PMIID iidToQuery=IID_IUNKNOWN)=0
 
virtual PMReal GetTintValueFromSwatch (const UIDRef &swatchRef)=0
 
virtual PMReal GetTintValueFromColorObject (IPMUnknown *colorObject)=0
 
virtual PMReal GetCurrentActiveTintValue (IDataBase *iDataBase)=0
 
virtual AGMColorSpace * NewAGMColorSpace (int32 colorFamily, const ColorArray &colorArray, const UIDList *pInkUIDList, IInkList *iInkList=nil)=0
 
virtual AGMColorSpace * NewAGMColorSpaceFromColorSwatch (const UIDRef &swatchRef)=0
 
virtual void GetColorSpaceAndColorValue (bool16 doPrint, const UIDRef &swatchRef, const PMReal &tint, AGMColorSpace **colorSpace, float *colorValue, IGraphicsPort *gPort=nil)=0
 
virtual void ReleaseColorSpace (AGMColorSpace *colorSpace)=0
 
virtual void SetColorSpaceAndColorValue (IGraphicsPort *gPort, int32 colorFamily, const ColorArray &colorArray, const PMReal &tint, const UIDList *pInkUIDList=nil)=0
 
virtual void SetColorSpaceAndColorValue (IGraphicsPort *gPort, IColorData *iColorData, IColorData *iAltColorData, IInkData *iInkData, IColorOverrides *iCORides, IColorSpaceMgr *iCSMgr, const PMReal &tint)=0
 
virtual ColorArray ColorTransform (IDocument *iDoc, ColorArray srcArray, int32 srcColorSpace, int32 dstColorSpace, const UIDList *pInkUIDList=nil, IInkList *iInkList=nil)=0
 
virtual ColorArray GetTintedColorComponents (int32 colorSpace, ColorArray colorArray, PMReal tint)=0
 
virtual void GetColorSwatchColorSpaceAndValue (const UIDRef &colorRef, int32 &colorspace, ColorArray &colorArray, PMReal &tint)=0
 
virtual bool32 IsWhite (const UIDRef &swatchRef, PMReal tint=kDefaultTintPercent, bool32 useAltspaceOnly=kFalse)=0
 
virtual bool32 ShouldIgnorePaperColor (IViewPortAttributes *iAttr)=0
 
virtual void RGBToHSB (PMReal r, PMReal g, PMReal b, PMReal &h, PMReal &s, PMReal &v)=0
 
virtual void HSBToRGB (PMReal h, PMReal s, PMReal v, PMReal &r, PMReal &g, PMReal &b)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Utility for InDesign color rendering object.

Member Function Documentation

virtual ColorArray IColorSystemUtils::ColorTransform (IDocumentiDoc,
ColorArray srcArray,
int32 srcColorSpace,
int32 dstColorSpace,
const UIDListpInkUIDList = nil,
IInkListiInkList = nil 
)
pure virtual

Transform source color array to destination color array based on current document CMS setting. If iDoc is nil, the current front document is used.

Parameters
iDocspecifies which the CMS setting should be used.
srcArrayis the source color array to be converted.
srcColorSpaceis the color space of the source color array.
dstColorSpaceis the color space to transform the source color to.
pInkUIDListspecifies the ink components for the source color array.
iInkListspecifies the IInkLIst for the ink components. Specify an IInkList if inks in pInkUIDList are not in the same database as the document or application database.
virtual PMString IColorSystemUtils::GetColorInfoString (const int32 & colorSpace,
const ColorArraycolorValueArray,
bool16 doUseComma 
)
pure virtual

Construct a string based on the color space and color value array. e.g. R=xx B=yy G=zz.

Parameters
colorSpacespecifies the color space to use.
colorValueArrayspecifies the color values.
doUseCommais kTrue then a comma is added after each component.
Returns
a string.
Precondition
the colorValueArray's component values must be already in the desired range. For RGB color space, the range is [0,255], for CMYK [0,100].
virtual void IColorSystemUtils::GetColorSpaceAndColorValue (bool16 doPrint,
const UIDRefswatchRef,
const PMRealtint,
AGMColorSpace ** colorSpace,
float * colorValue,
IGraphicsPortgPort = nil 
)
pure virtual

Creates the color space and gets color value from the given color swatch UIDRef.

Parameters
doPrintis kTrue if graphic port is a printer port.
swatchRefspecifies the UIDRef of the color swatch.
tintspecifies the tint percentage of the color swatch.
colorSpacereturns the AGMColorSpace for this swatch.
colorValuereturns the AGM color values for this swatch.
gPortspecifies the graphic port for this AGMColorSpace.
Precondition
The color swatch UIDRef must be an InDesign persistent color object (kPMColorBoss).
virtual void IColorSystemUtils::GetColorSwatchColorSpaceAndValue (const UIDRefcolorRef,
int32 & colorspace,
ColorArraycolorArray,
PMRealtint 
)
pure virtual

Get the specified color swatch's color space and color array. If color swatch is a tint swatch, the tint percent is returned otherwise returns kDefaultTintPercent.

Parameters
colorRefspecifies the color swatch UIDRef to get the color information from.
colorspacereturns the swatch's color space.
colorArrayreturns the swatch's color component array.
tintreturns the swatch's tint value. If not a tint swatch, kDefaultTintPercent is returned..
virtual PMReal IColorSystemUtils::GetCurrentActiveTintValue (IDataBaseiDataBase)
pure virtual

Return tint percentage of the given database's active fill or stroke attribute depending on whether fill or stroke proxy is active.

Parameters
iDataBasespecifies the data base.
virtual ColorArray IColorSystemUtils::GetTintedColorComponents (int32 colorSpace,
ColorArray colorArray,
PMReal tint 
)
pure virtual

Compute the tinted color components given a base color array and a tint percent between 0 and 100 percent.

Parameters
colorSpaceis the color space of the color value.
colorArrayis the color values
tintis the tint percentage in the range [0, 100].
Returns
tint color array.
virtual PMReal IColorSystemUtils::GetTintValueFromColorObject (IPMUnknowncolorObject)
pure virtual

Return the specified color object's tint value. tint is kInvalidTintPercent if swatch does not have a tint value or if swatch is not a color swatch.

Parameters
colorObjectspecifies the color object.
Returns
the tint percent.
virtual PMReal IColorSystemUtils::GetTintValueFromSwatch (const UIDRefswatchRef)
pure virtual

Return the specified swatch's tint value. tint is kInvalidTintPercent if swatch does not have a tint value or if swatch is not a color swatch.

Parameters
swatchRefspecifies the UIDRef of the swatch.
Returns
the tint percent.
virtual void IColorSystemUtils::HSBToRGB (PMReal h,
PMReal s,
PMReal v,
PMRealr,
PMRealg,
PMRealb 
)
pure virtual

HSBToRGB() a utility function to convert the HSBColor Values to their corresponding RGBColor Values. HSB is also known as HSV, argument name uses v instead of b to not to conflict with b of rgb.

virtual bool32 IColorSystemUtils::IsWhite (const UIDRefswatchRef,
PMReal tint = kDefaultTintPercent,
bool32 useAltspaceOnly = kFalse 
)
pure virtual

Returns true iff the color is white – that is, that the color will not mark any plate with a nonzero value.

Parameters
swatchRefis the swatch you're curious about.
tintis the tint to apply. If the swatch is a tint swatch then the two tints multiply.
useAltspaceOnlyIf true, non-process colors (spots and deviceN) are effectively converted to process; that is, their altspace value is used rather than considering contribution on plates. Note that this only makes a difference if a spot is defined as white.
virtual AGMColorSpace* IColorSystemUtils::NewAGMColorSpace (int32 colorFamily,
const ColorArraycolorArray,
const UIDListpInkUIDList,
IInkListiInkList = nil 
)
pure virtual

Creates and returns the AGM color space from the specified color and ink data. This version does not take any view port attribute into consideration. It uses the default CMS off settings. It assumed the target graphic port is screen.

Parameters
colorFamilyspecifies the color space.
colorArrayspecifies color value.
inkUIDListspecifies the ink components for this color.
Returns
an AGMColorSpace for this color space.
virtual AGMColorSpace* IColorSystemUtils::NewAGMColorSpaceFromColorSwatch (const UIDRefswatchRef)
pure virtual

Creates and returns the AGM color space from the specified color swatch UIDRef. This version ignores the view port settings. It uses the default CMS off settings. It assumed the target graphic port is screen. To accurately reflect the current port settings, use GetColorSpaceAndColorValue()

Parameters
swatchRefspecifies the UIDRef of the color swatch.
Returns
the AGMColorSpace created from the specified color swatch.
Precondition
The color swatch UIDRef must be an InDesign persistent color object (kPMColorBoss).
virtual IPMUnknown* IColorSystemUtils::QueryBaseRenderObject (IDataBaseiDataBase,
UID renderObjectUID,
PMIID iidToQuery = IID_IUNKNOWN 
)
pure virtual

Query for the base rendering object's interface

Parameters
iDataBasethe database of the object to use.
renderObjectUIDspecifies the object's UID.
iidToQueryis the PMIID to query.
Returns
the interface pointer for the requested interface.
virtual IPMUnknown* IColorSystemUtils::QueryBaseRenderObject (IPMUnknownobject,
PMIID iidToQuery = IID_IUNKNOWN 
)
pure virtual

Query for the base rendering object's interface

Parameters
objectspecifies the object to query.
iidToQueryis the PMIID to query.
Returns
the interface pointer for the requested interface.
virtual void IColorSystemUtils::ReleaseColorSpace (AGMColorSpace * colorSpace)
pure virtual

Release the AGMColorSpace. This is the AGMColorSpace created from GetAGMColorSpace, GetAGMColorSpaceFromColorSwatch, and GetColorSpaceAndColorValue().

Parameters
colorSpacespecifies the AGMColorSpace to be released.
virtual void IColorSystemUtils::RGBToHSB (PMReal r,
PMReal g,
PMReal b,
PMRealh,
PMReals,
PMRealv 
)
pure virtual

RGBToHSB() a utility function to convert the RGBColor Values to their corresponding HSBColor Values. HSB is also known as HSV, argument name uses v instead of b to not to conflict with b of rgb.

virtual void IColorSystemUtils::SetColorSpaceAndColorValue (IGraphicsPortgPort,
int32 colorFamily,
const ColorArraycolorArray,
const PMRealtint,
const UIDListpInkUIDList = nil 
)
pure virtual

Set the color value and color space specified by colorFamily and colorArray in the given port. This version ignores the view port settings. It uses the default CMS off settings. It assumed the target graphic port is screen. To accurately reflect the color in the graphics port, use the version which specifies the complete color data.

Parameters
gPortspecifies the graphic port for this AGMColorSpace.
IColorDataspecifies the color data.
tintspecifies the tint percentage of the color swatch.
inkUIDListspecifies the ink components for this color.
virtual void IColorSystemUtils::SetColorSpaceAndColorValue (IGraphicsPortgPort,
IColorDataiColorData,
IColorDataiAltColorData,
IInkDataiInkData,
IColorOverridesiCORides,
IColorSpaceMgriCSMgr,
const PMRealtint 
)
pure virtual

Set the color value and color space in the given port. This version is only called from within the implementation of ColorRenderingObject.

Parameters
gPortspecifies the graphic port for this AGMColorSpace.
IColorDataspecifies the color data.
iAltColorDataspecifies the alternate color data.
iInkDataspecifies the ink data.
iCORidesspecifies the color overrides data.
iCSMgrspecifies the color managment manager to use.
tintspecifies the tint percentage of the color object.
virtual bool32 IColorSystemUtils::ShouldIgnorePaperColor (IViewPortAttributesiAttr)
pure virtual

Returns true iff, given the viewport attributes, the paper swatch should be represented by CMYK white (or whatever other paper strategy is appropriate for the port) as opposed to its native color as defined in the swatch list. At present this returns true when printing, when previewing overprint, or when proofing with paper white; but it may be more sophisticated in the future.

Parameters
iAttrThe view port attributes to inspect.
Returns
True if the Paper swatch should be drawn with CMYK white.