net.sourceforge.jiu.ops

Class LookupTableOperation

Known Direct Subclasses:
Brightness, Contrast, EqualizeHistogram, GammaCorrection, NormalizeHistogram

public abstract class LookupTableOperation
extends ImageToImageOperation

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.
Author:
Marco Schmidt
Since:
0.6.0

Field Summary

private int[][]
intTables
private int
numTables

Fields inherited from class net.sourceforge.jiu.ops.ImageToImageOperation

canInAndOutBeEqual, inputImage, outputImage

Fields inherited from class net.sourceforge.jiu.ops.Operation

abort, progressListeners

Constructor Summary

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.

Method Summary

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.

Methods inherited from class net.sourceforge.jiu.ops.ImageToImageOperation

canInputAndOutputBeEqual, ensureImagesHaveSameResolution, ensureInputImageIsAvailable, ensureOutputImageResolution, getInputImage, getOutputImage, setCanInputAndOutputBeEqual, setInputImage, setOutputImage

Methods inherited from class net.sourceforge.jiu.ops.Operation

addProgressListener, addProgressListeners, getAbort, process, removeProgressListener, setAbort, setProgress, setProgress

Field Details

intTables

private int[][] intTables

numTables

private int numTables

Constructor Details

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.
Parameters:
numTables - number of tables to be used in this operation

Method Details

getNumTables

public int getNumTables()
Returns the number of tables in this operation.
Returns:
number of tables

getTable

public int[] getTable(int channelIndex)
Returns one of the internal int lookup tables.
Parameters:
channelIndex - the zero-based index of the table to be returned; from 0 to getNumTables() - 1
Returns:
the channelIndex'th table

prepareImages

public void prepareImages()
            throws MissingParameterException,
                   WrongParameterException

process

public void process()
            throws MissingParameterException,
                   WrongParameterException
Overrides:
process in interface Operation

process

private void process(IntegerImage in,
                     IntegerImage out)

process

private void process(IntegerImage in,
                     IntegerImage out,
                     int CHANNEL_INDEX,
                     int tableIndex,
                     int processedItems,
                     int TOTAL_ITEMS)

setNumTables

public void setNumTables(int numberOfTables)
Parameters:
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.

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.
Parameters:
tableData - the data that will be used as lookup table for all channels