Interface ImageConverter
-
- All Known Implementing Classes:
AbstractImageConverter,ImageConverterBitmap2G2D,ImageConverterBuffered2Rendered,ImageConverterG2D2Bitmap,ImageConverterRendered2PNG
public interface ImageConverterDefines an image converter that can convert one image representation into another.
-
-
Field Summary
Fields Modifier and Type Field Description static intMEDIUM_CONVERSION_PENALTYDefault/Medium conversion penalty (if there's some effort to convert the image format)static intMINIMAL_CONVERSION_PENALTYUsed if the conversion penalty is minimalstatic intNO_CONVERSION_PENALTYUsed if the conversion penalty is negligible (for example a simple cast).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Imageconvert(Image src, java.util.Map hints)Converts an image into a different representation.intgetConversionPenalty()Returns the conversion penalty for the conversion that this implementation supports.ImageFlavorgetSourceFlavor()Returns the flavor that this converter expects.ImageFlavorgetTargetFlavor()Returns the flavor that this converter converts images into.
-
-
-
Field Detail
-
NO_CONVERSION_PENALTY
static final int NO_CONVERSION_PENALTY
Used if the conversion penalty is negligible (for example a simple cast).- See Also:
- Constant Field Values
-
MINIMAL_CONVERSION_PENALTY
static final int MINIMAL_CONVERSION_PENALTY
Used if the conversion penalty is minimal- See Also:
- Constant Field Values
-
MEDIUM_CONVERSION_PENALTY
static final int MEDIUM_CONVERSION_PENALTY
Default/Medium conversion penalty (if there's some effort to convert the image format)- See Also:
- Constant Field Values
-
-
Method Detail
-
convert
Image convert(Image src, java.util.Map hints) throws ImageException, java.io.IOException
Converts an image into a different representation.Consumers can get the effective MIME type (if any) from the associated
ImageFlavor.- Parameters:
src- the source imagehints- the conversion hints- Returns:
- the converted image
- Throws:
ImageException- if an error occurs while converting the imagejava.io.IOException- if an I/O error occurs while converting the image
-
getTargetFlavor
ImageFlavor getTargetFlavor()
Returns the flavor that this converter converts images into.- Returns:
- the target flavor
-
getSourceFlavor
ImageFlavor getSourceFlavor()
Returns the flavor that this converter expects.- Returns:
- the source flavor
-
getConversionPenalty
int getConversionPenalty()
Returns the conversion penalty for the conversion that this implementation supports.- Returns:
- the conversion penalty (must be a non-negative integer)
-
-