cz.cuni.jagrlib.iface
Interface FeatureStore

All Superinterfaces:
Property
All Known Implementing Classes:
Features

public interface FeatureStore
extends Property

Data storage for "features" - elements used in feature/based warping/morphing. Features can be 1D (points), 2D (arrows), 3D (trangles) and can be placed in 2D space (plane) od 3D (3D warping).

Since:
0.24
See Also:
FeatureStore.java

Field Summary
static int FEATURE_ARROW
          Feature type: arrow (2D feature).
static int FEATURE_POINT
          Feature type: point (1D feature).
static int FEATURE_TRIANGLE
          Feature type: triangle (3D feature).
static int NULL
          Void (null) feature handle.
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 int featureEnd(int id)
          Returns Time of death of the given feature.
 int featureStart(int id)
          Returns Birth-time of the given feature.
 int featureType(int id)
          Reads feature-type (FEATURE_POINT, FEATURE_ARROW or FEATURE_TRIANGLE).
 double[] getCoords(int id, double time, double[] coords)
          Reads feature coordinates of the given feature in the given time.
 java.lang.Object getParam(int id, double time, java.lang.String name)
          Reads the given general parametr in the given time.
 double getParamDouble(int id, double time, java.lang.String name)
          Reads the given floating-point parametr in the given time.
 int getParamInt(int id, double time, java.lang.String name)
          Reads the given integer parametr in the given time.
 int insertFeature(int timeFrom, int timeTo, int type)
          Inserts a new feature of the given type.
 int nextFeature(int id, double time)
          Finds the next feature in the database.
 void removeFeature(int id)
          Removes the given feature from the database.
 void setCoords(int id, int time, double[] coords)
          Sets feature coordinates of the given feature in the given keyframe-time.
 void setParam(int id, int time, java.lang.String name, java.lang.Object value)
          Sets feature's general parameter in the given keyframe-time.
 void setTimes(int id, int timeFrom, int timeTo)
          Sets feature life-time.
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Field Detail

FEATURE_POINT

static final int FEATURE_POINT
Feature type: point (1D feature).

See Also:
Constant Field Values

FEATURE_ARROW

static final int FEATURE_ARROW
Feature type: arrow (2D feature).

See Also:
Constant Field Values

FEATURE_TRIANGLE

static final int FEATURE_TRIANGLE
Feature type: triangle (3D feature).

See Also:
Constant Field Values

NULL

static final int NULL
Void (null) feature handle.

See Also:
Constant Field Values
Method Detail

insertFeature

int insertFeature(int timeFrom,
                  int timeTo,
                  int type)
Inserts a new feature of the given type. Every feature exists in defined time interval (timeFrom - timeTo).

Parameters:
type - Feature type (FEATURE_POINT, FEATURE_ARROW or FEATURE_TRIANGLE).
Returns:
Feature handle (id). If succeeded, return value should be >= 0.
See Also:
removeFeature(int), setTimes(int, int, int), setCoords(int, int, double[]), setParam(int, int, java.lang.String, java.lang.Object)

removeFeature

void removeFeature(int id)
Removes the given feature from the database.

Parameters:
id - Handle of an existing feature.

nextFeature

int nextFeature(int id,
                double time)
Finds the next feature in the database. Iteration should start with id = NULL. This function also returns NULL if there is no other feature..

Parameters:
id - Handle of previous feature (or NULL if we are restaring an iteration).
time - Time of interest.
Returns:
Handle of a next feature in database (or NULL if the previous was the last one).

featureType

int featureType(int id)
Reads feature-type (FEATURE_POINT, FEATURE_ARROW or FEATURE_TRIANGLE).


setTimes

void setTimes(int id,
              int timeFrom,
              int timeTo)
Sets feature life-time.

Parameters:
id - Handle of a feature.
timeFrom - Birth-time of the feature.
timeTo - Death-time of the feature.

featureStart

int featureStart(int id)
Returns Birth-time of the given feature.


featureEnd

int featureEnd(int id)
Returns Time of death of the given feature.


setCoords

void setCoords(int id,
               int time,
               double[] coords)
Sets feature coordinates of the given feature in the given keyframe-time.

Parameters:
id - Handle of a feature.
time - Keyframe-time.
coords - Coordinate array (e.g. double[4] for 2D arrow feature: [ x0, y0, x1, y1 ]).

getCoords

double[] getCoords(int id,
                   double time,
                   double[] coords)
Reads feature coordinates of the given feature in the given time.

Parameters:
id - Handle of a feature.
time - Time of interest. Needs not be keyframe-time.
coords - Pre-allocated coordinate array to be filled (double[4] for 2D arrow feature: [ x0, y0, x1, y1 ]). Can be null.
Returns:
Coordinate array or null.

setParam

void setParam(int id,
              int time,
              java.lang.String name,
              java.lang.Object value)
Sets feature's general parameter in the given keyframe-time.

Parameters:
id - Handle of a feature.
time - Keyframe-time (NULL for time-independent parameter).
name - Parameter identifier.
value - New parameter value.

getParamInt

int getParamInt(int id,
                double time,
                java.lang.String name)
Reads the given integer parametr in the given time.

Parameters:
id - Handle of a feature.
time - Time of interest. Needs not be keyframe-time.
name - Parameter identifier.
Returns:
Integer value (interpolated in time if applicable).

getParamDouble

double getParamDouble(int id,
                      double time,
                      java.lang.String name)
Reads the given floating-point parametr in the given time.

Parameters:
id - Handle of a feature.
time - Time of interest. Needs not be keyframe-time.
name - Parameter identifier.
Returns:
Floating-point value (interpolated in time if applicable).

getParam

java.lang.Object getParam(int id,
                          double time,
                          java.lang.String name)
Reads the given general parametr in the given time.

Parameters:
id - Handle of a feature.
time - Time of interest. Needs not be keyframe-time.
name - Parameter identifier.
Returns:
Parameter value (interpolated in time if applicable).