org.pdfbox.pdmodel.graphics.color
Class PDColorSpaceInstance

java.lang.Object
  extended byorg.pdfbox.pdmodel.graphics.color.PDColorSpaceInstance

public class PDColorSpaceInstance
extends 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.
 PDColorSpace getColorSpace()
          This will get the current colorspace.
 float[] getColorSpaceValue()
          This will get the color space values.
 COSArray getCOSColorSpaceValue()
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

createColor

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

Returns:
The current awt color.
Throws:
IOException - If there is an error creating the color.

getColorSpace

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

Returns:
The current colorspace.

setColorSpace

public void setColorSpace(PDColorSpace value)
This will set the current colorspace.

Parameters:
value - The new colorspace.

getColorSpaceValue

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

Returns:
The colorspace values.

getCOSColorSpaceValue

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

Returns:
The colorspace values.

setColorSpaceValue

public void setColorSpaceValue(float[] value)
This will update the colorspace values.

Parameters:
value - The new colorspace values.