public class PDSeparation extends PDSpecialColorSpace
Modifier and Type | Field and Description |
---|---|
private static int |
ALTERNATE_CS |
private PDColorSpace |
alternateColorSpace |
private static int |
COLORANT_NAMES |
private PDColor |
initialColor |
private static int |
TINT_TRANSFORM |
private PDFunction |
tintTransform |
private java.util.Map<java.lang.Integer,float[]> |
toRGBMap
Map used to speed up
toRGB(float[]) . |
array
Constructor and Description |
---|
PDSeparation()
Creates a new Separation color space.
|
PDSeparation(COSArray separation)
Creates a new Separation color space from a PDF color space array.
|
Modifier and Type | Method and Description |
---|---|
PDColorSpace |
getAlternateColorSpace()
Returns the colorant name.
|
java.lang.String |
getColorantName()
Returns the colorant name.
|
float[] |
getDefaultDecode(int bitsPerComponent)
Returns the default decode array for this color space.
|
PDColor |
getInitialColor()
Returns the initial color value for this color space.
|
java.lang.String |
getName()
Returns the name of the color space.
|
int |
getNumberOfComponents()
Returns the number of components in this color space
|
void |
setAlternateColorSpace(PDColorSpace colorSpace)
Sets the alternate color space.
|
void |
setColorantName(java.lang.String name)
Sets the colorant name.
|
void |
setTintTransform(PDFunction tint)
Sets the tint transform function.
|
protected void |
tintTransform(float[] samples,
int[] alt) |
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.
|
private java.awt.image.BufferedImage |
toRGBImage2(java.awt.image.WritableRaster raster) |
java.lang.String |
toString() |
getCOSObject
create, create, create, toRGBImageAWT
private final PDColor initialColor
private static final int COLORANT_NAMES
private static final int ALTERNATE_CS
private static final int TINT_TRANSFORM
private PDColorSpace alternateColorSpace
private PDFunction tintTransform
private java.util.Map<java.lang.Integer,float[]> toRGBMap
toRGB(float[])
. Note that this class contains three maps (this
and the two in toRGBImage(java.awt.image.WritableRaster)
and toRGBImage2(java.awt.image.WritableRaster)
. The maps use different key intervals. This map here is needed for shading, which produce
more than 256 different float values, which we cast to int so that the map can work.public PDSeparation()
public PDSeparation(COSArray separation) throws java.io.IOException
separation
- an array containing all separation information.java.io.IOException
- if the color space or the function could not be created.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
public float[] toRGB(float[] value) throws java.io.IOException
PDColorSpace
toRGB
in class PDColorSpace
value
- a color value with component values between 0 and 1java.io.IOException
- if the color conversion failspublic 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 failsprivate java.awt.image.BufferedImage toRGBImage2(java.awt.image.WritableRaster raster) throws java.io.IOException
java.io.IOException
protected void tintTransform(float[] samples, int[] alt) throws java.io.IOException
java.io.IOException
public PDColorSpace getAlternateColorSpace()
public java.lang.String getColorantName()
public void setColorantName(java.lang.String name)
name
- the name of the colorantpublic void setAlternateColorSpace(PDColorSpace colorSpace)
colorSpace
- The alternate color space.public void setTintTransform(PDFunction tint)
tint
- the tint transform functionpublic java.lang.String toString()
toString
in class java.lang.Object