BenQ Mobile

javax.microedition.m3g
Class Image2D

java.lang.Object
  extended byjavax.microedition.m3g.Object3D
      extended byjavax.microedition.m3g.Image2D

public class Image2D
extends Object3D

A two-dimensional image that can be used as a texture, background or sprite image.


Field Summary
static int ALPHA
          A constructor parameter specifying that this Image2D has an alpha component only.
static int LUMINANCE
          A constructor parameter specifying that this Image2D has a luminance component only.
static int LUMINANCE_ALPHA
          A constructor parameter specifying that this Image2D has luminance and alpha components.
static int RGB
          A constructor parameter specifying that this Image2D has red, green and blue color components.
static int RGBA
          A constructor parameter specifying that this Image2D has red, green, blue and alpha components.
 
Constructor Summary
Image2D(int format, int width, int height)
          Constructs an empty, mutable Image2D with the given dimensions.
Image2D(int format, int width, int height, byte[] image)
          Constructs an immutable Image2D by copying pixels from a byte array.
Image2D(int format, int width, int height, byte[] image, byte[] palette)
          Constructs an immutable Image2D by copying palette indices from a byte array, and the palette entries from another byte array.
Image2D(int format, java.lang.Object image)
          Constructs an immutable Image2D by copying pixels from a MIDP or AWT Image.
 
Method Summary
 int getFormat()
          Gets the internal format of this Image2D.
 int getHeight()
          Gets the height of this Image2D, in pixels.
 int getWidth()
          Gets the width of this Image2D, in pixels.
 boolean isMutable()
          Queries whether this Image2D is mutable.
 void set(int x, int y, int width, int height, byte[] image)
          Updates a rectangular area of this Image2D by copying pixels from a byte array.
 
Methods inherited from class javax.microedition.m3g.Object3D
addAnimationTrack, animate, duplicate, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, getUserObject, removeAnimationTrack, setUserID, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALPHA

public static final int ALPHA
A constructor parameter specifying that this Image2D has an alpha component only.

See Also:
Constant Field Values

LUMINANCE

public static final int LUMINANCE
A constructor parameter specifying that this Image2D has a luminance component only.

See Also:
Constant Field Values

LUMINANCE_ALPHA

public static final int LUMINANCE_ALPHA
A constructor parameter specifying that this Image2D has luminance and alpha components.

See Also:
Constant Field Values

RGB

public static final int RGB
A constructor parameter specifying that this Image2D has red, green and blue color components.

See Also:
Constant Field Values

RGBA

public static final int RGBA
A constructor parameter specifying that this Image2D has red, green, blue and alpha components.

See Also:
Constant Field Values
Constructor Detail

Image2D

public Image2D(int format,
               java.lang.Object image)
Constructs an immutable Image2D by copying pixels from a MIDP or AWT Image.


Image2D

public Image2D(int format,
               int width,
               int height,
               byte[] image)
Constructs an immutable Image2D by copying pixels from a byte array.


Image2D

public Image2D(int format,
               int width,
               int height,
               byte[] image,
               byte[] palette)
Constructs an immutable Image2D by copying palette indices from a byte array, and the palette entries from another byte array.


Image2D

public Image2D(int format,
               int width,
               int height)
Constructs an empty, mutable Image2D with the given dimensions.

Method Detail

set

public void set(int x,
                int y,
                int width,
                int height,
                byte[] image)
Updates a rectangular area of this Image2D by copying pixels from a byte array.


isMutable

public boolean isMutable()
Queries whether this Image2D is mutable.


getFormat

public int getFormat()
Gets the internal format of this Image2D.


getWidth

public int getWidth()
Gets the width of this Image2D, in pixels.


getHeight

public int getHeight()
Gets the height of this Image2D, in pixels.


BenQ Mobile

Copyright © 2006 BenQ Mobile GmbH & Co. OHG or respective copyright owner.
All Rights Reserved.
BenQ Corp. is a trademark licensee of Siemens AG.


For further information about Mobility Toolkit (MTK) visit our Developer Portal.