Class PDColorSpace
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
-
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDCalGray,PDCalRGB,PDDeviceCMYK,PDDeviceGray,PDDeviceN,PDDeviceRGB,PDICCBased,PDIndexed,PDLab,PDPattern,PDSeparation
public abstract class PDColorSpace extends java.lang.Object implements COSObjectable
This class represents a color space in a pdf document.- Version:
- $Revision: 1.5 $
- Author:
- Ben Litchfield
-
-
Constructor Summary
Constructors Constructor Description PDColorSpace()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.awt.image.ColorModelcreateColorModel(int bpc)Create a Java color model for this colorspace.protected abstract java.awt.color.ColorSpacecreateColorSpace()Create a Java colorspace for this colorspace.COSBasegetCOSObject()Convert this standard java object to a COS object.java.awt.color.ColorSpacegetJavaColorSpace()Returns the Java AWT color space for this instance.abstract java.lang.StringgetName()This will return the name of the color space.abstract intgetNumberOfComponents()This will get the number of components that this color space is made up of.java.lang.StringtoString()
-
-
-
Field Detail
-
array
protected COSArray array
array for the given parameters.
-
-
Method Detail
-
getName
public abstract java.lang.String getName()
This will return the name of the color space.- Returns:
- The name of the color space.
-
getNumberOfComponents
public abstract int getNumberOfComponents() throws java.io.IOExceptionThis will get the number of components that this color space is made up of.- Returns:
- The number of components in this color space.
- Throws:
java.io.IOException- If there is an error getting the number of color components.
-
getCOSObject
public COSBase getCOSObject()
Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
getJavaColorSpace
public java.awt.color.ColorSpace getJavaColorSpace() throws java.io.IOExceptionReturns the Java AWT color space for this instance.- Returns:
- Java AWT color space
- Throws:
java.io.IOException- if the color space can not be created
-
createColorSpace
protected abstract java.awt.color.ColorSpace createColorSpace() throws java.io.IOExceptionCreate a Java colorspace for this colorspace.- Returns:
- A color space that can be used for Java AWT operations.
- Throws:
java.io.IOException- If there is an error creating the color space.
-
createColorModel
public abstract java.awt.image.ColorModel createColorModel(int bpc) throws java.io.IOExceptionCreate a Java color model for this colorspace.- Parameters:
bpc- The number of bits per component.- Returns:
- A color model that can be used for Java AWT operations.
- Throws:
java.io.IOException- If there is an error creating the color model.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-