Functions | |
| cpl_image * | cpl_image_new_empty (void) |
| Allocate an empty image structure. More... | |
| cpl_image * | cpl_image_new_double (const int nx, const int ny, const double *pixels, const cpl_image *badpixelmap) |
| Allocate an image structure and pixel buffer for a double image. More... | |
| cpl_image * | cpl_image_new_float (const int nx, const int ny, const float *pixels, const cpl_image *badpixelmap) |
| Allocate an image structure and pixel buffer for a float image. More... | |
| cpl_image * | cpl_image_new_int (const int nx, const int ny, const int *pixels, const cpl_image *badpixelmap) |
| Allocate an image structure and pixel buffer for a integer image. More... | |
| cpl_image * | cpl_image_new_bin (const int nx, const int ny, const cpl_binary *pixels, const cpl_image *badpixelmap) |
| Allocate an image structure and pixel buffer for a cpl_binary image. More... | |
| cpl_image * | cpl_image_load (const char *filename, const cpl_type im_type, const int pnum, const int xtnum) |
| Load an image from a FITS file as a float image. More... | |
| cpl_type | cpl_image_get_type (const cpl_image *img) |
| Get the image type. More... | |
| int | cpl_image_get_nx (const cpl_image *img) |
| Get the image x size. More... | |
| int | cpl_image_get_ny (const cpl_image *img) |
| Get the image y size. More... | |
| void * | cpl_image_get_data (const cpl_image *img) |
| Gets the pixel data. More... | |
| double * | cpl_image_get_data_double (const cpl_image *img) |
| Get the data as a double array. More... | |
| float * | cpl_image_get_data_float (const cpl_image *img) |
| Get the data as a float array. More... | |
| int * | cpl_image_get_data_int (const cpl_image *img) |
| Get the data as a integer array. More... | |
| cpl_binary * | cpl_image_get_data_bin (const cpl_image *img) |
| Get the data as a cpl_binary array. More... | |
| cpl_error_code | cpl_image_set_type (cpl_image *img, const cpl_type type) |
| Sets the type of an image. More... | |
| void | cpl_image_delete (cpl_image *d) |
| Free memory associated to an cpl_image object. More... | |
| void | cpl_image_delete_but_data (cpl_image *d) |
| Free memory associated to an cpl_image object, but the pixel buffer. More... | |
| cpl_error_code | cpl_image_clear (cpl_image *img) |
| Clears an image. More... | |
| cpl_image * | cpl_image_duplicate (const cpl_image *src) |
| Copy an image. More... | |
| cpl_image * | cpl_image_convert (const cpl_image *im, const cpl_type type) |
| convert a cpl_image to a given type. More... | |
| cpl_error_code | cpl_image_resize (cpl_image *img, const int nx, const int ny) |
| Resizes an image. More... | |
| int | cpl_image_is_empty (const cpl_image *img) |
| Check whether an image is empty. More... | |
| cpl_error_code | cpl_image_copy_from_fits (cpl_image *img, const char *filename, int pnum, int xtnum) |
| Fill an image from a FITS file. More... | |
| cpl_error_code | cpl_image_set_badpixel (cpl_image *im, const double a) |
| Set the bad pixels in an image to a fixed value. More... | |
| cpl_error_code | cpl_image_save (const cpl_image *to_save, const char *filename, const int bpp, cpl_plist *pl) |
| Save an image to a FITS file. More... | |
Functions are provided here to load and save images from and to FITS files, to generate empty images or to deallocated an image.
#include "cpl_image_io.h"
|
|
Clears an image.
Possible _cpl_error_code_ set in this function:
|
|
||||||||||||
|
convert a cpl_image to a given type.
Possible _cpl_error_code_ set in this function:
|
|
||||||||||||||||||||
|
Fill an image from a FITS file.
Possible _cpl_error_code_ set in this function:
|
|
|
Free memory associated to an cpl_image object.
|
|
|
Free memory associated to an cpl_image object, but the pixel buffer.
|
|
|
Copy an image.
Possible _cpl_error_code_ set in this function:
|
|
|
Gets the pixel data.
Possible _cpl_error_code_ set in this function:
|
|
|
Get the data as a cpl_binary array.
|
|
|
Get the data as a double array.
Possible _cpl_error_code_ set in this function:
|
|
|
Get the data as a float array.
|
|
|
Get the data as a integer array.
|
|
|
Get the image x size.
|
|
|
Get the image y size.
|
|
|
Get the image type.
|
|
|
Check whether an image is empty.
Possible _cpl_error_code_ set in this function:
|
|
||||||||||||||||||||
|
Load an image from a FITS file as a float image.
The returned image has to be deallocated with cpl_image_delete(). The passed type for the output image can be : CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE or CPL_TYPE_INT. 'xtnum' specifies from which extension the image should be loaded. This could be 0 for the main data section (files without extension), or any number between 1 and N, where N is the number of extensions present in the file. The requested plane number runs from 0 to nplanes-1, where nplanes is the number of planes present in the requested data section. Examples: // Load as a float image the only image in FITS file (a.fits) without ext.
// and NAXIS=2.
cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_FLOAT, 0, 0);
// Load as a double image the first plane in a FITS cube (a.fits) without
// extension, NAXIS=3 and NAXIS3=128
cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_DOUBLE, 0, 0);
// Load as an integer image the third plane in a FITS cube (a.fits) without
// extension, NAXIS=3 and NAXIS3=128
cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_INT, 2, 0);
// Load as a double image the first plane from extension 5
cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_DOUBLE, 0, 5);
// Load as a double image the third plane in extension 5
cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_DOUBLE, 2, 5);
Possible _cpl_error_code_ set in this function:
|
|
||||||||||||||||||||
|
Allocate an image structure and pixel buffer for a cpl_binary image.
|
|
||||||||||||||||||||
|
Allocate an image structure and pixel buffer for a double image.
Possible _cpl_error_code_ set in this function:
|
|
|
Allocate an empty image structure.
|
|
||||||||||||||||||||
|
Allocate an image structure and pixel buffer for a float image.
|
|
||||||||||||||||||||
|
Allocate an image structure and pixel buffer for a integer image.
|
|
||||||||||||||||
|
Resizes an image.
Possible _cpl_error_code_ set in this function:
|
|
||||||||||||||||||||
|
Save an image to a FITS file.
Possible _cpl_error_code_ set in this function:
|
|
||||||||||||
|
Set the bad pixels in an image to a fixed value.
|
|
||||||||||||
|
Sets the type of an image.
Possible _cpl_error_code_ set in this function:
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002