Main MRPT website > C++ reference for MRPT 1.9.9
TPixelCoord.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <iosfwd>
12 #include <utility>
13 
14 namespace mrpt
15 {
16 namespace img
17 {
18 /** A pair (x,y) of pixel coordinates (subpixel resolution). \ingroup
19  * mrpt_img_grp */
21 {
22  /** The type of \a x and \a y */
23  using pixel_coord_t = float;
24 
25  float x, y;
26 
27  /** Default constructor: undefined values of x,y */
28  TPixelCoordf() : x(), y() {}
29  /** Constructor from x,y values */
30  TPixelCoordf(const float _x, const float _y) : x(_x), y(_y) {}
31  template <typename T>
32  TPixelCoordf(const std::pair<T,T>& p) : x(p.first), y(p.second) {}
33 };
34 
35 /** Prints TPixelCoordf as "(x,y)" */
36 std::ostream& operator<<(std::ostream& o, const TPixelCoordf& p);
37 
38 /** A pair (x,y) of pixel coordinates (integer resolution). */
40 {
41  /** The type of \a x and \a y */
42  using pixel_coord_t = int;
43 
44  TPixelCoord() : x(0), y(0) {}
45  TPixelCoord(const int _x, const int _y) : x(_x), y(_y) {}
46  int x, y;
47 };
48 
49 /** Prints TPixelCoord as "(x,y)" */
50 std::ostream& operator<<(std::ostream& o, const TPixelCoord& p);
51 
52 /** A type for image sizes. */
54 
55 } // namespace img
56 } // namespace mrpt
mrpt::img::TPixelCoord::pixel_coord_t
int pixel_coord_t
The type of x and y.
Definition: TPixelCoord.h:42
mrpt::img::TPixelCoordf
A pair (x,y) of pixel coordinates (subpixel resolution).
Definition: TPixelCoord.h:20
mrpt::img::TPixelCoord::y
int y
Definition: TPixelCoord.h:46
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
p
GLfloat GLfloat p
Definition: glext.h:6305
mrpt::img::TPixelCoord::x
int x
Definition: TPixelCoord.h:46
mrpt::img::operator<<
std::ostream & operator<<(std::ostream &o, const TColor &c)
Definition: TColor.cpp:85
mrpt::img::TPixelCoord::TPixelCoord
TPixelCoord(const int _x, const int _y)
Definition: TPixelCoord.h:45
mrpt::img::TPixelCoordf::TPixelCoordf
TPixelCoordf()
Default constructor: undefined values of x,y.
Definition: TPixelCoord.h:28
mrpt::img::TPixelCoordf::TPixelCoordf
TPixelCoordf(const float _x, const float _y)
Constructor from x,y values.
Definition: TPixelCoord.h:30
mrpt::img::TPixelCoord::TPixelCoord
TPixelCoord()
Definition: TPixelCoord.h:44
mrpt::img::TPixelCoordf::TPixelCoordf
TPixelCoordf(const std::pair< T, T > &p)
Definition: TPixelCoord.h:32
img
GLint GLvoid * img
Definition: glext.h:3763
mrpt::img::TPixelCoordf::y
float y
Definition: TPixelCoord.h:25
mrpt::img::TPixelCoordf::x
float x
Definition: TPixelCoord.h:25
mrpt::img::TPixelCoord
A pair (x,y) of pixel coordinates (integer resolution).
Definition: TPixelCoord.h:39
y
GLenum GLint GLint y
Definition: glext.h:3538
x
GLenum GLint x
Definition: glext.h:3538
first
GLint * first
Definition: glext.h:3827
mrpt::img::TPixelCoordf::pixel_coord_t
float pixel_coord_t
The type of x and y.
Definition: TPixelCoord.h:23



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST