net.sourceforge.jiu.ops
Class LookupTableOperation
public abstract class LookupTableOperation
An operation that replaces samples with values taken from a lookup table.
Operations where each pixel is treated independently from its neighbors
and where a pixel value is always mapped to the same new pixel value
can be implemented this way.
LookupTableOperation() - Creates a LookupTableOperation for one lookup table.
|
LookupTableOperation(int numTables) - Creates an object of this class, calling the super constructor with two
null
arguments and allocates space for the argument number of lookup tables.
|
int | getNumTables() - Returns the number of tables in this operation.
|
int[] | getTable(int channelIndex) - Returns one of the internal
int lookup tables.
|
void | prepareImages()
|
void | process()
|
private void | process(IntegerImage in, IntegerImage out)
|
private void | process(IntegerImage in, IntegerImage out, int CHANNEL_INDEX, int tableIndex, int processedItems, int TOTAL_ITEMS)
|
void | setNumTables(int numberOfTables) - Resets the number of tables to be used in this operation to the
argument and drops all actual table data initialized so far.
|
void | setTable(int channelIndex, int[] tableData) - Provides a new lookup table for one of the channels.
|
void | setTables(int[] tableData) - Sets the tables for all channels to the argument table.
|
intTables
private int[][] intTables
numTables
private int numTables
LookupTableOperation
public LookupTableOperation()
Creates a LookupTableOperation for one lookup table.
LookupTableOperation
public LookupTableOperation(int numTables)
Creates an object of this class, calling the super constructor with two null
arguments and allocates space for the argument number of lookup tables.
numTables
- number of tables to be used in this operation
getNumTables
public int getNumTables()
Returns the number of tables in this operation.
getTable
public int[] getTable(int channelIndex)
Returns one of the internal int
lookup tables.
channelIndex
- the zero-based index of the table to be returned;
from 0 to getNumTables() - 1
- the channelIndex'th table
process
private void process(IntegerImage in,
IntegerImage out,
int CHANNEL_INDEX,
int tableIndex,
int processedItems,
int TOTAL_ITEMS)
setNumTables
public void setNumTables(int numberOfTables)
Resets the number of tables to be used in this operation to the
argument and drops all actual table data initialized so far.
After a call to this method,
getTable(int)
will return
null
as long as no new table data is provided
via
setTable(int,int[])
or
setTables(int[])
.
numberOfTables
- the new number of tables for this operation, must be 1
or larger
setTable
public void setTable(int channelIndex,
int[] tableData)
Provides a new lookup table for one of the channels.
channelIndex
- the index of the channel for which a table is provided; must be at least 0
and smaller than getNumTables()
tableData
- the actual table to be used for lookup
setTables
public void setTables(int[] tableData)
Sets the tables for all channels to the argument table.
Useful when the same table can be used for all channels.
tableData
- the data that will be used as lookup table for all channels