public class

ColorPt

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.ColorPt

Class Overview

ColorPt is an array of colorants (or tint values) representing a color point in an associated color space.

Summary

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

Public Constructors

public ColorPt ()

Instantiates a new color point

public ColorPt (double x, double y, double z)

Instantiates a new color point

public ColorPt (double x, double y, double z, double w)

Instantiates a new color point

Public Methods

public static ColorPt __Create (long impl)

public long __GetHandle ()

public void destroy ()

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.

public boolean equals (Object other)

public 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. To find how many colorant are associated with a given color space use color_space.GetComponentNum().

Parameters
colorant_index a colorant_index
Returns
  • the tint value

public int hashCode ()

public void set (int colorant_index, double colorant_value)

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.

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

public void set ()

Set the first 4 tint values to zero

public void set (double x, double y, double z, double w)

Set the first tint values to specified values

public void setColorantNum (int num)

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

Parameters
num the new colorant number