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 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)
Creates a color space given a name or array.
|
COSBase |
getCOSObject()
Convert this standard java object to a COS object.
|
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
|
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
create(COSBase, PDResources)
.colorSpace
- the color space COS objectresources
- the current resources.wasDefault
- if current color space was used by a default color space.MissingResourceException
- if the color space is missing in the resources dictionaryIOException
- if the color space is unknown or cannot be created.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()
COSObjectable
getCOSObject
in interface COSObjectable
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.