Class PDSeparation
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
-
- org.apache.pdfbox.pdmodel.graphics.color.PDSeparation
-
- All Implemented Interfaces:
COSObjectable
public class PDSeparation extends PDColorSpace
This class represents a Separation color space.- Version:
- $Revision: 1.5 $
- Author:
- Ben Litchfield
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
The name of this color space.-
Fields inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
array
-
-
Constructor Summary
Constructors Constructor Description PDSeparation()
Constructor.PDSeparation(COSArray separation)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description COSArray
calculateColorValues(COSBase tintValue)
Returns the components of the color in the alternate colorspace for the given tint value.java.awt.image.ColorModel
createColorModel(int bpc)
Create a Java color model for this colorspace.protected java.awt.color.ColorSpace
createColorSpace()
Create a Java colorspace for this colorspace.PDColorSpace
getAlternateColorSpace()
This will get the alternate color space for this separation.java.lang.String
getColorantName()
This will get the separation name.COSBase
getCOSObject()
Convert this standard java object to a COS object.java.lang.String
getName()
This will return the name of the color space.int
getNumberOfComponents()
This will get the number of components that this color space is made up of.PDFunction
getTintTransform()
This will get the tint transform function.void
setAlternateColorSpace(PDColorSpace cs)
This will set the alternate color space.void
setColorantName(java.lang.String name)
This will set the separation name.void
setTintTransform(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
-
PDSeparation
public PDSeparation()
Constructor.
-
PDSeparation
public PDSeparation(COSArray separation)
Constructor.- Parameters:
separation
- The array containing all separation information.
-
-
Method Detail
-
getCOSObject
public COSBase getCOSObject()
Description copied from class:PDColorSpace
Convert this standard java object to a COS object.- Specified by:
getCOSObject
in interfaceCOSObjectable
- Overrides:
getCOSObject
in 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 PDSeparation object this will always return "Separation"- Specified by:
getName
in classPDColorSpace
- Returns:
- The name of the color space.
-
getNumberOfComponents
public int getNumberOfComponents() throws java.io.IOException
This will get the number of components that this color space is made up of.- Specified by:
getNumberOfComponents
in 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.IOException
Create a Java colorspace for this colorspace.- Specified by:
createColorSpace
in 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.IOException
Create a Java color model for this colorspace.- Specified by:
createColorModel
in 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.
-
getColorantName
public java.lang.String getColorantName()
This will get the separation name.- Returns:
- The name in the separation.
-
setColorantName
public void setColorantName(java.lang.String name)
This will set the separation name.- Parameters:
name
- The separation name.
-
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 PDFunction
-
setTintTransform
public void setTintTransform(PDFunction tint)
This will set the tint transform function.- Parameters:
tint
- The tint transform function.
-
calculateColorValues
public COSArray calculateColorValues(COSBase tintValue) throws java.io.IOException
Returns the components of the color in the alternate colorspace for the given tint value.- Parameters:
tintValue
- the tint value- Returns:
- COSArray with the color components
- Throws:
java.io.IOException
- If the tint function is not supported
-
-