public interface TJCustomFilter
|Modifier and Type||Method and Description|
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 image.
void customFilter(java.nio.ShortBuffer coeffBuffer, java.awt.Rectangle bufferRegion, java.awt.Rectangle planeRegion, int componentID, int transformID, TJTransform transform) throws TJException
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
coeffBufferas 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
componentID- ID number of the component plane to which
coeffBufferbelongs (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
coeffBufferbelongs. This is the same as the index of the transform in the
transformsarray that was passed to
TJTransforminstance that specifies the parameters and/or cropping region for this transform