LayerPDFEdit_Layer
ObjectPDEColorSpace

A PDEColorSpace object is a reference to a color space used on a page. The color space is part of the graphics state attributes of a PDEElement. See Section 4.5, Color Spaces, in the PDF Reference, for details on color spaces and color operators.



Typedef Summary
 Typedef
 PDEColorSpace
A reference to a color space used on a page in a PDF file. The color space is part of the graphics state attributes of a PDEElement.
Union Summary
 Union
 PDEColorSpaceStruct
A color space structure for PDEColorSpaceCreate(). See Section 4.5 in the PDF Reference for information on color spaces.
Method Summary
 Method
 
PDEColorSpace PDEColorSpaceCreate(ASAtom family, PDEColorSpaceStruct* csStruct)
Creates a new color space object of the specified type.
 
PDEColorSpace PDEColorSpaceCreateFromCosObj(const CosObj* cosObjP)
Creates a new color space object from a Cos object.
 
PDEColorSpace PDEColorSpaceCreateFromName(INASAtom name)
Creates a new color space object.
 
PDEColorSpace PDEColorSpaceCreateInCosDoc(INASAtom family, INPDEColorSpaceStruct* csStruct, INCosDoc cosDoc)
Creates a color space object like PDEColorSpaceCreate(), except that the client can specify the CosDoc in which the color space object is created.
 
ASAtom PDEColorSpaceGetBase(INPDEColorSpace colorSpace)
Gets the name of the base color space. This is a helper routine for indexed color spaces.
 
Gets the number of components in the base color space of an indexed color space.
 
void PDEColorSpaceGetCosObj(INPDEColorSpace colorSpace, OUTCosObj* cosObjP)
Gets the CosObj representation of the color space object.
 
void PDEColorSpaceGetCTable(INPDEColorSpace colorSpace, OUTASUns8* colorTableP)
Gets the component information for an indexed color space.
 
ASInt32 PDEColorSpaceGetHiVal(INPDEColorSpace colorSpace)
Gets the highest index for the color lookup table for an indexed color space. Since the color table is indexed from zero to hiVal, the actual number of entries is hiVal + 1.
 
ASAtom PDEColorSpaceGetName(INPDEColorSpace colorSpace)
Gets the name of a color space object.
 
Calculates the number of components in a color space.
 
void PDEColorSpaceGetStruct(INPDEColorSpace cs, OUTPDEColorSpaceStruct* pdeColorSpaceStruct)
Retrieves a PDEColorSpaceStruct from a PDEColorSpace. It supports all PDF version 1.3 color spaces except the Pattern color space.

Typedefs Detail
PDEColorSpace 
Product availability: All
Platform availability: All

Syntax

typedef struct _t_PDEColorSpace* PDEColorSpace;

A reference to a color space used on a page in a PDF file. The color space is part of the graphics state attributes of a PDEElement.

See Also


File: PEExpT.h
Line: 321


Union Detail
PDEColorSpaceStruct

Product availability: All
Platform availability: All

Syntax

union PDEColorSpaceStruct {
 PDEGrayCalFlt calGray; 
 
 PDERGBCalFlt calRGB; 
 
 PDELabCalFlt lab; 
 
 PDEICCBasedColorData icc; 
 
 PDEIndexedColorData indexed; 
 
 PDEPatternColorSpace patternbase; 
 
 PDESeparationColorData sep; 
 
 PDEDeviceNColorData devn; 
}

See Also


File: PEExpT.h
Line: 2115

Elements

Method Detail
PDEColorSpaceCreate()
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEColorSpace PDEColorSpaceCreate(ASAtom family, PDEColorSpaceStruct* csStruct)

Creates a new color space object of the specified type.

Call PDERelease() to dispose of the returned color space object when finished with it.

Parameters

family — 

IN/OUT Supports all PDF 1.3 color spaces, which include:

Type of names

Names

Device-dependent names

  • DeviceCMYK

  • DeviceGray

  • DeviceN

  • DeviceRGB

Device-independent names

  • CalGray

  • CalRGB

  • Lab

  • ICCBased

Special names

  • Indexed

  • Pattern

  • Separation

 
csStruct — 

IN/OUT Data for the type of color space you want to create.

Returns

The newly created color space object.

See Also

Exceptions

cosErrExpectedArray
genErrBadParm
peErrUnknownPDEColorSpace

Since


File: PEWProcs.h
Line: 1586
PDEColorSpaceCreateFromCosObj() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEColorSpace PDEColorSpaceCreateFromCosObj(const CosObj* cosObjP)

Creates a new color space object from a Cos object.

Call PDERelease() to dispose of the returned color space object when finished with it.

Parameters

cosObjP — 

IN/OUT Supports all PDF 1.3 color spaces, which include:

Type of names

Names

Device-dependent names

  • DeviceCMYK

  • DeviceGray

  • DeviceN

  • DeviceRGB

Device-independent names

  • CalGray

  • CalRGB

  • Lab

  • ICCBased

Special names

  • Indexed

  • Pattern

  • Separation

Returns

The newly created color space object.

See Also

Exceptions

cosErrExpectedArray
genErrBadParm
peErrUnknownPDEColorSpace

Since


File: PEWProcs.h
Line: 1068
PDEColorSpaceCreateFromName() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEColorSpace PDEColorSpaceCreateFromName(INASAtom name)

Creates a new color space object.

Call PDERelease() to dispose of the returned color space object when finished with it.

Parameters

name — 

IN/OUT The ASAtom for the name of the color space created. The name must be one of the following: DeviceCMYK, DeviceGray, or DeviceRGB.

Returns

The newly created color space object.

See Also

Exceptions

cosErrExpectedName
genErrBadParm
peErrUnknownPDEColorSpace

Since


File: PEWProcs.h
Line: 1040
PDEColorSpaceCreateInCosDoc() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEColorSpace PDEColorSpaceCreateInCosDoc(INASAtom family, INPDEColorSpaceStruct* csStruct, INCosDoc cosDoc)

Creates a color space object like PDEColorSpaceCreate(), except that the client can specify the CosDoc in which the color space object is created.

Call PDERelease() to dispose of the returned color space object when finished with it.

Parameters

family — 

IN/OUT Supports all PDF 1.3 color spaces, which include:

Type of names

Names

Device-dependent names

  • DeviceCMYK

  • DeviceGray

  • DeviceN

  • DeviceRGB

Device-independent names

  • CalGray

  • CalRGB

  • Lab

  • ICCBased

Special names

  • Indexed

  • Pattern

  • Separation

 
csStruct — 

IN/OUT Data for the type of color space you want to create.

 
cosDoc — 

IN/OUT The document in which to put the Cos representation of resource. It may be NULL.

Returns

The newly created color space object.

See Also

Exceptions

cosErrExpectedArray
genErrBadParm
peErrUnknownPDEColorSpace

Since


File: PEWProcs.h
Line: 3441
PDEColorSpaceGetBase() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASAtom PDEColorSpaceGetBase(INPDEColorSpace colorSpace)

Gets the name of the base color space. This is a helper routine for indexed color spaces.

Call this method to obtain the base color space and color values for an uncolored pattern in PDFEdit.

Parameters

colorSpace — 

The base color space.

Returns

The ASAtom for the name of the base color space. Use ASAtomGetString() to obtain a C string for the ASAtom.

See Also

PDEColorSpaceGetBaseNumCompsNote that the base color values are in the color array in the PDEColorValue field for stroke and fill of a PDEGraphicStateP. Or, they are in the colorObj2 object if the base color space is DeviceN. To get the color values, a client gets the base color space, determines the type and number of components of the value, and looks them up in the PDEColorValue field.

Exceptions

peErrUnknownPDEColorSpace
peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 1289
PDEColorSpaceGetBaseNumComps() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASInt32 PDEColorSpaceGetBaseNumComps(INPDEColorSpace colorSpace)

Gets the number of components in the base color space of an indexed color space.

For example, for [/ Indexed / DeviceRGB...], the number of components is 3.

Parameters

colorSpace — 

IN/OUT The indexed color space.

Returns

The number of components in colorSpace.

See Also

Exceptions

peErrUnknownPDEColorSpace
peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 1610
PDEColorSpaceGetCosObj() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEColorSpaceGetCosObj(INPDEColorSpace colorSpace, OUTCosObj* cosObjP)

Gets the CosObj representation of the color space object.

For image masks, use PDEElementGetGState() to obtain color information.

Parameters

colorSpace — 

IN/OUT The color space whose Cos object is obtained.

 
cosObjP — 

IN/OUT (Filled by the method) The Cos object for the color space.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 1234
PDEColorSpaceGetCTable() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEColorSpaceGetCTable(INPDEColorSpace colorSpace, OUTASUns8* colorTableP)

Gets the component information for an indexed color space.

Parameters

colorSpace — 

IN/OUT The color space whose component information table is obtained.

 
colorTableP — 

IN/OUT (Filled by the method) The color lookup table, which is numComps * (hiVal + 1) bytes long, where numComps is the number of components in the base colorSpace. Each entry in the table contains numComps bytes, and the table is indexed from 0 to hiVal, where hiVal is the highest index in the color table. The table is indexed from 0 to hival, thus the table contains hival + 1 entries.

Exceptions

peErrUnknownPDEColorSpace
peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 1324
PDEColorSpaceGetHiVal() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASInt32 PDEColorSpaceGetHiVal(INPDEColorSpace colorSpace)

Gets the highest index for the color lookup table for an indexed color space. Since the color table is indexed from zero to hiVal, the actual number of entries is hiVal + 1.

Parameters

colorSpace — 

IN/OUT An indexed color space.

Returns

The highest index (hiVal) in the color lookup table.

Exceptions

peErrUnknownPDEColorSpace

Since


File: PERProcs.h
Line: 1303
PDEColorSpaceGetName() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASAtom PDEColorSpaceGetName(INPDEColorSpace colorSpace)

Gets the name of a color space object.

Parameters

colorSpace — 

IN/OUT A color space object.

Returns

The color space object's name. It supports all PDF 1.3 color spaces, which include:

Type of names

Names

Device-dependent names

  • DeviceCMYK

  • DeviceGray

  • DeviceN

  • DeviceRGB

Device-independent names

  • CalGray

  • CalRGB

  • Lab

  • ICCBased

Special names

  • Indexed

  • Pattern

  • Separation

Exceptions

peErrUnknownPDEColorSpace

Since


File: PERProcs.h
Line: 1205
PDEColorSpaceGetNumComps() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASInt32 PDEColorSpaceGetNumComps(INPDEColorSpace colorSpace)

Calculates the number of components in a color space.

Parameters

colorSpace — 

IN/OUT A color space object.

Returns

The number of components in colorSpace:

Color space

Return value

DeviceGray

1

CalGray

1

Separation

1

DeviceRGB

3

CalRGB

3

DeviceCMYK

4

Lab

4

DeviceN

The number of components dependent on the specific color space object.

ICCBased

The number of components dependent on the specific color space object.

Indexed

1

Call PDEColorSpaceGetBaseNumComps() to get the number of components in the base color space.

See Also

Exceptions

peErrUnknownPDEColorSpace
peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 1264
PDEColorSpaceGetStruct() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEColorSpaceGetStruct(INPDEColorSpace cs, OUTPDEColorSpaceStruct* pdeColorSpaceStruct)

Retrieves a PDEColorSpaceStruct from a PDEColorSpace. It supports all PDF version 1.3 color spaces except the Pattern color space.

It is the responsibility of the caller to free the PDEColorSpaceStruct and the underlying allocations.

Parameters

cs — 

IN/OUT The PDEColorSpace for which the structure is required.

 
pdeColorSpaceStruct — 

IN/OUT The PDEColorSpaceStruct created for the color space.

See Also

Exceptions

peErrUnknownPDEColorSpace
genErrBadParm

Since


File: PERProcs.h
Line: 3296