Class ColorPt
ColorPt is an array of colorants (or tint values) representing a color point in an associated color space.
Implements
Inherited Members
Namespace: pdftron.PDF
Assembly: PDFNet.dll
Syntax
public class ColorPt : IDisposable
Constructors
ColorPt()
Instantiates a new ColorPt
object.
Declaration
public ColorPt()
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
ColorPt(double)
Instantiates a new ColorPt
object.
Declaration
public ColorPt(double x)
Parameters
Type | Name | Description |
---|---|---|
double | x | initialized value of first color value (eg. red for rgb colorspace) |
Remarks
All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
ColorPt(double, double)
Instantiates a new ColorPt
object.
Declaration
public ColorPt(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | initialized value of first color value (eg. red for rgb colorspace) |
double | y | initialized value of second color value (eg. green for rgb colorspace) |
Remarks
All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
ColorPt(double, double, double)
Instantiates a new ColorPt
object.
Declaration
public ColorPt(double x, double y, double z)
Parameters
Type | Name | Description |
---|---|---|
double | x | initialized value of first color value (eg. red for rgb colorspace) |
double | y | initialized value of second color value (eg. green for rgb colorspace) |
double | z | initialized value of third color value (eg. blue for rgb colorspace) |
Remarks
All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
ColorPt(double, double, double, double)
Instantiates a new ColorPt
object.
Declaration
public ColorPt(double x, double y, double z, double w)
Parameters
Type | Name | Description |
---|---|---|
double | x | initialized value of first color value (eg. red for rgb colorspace) |
double | y | initialized value of second color value (eg. green for rgb colorspace) |
double | z | initialized value of third color value (eg. blue for rgb colorspace) |
double | w | initialized value of fourth color value (eg. when using CMYK) |
Remarks
All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Methods
Dispose()
Releases all resources used by the ColorPt
Declaration
public override sealed void Dispose()
Dispose(bool)
Declaration
[HandleProcessCorruptedStateExceptions]
protected virtual void Dispose(bool A_0)
Parameters
Type | Name | Description |
---|---|---|
bool | A_0 |
~ColorPt()
Allows a ColorPt to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
Declaration
protected ~ColorPt()
Get(int)
Gets the tint value at a given colorant index.
Declaration
public double Get(int colorant_index)
Parameters
Type | Name | Description |
---|---|---|
int | colorant_index | the colorant_index |
Returns
Type | Description |
---|---|
double | the tint value at the specified colorant index. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Set(double)
Sets the first value x of the ColorPt.
Declaration
public void Set(double x)
Parameters
Type | Name | Description |
---|---|---|
double | x | initialized value of first color value (eg. red for rgb colorspace) |
Remarks
All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Set(double, double)
Sets the first two values x and y of the ColorPt.
Declaration
public void Set(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | initialized value of first color value (eg. red for rgb colorspace) |
double | y | initialized value of second color value (eg. green for rgb colorspace) |
Remarks
All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Set(double, double, double)
Sets the first three values x, y, and z of the ColorPt.
Declaration
public void Set(double x, double y, double z)
Parameters
Type | Name | Description |
---|---|---|
double | x | initialized value of first color value (eg. red for rgb colorspace) |
double | y | initialized value of second color value (eg. green for rgb colorspace) |
double | z | initialized value of third color value (eg. blue for rgb colorspace) |
Remarks
All colorants should be in the range [0..1], so colors in the range [0..255]should be divided by 255.0 first.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Set(double, double, double, double)
A utility method to set the first 4 tint values. For example, color.Set(red, green, blue) will initialize the ColorPt to given tint values.
Declaration
public void Set(double x, double y, double z, double w)
Parameters
Type | Name | Description |
---|---|---|
double | x | initialized value of first color value (eg. red for rgb colorspace) |
double | y | initialized value of second color value (eg. green for rgb colorspace) |
double | z | initialized value of third color value (eg. blue for rgb colorspace) |
double | w | initialized value of fourth color value (eg. when using CMYK) |
Remarks
color.Set(gray) is equivalent to Set(0, gray);
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Set(int, double)
Sets the colorant index and value.
Declaration
public void Set(int colorant_index, double colorant_value)
Parameters
Type | Name | Description |
---|---|---|
int | colorant_index | the colorant_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). |
double | colorant_value | the colorant_value The new tint value. |
Remarks
If a color point has more than 4 colorants, SetColorantNum(num_colorants) must be called before getting or setting tint values.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
PDFNetException | PDFNetException the PDFNet exception |
Set(ColorPt)
Sets value to the given ColorPt
object
Declaration
public void Set(ColorPt p)
Parameters
Type | Name | Description |
---|---|---|
ColorPt | p | given |
SetColorantNum(int)
Sets the colorant number.
Declaration
public void SetColorantNum(int num)
Parameters
Type | Name | Description |
---|---|---|
int | num | the new colorant number |
Remarks
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().
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
op_Assign(ColorPt)
Assignment operator
Declaration
public ColorPt op_Assign(ColorPt r)
Parameters
Type | Name | Description |
---|---|---|
ColorPt | r | object at the right of the operator |
Returns
Type | Description |
---|---|
ColorPt | object equals to the given object |
op_Equality(ColorPt)
Equals operator
Declaration
public bool op_Equality(ColorPt other)
Parameters
Type | Name | Description |
---|---|---|
ColorPt | other | object at the right of the operator |
Returns
Type | Description |
---|---|
bool | true if the colorant values of the objects are equal, false otherwise |