Class ColorTable

  • Direct Known Subclasses:
    GrassColorTable

    public abstract class ColorTable
    extends Object

    A JGrass colortable.

    The color table consists of a list of catagory intervals sorted by starting catagory (cat0:RR:GG:BB - cat1:RR:GG:BB).

    Since:
    1.1.0
    Author:
    Andrea Antonello - www.hydrologis.com
    • Field Detail

      • blank

        public static final byte[] blank
      • backgroundColor

        protected Color backgroundColor
      • colorTableEmpty

        protected boolean colorTableEmpty
    • Constructor Detail

      • ColorTable

        public ColorTable()
        Creates a new instance of ColorTable
    • Method Detail

      • size

        public int size()
      • setBackgroundColor

        public void setBackgroundColor​(Color clr)
      • isEmpty

        public boolean isEmpty()
      • addColorRule

        protected void addColorRule​(int cat,
                                    int r,
                                    int g,
                                    int b)
      • addColorRule

        protected void addColorRule​(float cat0,
                                    int r0,
                                    int g0,
                                    int b0,
                                    float cat1,
                                    int r1,
                                    int g1,
                                    int b1)
      • interpolateColorMap

        public ByteBuffer interpolateColorMap​(int mapType,
                                              ByteBuffer data,
                                              int dataOffset)
        Create the buffer with the rbg colormap.
        Parameters:
        mapType - - type of map, from which to understand the single value offset
        data - - the buffer with the data
        dataOffset - - offset to define rows
        Returns:
        the colormap byte buffer
      • interpolateColorValue

        public void interpolateColorValue​(ByteBuffer cmapBuffer,
                                          int cell)
        Create the buffer with the rbg colormap.
      • interpolateColorValue

        public void interpolateColorValue​(ByteBuffer cmapBuffer,
                                          float cell)
        Create the buffer with the rbg colormap.
      • interpolateColorValue

        public void interpolateColorValue​(ByteBuffer cmapBuffer,
                                          double cell)
        Create the buffer with the rbg colormap.
      • insertRule

        public void insertRule​(float cat,
                               ColorRule newrule)
      • getColor

        public byte[] getColor​(float x)
      • createDefaultColorTable

        public void createDefaultColorTable​(double[] dataRange)
      • getAlpha

        public int getAlpha()