Giraffe Images
Functions | |
GiImage * | giraffe_image_new (cpl_type type) |
Creates an empty image container. | |
GiImage * | giraffe_image_create (cpl_type type, cxint nx, cxint ny) |
Creates an image container of a given type. | |
GiImage * | giraffe_image_duplicate (const GiImage *self) |
Creates a copy of an image. | |
void | giraffe_image_delete (GiImage *self) |
Destroys an image. | |
cpl_image * | giraffe_image_get (const GiImage *self) |
Gets the image data. | |
cxint | giraffe_image_set (GiImage *self, cpl_image *image) |
Sets the image data. | |
cpl_propertylist * | giraffe_image_get_properties (const GiImage *self) |
Get the properties of an image. | |
cxint | giraffe_image_set_properties (GiImage *self, cpl_propertylist *properties) |
Attaches a property list to an image. | |
cxint | giraffe_image_copy_matrix (GiImage *self, cpl_matrix *matrix) |
Copies matrix elements into an image. | |
cxint | giraffe_image_load_pixels (GiImage *self, const cxchar *filename, cxint position, cxint plane) |
Gets image data from a file. | |
cxint | giraffe_image_load_properties (GiImage *self, const cxchar *filename, cxint position) |
Gets image properties from a file. | |
cxint | giraffe_image_load (GiImage *self, const cxchar *filename, cxint position) |
Gets image data and properties from a file. | |
cxint | giraffe_image_save (GiImage *self, const cxchar *filename) |
Write a Giraffe image to a file. | |
cxint | giraffe_image_paste (GiImage *self, const GiImage *image, cxint x, cxint y, cxbool clip) |
Paste an image into another at a given position. | |
void | giraffe_image_print (GiImage *self) |
Prints status information about a Giraffe image. | |
cxint | giraffe_image_add_info (GiImage *image, const GiRecipeInfo *info, const cpl_frameset *set) |
Add additional frame information to an image. |
Detailed Description
The module implements an Giraffe image type which inherits the cpl_image type and extends it by a property list to allow for storing image meta data together with its associated image. A pointer to a Giraffe image can be cast into a pointer to a cpl_image.Function Documentation
cxint giraffe_image_add_info | ( | GiImage * | image, | |
const GiRecipeInfo * | info, | |||
const cpl_frameset * | set | |||
) |
Add additional frame information to an image.
TBD
Definition at line 777 of file giimage.c.
References giraffe_add_frameset_info(), giraffe_add_recipe_info(), giraffe_image_get_properties(), and GiRecipeInfo::sequence.
cxint giraffe_image_copy_matrix | ( | GiImage * | self, | |
cpl_matrix * | matrix | |||
) |
Copies matrix elements into an image.
- Parameters:
-
self The image to which the matrix elements are copied. matrix The matrix whose elements will be copied.
- Returns:
- The function returns 0 on success, or 1 otherwise.
Definition at line 354 of file giimage.c.
Referenced by giraffe_compute_fiber_profiles(), and giraffe_localize_spectra().
GiImage* giraffe_image_create | ( | cpl_type | type, | |
cxint | nx, | |||
cxint | ny | |||
) |
Creates an image container of a given type.
- Parameters:
-
nx Dimension in X direction ny Dimension in Y direction type Pixel type
- Returns:
- The newly created image.
Definition at line 103 of file giimage.c.
References giraffe_image_delete(), and giraffe_image_new().
Referenced by giraffe_compute_fiber_profiles(), giraffe_extract_spectra(), giraffe_localize_spectra(), giraffe_stacking_average(), giraffe_stacking_ksigma(), giraffe_stacking_median(), and giraffe_stacking_minmax().
void giraffe_image_delete | ( | GiImage * | self | ) |
Destroys an image.
- Parameters:
-
self The image to destroy.
Definition at line 189 of file giimage.c.
Referenced by giraffe_extract_spectra(), giraffe_fov_build(), giraffe_fov_clear(), giraffe_image_create(), giraffe_integrate_flux(), and giraffe_rebinning_destroy().
GiImage* giraffe_image_duplicate | ( | const GiImage * | self | ) |
Creates a copy of an image.
- Parameters:
-
self The image to copy.
- Returns:
- Pointer to the newly allocated image.
Definition at line 147 of file giimage.c.
References giraffe_image_new().
Referenced by giraffe_fov_build().
cpl_image* giraffe_image_get | ( | const GiImage * | self | ) |
Gets the image data.
- Parameters:
-
self Image to query.
- Returns:
- Pointer to the container's image data.
Definition at line 227 of file giimage.c.
Referenced by giraffe_adjust_scattered_light(), giraffe_bias_remove(), giraffe_calibrate_flux(), giraffe_calibrate_wavelength(), giraffe_compute_fiber_profiles(), giraffe_extract_spectra(), giraffe_fov_build(), giraffe_frame_create_image(), giraffe_image_paste(), giraffe_integrate_flux(), giraffe_localize_spectra(), giraffe_stacking_average(), giraffe_stacking_ksigma(), giraffe_stacking_median(), giraffe_stacking_minmax(), giraffe_subtract_dark(), giraffe_transmission_apply(), giraffe_transmission_compute(), giraffe_trim_raw_areas(), and giraffe_wlsolution_create().
cpl_propertylist* giraffe_image_get_properties | ( | const GiImage * | self | ) |
Get the properties of an image.
- Parameters:
-
self Image to query.
- Returns:
- Pointer to the image properties stored in the container.
Definition at line 291 of file giimage.c.
Referenced by giraffe_add_rvcorrection(), giraffe_adjust_scattered_light(), giraffe_bias_remove(), giraffe_calibrate_flux(), giraffe_calibrate_wavelength(), giraffe_compute_fiber_profiles(), giraffe_extract_spectra(), giraffe_fov_build(), giraffe_frame_create_image(), giraffe_get_raw_areas(), giraffe_grating_create(), giraffe_grating_setup(), giraffe_image_add_info(), giraffe_integrate_flux(), giraffe_localize_spectra(), giraffe_rebin_spectra(), giraffe_select_flux_standard(), giraffe_subtract_dark(), giraffe_transmission_compute(), giraffe_trim_raw_areas(), and giraffe_wlsolution_create().
cxint giraffe_image_load | ( | GiImage * | self, | |
const cxchar * | filename, | |||
cxint | position | |||
) |
Gets image data and properties from a file.
- Parameters:
-
self Giraffe image. filename File from which the pixel data and properties are read. position Image index within the file
- Returns:
- The function returns 0 on success or 1 in case the pixel data or the image properties could not be loaded.
In case the file contains a data cube at position position the plane number 0 is loaded.
Definition at line 540 of file giimage.c.
References giraffe_image_load_pixels(), and giraffe_image_load_properties().
cxint giraffe_image_load_pixels | ( | GiImage * | self, | |
const cxchar * | filename, | |||
cxint | position, | |||
cxint | plane | |||
) |
Gets image data from a file.
- Parameters:
-
self Image into which the data is read. filename File from which the pixel data is read. position Image index within the file. plane Plane index within a data cube.
- Returns:
- The function returns 0 on success or 1 in case the pixel data could not be loaded.
Definition at line 460 of file giimage.c.
Referenced by giraffe_image_load().
cxint giraffe_image_load_properties | ( | GiImage * | self, | |
const cxchar * | filename, | |||
cxint | position | |||
) |
Gets image properties from a file.
- Parameters:
-
self Giraffe image filename File from which the properties are read position Image index within the file
- Returns:
- The function returns 0 on success or 1 in case the image properties could not be loaded.
If there are already properties associated to an image they will be replaced by calling this function.
Definition at line 497 of file giimage.c.
Referenced by giraffe_image_load().
GiImage* giraffe_image_new | ( | cpl_type | type | ) |
Creates an empty image container.
- Returns:
- Pointer to the newly created image container.
Definition at line 73 of file giimage.c.
Referenced by giraffe_calibrate_flux(), giraffe_fov_build(), giraffe_image_create(), giraffe_image_duplicate(), and giraffe_integrate_flux().
cxint giraffe_image_paste | ( | GiImage * | self, | |
const GiImage * | image, | |||
cxint | x, | |||
cxint | y, | |||
cxbool | clip | |||
) |
Paste an image into another at a given position.
- Parameters:
-
self The destination image. image The source image. x Pixel offset along the x-axis. y Pixel offset along the y-axis. clip Flag controlling the image clipping.
- Returns:
- The function returns 0 on success or a non-zero value if an error occurred.
true
, the image image is properly clipped, if parts of image would fall outside of the destination image because of the given coordinates x and y. If clip is false
and the source image does not fit entirely into the destination image the function fails and the error code CPL_ERROR_ACCESS_OUT_RANGE
is set.
Definition at line 657 of file giimage.c.
References giraffe_image_get().
void giraffe_image_print | ( | GiImage * | self | ) |
cxint giraffe_image_save | ( | GiImage * | self, | |
const cxchar * | filename | |||
) |
Write a Giraffe image to a file.
- Parameters:
-
self Giraffe image to write. filename File to which self is written.
- Returns:
- The function returns 0 on success and 1 otherwise.
Definition at line 574 of file giimage.c.
Referenced by giraffe_frame_create_image().
cxint giraffe_image_set | ( | GiImage * | self, | |
cpl_image * | image | |||
) |
Sets the image data.
- Parameters:
-
self The image to store the data. image The source image the data is taken from.
- Returns:
- The function returns 0 on success, or 1 in case of errors.
Definition at line 253 of file giimage.c.
Referenced by giraffe_adjust_scattered_light(), giraffe_bias_remove(), giraffe_calibrate_flux(), giraffe_fov_build(), giraffe_integrate_flux(), and giraffe_trim_raw_areas().
cxint giraffe_image_set_properties | ( | GiImage * | self, | |
cpl_propertylist * | properties | |||
) |
Attaches a property list to an image.
- Parameters:
-
self Image the properties will be attached to. properties Property list to attach.
- Returns:
- The function returns 0 on success, or 1 otherwise.
If there is already a property list stored in the container self, it is replaced with the reference properties. If the properties cannot be copied, the function returns an error.
Definition at line 321 of file giimage.c.
Referenced by giraffe_adjust_scattered_light(), giraffe_bias_remove(), giraffe_calibrate_flux(), giraffe_compute_fiber_profiles(), giraffe_extract_spectra(), giraffe_fov_build(), giraffe_integrate_flux(), and giraffe_localize_spectra().