English | Site Directory

Android - An Open Handset Alliance Project

android.opengl
public class

android.opengl.Texture

java.lang.Object
android.opengl.Texture

Summary

Public Constructors

          Texture()

Public Methods

      static  void  decodeJPEG(byte[] jpegData, int jpegDataOffset, int jpegDataLength, int[] bounds, int boundsOffset, Buffer rgb565)
Decodes a JPEG encoded image into an OpenGL ES compatible GL10.GL_UNSIGNED_SHORT_5_6_5 buffer.
Methods inherited from class java.lang.Object

Details

Public Constructors

public Texture()

Public Methods

public static void decodeJPEG(byte[] jpegData, int jpegDataOffset, int jpegDataLength, int[] bounds, int boundsOffset, Buffer rgb565)

Decodes a JPEG encoded image into an OpenGL ES compatible GL10.GL_UNSIGNED_SHORT_5_6_5 buffer. May also be used to determin the bounds of an image prior to decoding it.

Parameters

jpegData the source JPEG data
bounds the buffer where the bounds will be reported. May be null, in which case no bounds are returned. The bounds will be returned as two integers. bounds[boundsOffset] == width, bounds[boundsOffset+1] == height.
boundsOffset the offset into the array where the bounds will be stored.
rgb565 the destination 565 buffer. May be null, and may also be larger than or smaller than the amount of space required to store the image data. If rgb565 is smaller than the amount of space required to store the image data, then any excess image data will be discarded.

Throws

IllegalArgumentException if the JPEG data is not a valid JPEG image, or if jpegData is null, or jpegDataOffset < 0, or jpegDataOffset + jpegDataLength > jpegData.length, or or bounds.length < 2, boundsOffset < 0, boundsOffset > bounds.length - 2. /** Decodes a JPEG encoded image into a buffer.
IllegalArgumentException if the JPEG data is not a valid JPEG image.
Build m5-rc15i - 10 Jun 2008 13:54