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::img
15 {
16 /** A pair (x,y) of pixel coordinates (subpixel resolution). \ingroup
17  * mrpt_img_grp */
19 {
20  /** The type of \a x and \a y */
21  using pixel_coord_t = float;
22 
23  float x, y;
24 
25  /** Default constructor: undefined values of x,y */
26  TPixelCoordf() : x(), y() {}
27  /** Constructor from x,y values */
28  TPixelCoordf(const float _x, const float _y) : x(_x), y(_y) {}
29  template <typename T>
30  TPixelCoordf(const std::pair<T,T>& p) : x(p.first), y(p.second) {}
31 };
32 
33 /** Prints TPixelCoordf as "(x,y)" */
34 std::ostream& operator<<(std::ostream& o, const TPixelCoordf& p);
35 
36 /** A pair (x,y) of pixel coordinates (integer resolution). */
38 {
39  /** The type of \a x and \a y */
40  using pixel_coord_t = int;
41 
42  TPixelCoord() : x(0), y(0) {}
43  TPixelCoord(const int _x, const int _y) : x(_x), y(_y) {}
44  int x, y;
45 };
46 
47 /** Prints TPixelCoord as "(x,y)" */
48 std::ostream& operator<<(std::ostream& o, const TPixelCoord& p);
49 
50 /** A type for image sizes. */
52 
53 }
54 
float pixel_coord_t
The type of x and y.
Definition: TPixelCoord.h:21
GLint * first
Definition: glext.h:3827
A pair (x,y) of pixel coordinates (subpixel resolution).
Definition: TPixelCoord.h:18
TPixelCoord(const int _x, const int _y)
Definition: TPixelCoord.h:43
TPixelCoordf(const std::pair< T, T > &p)
Definition: TPixelCoord.h:30
A pair (x,y) of pixel coordinates (integer resolution).
Definition: TPixelCoord.h:37
TPixelCoordf(const float _x, const float _y)
Constructor from x,y values.
Definition: TPixelCoord.h:28
int pixel_coord_t
The type of x and y.
Definition: TPixelCoord.h:40
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:26



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020