net.sourceforge.mobilebio.png
Class Encoder

java.lang.Object
  extended by net.sourceforge.mobilebio.png.Encoder

public class Encoder
extends java.lang.Object

MIDP PNG Encoder for J2ME

Version:
1.1, 2007-05-12
Author:
Cody Konior

Method Summary
static javax.microedition.lcdui.Image toImage(byte[] png)
          Returns an Image object from the suplied values.
static javax.microedition.lcdui.Image toImage(int width, int height, byte[] alpha, byte[] red, byte[] green, byte[] blue)
          Returns an Image object from the supplied values.
static byte[] toPNG(javax.microedition.lcdui.Image image)
          Returns a PNG stored in a byte array from the supplied Image.
static byte[] toPNG(int width, int height, byte[] alpha, byte[] red, byte[] green, byte[] blue)
          Returns a PNG stored in a byte array from the supplied values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toImage

public static javax.microedition.lcdui.Image toImage(int width,
                                                     int height,
                                                     byte[] alpha,
                                                     byte[] red,
                                                     byte[] green,
                                                     byte[] blue)
Returns an Image object from the supplied values.

Parameters:
width - the width of the image
height - the height of the image
alpha - the byte array of the alpha channel
red - the byte array of the red channel
green - the byte array of the green channel
blue - the byte array of the blue channel
Returns:
an Image object containing PNG data

toImage

public static javax.microedition.lcdui.Image toImage(byte[] png)
Returns an Image object from the suplied values.

Parameters:
png - a byte array containing PNG data
Returns:
an Image object containing PNG data

toPNG

public static byte[] toPNG(int width,
                           int height,
                           byte[] alpha,
                           byte[] red,
                           byte[] green,
                           byte[] blue)
                    throws java.io.IOException
Returns a PNG stored in a byte array from the supplied values.

Parameters:
width - the width of the image
height - the height of the image
alpha - the byte array of the alpha channel
red - the byte array of the red channel
green - the byte array of the green channel
blue - the byte array of the blue channel
Returns:
a byte array containing PNG data
Throws:
java.io.IOException

toPNG

public static byte[] toPNG(javax.microedition.lcdui.Image image)
Returns a PNG stored in a byte array from the supplied Image.

Parameters:
image - an Image object
Returns:
a byte array containing PNG data