DESY ACOP Beans Home

de.desy.video.sw
Class CColorLookupTable

java.lang.Object
  extended by de.desy.video.sw.CColorLookupTable

public final class CColorLookupTable
extends java.lang.Object

CColorLookupTable creates, prepares and maintains a false colour table necessary to decode pure grayscale image data to true colour display. Three false colour tables (mappings) are supported at the moment:

An important criteria to mention is that these mappings support scaling to physical and effective bits per pixel settings. For example if source grayscale data is 16bpp physically encoded (for performance reason) but only 12 of these bits are effectively used, the false colour table is designed to support 0 as darkest and 4195 (12 bit max) as brightest value. All other value (for 16 bit: 4096 to 65535) are encoded in magenta to easily detect them as being illegal. In comparison to that, the output format is always java TYPE_INT_ARGB for sake of simplicity.
The main use is to generate a 1-dimensional false-colour-mapping table that accepts as index any physically valid grayscale number and returns the matched pixel ready for being placed to the output drawing buffer.

Version:
$Id: Templates.xml,v 1.10 2008/06/20 16:31:13 sweisse Exp $
Author:
Stefan Weisse

Field Summary
static int FALSEJET
          MATLAB JET false colour mode id
static int FALSEPITZ
          PITZ false colour mode id
static int GRAYSCALE
          grayscale mode id
 
Constructor Summary
CColorLookupTable()
          initializes default false colour table (1 byte per pixel, 8 effective bits, PITZ false colour)
 
Method Summary
 boolean AdjustTable(int aMode, int aByPP, int aEBitPP)
          performs recalculation of the mapped false colour table in case the parameters have been changed.
 int[] getColorLookupTable()
          user code can obtain a reference to the internal memory buffer that contains the current false colour mapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAYSCALE

public static final int GRAYSCALE
grayscale mode id

See Also:
Constant Field Values

FALSEPITZ

public static final int FALSEPITZ
PITZ false colour mode id

See Also:
Constant Field Values

FALSEJET

public static final int FALSEJET
MATLAB JET false colour mode id

See Also:
Constant Field Values
Constructor Detail

CColorLookupTable

public CColorLookupTable()
initializes default false colour table (1 byte per pixel, 8 effective bits, PITZ false colour)

Method Detail

getColorLookupTable

public int[] getColorLookupTable()
user code can obtain a reference to the internal memory buffer that contains the current false colour mapping

Returns:
reference to internal memory buffer

AdjustTable

public boolean AdjustTable(int aMode,
                           int aByPP,
                           int aEBitPP)
performs recalculation of the mapped false colour table in case the parameters have been changed. If no parameters change in between, nothing is done for sake of caching.

Parameters:
aMode - false colour mode CColorLookupTable.GRAYSCALE, CColorLookupTable.FALSEPITZ or CColorLookupTable.FALSEJET
aByPP - bytes per pixel setting for new table to calculate (allowed values are 1, 2, 3)
aEBitPP - effective bits per pixel setting (effective bits must fit inside bytes per pixel)
Returns:
true mapping table recalculated
false mapping table not recalculated (parameters have not changed)


Copyright © 2009. All Rights Reserved.