Container for 2D integer positions (pixel position) More...
Public Member Functions | |
| p2d () | |
| empty constructor | |
| p2d (const int &x0, const int &y0) | |
| direct constructor | |
| void | set (const int &x, const int &y) |
| set (x,y)-coordinate | |
| const int & | x () const |
| get x-coordinate | |
| int & | x () |
| get x-coordinate | |
| const int & | y () const |
| get y-coordinate | |
| int & | y () |
| get y-coordinate | |
| p2d & | operator+= (const p2d &u) |
| internal sum between two positions | |
| p2d & | operator-= (const p2d &u) |
| internal diff between two positions | |
Private Attributes | |
| int | internal_x |
| internal x-coordinate | |
| int | internal_y |
| internal y-coordinate | |
Friends | |
| p2d | operator+ (const p2d &u1, const p2d &u2) |
| sum between two positions | |
| p2d | operator- (const p2d &u1, const p2d &u2) |
| diff between two positions | |
| std::ostream & | operator<< (std::ostream &stream, const p2d &u) |
| standard output | |
Container for 2D integer positions (pixel position)
| cpe::p2d::p2d | ( | ) |
empty constructor
| cpe::p2d::p2d | ( | const int & | x0, |
| const int & | y0 | ||
| ) |
direct constructor
| int | x0: x-coordinate |
| int | y0: y-coordinate |
internal sum between two positions
References internal_x, internal_y, x(), and y().
Here is the call graph for this function:internal diff between two positions
References internal_x, internal_y, x(), and y().
Here is the call graph for this function:| void cpe::p2d::set | ( | const int & | x, |
| const int & | y | ||
| ) |
set (x,y)-coordinate
References internal_x, internal_y, x(), and y().
Here is the call graph for this function:| const int & cpe::p2d::x | ( | ) | const |
get x-coordinate
References internal_x.
Referenced by cpe::image::check_position(), cpe::image::coordinate_to_index(), cpe::image::fill_rectangle(), cpe::operator+(), operator+=(), cpe::operator-(), operator-=(), cpe::operator<<(), and set().
| int & cpe::p2d::x | ( | ) |
get x-coordinate
References internal_x.
| const int & cpe::p2d::y | ( | ) | const |
get y-coordinate
References internal_y.
Referenced by cpe::image::check_position(), cpe::image::coordinate_to_index(), cpe::image::fill_rectangle(), cpe::operator+(), operator+=(), cpe::operator-(), operator-=(), cpe::operator<<(), and set().
| int & cpe::p2d::y | ( | ) |
get y-coordinate
References internal_y.
| std::ostream& operator<< | ( | std::ostream & | stream, |
| const p2d & | u | ||
| ) | [friend] |
standard output
int cpe::p2d::internal_x [private] |
internal x-coordinate
Referenced by operator+=(), operator-=(), set(), and x().
int cpe::p2d::internal_y [private] |
internal y-coordinate
Referenced by operator+=(), operator-=(), set(), and y().