FileDocCategorySizeDatePackage
RasterImage.javaAPI DocphoneME MR2 API (J2ME)2312Wed May 02 18:00:34 BST 2007com.sun.perseus.j2d

RasterImage

public class RasterImage extends Object
Class for 2D Raster Images.
version
$Id: RasterImage.java,v 1.4 2006/04/21 06:34:58 st125089 Exp $

Fields Summary
javax.microedition.lcdui.Image
image
int[]
argb
The cached pixel array.
Constructors Summary
RasterImage(javax.microedition.lcdui.Image img)

        if (img == null) {
            throw new NullPointerException();
        }

        image = img;
    
Methods Summary
public intgetHeight()

return
the image height.

        return image.getHeight();
    
public int[]getRGB()

return
a pixel array where the image data is stored in single pixel packed format 0xaarrggbb, with a scanline stride equal to the image width and a zero offset in the returned array. The returned array is of size width * height.


        if (argb != null) {
            return argb;
        }

	int w = image.getWidth();
	int h = image.getHeight();

	argb  = new int[w*h];

        image.getRGB(argb,
		     0, w,
		     0, 0,
		     w, h);

	return argb;

    
public intgetWidth()

return
the image width.

        return image.getWidth();