Class PDLab
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
org.apache.pdfbox.pdmodel.graphics.color.PDLab
- All Implemented Interfaces:
COSObjectable
This class represents a Lab color space.
- Version:
- $Revision: 1.4 $
- 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 get the valid range for the "a" component.This will return the BlackPoint tristimulus.This will get the valid range for the "b" component.Convert this standard java object to a COS object.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 a range for the "a" component.void
This will set the BlackPoint tristimulus.void
This will set the "b" range for this color space.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
-
PDLab
public PDLab()Constructor. -
PDLab
Constructor with array.- Parameters:
lab
- The underlying color space.
-
-
Method Details
-
getName
This will return the name of the color space.- Specified by:
getName
in classPDColorSpace
- Returns:
- The name of the color space.
-
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.
-
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.
- Throws:
IOException
- If there is an error creating the color space.
-
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.
-
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.
-
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.
-
getARange
This will get the valid range for the "a" component. If none is found then the default will be returned, which is -100..100.- Returns:
- the "a" range.
-
setARange
This will set the a range for the "a" component.- Parameters:
range
- the new range for the "a" component, or null if defaults (-100..100) are to be set.
-
getBRange
This will get the valid range for the "b" component. If none is found then the default will be returned, which is -100..100.- Returns:
- the "b" range.
-
setBRange
This will set the "b" range for this color space.- Parameters:
range
- the new range for the "b" component, or null if defaults (-100..100) are to be set.
-