public class PngParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int[] |
crc_table
If needed, this will be filled with a handy CRC lookup table
|
Constructor and Description |
---|
PngParser() |
Modifier and Type | Method and Description |
---|---|
static int |
pngCalcAdler(byte[] buffer,
int end,
int length,
int block_size)
Returns the Adler-checksum value for a block of byte data - checksum will run from buffer[end-length] to buffer[end]
|
static int |
pngCalcCrc(byte[] buffer,
int end,
int length)
Returns the CRC value for a block of byte data - checksum will run from buffer[end-length] to buffer[end]
|
static void |
pngCalcCrcTable()
Creates a CRC-table for quick reference purposes
|
static byte[] |
pngCreateByteArray(int image_width,
int image_height,
byte[] argb_image)
Creates the byte-array PNG representation from pixel argb data
|
static byte[] |
pngCreateByteArray(int image_width,
int image_height,
int[] argb_image)
Creates the byte-array PNG representation from pixel argb data
|
static byte[] |
pngCreateByteArray(int image_width,
int image_height,
int bit_depth,
byte[] argb_palette,
byte[] image,
boolean already_idat_format)
Creates the byte-array PNG representation from pixel data
|
static javax.microedition.lcdui.Image |
pngCreateImage(int image_width,
int image_height,
byte[] argb_image)
Creates an Image from pixel argb data, using the PNG file format (instead of createRGBImage, which doesn't exist under MIDP1, so isn't always accessible)
|
static javax.microedition.lcdui.Image |
pngCreateImage(int image_width,
int image_height,
int bit_depth,
byte[] argb_palette,
byte[] image,
boolean already_idat_format)
Creates an Image from pixel data, using the PNG file format
|
static javax.microedition.lcdui.Image |
pngMakeMutable(javax.microedition.lcdui.Image img)
Creates a mutable version of this image
|
public static int[] crc_table
public static byte[] pngCreateByteArray(int image_width, int image_height, int[] argb_image)
image_width
- pixel widthimage_height
- pixel heightargb_image
- argb pixel entries, in the format supplied by Image.getRGBpublic static byte[] pngCreateByteArray(int image_width, int image_height, byte[] argb_image)
image_width
- pixel widthimage_height
- pixel heightargb_image
- a/r/g/b pixel entriespublic static byte[] pngCreateByteArray(int image_width, int image_height, int bit_depth, byte[] argb_palette, byte[] image, boolean already_idat_format)
image_width
- pixel widthimage_height
- pixel heightbit_depth
- bit_depth (must be 1, 2, 4 or 8)argb_palette
- a/r/g/b palette entries (for transparent index, it should always be index 0)image
- indexed image dataalready_idat_format
- image data is a preformatted IDAT chunk, otherwise it's just pixel datapublic static javax.microedition.lcdui.Image pngCreateImage(int image_width, int image_height, byte[] argb_image)
image_width
- pixel widthimage_height
- pixel heightargb_image
- a/r/g/b pixel entriespublic static javax.microedition.lcdui.Image pngCreateImage(int image_width, int image_height, int bit_depth, byte[] argb_palette, byte[] image, boolean already_idat_format)
image_width
- pixel widthimage_height
- pixel heightbit_depth
- bit_depth (must be 1, 2, 4 or 8)argb_palette
- a/r/g/b palette entries (for transparent index, it should always be index 0)image
- indexed image dataalready_idat_format
- image data is a preformatted IDAT chunk, otherwise it's just pixel datapublic static int pngCalcAdler(byte[] buffer, int end, int length, int block_size)
public static int pngCalcCrc(byte[] buffer, int end, int length)
public static void pngCalcCrcTable()
public static javax.microedition.lcdui.Image pngMakeMutable(javax.microedition.lcdui.Image img)