Class AbstractArrayColorTable<T>

  • All Implemented Interfaces:
    ArrayColorTable<T>, ColorTable
    Direct Known Subclasses:
    ColorTable16, ColorTable8

    public abstract class AbstractArrayColorTable<T>
    extends java.lang.Object
    implements ArrayColorTable<T>
    Abstract superclass for array-based color lookup tables.
    Author:
    Stephan Saalfeld, Curtis Rueden, Mark Hiner
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected T[] values
      Actual color table values.
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractArrayColorTable​(T... values)
      Initializes a color table with the given table values.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int argb​(int i)
      Converts the tuple at the given position into a packed ARGB value.
      abstract int get​(int comp, int bin)
      Gets an individual value from the color table.
      int getComponentCount()
      Gets the number of color components in the table (typically 3 for RGB or 4 for RGBA).
      abstract int getResampled​(int comp, int bins, int bin)
      Gets an individual value from a color table with given number of bins.
      T[] getValues()
      Gets a copy of the entire color table.
      int lookupARGB​(double min, double max, double value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • values

        protected final T[] values
        Actual color table values.
    • Constructor Detail

      • AbstractArrayColorTable

        public AbstractArrayColorTable​(T... values)
        Initializes a color table with the given table values.
    • Method Detail

      • argb

        public int argb​(int i)
        Description copied from interface: ArrayColorTable
        Converts the tuple at the given position into a packed ARGB value.
        Specified by:
        argb in interface ArrayColorTable<T>
      • lookupARGB

        public int lookupARGB​(double min,
                              double max,
                              double value)
        Specified by:
        lookupARGB in interface ColorTable
      • getComponentCount

        public int getComponentCount()
        Description copied from interface: ColorTable
        Gets the number of color components in the table (typically 3 for RGB or 4 for RGBA).
        Specified by:
        getComponentCount in interface ColorTable
      • get

        public abstract int get​(int comp,
                                int bin)
        Gets an individual value from the color table.

        Value is unsigned 8 bits.

        Specified by:
        get in interface ColorTable
        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 abstract int getResampled​(int comp,
                                         int bins,
                                         int bin)
        Gets an individual value from a color table with given number of bins.

        Value is unsigned 8 bits.

        Specified by:
        getResampled in interface ColorTable
        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.