|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.geom.RectangularShape java.awt.geom.Rectangle2D java.awt.Rectangle org.libjpegturbo.turbojpeg.TJTransform
public class TJTransform
Lossless transform parameters
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
---|
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
Field Summary | |
---|---|
TJCustomFilter |
cf
Custom filter instance |
static int |
NUMOP
The number of lossless transform operations |
int |
op
Transform operation (one of OP_* ) |
static int |
OP_HFLIP
Flip (mirror) image horizontally. |
static int |
OP_NONE
Do not transform the position of the image pixels. |
static int |
OP_ROT180
Rotate image 180 degrees. |
static int |
OP_ROT270
Rotate image counter-clockwise by 90 degrees. |
static int |
OP_ROT90
Rotate image clockwise by 90 degrees. |
static int |
OP_TRANSPOSE
Transpose image (flip/mirror along upper left to lower right axis). |
static int |
OP_TRANSVERSE
Transverse transpose image (flip/mirror along upper right to lower left axis). |
static int |
OP_VFLIP
Flip (mirror) image vertically. |
static int |
OPT_CROP
This option will enable lossless cropping. |
static int |
OPT_GRAY
This option will discard the color data in the input image and produce a grayscale output image. |
static int |
OPT_NOOUTPUT
This option will prevent TJTransformer.transform() from outputting a JPEG image for this
particular transform. |
static int |
OPT_PERFECT
This option will cause TJTransformer.transform() to throw an exception if the transform is not
perfect. |
static int |
OPT_TRIM
This option will discard any partial MCU blocks that cannot be transformed. |
int |
options
Transform options (bitwise OR of one or more of OPT_* ) |
Fields inherited from class java.awt.Rectangle |
---|
height, width, x, y |
Fields inherited from class java.awt.geom.Rectangle2D |
---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
Constructor Summary | |
---|---|
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.Rectangle |
---|
add, 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.Rectangle2D |
---|
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union |
Methods inherited from class java.awt.geom.RectangularShape |
---|
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.Shape |
---|
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects |
Field Detail |
---|
public static final int NUMOP
public static final int OP_NONE
public static final int OP_HFLIP
OPT_PERFECT
,
Constant Field Valuespublic static final int OP_VFLIP
OPT_PERFECT
,
Constant Field Valuespublic static final int OP_TRANSPOSE
OPT_PERFECT
,
Constant Field Valuespublic static final int OP_TRANSVERSE
OPT_PERFECT
,
Constant Field Valuespublic static final int OP_ROT90
OPT_PERFECT
,
Constant Field Valuespublic static final int OP_ROT180
OPT_PERFECT
,
Constant Field Valuespublic static final int OP_ROT270
OPT_PERFECT
,
Constant Field Valuespublic static final int OPT_PERFECT
TJTransformer.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 (see TJ.getMCUWidth(int)
and TJ.getMCUHeight(int)
), 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.
public static final int OPT_TRIM
public static final int OPT_CROP
public static final int OPT_GRAY
public static final int OPT_NOOUTPUT
TJTransformer.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.
public int op
OP_*
)
public int options
OPT_*
)
public TJCustomFilter cf
Constructor Detail |
---|
public TJTransform()
public TJTransform(int x, int y, int w, int h, int op, int options, TJCustomFilter cf) throws java.lang.Exception
x
- the left boundary of the cropping region. This must be evenly
divisible by the MCU block width (see TJ.getMCUWidth(int)
)y
- the upper boundary of the cropping region. This must be evenly
divisible by the MCU block height (see TJ.getMCUHeight(int)
)w
- the width of the cropping region. Setting this to 0 is the
equivalent of setting it to the 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 the 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 TJCustomFilter
interface, or null if no custom filter is needed
java.lang.Exception
public TJTransform(java.awt.Rectangle r, int op, int options, TJCustomFilter cf) throws java.lang.Exception
r
- a Rectangle
instance that specifies the cropping
region. See TJTransform(int, int, int, int, int, int, TJCustomFilter)
for more
detail.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 TJCustomFilter
interface, or null if no custom filter is needed
java.lang.Exception
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |