Interface ImageRenderer

All Known Implementing Classes:
AbstractImageRenderer, ColorModelRenderer, ImageDisplay

public interface ImageRenderer
Interface for objects capable of converting a BufferedImage for rendering using Graphics2D. This typically means applying any color transforms to produce an (A)RGB image.

A timestamp and ID are supplied to help with caching.

  • Method Details

    • applyTransforms

      BufferedImage applyTransforms(BufferedImage imgInput, BufferedImage imgOutput)
      Apply the required transforms to a BufferedImage to get the appropriate display. imgOutput should always be an RGB image (of some kind), or null if a new image should be created. imgInput should always be an image of the kind that matches the imgData, e.g. RGB/non-RGB, same number of channels, same bit-depth.
      Parameters:
      imgInput - input image
      imgOutput - output image, with the same width and height as the input; if null or the image size is inconsistent, a new RGB image should be created
      Returns:
      imgOutput, or a new RGB image created for the output
    • getLastChangeTimestamp

      long getLastChangeTimestamp()
      Timestamp of the last change. The format should not be assumed - only that the value increases. This means that it might be in nanoseconds, milliseconds or 'events' (i.e. an incrementing value each time there is a change).

      This is useful to identify when the status has changed, for example to determine whether a repaint is necessary.

      Returns:
      the value of the timestamp
    • getUniqueID

      String getUniqueID()
      Get a unique key, which will be used for caching.

      The only requirement is that the key is unique for the ImageRenderer in its current state. It is suggested to base it on the full class name, a counter for instances of this class, and a timestamp derived from the last change.

      Returns: