#include <vector>
#include <cpl.h>
Go to the source code of this file.
|
| cpl_vector * | LoadCplVector (const char *file_name, long long extension_number=0) |
| |
| cpl_image * | LoadCplImage (const char *file_name, long long plane_number=0, long long extension_number=0) |
| |
| cpl_image * | CreateCplImage (int width, int height, uint8_t *image_data) |
| |
| cpl_image * | CreateCplImage (int width, int height, std::vector< uint8_t > *image_data) |
| |
| cpl_image * | CreateCplImage (int width, int height, int16_t *image_data) |
| |
| cpl_image * | CreateCplImage (int width, int height, std::vector< int16_t > *image_data) |
| |
| cpl_image * | CreateCplImage (int width, int height, std::vector< int32_t > *image_data) |
| |
| cpl_image * | CreateCplImage (int width, int height, std::vector< float_t > *image_data) |
| |
| cpl_image * | CreateCplImage (int width, int height, std::vector< double_t > *image_data) |
| |
| bool | SaveCplImage (const cpl_image *image, const char *file_name, cpl_propertylist *property_list=nullptr) |
| |
| void | DeleteCplImage (cpl_image *image) |
| |
| void | UnwrapCplImage (cpl_image *image) |
| |
| cpl_type | GetCplImageType (const cpl_image *image) |
| |
| int | GetCplImageExtensions (const char *file_name) |
| |
| cpl_propertylist * | GetCplImagePropertyList (const char *file_name, int position) |
| |
| int | GetCplImagePlanCount (const cpl_propertylist *propertylist) |
| |
| cpl_wcs * | GetCplWcs (const cpl_propertylist *propertylist) |
| |
◆ CreateCplImage() [1/7]
| cpl_image* CreateCplImage |
( |
int |
width, |
|
|
int |
height, |
|
|
int16_t * |
image_data |
|
) |
| |
Creates an image from a vector of 16 bit signed data. Call function DeleteCplImage to deallocate memory afterwards.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
Creates an image from a vector of 16 bit signed data.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
◆ CreateCplImage() [2/7]
| cpl_image* CreateCplImage |
( |
int |
width, |
|
|
int |
height, |
|
|
std::vector< double_t > * |
image_data |
|
) |
| |
Creates an image from a vector of 64 bit double data. Call function UnwrapCplImage to deallocate memory afterwards.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
Creates an image from a vector of 64 bit double data.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
◆ CreateCplImage() [3/7]
| cpl_image* CreateCplImage |
( |
int |
width, |
|
|
int |
height, |
|
|
std::vector< float_t > * |
image_data |
|
) |
| |
Creates an image from a vector of 32 bit float data. Call function UnwrapCplImage to deallocate memory afterwards.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
Creates an image from a vector of 32 bit float data.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
◆ CreateCplImage() [4/7]
| cpl_image* CreateCplImage |
( |
int |
width, |
|
|
int |
height, |
|
|
std::vector< int16_t > * |
image_data |
|
) |
| |
Creates an image from a vector of 16 bit signed data. Call function DeleteCplImage to deallocate memory afterwards.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
Creates an image from a vector of 16 bit signed data.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
◆ CreateCplImage() [5/7]
| cpl_image* CreateCplImage |
( |
int |
width, |
|
|
int |
height, |
|
|
std::vector< int32_t > * |
image_data |
|
) |
| |
Creates an image from a vector of 32 bit signed data. Call function UnwrapCplImage to deallocate memory afterwards.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
Creates an image from a vector of 32 bit signed data.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
◆ CreateCplImage() [6/7]
| cpl_image* CreateCplImage |
( |
int |
width, |
|
|
int |
height, |
|
|
std::vector< uint8_t > * |
image_data |
|
) |
| |
Creates an image from a vector of 8 bit unsigned data. Call function DeleteCplImage to deallocate memory afterwards.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
Creates an image from a vector of 8 bit unsigned data.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
◆ CreateCplImage() [7/7]
| cpl_image* CreateCplImage |
( |
int |
width, |
|
|
int |
height, |
|
|
uint8_t * |
image_data |
|
) |
| |
Creates an image from a vector of 8 bit unsigned data. Call function DeleteCplImage to deallocate memory afterwards.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
Creates an image from a vector of 8 bit unsigned data.
- Parameters
-
| width | the number of columns in the image |
| height | the number of lines in the image |
| image_data | address of the data vector |
- Returns
- newly allocated CPL image or NULL on error
◆ DeleteCplImage()
| void DeleteCplImage |
( |
cpl_image * |
image | ) |
|
Unwraps the image (frees memory associated with the image) and deallocates the pixel buffer
- Parameters
-
◆ GetCplImageExtensions()
| int GetCplImageExtensions |
( |
const char * |
file_name | ) |
|
Get the number of extensions from a CPL image (FITS).
- Parameters
-
| file_name | Filename of the image to check |
- Returns
- the number of extensions in the CPL image, or -1 on error
◆ GetCplImagePlanCount()
| int GetCplImagePlanCount |
( |
const cpl_propertylist * |
propertylist | ) |
|
Get the number of planes as contained in the property list of a CPL image (FITS). The property list has to be loaded from a certain data set contained in a CPL image. The function will return following values depending on the number of axis contained: number of axis: 1: -> 0 number of axis: 2: -> 1 number of axis: 3: -> value of property NAXIS3 number of axis > 3: -> -1
- Parameters
-
| property_list | CPL image property list |
- Returns
- number of planes as contained in the cpl_property_list object, or -1 on error
◆ GetCplImagePropertyList()
| cpl_propertylist* GetCplImagePropertyList |
( |
const char * |
file_name, |
|
|
int |
position |
|
) |
| |
Get the property list from one data set of a CPL image (FITS).
- Parameters
-
| file_name | Filename of the image |
| position | index of the data set (defaults to 0) |
- Returns
- a cpl_property_list object, or NULL on error
◆ GetCplImageType()
| cpl_type GetCplImageType |
( |
const cpl_image * |
image | ) |
|
Get the image type from a CPL image.
- Parameters
-
- Returns
- the image type or CPL_TYPE_INVALID
◆ GetCplWcs()
| cpl_wcs* GetCplWcs |
( |
const cpl_propertylist * |
propertylist | ) |
|
Get the WCS structure created by parsing a CPL property list.
- Parameters
-
| propertylist | the input property list |
- Returns
- the cpl_wcs object, or NULL in case of error.
◆ LoadCplImage()
| cpl_image* LoadCplImage |
( |
const char * |
file_name, |
|
|
long long |
plane_number, |
|
|
long long |
extension_number |
|
) |
| |
Loads an image from a fits file.
- Parameters
-
| file_name | Filename of the image to load |
| plane_number | Plane number in the Data Unit (default 0: first) |
| extension_number | Extension number in the file (default 0: primary HDU) |
- Returns
- newly allocated CPL image or NULL on error
◆ LoadCplVector()
| cpl_vector* LoadCplVector |
( |
const char * |
file_name, |
|
|
long long |
extension_number |
|
) |
| |
This file is part of the DDT Image Handling Library and provides functions to load / save CPL images.
The usage is as follows:
#include "ddt/imageIO.hpp" ... using namespace ddt; Loads a vector from a fits file.
- Parameters
-
| file_name | Filename of the image to load |
| extension_number | Extension number in the file (default 0: primary HDU) |
- Returns
- newly allocated CPL vector or NULL on error
◆ SaveCplImage()
| bool SaveCplImage |
( |
const cpl_image * |
image, |
|
|
const char * |
file_name, |
|
|
cpl_propertylist * |
property_list |
|
) |
| |
Save an image to a fits file.
- Parameters
-
| image | CPL image object |
| file_name | Filename of the file to save to |
| property_list | list of properties to save to the output header |
- Returns
- bool indicating success of saving
◆ UnwrapCplImage()
| void UnwrapCplImage |
( |
cpl_image * |
image | ) |
|
Unwraps the image (frees memory associated with the image, except the pixel buffer). The pixel buffer must subsequently be deallocated.
- Parameters
-