GDAL

gdal_gcp.h
1/******************************************************************************
2 *
3 * Name: gdal_gcp.h
4 * Project: GDAL Core
5 * Purpose: Declaration of gdal::GCP class
6 * Author: Even Rouault, <even.rouault@spatialys.com>
7 *
8 ******************************************************************************
9 * Copyright (c) 2024, Even Rouault, <even.rouault@spatialys.com>
10 *
11 * SPDX-License-Identifier: MIT
12 ****************************************************************************/
13
14#ifndef GDALGCP_H_INCLUDED
15#define GDALGCP_H_INCLUDED
16
17#include "cpl_port.h"
18#include "gdal.h"
19
20#include <vector>
21
22/* ******************************************************************** */
23/* gdal::GCP */
24/* ******************************************************************** */
25
26 namespace gdal
27{
35 class CPL_DLL GCP
36{
37 public:
38 explicit GCP(const char *pszId = "", const char *pszInfo = "",
39 double dfPixel = 0, double dfLine = 0, double dfX = 0,
40 double dfY = 0, double dfZ = 0);
41 ~GCP();
42 GCP(const GCP &);
43 explicit GCP(const GDAL_GCP &other);
44 GCP &operator=(const GCP &);
45 GCP(GCP &&);
46 GCP &operator=(GCP &&);
47
49 inline const char *Id() const
50 {
51 return gcp.pszId;
52 }
53
54 void SetId(const char *pszId);
55
57 inline const char *Info() const
58 {
59 return gcp.pszInfo;
60 }
61
62 void SetInfo(const char *pszInfo);
63
65 inline double Pixel() const
66 {
67 return gcp.dfGCPPixel;
68 }
69
71 inline double &Pixel()
72 {
73 return gcp.dfGCPPixel;
74 }
75
77 inline double Line() const
78 {
79 return gcp.dfGCPLine;
80 }
81
83 inline double &Line()
84 {
85 return gcp.dfGCPLine;
86 }
87
89 inline double X() const
90 {
91 return gcp.dfGCPX;
92 }
93
95 inline double &X()
96 {
97 return gcp.dfGCPX;
98 }
99
101 inline double Y() const
102 {
103 return gcp.dfGCPY;
104 }
105
107 inline double &Y()
108 {
109 return gcp.dfGCPY;
110 }
111
113 inline double Z() const
114 {
115 return gcp.dfGCPZ;
116 }
117
119 inline double &Z()
120 {
121 return gcp.dfGCPZ;
122 }
123
125 inline const GDAL_GCP *c_ptr() const
126 {
127 return &gcp;
128 }
129
130 static const GDAL_GCP *c_ptr(const std::vector<GCP> &asGCPs);
131
132 static std::vector<GCP> fromC(const GDAL_GCP *pasGCPList, int nGCPCount);
133
134 private:
135 GDAL_GCP gcp;
136};
137
138} /* namespace gdal */
139
140#endif
gdal::GCP
C++ wrapper over the C GDAL_GCP structure.
Definition gdal_gcp.h:36
gdal::GCP::Line
double Line() const
Returns the "line" member.
Definition gdal_gcp.h:77
gdal::GCP::Pixel
double & Pixel()
Returns a reference to the "pixel" member.
Definition gdal_gcp.h:71
gdal::GCP::X
double X() const
Returns the "X" member.
Definition gdal_gcp.h:89
gdal::GCP::X
double & X()
Returns a reference to the "X" member.
Definition gdal_gcp.h:95
gdal::GCP::Pixel
double Pixel() const
Returns the "pixel" member.
Definition gdal_gcp.h:65
gdal::GCP::Z
double & Z()
Returns a reference to the "Z" member.
Definition gdal_gcp.h:119
gdal::GCP::Y
double Y() const
Returns the "Y" member.
Definition gdal_gcp.h:101
gdal::GCP::c_ptr
const GDAL_GCP * c_ptr() const
Casts as a C GDAL_GCP pointer.
Definition gdal_gcp.h:125
gdal::GCP::Y
double & Y()
Returns a reference to the "Y" member.
Definition gdal_gcp.h:107
gdal::GCP::Id
const char * Id() const
Returns the "id" member.
Definition gdal_gcp.h:49
gdal::GCP::Info
const char * Info() const
Returns the "info" member.
Definition gdal_gcp.h:57
gdal::GCP::Z
double Z() const
Returns the "Z" member.
Definition gdal_gcp.h:113
gdal::GCP::Line
double & Line()
Returns a reference to the "line" member.
Definition gdal_gcp.h:83
cpl_port.h
Core portability definitions for CPL.
gdal.h
Public (C callable) GDAL entry points.
GDAL_GCP
Ground Control Point.
Definition gdal.h:1221