Interface ImageSink<T>
-
- Type Parameters:
T- The destination class to which the thumbnail is stored or written.
- All Known Implementing Classes:
AbstractImageSink,BufferedImageSink,FileImageSink,FileImageSink.UninitializedImageSink,OutputStreamImageSink
public interface ImageSink<T>An interface to be implemented by classes which stores the image resulting from a thumbnail generation task.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TgetSink()Returns the destination to which the thumbnail will be stored or written.java.lang.StringpreferredOutputFormatName()Returns the output format to use from information provided for the output image.voidsetOutputFormatName(java.lang.String format)Sets the output format of the resulting image.voidsetThumbnailParameter(ThumbnailParameter param)Sets theThumbnailParameterfrom which to retrieve parameters to use when storing the image.voidwrite(java.awt.image.BufferedImage img)Writes the resulting image to a destination.
-
-
-
Method Detail
-
write
void write(java.awt.image.BufferedImage img) throws java.io.IOExceptionWrites the resulting image to a destination.- Parameters:
img- The image to write or store.- Throws:
java.io.IOException- When a problem occurs while writing or storing the image.java.lang.NullPointerException- If the image isnull.
-
setOutputFormatName
void setOutputFormatName(java.lang.String format)
Sets the output format of the resulting image.For
ImageSinks which stores raw images, the format name specified by this method may be ignored.- Parameters:
format- File format with which to store the image.
-
setThumbnailParameter
void setThumbnailParameter(ThumbnailParameter param)
Sets theThumbnailParameterfrom which to retrieve parameters to use when storing the image.- Parameters:
param- TheThumbnailParameterwith image writing parameters.
-
preferredOutputFormatName
java.lang.String preferredOutputFormatName()
Returns the output format to use from information provided for the output image.
If the output format cannot be determined, then
ThumbnailParameter.ORIGINAL_FORMATshould be returned.- Returns:
- Name of the preferred output format.
-
getSink
T getSink()
Returns the destination to which the thumbnail will be stored or written.- Returns:
- The destination for the thumbnail image.
-
-