Adobe.com
Contents Suites Classes Class Index Member Index

ai::ColorSpace Class Reference

This class represents an Illustrator color space. More...

#include <IAIColorSpace.hpp>

List of all members.

Public Types

enum  Family {
  kAIColorSpaceFamilyUnknown, kAIColorSpaceFamilyGray, kAIColorSpaceFamilyRGB, kAIColorSpaceFamilyLab,
  kAIColorSpaceFamilyCMYK, kAIColorSpaceFamilySeparation, kAIColorSpaceFamilyNChannel, kAIColorSpaceFamilyIndexed
}

Public Member Functions

ai::ColorSpaceoperator= (const ai::ColorSpace &rhs)
 Assignment operator.
bool operator== (const ai::ColorSpace &rhs) const
 Equality operator.
bool operator!= (const ai::ColorSpace &rhs) const
 Inequality operator.
bool IsValid (void) const
 Reports whether this color space is valid.
ai::ColorSpace::Family GetFamily (void) const
 Retrieves the family of this color space.
bool HasAlpha (void) const
 Reports whether this color space has an alpha channel.
int NumComponents (void) const
 Retrieves the number of components in this color space, including the alpha channel if present.
int NumColorComponents (void) const
 Retrieves the number of color components in this color space, excluding the alpha channel if present.
int NumSpotComponents (void) const
 Retrieves the number of spot components in this color space.
int NumProcessComponents (void) const
 Retrieves the number of process components in this color space, which is the number of color components, minus the number of spot components.
ai::ColorSpace BaseColorSpace (void) const
 Retrieves the base color space for this indexed color space, or the alternate color space for this separation or n-channel color space.
int IndexedNumComponents (void) const
 Retrieves the number of components in the index color table of this indexed color space.
int IndexedNumEntries (void) const
 Retrieves the number of entries in the index color table of this indexed color space.
const ASUInt8IndexedTable (void) const
 Retrieves the color table of this indexed color space.
const ASUInt8IndexedColors (ASUInt8 index) const
 Retrieves an entry from the color table of this indexed color space.
const AIFloatSeparationAltColors (void) const
 Retrieves the alternate color values in the alternate color space for this separation color space.
ai::ColorSpaceList GetColorSpaceList (void) const
 Retrieves the fully-specified color space list for this color space.
ai::UnicodeString NthColorant (ai::int32 n) const
 Retrieves the name of a colorant for this color space.
bool HasFullSetOfProcessComponents (void) const
 Reports whether this color space has all process components.
void deleteImpl (void)
const CAIColorSpaceImpl * getImpl (void) const
 ColorSpace (CAIColorSpaceImpl *impl)
Constructors & Destructors



 ColorSpace (void) AINOTHROW
 Constructs an empty, invalid color space object.
 ColorSpace (ai::ColorSpace::Family family, bool hasAlpha=false)
 Constructs a standard color space object.
 ColorSpace (int separationNum, bool hasAlpha=false)
 Constructs a process separation color space.
 ColorSpace (const AICustomColorHandle customColor, bool hasAlpha=false)
 Constructs a color space based on the global custom color.
 ColorSpace (const ai::ColorSpaceList &csList, bool hasAlpha=false, bool promoteToProcess=false)
 Constructs an n-channel color space using a fully specified color space list.
 ColorSpace (const ai::ColorSpace &baseCs, int numComponents, int numEntries, const ASUInt8 *lookup)
 Constructs an indexed color space.
 ColorSpace (const ai::ColorSpace &baseCs, bool hasAlpha)
 Constructs a color space based on another color space.
 ColorSpace (const ai::ColorSpace &cs)
 Copy constructor.
 ~ColorSpace ()
 Destructor.

Friends

class ColorSpaceList

Detailed Description

This class represents an Illustrator color space.


Member Enumeration Documentation

Enumerator:
kAIColorSpaceFamilyUnknown 
kAIColorSpaceFamilyGray 
kAIColorSpaceFamilyRGB 
kAIColorSpaceFamilyLab 
kAIColorSpaceFamilyCMYK 
kAIColorSpaceFamilySeparation 
kAIColorSpaceFamilyNChannel 
kAIColorSpaceFamilyIndexed 

Constructor & Destructor Documentation

ai::ColorSpace::ColorSpace ( void   )  [explicit]

Constructs an empty, invalid color space object.

Throws no exceptions.

ai::ColorSpace::ColorSpace ( ai::ColorSpace::Family  family,
bool  hasAlpha = false 
) [explicit]

Constructs a standard color space object.

Parameters:
family The color space family (Gray, RGB, CMYK, or LAB).
hasAlpha True if alpha channel is present.
Returns:
The new color space object.
ai::ColorSpace::ColorSpace ( int  separationNum,
bool  hasAlpha = false 
) [explicit]

Constructs a process separation color space.

Parameters:
separationNum Process-separation plate number of the base CMYK color space.
0: Cyan
1: Magenta
2: Yellow
3: Black
hasAlpha True if alpha channel is present.
Returns:
The new color space object.
ai::ColorSpace::ColorSpace ( const AICustomColorHandle  customColor,
bool  hasAlpha = false 
) [explicit]

Constructs a color space based on the global custom color.

Parameters:
customColor The global custom color object.
hasAlpha True if alpha channel is present.
Returns:
The new global process color space object, or, if the custom color is a spot color, a spot separation color space object.
ai::ColorSpace::ColorSpace ( const ai::ColorSpaceList csList,
bool  hasAlpha = false,
bool  promoteToProcess = false 
) [explicit]

Constructs an n-channel color space using a fully specified color space list.

Parameters:
csList The list of component color spaces, which must conform to all requirements of an n-channel color space, including at most one process color space and no duplicate channels, with all RGB or Lab channels present and in order.
hasAlpha True if alpha channel is present.
promoteToProcess True to construct an equivalent process color space instead of a NChannel color space if it is possible. For example, if the input color space list contains the full process components and has no spot components, an equivalent process color space representation exists and is returned.
Returns:
The new color space object.
ai::ColorSpace::ColorSpace ( const ai::ColorSpace baseCs,
int  numComponents,
int  numEntries,
const ASUInt8 lookup 
) [explicit]

Constructs an indexed color space.

Parameters:
baseCs The base color space of the indexed color space.
numComponents The number of components in the color lookup table. For an RGB indexed table, can be 3 or 4.
numEntries number of entries in the color lookup table.
lookup The color lookup table, numComponents rows by numEntries columns. A 4-component RGB table must be in 0RGB byte order.
Returns:
The new color space object.
ai::ColorSpace::ColorSpace ( const ai::ColorSpace baseCs,
bool  hasAlpha 
) [explicit]

Constructs a color space based on another color space.

The alpha channel, if present, is ignored in constructing the new color space.

Parameters:
baseCs The input color space.
hasAlpha True if alpha channel is to be present in the new color space.
Returns:
The new color space object.
ai::ColorSpace::ColorSpace ( const ai::ColorSpace cs  ) 

Copy constructor.

Parameters:
cs the color space to copy.
Returns:
The new color space object.
ai::ColorSpace::~ColorSpace (  ) 

Destructor.

ai::ColorSpace::ColorSpace ( CAIColorSpaceImpl *  impl  )  [explicit]

Member Function Documentation

ai::ColorSpace ai::ColorSpace::BaseColorSpace ( void   )  const

Retrieves the base color space for this indexed color space, or the alternate color space for this separation or n-channel color space.

Returns:
The base or alternate color space, or, for a standard color space, this color space itself.
void ai::ColorSpace::deleteImpl ( void   ) 
ai::ColorSpaceList ai::ColorSpace::GetColorSpaceList ( void   )  const

Retrieves the fully-specified color space list for this color space.

Throws bad-parameter error if this is an indexed color space.

Returns:
The color space list object.
ai::ColorSpace::Family ai::ColorSpace::GetFamily ( void   )  const

Retrieves the family of this color space.

Returns:
The color space family constant.
const CAIColorSpaceImpl* ai::ColorSpace::getImpl ( void   )  const
bool ai::ColorSpace::HasAlpha ( void   )  const

Reports whether this color space has an alpha channel.

An indexed color space has an alpha channel if and only if its base color space has an alpha channel.

Returns:
True if the color space has an alpha channel, false otherwise.
bool ai::ColorSpace::HasFullSetOfProcessComponents ( void   )  const

Reports whether this color space has all process components.

Returns:
True if the color space has all process components
False if the color space has no process components, or for spot, separation, or process separation color spaces.
const ASUInt8* ai::ColorSpace::IndexedColors ( ASUInt8  index  )  const

Retrieves an entry from the color table of this indexed color space.

Parameters:
index The 0-based index position of the entry.
Returns:
A pointer to the entry, or NULL if the index is out of range.
int ai::ColorSpace::IndexedNumComponents ( void   )  const

Retrieves the number of components in the index color table of this indexed color space.

Throws bad-parameter error for non-indexed color spaces.

Returns:
The number of color table components.
int ai::ColorSpace::IndexedNumEntries ( void   )  const

Retrieves the number of entries in the index color table of this indexed color space.

Throws bad-parameter error for non-indexed color spaces.

Returns:
The number of color table entries.
const ASUInt8* ai::ColorSpace::IndexedTable ( void   )  const

Retrieves the color table of this indexed color space.

Throws bad-parameter error for non-indexed color spaces.

Returns:
A pointer to the color table.
bool ai::ColorSpace::IsValid ( void   )  const

Reports whether this color space is valid.

Returns:
True if the color space is valid, false otherwise.
ai::UnicodeString ai::ColorSpace::NthColorant ( ai::int32  n  )  const

Retrieves the name of a colorant for this color space.

Throws bad-parameter error if index is out of range.

Parameters:
n The 0-based index of the colorant, less than NumColorComponents().
Returns:
"Gray" for Gray color spaces.
"Red","Green", or "Blue" for RGB color spaces.
"Cyan","Magenta","Yellow", or "Black" for CMYK color spaces.
Empty strings for LAB color spaces.
int ai::ColorSpace::NumColorComponents ( void   )  const

Retrieves the number of color components in this color space, excluding the alpha channel if present.

For an indexed color space, this is the number of color components in its base color space.

Returns:
The number of color components.
int ai::ColorSpace::NumComponents ( void   )  const

Retrieves the number of components in this color space, including the alpha channel if present.

An indexed color space has only one component in addition to the possible alpha component (not the number of color components in the base color space).

Returns:
The number of components.
int ai::ColorSpace::NumProcessComponents ( void   )  const

Retrieves the number of process components in this color space, which is the number of color components, minus the number of spot components.

Returns:
The number of process components.
int ai::ColorSpace::NumSpotComponents ( void   )  const

Retrieves the number of spot components in this color space.

Ignores the alpha channel, if present.

Returns:
0 for CMYK, RGB, Gray, Lab, and process separations.
1 for spot separations
For an Indexed color space, the number of spot color components in its base color space.
bool ai::ColorSpace::operator!= ( const ai::ColorSpace rhs  )  const

Inequality operator.

ai::ColorSpace& ai::ColorSpace::operator= ( const ai::ColorSpace rhs  ) 

Assignment operator.

bool ai::ColorSpace::operator== ( const ai::ColorSpace rhs  )  const

Equality operator.

const AIFloat* ai::ColorSpace::SeparationAltColors ( void   )  const

Retrieves the alternate color values in the alternate color space for this separation color space.

Throws bad-parameter error for non-separation color spaces.

Returns:
A pointer to the array of color values.

Friends And Related Function Documentation

friend class ColorSpaceList [friend]

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


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2016 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks