Class PDJPXColorSpace
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.graphics.color.PDColorSpace
-
- com.tom_roush.pdfbox.pdmodel.graphics.color.PDJPXColorSpace
-
- All Implemented Interfaces:
COSObjectable
public final class PDJPXColorSpace extends PDColorSpace
A color space embedded in a JPX file. This wraps the AWT ColorSpace which is obtained after JAI Image I/O reads a JPX stream.
-
-
Field Summary
-
Fields inherited from class com.tom_roush.pdfbox.pdmodel.graphics.color.PDColorSpace
array
-
-
Constructor Summary
Constructors Constructor Description PDJPXColorSpace(ColorSpace colorSpace)Creates a new JPX color space from the given AWT color space.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description COSBasegetCOSObject()Convert this standard java object to a COS object.float[]getDefaultDecode(int bitsPerComponent)Returns the default decode array for this color space.PDColorgetInitialColor()Returns the initial color value for this color space.StringgetName()Returns the name of the color space.intgetNumberOfComponents()Returns the number of components in this color spacefloat[]toRGB(float[] value)Returns the RGB equivalent of the given color value.BitmaptoRGBImage(Bitmap raster)Returns the (A)RGB equivalent of the given raster.-
Methods inherited from class com.tom_roush.pdfbox.pdmodel.graphics.color.PDColorSpace
create, create, create
-
-
-
-
Constructor Detail
-
PDJPXColorSpace
public PDJPXColorSpace(ColorSpace colorSpace)
Creates a new JPX color space from the given AWT color space.- Parameters:
colorSpace- color space from a JPX image
-
-
Method Detail
-
getName
public String getName()
Description copied from class:PDColorSpaceReturns the name of the color space.- Specified by:
getNamein classPDColorSpace- Returns:
- the name of the color space
-
getNumberOfComponents
public int getNumberOfComponents()
Description copied from class:PDColorSpaceReturns the number of components in this color space- Specified by:
getNumberOfComponentsin classPDColorSpace- Returns:
- the number of components in this color space
-
getDefaultDecode
public float[] getDefaultDecode(int bitsPerComponent)
Description copied from class:PDColorSpaceReturns the default decode array for this color space.- Specified by:
getDefaultDecodein classPDColorSpace- Parameters:
bitsPerComponent- the number of bits per component.- Returns:
- the default decode array
-
getInitialColor
public PDColor getInitialColor()
Description copied from class:PDColorSpaceReturns the initial color value for this color space.- Specified by:
getInitialColorin classPDColorSpace- Returns:
- the initial color value for this color space
-
toRGB
public float[] toRGB(float[] value)
Description copied from class:PDColorSpaceReturns the RGB equivalent of the given color value.- Specified by:
toRGBin 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
-
toRGBImage
public Bitmap toRGBImage(Bitmap raster) throws IOException
Description copied from class:PDColorSpaceReturns the (A)RGB equivalent of the given raster.- Specified by:
toRGBImagein classPDColorSpace- Parameters:
raster- the source raster- Returns:
- an (A)RGB buffered image
- Throws:
IOException- if the color conversion fails
-
getCOSObject
public COSBase getCOSObject()
Description copied from interface:COSObjectableConvert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Overrides:
getCOSObjectin classPDColorSpace- Returns:
- The cos object that matches this Java object.
-
-