Class PDCalRGB
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
org.apache.pdfbox.pdmodel.graphics.color.PDCalRGB
- All Implemented Interfaces:
COSObjectable
This class represents a Cal RGB color space.
- Version:
- $Revision: 1.3 $
- Author:
- Ben Litchfield
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateColorModel
(int bpc) Create a Java color model for this colorspace.protected ColorSpace
Create a Java colorspace for this colorspace.This will return the BlackPoint tristimulus.Convert this standard java object to a COS object.getGamma()
This will get the gamma value.This will get the linear interpretation array.getName()
This will return the name of the color space.int
This will get the number of components that this color space is made up of.This will return the whitepoint tristimulus.void
This will set the BlackPoint tristimulus.void
Set the gamma value.void
setLinearInterpretation
(PDMatrix matrix) This will set the linear interpretation matrix.void
This will set the whitepoint tristimulus.Methods inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
getJavaColorSpace, toString
-
Field Details
-
NAME
The name of this color space.- See Also:
-
-
Constructor Details
-
PDCalRGB
public PDCalRGB()Constructor. -
PDCalRGB
Constructor with array.- Parameters:
rgb
- The underlying color space.
-
-
Method Details
-
getNumberOfComponents
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:
IOException
- If there is an error getting the number of color components.
-
getName
This will return the name of the color space.- Specified by:
getName
in classPDColorSpace
- Returns:
- The name of the color space.
-
createColorSpace
Create a Java colorspace for this colorspace.- Specified by:
createColorSpace
in classPDColorSpace
- Returns:
- A color space that can be used for Java AWT operations.
-
createColorModel
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:
IOException
- If there is an error creating the color model.
-
getCOSObject
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.
-
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
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
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
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
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
Set the gamma value.- Parameters:
value
- The new gamma value.
-
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
This will set the linear interpretation matrix. Passing in null will clear the matrix.- Parameters:
matrix
- The new linear interpretation matrix.
-