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

public final Class PDCalGray

extends PDCIEDictionaryBasedColorSpace
Class Inheritance
Imports
java.util.HashMap, .Map, org.apache.pdfbox.cos.COSArray, .COSFloat, .COSName

A CalGray colour space is a special case of a single-component CIE-based colour space.
Authors
John Hewson, Ben Litchfield

Field Summary

Modifier and TypeField and Description
private final PDColor
private final Map<Float, float[]>
Inherited from org.apache.pdfbox.pdmodel.graphics.color.PDCIEDictionaryBasedColorSpace:
dictionarywpXwpYwpZ

Constructor Summary

AccessConstructor and Description
public
PDCalGray()

Create a new CalGray color space.

public
PDCalGray(COSArray
the COS array which represents this color space
array
)

Creates a new CalGray 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 float

Returns:

The gamma value.
getGamma
()

This will get 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 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 void
setGamma(float
The new gamma value.
value
)

Set the gamma value.

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
map1back to summary
private final Map<Float, float[]> map1

Constructor Detail

PDCalGrayback to summary
public PDCalGray()

Create a new CalGray color space.

PDCalGrayback to summary
public PDCalGray(COSArray array)

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

Parameters
array: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 float getGamma()

This will get the gamma value. If none is present then the default of 1 will be returned.

Returns:float

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
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 void setGamma(float value)

Set the gamma value.

Parameters
value:float

The new gamma value.

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