Package VASSAL.tools.image
Class FallbackImageTypeConverter
java.lang.Object
VASSAL.tools.image.FallbackImageTypeConverter
- All Implemented Interfaces:
ImageTypeConverter
public class FallbackImageTypeConverter extends Object implements ImageTypeConverter
Convert a
BufferedImage
to a different type, falling back to
conversion on disk if convertion in memory fails.- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Field Summary
Fields Modifier and Type Field Description protected ImageTypeConverter
file_converter
protected ImageTypeConverter
memory_converter
protected TemporaryFileFactory
tfactory
-
Constructor Summary
Constructors Constructor Description FallbackImageTypeConverter(TemporaryFileFactory tfactory)
Create a converter. -
Method Summary
Modifier and Type Method Description BufferedImage
convert(Reference<BufferedImage> ref, int type)
Converts an image to the given type.
-
Field Details
-
tfactory
-
memory_converter
-
file_converter
-
-
Constructor Details
-
FallbackImageTypeConverter
Create a converter.- Parameters:
tfactory
- the temporary file factory
-
-
Method Details
-
convert
Converts an image to the given type.- Specified by:
convert
in interfaceImageTypeConverter
- Parameters:
ref
- a holder for the imagetype
- the type of image to return- Returns:
- a converted image
- Throws:
ImageIOException
- if something goes wrong
-