Package org.libjpegturbo.turbojpeg
Class TJTransform
- java.lang.Object
- 
- java.awt.geom.RectangularShape
- 
- java.awt.geom.Rectangle2D
- 
- java.awt.Rectangle
- 
- org.libjpegturbo.turbojpeg.TJTransform
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.Shape,- java.io.Serializable,- java.lang.Cloneable
 
 public class TJTransform extends java.awt.RectangleLossless transform parameters- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description TJCustomFiltercfCustom filter instancestatic intNUMOPThe number of lossless transform operationsintopTransform operation (one ofOP_*)static intOP_HFLIPFlip (mirror) image horizontally.static intOP_NONEDo not transform the position of the image pixels.static intOP_ROT180Rotate image 180 degrees.static intOP_ROT270Rotate image counter-clockwise by 90 degrees.static intOP_ROT90Rotate image clockwise by 90 degrees.static intOP_TRANSPOSETranspose image (flip/mirror along upper left to lower right axis).static intOP_TRANSVERSETransverse transpose image (flip/mirror along upper right to lower left axis).static intOP_VFLIPFlip (mirror) image vertically.static intOPT_ARITHMETICThis option will enable arithmetic entropy coding in the JPEG image generated by this particular transform.static intOPT_COPYNONEThis option will preventTJTransformer.transform()from copying any extra markers (including EXIF and ICC profile data) from the source image to the destination image.static intOPT_CROPThis option will enable lossless cropping.static intOPT_GRAYThis option will discard the color data in the source image and produce a grayscale destination image.static intOPT_NOOUTPUTThis option will preventTJTransformer.transform()from outputting a JPEG image for this particular transform.static intOPT_OPTIMIZEThis option will enable optimized baseline entropy coding in the JPEG image generated by this particular transform.static intOPT_PERFECTThis option will causeTJTransformer.transform()to throw an exception if the transform is not perfect.static intOPT_PROGRESSIVEThis option will enable progressive entropy coding in the JPEG image generated by this particular transform.static intOPT_TRIMThis option will discard any partial MCU blocks that cannot be transformed.intoptionsTransform options (bitwise OR of one or more ofOPT_*)
 - 
Constructor SummaryConstructors Constructor Description TJTransform()Create a new lossless transform instance.TJTransform(int x, int y, int w, int h, int op, int options, TJCustomFilter cf)Create a new lossless transform instance with the given parameters.TJTransform(java.awt.Rectangle r, int op, int options, TJCustomFilter cf)Create a new lossless transform instance with the given parameters.
 - 
Method Summary- 
Methods inherited from class java.awt.Rectangleadd, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union
 - 
Methods inherited from class java.awt.geom.Rectangle2Dadd, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 - 
Methods inherited from class java.awt.geom.RectangularShapeclone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
- 
 
- 
- 
- 
Field Detail- 
NUMOPpublic static final int NUMOP The number of lossless transform operations- See Also:
- Constant Field Values
 
 - 
OP_NONEpublic static final int OP_NONE Do not transform the position of the image pixels.- See Also:
- Constant Field Values
 
 - 
OP_HFLIPpublic static final int OP_HFLIP Flip (mirror) image horizontally. This transform is imperfect if there are any partial MCU blocks on the right edge.- See Also:
- OPT_PERFECT, Constant Field Values
 
 - 
OP_VFLIPpublic static final int OP_VFLIP Flip (mirror) image vertically. This transform is imperfect if there are any partial MCU blocks on the bottom edge.- See Also:
- OPT_PERFECT, Constant Field Values
 
 - 
OP_TRANSPOSEpublic static final int OP_TRANSPOSE Transpose image (flip/mirror along upper left to lower right axis). This transform is always perfect.- See Also:
- OPT_PERFECT, Constant Field Values
 
 - 
OP_TRANSVERSEpublic static final int OP_TRANSVERSE Transverse transpose image (flip/mirror along upper right to lower left axis). This transform is imperfect if there are any partial MCU blocks in the image.- See Also:
- OPT_PERFECT, Constant Field Values
 
 - 
OP_ROT90public static final int OP_ROT90 Rotate image clockwise by 90 degrees. This transform is imperfect if there are any partial MCU blocks on the bottom edge.- See Also:
- OPT_PERFECT, Constant Field Values
 
 - 
OP_ROT180public static final int OP_ROT180 Rotate image 180 degrees. This transform is imperfect if there are any partial MCU blocks in the image.- See Also:
- OPT_PERFECT, Constant Field Values
 
 - 
OP_ROT270public static final int OP_ROT270 Rotate image counter-clockwise by 90 degrees. This transform is imperfect if there are any partial MCU blocks on the right edge.- See Also:
- OPT_PERFECT, Constant Field Values
 
 - 
OPT_PERFECTpublic static final int OPT_PERFECT This option will causeTJTransformer.transform()to throw an exception if the transform is not perfect. Lossless transforms operate on MCU blocks, whose size depends on the level of chrominance subsampling used. If the image's width or height is not evenly divisible by the MCU block size (seeTJ.getMCUWidth()andTJ.getMCUHeight()), then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is "imperfect." If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image.- See Also:
- Constant Field Values
 
 - 
OPT_TRIMpublic static final int OPT_TRIM This option will discard any partial MCU blocks that cannot be transformed.- See Also:
- Constant Field Values
 
 - 
OPT_CROPpublic static final int OPT_CROP This option will enable lossless cropping.- See Also:
- Constant Field Values
 
 - 
OPT_GRAYpublic static final int OPT_GRAY This option will discard the color data in the source image and produce a grayscale destination image.- See Also:
- Constant Field Values
 
 - 
OPT_NOOUTPUTpublic static final int OPT_NOOUTPUT This option will preventTJTransformer.transform()from outputting a JPEG image for this particular transform. This can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.- See Also:
- Constant Field Values
 
 - 
OPT_PROGRESSIVEpublic static final int OPT_PROGRESSIVE This option will enable progressive entropy coding in the JPEG image generated by this particular transform. Progressive entropy coding will generally improve compression relative to baseline entropy coding (the default), but it will reduce decompression performance considerably. Can be combined withOPT_ARITHMETIC. ImpliesOPT_OPTIMIZEunlessOPT_ARITHMETICis also specified.- See Also:
- Constant Field Values
 
 - 
OPT_COPYNONEpublic static final int OPT_COPYNONE This option will preventTJTransformer.transform()from copying any extra markers (including EXIF and ICC profile data) from the source image to the destination image.- See Also:
- Constant Field Values
 
 - 
OPT_ARITHMETICpublic static final int OPT_ARITHMETIC This option will enable arithmetic entropy coding in the JPEG image generated by this particular transform. Arithmetic entropy coding will generally improve compression relative to Huffman entropy coding (the default), but it will reduce decompression performance considerably. Can be combined withOPT_PROGRESSIVE.- See Also:
- Constant Field Values
 
 - 
OPT_OPTIMIZEpublic static final int OPT_OPTIMIZE This option will enable optimized baseline entropy coding in the JPEG image generated by this particular transform. Optimized baseline entropy coding will improve compression slightly (generally 5% or less.)- See Also:
- Constant Field Values
 
 - 
oppublic int op Transform operation (one ofOP_*)
 - 
optionspublic int options Transform options (bitwise OR of one or more ofOPT_*)
 - 
cfpublic TJCustomFilter cf Custom filter instance
 
- 
 - 
Constructor Detail- 
TJTransformpublic TJTransform() Create a new lossless transform instance.
 - 
TJTransformpublic TJTransform(int x, int y, int w, int h, int op, int options, TJCustomFilter cf)Create a new lossless transform instance with the given parameters.- Parameters:
- x- the left boundary of the cropping region. This must be evenly divisible by the MCU block width (see- TJ.getMCUWidth())
- y- the upper boundary of the cropping region. This must be evenly divisible by the MCU block height (see- TJ.getMCUHeight())
- w- the width of the cropping region. Setting this to 0 is the equivalent of setting it to (width of the source JPEG image -- x).
- h- the height of the cropping region. Setting this to 0 is the equivalent of setting it to (height of the source JPEG image -- y).
- op- one of the transform operations (- OP_*)
- options- the bitwise OR of one or more of the transform options (- OPT_*)
- cf- an instance of an object that implements the- TJCustomFilterinterface, or null if no custom filter is needed
 
 - 
TJTransformpublic TJTransform(java.awt.Rectangle r, int op, int options, TJCustomFilter cf)Create a new lossless transform instance with the given parameters.- Parameters:
- r- a- java.awt.Rectangleinstance that specifies the cropping region. See- TJTransform(int, int, int, int, int, int, TJCustomFilter)for more details.
- op- one of the transform operations (- OP_*)
- options- the bitwise OR of one or more of the transform options (- OPT_*)
- cf- an instance of an object that implements the- TJCustomFilterinterface, or null if no custom filter is needed
 
 
- 
 
-