gucoordinates
CameraCoordinate.hpp
Go to the documentation of this file.
1/*
2 * CameraCoordinate.hpp
3 * guvision_utils
4 *
5 * Created by Callum McColl on 19/06/2020.
6 * Copyright © 2020 Callum McColl. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer in the documentation and/or other materials
18 * provided with the distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgement:
22 *
23 * This product includes software developed by Callum McColl.
24 *
25 * 4. Neither the name of the author nor the names of contributors
26 * may be used to endorse or promote products derived from this
27 * software without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
33 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
34 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
35 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
37 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
38 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * -----------------------------------------------------------------------
42 * This program is free software; you can redistribute it and/or
43 * modify it under the above terms or under the terms of the GNU
44 * General Public License as published by the Free Software Foundation;
45 * either version 2 of the License, or (at your option) any later version.
46 *
47 * This program is distributed in the hope that it will be useful,
48 * but WITHOUT ANY WARRANTY; without even the implied warranty of
49 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 * GNU General Public License for more details.
51 *
52 * You should have received a copy of the GNU General Public License
53 * along with this program; if not, see http://www.gnu.org/licenses/
54 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
55 * Fifth Floor, Boston, MA 02110-1301, USA.
56 *
57 */
58
59#ifndef CAMERACOORDINATE_HPP
60#define CAMERACOORDINATE_HPP
61
62#include "camera_coordinate.h"
63#include "PixelCoordinate.hpp"
64#include "PercentCoordinate.hpp"
67#include "FieldCoordinate.hpp"
68#include "CameraPivot.hpp"
70
71#include <cstdlib>
72#include <gu_util.h>
73
74#if __cplusplus >= 201703L
75#include <optional>
76#endif
77
78namespace GU {
79
80 struct PixelCoordinate;
81 struct PercentCoordinate;
82 struct RelativeCoordinate;
83 struct CartesianCoordinate;
84 struct FieldCoordinate;
85
87
88 CameraCoordinate() NOEXCEPT;
89 CameraCoordinate(pixels_u, pixels_u, pixels_u, pixels_u) NOEXCEPT;
90 CameraCoordinate(const CameraCoordinate& other) NOEXCEPT;
91 CameraCoordinate(const gu_camera_coordinate& other) NOEXCEPT;
92#if __cplusplus >= 201103L
93#pragma clang diagnostic push
94#pragma clang diagnostic ignored "-Wc++98-compat"
95 CameraCoordinate(CameraCoordinate&& other) NOEXCEPT;
96 CameraCoordinate(gu_camera_coordinate&& other) NOEXCEPT;
97#pragma clang diagnostic pop
98#endif
99 ~CameraCoordinate() NOEXCEPT;
100 CameraCoordinate& operator=(const CameraCoordinate& other) NOEXCEPT;
101 CameraCoordinate& operator=(const gu_camera_coordinate& other) NOEXCEPT;
102#if __cplusplus >= 201103L
103#pragma clang diagnostic push
104#pragma clang diagnostic ignored "-Wc++98-compat"
107#pragma clang diagnostic pop
108#endif
109
110 GU::PixelCoordinate pixelCoordinate() const NOEXCEPT;
112 RelativeCoordinate relativeCoordinate(const GU::CameraPivot &, const int) const NOEXCEPT;
113
114 pixels_u x() const NOEXCEPT;
115 void set_x(const pixels_u) NOEXCEPT;
116
117 pixels_u y() const NOEXCEPT;
118 void set_y(const pixels_u) NOEXCEPT;
119
120 pixels_u resWidth() const NOEXCEPT;
121 void set_resWidth(const pixels_u) NOEXCEPT;
122
123 pixels_u resHeight() const NOEXCEPT;
124 void set_resHeight(const pixels_u) NOEXCEPT;
125
126 pixels_t xLowerBound() const NOEXCEPT;
127 pixels_t xUpperBound() const NOEXCEPT;
128
129 pixels_t yLowerBound() const NOEXCEPT;
130 pixels_t yUpperBound() const NOEXCEPT;
131
132 bool operator ==(const CameraCoordinate &other) const NOEXCEPT;
133 bool operator !=(const CameraCoordinate &other) const NOEXCEPT;
134 bool operator ==(const gu_camera_coordinate &other) const NOEXCEPT;
135 bool operator !=(const gu_camera_coordinate &other) const NOEXCEPT;
136
137 };
138
139}
140
141#endif /* CAMERACOORDINATE_HPP */
Definition: Camera.hpp:66
RelativeCoordinate relativeCoordinate(const GU::CameraPivot &, const int) const NOEXCEPT
GU::PixelCoordinate pixelCoordinate() const NOEXCEPT
pixels_u y() const NOEXCEPT
void set_resWidth(const pixels_u) NOEXCEPT
bool operator==(const CameraCoordinate &other) const NOEXCEPT
pixels_t xLowerBound() const NOEXCEPT
pixels_u resWidth() const NOEXCEPT
void set_x(const pixels_u) NOEXCEPT
pixels_t yUpperBound() const NOEXCEPT
void set_resHeight(const pixels_u) NOEXCEPT
pixels_t yLowerBound() const NOEXCEPT
pixels_u resHeight() const NOEXCEPT
void set_y(const pixels_u) NOEXCEPT
bool operator!=(const CameraCoordinate &other) const NOEXCEPT
pixels_t xUpperBound() const NOEXCEPT
GU::PercentCoordinate percentCoordinate() const NOEXCEPT
CameraCoordinate & operator=(const CameraCoordinate &other) NOEXCEPT
pixels_u x() const NOEXCEPT
A gu_camera_coordinate represents the coordinate of a pixel within an image where the (0,...