ddt 1.4.0
 
Loading...
Searching...
No Matches
imageCoords.hpp
Go to the documentation of this file.
1
11
12#ifndef IMAGECOORDS_HPP
13#define IMAGECOORDS_HPP
14
15#include <cpl.h>
16#include <sys/stat.h>
17
18#include <algorithm>
19#include <cctype>
20#undef I
21#undef arg
22
24#include "ddt/dataFile.hpp"
25#include "ddt/ddtLogger.hpp"
26#include "ddt/imageError.hpp"
27#include "ddt/imageIO.hpp"
28#include "ddt/imageProc.hpp"
29#include "ddt/imageStats.hpp"
30
31const double DEG_PER_HOUR = 360.0 / 24.0;
32const double DEG_PER_MINUTE = 15.0 / 60.0;
33const double DEG_PER_SECOND = 0.25 / 60.0;
34
35namespace ddt {
36
45 public:
49 ImageCoords(const int image_width, const int image_height,
50 const bool rotate_flag, const bool flip_x_flag,
51 const bool flip_y_flag);
52
56 virtual ~ImageCoords() = default;
57
62 void set_logger(ddt::DdtLogger* const in_logger);
63
73 bool WorldCoordinatesDegreesFromCanvas(const cpl_wcs* const wcs,
74 const double x_canvas,
75 const double y_canvas, double* alpha,
76 double* delta);
77
87 bool CanvasCoordinatesFromWorldCoordinatesDegrees(const cpl_wcs* const wcs,
88 const double alpha,
89 const double delta,
90 double* const x_canvas,
91 double* const y_canvas);
92
103 bool WorldCoordinatesDegreesFromImage(const cpl_wcs* const wcs,
104 const double x_image,
105 const double y_image,
106 double* const alpha,
107 double* const delta) const;
108
119 bool ImageCoordinatesFromWorldCoordinatesDegrees(const cpl_wcs* const wcs,
120 const double alpha,
121 const double delta,
122 double* const x_image,
123 double* const y_image) const;
124
130 const cpl_matrix* WorldCoordinatesCdMatrix(const cpl_wcs* const wcs) const;
131
139 void ConvertCanvasToImage(const double x_canvas, const double y_canvas,
140 double* const x_image, double* const y_image) const;
141
149 void ConvertImageToCanvas(const double x_image, const double y_image,
150 double* const x_canvas,
151 double* const y_canvas) const;
152
157 void set_RotateFlag(const bool rot_flag);
158
163 bool get_RotateFlag() const;
164
169 void set_FlipXFlag(const bool flip_flag);
170
176 bool get_FlipXFlag() const;
177
182 void set_FlipYFlag(const bool flip_flag);
183
189 bool get_FlipYFlag() const;
190
194 int get_ImageWidth() const;
195
200 void set_ImageWidth(const int in_image_width);
201
205 int get_ImageHeight() const;
206
211 void set_ImageHeight(const int in_image_height);
212
219 static std::string RaDegToHMS(double deg);
220
227 static double HMSToRaDeg(const std::string hms);
228
235 static std::string DecDegToDMS(double deg);
236
243 static double DMSToDecDeg(const std::string dms);
244
245 protected:
250
251 private:
255 int image_width;
256
260 int image_height;
261
265 bool rotate_flag;
266
270 bool flip_x_flag;
271
275 bool flip_y_flag;
276
282 bool IsNotFlippedNotRotated() const;
283
289 bool IsNotFlippedRotated() const;
290
296 bool IsXFlippedNotRotated() const;
297
302 bool IsXFlippedRotated() const;
303
309 bool IsYFlippedNotRotated() const;
310
315 bool IsYFlippedRotated() const;
316
322 bool IsXYFlippedNotRotated() const;
323
329 bool IsXYFlippedRotated() const;
330
334 void Init();
335};
336
337} // namespace ddt
338
339#endif /* IMAGECOORDS_HPP */
Definition ddtLogger.hpp:43
void set_ImageHeight(const int in_image_height)
Definition imageCoords.cpp:420
int get_ImageHeight() const
Definition imageCoords.cpp:417
void set_FlipYFlag(const bool flip_flag)
Definition imageCoords.cpp:395
void set_ImageWidth(const int in_image_width)
Definition imageCoords.cpp:412
bool ImageCoordinatesFromWorldCoordinatesDegrees(const cpl_wcs *const wcs, const double alpha, const double delta, double *const x_image, double *const y_image) const
Definition imageCoords.cpp:160
bool get_FlipYFlag() const
Definition imageCoords.cpp:406
bool get_FlipXFlag() const
Definition imageCoords.cpp:403
void set_RotateFlag(const bool rot_flag)
Definition imageCoords.cpp:385
static double HMSToRaDeg(const std::string hms)
Definition imageCoords.cpp:234
void set_FlipXFlag(const bool flip_flag)
Definition imageCoords.cpp:390
const cpl_matrix * WorldCoordinatesCdMatrix(const cpl_wcs *const wcs) const
Definition imageCoords.cpp:200
ddt::DdtLogger * logger
Definition imageCoords.hpp:249
void ConvertImageToCanvas(const double x_image, const double y_image, double *const x_canvas, double *const y_canvas) const
Definition imageCoords.cpp:348
static std::string DecDegToDMS(double deg)
Definition imageCoords.cpp:261
bool WorldCoordinatesDegreesFromCanvas(const cpl_wcs *const wcs, const double x_canvas, const double y_canvas, double *alpha, double *delta)
Definition imageCoords.cpp:36
static std::string RaDegToHMS(double deg)
Definition imageCoords.cpp:209
static double DMSToDecDeg(const std::string dms)
Definition imageCoords.cpp:286
virtual ~ImageCoords()=default
bool CanvasCoordinatesFromWorldCoordinatesDegrees(const cpl_wcs *const wcs, const double alpha, const double delta, double *const x_canvas, double *const y_canvas)
Definition imageCoords.cpp:74
void set_logger(ddt::DdtLogger *const in_logger)
Definition imageCoords.cpp:30
int get_ImageWidth() const
Definition imageCoords.cpp:409
bool WorldCoordinatesDegreesFromImage(const cpl_wcs *const wcs, const double x_image, const double y_image, double *const alpha, double *const delta) const
Definition imageCoords.cpp:117
void ConvertCanvasToImage(const double x_canvas, const double y_canvas, double *const x_image, double *const y_image) const
Definition imageCoords.cpp:310
ImageCoords(const int image_width, const int image_height, const bool rotate_flag, const bool flip_x_flag, const bool flip_y_flag)
Definition imageCoords.cpp:17
bool get_RotateFlag() const
Definition imageCoords.cpp:400
Data acquisition class, offers access to data stream acquisition functions. This file is part of the ...
Data file class, offers access to FITS file functions. This file is part of the DDT Image Handling Li...
Class to wrap the usage of log4cplus as logging utility. This file provides a wrapper class for the u...
const double DEG_PER_HOUR
Definition imageCoords.hpp:31
const double DEG_PER_MINUTE
Definition imageCoords.hpp:32
const double DEG_PER_SECOND
Definition imageCoords.hpp:33
Image error handling function declaration. This file is part of the DDT Image Handling Library and pr...
Image IO function declaration. This file is part of the DDT Image Handling Library and provides funct...
Image processing function declaration. This file is part of the DDT Image Handling Library and provid...
Image analysis and statistic function declaration. This file is part of the DDT Image Handling Librar...
Definition ddtClient.hpp:32