IMP
2.2.1
The Integrative Modeling Platform
|
#include <IMP/em2d/CenteredMat.h>
Public Member Functions | |
CenteredMat (cv::Mat &m) | |
CenteredMat (cv::Mat &m, int center_row, int center_col) | |
void | do_show (std::ostream &out) const |
int | get_end (int i) const |
bool | get_is_in_range (int i, int j) const |
int | get_start (int i) const |
double & | operator() (int i, int j) |
void | show (std::ostream &out=std::cout) const |
Protected Member Functions | |
void | set_starts_and_ends () |
Protected Attributes | |
int | center_col_ |
int | center_row_ |
cv::Mat | centered_ |
int | end_ [2] |
int | start_ [2] |
Decorator for a cv::Mat to use coordinates respect to a point Almost always that point is the center
Definition at line 21 of file CenteredMat.h.
IMP::em2d::CenteredMat::CenteredMat | ( | cv::Mat & | m | ) |
Creates and CenteredMat for the matrx
m | The matrix |
Definition at line 30 of file CenteredMat.h.
IMP::em2d::CenteredMat::CenteredMat | ( | cv::Mat & | m, |
int | center_row, | ||
int | center_col | ||
) |
Creates a CenteredMat for the matrx
m | The matrix |
center_row | - The row for the point used as center of CenteredMat |
center_col | - The column for the point used as center of CenteredMat |
Definition at line 48 of file CenteredMat.h.
void IMP::em2d::CenteredMat::do_show | ( | std::ostream & | out | ) | const |
Shows information about the class
out | Stream used to show the information |
Definition at line 109 of file CenteredMat.h.
int IMP::em2d::CenteredMat::get_end | ( | int | i | ) | const |
See get_start() function help. In the example of the 5x5 matrix, the end values would be (2,2)
i | The dimension to use (0 - rows, 1 - columns) |
Definition at line 75 of file CenteredMat.h.
bool IMP::em2d::CenteredMat::get_is_in_range | ( | int | i, |
int | j | ||
) | const |
Returns true if the indices are in the matrix. Remember that the indices are those respect to the center of CenteredMat
i | Row |
j | Column |
Definition at line 84 of file CenteredMat.h.
int IMP::em2d::CenteredMat::get_start | ( | int | i | ) | const |
get the starting value for a dimension. ! For example, in a matrix of 5x5 centered at the origin (2,2), the ! starting point will be (-2,2)
i | The dimension to use (0 - rows, 1 - columns) |
Definition at line 67 of file CenteredMat.h.
double& IMP::em2d::CenteredMat::operator() | ( | int | i, |
int | j | ||
) |
Returns the element (i,j) RELATIVE to the center. Remember then that the indices can be negative. For performance the indices out of range are NOT checked
i | row |
j | column |
Definition at line 98 of file CenteredMat.h.
|
protected |
Sets the starting and ending points for the object. See get_start() and get_end() for more help
Definition at line 123 of file CenteredMat.h.