Package com.sun.pdfview.colorspace
Class PDFColorSpace
- java.lang.Object
-
- com.sun.pdfview.colorspace.PDFColorSpace
-
- Direct Known Subclasses:
AlternateColorSpace,IndexedColor,PatternSpace
public class PDFColorSpace extends java.lang.ObjectA color space that can convert a set of color components into PDFPaint.
-
-
Field Summary
Fields Modifier and Type Field Description private static PDFColorSpacecmykSpacestatic intCOLORSPACE_CMYKthe name of the device-dependent CMYK color spacestatic intCOLORSPACE_GRAYthe name of the device-dependent gray color spacestatic intCOLORSPACE_PATTERNthe name of the pattern color spacestatic intCOLORSPACE_RGBthe name of the device-dependent RGB color space(package private) java.awt.color.ColorSpacecsthe color spaceprivate static PDFColorSpacegraySpacegraySpace and the gamma correction for it.private static PDFColorSpacepatternSpacethe pattern spaceprivate static PDFColorSpacergbSpacethe device-dependent color spaces
-
Constructor Summary
Constructors Modifier Constructor Description protectedPDFColorSpace(java.awt.color.ColorSpace cs)create a PDFColorSpace based on a Java ColorSpace
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.color.ColorSpacegetColorSpace()get the original Java ColorSpace.static PDFColorSpacegetColorSpace(int name)Get a color space by namestatic PDFColorSpacegetColorSpace(PDFObject csobj, java.util.Map resources)Get a color space specified in a PDFObjectintgetNumComponents()get the number of components expected in the getPaint commandPDFPaintgetPaint(float[] components)get the PDFPaint representing the color described by the given color components
-
-
-
Field Detail
-
COLORSPACE_GRAY
public static final int COLORSPACE_GRAY
the name of the device-dependent gray color space- See Also:
- Constant Field Values
-
COLORSPACE_RGB
public static final int COLORSPACE_RGB
the name of the device-dependent RGB color space- See Also:
- Constant Field Values
-
COLORSPACE_CMYK
public static final int COLORSPACE_CMYK
the name of the device-dependent CMYK color space- See Also:
- Constant Field Values
-
COLORSPACE_PATTERN
public static final int COLORSPACE_PATTERN
the name of the pattern color space- See Also:
- Constant Field Values
-
rgbSpace
private static PDFColorSpace rgbSpace
the device-dependent color spaces
-
cmykSpace
private static PDFColorSpace cmykSpace
-
patternSpace
private static PDFColorSpace patternSpace
the pattern space
-
graySpace
private static PDFColorSpace graySpace
graySpace and the gamma correction for it.
-
cs
java.awt.color.ColorSpace cs
the color space
-
-
Method Detail
-
getColorSpace
public static PDFColorSpace getColorSpace(int name)
Get a color space by name- Parameters:
name- the name of one of the device-dependent color spaces
-
getColorSpace
public static PDFColorSpace getColorSpace(PDFObject csobj, java.util.Map resources) throws java.io.IOException
Get a color space specified in a PDFObject- Parameters:
csobj- the PDFObject with the colorspace information- Throws:
java.io.IOException
-
getNumComponents
public int getNumComponents()
get the number of components expected in the getPaint command
-
getPaint
public PDFPaint getPaint(float[] components)
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
public java.awt.color.ColorSpace getColorSpace()
get the original Java ColorSpace.
-
-