org.pdfbox.pdmodel.graphics.color

Class PDLab

Implemented Interfaces:
COSObjectable

public class PDLab
extends PDColorSpace

This class represents a Lab color space.
Version:
$Revision: 1.4 $
Author:
Ben Litchfield

Field Summary

static String
NAME
The name of this color space.

Constructor Summary

PDLab()
Constructor.
PDLab(COSArray lab)
Constructor with array.

Method Summary

ColorModel
createColorModel(int bpc)
Create a Java color model for this colorspace.
ColorSpace
createColorSpace()
Create a Java colorspace for this colorspace.
PDRange
getARange()
This will get the valid range for the a component.
PDRange
getBRange()
This will get the valid range for the b component.
PDTristimulus
getBlackPoint()
This will return the BlackPoint tristimulus.
COSBase
getCOSObject()
Convert this standard java object to a COS object.
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.
PDTristimulus
getWhitepoint()
This will return the whitepoint tristimulus.
void
setARange(PDRange range)
This will set the a range for this color space.
void
setBRange(PDRange range)
This will set the b range for this color space.
void
setBlackPoint(PDTristimulus bp)
This will set the BlackPoint tristimulus.
void
setWhitepoint(PDTristimulus wp)
This will set the whitepoint tristimulus.

Methods inherited from class org.pdfbox.pdmodel.graphics.color.PDColorSpace

createColorModel, createColorSpace, getCOSObject, getName, getNumberOfComponents

Field Details

NAME

public static final String NAME
The name of this color space.

Constructor Details

PDLab

public PDLab()
Constructor.

PDLab

public PDLab(COSArray lab)
Constructor with array.
Parameters:
lab - The underlying color space.

Method Details

createColorModel

public ColorModel createColorModel(int bpc)
            throws IOException
Create a Java color model for this colorspace.
Overrides:
createColorModel in interface PDColorSpace
Parameters:
bpc - The number of bits per component.
Returns:
A color model that can be used for Java AWT operations.

createColorSpace

public ColorSpace createColorSpace()
            throws IOException
Create a Java colorspace for this colorspace.
Overrides:
createColorSpace in interface PDColorSpace
Returns:
A color space that can be used for Java AWT operations.

getARange

public PDRange getARange()
This will get the valid range for the a component. If none is found then the default will be returned, which is -100 to 100.
Returns:
The a range.

getBRange

public PDRange getBRange()
This will get the valid range for the b component. If none is found then the default will be returned, which is -100 to 100.
Returns:
The b range.

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.

getCOSObject

public COSBase getCOSObject()
Convert this standard java object to a COS object.
Specified by:
getCOSObject in interface COSObjectable
Overrides:
getCOSObject in interface PDColorSpace
Returns:
The cos object that matches this Java object.

getName

public String getName()
This will return the name of the color space.
Overrides:
getName in interface PDColorSpace
Returns:
The name of the color space.

getNumberOfComponents

public int getNumberOfComponents()
            throws IOException
This will get the number of components that this color space is made up of.
Overrides:
getNumberOfComponents in interface PDColorSpace
Returns:
The number of components in this color space.

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.

setARange

public void setARange(PDRange range)
This will set the a range for this color space.
Parameters:
range - The new range for the a component.

setBRange

public void setBRange(PDRange range)
This will set the b range for this color space.
Parameters:
range - The new range for the b component.

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.

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.