Class 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 Detail

      • SimpleFormat

        public SimpleFormat()
    • Method Detail

      • requiresLegend

        public final boolean requiresLegend()
        Returns false: simple formats do not require a legend.
        Specified by:
        requiresLegend in class ImageFormat
        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 class ImageFormat
        Parameters:
        frames - A List of BufferedImages to plot
        out - The OutputStream to write the resulting image to
        name - 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 plotted
        tValues - The time values corresponding to the frames of data
        zValue - A string representing the elevation of the plotted data
        legend - An image representing the legend
        frameRate - The frame rate to render an animation at
        Throws:
        IOException - If there is a problem writing the data to the OutputStream
      • writeImage

        public abstract void writeImage​(List<BufferedImage> frames,
                                        OutputStream out,
                                        Integer frameRate)
                                 throws IOException
        Writes the given list of java.awt.BufferedImages 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 image
        out - The OutputStream to which the image will be written
        frameRate - The frame rate to use if this is an animation.
        Throws:
        IOException - if there was an error writing to the output stream
        IllegalArgumentException - if this ImageFormat cannot render all of the given BufferedImages.