ddt  0.1
imageHelpers.hpp
Go to the documentation of this file.
1 // @copyright
2 // (c) Copyright ESO 2020
3 // All Rights Reserved
4 // ESO (eso.org) is an Intergovernmental Organization, and therefore special
5 // legal conditions apply.
6 //
7 // @file imageHelpers.hpp
8 // @brief Helper function declaration.
9 //
10 // This file is part of the DDT Image Handling Library and
11 // provides helper functions for handling of CPL images.
12 //
13 // @author Christoph Bortlisz, CGI
14 // @since 2020/07/29
15 //
16 
17 #ifndef IMAGEHELPERS_HPP_
18 #define IMAGEHELPERS_HPP_
19 
20 //#include <algorithm>
21 //#include <cctype>
22 #include <tuple>
23 #include <vector>
24 
25 //#include <sys/stat.h>
26 
27 #include <cpl.h>
28 
29 // namespace ddt {
30 
40 std::vector<int> SubarrayLineInt(cpl_image *image, std::tuple<int, int> start,
41  std::tuple<int, int> end);
42 
47 std::vector<int> SubarrayLineInt(cpl_image *image, int x0, int y0, int x1,
48  int y1);
49 
54 std::vector<double> SubarrayLineDouble(cpl_image *image, int x0, int y0,
55  const int x1, const int y1);
56 
60 std::vector<std::vector<int>> SubarrayRectInt(cpl_image *image,
61  std::tuple<int, int> start,
62  std::tuple<int, int> end);
63 
68 std::vector<std::vector<int>> SubarrayRectInt(cpl_image *image, int llx,
69  int lly, int urx, int ury);
70 
74 cpl_image *SubImageRect(cpl_image *image, std::tuple<int, int> start,
75  std::tuple<int, int> end);
76 
80 cpl_image *SubImageRect(cpl_image *image, int llx, int lly, int urx, int ury);
81 
89 cpl_image *SubImageRectOutside(const cpl_image *const image, const int llx,
90  const int lly, const int urx, const int ury);
91 
103 cpl_image *SubImageCircular(const cpl_image *const image, const int xcenter,
104  const int ycenter, const int radius);
105 
117 cpl_image *SubImageCircularOutside(const cpl_image *const image,
118  const int xcenter, const int ycenter,
119  const int radius);
120 
133 double PixelDistance(const double startx, const double starty,
134  const double endx, const double endy,
135  double *const xoffset = nullptr,
136  double *const yoffset = nullptr);
137 
152 double PixelDistanceDegrees(const cpl_propertylist *const property_list,
153  const double startx, const double starty,
154  const double endx, const double endy,
155  double *const xoffsetdeg, double *const yoffsetdeg);
156 
161 double PixelToDegreesScalingFactor(const cpl_propertylist *const property_list);
162 
169 std::string ConvertDegreesToString(double deg);
170 
171 //} // namespace ddt
172 
173 #endif /* IMAGEHELPERS_HPP_ */
PixelToDegreesScalingFactor
double PixelToDegreesScalingFactor(const cpl_propertylist *const property_list)
Definition: imageHelpers.cpp:336
ConvertDegreesToString
std::string ConvertDegreesToString(double deg)
Definition: imageHelpers.cpp:360
SubarrayLineInt
std::vector< int > SubarrayLineInt(cpl_image *image, std::tuple< int, int > start, std::tuple< int, int > end)
Definition: imageHelpers.cpp:30
SubImageCircularOutside
cpl_image * SubImageCircularOutside(const cpl_image *const image, const int xcenter, const int ycenter, const int radius)
Definition: imageHelpers.cpp:265
SubImageRectOutside
cpl_image * SubImageRectOutside(const cpl_image *const image, const int llx, const int lly, const int urx, const int ury)
Definition: imageHelpers.cpp:197
PixelDistance
double PixelDistance(const double startx, const double starty, const double endx, const double endy, double *const xoffset=nullptr, double *const yoffset=nullptr)
Definition: imageHelpers.cpp:298
SubImageCircular
cpl_image * SubImageCircular(const cpl_image *const image, const int xcenter, const int ycenter, const int radius)
Definition: imageHelpers.cpp:226
SubarrayRectInt
std::vector< std::vector< int > > SubarrayRectInt(cpl_image *image, std::tuple< int, int > start, std::tuple< int, int > end)
Definition: imageHelpers.cpp:121
SubImageRect
cpl_image * SubImageRect(cpl_image *image, std::tuple< int, int > start, std::tuple< int, int > end)
Definition: imageHelpers.cpp:169
PixelDistanceDegrees
double PixelDistanceDegrees(const cpl_propertylist *const property_list, const double startx, const double starty, const double endx, const double endy, double *const xoffsetdeg, double *const yoffsetdeg)
Definition: imageHelpers.cpp:313
SubarrayLineDouble
std::vector< double > SubarrayLineDouble(cpl_image *image, int x0, int y0, const int x1, const int y1)
Definition: imageHelpers.cpp:83