Functions | |
void | cpl_imagelist_delete (cpl_imagelist *imlist) |
Free memory associated to a cpl_imagelist object. | |
cpl_error_code | cpl_imagelist_dump_structure (const cpl_imagelist *self, FILE *stream) |
Dump structural information of images in an imagelist. | |
cpl_error_code | cpl_imagelist_dump_window (const cpl_imagelist *self, int llx, int lly, int urx, int ury, FILE *stream) |
Dump pixel values of images in a CPL imagelist. | |
cpl_imagelist * | cpl_imagelist_duplicate (const cpl_imagelist *imlist) |
Copy an image list. | |
cpl_error_code | cpl_imagelist_erase (cpl_imagelist *imlist, const cpl_vector *valid) |
Reject one or more images in a list according to an array of flags. | |
cpl_image * | cpl_imagelist_get (cpl_imagelist *imlist, int inum) |
Get an image from a list of images. | |
const cpl_image * | cpl_imagelist_get_const (const cpl_imagelist *imlist, int inum) |
Get an image from a list of images. | |
int | cpl_imagelist_get_size (const cpl_imagelist *imlist) |
Get the number of images in the imagelist. | |
int | cpl_imagelist_is_uniform (const cpl_imagelist *imlist) |
Determine if an imagelist contains images of equal size and type. | |
cpl_imagelist * | cpl_imagelist_load (const char *filename, cpl_type type, int extnum) |
Load a FITS file extension into a list of images. | |
cpl_imagelist * | cpl_imagelist_load_window (const char *filename, cpl_type type, int extnum, int llx, int lly, int urx, int ury) |
Load images windows from a FITS file extension into an image list. | |
cpl_imagelist * | cpl_imagelist_new (void) |
Create an empty imagelist. | |
cpl_error_code | cpl_imagelist_save (const cpl_imagelist *imlist, const char *filename, cpl_type_bpp bpp, const cpl_propertylist *pl, unsigned mode) |
Save an imagelist to disk in FITS format. | |
cpl_error_code | cpl_imagelist_set (cpl_imagelist *imlist, cpl_image *im, int pos) |
Insert an image into an imagelist. | |
cpl_image * | cpl_imagelist_unset (cpl_imagelist *self, int pos) |
Remove an image from an imagelist. |
#include "cpl_imagelist_io.h"
void cpl_imagelist_delete | ( | cpl_imagelist * | imlist | ) |
Free memory associated to a cpl_imagelist object.
imlist | the image list |
NULL
, nothing is done, and no error is set.
cpl_error_code cpl_imagelist_dump_structure | ( | const cpl_imagelist * | self, | |
FILE * | stream | |||
) |
Dump structural information of images in an imagelist.
self | Imagelist to dump | |
stream | Output stream, accepts stdout or stderr |
cpl_error_code cpl_imagelist_dump_window | ( | const cpl_imagelist * | self, | |
int | llx, | |||
int | lly, | |||
int | urx, | |||
int | ury, | |||
FILE * | stream | |||
) |
Dump pixel values of images in a CPL imagelist.
self | Imagelist to dump | |
llx | Specifies the window position | |
lly | Specifies the window position | |
urx | Specifies the window position | |
ury | Specifies the window position | |
stream | Output stream, accepts stdout or stderr |
cpl_imagelist* cpl_imagelist_duplicate | ( | const cpl_imagelist * | imlist | ) |
Copy an image list.
imlist | Source image list. |
Possible _cpl_error_code_ set in this function:
cpl_error_code cpl_imagelist_erase | ( | cpl_imagelist * | imlist, | |
const cpl_vector * | valid | |||
) |
Reject one or more images in a list according to an array of flags.
imlist | Non-empty imagelist to examine for image rejection. | |
valid | Vector of flags (>=-0.5: valid, <-0.5: invalid) |
Images flagged as invalid are removed from the list.
The removal of image(s) will reduce the length of the list accordingly.
Possible _cpl_error_code_ set in this function:
cpl_image* cpl_imagelist_get | ( | cpl_imagelist * | imlist, | |
int | inum | |||
) |
Get an image from a list of images.
imlist | the image list | |
inum | the image id (from 0 to number of images-1) |
Possible _cpl_error_code_ set in this function:
const cpl_image* cpl_imagelist_get_const | ( | const cpl_imagelist * | imlist, | |
int | inum | |||
) |
Get an image from a list of images.
imlist | the image list | |
inum | the image id (from 0 to number of images-1) |
int cpl_imagelist_get_size | ( | const cpl_imagelist * | imlist | ) |
Get the number of images in the imagelist.
imlist | the list of image |
int cpl_imagelist_is_uniform | ( | const cpl_imagelist * | imlist | ) |
Determine if an imagelist contains images of equal size and type.
imlist | The imagelist to check |
Possible _cpl_error_code_ set in this function:
cpl_imagelist* cpl_imagelist_load | ( | const char * | filename, | |
cpl_type | type, | |||
int | extnum | |||
) |
Load a FITS file extension into a list of images.
filename | The FITS file name | |
type | Type of the images in the created image list | |
extnum | The extension number |
Type can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT or CPL_TYPE_INT. The loaded images have an empty bad pixel map.
The returned cpl_imagelist must be deallocated using cpl_imagelist_delete()
Possible _cpl_error_code_ set in this function:
cpl_imagelist* cpl_imagelist_load_window | ( | const char * | filename, | |
cpl_type | type, | |||
int | extnum, | |||
int | llx, | |||
int | lly, | |||
int | urx, | |||
int | ury | |||
) |
Load images windows from a FITS file extension into an image list.
filename | The FITS file name | |
type | Type of the images in the created image list | |
extnum | The extension number | |
llx | Specifies the window position | |
lly | Specifies the window position | |
urx | Specifies the window position | |
ury | Specifies the window position |
Type can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT or CPL_TYPE_INT.
The window position is specified starting with 1 to the number of pixel. Lower left pixel is (1, 1).
The returned cpl_imagelist must be deallocated using cpl_imagelist_delete()
Possible _cpl_error_code_ set in this function:
cpl_imagelist* cpl_imagelist_new | ( | void | ) |
Create an empty imagelist.
cpl_error_code cpl_imagelist_save | ( | const cpl_imagelist * | imlist, | |
const char * | filename, | |||
cpl_type_bpp | bpp, | |||
const cpl_propertylist * | pl, | |||
unsigned | mode | |||
) |
Save an imagelist to disk in FITS format.
imlist | Imagelist to save | |
filename | Name of the FITS file to write | |
bpp | Bits per pixels | |
pl | Property list for the output header or NULL | |
mode | The desired output options (combined with bitwise or) |
The requested pixel depth (bpp) follows the FITS convention. Possible values are CPL_BPP_8_UNSIGNED (8), CPL_BPP_16_SIGNED (16), CPL_BPP_16_UNSIGNED (-16), CPL_BPP_32_SIGNED (32), CPL_BPP_IEEE_FLOAT (-32), CPL_BPP_IEEE_DOUBLE (-64)
In the case of CPL_BPP_16_UNSIGNED, the BITPIX stays 16, the data are stored as signed (32768 is subtracted to the images) and BZERO is set to 32768 as specified by the FITS standard.
Supported image lists types are CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT.
Supported output modes are CPL_IO_CREATE (create a new file) and CPL_IO_EXTEND (append to an existing file)
If you are in append mode, make sure that the file has writing permissions. You may have problems if you create a file in your application and append something to it with the umask set to 222. In this case, the file created by your application would not be writable, and the append would fail.
Possible _cpl_error_code_ set in this function:
cpl_error_code cpl_imagelist_set | ( | cpl_imagelist * | imlist, | |
cpl_image * | im, | |||
int | pos | |||
) |
Insert an image into an imagelist.
imlist | The imagelist | |
im | The image to insert | |
pos | The list position (from 0 to number of images) |
It is allowed to specify the position equal to the number of images in the list. This will increment the size of the imagelist.
No action occurs if an image is inserted more than once into the same position. It is not allowed to insert the same image into two different positions in a list.
It is not allowed to insert images of different size into a list.
You should not deallocate the image after it has been inserted into an imagelist, since the cpl_imagelist_delete() will deallocate its images.
Possible _cpl_error_code_ set in this function:
cpl_image* cpl_imagelist_unset | ( | cpl_imagelist * | self, | |
int | pos | |||
) |
Remove an image from an imagelist.
self | The imagelist | |
pos | The list position (from 0 to number of images-1) |
Possible _cpl_error_code_ set in this function: