gucoordinates
conversion_fakes.h
Go to the documentation of this file.
1/*
2 * conversion_fakes.h
3 * tests
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 CONVERSION_FAKES_H
60#define CONVERSION_FAKES_H
61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#include "fff.h"
67#include "../gucoordinates.h"
68#include <stdbool.h>
69
70#define CONVERSION_FAKES(FAKE) \
71 FAKE(cam_coord_to_px_coord) \
72 FAKE(px_coord_to_cam_coord) \
73 FAKE(px_coord_to_pct_coord) \
74 FAKE(pct_coord_to_px_coord) \
75 FAKE(pct_coord_to_rr_coord) \
76 FAKE(rr_coord_to_pct_coord) \
77 FAKE(clamped_rr_coord_to_pct_coord) \
78 FAKE(rr_coord_to_cartesian_coord) \
79 FAKE(rr_coord_to_cartesian_coord_from_source) \
80 FAKE(rr_coord_to_field_coord) \
81 FAKE(rr_coord_to_field_coord_from_source) \
82 FAKE(cartesian_coord_to_rr_coord) \
83 FAKE(cartesian_coord_to_rr_coord_from_source) \
84 FAKE(field_coord_to_rr_coord_to_target)
85
92
99
100#define cam_coord_to_px_coord_result px_result
102
103#define px_coord_to_cam_coord_result cam_result
105
106#define px_coord_to_pct_coord_result pct_result
108
109#define pct_coord_to_px_coord_result px_result
111
112#define pct_coord_to_rr_coord_result rr_result
114
115#define rr_coord_to_pct_coord_result pct_result
117
118#define clamped_rr_coord_to_pct_coord_result pct_result
120
121// Converting from the robot relative coordinate system to the field coordinate systems.
122#define rr_coord_to_cartesian_coord_result cartesian_result
124
125#define rr_coord_to_cartesian_coord_from_source_result cartesian_result
127
128#define rr_coord_to_cartesian_coord_from_field_result cartesian_result
130
131#define rr_coord_to_field_coord_result field_result
133
134#define rr_coord_to_field_coord_from_source_result field_result
136
137// Converting from field coordinates to relative coordinates.
138#define cartesian_coord_to_rr_coord_result rr_result
140
141#define cartesian_coord_to_rr_coord_from_source_result rr_result
143
144#define field_coord_to_rr_coord_to_target_result rr_result
146
147#ifdef __cplusplus
148}
149#endif
150
151#endif /* CONVERSION_FAKES_H */
const gu_optional_camera_coordinate opt_cam_result
gu_percent_coordinate px_coord_to_pct_coord(const gu_pixel_coordinate arg0)
Definition: conversions.c:95
gu_cartesian_coordinate rr_coord_to_cartesian_coord_from_field(const gu_relative_coordinate arg0, const gu_field_coordinate arg1)
Definition: conversions.c:196
gu_pixel_coordinate pct_coord_to_px_coord(const gu_percent_coordinate arg0, const pixels_u arg1, const pixels_u arg2)
Definition: conversions.c:105
gu_percent_coordinate rr_coord_to_pct_coord(const gu_relative_coordinate arg0, const gu_camera_pivot arg1, const int arg2)
Definition: conversions.c:142
gu_relative_coordinate cartesian_coord_to_rr_coord_from_source(const gu_cartesian_coordinate arg0, const gu_cartesian_coordinate arg1)
Definition: conversions.c:226
const gu_field_coordinate field_result
gu_relative_coordinate field_coord_to_rr_coord_to_target(const gu_field_coordinate arg0, const gu_cartesian_coordinate arg1)
Definition: conversions.c:237
const gu_optional_field_coordinate opt_field_result
gu_field_coordinate rr_coord_to_field_coord(const gu_relative_coordinate arg0, const degrees_t arg1)
Definition: conversions.c:202
gu_percent_coordinate clamped_rr_coord_to_pct_coord(const gu_relative_coordinate arg0, const gu_camera_pivot arg1, const int arg2)
Definition: conversions.c:157
gu_relative_coordinate cartesian_coord_to_rr_coord(const gu_cartesian_coordinate arg0)
Definition: conversions.c:220
gu_relative_coordinate pct_coord_to_rr_coord(const gu_percent_coordinate arg0, const gu_camera_pivot arg1, const int arg2)
Definition: conversions.c:115
const gu_cartesian_coordinate cartesian_result
gu_cartesian_coordinate rr_coord_to_cartesian_coord_from_source(const gu_relative_coordinate arg0, const gu_cartesian_coordinate arg1)
Definition: conversions.c:188
const gu_optional_percent_coordinate opt_pct_result
const gu_relative_coordinate rr_result
const gu_optional_relative_coordinate opt_rr_result
const gu_optional_cartesian_coordinate opt_cartesian_result
const gu_pixel_coordinate px_result
gu_pixel_coordinate cam_coord_to_px_coord(const gu_camera_coordinate arg0)
Definition: conversions.c:75
const gu_optional_pixel_coordinate opt_px_result
gu_field_coordinate rr_coord_to_field_coord_from_source(const gu_relative_coordinate arg0, const gu_field_coordinate arg1, const degrees_t arg2)
Definition: conversions.c:211
gu_cartesian_coordinate rr_coord_to_cartesian_coord(const gu_relative_coordinate arg0)
Definition: conversions.c:177
const gu_camera_coordinate cam_result
const gu_percent_coordinate pct_result
gu_camera_coordinate px_coord_to_cam_coord(const gu_pixel_coordinate arg0)
Definition: conversions.c:85
#define DECLARE_FAKE_VALUE_FUNC(...)
Definition: fff.h:6582
A gu_camera_coordinate represents the coordinate of a pixel within an image where the (0,...
A gu_camera_pivot represents the pivot point which a gu_camera is attached to.
Definition: camera_pivot.h:87
A cartesian_coordinate is a general coordinate for representing positions on a tow dimensional plane.
A field_coordinate is a coordinate for an object that faces a certain direction (such as a robot) on ...
A gu_percent_coordinate represents the coordinate of a pixel within an image.
A gu_pixel_coordinate represents the coordinate of a pixel within an image.
A coordinate that is relative to some other coordinate.