Package qupath.lib.gui.images.stores
Class ColorModelRenderer
java.lang.Object
qupath.lib.gui.images.stores.ColorModelRenderer
- All Implemented Interfaces:
ImageRenderer
An
ImageRenderer
that uses a ColorModel
.- Author:
- Pete Bankhead
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapplyTransforms
(BufferedImage imgInput, BufferedImage imgOutput) Apply the required transforms to a BufferedImage to get the appropriate display.Get theColorModel
for this renderer (may be null).long
Timestamp of the last change (probably in milliseconds).Get a unique key, which will be used for caching.void
setColorModel
(ColorModel model) Set the color model to use.
-
Constructor Details
-
ColorModelRenderer
Constructor.- Parameters:
colorModel
-
-
-
Method Details
-
applyTransforms
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 interfaceImageRenderer
- Parameters:
imgInput
- input imageimgOutput
- 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
Set the color model to use.- Parameters:
model
-
-
getColorModel
Get theColorModel
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 interfaceImageRenderer
- Returns:
-
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 interfaceImageRenderer
- Returns:
-