Class ColorModelRenderer

java.lang.Object
qupath.lib.gui.images.stores.ColorModelRenderer
All Implemented Interfaces:
ImageRenderer

public class ColorModelRenderer extends Object implements ImageRenderer
An ImageRenderer that uses a ColorModel.
Author:
Pete Bankhead
  • Constructor Details

    • ColorModelRenderer

      public ColorModelRenderer(ColorModel colorModel)
      Constructor.
      Parameters:
      colorModel -
  • Method Details

    • applyTransforms

      public BufferedImage applyTransforms(BufferedImage imgInput, BufferedImage imgOutput)
      Description copied from interface: ImageRenderer
      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.
      Specified by:
      applyTransforms in interface ImageRenderer
      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
    • setColorModel

      public void setColorModel(ColorModel model)
      Set the color model to use.
      Parameters:
      model -
    • getColorModel

      public ColorModel getColorModel()
      Get the ColorModel for this renderer (may be null).
      Returns:
    • getLastChangeTimestamp

      public long getLastChangeTimestamp()
      Description copied from interface: ImageRenderer
      Timestamp of the last change (probably in milliseconds).

      This can be used to identify when the status has changed.

      Specified by:
      getLastChangeTimestamp in interface ImageRenderer
      Returns:
    • getUniqueID

      public String getUniqueID()
      Description copied from interface: ImageRenderer
      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.

      Specified by:
      getUniqueID in interface ImageRenderer
      Returns: