Class TLcdComponentColorLookupTable.Builder<B extends TLcdComponentColorLookupTable.Builder<B>>

java.lang.Object
com.luciad.imaging.operator.util.TLcdComponentColorLookupTable.Builder<B>
Enclosing class:
TLcdComponentColorLookupTable

public static class TLcdComponentColorLookupTable.Builder<B extends TLcdComponentColorLookupTable.Builder<B>> extends Object
Builder for component-based color lookup table's. The default table's are 2 pixels wide with 8-bit color components and use linear interpolation. The actual filter must be specified as either a ColorFilter or pixel buffers.

For example to create a negative filter:


   TLcdComponentColorLookupTable table = TLcdComponentColorLookupTable.newBuilder().
     filter(
       new ILcdColorFilter() {
         public void apply( float[] aRGBColorSFCT ) {
           aRGBColorSFCT[ 0 ] = 1.f - aRGBColorSFCT[ 0 ];
           aRGBColorSFCT[ 1 ] = 1.f - aRGBColorSFCT[ 1 ];
           aRGBColorSFCT[ 2 ] = 1.f - aRGBColorSFCT[ 2 ];
         }
       }
     ).
     build();
 
  • Method Details

    • size

      public B size(int aSize)
      Sets the size of all table's.
      Parameters:
      aSize - the size of the table's
      Returns:
      this builder
    • size

      public B size(int aRedSize, int aGreenSize, int aBlueSize)
      Sets the size of each component's table.
      Parameters:
      aRedSize - the size for the red color component
      aGreenSize - the size for the green color component
      aBlueSize - the size for the blue color component
      Returns:
      this builder
    • componentType

      public B componentType(TLcdLookupTable.ComponentType aComponentType)
      Sets the type of the table's color components.

      Typically a byte provides sufficient accuracy for rendering.

      Parameters:
      aComponentType - the component type
      Returns:
      this builder
    • interpolation

      public B interpolation(ELcdInterpolationType aInterpolationType)
      Sets the interpolation type between table pixels. Note that only NONE and LINEAR are currently supported.
      Parameters:
      aInterpolationType - the interpolation type
      Returns:
      this builder
    • filter

      public B filter(ILcdColorFilter aColorFilter)
      Sets the table's entries from a color filter.
      Parameters:
      aColorFilter - the color filter
      Returns:
      this builder
    • filter

      public B filter(Buffer aPixelData)
      Sets the each component table's entries directly from a buffer.

      The buffers should contain the appropriate number of bytes according to the table table size and component type. Each table entry has 1 component. See TLcdComponentColorLookupTable and TLcdLookupTable for details.

      Parameters:
      aPixelData - the pixel buffer
      Returns:
      this builder
    • filter

      public B filter(Buffer aRedPixelData, Buffer aGreenPixelData, Buffer aBluePixelData)
      Sets the component table's entries directly from a buffer.

      The buffers should contain the appropriate number of bytes according to the table table size and component type. Each table entry has 1 component. See TLcdComponentColorLookupTable and TLcdLookupTable for details.

      Parameters:
      aRedPixelData - the pixel buffer
      aGreenPixelData - the pixel buffer
      aBluePixelData - the pixel buffer
      Returns:
      this builder
    • build

      Builds the color lookup table.
      Returns:
      the color lookup table