A tlSpiral object provides a discrete spiral coordinates computation respectively to a given starting point. This allows a routine to address image pixels in a spiral sequence, which can be extremely useful for some correlation implementations or simply to find the closest filtered neighbor of a filtered pixel.
Public Member Functions | |
tlSpiral (tlRect *rect=NULL) | |
tlSpiral (int x0, int y0, int width, int height, tlRect *rect=NULL) | |
tlSpiral (tlPoint *p0, int width, int height, tlRect *rect=NULL) | |
virtual | ~tlSpiral () |
int | init (int x0, int y0, int width, int height, tlRect *rect=NULL) |
int | init (tlPoint *p0, int width, int height, tlRect *rect=NULL) |
int | toNext () |
int | toNext (tlPoint *point) |
tlPoint * | get () |
int | get (tlPoint *point) |
int | getX () |
int | getY () |
int | getIndex () |
tlPoint * | getLast () |
int | getLast (tlPoint *point) |
int | getLastX () |
int | getLastY () |
int | getLastIndex () |
tlPoint * | getNext () |
int | getNext (tlPoint *point) |
int | getNextX () |
int | getNextY () |
int | getNextIndex () |
tlSpiral::tlSpiral | ( | tlRect * | rect = NULL |
) |
Constructor, creates a spiral centered relatively to the default image size.
tlSpiral::tlSpiral | ( | int | x0, | |
int | y0, | |||
int | width, | |||
int | height, | |||
tlRect * | rect = NULL | |||
) |
Constructor, creates a spiral centered at the given point.
x0 | spiral starting point on X axis | |
y0 | spiral starting point on Y axis | |
width | image width | |
height | image height | |
rect | portion of the image to consider |
Constructor, creates a spiral centered at the given point.
p0 | spiral starting point | |
width | image width | |
height | image height | |
rect | portion of the image to consider |
tlSpiral::~tlSpiral | ( | ) | [virtual] |
int tlSpiral::init | ( | int | x0, | |
int | y0, | |||
int | width, | |||
int | height, | |||
tlRect * | rect = NULL | |||
) |
Initialize the spiral around a given point, for an image of a given width, and within a certain portion of the image only.
x0 | spiral starting point on X axis | |
y0 | spiral starting point on Y axis | |
width | image width | |
height | image height | |
rect | portion of the image to consider |
Initialize the spiral around a given point, for an image of a given width, and within a certain portion of the image only.
p0 | spiral starting point | |
width | image width | |
height | image height | |
rect | portion of the image to consider |
int tlSpiral::toNext | ( | ) |
Moves on to the next point on the spiral.
int tlSpiral::toNext | ( | tlPoint * | point | ) |
Moves on to the next point on the spiral and place the new current location in a tlPoint.
point | point that receives the new current location |
tlPoint * tlSpiral::get | ( | ) | [inline] |
Return a tlPoint to the current position.
int tlSpiral::get | ( | tlPoint * | point | ) | [inline] |
Fills a tlPoint with the current position.
int tlSpiral::getX | ( | ) | [inline] |
Return the current position in X.
int tlSpiral::getY | ( | ) | [inline] |
Return the current position in Y.
int tlSpiral::getIndex | ( | ) | [inline] |
Return the pixel array index of the current pixel.
tlPoint * tlSpiral::getLast | ( | ) | [inline] |
Return a tlPoint to the previous position.
int tlSpiral::getLast | ( | tlPoint * | point | ) | [inline] |
Fills a tlPoint with the previous position.
int tlSpiral::getLastX | ( | ) | [inline] |
Return the previous position in X.
int tlSpiral::getLastY | ( | ) | [inline] |
Return the previous position in Y.
int tlSpiral::getLastIndex | ( | ) | [inline] |
Return the pixel array index of the previous pixel.
tlPoint * tlSpiral::getNext | ( | ) | [inline] |
Return a tlPoint to the next position.
int tlSpiral::getNext | ( | tlPoint * | point | ) | [inline] |
Fills a tlPoint with the next position.
int tlSpiral::getNextX | ( | ) | [inline] |
Return the next position in X.
int tlSpiral::getNextY | ( | ) | [inline] |
Return the next position in Y.
int tlSpiral::getNextIndex | ( | ) | [inline] |
Return the pixel array index of the next pixel.