Class PDDeviceGray
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
-
- org.apache.pdfbox.pdmodel.graphics.color.PDDeviceGray
-
- All Implemented Interfaces:
COSObjectable
public class PDDeviceGray extends PDColorSpace
This class represents a Gray color space.- Author:
- Ben Litchfield
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringABBREVIATED_NAMEThe abbreviated name of this color space.static java.lang.StringNAMEThe name of this color space.-
Fields inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
array
-
-
Constructor Summary
Constructors Constructor Description PDDeviceGray()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.ColorModelcreateColorModel(int bpc)Create a Java color model for this colorspace.protected java.awt.color.ColorSpacecreateColorSpace()Create a Java colorspace for this colorspace.java.lang.StringgetName()This will return the name of the color space.intgetNumberOfComponents()This will get the number of components that this color space is made up of.-
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
getCOSObject, getJavaColorSpace, toString
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
The name of this color space.- See Also:
- Constant Field Values
-
ABBREVIATED_NAME
public static final java.lang.String ABBREVIATED_NAME
The abbreviated name of this color space.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public java.lang.String getName()
This will return the name of the color space.- Specified by:
getNamein classPDColorSpace- Returns:
- The name of the color space.
-
getNumberOfComponents
public int getNumberOfComponents() throws java.io.IOExceptionThis will get the number of components that this color space is made up of.- Specified by:
getNumberOfComponentsin classPDColorSpace- Returns:
- The number of components in this color space.
- Throws:
java.io.IOException- If there is an error getting the number of color components.
-
createColorSpace
protected java.awt.color.ColorSpace createColorSpace()
Create a Java colorspace for this colorspace.- Specified by:
createColorSpacein classPDColorSpace- Returns:
- A color space that can be used for Java AWT operations.
-
createColorModel
public java.awt.image.ColorModel createColorModel(int bpc) throws java.io.IOExceptionCreate a Java color model for this colorspace.- Specified by:
createColorModelin classPDColorSpace- 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.
-
-