| java.lang.Object com.sun.midp.imageutil.ImageToRawConverter
ImageToRawConverter | public class ImageToRawConverter (Code) | | This class generates raw data from image according to
specified raw format and pixel format.
Supported formats are listed in static formatList array.
To add new supported format one should define new raw or/and
color format constants if needed, update static formatList array,
implement new conversion function byte[] _function_name_(BufferedImage image)
and update imageToByteArray function to support new format.
|
Constructor Summary | |
public | ImageToRawConverter(int rawFormat, int colorFormat, int endian) Constructs instance of ImageToRawConverter which will
convert images to raw data in specified here format. |
Method Summary | |
public byte[] | convertToRaw(int[] imageData, int width, int height, boolean hasAlpha) Converts image to raw data in byte array. | void | fillRawHeader(byte[] rawData, int width, int height, boolean hasAlpha) | public static boolean | isFormatSupported(int rawFormat, int colorFormat) Defines if format is currently supported. |
COLOR_FORMAT_565 | final public static int COLOR_FORMAT_565(Code) | | pixel format - 16bit color
|
COLOR_FORMAT_888 | final public static int COLOR_FORMAT_888(Code) | | pixel format - 24bit color
|
FORMAT_INVALID | final public static int FORMAT_INVALID(Code) | | value for invalid format indication
|
INT_FORMAT_BIG_ENDIAN | final public static int INT_FORMAT_BIG_ENDIAN(Code) | | int byte order - big-endian
|
INT_FORMAT_LITTLE_ENDIAN | final public static int INT_FORMAT_LITTLE_ENDIAN(Code) | | int byte order - little-endian
|
RAW_FORMAT_ARGB | final public static int RAW_FORMAT_ARGB(Code) | | RGBA raw format
|
RAW_FORMAT_PP | final public static int RAW_FORMAT_PP(Code) | | Put Pixel raw format
|
formatList | final static int formatList(Code) | | list of supported pairs raw format - color format
|
rawFormatcolorFormatintFormat | protected int rawFormatcolorFormatintFormat(Code) | | current raw, color and int formats
|
rawMagic | final static short[] rawMagic(Code) | | byte sequence that indentifies raw format
|
ImageToRawConverter | public ImageToRawConverter(int rawFormat, int colorFormat, int endian) throws IllegalArgumentException(Code) | | Constructs instance of ImageToRawConverter which will
convert images to raw data in specified here format.
Raw format and color format should be in list of
supported formarts, otherwise IllegalArgumentException
will be thrown.
Parameters: rawFormat - required raw format Parameters: colorFormat - required color format Parameters: endian - required int format exception: IllegalArgumentException - if unsupported format |
convertToRaw | public byte[] convertToRaw(int[] imageData, int width, int height, boolean hasAlpha)(Code) | | Converts image to raw data in byte array.
Parameters: imageData - image pixels in 32bit ARGB format Parameters: width - image width Parameters: height - image height Parameters: hasAlpha - true if image has alpha channel byte[] raw data |
fillRawHeader | void fillRawHeader(byte[] rawData, int width, int height, boolean hasAlpha)(Code) | | Fills byte array with raw header
byte RAW_HEADER[4] = {0x89, 'S', 'U', 'N'};
int32 width;
int32 height;
int32 hasAlpha;
Parameters: rawData - byte array to fill header for, length of thatarray must be greater than 16, otherwise function fails (returns false) Parameters: width - width of the image Parameters: height - height of the image Parameters: hasAlpha - if image has alpha channel |
isFormatSupported | public static boolean isFormatSupported(int rawFormat, int colorFormat)(Code) | | Defines if format is currently supported.
Parameters: rawFormat - raw format Parameters: colorFormat - color format true if format is supported false otherwise |
|
|