Class PDCalRGB
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
-
- org.apache.pdfbox.pdmodel.graphics.color.PDCalRGB
-
- All Implemented Interfaces:
COSObjectable
public class PDCalRGB extends PDColorSpace
This class represents a Cal RGB color space.- Version:
- $Revision: 1.3 $
- Author:
- Ben Litchfield
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAMEThe name of this color space.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.PDTristimulusgetBlackPoint()This will return the BlackPoint tristimulus.COSBasegetCOSObject()Convert this standard java object to a COS object.PDGammagetGamma()This will get the gamma value.PDMatrixgetLinearInterpretation()This will get the linear interpretation array.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.PDTristimulusgetWhitepoint()This will return the whitepoint tristimulus.voidsetBlackPoint(PDTristimulus bp)This will set the BlackPoint tristimulus.voidsetGamma(PDGamma value)Set the gamma value.voidsetLinearInterpretation(PDMatrix matrix)This will set the linear interpretation matrix.voidsetWhitepoint(PDTristimulus wp)This will set the whitepoint tristimulus.-
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
-
PDCalRGB
public PDCalRGB()
Constructor.
-
PDCalRGB
public PDCalRGB(COSArray rgb)
Constructor with array.- Parameters:
rgb- The underlying color space.
-
-
Method Detail
-
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.
-
getName
public java.lang.String getName()
This will return the name of the color space.- Specified by:
getNamein classPDColorSpace- Returns:
- The name of the color space.
-
createColorSpace
protected java.awt.color.ColorSpace createColorSpace()
Create a Java colorspace for this colorspace.- Specified by:
createColorSpacein classPDColorSpace- Returns:
- A color space that can be used for Java AWT operations.
-
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.
-
getCOSObject
public COSBase getCOSObject()
Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Overrides:
getCOSObjectin classPDColorSpace- Returns:
- The cos object that matches this Java object.
-
getWhitepoint
public PDTristimulus getWhitepoint()
This will return the whitepoint tristimulus. As this is a required field this will never return null. A default of 1,1,1 will be returned if the pdf does not have any values yet.- Returns:
- The whitepoint tristimulus.
-
setWhitepoint
public void setWhitepoint(PDTristimulus wp)
This will set the whitepoint tristimulus. As this is a required field this null should not be passed into this function.- Parameters:
wp- The whitepoint tristimulus.
-
getBlackPoint
public PDTristimulus getBlackPoint()
This will return the BlackPoint tristimulus. This is an optional field but has defaults so this will never return null. A default of 0,0,0 will be returned if the pdf does not have any values yet.- Returns:
- The blackpoint tristimulus.
-
setBlackPoint
public void setBlackPoint(PDTristimulus bp)
This will set the BlackPoint tristimulus. As this is a required field this null should not be passed into this function.- Parameters:
bp- The BlackPoint tristimulus.
-
getGamma
public PDGamma getGamma()
This will get the gamma value. If none is present then the default of 1,1,1 will be returned.- Returns:
- The gamma value.
-
setGamma
public void setGamma(PDGamma value)
Set the gamma value.- Parameters:
value- The new gamma value.
-
getLinearInterpretation
public PDMatrix getLinearInterpretation()
This will get the linear interpretation array. This is guaranteed to not return null. If the underlying dictionary contains null then the identity matrix will be returned.- Returns:
- The linear interpretation matrix.
-
setLinearInterpretation
public void setLinearInterpretation(PDMatrix matrix)
This will set the linear interpretation matrix. Passing in null will clear the matrix.- Parameters:
matrix- The new linear interpretation matrix.
-
-