Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit.common.ColorSpace Class Reference
Inheritance diagram for foxit.common.ColorSpace:

## Public Types
enum | RenderingIntent { RenderingIntent.e_RenderIntentPerceptual = 0, RenderingIntent.e_RenderIntentRelColorimetric = 1, RenderingIntent.e_RenderIntentSaturation = 2, RenderingIntent.e_RenderIntentAbsColorimetric = 3 }
| Enumeration for rendering intent. More...

## Public Member Functions
| ColorSpace (ColorSpaceType type)
| Constructor, with specified color type. More...
| ColorSpace (ColorSpace other)
| Constructor, with another color space object. More...
Color | ConvertColor (Color color)
| Convert input color to the color in current color space. More...
Color | ConvertColor (int r_value, int g_value, int b_value)
| Convert input R/G/B component values to a color in current color space. More...
Color | ConvertColor (int c_value, int m_value, int y_value, int k_value)
| Convert input C/M/Y/K component values to a color object in current color space. More...
ColorSpaceType | GetColorSpaceType ()
| Get color space type. More...
int | GetComponentCount ()
| Get the count of components. More...
StringArray | GetComponentNames ()
| Get a string array which represents the name of colorant for Separation color space, or names specifying the individual color components for DeviceN color space. More...
bool | IsEmpty ()
| Check whether current object is empty or not. More...
bool | IsSpotColorSpace ()
| Check whether current color space object is a spot color space or not. More...

## Detailed Description

This class represents color space. User can use this class to covert colors.

## Member Enumeration Documentation

## ◆ RenderingIntent

enum foxit.common.ColorSpace.RenderingIntent
| strong

Enumeration for rendering intent.

Values of this enumeration should be used alone.
Rendering intent can be used for color conversion. Please refer to Section 8.6.5.8 "Rendering intents" in the reference doucment for PDF 2.0 for more details.

Enumerator
e_RenderIntentPerceptual | Rendering intent: Perceptual.
e_RenderIntentRelColorimetric | Rendering intent: Relative Colorimetric.
e_RenderIntentSaturation | Rendering intent: Saturation.
e_RenderIntentAbsColorimetric | Rendering intent: Absolute Colorimetric.

## Constructor & Destructor Documentation

## ◆ ColorSpace() [1/2]

foxit.common.ColorSpace.ColorSpace | ( | ColorSpaceType | type | ) |
| inline

Constructor, with specified color type.

Parameters

  [in] | type | The color space type. Currently, this value can only be one of following values: foxit.common.ColorSpaceType.e_ColorSpaceDeviceGray , foxit.common.ColorSpaceType.e_ColorSpaceDeviceRGB , foxit.common.ColorSpaceType.e_ColorSpaceDeviceCMYK . For other unsupported color space type, exception foxit.common.ErrorCode.e_ErrUnsupported will be thrown.

## ◆ ColorSpace() [2/2]

foxit.common.ColorSpace.ColorSpace | ( | ColorSpace | other | ) |
| inline

Constructor, with another color space object.

Parameters

  [in] | other | Another color space object.

## Member Function Documentation

## ◆ ConvertColor() [1/3]

Color foxit.common.ColorSpace.ConvertColor | ( | Color | color | ) |
| inline

Convert input color to the color in current color space.

Parameters

  [in] | color | Input color, which is to be converted to current color space.

Returns
  Converted color. If the return value of function Color.IsEmpty for the returned color is true, that means the conversion failed.

## ◆ ConvertColor() [2/3]

Color foxit.common.ColorSpace.ConvertColor | ( | int | r_value,
|  | int | g_value,
|  | int | b_value
| ) |  |
| inline

Convert input R/G/B component values to a color in current color space.

Parameters

  [in] | r_value | R component value. Valid range: from 0 to 255.
  [in] | g_value | G component value. Valid range: from 0 to 255.
  [in] | b_value | B component value. Valid range: from 0 to 255.

Returns
  Converted color. If the return value of function Color.IsEmpty for the returned color is true, that means the conversion failed.

## ◆ ConvertColor() [3/3]

Color foxit.common.ColorSpace.ConvertColor | ( | int | c_value,
|  | int | m_value,
|  | int | y_value,
|  | int | k_value
| ) |  |
| inline

Convert input C/M/Y/K component values to a color object in current color space.

Parameters

  [in] | c_value | C component value. Valid range: from 0 to 255.
  [in] | m_value | M component value. Valid range: from 0 to 255.
  [in] | y_value | Y component value. Valid range: from 0 to 255.
  [in] | k_value | K component value. Valid range: from 0 to 255.

Returns
  Converted color. If the return value of function Color.IsEmpty for the returned color is true, that means the conversion failed.

## ◆ GetColorSpaceType()

ColorSpaceType foxit.common.ColorSpace.GetColorSpaceType | ( |  | ) |
| inline

Get color space type.

Returns
  Color space type. Please refer to values starting from foxit.common.ColorSpaceType.e_ColorSpaceInvalid and this would be one of these values.

## ◆ GetComponentCount()

int foxit.common.ColorSpace.GetComponentCount | ( |  | ) |
| inline

Get the count of components.

For different color space type, the count of components are not the same.

Returns
  Count of components.

## ◆ GetComponentNames()

StringArray foxit.common.ColorSpace.GetComponentNames | ( |  | ) |
| inline

Get a string array which represents the name of colorant for Separation color space, or names specifying the individual color components for DeviceN color space.

This function is only available when current color space type is foxit.common.ColorSpaceType.e_ColorSpaceSeparation or foxit.common.ColorSpaceType.e_ColorSpaceDeviceN . For other color space type, this function will return an empty string array.

Returns
  A string array of name(s).

  - For Separation color space, the count of returned array will be only one and the string specifies the name of colorant.

  - For DeviceN color space, there can be several strings in returned array and they specify the individual color components.

## ◆ IsEmpty()

bool foxit.common.ColorSpace.IsEmpty | ( |  | ) |
| inline

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ IsSpotColorSpace()

bool foxit.common.ColorSpace.IsSpotColorSpace | ( |  | ) |
| inline

Check whether current color space object is a spot color space or not.

Returns
  true means current object is spot color space, while false means not.