#include <image.h>
Inheritance diagram for PLib::MatrixImage< T >:
Public Member Functions | |
MatrixImage (Matrix< T > &img) | |
MatrixImage (MatrixImage< T > &img) | |
MatrixImage (const int r, const int c) | |
void | drawLine (int i1, int j1, int i2, int j2, T color) |
void | drawPoint (int i, int j, double radius, T color) |
void | store (Matrix< T > &) |
This class allows one to draw a line or a point on a matrix as if it was an image.
void PLib::MatrixImage< T >::drawLine | ( | int | i1, | |
int | j1, | |||
int | i2, | |||
int | j2, | |||
T | color | |||
) |
draws a line from point 1 to point 2
Draws a line without aliasing from point \a (i1,j1) to \a (i2,j2) with the value \a color.
i1 | the row of point 1 | |
j1 | the column of point 1 | |
i2 | the row of point 2 | |
j2 | the column of point 2 | |
color | the line is drawn with this value |
void PLib::MatrixImage< T >::drawPoint | ( | int | i, | |
int | j, | |||
double | r, | |||
T | color | |||
) |
draws a point of radius r
Draws a point of radius r at location (i,j) with the value color.
i | the row of the center point to draw | |
j | the column of the center point to draw | |
r | the radius of the point | |
color | the value to draw the point with |
void PLib::MatrixImage< T >::store | ( | Matrix< T > & | a | ) |
copies an image to a Matrix
copies the image to a matrix of the same type.
a | the matrix to store the image to |