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

NameTypeAccessDescription
nameStringReadGets the name.
numberOfComponentsintReadGets the number of components.
INSTANCEDeviceCMYKReadSingleton instance.

Methods

SignatureDescription
getName()StringReturns the name.
getNumberOfComponents()intReturns the number of components.
toRGBInt(c: double, m: double, y: double, k: double)intConverts 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 | |

See Also

 English