public final class PDICCBased extends PDCIEBasedColorSpace
array| Constructor and Description |
|---|
PDICCBased(PDDocument doc)
Creates a new ICC color space with an empty stream.
|
| Modifier and Type | Method and Description |
|---|---|
static PDICCBased |
create(COSArray iccArray,
PDResources resources)
Creates a new ICC color space using the PDF array, optionally using a resource cache.
|
PDColorSpace |
getAlternateColorSpace()
Returns a list of alternate color spaces for non-conforming readers.
|
int |
getColorSpaceType()
Returns the type of the color space in the ICC profile.
|
float[] |
getDefaultDecode(int bitsPerComponent)
Returns the default decode array for this color space.
|
PDColor |
getInitialColor()
Returns the initial color value for this color space.
|
COSStream |
getMetadata()
Returns the metadata stream for this object, or null if there is no metadata stream.
|
String |
getName()
Returns the name of the color space.
|
int |
getNumberOfComponents()
Returns the number of components in this color space
|
PDStream |
getPDStream()
Get the underlying ICC profile stream.
|
PDRange |
getRangeForComponent(int n)
Returns the range for a certain component number.
|
void |
setAlternateColorSpaces(List<PDColorSpace> list)
Sets the list of alternateColorSpace color spaces.
|
void |
setMetadata(COSStream metadata)
Sets the metadata stream that is associated with this color space.
|
void |
setRangeForComponent(PDRange range,
int n)
Sets the range for this color space.
|
BufferedImage |
toRawImage(WritableRaster raster)
Returns the image in this colorspace or null.
|
float[] |
toRGB(float[] value)
Returns the RGB equivalent of the given color value.
|
BufferedImage |
toRGBImage(WritableRaster raster)
Returns the (A)RGB equivalent of the given raster.
|
String |
toString() |
create, create, create, getCOSObject, toRawImage, toRGBImageAWTpublic PDICCBased(PDDocument doc)
doc - the document to store the ICC datapublic static PDICCBased create(COSArray iccArray, PDResources resources) throws IOException
iccArray - the ICC stream object.resources - resources to use as cache, or null for no caching.IOException - if there is an error reading the ICC profile or if the parameter is
invalid.public String getName()
PDColorSpacegetName in class PDColorSpacepublic PDStream getPDStream()
public float[] toRGB(float[] value)
throws IOException
PDColorSpacetoRGB in class PDColorSpacevalue - a color value with component values between 0 and 1IOException - if the color conversion failspublic BufferedImage toRGBImage(WritableRaster raster) throws IOException
PDColorSpacetoRGBImage in class PDCIEBasedColorSpaceraster - the source rasterIOException - if the color conversion failspublic BufferedImage toRawImage(WritableRaster raster) throws IOException
PDColorSpacePDColorSpace.toRGBImage(WritableRaster) if this returns null.toRawImage in class PDCIEBasedColorSpaceraster - the source rasterIOException - if the image conversion failspublic int getNumberOfComponents()
PDColorSpacegetNumberOfComponents in class PDColorSpacepublic float[] getDefaultDecode(int bitsPerComponent)
PDColorSpacegetDefaultDecode in class PDColorSpacebitsPerComponent - the number of bits per component.public PDColor getInitialColor()
PDColorSpacegetInitialColor in class PDColorSpacepublic PDColorSpace getAlternateColorSpace() throws IOException
IOException - If there is an error getting the alternateColorSpace color spaces.public PDRange getRangeForComponent(int n)
n - the component number to get the range forpublic COSStream getMetadata()
public int getColorSpaceType()
TYPE_GRAY, TYPE_RGB,
TYPE_CMYK, or -1 if that one is invalid.ColorSpace.getType() and the static values of
ColorSpace for more details.public void setAlternateColorSpaces(List<PDColorSpace> list)
list - the list of color space objectspublic void setRangeForComponent(PDRange range, int n)
range - the new range for the a componentn - the component to set the range forpublic void setMetadata(COSStream metadata)
metadata - the new metadata streampublic String toString()
toString in class PDCIEBasedColorSpaceCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.