#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) | |
ColorSpace (const ColorSpace &c) | |
ColorSpace & | operator= (const ColorSpace &c) |
~ColorSpace () | |
Type | GetType () const |
SDF::Obj | GetSDFObj () |
int | GetComponentNum () |
void | InitColor (ColorPt &out_colorants) |
void | InitComponentRanges (std::vector< double > &out_decode_low, std::vector< double > &out_decode_range) |
ColorPt | Convert2Gray (const ColorPt &in_color) |
void | Convert2Gray (const ColorPt &in_color, ColorPt &out_color) |
ColorPt | Convert2RGB (const ColorPt &in_color) |
void | Convert2RGB (const ColorPt &in_color, ColorPt &out_color) |
ColorPt | Convert2CMYK (const ColorPt &in_color) |
void | Convert2CMYK (const ColorPt &in_color, ColorPt &out_color) |
ColorSpace | GetAlternateColorSpace () |
ColorSpace | GetBaseColorSpace () |
int | GetHighVal () |
const UChar * | GetLookupTable () |
ColorPt | GetBaseColor (UChar color_idx) |
void | GetBaseColor (UChar color_idx, ColorPt &out_color) |
bool | IsNone () |
bool | IsAll () |
Function | GetTintFunction () |
void | Destroy () |
Static Public Member Functions | |
static ColorSpace | CreateDeviceGray () |
static ColorSpace | CreateDeviceRGB () |
static ColorSpace | CreateDeviceCMYK () |
static ColorSpace | CreatePattern () |
static ColorSpace | CreateICC (SDF::SDFDoc &doc, const UString &filepath) |
static ColorSpace | CreateICC (SDF::SDFDoc &doc, Filters::Filter stm) |
static ColorSpace | CreateICC (SDF::SDFDoc &doc, const UChar *buf, size_t buf_sz) |
static int | GetComponentNum (Type cs_type, SDF::Obj cs) |
static Type | GetType (SDF::Obj cs) |
This abstract class is used to serve as a color space tag to identify the specific color space of a Color object. 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.
Definition at line 138 of file ColorSpace.h.
Enumerator | |
---|---|
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 |
Definition at line 186 of file ColorSpace.h.
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.
color_space | The Cos/SDF object to initialze the ColorSpace object with. |
pdftron::PDF::ColorSpace::ColorSpace | ( | const ColorSpace & | c | ) |
pdftron::PDF::ColorSpace::~ColorSpace | ( | ) |
Destructor
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 |
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 |
|
static |
Create a new DeviceCMYK ColorSpace object
|
static |
Create a new DeviceGray ColorSpace object
|
static |
Create a new DeviceRGB ColorSpace object
|
static |
Create a PDF 'ICCBased' color space given an ICC profile
|
static |
|
static |
|
static |
Create a new Pattern ColorSpace object
void pdftron::PDF::ColorSpace::Destroy | ( | ) |
Frees the native memory of the object.
ColorSpace pdftron::PDF::ColorSpace::GetAlternateColorSpace | ( | ) |
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 |
ColorSpace pdftron::PDF::ColorSpace::GetBaseColorSpace | ( | ) |
cs_type | The color space type. |
cs | Cos/SDF color space object. |
int pdftron::PDF::ColorSpace::GetComponentNum | ( | ) |
int pdftron::PDF::ColorSpace::GetHighVal | ( | ) |
const UChar* pdftron::PDF::ColorSpace::GetLookupTable | ( | ) |
SDF::Obj pdftron::PDF::ColorSpace::GetSDFObj | ( | ) |
Function pdftron::PDF::ColorSpace::GetTintFunction | ( | ) |
cs | Cos/SDF color space object. |
Type pdftron::PDF::ColorSpace::GetType | ( | ) | const |
void pdftron::PDF::ColorSpace::InitColor | ( | ColorPt & | out_colorants | ) |
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].
out_decode_low | a vector of numbers representing the lower bound for each color component. |
out_decode_range | a vector of numbers representing the difference between high and low bound for each color component. |
bool pdftron::PDF::ColorSpace::IsAll | ( | ) |
bool pdftron::PDF::ColorSpace::IsNone | ( | ) |
ColorSpace& pdftron::PDF::ColorSpace::operator= | ( | const ColorSpace & | c | ) |