public class ImageOutput extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CO_FLATE
Compress image using Flate compression.
|
static int |
CO_JBIG2
Compress image to JBIG2 (implies conversion to B/W).
|
static int |
CO_JPEG
Compress image to JPEG.
|
static int |
CO_JPEG2000
Compress image to JPEG 2000.
|
static int |
CO_RETAIN
Retain image current compression.
|
static int |
CS_BW
Convert image to B/W (1 bit grayscale).
|
static int |
CS_CMYK
Convert image to CMYK.
|
static int |
CS_GRAY
Convert image to grayscale.
|
static int |
CS_RETAIN
Retain image current color space.
|
static int |
CS_RGB
Convert image to RGB.
|
Constructor and Description |
---|
ImageOutput(int imageCompression,
float compQuality,
int colorSpace,
int imgWidth,
int imgHeight)
Constructs an ImageOuput object with the given image compression, compression quality, color space, width and height.
|
ImageOutput(int imageCompression,
float compQuality,
int colorSpace,
int imgWidth,
int imgHeight,
boolean onlyChangeIfSmaller) |
ImageOutput(int imageCompression,
int colorSpace,
int imgWidth,
int imgHeight)
Constructs an ImageOuput object with the given image compression, color space, width and height.
|
Modifier and Type | Method and Description |
---|---|
int |
getColorSpace()
Gets the image output color space.
|
int |
getCompression()
Returns the image output compression.
|
float |
getCompressionQuality()
Returns the image output compression quality which applies to JPEG and JPEG2000 images.
|
int |
getImageHeight()
Returns the image output image width in pixels.
|
int |
getImageWidth()
Returns the image output image width in pixels.
|
boolean |
isOnlyChangeIfSmaller()
Sets the flag to update an image only when the altered image is smaller than the original.
|
void |
setColorSpace(int cs)
Sets the color space to convert images to.
|
void |
setCompression(int compression)
Sets the image output compression.
|
void |
setCompressionQuality(float compQuality)
Sets the image output compression quality, which is only used when the compression is JPEG or JPEG2000.
|
void |
setImageHeight(int imgHeight)
Sets the image output image height in pixels.
|
void |
setImageWidth(int imgWidth)
Sets the image output image width in pixels.
|
void |
setOnlyChangeIfSmaller(boolean mOnlyChangeIfSmaller)
Sets the flag to update an image only when the altered image is smaller than the original.
|
String |
toString()
Display human-readable processing parameters.
|
public static final int CO_RETAIN
public static final int CO_JPEG
public static final int CO_JPEG2000
public static final int CO_JBIG2
public static final int CO_FLATE
public static final int CS_RETAIN
public static final int CS_RGB
public static final int CS_GRAY
public static final int CS_CMYK
public static final int CS_BW
public ImageOutput(int imageCompression, int colorSpace, int imgWidth, int imgHeight)
imageCompression
- the new compression, allowed values are CO_RETAIN
, CO_JPEG
, CO_JPEG2000
, CO_JBIG2
, CO_FLATE
colorSpace
- the color space to convert to, allowed values are CS_RETAIN
, CS_BW
, CS_CMYK
, CS_GRAY
, CS_RGB
imgWidth
- the new image width, in pixelsimgHeight
- the new image height, in pixelspublic ImageOutput(int imageCompression, float compQuality, int colorSpace, int imgWidth, int imgHeight)
imageCompression
- the new compression, allowed values are CO_RETAIN
, CO_JPEG
, CO_JPEG2000
, CO_JBIG2
, CO_FLATE
compQuality
- the new compression quality, allowed values are 0.1 to 1.0colorSpace
- the color space to convert to, allowed values are CS_RETAIN
, CS_BW
, CS_CMYK
, CS_GRAY
, CS_RGB
imgWidth
- the new image width, in pixelsimgHeight
- the new image height, in pixelspublic ImageOutput(int imageCompression, float compQuality, int colorSpace, int imgWidth, int imgHeight, boolean onlyChangeIfSmaller)
public float getCompressionQuality()
public void setCompressionQuality(float compQuality)
compQuality
- the new value for compression quality. Valid values are 0.1 to 1.0.public int getImageWidth()
public void setImageWidth(int imgWidth)
imgWidth
- the new image width.public int getImageHeight()
public void setImageHeight(int imgHeight)
imgHeight
- the new image height, in pixels.public String toString()
public int getCompression()
public void setCompression(int compression)
compression
- the new compression, allowed values are CO_RETAIN
, CO_JPEG
, CO_JPEG2000
, CO_JBIG2
, CO_FLATE
public int getColorSpace()
public void setColorSpace(int cs)
public boolean isOnlyChangeIfSmaller()
public void setOnlyChangeIfSmaller(boolean mOnlyChangeIfSmaller)
mOnlyChangeIfSmaller
- Set to true to update an image only when the altered image is smaller than the original.