public class TurboJpeg extends Object
| Modifier and Type | Field and Description |
|---|---|
libturbojpeg |
lib |
jnr.ffi.Runtime |
runtime |
| Constructor and Description |
|---|
TurboJpeg() |
| Modifier and Type | Method and Description |
|---|---|
BufferedImage |
decode(byte[] jpegData,
Info info,
Dimension size)
Decode the JPEG image in the input buffer into a BufferedImage.
|
ByteBuffer |
encode(Raster img,
int quality)
Encode an image to JPEG
|
Info |
getInfo(byte[] jpegData)
Return information about the JPEG image in the input buffer
|
ByteBuffer |
transform(byte[] jpegData,
Info info,
Rectangle region,
int rotation)
Transform a JPEG image without decoding it fully
|
public libturbojpeg lib
public jnr.ffi.Runtime runtime
public Info getInfo(byte[] jpegData) throws TurboJpegException
TurboJpegExceptionpublic BufferedImage decode(byte[] jpegData, Info info, Dimension size) throws TurboJpegException
jpegData - JPEG data input bufferinfo - Information about the JPEG image in the buffersize - Target decompressed dimensions, must be among the available sizes (see Info.getAvailableSizes())TurboJpegExceptionpublic ByteBuffer encode(Raster img, int quality) throws TurboJpegException
TurboJpegExceptionpublic ByteBuffer transform(byte[] jpegData, Info info, Rectangle region, int rotation) throws TurboJpegException
jpegData - JPEG input bufferinfo - Information about the JPEG (from getInfo(byte[])region - Source region to crop out of JPEGrotation - Degrees to rotate the JPEG, must be 90, 180 or 270TurboJpegExceptionCopyright © 2018. All rights reserved.