Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

WarpAlgorithm1 Class Reference

A warp algorithm derived from WarpAlgorithm. More...

#include <WarpAlgorithm.h>

Inheritance diagram for WarpAlgorithm1::

WarpAlgorithm List of all members.

Public Methods

parameter setter and getter
constant edges

Private Methods

Private Attributes


Detailed Description

This is a warping algorithm we've implemented. It compiles the final position of a warped point from the affine transformations of _all_ edges, wedged depeding on the inverse of the distance to the point. For math details see the specification

The parameters in this algorithm only influence the wedge function. If changed, the weighted mean between the transformations of the edges is calculated differently.

The sort of precalculation performed by this algorithm is wedge caching If the original contour stays fixed for a longer time than the transformed one the wedge per point and per edge can already be calculated.

Note:
In differential mode which is supported in ContourWarpEffect the original contour passed to this algorithm changes between subsequent transform-calls, so ContourWarpEffect turns wedge caching off in this mode.


Constructor & Destructor Documentation

WarpAlgorithm1::WarpAlgorithm1 ( )
 

Initializes parameters and flags, sets pointer to NULL.

WarpAlgorithm1::WarpAlgorithm1 ( CVertexGrid * vertexGrid )
 

Initializes parameters and flags, sets pointer to NULL. Calls the setVertexGrid method.

WarpAlgorithm1::~WarpAlgorithm1 ( )
 

Deallocates all used memory


Member Function Documentation

void WarpAlgorithm1::trafoWithEdgePair ( VECTOR3D * point,
const Edge & origEdge,
const Edge & trafoEdge,
VECTOR3D vPlaneNormal ) [private]
 

This method method "warps" a point with the affine transformation between an original edge and a warped one.

For further details, see specification 2.3

Parameters:
point   pointer to the point being warped
origEdge   the original edge
trafoEdge   the warped edge
vPlaneNormal   the normal of the plane the image (and the two edges) lies in.

float WarpAlgorithm1::wedge ( VECTOR3D vPoint,
Edge edge ) [private]
 

This helper method determines how important is the transformation of the given edge for the point at this position. The final transformation of the pointed is calculated with a weighted mean of the warped edges (contoures). The wedge result is also influenced by the parameters of the algorithm.

For further details, see specification 2.4

Parameters:
vPoint   the point being warped
edge   a warped edge

void WarpAlgorithm1::transform ( int index,
PolygonShape * origShape,
PolygonShape * trafoShape,
VECTOR3D vPlaneNormal ) [private]
 

This method transform the point at index index in the vertex grid

void WarpAlgorithm1::doPrecalculation ( PolygonShape * origShape ) [virtual]
 

The sort of Precalculation done in WarpAlgorithm1 is wedge caching The wedge depends only from the vertex positions relative to the original shape.

Parameters:
origShape   The original contour (shape)

Reimplemented from WarpAlgorithm.

void WarpAlgorithm1::undoPrecalculation ( ) [virtual]
 

Frees up the memory used by wedge caching.

Reimplemented from WarpAlgorithm.

void WarpAlgorithm1::transformGrid ( PolygonShape * origShape,
PolygonShape * trafoShape,
VECTOR3D vPlaneNormal ) [virtual]
 

The main vertex grid warping method.

Parameters:
origShape   The original contour
trafoShape   The warped contour
vPlaneNormal   The normal vector of the plane in which the image lies.

Reimplemented from WarpAlgorithm.

void WarpAlgorithm1::getParamInfo ( int ParamID,
paramInfo & descr ) [virtual]
 

Parameters:
ParamID   parameter ID
descr   reference to a paramInfo structure to be filled.

See also:
setParam(int, void*)

Reimplemented from WarpAlgorithm.

void WarpAlgorithm1::setParam ( int ParamID,
void * pValue ) [virtual]
 

The meaning of the parameters are:

  • Param[0]: paramter a in the specification.
  • Param[1]: paramter b in the specification.
  • Param[2]: paramter p in the specification. For further details, see specification 2.4
Parameters:
ParamID   parameter ID
pValue   pointer to the parameter (which type is unknown)

Returns:
a pointer to a parameter (which type is always float here)

Reimplemented from WarpAlgorithm.

void * WarpAlgorithm1::getParam ( int ParamID ) [virtual]
 

Parameters:
ParamID   parameter ID

See also:
setParam(int, void*)

Reimplemented from WarpAlgorithm.

int WarpAlgorithm1::getParamCount ( ) [inline, virtual]
 

See also:
setParam(int, void*)

Reimplemented from WarpAlgorithm.

bool WarpAlgorithm1::doesPrecalculation ( ) [inline, virtual]
 

Returns:
whether the algorithm does optimizations with wedge caching

Reimplemented from WarpAlgorithm.

void WarpAlgorithm1::setConstantEdges ( Edge * pEdges,
int numEdges ) [virtual]
 

Parameters:
pEdges   pointer to an array of edges
numEdges   number of edges in the array

Reimplemented from WarpAlgorithm.

int WarpAlgorithm1::getConstantEdgeCount ( ) [inline, virtual]
 

Returns:
The number of constant edges

Reimplemented from WarpAlgorithm.

void WarpAlgorithm1::getConstantEdges ( Edge * pEdges,
int maxEdges ) [virtual]
 

Parameters:
pEdges   pointer to an array to be filled with the edges
maxEdges   maximal number of edges that have place in the array

Reimplemented from WarpAlgorithm.

void WarpAlgorithm1::useConstantEdges ( bool value ) [virtual]
 

Parameters:
value   true, if constant edges are used in the warp algorithm.
Note:
This method is reimplemented here in order to disable wedge caching.

Reimplemented from WarpAlgorithm.

void WarpAlgorithm1::setVertexGrid ( CVertexGrid * vertexGrid ) [virtual]
 

Parameters:
vertexGrid   a valid pointer to a CVertexGrid instance
Note:
This method is reimplemented here in order to disable wedge caching.

Reimplemented from WarpAlgorithm.


Member Data Documentation

float WarpAlgorithm1::Params [private]
 

Note:
All parameters supported by this algorithm are of type float.
See also:
setParam(int,void*)


The documentation for this class was generated from the following file:
Generated at Fri Apr 19 16:53:07 2002 for GLFramework by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001