Interface ImageDecoder

All Known Implementing Classes:

public interface ImageDecoder

Defines a user specified decoder that can be set in ImageScanner.

BlackBerry API 7.0.0

Method Summary
 Object decode(byte[] data, int width, int height)
          Decodes the provided image data.

Method Detail


Object decode(byte[] data,
              int width,
              int height)
Decodes the provided image data.

If, in the future, full planar YUV data is specified then the length of the "data" array will be strictly greater than width*height. Therefore, implementations that are only interested in the luminance values should only examine the first width*height elements of the data array and not assume that the array's length is necessarily equal to width*height. Similarly, implementations that require full YUV data should first test that the array's length is greater than width*height in order to avoid ArrayIndexOutOfBoundsException being thrown if executed in an environment where only luminance values are specified in the "data" array.

As of 7.0, only luminance values are supplied, and thus, the length of the data array will be width*height.

data - Image data.
bitmap - The width of the image.
height - The height of the image.
An Object representing the data which has been decoded. If no data can be decoded from the image, then this method should return null. If a non-null Object is returned, then the ImageScanner which owns this decoder will stop scanning and notify the ImageDecoderListener that's also registered with ImageScanner.
BlackBerry API 7.0.0

Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.