Class PDFColorSpace
java.lang.Object
org.loboevolution.pdfview.colorspace.PDFColorSpace
- Direct Known Subclasses:
AlternateColorSpace
,IndexedColor
,PatternSpace
A color space that can convert a set of color components into
PDFPaint.
Author Mike Wessler
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
the name of the device-dependent CMYK color spacestatic final int
the name of the device-dependent gray color spacestatic final int
the name of the pattern color spacestatic final int
the name of the device-dependent RGB color space -
Constructor Summary
ConstructorDescriptioncreate a PDFColorSpace based on a Java ColorSpace -
Method Summary
Modifier and TypeMethodDescriptionget the original Java ColorSpace.static PDFColorSpace
getColorSpace
(int name) Get a color space by namestatic PDFColorSpace
getColorSpace
(PDFObject csobj, Map resources) Get a color space specified in a PDFObjectint
get the number of components expected in the getPaint commandgetPaint
(float[] components) get the PDFPaint representing the color described by the given color components
-
Field Details
-
COLORSPACE_GRAY
public static final int COLORSPACE_GRAYthe name of the device-dependent gray color space- See Also:
-
COLORSPACE_RGB
public static final int COLORSPACE_RGBthe name of the device-dependent RGB color space- See Also:
-
COLORSPACE_CMYK
public static final int COLORSPACE_CMYKthe name of the device-dependent CMYK color space- See Also:
-
COLORSPACE_PATTERN
public static final int COLORSPACE_PATTERNthe name of the pattern color space- See Also:
-
-
Constructor Details
-
PDFColorSpace
create a PDFColorSpace based on a Java ColorSpace- Parameters:
cs
- the Java ColorSpace
-
-
Method Details
-
getColorSpace
Get a color space by name- Parameters:
name
- the name of one of the device-dependent color spaces- Returns:
- a
PDFColorSpace
object.
-
getColorSpace
Get a color space specified in a PDFObject- Parameters:
csobj
- the PDFObject with the colorspace informationresources
- aMap
object.- Returns:
- a
PDFColorSpace
object. - Throws:
IOException
- if any.
-
getNumComponents
public int getNumComponents()get the number of components expected in the getPaint command- Returns:
- a
Integer
object.
-
getPaint
get the PDFPaint representing the color described by the given color components- Parameters:
components
- the color components corresponding to the given colorspace- Returns:
- a PDFPaint object representing the closest Color to the given components.
-
getColorSpace
get the original Java ColorSpace.- Returns:
- a
ColorSpace
object.
-