Class SimpleFormat
- java.lang.Object
-
- uk.ac.rdg.resc.edal.graphics.formats.ImageFormat
-
- uk.ac.rdg.resc.edal.graphics.formats.SimpleFormat
-
- Direct Known Subclasses:
AviFormat
,GifFormat
,JpegFormat
,PngFormat
public abstract class SimpleFormat extends ImageFormat
Abstract superclass for simple image formats that do not require information about the layer, time values, bounding box etc to render an image.- Author:
- Jon Blower
-
-
Constructor Summary
Constructors Constructor Description SimpleFormat()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
requiresLegend()
Returns false: simple formats do not require a legend.abstract void
writeImage(List<BufferedImage> frames, OutputStream out, Integer frameRate)
Writes the given list ofjava.awt.BufferedImage
s to the given OutputStream.void
writeImage(List<BufferedImage> frames, OutputStream out, String name, String description, org.opengis.metadata.extent.GeographicBoundingBox bbox, List<org.joda.time.DateTime> tValues, String zValue, BufferedImage legend, Integer frameRate)
Writes the given list of frames to the supplied output stream.-
Methods inherited from class uk.ac.rdg.resc.edal.graphics.formats.ImageFormat
get, getMimeType, getSupportedMimeTypes, supportsFullyTransparentPixels, supportsMultipleFrames, supportsPartiallyTransparentPixels
-
-
-
-
Method Detail
-
requiresLegend
public final boolean requiresLegend()
Returns false: simple formats do not require a legend.- Specified by:
requiresLegend
in classImageFormat
- See Also:
KmzFormat
-
writeImage
public void writeImage(List<BufferedImage> frames, OutputStream out, String name, String description, org.opengis.metadata.extent.GeographicBoundingBox bbox, List<org.joda.time.DateTime> tValues, String zValue, BufferedImage legend, Integer frameRate) throws IOException
Description copied from class:ImageFormat
Writes the given list of frames to the supplied output stream. If there are multiple frames, the image format must support animations, otherwise an exception is thrown.- Specified by:
writeImage
in classImageFormat
- Parameters:
frames
- AList
ofBufferedImage
s to plotout
- TheOutputStream
to write the resulting image toname
- The name of the feature being plotted (for KML)description
- A description of what's being plotted (for KML)bbox
- The bounding box of the data being plottedtValues
- The time values corresponding to the frames of datazValue
- A string representing the elevation of the plotted datalegend
- An image representing the legendframeRate
- The frame rate to render an animation at- Throws:
IOException
- If there is a problem writing the data to theOutputStream
-
writeImage
public abstract void writeImage(List<BufferedImage> frames, OutputStream out, Integer frameRate) throws IOException
Writes the given list ofjava.awt.BufferedImage
s to the given OutputStream. If this ImageFormat doesn't support animations then the given list of frames should only contain one entry, otherwise an IllegalArgumentException will be thrown.- Parameters:
frames
- List of BufferedImages to render into an imageout
- The OutputStream to which the image will be writtenframeRate
- The frame rate to use if this is an animation.- Throws:
IOException
- if there was an error writing to the output streamIllegalArgumentException
- if this ImageFormat cannot render all of the given BufferedImages.
-
-