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
26namespace gdal
27{
35class 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
double Line() const
Returns the "line" member.
Definition gdal_gcp.h:77
double & Pixel()
Returns a reference to the "pixel" member.
Definition gdal_gcp.h:71
double X() const
Returns the "X" member.
Definition gdal_gcp.h:89
double & X()
Returns a reference to the "X" member.
Definition gdal_gcp.h:95
double Pixel() const
Returns the "pixel" member.
Definition gdal_gcp.h:65
double & Z()
Returns a reference to the "Z" member.
Definition gdal_gcp.h:119
double Y() const
Returns the "Y" member.
Definition gdal_gcp.h:101
const GDAL_GCP * c_ptr() const
Casts as a C GDAL_GCP pointer.
Definition gdal_gcp.h:125
double & Y()
Returns a reference to the "Y" member.
Definition gdal_gcp.h:107
const char * Id() const
Returns the "id" member.
Definition gdal_gcp.h:49
GCP & operator=(const GCP &)
Copy assignment operator.
Definition gdal_misc.cpp:1760
const char * Info() const
Returns the "info" member.
Definition gdal_gcp.h:57
double Z() const
Returns the "Z" member.
Definition gdal_gcp.h:113
double & Line()
Returns a reference to the "line" member.
Definition gdal_gcp.h:83
GCP(const char *pszId="", const char *pszInfo="", double dfPixel=0, double dfLine=0, double dfX=0, double dfY=0, double dfZ=0)
Constructor.
Definition gdal_misc.cpp:1712
Core portability definitions for CPL.
Public (C callable) GDAL entry points.
Ground Control Point.
Definition gdal.h:1221