SMIL 1.1.2
|
Classes | |
class | Bresenham |
Bresenham Class. More... | |
Functions | |
vector< IntPoint > | bresenhamPoints (int p1x, int p1y, int p2x, int p2y, int xMax=0, int yMax=0) |
Find intermediate points forming a line between two end points, using the Bresenham Line Draw Algorithm. | |
vector< IntPoint > | bresenhamLine (int p1x, int p1y, int p2x, int p2y) |
Find intermediate points forming a line between two end points, using the Bresenham Line Draw Algorithm. | |
|
inline |
Find intermediate points forming a line between two end points, using the Bresenham Line Draw Algorithm.
[in] | (p1x,p1y),(p2x,p2y) | : end points |
[in] | xMax,yMax | : maximum values of X and y |
std::vector< IntPoint > bresenhamLine | ( | int | p1x, |
int | p1y, | ||
int | p2x, | ||
int | p2y | ||
) |
Find intermediate points forming a line between two end points, using the Bresenham Line Draw Algorithm.
[in] | (p1x,p1y),(p2x,p2y) | : end points |
RES_T drawLine | ( | Image< T > & | im, |
int | x0, | ||
int | y0, | ||
int | x1, | ||
int | y1, | ||
T | value = ImDtTypes<T>::max() |
||
) |
Draws a line between two points P0(x0,y0) and P1(x1,y1).
This function is based on the Bresenham's line algorithm. (works only on 2D images)
[in,out] | im | : Modified image |
[in] | x0,y0 | : Coordinates of the first point |
[in] | x1,y1 | : Coordinates of the second point |
[in] | value | : value to set pixels in the line |
RES_T drawLine | ( | Image< T > & | imOut, |
vector< UINT > | coords, | ||
T | value = ImDtTypes<T>::max() |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Draw line from vector
[in,out] | imOut | : Modified image |
[in] | coords | : Vector containing the coordiantes of the two end points (x0, y0, x1, y1) |
[in] | value | : value to set pixels in the line |
RES_T drawRectangle | ( | Image< T > & | imOut, |
int | x0, | ||
int | y0, | ||
size_t | width, | ||
size_t | height, | ||
T | value = ImDtTypes<T>::max() , |
||
bool | fill = false , |
||
size_t | zSlice = 0 |
||
) |
Draw a rectangle.
[in,out] | imOut | : Output image. |
[in] | x0,y0 | : Coordinates of the first point |
[in] | width | : Width of the rectangle |
[in] | height | : Height of the rectangle |
[in] | value | : value to set pixels in the rectangle |
[in] | fill | : Fill the rectangle |
[in] | zSlice | : Select the slice (for 3D images) |
RES_T drawRectangle | ( | Image< T > & | imOut, |
vector< UINT > | coords, | ||
T | value = ImDtTypes<T>::max() , |
||
bool | fill = false |
||
) |
Draw a rectangle.
As drawRectangle but with a vector parameter to define all coordinates of rectangles.
[in,out] | imOut | : Output image. |
[in] | coords | : A vector with the coordinates of the rectangle |
[in] | value | : value to set pixels in the rectangle |
[in] | fill | : Fill the rectangle |
RES_T drawRectangles | ( | Image< T > & | imOut, |
const map< MapT, vector< size_t > > & | coordsVectMap, | ||
bool | fill = false |
||
) |
Draw a list of rectangles.
[in,out] | imOut | : output image |
[in] | coordsVectMap | : a map defining rectangles to draw |
[in] | fill | : fill rectangles |
RES_T drawCircle | ( | Image< T > & | imOut, |
int | x0, | ||
int | y0, | ||
int | radius, | ||
T | value = ImDtTypes<T>::max() , |
||
size_t | zSlice = 0 |
||
) |
Draw a circle.
Bressenham's Midpoint Circle algoritm
imOut | Output image. |
x0,y0 | Coordinates of the center |
radius | Radius of the circle |
value | Pixel value on the circle |
zSlice | Select the slice (for 3D images) |
RES_T drawSphere | ( | Image< T > & | imOut, |
int | x0, | ||
int | y0, | ||
int | z0, | ||
int | radius, | ||
T | value = ImDtTypes<T>::max() |
||
) |
Draw a sphere.
imOut | Output image. |
x0,y0,z0 | Coordinates of the center |
radius | Radius of the circle |
value | Pixel value on the sphere |
RES_T drawDisc | ( | Image< T > & | imOut, |
int | x0, | ||
int | y0, | ||
size_t | zSlice, | ||
int | radius, | ||
T | value = ImDtTypes<T>::max() |
||
) |
Draw a disc.
imOut | Output image. |
x0,y0 | Coordinates of the center |
radius | Radius of the circle |
value | Pixel value on the circle |
zSlice | Select the slice (for 3D images) |
RES_T drawBox | ( | Image< T > & | imOut, |
size_t | x0, | ||
size_t | y0, | ||
size_t | z0, | ||
size_t | width, | ||
size_t | height, | ||
size_t | depth, | ||
T | value = ImDtTypes<T>::max() , |
||
bool | fill = false |
||
) |
Draw a box (3D)
imOut | Output image. |
x0,y0,z0 | Coordinates of the first point |
width,height,depth | Dimensions of the box |
value | Pixel value on the box |
fill | Fill the box |
RES_T copyPattern | ( | const Image< T > & | imIn, |
int | x0, | ||
int | y0, | ||
int | width, | ||
int | height, | ||
Image< T > & | imOut, | ||
int | nbr_along_x, | ||
int | nbr_along_y | ||
) |
Copy a given pattern (zone of input image) several times in an output image.
Only 2D for now.
If nbr_along_x and int nbr_along_y are not specified, fill completely the output image with a maximum number of parterns. If x0, y0, width and height are not specified, the full image imIn will be copied.
Python example: