public class ImageLineHelper extends Object
WARNING: this has little testing/optimizing, and this API is not stable. some methods will probably be changed or removed if future releases.
WARNING: most methods for getting/setting values work currently only for ImageLine or ImageLineByte
Constructor and Description |
---|
ImageLineHelper() |
Modifier and Type | Method and Description |
---|---|
static int |
clampTo_0_255(int i) |
static int |
clampTo_0_65535(int i) |
static int |
clampTo_128_127(int x) |
static int[] |
convert2rgba(IImageLineArray line,
PngChunkPLTE pal,
PngChunkTRNS trns,
int[] buf)
this is not very efficient, only for tests and troubleshooting
|
static int |
double2int(ImageLineInt line,
double d) |
static int |
double2intClamped(ImageLineInt line,
double d) |
static int |
getMaskForPackedFormats(int bitDepth) |
static int |
getMaskForPackedFormatsLs(int bitDepth) |
static int |
getPixelARGB8(IImageLine line,
int column) |
static int |
getPixelRGB8(IImageLine line,
int column)
integer packed R G B only for bitdepth=8! (does not check!)
|
static String |
infoFirstLastPixels(ImageLineInt line)
Just for basic info or debugging.
|
static double |
int2double(ImageLineInt line,
int p) |
static double |
int2doubleClamped(ImageLineInt line,
int p) |
static int |
interpol(int a,
int b,
int c,
int d,
double dx,
double dy) |
static int[] |
palette2rgb(ImageLineInt line,
PngChunkPLTE pal,
int[] buf) |
static int[] |
palette2rgb(ImageLineInt line,
PngChunkPLTE pal,
PngChunkTRNS trns,
int[] buf)
Given an indexed line with a palette, unpacks as a RGB array, or RGBA if a non nul PngChunkTRNS chunk is passed
|
static int[] |
palette2rgba(ImageLineInt line,
PngChunkPLTE pal,
PngChunkTRNS trns,
int[] buf)
Same as palette2rgbx , but returns rgba always, even if trns is null
|
static void |
scaleDown(IImageLineArray line)
Reverse of
scaleUp(IImageLineArray) |
static byte |
scaleDown(int bitdepth,
byte v) |
static void |
scaleUp(IImageLineArray line)
When the bitdepth is less than 8, the imageLine is usually returned/expected unscaled.
|
static byte |
scaleUp(int bitdepth,
byte v) |
static void |
setPixelRGB8(ImageLineInt line,
int col,
int rgb) |
static void |
setPixelRGB8(ImageLineInt line,
int col,
int r,
int g,
int b) |
static void |
setPixelRGBA8(ImageLineInt line,
int col,
int rgb) |
static void |
setPixelRGBA8(ImageLineInt line,
int col,
int r,
int g,
int b,
int a) |
static void |
setPixelsRGB8(ImageLineInt line,
int[] rgb) |
static void |
setPixelsRGBA8(ImageLineInt line,
int[] rgb) |
static void |
setValD(ImageLineInt line,
int i,
double d) |
public static void scaleUp(IImageLineArray line)
public static void scaleDown(IImageLineArray line)
scaleUp(IImageLineArray)
public static byte scaleUp(int bitdepth, byte v)
public static byte scaleDown(int bitdepth, byte v)
public static int[] palette2rgb(ImageLineInt line, PngChunkPLTE pal, PngChunkTRNS trns, int[] buf)
line
- ImageLine as returned from PngReaderpal
- Palette chunktrns
- Transparency chunk, can be null (absent)buf
- Preallocated array, optionalpublic static int[] palette2rgba(ImageLineInt line, PngChunkPLTE pal, PngChunkTRNS trns, int[] buf)
line
- ImageLine as returned from PngReaderpal
- Palette chunktrns
- Transparency chunk, can be null (absent)buf
- Preallocated array, optionalpublic static int[] palette2rgb(ImageLineInt line, PngChunkPLTE pal, int[] buf)
public static int[] convert2rgba(IImageLineArray line, PngChunkPLTE pal, PngChunkTRNS trns, int[] buf)
public static String infoFirstLastPixels(ImageLineInt line)
public static int getPixelRGB8(IImageLine line, int column)
public static int getPixelARGB8(IImageLine line, int column)
public static void setPixelsRGB8(ImageLineInt line, int[] rgb)
public static void setPixelRGB8(ImageLineInt line, int col, int r, int g, int b)
public static void setPixelRGB8(ImageLineInt line, int col, int rgb)
public static void setPixelsRGBA8(ImageLineInt line, int[] rgb)
public static void setPixelRGBA8(ImageLineInt line, int col, int r, int g, int b, int a)
public static void setPixelRGBA8(ImageLineInt line, int col, int rgb)
public static void setValD(ImageLineInt line, int i, double d)
public static int interpol(int a, int b, int c, int d, double dx, double dy)
public static double int2double(ImageLineInt line, int p)
public static double int2doubleClamped(ImageLineInt line, int p)
public static int double2int(ImageLineInt line, double d)
public static int double2intClamped(ImageLineInt line, double d)
public static int clampTo_0_255(int i)
public static int clampTo_0_65535(int i)
public static int clampTo_128_127(int x)
public static int getMaskForPackedFormats(int bitDepth)
public static int getMaskForPackedFormatsLs(int bitDepth)
Copyright © 2014. All rights reserved.