|
ifw-odp 5.0.0
|
#include "ifw/odp/clipm/clipm_priv_image.h"#include "ifw/odp/clipm/clipm_math.h"#include "ifw/odp/clipm/clipm_math_correlation.h"#include "ifw/odp/clipm/clipm_priv_checks.h"#include "ifw/odp/clipm/clipm_compatibility_replacements.h"#include "ifw/odp/clipm/clipm_priv_error.h"#include "ifw/odp/clipm/clipm_priv_math.h"#include "ifw/odp/clipm/clipm_priv_matrix.h"#include "ifw/odp/clipm/clipm_priv_vector.h"Macros | |
| #define | clipm_priv_image_get_nearest_good_BODY(TYPE) |
| #define | clipm_priv_image_bpm_reject_above_BODY( TYPE) |
| #define | clipm_priv_image_copy_good_data_vector_BODY( TYPE) |
| #define | clipm_COPY_WINDOW_TO_BUFFER( OUT_CTYPE, INTYPE) |
| #define | clipm_priv_image_extract_SWITCH_INTYPE(OUT_CTYPE) |
| #define | clipm_priv_image_extract_round_BODY(INTYPE) |
| #define | clipm_priv_image_fill_BODY( TYPE) |
| #define | clipm_image_fill_circle_BODY( TYPE) |
| #define | clipm_priv_image_fill_polygon_BODY( TYPE) |
Functions | |
| cpl_image * | clipm_priv_image_wrap (const cpl_size *size, cpl_type type, void *data) |
| Create an image by wrapping it around an existing data buffer. | |
| double | clipm_priv_image_get_nearest_good (const cpl_image *image, double x, double y, cpl_size *out_x, cpl_size *out_y) |
| Return closest pixel which is not flagged as bad. | |
| const cpl_binary * | clipm_priv_image_bpm_get_if_exist (const cpl_image *image) |
| Return bad pixel mask data, if there are bad pixels, otherwise NULL. | |
| cpl_error_code | clipm_priv_image_bpm_or (cpl_image *mod_image, const cpl_image *ref_image) |
| Perform a logical OR between the bad pixel masks of 2 images. | |
| cpl_error_code | clipm_priv_image_bpm_border_bad (cpl_image *image, cpl_size left, cpl_size right, cpl_size lower, cpl_size upper) |
| Mark the border of an image as bad. | |
| cpl_error_code | clipm_priv_image_bpm_reject_above (cpl_image *image, const cpl_size *window_xxyy, double limit) |
| Reject all pixels equal to or greater than a limit. | |
| cpl_vector * | clipm_priv_image_copy_good_data_vector (const cpl_image *image, const cpl_size *window_xxyy, cpl_size *out_ngood) |
| Copy all non-bad pixels into a new vector of appropriate size. | |
| cpl_error_code | clipm_priv_image_get_data_const (const cpl_image *image, const cpl_size *window_xxyy, int allow_window_NULL, cpl_size *img_size_xy, cpl_size *window_size_xy, cpl_size *buffer_start_xy, cpl_type *type, const void **data_start, const cpl_binary **badp_start) |
| Get image and window sizes, and data pointers to image (window). | |
| cpl_image * | clipm_priv_image_extract_cast (const cpl_image *input, const cpl_size *window_xxyy, cpl_type outtype) |
| Extract an image window and cast into a new image. | |
| cpl_image * | clipm_priv_image_extract_round (const cpl_image *input, const cpl_size *window_xxyy) |
| Extract an image window and round to integer. | |
| cpl_error_code | clipm_priv_image_fill (cpl_image *image, const cpl_size *window_xxyy, double value) |
| Apply a value to all pixels inside the image or a window of the image. | |
| cpl_error_code | clipm_priv_image_fill_circle (cpl_image *img_modified, double centre_xy[2], double radius, double brightness, int anti_alias, int additive) |
| Fill a circle. | |
| cpl_error_code | clipm_priv_image_fill_polygon (cpl_image *image, const cpl_matrix *points, double brightness, int anti_alias, int additive) |
| Fill a polygon. | |
| cpl_error_code | clipm_priv_image_fill_rectangle (cpl_image *image, const double centre_xy[2], double angle, const double size_lw[2], double brightness, int anti_alias, int additive) |
| Fill a rectangle. | |
| cpl_error_code | clipm_priv_image_save_debug (const cpl_image *img, const char *filename) |
| Write an image to disk and print a message. | |
| void | clipm_priv_image_null (cpl_image **i) |
| Delete a CPL image object and set the pointer to NULL. | |
| #define clipm_COPY_WINDOW_TO_BUFFER | ( | OUT_CTYPE, | |
| INTYPE ) |
| #define clipm_image_fill_circle_BODY | ( | TYPE | ) |
| #define clipm_priv_image_bpm_reject_above_BODY | ( | TYPE | ) |
| #define clipm_priv_image_copy_good_data_vector_BODY | ( | TYPE | ) |
| #define clipm_priv_image_extract_round_BODY | ( | INTYPE | ) |
| #define clipm_priv_image_extract_SWITCH_INTYPE | ( | OUT_CTYPE | ) |
| #define clipm_priv_image_fill_BODY | ( | TYPE | ) |
| #define clipm_priv_image_fill_polygon_BODY | ( | TYPE | ) |
| #define clipm_priv_image_get_nearest_good_BODY | ( | TYPE | ) |
| cpl_error_code clipm_priv_image_bpm_border_bad | ( | cpl_image * | image, |
| cpl_size | left, | ||
| cpl_size | right, | ||
| cpl_size | lower, | ||
| cpl_size | upper ) |
Mark the border of an image as bad.
| image | Image to modify |
| left | Left border width |
| right | Right border width |
| lower | Lower border width |
| upper | Upper border width |
| const cpl_binary * clipm_priv_image_bpm_get_if_exist | ( | const cpl_image * | image | ) |
Return bad pixel mask data, if there are bad pixels, otherwise NULL.
| image | Input image |
| cpl_error_code clipm_priv_image_bpm_or | ( | cpl_image * | mod_image, |
| const cpl_image * | ref_image ) |
Perform a logical OR between the bad pixel masks of 2 images.
| mod_image | Image to modify |
| ref_image | Reference image |
| cpl_error_code clipm_priv_image_bpm_reject_above | ( | cpl_image * | image, |
| const cpl_size * | window_xxyy, | ||
| double | limit ) |
Reject all pixels equal to or greater than a limit.
| image | Image to modify |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
| limit | Limit |
| cpl_vector * clipm_priv_image_copy_good_data_vector | ( | const cpl_image * | image, |
| const cpl_size * | window_xxyy, | ||
| cpl_size * | out_ngood ) |
Copy all non-bad pixels into a new vector of appropriate size.
| image | Input image |
| window_xxyy | Coordinate buffer of the form {x1a, x1b, y1a, y1b}, minimum/maximum order is irrelevant |
| out_ngood | (Optional output) number of good pixels, contains 0 in the case of error |
| cpl_image * clipm_priv_image_extract_cast | ( | const cpl_image * | input, |
| const cpl_size * | window_xxyy, | ||
| cpl_type | outtype ) |
Extract an image window and cast into a new image.
| input | Input image (FITS convention) |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
| outtype | Output image type |
| cpl_image * clipm_priv_image_extract_round | ( | const cpl_image * | input, |
| const cpl_size * | window_xxyy ) |
Extract an image window and round to integer.
| input | Input image (FITS convention) |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
| cpl_error_code clipm_priv_image_fill | ( | cpl_image * | image, |
| const cpl_size * | window_xxyy, | ||
| double | value ) |
Apply a value to all pixels inside the image or a window of the image.
| image | The image to draw into (FITS convention) |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
| value | The value to be set (true or false) |
| cpl_error_code clipm_priv_image_fill_circle | ( | cpl_image * | img_modified, |
| double | centre_xy[2], | ||
| double | radius, | ||
| double | brightness, | ||
| int | anti_alias, | ||
| int | additive ) |
Fill a circle.
| img_modified | The image to draw into |
| centre_xy | Centre position (double buffer of length 2 [x, y]) |
| radius | The circle's radius |
| brightness | The circle's content value |
| anti_alias | Flag whether to soften the edge |
| additive | Flag whether to add the circle on top of the existing image content (additive != 0), or whether to set the area to the brightness value |
| cpl_error_code clipm_priv_image_fill_polygon | ( | cpl_image * | image, |
| const cpl_matrix * | points, | ||
| double | brightness, | ||
| int | anti_alias, | ||
| int | additive ) |
Fill a polygon.
| image | The image to draw into |
| points | 2xN corner point matrix |
| brightness | The polygon's content value |
| anti_alias | Flag whether to soften the edge |
| additive | Flag whether to add the circle on top of the existing image content (additive != 0), or whether to set the area to the brightness value |
| cpl_error_code clipm_priv_image_fill_rectangle | ( | cpl_image * | image, |
| const double | centre_xy[2], | ||
| double | angle, | ||
| const double | size_lw[2], | ||
| double | brightness, | ||
| int | anti_alias, | ||
| int | additive ) |
Fill a rectangle.
| image | The image to draw into |
| centre_xy | Centre coordinate as (x,y) tuple |
| angle | Orientation |
| size_lw | Length and width as a data tuple, the first entry (size_lw[0]) will point into the direction of angle |
| brightness | The polygon's content value |
| anti_alias | Flag whether to soften the edge |
| additive | Flag whether to add the circle on top of the existing image content (additive != 0), or whether to set the area to the brightness value |
| cpl_error_code clipm_priv_image_get_data_const | ( | const cpl_image * | image, |
| const cpl_size * | window_xxyy, | ||
| int | allow_window_NULL, | ||
| cpl_size * | img_size_xy, | ||
| cpl_size * | window_size_xy, | ||
| cpl_size * | buffer_start_xy, | ||
| cpl_type * | type, | ||
| const void ** | data_start, | ||
| const cpl_binary ** | badp_start ) |
Get image and window sizes, and data pointers to image (window).
| image | Image (FITS convention) |
| window_xxyy | Coordinate buffer of the form {x1a, x1b, y1a, y1b}, minimum/maximum order is irrelevant |
| allow_window_NULL | If !0, then no error is set if (window==NULL) |
| img_size_xy | (Optional) buffer of size 2, to which the image size [x, y] is put out, can be NULL |
| window_size_xy | (Optional) buffer of size 2, to which the window size is determined and written, can be NULL |
| buffer_start_xy | (Optional) buffer of size 2, to which the lower left window indices are written (buffer, not FITS), starting at 0, can be NULL |
| type | (Optional) output CPL-type of image |
| data_start | (Optional) output pointer to image data, if window_xxyy is given, then it points to the lower left corner of the data |
| badp_start | (Optional) output bad pixel map pointer, returns NULL if no bad pixels are set, if window_xxyy is given, then it points to the lower left corner of the data |
| double clipm_priv_image_get_nearest_good | ( | const cpl_image * | image, |
| double | x, | ||
| double | y, | ||
| cpl_size * | out_x, | ||
| cpl_size * | out_y ) |
Return closest pixel which is not flagged as bad.
| image | Input image |
| x | X position (FITS convention) |
| y | Y position (FITS convention) |
| out_x | (Optional output) x index of found pixel (FITS convention) |
| out_y | (Optional output) y index of found pixel (FITS convention) |
| void clipm_priv_image_null | ( | cpl_image ** | i | ) |
Delete a CPL image object and set the pointer to NULL.
| i | Pointer to image pointer |
The following code is executed:
| cpl_error_code clipm_priv_image_save_debug | ( | const cpl_image * | img, |
| const char * | filename ) |
Write an image to disk and print a message.
| img | |
| filename |
| cpl_image * clipm_priv_image_wrap | ( | const cpl_size * | size, |
| cpl_type | type, | ||
| void * | data ) |
Create an image by wrapping it around an existing data buffer.
| size | Buffer of size 2, containing the image size [x, y], can be NULL |
| type | Either CPL_TYPE_INT, CPL_TYPE_FLOAT, or CPL_TYPE_DOUBLE |
| data | The data buffer of the specified type and size |