|
JIU 0.12.0 Homepage | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.color.reduction.AutoDetectColorType
Detects the minimum (in terms of memory) color type of an image. Can convert the original image to that new input type on demand.
Input parameters: image to be examined, boolean that specifies whether conversion will be performed (default is true, conversion is performed). Output parameters: converted image, boolean that expresses whether a conversion was possible.
Supported types for input image: RGB24Image, Gray8Image, Paletted8Image.
BilevelImage is not supported because there is no smaller image type, so bilevel images cannot be reduced.
This operation is not a ImageToImageOperation
because this
class need not necessarily produce a new image
(with setConversion(boolean)
(false)).
PixelImage image = ImageLoader.load("test.bmp"); AutoDetectColorType op = new AutoDetectColorType(); op.setInputImage(image); op.process(); if (op.isReducible()) { image = op.getOutputImage(); }
Field Summary | |
static int |
TYPE_BILEVEL
|
static int |
TYPE_GRAY16
|
static int |
TYPE_GRAY8
|
static int |
TYPE_PALETTED8
|
static int |
TYPE_RGB24
|
static int |
TYPE_RGB48
|
static int |
TYPE_UNKNOWN
|
Constructor Summary | |
AutoDetectColorType()
|
Method Summary | |
PixelImage |
getOutputImage()
Returns the reduced output image if one was created in process() . |
int |
getType()
Returns the type of the minimum image type found (one of the TYPE_xyz constants of this class). |
boolean |
isReducible()
This method can be called after process() to find out if the input
image in fact can be reduced to a "smaller" image type.
|
void |
process()
This method does the actual work of the operation. |
void |
setConversion(boolean convert)
This method can be used to specify whether the input image is to be converted to the minimum image type if it is clear that such a conversion is possible. |
void |
setInputImage(PixelImage image)
This method must be used to specify the mandatory input image. |
Methods inherited from class net.sourceforge.jiu.ops.Operation |
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TYPE_UNKNOWN
public static final int TYPE_BILEVEL
public static final int TYPE_GRAY16
public static final int TYPE_GRAY8
public static final int TYPE_PALETTED8
public static final int TYPE_RGB24
public static final int TYPE_RGB48
Constructor Detail |
public AutoDetectColorType()
Method Detail |
public PixelImage getOutputImage()
process()
.
public int getType()
public boolean isReducible()
process()
to find out if the input
image in fact can be reduced to a "smaller" image type.
If this method returns true
and if conversion was desired by the
user (can be specified via setConversion(boolean)
), the reduced image can
be retrieved via getOutputImage()
.
public void process() throws MissingParameterException, WrongParameterException
Operation
process
in class Operation
MissingParameterException
- if any mandatory parameter was not given to the operation
WrongParameterException
- if at least one of the input parameters was
not initialized appropriately (values out of the valid interval, etc.)public void setConversion(boolean convert)
true
.
If this is set to false
, it can still be
convert
- if true, the conversion will be performedpublic void setInputImage(PixelImage image)
image
- PixelImage object to be examined
|
JIU 0.12.0 Homepage | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |