FileDocCategorySizeDatePackage
ImageEncoder.javaAPI DocphoneME MR2 API (J2ME)2680Wed May 02 16:47:10 BST 2007com.sun.mmedia

ImageEncoder

public final class ImageEncoder extends Object
Utility class that provides I/F to native image/audio/video format conversion code: currently implemented image RGB -to-JPEG & -to-PNG conversion

Fields Summary
public static final int
CONVERT_RGB_TO_JPEG
public static final int
CONVERT_RGB_TO_PNG
Constructors Summary
Methods Summary
public static native intRGBByteCompress(byte[] xrgb, int w, int h, int qual, byte[] compressed, int encType)
converts xrgb image to jpeg or png format. this function is platform independent, since byte ordder doesn't depend on big-/little-endian platform.

param
xrgb raw RGB data in form of byte array (4 bytes per pixel)
param
w width of frame
param
h height of frame
param
qual quality - for JPEG
param
compressed data to be output
param
encType 1 for JPEG, 2 for PNG
return
the size of the compressed data

public static native intRGBIntCompress(int[] xrgb, int w, int h, int qual, byte[] compressed, int encType)
converts xrgb image to jpeg or png format this function is platform DEPENDENT, since byte order in int depends on big-/little-endian platform ! Current implementation works for little-endian only (x86) !

param
xrgb raw RGB data in form of int array (32-bit per pixel)
param
w width of frame
param
h height of frame
param
qual quality - for JPEG
param
compressed data to be output
param
encType 1 for JPEG, 2 for PNG
return
the size of the compressed data