org.apache.pdfbox.pdmodel.graphics.color

## Class PDCalRGB

- 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.PDCalRGB

All Implemented Interfaces:
  COSObjectable

    public class PDCalRGB
    extends PDCIEDictionaryBasedColorSpace

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.

Author:
  Ben Litchfield, John Hewson

### Field Summary

### 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`

### Constructor Summary

Constructors
Constructor and Description
`PDCalRGB()` Creates a new CalRGB color space.
`PDCalRGB(COSArray rgb)` Creates a new CalRGB color space using the given COS array.

### Method Summary

All Methods Instance Methods Concrete Methods
`float[]` `getDefaultDecode(int bitsPerComponent)` Returns the default decode array for this color space.
`PDGamma` `getGamma()` Returns the gamma value.
`PDColor` `getInitialColor()` Returns the initial color value for this color space.
`float[]` `getMatrix()` Returns the linear interpretation matrix, which is an array of nine numbers.
`String` `getName()` Returns the name of the color space.
`int` `getNumberOfComponents()` Returns the number of components in this color space
`void` `setGamma(PDGamma gamma)` Sets the gamma value.
`void` `setMatrix(Matrix matrix)` Sets the linear interpretation matrix.
`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, isWhitePoint, 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### PDCalRGB

    public PDCalRGB()

Creates a new CalRGB color space.

#### PDCalRGB

    public PDCalRGB(COSArray rgb)

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

Parameters:
  `rgb` - the cos array which represents this color space

### Method Detail

#### getName

    public String getName()

Description copied from class: `PDColorSpace`
Returns the name of the color space.

Specified by:
  `getName` in class `PDColorSpace`
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 class `PDColorSpace`
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 class `PDColorSpace`
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 class `PDColorSpace`
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 class `PDColorSpace`
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 final PDGamma getGamma()

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

Returns:
  the gamma value

#### getMatrix

    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:
  the linear interpretation matrix

#### setGamma

    public final void setGamma(PDGamma gamma)

Sets the gamma value.

Parameters:
  `gamma` - the new gamma value

#### setMatrix

    public final void setMatrix(Matrix matrix)

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

Parameters:
  `matrix` - the new linear interpretation matrix, or null