public interface TJCustomFilter
Modifier and Type | Method and Description |
---|---|
void |
customFilter(ShortBuffer coeffBuffer,
Rectangle bufferRegion,
Rectangle planeRegion,
int componentID,
int transformID,
TJTransform transform)
A callback function that can be used to modify the DCT coefficients after
they are losslessly transformed but before they are transcoded to a new
JPEG file.
|
void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion, Rectangle planeRegion, int componentID, int transformID, TJTransform transform) throws Exception
coeffBuffer
- a buffer containing transformed DCT coefficients.
(NOTE: this buffer is not guaranteed to be valid once the callback
returns, so applications wishing to hand off the DCT coefficients to
another function or library should make a copy of them within the body of
the callback.)bufferRegion
- rectangle containing the width and height of
coeffBuffer
as well as its offset relative to the component
plane. TurboJPEG implementations may choose to split each component plane
into multiple DCT coefficient buffers and call the callback function once
for each buffer.planeRegion
- rectangle containing the width and height of the
component plane to which coeffBuffer
belongscomponentID
- ID number of the component plane to which
coeffBuffer
belongs (Y, Cb, and Cr have, respectively, ID's of
0, 1, and 2 in typical JPEG images.)transformID
- ID number of the transformed image to which
coeffBuffer
belongs. This is the same as the index of the
transform in the transforms array that was passed to TJTransformer.transform()
.transform
- a TJTransform
instance that specifies the
parameters and/or cropping region for this transformException
Copyright © 2017 Open Microscopy Environment