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: PDFL
Platform availability: Macintosh, Windows, UNIX

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

Examples

go to source arrow volatile PDEColorSpace cs = NULL;
go to source arrow PDEColorSpace pdeColorSpace = NULL; /* ColorSpace */
go to source arrow PDEColorSpace pdeColorSpace = NULL; /* ColorSpace */

more...

File: PEExpT.h
Line: 321


Union Detail
PDEColorSpaceStruct

Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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: 2251

Elements

Method Detail
PDEColorSpaceCreate()
Product availability: 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

Examples

go to source arrow gState.fillColorSpec.space = PDEColorSpaceCreate(ASAtomFromString("Pattern"), &pdeCSStruct);

File: PEWProcs.h
Line: 1590
PDEColorSpaceCreateFromCosObj() 
Product availability: 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: 1070
PDEColorSpaceCreateFromName() 
Product availability: 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

Examples

go to source arrow cs = PDEColorSpaceCreateFromName(csAtom);
go to source arrow pdeColorSpace = PDEColorSpaceCreateFromName(ASAtomFromString("DeviceGray"));
go to source arrow pdeColorSpace = PDEColorSpaceCreateFromName(ASAtomFromString("DeviceGray"));

more...

File: PEWProcs.h
Line: 1042
PDEColorSpaceCreateInCosDoc() 
Product availability: 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: 3453
PDEColorSpaceGetBase() 
Product availability: 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

Examples

go to source arrow if (PDEColorSpaceGetBase(srcColorSpace) == ASAtomFromString("DeviceRGB"))

File: PERProcs.h
Line: 1291
PDEColorSpaceGetBaseNumComps() 
Product availability: 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

Examples

go to source arrow ASInt32 baseNumComps = PDEColorSpaceGetBaseNumComps(srcColorSpace);

File: PERProcs.h
Line: 1612
PDEColorSpaceGetCosObj() 
Product availability: 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

Note

(For the Adobe PDF Library v1 only) If you get the PDEColorSpace for an inline image and then get the CosObj for that color space with PDEColorSpaceGetCosObj(), this CosObj is limited. Cos objects that are the result of parsing inline dictionaries in the PDF page contents are a special class of Cos objects. You should never depend on these objects to last for the lifetime of the document. You should extract the information you need from the object immediately and refer to it no further in your code.

File: PERProcs.h
Line: 1236
PDEColorSpaceGetCTable() 
Product availability: 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

Examples

go to source arrow PDEColorSpaceGetCTable (srcColorSpace, bufLUT);

File: PERProcs.h
Line: 1326
PDEColorSpaceGetHiVal() 
Product availability: 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

Examples

go to source arrow ASInt32 sizeLUT = PDEColorSpaceGetHiVal(srcColorSpace) + 1;

File: PERProcs.h
Line: 1305
PDEColorSpaceGetName() 
Product availability: 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

Examples

go to source arrow if (PDEColorSpaceGetName(srcColorSpace) == ASAtomFromString("Indexed"))

File: PERProcs.h
Line: 1207
PDEColorSpaceGetNumComps() 
Product availability: 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

Examples

go to source arrow CosDictPut(jpxParams, ASAtomFromString("Colors"), CosNewInteger( cosDoc, false, PDEColorSpaceGetNumComps(srcColorSpace)));

File: PERProcs.h
Line: 1266
PDEColorSpaceGetStruct() 
Product availability: 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: 3300