ifw-odp
2.0.0-alpha
|
#include <cpl.h>
Go to the source code of this file.
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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). More... | |
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. More... | |
cpl_image * | clipm_priv_image_extract_round (const cpl_image *input, const cpl_size *window_xxyy) |
Extract an image window and round to integer. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
cpl_error_code | clipm_priv_image_save_debug (const cpl_image *img, const char *filename) |
Write an image to disk and print a message. More... | |
void | clipm_priv_image_null (cpl_image **i) |
Delete a CPL image object and set the pointer to NULL. More... | |
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 |