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(), and giraffe_image_get_properties().
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.
The function copies the matrix elements of the source matrix matrix into the pixel buffer of the image image.
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.
The function creates a new image container and an allocates memory for an image of the given dimensions nx, ny. The allocated image is suitable for pixels of type type. The created property list is empty.
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.
The function deallocates the memory used for the image data and all image properties.
Definition at line 189 of file giimage.c.
Referenced by giraffe_extract_spectra(), giraffe_fov_build(), giraffe_fov_clear(), giraffe_image_create(), 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.
The function creates a deep copy of the source image image, i.e. the image data and all properties are copied.
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.
The function returns a reference pointer to the actual image stored in the image container self.
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_localize_spectra(), giraffe_stacking_average(), giraffe_stacking_ksigma(), giraffe_stacking_median(), giraffe_stacking_minmax(), giraffe_subtract_dark(), 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.
The function returns a reference pointer to the properties, i.e. the keyword list stored in the image container self.
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_localize_spectra(), giraffe_rebin_spectra(), giraffe_subtract_dark(), 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.
The function reads the pixel data and the properties for image number position from the file filename into the target image self.
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.
The function reads the pixel data for image number index from the file filename into the target image self. The pixel data type is converted to the target type if necessary. If the pixel data at position index in the file form a data cube, the function loads the plane with the index plane, otherwise plane is ignored.
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.
The function reads the image properties for the image at position position within the file filename and stores them in self.
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.
The function allocates memory for an empty image container.
Definition at line 73 of file giimage.c.
Referenced by giraffe_calibrate_flux(), giraffe_fov_build(), giraffe_image_create(), and giraffe_image_duplicate().
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.
The function pastes the image image into the destination image self at the pixel position given by the coordinates x and y. The coordinates x and y indicate the position of the lower left pixel of image, starting from (0, 0). If clip is set to 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.
The Giraffe image self is written to the file filename. Currently a Giraffe image can only be written as a FITS file with the image data in the primary data unit. The image properties are written/converted to the primary FITS header.
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.
The function copies the pixel data of image into self. The pixel type of the source and the target image must match. If the type do not match the function returns an error.
Definition at line 253 of file giimage.c.
Referenced by giraffe_adjust_scattered_light(), giraffe_bias_remove(), giraffe_calibrate_flux(), giraffe_fov_build(), 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.
The function stores a copy of the property list properties in the image container self.
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(), and giraffe_localize_spectra().