public class JP2Decoder
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JP2Decoder.Header |
| Constructor and Description |
|---|
JP2Decoder(byte[] data)
Decode a JPEG-2000 image from a byte array.
|
JP2Decoder(java.io.InputStream is)
Decode a JPEG-2000 image from a stream.
|
JP2Decoder(java.lang.String fileName)
Decode a JPEG-2000 image file.
|
| Modifier and Type | Method and Description |
|---|---|
android.graphics.Bitmap |
decode() |
JP2Decoder |
disableBitmapPremultiplication()
This allows you to turn off alpha pre-multiplication in the output bitmap.
|
static boolean |
isJPEG2000(byte[] data)
Returns true if the byte array starts with values typical for a JPEG-2000 header.
|
JP2Decoder.Header |
readHeader()
Decodes the file header information and returns it in a
JP2Decoder.Header object. |
JP2Decoder |
setLayersToDecode(int layersToDecode)
Set the maximum number of quality layers to decode.
|
JP2Decoder |
setSkipResolutions(int skipResolutions)
Set the number of highest resolution levels to be discarded.
|
public JP2Decoder(byte[] data)
data - the JPEG-2000 imagepublic JP2Decoder(java.lang.String fileName)
fileName - the name of the JPEG-2000 filepublic JP2Decoder(java.io.InputStream is)
is - the stream containing the JPEG-2000 imagepublic JP2Decoder setSkipResolutions(int skipResolutions)
readHeader()
method.skipResolutions - the number of resolutions to skipJP2Decoderpublic JP2Decoder setLayersToDecode(int layersToDecode)
readHeader() method. Special value 0 indicates all layers.layersToDecode - number of quality layers to decodeJP2Decoderpublic JP2Decoder disableBitmapPremultiplication()
JP2DecoderBitmap.setPremultiplied(boolean),
BitmapFactory.Options#inPremultipliedpublic static boolean isJPEG2000(byte[] data)
data - the byte array to checktrue if the beginning looks like a JPEG-2000 header; false otherwisepublic android.graphics.Bitmap decode()
null in case of an errorpublic JP2Decoder.Header readHeader()
JP2Decoder.Header object.