Package net.imglib2.display
Class ColorTable8
- java.lang.Object
-
- net.imglib2.display.AbstractArrayColorTable<byte[]>
-
- net.imglib2.display.ColorTable8
-
- All Implemented Interfaces:
ArrayColorTable<byte[]>,ColorTable
public class ColorTable8 extends AbstractArrayColorTable<byte[]>
8-bit color lookup table.
-
-
Field Summary
-
Fields inherited from class net.imglib2.display.AbstractArrayColorTable
values
-
Fields inherited from interface net.imglib2.display.ColorTable
ALPHA, BLUE, GREEN, RED
-
-
Constructor Summary
Constructors Constructor Description ColorTable8()Initializes an 8-bit color table with a linear grayscale ramp.ColorTable8(byte[]... values)Initializes an 8-bit color table with the given table values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intget(int comp, int bin)Gets an individual value from the color table.intgetBits()Gets the number of bits in each color component value.intgetLength()Gets the number of elements for each color component in the table.intgetNative(int comp, int bin)Gets an individual value from the color table.intgetResampled(int comp, int bins, int bin)Gets an individual value from a color table with given number of bins.private static byte[][]gray()Creates a linear grayscale ramp with 3 components and 256 values.-
Methods inherited from class net.imglib2.display.AbstractArrayColorTable
argb, getComponentCount, getValues, lookupARGB
-
-
-
-
Method Detail
-
getLength
public int getLength()
Description copied from interface:ColorTableGets the number of elements for each color component in the table.
-
getBits
public int getBits()
Description copied from interface:ArrayColorTableGets the number of bits in each color component value.
-
get
public int get(int comp, int bin)Description copied from interface:ColorTableGets an individual value from the color table.- Parameters:
comp- The color component to query.bin- The index into the color table.- Returns:
- The value of the table at the specified position.
-
getNative
public int getNative(int comp, int bin)Description copied from interface:ArrayColorTableGets an individual value from the color table.Value is unsigned with
ArrayColorTable.getBits()bits.- Parameters:
comp- The color component to query.bin- The index into the color table.- Returns:
- The value of the table at the specified position.
-
getResampled
public int getResampled(int comp, int bins, int bin)Description copied from interface:ColorTableGets an individual value from a color table with given number of bins.- Parameters:
comp- The color component to query.bins- The total number of bins.bin- The index into the color table.- Returns:
- The value of the table at the specified position.
-
gray
private static byte[][] gray()
Creates a linear grayscale ramp with 3 components and 256 values.
-
-