Foxit PDF RDK

Public Member Functions | Static Public Attributes | List of all members
ColorSpace Class Reference

## Public Member Functions
| constructor (type)
| Constructor, with specified color type. More...
| ConvertColor (c_value, m_value, y_value, k_value)
| Convert input C/M/Y/K component values to a color object in current color space. More...
| ConvertColor (color)
| Convert input color to the color in current color space. More...
| ConvertColor (r_value, g_value, b_value)
| Convert input R/G/B component values to a color in current color space. More...
| GetColorSpaceType ()
| Get color space type. More...
| GetComponentCount ()
| Get the count of components. More...
| 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...
| IsEmpty ()
| Check whether current object is empty or not. More...
| IsSpotColorSpace ()
| Check whether current color space object is a spot color space or not. More...

## Static Public Attributes
static | e_RenderIntentAbsColorimetric
| Rendering intent: Absolute Colorimetric.
static | e_RenderIntentPerceptual
| Enumeration for rendering intent. More...
static | e_RenderIntentRelColorimetric
| Rendering intent: Relative Colorimetric.
static | e_RenderIntentSaturation
| Rendering intent: Saturation.

## Detailed Description

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

## Member Function Documentation

## ◆ constructor()

ColorSpace.constructor | ( | type |  | ) |

Constructor, with specified color type.

Parameters

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

## ◆ ConvertColor() [1/3]

ColorSpace.ConvertColor | ( | c_value | ,
|  | m_value | ,
|  | y_value | ,
|  | k_value |
| ) |  |

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.

## ◆ ConvertColor() [2/3]

ColorSpace.ConvertColor | ( | color |  | ) |

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() [3/3]

ColorSpace.ConvertColor | ( | r_value | ,
|  | g_value | ,
|  | b_value |
| ) |  |

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.

## ◆ GetColorSpaceType()

ColorSpace.GetColorSpaceType | ( |  | ) |

Get color space type.

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

## ◆ GetComponentCount()

ColorSpace.GetComponentCount | ( |  | ) |

Get the count of components.

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

Returns
  Count of components.

## ◆ GetComponentNames()

ColorSpace.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.

This function is only available when current color space type is e_ColorSpaceSeparation or 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()

ColorSpace.IsEmpty | ( |  | ) |

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()

ColorSpace.IsSpotColorSpace | ( |  | ) |

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.

## Member Data Documentation

## ◆ e_RenderIntentPerceptual

ColorSpace.e_RenderIntentPerceptual
| static

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.

Rendering intent: Perceptual.