mp_traversals
Terrible Traversals
ImageTraversal Class Referenceabstract

A base class for traversal algorithms on images. More...

#include <ImageTraversal.h>

Inheritance diagram for ImageTraversal:
[legend]

Classes

class  Iterator
 A forward iterator through an ImageTraversal. More...
 

Public Member Functions

virtual Iterator begin ()=0
 The begining of an iterator Virtual function. More...
 
virtual Iterator end ()=0
 The end of an iterator Virtual function. More...
 
virtual void add (const Point &t)=0
 Add new point to the traversal Virtual function. More...
 
virtual Point pop ()=0
 Remove and return the next point of the traversal Virtual function. More...
 
virtual Point peek () const =0
 Return but not remove the next point of the traversal Virtual function. More...
 
virtual bool empty () const =0
 To see if the traversal has no points left Virtual function. More...
 

Static Private Member Functions

static double calculateDelta (const HSLAPixel &p1, const HSLAPixel &p2)
 Calculates a metric for the difference between two pixels, used to calculate if a pixel is within a tolerance. More...
 

Detailed Description

A base class for traversal algorithms on images.

BFS and DFS will inherit from this class

Each derived class must maintain an ordering of points on an image, through calls to the virtual member functions add and pop.

A derived class provides a traversal by returning instances of ImageTraversal::Iterator.

Member Function Documentation

◆ add()

virtual void ImageTraversal::add ( const Point t)
pure virtual

Add new point to the traversal Virtual function.

Derived class need to implement this

Implemented in BFS, and DFS.

◆ begin()

virtual Iterator ImageTraversal::begin ( )
pure virtual

The begining of an iterator Virtual function.

Derived class need to implement this

Implemented in BFS, and DFS.

◆ calculateDelta()

double ImageTraversal::calculateDelta ( const HSLAPixel p1,
const HSLAPixel p2 
)
staticprivate

Calculates a metric for the difference between two pixels, used to calculate if a pixel is within a tolerance.

Parameters
p1First pixel
p2Second pixel
Returns
the difference between two HSLAPixels

◆ empty()

virtual bool ImageTraversal::empty ( ) const
pure virtual

To see if the traversal has no points left Virtual function.

Derived class need to implement this

Implemented in BFS, and DFS.

◆ end()

virtual Iterator ImageTraversal::end ( )
pure virtual

The end of an iterator Virtual function.

Derived class need to implement this

Implemented in BFS, and DFS.

◆ peek()

virtual Point ImageTraversal::peek ( ) const
pure virtual

Return but not remove the next point of the traversal Virtual function.

Derived class need to implement this

Implemented in BFS, and DFS.

◆ pop()

virtual Point ImageTraversal::pop ( )
pure virtual

Remove and return the next point of the traversal Virtual function.

Derived class need to implement this

Implemented in BFS, and DFS.


The documentation for this class was generated from the following files: