org.pdfbox.pdmodel.graphics.color

Class PDColorSpaceInstance


public class PDColorSpaceInstance
extends java.lang.Object

This class represents a color space and the color value for that colorspace.
Version:
$Revision: 1.6 $
Author:
Ben Litchfield

Constructor Summary

PDColorSpaceInstance()
Default constructor.
PDColorSpaceInstance(COSArray csValues)
Constructor with an existing color set.

Method Summary

Color
createColor()
Create the current color from the colorspace and values.
COSArray
getCOSColorSpaceValue()
This will get the color space values.
PDColorSpace
getColorSpace()
This will get the current colorspace.
float[]
getColorSpaceValue()
This will get the color space values.
void
setColorSpace(PDColorSpace value)
This will set the current colorspace.
void
setColorSpaceValue(float[] value)
This will update the colorspace values.

Constructor Details

PDColorSpaceInstance

public PDColorSpaceInstance()
Default constructor.

PDColorSpaceInstance

public PDColorSpaceInstance(COSArray csValues)
Constructor with an existing color set. Default colorspace is PDDeviceGray.
Parameters:
csValues - The color space values.

Method Details

createColor

public Color createColor()
            throws IOException
Create the current color from the colorspace and values.
Returns:
The current awt color.

getCOSColorSpaceValue

public COSArray getCOSColorSpaceValue()
This will get the color space values. Either 1 for gray or 3 for RGB.
Returns:
The colorspace values.

getColorSpace

public PDColorSpace getColorSpace()
This will get the current colorspace.
Returns:
The current colorspace.

getColorSpaceValue

public float[] getColorSpaceValue()
This will get the color space values. Either 1 for gray or 3 for RGB.
Returns:
The colorspace values.

setColorSpace

public void setColorSpace(PDColorSpace value)
This will set the current colorspace.
Parameters:
value - The new colorspace.

setColorSpaceValue

public void setColorSpaceValue(float[] value)
This will update the colorspace values.
Parameters:
value - The new colorspace values.