java.lang.Object | |
↳ | com.pdftron.pdf.ColorPt |
ColorPt is an array of colorants (or tint values) representing a color point in an associated color space.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ColorPt()
Instantiates a new color point
| |||||||||||
ColorPt(double x, double y, double z)
Instantiates a new color point
| |||||||||||
ColorPt(double x, double y, double z, double w)
Instantiates a new color point
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static ColorPt | __Create(long impl) | ||||||||||
long | __GetHandle() | ||||||||||
void |
close()
Frees the native memory of the object.
| ||||||||||
void |
destroy()
Frees the native memory of the object.
| ||||||||||
boolean | equals(Object other) | ||||||||||
double |
get(int colorant_index)
Get the tint value at a given colorant index
Note: The number of colorants depends on the associated color space. | ||||||||||
int | hashCode() | ||||||||||
void |
set(int colorant_index, double colorant_value)
Set a tint value at a given colorant index.
| ||||||||||
void |
set()
Set the first 4 tint values to zero
| ||||||||||
void |
set(double x, double y, double z, double w)
Set the first tint values to specified values
| ||||||||||
void |
setColorantNum(int num)
Set the colorant number.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Instantiates a new color point
x | initialized value of first color value (eg. red for rgb colorspace); |
---|---|
y | initialized value of second color value (eg. green for rgb colorspace); |
z | initialized value of third color value (eg. blue for rgb colorspace);
Note:
All colorants should be in the range [0..1], so colors in the range [0..255] should be divided by 255.0 first. |
PDFNetException |
---|
Instantiates a new color point
x | initialized value of first color value (eg. red for rgb colorspace); |
---|---|
y | initialized value of second color value (eg. green for rgb colorspace); |
z | initialized value of third color value (eg. blue for rgb colorspace); |
w | initialized value of fourth color value (eg. when using CMYK);
Note:
All colorants should be in the range [0..1], so colors in the range [0..255] should be divided by 255.0 first. |
PDFNetException |
---|
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Get the tint value at a given colorant index
Note: The number of colorants depends on the associated color space. To find how many colorant are associated with a given color space use color_space.GetComponentNum().
colorant_index | a colorant_index |
---|
PDFNetException |
---|
Set a tint value at a given colorant index.
Note:
For example, the following snippet will initialize the color point to [red, green, blue]: color.setColorantNum(3); color.set(0, red); color.set(1, green); color.set(2, blue); The above code snippet is equivalent to the following line: color.set(red, green, blue)
If a color point has more than 4 colorants, SetColorantNum(num_colorants) must be called before getting or setting tint values.
colorant_index | the color index. For example, for a color point associated with a Gray color space the only allowed value for index is 0. For a color point associated with a CMYK color space, the color_index can range from 0 (cyan) to 4 (black). |
---|---|
colorant_value | The new tint value.
Note:
All colorants should be in the range [0..1], so colors in the range [0..255] should be divided by 255.0 first. |
PDFNetException |
---|
Set the first tint values to specified values
x | initialized value of first color value (eg. red for rgb colorspace); |
---|---|
y | initialized value of second color value (eg. green for rgb colorspace); |
z | initialized value of third color value (eg. blue for rgb colorspace); |
w | initialized value of fourth color value (eg. when using CMYK);
Note:
All colorants should be in the range [0..1], so colors in the range [0..255] should be divided by 255.0 first. |
PDFNetException |
---|
Set the colorant number.
Note: If a color point has more than 4 colorants, SetColorantNum(num_colorants) must be called before getting or setting tint values. The number of colorants depends on the associated color space. To find how many colorant are associated with a given color space use color_space.GetComponentNum().
num | the new colorant number |
---|
PDFNetException |
---|