mp_traversals
Terrible Traversals
|
A base class for traversal algorithms on images. More...
#include <ImageTraversal.h>
Classes | |
class | Iterator |
A forward iterator through an ImageTraversal. More... | |
Public Member Functions | |
ImageTraversal (const PNG &png, const Point &start, double tolerance, add_function traversal_add, pop_function traversal_pop) | |
Constructor for the given traversal. More... | |
Iterator | begin () |
Returns an iterator for the traversal starting at the first point (specified in the constructor). More... | |
Iterator | end () |
Returns an iterator for the traversal one past the end of the traversal. More... | |
A base class for traversal algorithms on images.
This class provides a traversal of the image by returning instances of ImageTraversal::Iterator.
Traversals::ImageTraversal::ImageTraversal | ( | const PNG & | png, |
const Point & | start, | ||
double | tolerance, | ||
add_function | traversal_add, | ||
pop_function | traversal_pop | ||
) |
Constructor for the given traversal.
Initializes a ImageTraversal on a given png
image, starting at start
, and with a given tolerance
.
png | The image this traversal is going to traverse |
start | The start point of this traversal |
tolerance | If the current point is too different (difference larger than tolerance) with the start point, it will not be included in this traversal |
traversal_add | a function pointer to an implemented function which takes in a reference to the work list and the point to be added |
traversal_pop | a function pointer to an implemented function which takes in a reference to the work list and returns the next point to be processed in the traversal |
ImageTraversal::Iterator Traversals::ImageTraversal::begin | ( | ) |
Returns an iterator for the traversal starting at the first point (specified in the constructor).
Returns an iterator for the traversal starting at the first point.
ImageTraversal::Iterator Traversals::ImageTraversal::end | ( | ) |
Returns an iterator for the traversal one past the end of the traversal.