- java.lang.Object
-
- ij.LookUpTable
-
public class LookUpTable extends Object
This class represents a color look-up table.
-
-
Constructor Summary
Constructors Constructor Description LookUpTable(Image img)Constructs a LookUpTable object from an AWT Image.LookUpTable(ColorModel cm)Constructs a LookUpTable object from a ColorModel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ColorModelcreateGrayscaleColorModel(boolean invert)voiddrawColorBar(Graphics g, int x, int y, int width, int height)Draws a color bar with the LUT, with a black rectangle around.voiddrawUnscaledColorBar(ImageProcessor ip, int x, int y, int width, int height)byte[]getBlues()ColorModelgetColorModel()byte[]getGreens()intgetMapSize()byte[]getReds()booleanisGrayscale()Returnstrueif this is a 256 entry grayscale LUT.
-
-
-
Constructor Detail
-
LookUpTable
public LookUpTable(Image img)
Constructs a LookUpTable object from an AWT Image.
-
LookUpTable
public LookUpTable(ColorModel cm)
Constructs a LookUpTable object from a ColorModel.
-
-
Method Detail
-
getMapSize
public int getMapSize()
-
getReds
public byte[] getReds()
-
getGreens
public byte[] getGreens()
-
getBlues
public byte[] getBlues()
-
getColorModel
public ColorModel getColorModel()
-
isGrayscale
public boolean isGrayscale()
Returnstrueif this is a 256 entry grayscale LUT.- See Also:
ImageProcessor.isColorLut()
-
drawColorBar
public void drawColorBar(Graphics g, int x, int y, int width, int height)
Draws a color bar with the LUT, with a black rectangle around. 'x' is the coordinate of the field for the lowest LUT color. Note that 'width' is the width of the area for the LUT colors; thus no colors will be omitted with a 256-entry LUT if width=256. The left line of the rectangle is at x, the right one at x+width+1.
-
drawUnscaledColorBar
public void drawUnscaledColorBar(ImageProcessor ip, int x, int y, int width, int height)
-
createGrayscaleColorModel
public static ColorModel createGrayscaleColorModel(boolean invert)
-
-