|
#include <ColorSpace.h>
Public Types | |
| enum | Type { e_device_gray, e_device_rgb, e_device_cmyk, e_cal_gray, e_cal_rgb, e_lab, e_icc, e_indexed, e_pattern, e_separation, e_device_n, e_null } |
Public Member Functions | |
| ColorSpace (SDF::Obj color_space=0) | |
| Create a ColorSpace from the given SDF/Cos object listed under ColorSpaces entry in page Resource dictionary. | |
| ColorSpace (const ColorSpace &c) | |
| ColorSpace & | operator= (const ColorSpace &c) |
| ~ColorSpace () | |
| Destructor. | |
| Type | GetType () const |
| |
| SDF::Obj | GetSDFObj () |
| |
| int | GetComponentNum () |
| |
| void | InitColor (ColorPt &out_colorants) |
| Set color to the initial value used for this color space. | |
| void | InitComponentRanges (std::vector< double > &out_decode_low, std::vector< double > &out_decode_range) |
| Initialize default ranges for each color component in the color space. | |
| void | Convert2Gray (const ColorPt &in_color, ColorPt &out_color) |
| A convenience function used to convert color points from the current color space to DeviceGray color space. | |
| void | Convert2RGB (const ColorPt &in_color, ColorPt &out_color) |
| A convenience function used to convert color points from the current color space to DeviceRGB color space. | |
| void | Convert2CMYK (const ColorPt &in_color, ColorPt &out_color) |
| A convenience function used to convert color points from the current color space to DeviceCMYK color space. | |
| ColorSpace | GetAlternateColorSpace () |
| |
| ColorSpace | GetBaseColorSpace () |
| |
| int | GetHighVal () |
| |
| const UChar * | GetLookupTable () |
| |
| void | GetBaseColor (UChar color_idx, ColorPt &out_color) |
| Get the base color given a component value (index) in Indexed color space. | |
| Function | GetTintFunction () |
| |
| bool | IsAll () |
| |
| bool | IsNone () |
| |
Static Public Member Functions | |
| static ColorSpace | CreateDeviceGray () |
| Create a new DeviceGray ColorSpace object. | |
| static ColorSpace | CreateDeviceRGB () |
| Create a new DeviceRGB ColorSpace object. | |
| static ColorSpace | CreateDeviceCMYK () |
| Create a new DeviceCMYK ColorSpace object. | |
| static ColorSpace | CreatePattern () |
| Create a new Pattern ColorSpace object. | |
| static int | GetComponentNum (Type cs_type, SDF::Obj cs) |
| |
| static Type | GetType (SDF::Obj cs) |
| |
It contains methods that transform colors in a specific color space to/from several color space such as DeviceRGB and DeviceCMYK.
For purposes of the methods in this class, colors are represented as arrays of color components represented as doubles in a normalized range defined by each ColorSpace. For many ColorSpaces (e.g. DeviceRGB), this range is 0.0 to 1.0. However, some ColorSpaces have components whose values have a different range. Methods are provided to inquire per component minimum and maximum normalized values.
| pdftron::PDF::ColorSpace::ColorSpace | ( | SDF::Obj | color_space = 0 |
) |
Create a ColorSpace from the given SDF/Cos object listed under ColorSpaces entry in page Resource dictionary.
If color_space dictionary is null, a non valid ColorSpace object is created.
| pdftron::PDF::ColorSpace::ColorSpace | ( | const ColorSpace & | c | ) |
| pdftron::PDF::ColorSpace::~ColorSpace | ( | ) |
Destructor.
| static ColorSpace pdftron::PDF::ColorSpace::CreateDeviceGray | ( | ) | [static] |
Create a new DeviceGray ColorSpace object.
| static ColorSpace pdftron::PDF::ColorSpace::CreateDeviceRGB | ( | ) | [static] |
Create a new DeviceRGB ColorSpace object.
| static ColorSpace pdftron::PDF::ColorSpace::CreateDeviceCMYK | ( | ) | [static] |
Create a new DeviceCMYK ColorSpace object.
| static ColorSpace pdftron::PDF::ColorSpace::CreatePattern | ( | ) | [static] |
Create a new Pattern ColorSpace object.
| ColorSpace& pdftron::PDF::ColorSpace::operator= | ( | const ColorSpace & | c | ) |
| cs_type | ||
| cs | Cos/SDF color space object. |
| cs | Cos/SDF color space object. |
| Type pdftron::PDF::ColorSpace::GetType | ( | ) | const |
| SDF::Obj pdftron::PDF::ColorSpace::GetSDFObj | ( | ) |
| int pdftron::PDF::ColorSpace::GetComponentNum | ( | ) |
| void pdftron::PDF::ColorSpace::InitColor | ( | ColorPt & | out_colorants | ) |
Set color to the initial value used for this color space.
The initial value depends on the color space (see 4.5.7 in PDF Ref. Manual).
| void pdftron::PDF::ColorSpace::InitComponentRanges | ( | std::vector< double > & | out_decode_low, | |
| std::vector< double > & | out_decode_range | |||
| ) |
Initialize default ranges for each color component in the color space.
For example, default ranges for DeviceRGB are [0 1 0 1 0 1] but for Lab the default values might be [0 100 -100 100 -100 100].
| an | vector of numbers representing the lower bound for each color component. | |
| an | vector of numbers representing the the difference between high and low bound for each color component. |
A convenience function used to convert color points from the current color space to DeviceGray color space.
| in_color | input color point in the current color space | |
| out_color | output color point in the DeviceGray color space |
A convenience function used to convert color points from the current color space to DeviceRGB color space.
| in_color | input color point in the current color space | |
| out_color | output color point in the DeviceRGB color space |
A convenience function used to convert color points from the current color space to DeviceCMYK color space.
| in_color | input color point in the current color space | |
| out_color | output color point in the DeviceCMYK color space |
| ColorSpace pdftron::PDF::ColorSpace::GetAlternateColorSpace | ( | ) |
Color spaces that include alternate color space are e_separation, e_device_n, and e_icc.
| ColorSpace pdftron::PDF::ColorSpace::GetBaseColorSpace | ( | ) |
| int pdftron::PDF::ColorSpace::GetHighVal | ( | ) |
Since the color table is indexed from zero to highval, the actual number of entries is highval + 1. For color spaces other than indexed the method returns 0.
| const UChar* pdftron::PDF::ColorSpace::GetLookupTable | ( | ) |
for color spaces other than indexed the method returns NULL.
Get the base color given a component value (index) in Indexed color space.
| color_idx | color value represented in the index color space | |
| out_color | the color represented in the base (associated) color space |
| Function pdftron::PDF::ColorSpace::GetTintFunction | ( | ) |
| bool pdftron::PDF::ColorSpace::IsAll | ( | ) |
| bool pdftron::PDF::ColorSpace::IsNone | ( | ) |