public final class PDIndexed extends PDSpecialColorSpace
Modifier and Type | Field and Description |
---|---|
private int |
actualMaxIndex |
private PDColorSpace |
baseColorSpace |
private float[][] |
colorTable |
private PDColor |
initialColor |
private byte[] |
lookupData |
private int[][] |
rgbColorTable |
array
Constructor and Description |
---|
PDIndexed()
Creates a new Indexed color space.
|
PDIndexed(COSArray indexedArray)
Creates a new indexed color space from the given PDF array.
|
PDIndexed(COSArray indexedArray,
PDResources resources)
Creates a new indexed color space from the given PDF array.
|
Modifier and Type | Method and Description |
---|---|
PDColorSpace |
getBaseColorSpace()
Returns the base color space.
|
float[] |
getDefaultDecode(int bitsPerComponent)
Returns the default decode array for this color space.
|
private int |
getHival() |
PDColor |
getInitialColor()
Returns the initial color value for this color space.
|
private byte[] |
getLookupData() |
java.lang.String |
getName()
Returns the name of the color space.
|
int |
getNumberOfComponents()
Returns the number of components in this color space
|
private void |
initRgbColorTable() |
private void |
readColorTable() |
void |
setBaseColorSpace(PDColorSpace base)
Sets the base color space.
|
void |
setHighValue(int high)
Sets the highest value that is allowed.
|
float[] |
toRGB(float[] value)
Returns the RGB equivalent of the given color value.
|
java.awt.image.BufferedImage |
toRGBImage(java.awt.image.WritableRaster raster)
Returns the (A)RGB equivalent of the given raster.
|
java.lang.String |
toString() |
getCOSObject
create, create, create, toRGBImageAWT
private final PDColor initialColor
private PDColorSpace baseColorSpace
private byte[] lookupData
private float[][] colorTable
private int actualMaxIndex
private int[][] rgbColorTable
public PDIndexed()
public PDIndexed(COSArray indexedArray) throws java.io.IOException
indexedArray
- the array containing the indexed parametersjava.io.IOException
public PDIndexed(COSArray indexedArray, PDResources resources) throws java.io.IOException
indexedArray
- the array containing the indexed parametersresources
- the resources, can be null. Allows to use its cache for the colorspace.java.io.IOException
public java.lang.String getName()
PDColorSpace
getName
in class PDColorSpace
public int getNumberOfComponents()
PDColorSpace
getNumberOfComponents
in class PDColorSpace
public float[] getDefaultDecode(int bitsPerComponent)
PDColorSpace
getDefaultDecode
in class PDColorSpace
bitsPerComponent
- the number of bits per component.public PDColor getInitialColor()
PDColorSpace
getInitialColor
in class PDColorSpace
private void initRgbColorTable() throws java.io.IOException
java.io.IOException
public float[] toRGB(float[] value)
PDColorSpace
toRGB
in class PDColorSpace
value
- a color value with component values between 0 and 1public java.awt.image.BufferedImage toRGBImage(java.awt.image.WritableRaster raster) throws java.io.IOException
PDColorSpace
toRGBImage
in class PDColorSpace
raster
- the source rasterjava.io.IOException
- if the color conversion failspublic PDColorSpace getBaseColorSpace()
private int getHival()
private byte[] getLookupData() throws java.io.IOException
java.io.IOException
private void readColorTable() throws java.io.IOException
java.io.IOException
public void setBaseColorSpace(PDColorSpace base)
base
- the base color spacepublic void setHighValue(int high)
high
- the highest value for the lookup tablepublic java.lang.String toString()
toString
in class java.lang.Object