org.icepdf.core.pobjects.graphics
Class PColorSpace

java.lang.Object
  extended by org.icepdf.core.pobjects.Dictionary
      extended by org.icepdf.core.pobjects.graphics.PColorSpace
Direct Known Subclasses:
CalGray, CalRGB, DeviceCMYK, DeviceGray, DeviceN, DeviceRGB, ICCBased, Indexed, Lab, PatternColor, Separation

public abstract class PColorSpace
extends Dictionary

put your documentation comment here


Field Summary
 
Fields inherited from class org.icepdf.core.pobjects.Dictionary
entries, FORM_TYPE_KEY, inited, isDeleted, isNew, LENGTH_KEY, library, SUBTYPE_KEY, TYPE_KEY
 
Method Summary
 java.awt.Color getColor(float[] components)
          Gets the colour in RGB represented by the array of colour components
abstract  java.awt.Color getColor(float[] components, boolean fillAndStroke)
           
static PColorSpace getColorSpace(Library library, float n)
          Gets the color space for the given n value.
static PColorSpace getColorSpace(Library library, java.lang.Object o)
           
 java.lang.String getDescription()
           
abstract  int getNumComponents()
           
 void normaliseComponentsToFloats(int[] in, float[] out, float maxval)
           
static float[] reverse(float[] f)
           
static void reverseInPlace(float[] f)
           
static void reverseInPlace(int[] f)
           
 
Methods inherited from class org.icepdf.core.pobjects.Dictionary
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getPObjectReference, init, isDeleted, isNew, setDeleted, setNew, setPObjectReference, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getNumComponents

public abstract int getNumComponents()
Returns:

getDescription

public java.lang.String getDescription()

getColorSpace

public static PColorSpace getColorSpace(Library library,
                                        java.lang.Object o)
Parameters:
library -
o -
Returns:

getColorSpace

public static PColorSpace getColorSpace(Library library,
                                        float n)
Gets the color space for the given n value. If n == 3 then the new color space with be RGB, if n == 4 then CMYK and finally if n == 1 then Gray.

Parameters:
library - hash of all library objects
n - number of colours in colour space
Returns:
a new PColorSpace given the value of n

getColor

public java.awt.Color getColor(float[] components)
Gets the colour in RGB represented by the array of colour components

Parameters:
components - array of component colour data
Returns:
new RGB colour composed from the components array.

getColor

public abstract java.awt.Color getColor(float[] components,
                                        boolean fillAndStroke)

normaliseComponentsToFloats

public void normaliseComponentsToFloats(int[] in,
                                        float[] out,
                                        float maxval)

reverse

public static float[] reverse(float[] f)
Parameters:
f -
Returns:

reverseInPlace

public static void reverseInPlace(float[] f)

reverseInPlace

public static void reverseInPlace(int[] f)