java.lang.Object | |
↳ | com.pdftron.pdf.ColorSpace |
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.
Note: In Pattern color space (i.e. for ColorSpace::e_pattern) 'color values' are PDF::PatternColor objects instead of the numeric component values (i.e. ColorPt) used with other spaces.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | e_cal_gray | The Constant e_cal_gray. | |||||||||
int | e_cal_rgb | The Constant e_cal_rgb. | |||||||||
int | e_device_cmyk | The Constant e_device_cmyk. | |||||||||
int | e_device_gray | The Constant e_device_gray. | |||||||||
int | e_device_n | The Constant e_device_n. | |||||||||
int | e_device_rgb | The Constant e_device_rgb. | |||||||||
int | e_icc | The Constant e_icc. | |||||||||
int | e_indexed | The Constant e_indexed. | |||||||||
int | e_lab | The Constant e_lab. | |||||||||
int | e_null | The Constant e_null. | |||||||||
int | e_pattern | The Constant e_pattern. | |||||||||
int | e_separation | The Constant e_separation. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ColorSpace(Obj color_space)
Create a ColorSpace from the given SDF/Cos object listed under ColorSpaces entry
in page Resource dictionary.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static ColorSpace | __Create(long impl, Object ref) | ||||||||||
ColorPt |
convert2CMYK(ColorPt in_color)
A convenience function used to convert color points from the current
color space to DeviceCMYK color space.
| ||||||||||
ColorPt |
convert2Gray(ColorPt in_color)
A convenience function used to convert color points from the current
color space to DeviceGray color space.
| ||||||||||
ColorPt |
convert2RGB(ColorPt in_color)
A convenience function used to convert color points from the current
color space to DeviceRGB color space.
| ||||||||||
static ColorSpace |
createDeviceCMYK()
Create a new DeviceCMYK ColorSpace object.
| ||||||||||
static ColorSpace |
createDeviceGray()
Create a new DeviceGray ColorSpace object.
| ||||||||||
static ColorSpace |
createDeviceRGB()
Create a new DeviceRGB ColorSpace object.
| ||||||||||
static ColorSpace |
createICCFromBuffer(Doc doc, byte[] data)
Creates the icc from buffer in the given document
| ||||||||||
static ColorSpace |
createICCFromFile(Doc doc, String filepath)
Create a PDF 'ICCBased' color space given an ICC profile in the given document
| ||||||||||
static ColorSpace |
createICCFromFilter(Doc doc, Filter filter)
Creates the icc from filter in the given document
| ||||||||||
static ColorSpace |
createPattern()
Create a new Pattern ColorSpace object.
| ||||||||||
ColorSpace |
getAlternateColorSpace()
Get the alternate color space.
| ||||||||||
ColorPt |
getBaseColor(byte color_idx)
Get the base color given a component value (index) in Indexed color space.
| ||||||||||
ColorSpace |
getBaseColorSpace()
Get the base color space.
| ||||||||||
static int |
getComponentNum(int cs_type, Obj cs)
Get the number of components (tint components) used to represent color point for
this color space
| ||||||||||
int |
getComponentNum()
Get the component number
| ||||||||||
byte[] |
getLookupTable()
Get the lookup table.
| ||||||||||
Obj |
getSDFObj()
Get the SDFObj
| ||||||||||
Function |
getTintFunction()
Get the tint function.
| ||||||||||
int |
getType()
Get ColorSpace type
| ||||||||||
static int |
getType(Obj cs)
Get type from specified ColorSpace object
| ||||||||||
void |
initColor(ColorPt out_colorants)
Set color to the initial value used for this color space.
| ||||||||||
void |
initComponentRanges(double[] out_decode_low, double[] out_decode_range)
Initialize default ranges for each color component in the color space.
| ||||||||||
boolean |
isAll()
Checks if Separation color space contains the colorant All.
| ||||||||||
boolean |
isNone()
Checks if Separation or DeviceN color space contains None colorants.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The Constant e_cal_gray.
The Constant e_cal_rgb.
The Constant e_device_cmyk.
The Constant e_device_gray.
The Constant e_device_n.
The Constant e_device_rgb.
The Constant e_icc.
The Constant e_indexed.
The Constant e_lab.
The Constant e_null.
The Constant e_pattern.
The Constant e_separation.
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 input color space as Obj |
---|
A convenience function used to convert color points from the current color space to DeviceCMYK color space.
Note: the number to input colorants must match the number of colorants expected by the current color space.
in_color | input color point in the current color space |
---|
PDFNetException |
---|
A convenience function used to convert color points from the current color space to DeviceGray color space.
Note: the number to input colorants must match the number of colorants expected by the current color space.
in_color | input color point in the current color space |
---|
PDFNetException |
---|
A convenience function used to convert color points from the current color space to DeviceRGB color space.
Note: the number to input colorants must match the number of colorants expected by the current color space.
in_color | input color point in the current color space |
---|
PDFNetException |
---|
Creates the icc from buffer in the given document
doc | the input document |
---|---|
data | the input buffer |
PDFNetException |
---|
Create a PDF 'ICCBased' color space given an ICC profile in the given document
doc | input document |
---|---|
filepath | input document filepath |
PDFNetException |
---|
Creates the icc from filter in the given document
doc | the input document |
---|---|
filter | the input filter |
PDFNetException |
---|
Get the alternate color space.
PDFNetException |
---|
Get the base color given a component value (index) in Indexed color space.
Note: for color spaces other than Indexed this method throws an exception.
color_idx | color value represented in the index color space |
---|
PDFNetException |
---|
Get the base color space.
PDFNetException |
---|
Get the number of components (tint components) used to represent color point for this color space
cs_type | ColorSpace type |
---|---|
cs | Cos/SDF color space object. |
PDFNetException |
---|
Get the component number
PDFNetException |
---|
Get the lookup table.
Note: for color spaces other than Indexed this method throws an exception.
PDFNetException |
---|
Get the tint function.
Note: for color spaces other than Separation this method throws an exception.
PDFNetException |
---|
Get type from specified ColorSpace object
cs | Cos/SDF color space object. |
---|
PDFNetException |
---|
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).
out_colorants | initial value |
---|
PDFNetException |
---|
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].
Note: the size of resulting vectors will match the number of color components in this color space
out_decode_low | an array of numbers representing the lower bound for each color component. |
---|---|
out_decode_range | an array of numbers representing the difference between high and low bound for each color component. |
PDFNetException | . |
---|
Checks if Separation color space contains the colorant All.
Note: for color spaces other than Separation this method throws an exception.
PDFNetException |
---|
Checks if Separation or DeviceN color space contains None colorants.
Note: for color spaces other than Separation or DeviceN this method throws an exception.
PDFNetException |
---|