public class GenericColorSpace extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
cb |
static String |
ce |
static boolean |
fasterPNG
enables optimisations for PDF output - enabled with jvm flag org.jpedal.fasterPNG
|
| Modifier and Type | Method and Description |
|---|---|
protected static BufferedImage |
cleanupImage(BufferedImage image,
int pX,
int pY) |
protected static Raster |
cleanupRaster(Raster ras,
int pX,
int pY,
int comp) |
void |
clearCache()
method to flush any caching values for cases where may need resetting (ie in CMYK where restore will render
last values in setColor used for caching invalid
|
byte[] |
convertIndexToRGB(byte[] index)
convert Index to RGB
|
BufferedImage |
dataToRGB(byte[] data,
int w,
int h)
convert color content of data to sRGB data
|
byte[] |
dataToRGBByteArray(byte[] data,
int w,
int h)
default RGB implementation just returns data
|
int |
getAlternateColorSpace() |
PdfPaint |
getColor()
get color
|
int |
getColorComponentCount()
return number of values used for color (ie 3 for rgb)
|
ColorSpace |
getColorSpace()
return the set Java colorspace
|
static ColorSpace |
getColorSpaceInstance() |
int |
getID()
get colorspace ID
|
protected int |
getIndexedColorComponent(int count)
lookup a component for index colorspace
|
byte[] |
getIndexedMap()
return indexed COlorMap
|
int |
getIndexSize()
get size
|
int |
getRawColorSpacePDFType() |
float[] |
getRawValues()
return raw values - only currently works for CMYK
|
String |
getXMLColorToken()
get an xml string with the color info
|
protected static void |
initCMYKColorspace()
initialise all the colorspaces when first needed
|
void |
invalidateCaching(int color) |
boolean |
isImageYCCK()
flag to show if YCCK image decoded so we can draw attention to user
|
boolean |
isIndexConverted() |
boolean |
isInvalid() |
BufferedImage |
JPEG2000ToImage(byte[] data,
int pX,
int pY) |
BufferedImage |
JPEG2000ToRGBImage(byte[] data,
int w,
int h,
int pX,
int pY,
int d)
convert byte[] datastream JPEG to an image in RGB
|
BufferedImage |
JPEGToRGBImage(byte[] data,
int w,
int h,
int pX,
int pY)
convert byte[] datastream JPEG to an image in RGB
|
protected BufferedImage |
nonRGBJPEGToRGBImage(byte[] data,
int w,
int h,
int pX,
int pY)
Convert DCT encoded image bytestream to sRGB
|
protected void |
setAlternateColorSpace(int alt) |
void |
setCIEValues(float[] W,
float[] R,
float[] Ma,
float[] G)
create a CIE values for conversion to RGB colorspace
|
void |
setColor(float[] value,
int operandCount)
convert color value to sRGB color
|
void |
setColor(PdfPaint col)
used by generic decoder to asign color
|
void |
setColor(String[] value,
int operandCount)
convert color value to sRGB color
|
void |
setGS(GraphicsState currentGraphicsState)
pattern colorspace needs access to graphicsState
|
void |
setIndex(byte[] IndexedColorMap,
int size) |
void |
setPattern(Map patterns)
pass in list of patterns
|
void |
setPrinting(boolean isPrinting) |
public static final String cb
public static final String ce
public static boolean fasterPNG
public void setPrinting(boolean isPrinting)
protected static void initCMYKColorspace()
public boolean isInvalid()
public int getIndexSize()
public PdfPaint getColor()
public ColorSpace getColorSpace()
protected void setAlternateColorSpace(int alt)
public int getAlternateColorSpace()
protected final BufferedImage nonRGBJPEGToRGBImage(byte[] data, int w, int h, int pX, int pY)
Convert DCT encoded image bytestream to sRGB
It uses the internal Java classes and the Adobe icm to convert CMYK and YCbCr-Alpha - the data is still DCT encoded.
The Sun class JPEGDecodeParam.java is worth examining because it contains lots of interesting comments
I tried just using the new IOImage.read() but on type 3 images, all my clipping code stopped working so I am still using 1.3
protected static BufferedImage cleanupImage(BufferedImage image, int pX, int pY)
public void setIndex(byte[] IndexedColorMap,
int size)
protected int getIndexedColorComponent(int count)
public byte[] getIndexedMap()
public void setColor(String[] value, int operandCount)
public void setColor(float[] value,
int operandCount)
public BufferedImage JPEGToRGBImage(byte[] data, int w, int h, int pX, int pY)
public BufferedImage JPEG2000ToRGBImage(byte[] data, int w, int h, int pX, int pY, int d) throws PdfException
PdfExceptionpublic byte[] dataToRGBByteArray(byte[] data,
int w,
int h)
public BufferedImage dataToRGB(byte[] data, int w, int h)
public int getID()
public final void setCIEValues(float[] W,
float[] R,
float[] Ma,
float[] G)
public byte[] convertIndexToRGB(byte[] index)
public String getXMLColorToken()
public void setPattern(Map patterns)
public void setColor(PdfPaint col)
public int getColorComponentCount()
public void setGS(GraphicsState currentGraphicsState)
public float[] getRawValues()
public boolean isImageYCCK()
public boolean isIndexConverted()
public void clearCache()
public static ColorSpace getColorSpaceInstance()
public int getRawColorSpacePDFType()
public BufferedImage JPEG2000ToImage(byte[] data, int pX, int pY) throws PdfException
PdfExceptionpublic void invalidateCaching(int color)
Copyright © 2017. All rights reserved.