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 | |
void | get (int *x, int *y) const |
get (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 |
void cpe::p2d::get | ( | int * | x, | |
int * | y | |||
) | const |
get (x,y)-coordinate
References internal_x, and internal_y.
internal sum between two positions
References internal_x, internal_y, x(), and y().
internal diff between two positions
References internal_x, internal_y, x(), and y().
void cpe::p2d::set | ( | const int & | x, | |
const int & | y | |||
) |
set (x,y)-coordinate
References internal_x, and internal_y.
int & cpe::p2d::x | ( | ) |
get x-coordinate
References internal_x.
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::image::get_b(), cpe::image::get_g(), cpe::image::get_pixel(), cpe::image::get_r(), cpe::operator+(), operator+=(), cpe::operator-(), operator-=(), cpe::operator<<(), and cpe::image::set_pixel().
int & cpe::p2d::y | ( | ) |
get y-coordinate
References internal_y.
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::image::get_b(), cpe::image::get_g(), cpe::image::get_pixel(), cpe::image::get_r(), cpe::operator+(), operator+=(), cpe::operator-(), operator-=(), cpe::operator<<(), and cpe::image::set_pixel().
std::ostream& operator<< | ( | std::ostream & | stream, | |
const p2d & | u | |||
) | [friend] |
standard output
int cpe::p2d::internal_x [private] |
internal x-coordinate
Referenced by get(), operator+=(), operator-=(), set(), and x().
int cpe::p2d::internal_y [private] |
internal y-coordinate
Referenced by get(), operator+=(), operator-=(), set(), and y().