Class PDDeviceN
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
-
- org.apache.pdfbox.pdmodel.graphics.color.PDDeviceN
-
- All Implemented Interfaces:
COSObjectable
public class PDDeviceN extends PDColorSpace
This class represents a DeviceN color space.- Version:
- $Revision: 1.4 $
- Author:
- Ben Litchfield
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAMEThe name of this color space.-
Fields inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
array
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description COSArraycalculateColorValues(java.util.List<COSBase> tintValues)Returns the components of the color in the alternate colorspace for the given tint value.java.awt.image.ColorModelcreateColorModel(int bpc)Create a Java color model for this colorspace.protected java.awt.color.ColorSpacecreateColorSpace()Create a Java colorspace for this colorspace.PDColorSpacegetAlternateColorSpace()This will get the alternate color space for this separation.PDDeviceNAttributesgetAttributes()This will get the attributes that are associated with the deviceN color space.java.util.List<java.lang.String>getColorantNames()This will get the colorant names.COSBasegetCOSObject()Convert this standard java object to a COS object.java.lang.StringgetName()This will return the name of the color space.intgetNumberOfComponents()This will get the number of components that this color space is made up of.PDFunctiongetTintTransform()This will get the tint transform function.voidsetAlternateColorSpace(PDColorSpace cs)This will set the alternate color space.voidsetAttributes(PDDeviceNAttributes attributes)This will set the color space attributes.voidsetColorantNames(java.util.List<java.lang.String> names)This will set the list of colorants.voidsetTintTransform(PDFunction tint)This will set the tint transform function.-
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
getJavaColorSpace, toString
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
The name of this color space.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDDeviceN
public PDDeviceN()
Constructor.
-
PDDeviceN
public PDDeviceN(COSArray csAttributes)
Constructor.- Parameters:
csAttributes- The array containing all colorspace information.
-
-
Method Detail
-
getCOSObject
public COSBase getCOSObject()
Description copied from class:PDColorSpaceConvert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Overrides:
getCOSObjectin classPDColorSpace- Returns:
- The cos object that matches this Java object.
-
getName
public java.lang.String getName()
This will return the name of the color space. For a PDDeviceN object this will always return "DeviceN"- Specified by:
getNamein classPDColorSpace- Returns:
- The name of the color space.
-
getNumberOfComponents
public int getNumberOfComponents() throws java.io.IOExceptionThis will get the number of components that this color space is made up of.- Specified by:
getNumberOfComponentsin classPDColorSpace- Returns:
- The number of components in this color space.
- Throws:
java.io.IOException- If there is an error getting the number of color components.
-
createColorSpace
protected java.awt.color.ColorSpace createColorSpace() throws java.io.IOExceptionCreate a Java colorspace for this colorspace.- Specified by:
createColorSpacein classPDColorSpace- Returns:
- A color space that can be used for Java AWT operations.
- Throws:
java.io.IOException- If there is an error creating the color space.
-
createColorModel
public java.awt.image.ColorModel createColorModel(int bpc) throws java.io.IOExceptionCreate a Java color model for this colorspace.- Specified by:
createColorModelin classPDColorSpace- Parameters:
bpc- The number of bits per component.- Returns:
- A color model that can be used for Java AWT operations.
- Throws:
java.io.IOException- If there is an error creating the color model.
-
getColorantNames
public java.util.List<java.lang.String> getColorantNames()
This will get the colorant names. A list of string objects.- Returns:
- A list of colorants
-
setColorantNames
public void setColorantNames(java.util.List<java.lang.String> names)
This will set the list of colorants.- Parameters:
names- The list of colorant names.
-
getAlternateColorSpace
public PDColorSpace getAlternateColorSpace() throws java.io.IOException
This will get the alternate color space for this separation.- Returns:
- The alternate color space.
- Throws:
java.io.IOException- If there is an error getting the alternate color space.
-
setAlternateColorSpace
public void setAlternateColorSpace(PDColorSpace cs)
This will set the alternate color space.- Parameters:
cs- The alternate color space.
-
getTintTransform
public PDFunction getTintTransform() throws java.io.IOException
This will get the tint transform function.- Returns:
- The tint transform function.
- Throws:
java.io.IOException- if there is an error creating the function.
-
setTintTransform
public void setTintTransform(PDFunction tint)
This will set the tint transform function.- Parameters:
tint- The tint transform function.
-
getAttributes
public PDDeviceNAttributes getAttributes()
This will get the attributes that are associated with the deviceN color space.- Returns:
- The DeviceN attributes.
-
setAttributes
public void setAttributes(PDDeviceNAttributes attributes)
This will set the color space attributes. If null is passed in then all attribute will be removed.- Parameters:
attributes- The color space attributes.
-
calculateColorValues
public COSArray calculateColorValues(java.util.List<COSBase> tintValues) throws java.io.IOException
Returns the components of the color in the alternate colorspace for the given tint value.- Parameters:
tintValues- a list containing the tint values- Returns:
- COSArray with the color components
- Throws:
java.io.IOException- If the tint function is not supported
-
-