mp_traversals
Terrible Traversals
Traversals Namespace Reference

Namespace containing everything required for an image traversal. More...

Classes

class  ImageTraversal
 A base class for traversal algorithms on images. More...
 
struct  TraversalFunctions
 The set of functions describing a traversal's operation. More...
 

Typedefs

typedef void(* add_function) (std::deque< Point > &, const Point &)
 The expected type for an add function for a traversal The first parameter is the deque storing a list of points to be processed The second parameter is the new Point that should be added to the deque. More...
 
typedef void(* pop_function) (std::deque< Point > &)
 The expected type for a pop function for a traversal The first parameter is the deque storing a list of points to be processed The function then removes the next Point from the deque. More...
 
typedef Point(* peek_function) (std::deque< Point > &)
 The expected type for a peek function for a traversal The first parameter is the deque storing a list of points to be processed The function returns the next Point to be processed (without removing it from the deque) More...
 
typedef struct Traversals::TraversalFunctions TraversalFunctions
 The set of functions describing a traversal's operation. More...
 

Functions

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...
 
void bfs_add (std::deque< Point > &work_list, const Point &point)
 Adds a Point for the bfs traversal to visit at some point in the future. More...
 
void dfs_add (std::deque< Point > &work_list, const Point &point)
 Adds a Point for the dfs traversal to visit at some point in the future. More...
 
void bfs_pop (std::deque< Point > &work_list)
 Removes the current Point in the bfs traversal. More...
 
void dfs_pop (std::deque< Point > &work_list)
 Removes the current Point in the dfs traversal. More...
 
Point bfs_peek (std::deque< Point > &work_list)
 Returns the current Point in the bfs traversal. More...
 
Point dfs_peek (std::deque< Point > &work_list)
 Returns the current Point in the dfs traversal. More...
 
double calculateDelta (const HSLAPixel &p1, const HSLAPixel &p2)
 

Detailed Description

Namespace containing everything required for an image traversal.

Typedef Documentation

◆ add_function

typedef void(* Traversals::add_function) (std::deque< Point > &, const Point &)

The expected type for an add function for a traversal The first parameter is the deque storing a list of points to be processed The second parameter is the new Point that should be added to the deque.

◆ peek_function

typedef Point(* Traversals::peek_function) (std::deque< Point > &)

The expected type for a peek function for a traversal The first parameter is the deque storing a list of points to be processed The function returns the next Point to be processed (without removing it from the deque)

◆ pop_function

typedef void(* Traversals::pop_function) (std::deque< Point > &)

The expected type for a pop function for a traversal The first parameter is the deque storing a list of points to be processed The function then removes the next Point from the deque.

◆ TraversalFunctions

The set of functions describing a traversal's operation.

Function Documentation

◆ bfs_add()

void Traversals::bfs_add ( std::deque< Point > &  work_list,
const Point point 
)

Adds a Point for the bfs traversal to visit at some point in the future.

Parameters
work_listthe deque storing a list of points to be processed
pointthe point to be added
Todo:
[Part 1]

◆ bfs_peek()

Point Traversals::bfs_peek ( std::deque< Point > &  work_list)

Returns the current Point in the bfs traversal.

Parameters
work_listthe deque storing a list of points to be processed
Returns
the current Point
Todo:
[Part 1]

◆ bfs_pop()

void Traversals::bfs_pop ( std::deque< Point > &  work_list)

Removes the current Point in the bfs traversal.

Parameters
work_listthe deque storing a list of points to be processed
Todo:
[Part 1]

◆ calculateDelta()

double Traversals::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.

Parameters
p1First pixel
p2Second pixel
Returns
the difference between two HSLAPixels

◆ dfs_add()

void Traversals::dfs_add ( std::deque< Point > &  work_list,
const Point point 
)

Adds a Point for the dfs traversal to visit at some point in the future.

Parameters
work_listthe deque storing a list of points to be processed
pointthe point to be added
Todo:
[Part 1]

◆ dfs_peek()

Point Traversals::dfs_peek ( std::deque< Point > &  work_list)

Returns the current Point in the dfs traversal.

Parameters
work_listthe deque storing a list of points to be processed
Returns
the current Point
Todo:
[Part 1]

◆ dfs_pop()

void Traversals::dfs_pop ( std::deque< Point > &  work_list)

Removes the current Point in the dfs traversal.

Parameters
work_listthe deque storing a list of points to be processed
Todo:
[Part 1]