Package VASSAL.tools.image
Interface ImageLoader
- All Known Implementing Classes:
ImageIOImageLoader
public interface ImageLoader
An interface for loading images.
- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Method Summary
Modifier and TypeMethodDescriptionload
(String name, InputStream in, int typeIfOpaque, int typeIfTransparent, boolean managed) Loads an image.size
(String name, InputStream in) Gets the size of an image.
-
Method Details
-
load
BufferedImage load(String name, InputStream in, int typeIfOpaque, int typeIfTransparent, boolean managed) throws ImageIOException Loads an image.- Parameters:
name
- the image namein
- the input streamtypeIfOpaque
- the requested image type for opaque imagestypeIfTransparent
- the requested image type for transparent imagesmanaged
-true
if a managed image should be returned- Returns:
- the image
- Throws:
BrokenImageException
- if the image is faultyUnrecognizedImageTypeException
- if the image type is not recognizedImageIOException
- if reading the image goes wrong
-
size
Gets the size of an image.- Parameters:
name
- the image namein
- the input stream- Returns:
- the size of the image
- Throws:
BrokenImageException
- if the image is faultyUnrecognizedImageTypeException
- if the image type is not recognizedImageIOException
- if reading the image goes wrong
-