org.pdfbox.pdmodel.graphics.color
Class PDICCBased
- COSObjectable
This class represents a ICC profile color space.
static String | NAME - The name of this color space.
|
NAME
public static final String NAME
The name of this color space.
PDICCBased
public PDICCBased(COSArray iccArray)
Constructor.
iccArray
- The ICC stream object.
PDICCBased
public PDICCBased(PDDocument doc)
Default constructor, creates empty stream.
doc
- The document to store the icc data.
createColorModel
public ColorModel createColorModel(int bpc)
throws IOException
Create a Java color model for this colorspace.
- createColorModel in interface PDColorSpace
bpc
- The number of bits per component.
- A color model that can be used for Java AWT operations.
createColorSpace
public ColorSpace createColorSpace()
throws IOException
Create a Java colorspace for this colorspace.
- createColorSpace in interface PDColorSpace
- A color space that can be used for Java AWT operations.
getAlternateColorSpaces
public List getAlternateColorSpaces()
throws IOException
This will return a list of alternate color spaces(PDColorSpace) if the display application
does not support this icc stream.
- A list of alternate color spaces.
getMetadata
public COSStream getMetadata()
This will get the metadata stream for this object. Null if there is no
metadata stream.
- The metadata stream, if it exists.
getName
public String getName()
This will return the name of the color space.
- getName in interface PDColorSpace
- The name of the color space.
getNumberOfComponents
public int getNumberOfComponents()
throws IOException
This will return the number of color components. As of PDF 1.4 this will
be 1,3,4.
- getNumberOfComponents in interface PDColorSpace
- The number of components in this color space.
getPDStream
public PDStream getPDStream()
Get the pd stream for this icc color space.
- Get the stream for this icc based color space.
getRangeForComponent
public PDRange getRangeForComponent(int n)
This will get the range for a certain component number. This is will never
return null. If it is not present then the range -100 to 100 will
be returned.
n
- The component number to get the range for.
- The range for this component.
setAlternateColorSpaces
public void setAlternateColorSpaces(List list)
This will set the list of alternate color spaces. This should be a list
of PDColorSpace objects.
list
- The list of colorspace objects.
setMetadata
public void setMetadata(COSStream metadata)
This will set the metadata stream that is associated with this color space.
metadata
- The new metadata stream.
setNumberOfComponents
public void setNumberOfComponents(int n)
This will set the number of color components.
n
- The number of color components.
setRangeForComponent
public void setRangeForComponent(PDRange range,
int n)
This will set the a range for this color space.
range
- The new range for the a component.n
- The component to set the range for.