public class PDDeviceN extends PDSpecialColorSpace
Modifier and Type | Field and Description |
---|---|
private static int |
ALTERNATE_CS |
private PDColorSpace |
alternateColorSpace |
private PDDeviceNAttributes |
attributes |
private static int |
COLORANT_NAMES |
private int[] |
colorantToComponent |
private static int |
DEVICEN_ATTRIBUTES |
private PDColor |
initialColor |
private int |
numColorants |
private PDColorSpace |
processColorSpace |
private PDSeparation[] |
spotColorSpaces |
private static int |
TINT_TRANSFORM |
private PDFunction |
tintTransform |
array
Constructor and Description |
---|
PDDeviceN()
Creates a new DeviceN color space.
|
PDDeviceN(COSArray deviceN)
Creates a new DeviceN color space from the given COS array.
|
Modifier and Type | Method and Description |
---|---|
PDColorSpace |
getAlternateColorSpace()
This will get the alternate color space for this separation.
|
PDDeviceNAttributes |
getAttributes()
Returns the attributes associated with the DeviceN color space.
|
java.util.List<java.lang.String> |
getColorantNames()
Returns the list of colorants.
|
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
|
PDFunction |
getTintTransform()
This will get the tint transform function.
|
private void |
initColorConversionCache() |
boolean |
isNChannel()
Returns true if this color space has the NChannel subtype.
|
void |
setAlternateColorSpace(PDColorSpace cs)
This will set the alternate color space.
|
void |
setAttributes(PDDeviceNAttributes attributes)
Sets the color space attributes.
|
void |
setColorantNames(java.util.List<java.lang.String> names)
Sets the list of colorants
|
void |
setTintTransform(PDFunction tint)
This will set the tint transform function.
|
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 float[] |
toRGBWithAttributes(float[] value) |
private java.awt.image.BufferedImage |
toRGBWithAttributes(java.awt.image.WritableRaster raster) |
private float[] |
toRGBWithTintTransform(float[] value) |
private java.awt.image.BufferedImage |
toRGBWithTintTransform(java.awt.image.WritableRaster raster) |
java.lang.String |
toString() |
getCOSObject
create, create, create, toRGBImageAWT
private static final int COLORANT_NAMES
private static final int ALTERNATE_CS
private static final int TINT_TRANSFORM
private static final int DEVICEN_ATTRIBUTES
private PDColorSpace alternateColorSpace
private PDFunction tintTransform
private PDDeviceNAttributes attributes
private PDColor initialColor
private int numColorants
private int[] colorantToComponent
private PDColorSpace processColorSpace
private PDSeparation[] spotColorSpaces
public PDDeviceN()
public PDDeviceN(COSArray deviceN) throws java.io.IOException
deviceN
- an array containing the color space informationjava.io.IOException
private void initColorConversionCache() throws java.io.IOException
java.io.IOException
public 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 toRGBWithAttributes(java.awt.image.WritableRaster raster) throws java.io.IOException
java.io.IOException
private java.awt.image.BufferedImage toRGBWithTintTransform(java.awt.image.WritableRaster raster) throws java.io.IOException
java.io.IOException
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 failsprivate float[] toRGBWithAttributes(float[] value) throws java.io.IOException
java.io.IOException
private float[] toRGBWithTintTransform(float[] value) throws java.io.IOException
java.io.IOException
public boolean isNChannel()
public java.lang.String getName()
PDColorSpace
getName
in class PDColorSpace
public final 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 java.util.List<java.lang.String> getColorantNames()
public PDDeviceNAttributes getAttributes()
public void setColorantNames(java.util.List<java.lang.String> names)
names
- the list of colorantspublic void setAttributes(PDDeviceNAttributes attributes)
attributes
- the color space attributes, or nullpublic PDColorSpace getAlternateColorSpace() throws java.io.IOException
java.io.IOException
- If there is an error getting the alternate color
space.public void setAlternateColorSpace(PDColorSpace cs)
cs
- The alternate color space.public PDFunction getTintTransform() throws java.io.IOException
java.io.IOException
- if there is an error creating the function.public void setTintTransform(PDFunction tint)
tint
- The tint transform function.public java.lang.String toString()
toString
in class java.lang.Object