public class ColorSpaceConvertor extends Object
Several methods are very similar and I should recode my code to use a common method for the RGB conversion
LogWriter is JPedal logging class
| Modifier and Type | Field and Description |
|---|---|
static boolean |
isUsingARGB
Flag to trigger raster printing
|
| Constructor and Description |
|---|
ColorSpaceConvertor() |
| Modifier and Type | Method and Description |
|---|---|
static BufferedImage |
algorithmicConvertCMYKImageToRGB(byte[] buffer,
int w,
int h) |
static BufferedImage |
algorithmicConvertYCbCrToRGB(byte[] buffer,
int w,
int h)
Convert YCbCr to RGB using formula.
|
static BufferedImage |
convertColorspace(BufferedImage image,
int newType)
Convert a BufferedImage to RGB colourspace.
|
static BufferedImage |
convertFromICCCMYK(int width,
int height,
byte[] data) |
static BufferedImage |
convertIndexedToFlat(int d,
int w,
int h,
byte[] data,
byte[] index,
boolean isARGB,
boolean isDownsampled) |
static byte[] |
convertIndexToRGBByte(byte[] index,
int w,
int h,
int components,
int d,
byte[] data,
boolean isDownsampled,
boolean isARGB) |
static BufferedImage |
convertToARGB(BufferedImage image)
convert a BufferedImage to RGB colourspace (used when I clip the image).
|
static BufferedImage |
convertToRGB(BufferedImage image)
convert any BufferedImage to RGB colourspace.
|
static BufferedImage |
createARGBImage(int width,
int height,
byte[] data) |
static WritableRaster |
createCompatibleWritableRaaster(ColorModel colorModel,
int w,
int h) |
static Raster |
createInterleavedRaster(byte[] data,
int w,
int h) |
static BufferedImage |
createRGBImage(int width,
int height,
byte[] data) |
static void |
drawImage(Graphics2D g2,
BufferedImage tileImg,
AffineTransform tileAff,
ImageObserver observer) |
static void |
flatten1bpc(int w,
byte[] data,
int comp,
byte[] index,
boolean isARGB,
int length,
int transparency,
byte[] newData) |
static void |
flatten2bpc(int w,
byte[] data,
byte[] index,
boolean isARGB,
int length,
byte[] newData)
convert to RGB or gray.
|
static void |
flatten4bpc(int w,
byte[] data,
int newSize,
byte[] newData) |
static void |
flatten8bpc(byte[] data,
boolean isDownsampled,
float ratio,
int id,
int length,
byte[] newData,
byte[] index,
int indexLength,
boolean isARGB) |
static BufferedImage |
iccConvertCMYKImageToRGB(byte[] buffer,
int w,
int h)
Convert YCC to CMY via formula and the CMYK to sRGB via profiles.
|
static byte[] |
normaliseTo8Bit(int d,
int w,
int h,
byte[] data) |
public static BufferedImage convertFromICCCMYK(int width, int height, byte[] data)
public static BufferedImage convertToRGB(BufferedImage image)
image - is of type BufferedImagepublic static BufferedImage convertToARGB(BufferedImage image)
image - is of type BufferedImagepublic static BufferedImage algorithmicConvertYCbCrToRGB(byte[] buffer, int w, int h)
buffer - is of type byte[]w - is of type final inth - is of type final intpublic static BufferedImage convertIndexedToFlat(int d, int w, int h, byte[] data, byte[] index, boolean isARGB, boolean isDownsampled)
public static byte[] normaliseTo8Bit(int d,
int w,
int h,
byte[] data)
throws RuntimeException
RuntimeExceptionpublic static byte[] convertIndexToRGBByte(byte[] index,
int w,
int h,
int components,
int d,
byte[] data,
boolean isDownsampled,
boolean isARGB)
public static void flatten8bpc(byte[] data,
boolean isDownsampled,
float ratio,
int id,
int length,
byte[] newData,
byte[] index,
int indexLength,
boolean isARGB)
public static void flatten1bpc(int w,
byte[] data,
int comp,
byte[] index,
boolean isARGB,
int length,
int transparency,
byte[] newData)
public static void flatten2bpc(int w,
byte[] data,
byte[] index,
boolean isARGB,
int length,
byte[] newData)
w - is of type intdata - is of type byte[]index - is of type byte[]isARGB - is of type booleanlength - is of type intnewData - is of type byte[]public static BufferedImage iccConvertCMYKImageToRGB(byte[] buffer, int w, int h)
buffer - is of type byte[]w - is of type inth - is of type intpublic static BufferedImage convertColorspace(BufferedImage image, int newType)
image - is of type BufferedImagenewType - is of type intpublic static WritableRaster createCompatibleWritableRaaster(ColorModel colorModel, int w, int h)
public static Raster createInterleavedRaster(byte[] data, int w, int h)
public static void drawImage(Graphics2D g2, BufferedImage tileImg, AffineTransform tileAff, ImageObserver observer)
public static void flatten4bpc(int w,
byte[] data,
int newSize,
byte[] newData)
public static BufferedImage createRGBImage(int width, int height, byte[] data)
public static BufferedImage createARGBImage(int width, int height, byte[] data)
public static BufferedImage algorithmicConvertCMYKImageToRGB(byte[] buffer, int w, int h)
Copyright © 2017. All rights reserved.