ddt  0.1
imageIO.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 imageIO.hpp
8 // @brief Image IO function declaration.
9 //
10 // This file is part of the DDT Image Handling Library and
11 // provides functions to load / save CPL images.
12 //
13 // @author Christoph Bortlisz, CGI
14 // @since 2020/07/29
15 //
16 
17 #ifndef IMAGEIO_HPP_
18 #define IMAGEIO_HPP_
19 
20 //#include <algorithm>
21 //#include <cctype>
22 #include <vector>
23 
24 //#include <sys/stat.h>
25 
26 #include <cpl.h>
27 
28 // namespace ddt {
29 
48 cpl_vector* LoadCplVector(const char* file_name,
49  long long extension_number = 0);
50 
58 cpl_image* LoadCplImage(const char* file_name, long long plane_number = 0,
59  long long extension_number = 0);
60 
69 cpl_image* CreateCplImage(int width, int height, uint8_t* image_data);
70 
79 cpl_image* CreateCplImage(int width, int height,
80  std::vector<uint8_t>* image_data);
81 
90 cpl_image* CreateCplImage(int width, int height, int16_t* image_data);
91 
100 cpl_image* CreateCplImage(int width, int height,
101  std::vector<int16_t>* image_data);
102 
111 cpl_image* CreateCplImage(int width, int height,
112  std::vector<int32_t>* image_data);
113 
122 cpl_image* CreateCplImage(int width, int height,
123  std::vector<float_t>* image_data);
124 
133 cpl_image* CreateCplImage(int width, int height,
134  std::vector<double_t>* image_data);
135 
143 bool SaveCplImage(const cpl_image* image, const char* file_name,
144  cpl_propertylist* property_list = nullptr);
145 
151 void DeleteCplImage(cpl_image* image);
152 
158 void UnwrapCplImage(cpl_image* image);
159 
165 cpl_type GetCplImageType(const cpl_image* image);
166 
172 int GetCplImageExtensions(const char* file_name);
173 
180 cpl_propertylist* GetCplImagePropertyList(const char* file_name, int position);
181 
193 int GetCplImagePlanCount(const cpl_propertylist* propertylist);
194 
200 cpl_wcs* GetCplWcs(const cpl_propertylist* propertylist);
201 
202 //} // namespace ddt
203 
204 #endif /* IMAGEIO_HPP_ */
LoadCplVector
cpl_vector * LoadCplVector(const char *file_name, long long extension_number=0)
Definition: imageIO.cpp:41
SaveCplImage
bool SaveCplImage(const cpl_image *image, const char *file_name, cpl_propertylist *property_list=nullptr)
Definition: imageIO.cpp:196
UnwrapCplImage
void UnwrapCplImage(cpl_image *image)
Definition: imageIO.cpp:238
CreateCplImage
cpl_image * CreateCplImage(int width, int height, uint8_t *image_data)
Definition: imageIO.cpp:67
DeleteCplImage
void DeleteCplImage(cpl_image *image)
Definition: imageIO.cpp:213
GetCplWcs
cpl_wcs * GetCplWcs(const cpl_propertylist *propertylist)
Definition: imageIO.cpp:305
GetCplImageExtensions
int GetCplImageExtensions(const char *file_name)
Definition: imageIO.cpp:254
LoadCplImage
cpl_image * LoadCplImage(const char *file_name, long long plane_number=0, long long extension_number=0)
Definition: imageIO.cpp:53
GetCplImagePropertyList
cpl_propertylist * GetCplImagePropertyList(const char *file_name, int position)
Definition: imageIO.cpp:264
GetCplImageType
cpl_type GetCplImageType(const cpl_image *image)
Definition: imageIO.cpp:245
GetCplImagePlanCount
int GetCplImagePlanCount(const cpl_propertylist *propertylist)
Definition: imageIO.cpp:279