public class JP2Encoder
extends java.lang.Object
hasAlpha() value of the input bitmap)| Modifier and Type | Class and Description |
|---|---|
static interface |
JP2Encoder.OutputFormat |
| Modifier and Type | Field and Description |
|---|---|
static int |
FORMAT_J2K
JPEG 2000 codestream format
|
static int |
FORMAT_JP2
The standard JPEG-2000 file format
|
| Constructor and Description |
|---|
JP2Encoder(android.graphics.Bitmap bmp)
Creates a new instance of the JPEG-2000 encoder.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
encode()
Encode to JPEG-2000, return the result as a byte array.
|
int |
encode(java.io.OutputStream out)
Encode to JPEG-2000, write the result into an
OutputStream. |
boolean |
encode(java.lang.String fileName)
Encode to JPEG-2000, store the result into a file.
|
JP2Encoder |
setCompressionRatio(float... compressionRatios)
Set compression ratio.
|
JP2Encoder |
setNumResolutions(int numResolutions)
Set the number of resolutions.
|
JP2Encoder |
setOutputFormat(int outputFormat)
Sets the output file format.
|
JP2Encoder |
setVisualQuality(float... qualityValues)
Set image quality.
|
public static final int FORMAT_J2K
public static final int FORMAT_JP2
public JP2Encoder(android.graphics.Bitmap bmp)
bmp - the bitmap to encodepublic JP2Encoder setNumResolutions(int numResolutions)
JP2Decoder.setSkipResolutions(int)).numResolutions - number of resolutionsJP2Encoder instancepublic JP2Encoder setCompressionRatio(float... compressionRatios)
setVisualQuality(float...).JP2Decoder.setLayersToDecode(int).)setCompressionRatio(float...) and setVisualQuality(float...)
cannot be used together.compressionRatios - compression ratiosJP2Encoder instancepublic JP2Encoder setVisualQuality(float... qualityValues)
setCompressionRatio(float...).JP2Decoder.setLayersToDecode(int).)setVisualQuality(float...) and setCompressionRatio(float...) cannot be used together.qualityValues - quality layer PSNR valuesJP2Encoder instancepublic JP2Encoder setOutputFormat(int outputFormat)
FORMAT_JP2.outputFormat - FORMAT_J2K or FORMAT_JP2JP2Encoder instancepublic byte[] encode()
public boolean encode(java.lang.String fileName)
fileName - the name of the output filetrue if the image was successfully converted and stored; false otherwisepublic int encode(java.io.OutputStream out)
throws java.io.IOException
OutputStream.out - the stream into which the result will be writtenjava.io.IOException - if there's an error writing the result into the output stream