Package org.apache.fop.pdf
Class PDFDeviceColorSpace
java.lang.Object
org.apache.fop.pdf.PDFDeviceColorSpace
- All Implemented Interfaces:
PDFColorSpace
Represents a device-specific color space. Used for mapping DeviceRGB, DeviceCMYK and DeviceGray.
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
Current color space value.static final int
CMYK colorspacestatic final int
Gray colorspacestatic final int
RGB colorspacestatic final int
Unknown colorspace -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the colorspace valuegetName()
int
Get the number of color components for this colorspaceboolean
boolean
boolean
boolean
void
setColorSpace
(int theColorSpace) Set the current colorspace.static PDFDeviceColorSpace
Returns a suitablePDFDeviceColorSpace
object given aColorSpace
object.
-
Field Details
-
DEVICE_UNKNOWN
public static final int DEVICE_UNKNOWNUnknown colorspace- See Also:
-
DEVICE_GRAY
public static final int DEVICE_GRAYGray colorspace- See Also:
-
DEVICE_RGB
public static final int DEVICE_RGBRGB colorspace- See Also:
-
DEVICE_CMYK
public static final int DEVICE_CMYKCMYK colorspace- See Also:
-
currentColorSpace
protected int currentColorSpaceCurrent color space value.
-
-
Constructor Details
-
PDFDeviceColorSpace
public PDFDeviceColorSpace(int theColorSpace) Create a PDF colorspace object.- Parameters:
theColorSpace
- the current colorspace
-
-
Method Details
-
setColorSpace
public void setColorSpace(int theColorSpace) Set the current colorspace.- Parameters:
theColorSpace
- the new color space value
-
getColorSpace
public int getColorSpace()Get the colorspace value- Returns:
- the colorspace value
-
getNumComponents
public int getNumComponents()Get the number of color components for this colorspace- Specified by:
getNumComponents
in interfacePDFColorSpace
- Returns:
- the number of components
-
getName
- Specified by:
getName
in interfacePDFColorSpace
- Returns:
- the name of the color space
-
isDeviceColorSpace
public boolean isDeviceColorSpace()- Specified by:
isDeviceColorSpace
in interfacePDFColorSpace
- Returns:
- true if the color space is a device-dependent color space (like DeviceRGB, DeviceCMYK and DeviceGray)
-
isRGBColorSpace
public boolean isRGBColorSpace()- Specified by:
isRGBColorSpace
in interfacePDFColorSpace
- Returns:
- true if the color space is an RGB color space
-
isCMYKColorSpace
public boolean isCMYKColorSpace()- Specified by:
isCMYKColorSpace
in interfacePDFColorSpace
- Returns:
- true if the color space is an CMYK color space
-
isGrayColorSpace
public boolean isGrayColorSpace()- Specified by:
isGrayColorSpace
in interfacePDFColorSpace
- Returns:
- true if the color space is an Gray color space
-
toPDFColorSpace
Returns a suitablePDFDeviceColorSpace
object given aColorSpace
object.- Parameters:
cs
- ColorSpace instance- Returns:
- a PDF-based color space
-