public abstract class PDColorSpace extends Object implements COSObjectable
| Constructor and Description |
|---|
PDColorSpace() |
| Modifier and Type | Method and Description |
|---|---|
static PDColorSpace |
create(COSBase colorSpace)
Creates a color space given a name or array.
|
static PDColorSpace |
create(COSBase colorSpace,
PDResources resources)
Creates a color space given a name or array.
|
static PDColorSpace |
create(COSBase colorSpace,
PDResources resources,
boolean wasDefault) |
COSBase |
getCOSObject() |
abstract float[] |
getDefaultDecode(int bitsPerComponent)
Returns the default decode array for this color space.
|
abstract PDColor |
getInitialColor()
Returns the initial color value for this color space.
|
abstract String |
getName()
Returns the name of the color space.
|
abstract int |
getNumberOfComponents()
Returns the number of components in this color space
|
static boolean |
isAllowedCache(PDColorSpace colorSpace) |
abstract float[] |
toRGB(float[] value)
Returns the RGB equivalent of the given color value.
|
abstract BufferedImage |
toRGBImage(WritableRaster raster)
Returns the (A)RGB equivalent of the given raster.
|
protected BufferedImage |
toRGBImageAWT(WritableRaster raster,
ColorSpace colorSpace)
Returns the (A)RGB equivalent of the given raster, using the given AWT color space to perform the conversion.
|
protected COSArray array
public static PDColorSpace create(COSBase colorSpace) throws IOException
colorSpace - the color space COS objectIOException - if the color space is unknown or cannot be createdpublic static PDColorSpace create(COSBase colorSpace, PDResources resources) throws IOException
colorSpace - the color space COS objectresources - the current resources.MissingResourceException - if the color space is missing in the resources dictionaryIOException - if the color space is unknown or cannot be createdpublic static PDColorSpace create(COSBase colorSpace, PDResources resources, boolean wasDefault) throws IOException
IOExceptionpublic static boolean isAllowedCache(PDColorSpace colorSpace)
public abstract String getName()
public abstract int getNumberOfComponents()
public abstract float[] getDefaultDecode(int bitsPerComponent)
bitsPerComponent - the number of bits per component.public abstract PDColor getInitialColor()
public abstract float[] toRGB(float[] value)
throws IOException
value - a color value with component values between 0 and 1IOException - if the color conversion failspublic abstract BufferedImage toRGBImage(WritableRaster raster) throws IOException
raster - the source rasterIOException - if the color conversion failsprotected BufferedImage toRGBImageAWT(WritableRaster raster, ColorSpace colorSpace)
raster - the source rastercolorSpace - the AWTpublic COSBase getCOSObject()
getCOSObject in interface COSObjectableCOSBase that matches this Java object.Copyright © 2020 sejda. All rights reserved.