cz.cuni.jagrlib
Class DefaultValueTransferFunction

java.lang.Object
  extended by cz.cuni.jagrlib.DefaultProperty
      extended by cz.cuni.jagrlib.Piece
          extended by cz.cuni.jagrlib.DefaultValueTransferFunction
All Implemented Interfaces:
Breakable, PersistentParamsBinary, Property, ValueTransferFunction, Template

public abstract class DefaultValueTransferFunction
extends Piece
implements ValueTransferFunction, PersistentParamsBinary

Default implementation of ValueTransferFunction interface.

Since:
0.25
See Also:
DefaultValueTransferFunction.java

Field Summary
 
Fields inherited from class cz.cuni.jagrlib.Piece
channels, info, pl, plugs, reg, TEMPLATE_TYPE, userBreak
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Fields inherited from interface cz.cuni.jagrlib.Template
ALL_PLUGS, C_1D, C_2D, C_3D, C_ALPHA, C_BINARY, C_BREP, C_CAMERA, C_CIRCLE, C_CLIP, C_COMPRESSION, C_CURVE, C_DATA, C_DRAW, C_EDITOR, C_ELLIPSE, C_FILL, C_FILTER, C_FLOAT, C_FUNCTION, C_IMAGE, C_INTEGER, C_IO, C_LIGHT, C_LINE, C_METRIC, C_POLYGON, C_PROJECTION, C_RADIOSITY, C_RASTER, C_RENDER, C_SAMPLE, C_SCENE, C_SET, C_SOLID, C_TEXT, C_TRANSFORM, C_VECTOR, C_VIEWER, C_WORKER, CAT_EMPTY, EMPTY, IFACE, JAGRLIB, JAGRLIB2, MANIPULATOR_COMBO, MANIPULATOR_CUSTOM, MANIPULATOR_DEFAULT, MANIPULATOR_MULTILINE, PL_ALPHAMASK, PL_BITMASK, PL_CAUSTIC, PL_CODEC, PL_COLORMAP, PL_COMPARE, PL_DATA, PL_DIRECT, PL_EDITOR, PL_FILTER, PL_FUNCTION, PL_IMAGE, PL_IMPORT, PL_INPUT, PL_INTERSECTION, PL_LIGHTSOURCE, PL_ORDER, PL_OUTPUT, PL_PALETTE, PL_PHOTON, PL_PROPERTY, PL_QUANTIZER, PL_RASTER, PL_RENDER, PL_SHADOW, PL_STREAM, PL_TRANSFORM, PL_TRIGGER, PL_VOLUME, PL_WINDOW, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_OBJECT, TYPE_STRING
 
Constructor Summary
DefaultValueTransferFunction()
           
 
Method Summary
 boolean loadData(byte[] data)
          Loads instance parameters from (previously stored) binary data.
 byte[] storeData()
          Pack instance parameters into binary format.
 double transfer(double value)
          Scalar value-transfer function.
 int transfer(double[] input)
          Gr[A] or RGB[A] -> index (classification) function.
 void transfer(double[] input, double[] output)
          Gr[A] or RGB[A] value-transfer function.
 int transfer(int[] input, int max)
          Gr[A] or RGB[A] -> index (classification) function.
 void transfer(int[] input, int[] output, int max)
          Gr[A] or RGB[A] value-transfer function.
 int transfer(int value, int max)
          Scalar value-transfer function.
 double transferInv(double value)
          Scalar inverse value-transfer function.
 void transferInv(double[] input, double[] output)
          Gr[A] or RGB[A] inverse value-transfer function.
 void transferInv(int[] input, int[] output, int max)
          Gr[A] or RGB[A] inverse value-transfer function.
 void transferInv(int input, double[] output)
          Index -> Gr[A] or RGB[A] (reconstruction) function.
 int transferInv(int value, int max)
          Scalar inverse value-transfer function.
 void transferInv(int input, int[] output, int max)
          Index -> Gr[A] or RGB[A] (reconstruction) function.
 
Methods inherited from class cz.cuni.jagrlib.Piece
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplate, setTemplateDynamic, stop
 
Methods inherited from class cz.cuni.jagrlib.DefaultProperty
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, get, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, set, stringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Constructor Detail

DefaultValueTransferFunction

public DefaultValueTransferFunction()
Method Detail

transfer

public int transfer(int value,
                    int max)
Scalar value-transfer function.

Specified by:
transfer in interface ValueTransferFunction
Parameters:
value - Input value (range from 0 to max).
max - Maximal input/output value.
Returns:
Output value (range from 0 to max).

transferInv

public int transferInv(int value,
                       int max)
Scalar inverse value-transfer function.

Specified by:
transferInv in interface ValueTransferFunction
Parameters:
value - Input value (range from 0 to max).
max - Maximal input/output value.
Returns:
Output value (range from 0 to max).

transfer

public double transfer(double value)
Scalar value-transfer function.

Specified by:
transfer in interface ValueTransferFunction
Parameters:
value - Input value (range from 0.0 to 1.0).
Returns:
Output value (range from 0.0 to 1.0).

transferInv

public double transferInv(double value)
Scalar inverse value-transfer function.

Specified by:
transferInv in interface ValueTransferFunction
Parameters:
value - Input value (range from 0.0 to 1.0).
Returns:
Output value (range from 0.0 to 1.0).

transfer

public void transfer(int[] input,
                     int[] output,
                     int max)
Gr[A] or RGB[A] value-transfer function. Can be used for higher dimensions too.

Specified by:
transfer in interface ValueTransferFunction
Parameters:
input - Input value (scalar range from 0 to max).
output - Output value (scalar range from 0 to max). Can be the same as input (in-place operation).
max - Maximal input/output value.

transferInv

public void transferInv(int[] input,
                        int[] output,
                        int max)
Gr[A] or RGB[A] inverse value-transfer function. Can be used for higher dimensions too.

Specified by:
transferInv in interface ValueTransferFunction
Parameters:
input - Input value (scalar range from 0 to max).
output - Output value (scalar range from 0 to max). Can be the same as input (in-place operation).
max - Maximal input/output value.

transfer

public void transfer(double[] input,
                     double[] output)
Gr[A] or RGB[A] value-transfer function. Can be used for higher dimensions too.

Specified by:
transfer in interface ValueTransferFunction
Parameters:
input - Input value (scalar range from 0.0 to 1.0).
output - Output value (scalar range from 0.0 to 1.0). Can be the same as input (in-place operation).

transferInv

public void transferInv(double[] input,
                        double[] output)
Gr[A] or RGB[A] inverse value-transfer function. Can be used for higher dimensions too.

Specified by:
transferInv in interface ValueTransferFunction
Parameters:
input - Input value (scalar range from 0.0 to 1.0).
output - Output value (scalar range from 0.0 to 1.0). Can be the same as input (in-place operation).

transfer

public int transfer(int[] input,
                    int max)
Gr[A] or RGB[A] -> index (classification) function. Prototype implementation: RGB to gray conversion.

Specified by:
transfer in interface ValueTransferFunction
Parameters:
input - Input value (scalar range from 0 to max).
max - Maximal input value.
Returns:
Output index value (color index).

transferInv

public void transferInv(int input,
                        int[] output,
                        int max)
Index -> Gr[A] or RGB[A] (reconstruction) function. Prototype implementation: gray to RGB conversion.

Specified by:
transferInv in interface ValueTransferFunction
Parameters:
input - Index value (color index).
output - Output value (scalar range from 0 to max).
max - Maximal output value.

transfer

public int transfer(double[] input)
Gr[A] or RGB[A] -> index (classification) function. Prototype implementation: RGB to gray conversion.

Specified by:
transfer in interface ValueTransferFunction
Parameters:
input - Input value (scalar range from 0.0 to 1.0).
Returns:
Output index value (color index).

transferInv

public void transferInv(int input,
                        double[] output)
Index -> Gr[A] or RGB[A] (reconstruction) function. Prototype implementation: gray to RGB conversion.

Specified by:
transferInv in interface ValueTransferFunction
Parameters:
input - Index value (color index).
output - Output value (scalar range from 0.0 to 1.0).

storeData

public byte[] storeData()
Pack instance parameters into binary format.

Specified by:
storeData in interface PersistentParamsBinary
Returns:
Data array to be stored into binary stream. Can be null. The array can be shared by all method calls.
See Also:
loadData(byte[])

loadData

public boolean loadData(byte[] data)
Loads instance parameters from (previously stored) binary data.

Specified by:
loadData in interface PersistentParamsBinary
Parameters:
data - Binary data to be interpreted. Can be null.
Returns:
true if successful.
See Also:
storeData()