DeviceCMYK
Overview
DeviceCMYK is a class in Aspose.PDF FOSS for Java.
Inherits from: ColorSpaceBase.
The DeviceCMYK color space (ISO 32000-1:2008, §8.6.4.4).
This class provides 4 methods for working with DeviceCMYK objects in Java programs.
Available methods include: getName, getNumberOfComponents, resolve, toRGBInt.
All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package.
Properties: INSTANCE, name, numberOfComponents.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
name | String | Read | Gets the name. |
numberOfComponents | int | Read | Gets the number of components. |
INSTANCE | DeviceCMYK | Read | Singleton instance. |
Methods
| Signature | Description |
|---|---|
getName() → String | Returns the name. |
getNumberOfComponents() → int | Returns the number of components. |
toRGBInt(c: double, m: double, y: double, k: double) → int | Converts CMYK components [0..1] to a packed ARGB int using the standard |
| multiplicative (“no ICC profile”) formula |
R = (1 - C) * (1 - K) * 255 G = (1 - M) * (1 - K) * 255 B = (1 - Y) * (1 - K) * 255
This preserves the algebraic primaries — pure C maps to
{@code (0,255,255)}, pure K to {@code (0,0,0)}, registration black
{@code (1,1,1,1)} to black, white {@code (0,0,0,0)} to white — which is
what the public API contract assumes (see
{@code ColorSpaceTest.testDeviceCMYKToInt} and
{@code AsposeColorActionPortedTest.createDeviceCMYK}), and matches both
{@code ColorConverter.cmykToRgb} and PDFBox’s non-ICC mapping. |
| resolve(csObj: PdfBase, resources: Resources, parser: PDFParser) → ColorSpaceBase | |