Class PbNonLinearDataMapping2

All Implemented Interfaces:
Cloneable

public class PbNonLinearDataMapping2 extends PbDataMapping implements Cloneable
Class to define non linear data mapping. This object defines a non linear association between colors, transparencies and floating-point values. In other words, this association is defined by 2 functions F(c,v) and F(c,t):
      F(c,v)(V) = C (with c being a color and v being a value).
      F(t,v)(V) = T (with t being a transparency and v being a value).
There are two ways to express F(c,v)(V):

  • F(c,v)(V) is non linear, but linear per level, so a list of values sorted in increasing order and a list of colors associated define this function. Thus, the association is (V1,C1), (V2,C2),...,(Vn,Cn) with V1 < V2 <...< Vn. For a given value vi, Vk <= vi <= Vk+1, the associated color ci is determined by a linear interpolation between (Vk,Ck) and (Vk+1,Ck+1).
  • F(c,v)(V) is defined by level, so a list of n values sorted in increasing order and a list of n+1 colors associated define this function. Thus, the association is C1, (V1,C2), (V2,C3),...,(Vn,Cn+1) with V1 < V2 <...< Vn. For a given value vi, Vk <= vi < Vk+1, the associated color ci is Ck+1. If vi < V1, the associated color ci is C1. In the two methods, the list of values is sorted in increasing order (and the associated colors also). By default, F(c,v)(V) is linear by level (LINEAR_PER_LEVEL), the number of colors and values is 2 with V1=0, V2=0, C1=(0,0,0) (black) and C2=(1,1,1) (white).

There are as well, two ways to express F(t,v)(V)

  • Constructor Details

    • PbNonLinearDataMapping2

      public PbNonLinearDataMapping2()
      Default constructor.
    • PbNonLinearDataMapping2

      public PbNonLinearDataMapping2(PbNonLinearDataMapping2 nonLinearDataMap2)
      Copy constructor.
  • Method Details

    • clone

      public Object clone()
    • setValues

      public void setValues(PbNonLinearDataMapping2.Types type, float[] v, SbColor[] c, float[] t)
      Sets non linear function for data mapping, with RGB color and transparencies. If type = NON_LINEAR_PER_LEVEL, the number of colors and transparencies must be equal to numValues + 1, otherwise it must be equal to numValues.
    • getValuesList

      public float[] getValuesList()
      Gets the list of values defining the current non linear data mapping.
    • getDirectTransparencyList

      public FloatBuffer getDirectTransparencyList()
      Gets the list of transparencies defining the current non linear data mapping.
    • getDirectValuesList

      public FloatBuffer getDirectValuesList()
      Gets the list of values defining the current non linear data mapping.
    • getTransparencyList

      public float[] getTransparencyList()
      Gets the list of transparencies defining the current non linear data mapping.
    • setValues

      public void setValues(PbNonLinearDataMapping2.Types type, float[] v, SbColor[] c)
      Sets non linear function for data mapping, with RGB color. If type = NON_LINEAR_PER_LEVEL, the number of colors must be equal to numValues + 1, otherwise it must be equal to numValues.
    • getRGBColorsList

      public SbColor[] getRGBColorsList()
      Gets the list of RGB colors defining the current non linear data mapping.
    • getType

      Returns the data mapping type.
    • getDirectRGBColorsList

      public FloatBuffer getDirectRGBColorsList()
      Gets the list of RGB colors defining the current non linear data mapping.