SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
tps_transform.h
1#pragma once
2
3#include "projection/thinplatespline.h"
4#include <vector>
5
6namespace satdump
7{
8 namespace projection
9 {
10 class TPSTransform
11 {
12 private:
13 VizGeorefSpline2D *spline_forward;
14 VizGeorefSpline2D *spline_reverse;
15 bool fwd_solved = true;
16 bool rev_solved = true;
17
18 bool has_been_init = false;
19 double xy[2] = {0.0, 0.0};
20
21 public:
22 int init(std::vector<GCP> gcps, bool forward = true, bool reverse = true);
23 TPSTransform();
24 TPSTransform(std::vector<GCP> gcps);
25 ~TPSTransform();
26
27 inline void forward(double lon, double lat, double &x, double &y)
28 {
29 spline_forward->get_point(lon, lat, xy);
30 x = xy[0];
31 y = xy[1];
32 }
33
34 inline void inverse(double x, double y, double &lon, double &lat)
35 {
36 spline_reverse->get_point(x, y, xy);
37 lon = xy[0];
38 lat = xy[1];
39 }
40
41 inline VizGeorefSpline2D &getRawForward() { return *spline_forward; }
42 };
43 }; // namespace projection
44}; // namespace satdump
Definition thinplatespline.h:73