Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.graphics.color

public Class PDCalRGB

extends PDCIEDictionaryBasedColorSpace
Class Inheritance
Imports
org.apache.pdfbox.cos.COSArray, .COSFloat, .COSName, org.apache.pdfbox.util.Matrix

A CalRGB colour space is a CIE-based colour space with one transformation stage instead of two. In this type of space, A, B, and C represent calibrated red, green, and blue colour values.
Authors
Ben Litchfield, John Hewson

Field Summary

Modifier and TypeField and Description
private final PDColor
Inherited from org.apache.pdfbox.pdmodel.graphics.color.PDCIEDictionaryBasedColorSpace:
dictionarywpXwpYwpZ

Constructor Summary

AccessConstructor and Description
public
PDCalRGB()

Creates a new CalRGB color space.

public
PDCalRGB(COSArray
the cos array which represents this color space
rgb
)

Creates a new CalRGB color space using the given COS array.

Method Summary

Modifier and TypeMethod and Description
public float[]
getDefaultDecode(int
the number of bits per component.
bitsPerComponent
)

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getDefaultDecode.

Returns the default decode array for this color space.

public final PDGamma

Returns:

the gamma value
getGamma
()

Returns the gamma value.

public PDColor
getInitialColor()

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getInitialColor.

Returns the initial color value for this color space.

public final float[]

Returns:

the linear interpretation matrix
getMatrix
()

Returns the linear interpretation matrix, which is an array of nine numbers.

public String
getName()

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getName.

Returns the name of the color space.

public int
getNumberOfComponents()

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getNumberOfComponents.

Returns the number of components in this color space

public final void
setGamma(PDGamma
the new gamma value
gamma
)

Sets the gamma value.

public final void
setMatrix(Matrix
the new linear interpretation matrix, or null
matrix
)

Sets the linear interpretation matrix.

public float[]
toRGB(float[]
a color value with component values between 0 and 1
value
)

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toRGB.

Returns the RGB equivalent of the given color value.

Inherited from org.apache.pdfbox.pdmodel.graphics.color.PDCIEDictionaryBasedColorSpace:
convXYZtoRGBgetBlackPointgetWhitepointisWhitePointsetBlackPointsetWhitePoint

Field Detail

initialColorback to summary
private final PDColor initialColor

Constructor Detail

PDCalRGBback to summary
public PDCalRGB()

Creates a new CalRGB color space.

PDCalRGBback to summary
public PDCalRGB(COSArray rgb)

Creates a new CalRGB color space using the given COS array.

Parameters
rgb:COSArray

the cos array which represents this color space

Method Detail

getDefaultDecodeback to summary
public float[] getDefaultDecode(int bitsPerComponent)

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getDefaultDecode.

Doc from org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getDefaultDecode.

Returns the default decode array for this color space.

Parameters
bitsPerComponent:int

the number of bits per component.

Returns:float[]

the default decode array

Annotations
@Override
getGammaback to summary
public final PDGamma getGamma()

Returns the gamma value. If none is present then the default of 1,1,1 will be returned.

Returns:PDGamma

the gamma value

getInitialColorback to summary
public PDColor getInitialColor()

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getInitialColor.

Doc from org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getInitialColor.

Returns the initial color value for this color space.

Returns:PDColor

the initial color value for this color space

Annotations
@Override
getMatrixback to summary
public final float[] getMatrix()

Returns the linear interpretation matrix, which is an array of nine numbers. If the underlying dictionary contains null then the identity matrix will be returned.

Returns:float[]

the linear interpretation matrix

getNameback to summary
public String getName()

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getName.

Doc from org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getName.

Returns the name of the color space.

Returns:String

the name of the color space

Annotations
@Override
getNumberOfComponentsback to summary
public int getNumberOfComponents()

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getNumberOfComponents.

Doc from org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.getNumberOfComponents.

Returns the number of components in this color space

Returns:int

the number of components in this color space

Annotations
@Override
setGammaback to summary
public final void setGamma(PDGamma gamma)

Sets the gamma value.

Parameters
gamma:PDGamma

the new gamma value

setMatrixback to summary
public final void setMatrix(Matrix matrix)

Sets the linear interpretation matrix. Passing in null will clear the matrix.

Parameters
matrix:Matrix

the new linear interpretation matrix, or null

toRGBback to summary
public float[] toRGB(float[] value)

Implements abstract org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toRGB.

Doc from org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toRGB.

Returns the RGB equivalent of the given color value.

Parameters
value:float[]

a color value with component values between 0 and 1

Returns:float[]

an array of R,G,B value between 0 and 255

Annotations
@Override