The integer coordinates of pixels inside a rectangle are iteratively explored. This structure keep track of the process and functions ri_ini(), ri_inc(), ri_end(), and ri_del() are used in the process. An example of how to use the iterator is as follows:
struct rect * rec = XXX; // some rectangle rect_iter * i; for( i=ri_ini(rec); !ri_end(i); ri_inc(i) ) { // your code, using 'i->x' and 'i->y' as coordinates } ri_del(i); // delete iterator
vx[1],vy[1]
* *
* *
* *
* ye
* : *
vx[0],vy[0] : *
* : *
* x,y *
* : *
* : vx[2],vy[2]
* : *
y ys *
^ * *
| * *
| * *
+---> x vx[3],vy[3]
The four corners of the rectangle are stored in order that rotates around the corners at the arrays 'vx[]' and 'vy[]'. The first point is always the one with smaller x value.
'x' and 'y' are the coordinates of the pixel being explored. 'ys' and 'ye' are the start and end values of the current column being explored. So, 'ys' < 'ye'.
Definition at line 1259 of file lsd.c.
Data Fields | |
| double | vx [4] |
| double | vy [4] |
| double | ys |
| double | ye |
| int | x |
| int | y |
|
|
|
|
|
|
|
|
Definition at line 1264 of file lsd.c. Referenced by rect_nfa(), ri_end(), ri_inc(), and ri_ini(). |
|
|
Definition at line 1264 of file lsd.c. Referenced by rect_nfa(), ri_inc(), and ri_ini(). |
|
|
|
|
|
|
1.3.4