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
float pixel_coord_t
The type of x and y.
Definition: TPixelCoord.h:23
GLint * first
Definition: glext.h:3827
A pair (x,y) of pixel coordinates (subpixel resolution).
Definition: TPixelCoord.h:20
TPixelCoord(const int _x, const int _y)
Definition: TPixelCoord.h:45
GLint GLvoid * img
Definition: glext.h:3763
TPixelCoordf(const std::pair< T, T > &p)
Definition: TPixelCoord.h:32
A pair (x,y) of pixel coordinates (integer resolution).
Definition: TPixelCoord.h:39
TPixelCoordf(const float _x, const float _y)
Constructor from x,y values.
Definition: TPixelCoord.h:30
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
int pixel_coord_t
The type of x and y.
Definition: TPixelCoord.h:42
GLenum GLint GLint y
Definition: glext.h:3538
GLenum GLint x
Definition: glext.h:3538
std::ostream & operator<<(std::ostream &o, const TColor &c)
Definition: TColor.cpp:85
GLfloat GLfloat p
Definition: glext.h:6305
TPixelCoordf()
Default constructor: undefined values of x,y.
Definition: TPixelCoord.h:28



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019