public class OpenJpeg extends Object
| Modifier and Type | Field and Description |
|---|---|
libopenjp2 |
lib |
jnr.ffi.Runtime |
runtime |
| Constructor and Description |
|---|
OpenJpeg()
Load the library.
|
| Modifier and Type | Method and Description |
|---|---|
BufferedImage |
decode(InStreamWrapper wrapper,
Rectangle area,
int reduceFactor)
Decode the JPEG2000 image in the input stream to a BufferedImage.
|
void |
encode(Raster img,
OutStreamWrapper output,
opj_cparameters params)
Encode a raster image to a JPEG2000 image.
|
Info |
getInfo(InStreamWrapper wrapper)
Obtain information about the JPEG200 image in the input stream.
|
public libopenjp2 lib
public jnr.ffi.Runtime runtime
public Info getInfo(InStreamWrapper wrapper) throws IOException
IOExceptionpublic BufferedImage decode(InStreamWrapper wrapper, Rectangle area, int reduceFactor) throws IOException
wrapper - Wrapper around the input stream pointing to the imagearea - Region of the image to decodereduceFactor - Scale down the image by a factor of 2^reduceFactorIOException - if there's a problem decoding the imagepublic void encode(Raster img, OutStreamWrapper output, opj_cparameters params) throws IOException
img - image to encodeoutput - wrapped OutputStream the image should be written toparams - encoding parametersIOException - if encoding failsCopyright © 2019. All rights reserved.