Class PDCalGray
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
-
- org.apache.pdfbox.pdmodel.graphics.color.PDCIEBasedColorSpace
-
- org.apache.pdfbox.pdmodel.graphics.color.PDCIEDictionaryBasedColorSpace
-
- org.apache.pdfbox.pdmodel.graphics.color.PDCalGray
-
- All Implemented Interfaces:
COSObjectable
public final class PDCalGray extends PDCIEDictionaryBasedColorSpace
A CalGray colour space is a special case of a single-component CIE-based colour space.
-
-
Field Summary
Fields Modifier and Type Field Description private PDColor
initialColor
private java.util.Map<java.lang.Float,float[]>
map1
-
Fields inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDCIEDictionaryBasedColorSpace
dictionary, wpX, wpY, wpZ
-
Fields inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
array
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]
getDefaultDecode(int bitsPerComponent)
Returns the default decode array for this color space.float
getGamma()
This will get the gamma value.PDColor
getInitialColor()
Returns the initial color value for this color space.java.lang.String
getName()
Returns the name of the color space.int
getNumberOfComponents()
Returns the number of components in this color spacevoid
setGamma(float value)
Set the gamma value.float[]
toRGB(float[] value)
Returns the RGB equivalent of the given color value.-
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDCIEDictionaryBasedColorSpace
convXYZtoRGB, getBlackPoint, getWhitepoint, setBlackPoint, setWhitePoint
-
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDCIEBasedColorSpace
toRawImage, toRGBImage, toString
-
Methods inherited from class org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace
create, create, create, getCOSObject, toRawImage, toRGBImageAWT
-
-
-
-
Field Detail
-
initialColor
private final PDColor initialColor
-
map1
private final java.util.Map<java.lang.Float,float[]> map1
-
-
Constructor Detail
-
PDCalGray
public PDCalGray()
Create a new CalGray color space.
-
PDCalGray
public PDCalGray(COSArray array)
Creates a new CalGray color space using the given COS array.- Parameters:
array
- the COS array which represents this color space
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:PDColorSpace
Returns the name of the color space.- Specified by:
getName
in classPDColorSpace
- Returns:
- the name of the color space
-
getNumberOfComponents
public int getNumberOfComponents()
Description copied from class:PDColorSpace
Returns the number of components in this color space- Specified by:
getNumberOfComponents
in classPDColorSpace
- Returns:
- the number of components in this color space
-
getDefaultDecode
public float[] getDefaultDecode(int bitsPerComponent)
Description copied from class:PDColorSpace
Returns the default decode array for this color space.- Specified by:
getDefaultDecode
in classPDColorSpace
- Parameters:
bitsPerComponent
- the number of bits per component.- Returns:
- the default decode array
-
getInitialColor
public PDColor getInitialColor()
Description copied from class:PDColorSpace
Returns the initial color value for this color space.- Specified by:
getInitialColor
in classPDColorSpace
- Returns:
- the initial color value for this color space
-
toRGB
public float[] toRGB(float[] value)
Description copied from class:PDColorSpace
Returns the RGB equivalent of the given color value.- Specified by:
toRGB
in classPDColorSpace
- Parameters:
value
- a color value with component values between 0 and 1- Returns:
- an array of R,G,B value between 0 and 255
-
getGamma
public float getGamma()
This will get the gamma value. If none is present then the default of 1 will be returned.- Returns:
- The gamma value.
-
setGamma
public void setGamma(float value)
Set the gamma value.- Parameters:
value
- The new gamma value.
-
-