Wavelet and Image class library  1.3.2
Public Member Functions | Protected Member Functions | Private Attributes

#include <PyramidTree.hh>

Inheritance diagram for PyramidTree:
Inheritance graph
[legend]
Collaboration diagram for PyramidTree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PyramidTree (PyramidTransform &t, int y, int x, int position=-1, PyramidTree *parent=NULL, int generations=1)
 ~PyramidTree (void)
void addGenerations (int depth)
void moveTo (int y, int x, int position=-1, PyramidTree *parent=NULL)
int depth (void)

Protected Member Functions

void findChildPosition (int y, int x, int &resY, int &resX)
void shiftBy (int shiftY, int shiftX)

Private Attributes

PyramidTransformm_transform

Detailed Description

A class for pyramid trees. Rather relaxed attitude towards position checking; crashes are avoided but errors not always flagged! Each node can have exactly 4 children. Child #0 is the upper left, the children are stored linewise from there.

Definition at line 26 of file PyramidTree.hh.


Constructor & Destructor Documentation

PyramidTree::PyramidTree ( PyramidTransform t,
int  y,
int  x,
int  position = -1,
PyramidTree parent = NULL,
int  generations = 1 
)

Constructor, creates a tree from a transformed image at a given position and over a depth of a given number of generations

Parameters:
tthe transform
ythe row in the image
xthe col in the image
positionthe position in the parent node if applicable
parenta pointer to the parent node or NULL if root
generationsthe number of generations (including this node)
Exceptions:
invalid_argumentif the transform levels are insufficient or the start position in the image's LL

Destructor, does nothing (destruction done by parent class)


Member Function Documentation

void PyramidTree::addGenerations ( int  depth)

Create/replace a number of generations to this node according to position and subband.

Exceptions:
invalid_argumentif the subband depth is insufficient
Parameters:
depththe depth to recurse into (not counting this node)
int PyramidTree::depth ( void  )

Return the current depth including this node

Returns:
the depth
void PyramidTree::findChildPosition ( int  y,
int  x,
int &  resY,
int &  resX 
) [protected]

Find the upper left of the position for a new child

Parameters:
ythe row in the image
xthe col in the image
resYthe returned row
resXthe returned col
Exceptions:
invalid_argumentif (y,x) is in subband 1 or in LL
void PyramidTree::moveTo ( int  y,
int  x,
int  position = -1,
PyramidTree parent = NULL 
)

"Move" the tree to a different position in the image by replacing the positions stored in the leaves.

Parameters:
ythe new row
xthe new column
positionthe new position in the parent node (or -1 if no change)
parentthe new parent node (or NULL if no change)
void PyramidTree::shiftBy ( int  shiftY,
int  shiftX 
) [protected]

Shift the stored positions in the node and all children by a given amount.

Parameters:
shiftYthe number of rows by which to shift
shiftXthe number of columns by which to shift

Member Data Documentation

The transform (contains a reference to the image)

Definition at line 76 of file PyramidTree.hh.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines