![]() |
温暖的遥控器 · 在Swift中获取特定的json数据_Swi ...· 6 月前 · |
![]() |
霸气的毛衣 · bcprov-jdk15-1.46.jar ...· 8 月前 · |
![]() |
爱喝酒的牛肉面 · c#(c++/c ...· 11 月前 · |
![]() |
酒量大的莲藕 · 4.2. 课: 创建动态打印布局 — ...· 11 月前 · |
![]() |
面冷心慈的李子 · 【枣庄丰田FCV-R最新报价】枣庄丰田FCV ...· 1 年前 · |
This module provides functions to create, use, and destroy a
cpl_image
. A
cpl_image
is a 2-dimensional data structure with a pixel type (one of
CPL_TYPE_INT
,
CPL_TYPE_FLOAT
,
CPL_TYPE_DOUBLE
,
CPL_TYPE_FLOAT_COMPLEX
or
CPL_TYPE_DOUBLE_COMPLEX
) and an optional bad pixel map.
The pixel indexing follows the FITS convention in the sense that the lower left pixel in a CPL image has index (1, 1). The pixel buffer is stored row-wise so for optimum performance any pixel-wise access should be done likewise.
Functionality include: FITS I/O Image arithmetic, casting, extraction, thresholding, filtering, resampling Bad pixel handling Image statistics Generation of test images Special functions, such as the image quality estimator
Usage: define the following preprocessor symbols as needed, then include this file
The special values that can be rejected They are a bit-field and can be combined with bitwise or.
Enumerator CPL_VALUE_NANNot-a-Number (NaN)
CPL_VALUE_PLUSINFPlus Infinity
CPL_VALUE_MINUSINFMinus Infinity
CPL_VALUE_ZEROZero
CPL_VALUE_INFInfinity with any sign
CPL_VALUE_NOTFINITENaN or infinity with any sign
Set each pixel to its absolute value.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_image_abs_create() , cpl_image_fill_jacobian() , and cpl_image_fill_jacobian_polynomial() .
For each pixel, out = abs(in). The returned image must be deallocated using cpl_image_delete() .
References cpl_ensure , cpl_error_get_code() , cpl_image_abs() , cpl_image_delete() , and cpl_image_duplicate() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_NONE , and CPL_ERROR_NULL_INPUT .
Possible _cpl_error_code_ set in this function:
References CPL_ERROR_NONE , cpl_image_unset_bpm() , and cpl_mask_delete() .
Referenced by cpl_detector_interpolate_rejected() , cpl_geom_img_offset_saa() , and cpl_imagelist_collapse_create() .
The first input image is modified to contain the result of the operation.
The bad pixel map of the first image becomes the union of the bad pixel maps of the input images.
Possible _cpl_error_code_ set in this function:
Referenced by cpl_image_fill_test_create() , and cpl_imagelist_collapse_create() .
Creates a new image, being the result of the operation, and returns it to the caller. The returned image must be deallocated using cpl_image_delete() . The function supports images with different types among CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. The returned image type is the one of the first passed image.
The bad pixels map of the result is the union of the bad pixels maps of the input images.
Possible _cpl_error_code_ set in this function:
Modifies the image by adding a number to each of its pixels.
The operation is always performed in double precision, with a final cast of the result to the image pixel type.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and cpl_image_get_type() .
Referenced by cpl_image_add_scalar_create() , cpl_image_new_from_accepted() , and cpl_imagelist_add_scalar() .
Creates a new image, being the result of the operation, and returns it to the caller. The returned image must be deallocated using cpl_image_delete() . The function supports images with different types among CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. The type of the created image is that of the passed image.
References cpl_ensure , cpl_error_get_code() , cpl_image_add_scalar() , cpl_image_delete() , and cpl_image_duplicate() .
selfPre-allocated image to hold the result firstFirst operand, or NULL for an in-place operation secondSecond operandPossible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , cpl_type_get_name() , cpl_type_get_sizeof() , and CPL_TYPE_INT .
selfPre-allocated image to hold the result firstFirst operand, or NULL for an in-place operation secondSecond operand (scalar)Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , cpl_type_get_name() , cpl_type_get_sizeof() , and CPL_TYPE_INT .
Builds the average of two images and returns a newly allocated image, to be deallocated using cpl_image_delete() . The average is arithmetic, i.e. outpix=(pix1+pix2)/2 Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , cpl_mask_duplicate() , and cpl_mask_or() .
Casting to non-complex types is only supported for non-complex types.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , CPL_ERROR_TYPE_MISMATCH , cpl_free() , cpl_image_duplicate() , cpl_malloc() , cpl_mask_duplicate() , CPL_TYPE_DOUBLE , CPL_TYPE_DOUBLE_COMPLEX , CPL_TYPE_FLOAT , CPL_TYPE_FLOAT_COMPLEX , cpl_type_get_name() , cpl_type_get_sizeof() , CPL_TYPE_INT , and CPL_TYPE_INVALID .
Referenced by cpl_image_fit_gaussian() , cpl_imagelist_cast() , cpl_plot_image() , cpl_plot_image_col() , and cpl_plot_image_row() .
On success the function returns a 1D image, created by adding up all pixels on the same row or column.
Collapse along y (sum of rows): p7 p8 p9 Input image is a 3x3 image containing 9 pixels. p4 p5 p6 The output is an image containing one row with p1 p2 p3 3 pixels A, B, C, where: ---------- A B C A = p1+p4+p7 B = p2+p5+p8 C = p3+p6+p9 If p7 is a bad pixel, A = (p1+p4)*3/2. If p1, p4, p7 are bad, A is flagged as bad.
Provide the collapsing direction as an int. Give 0 to collapse along y (sum of rows) and get an image with a single row in output, or give 1 to collapse along x (sum of columns) to get an image with a single column in output. Only the good pixels are collapsed. Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The returned image must be deallocated using cpl_image_delete() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , cpl_error_get_code() , cpl_image_collapse_window_create() , cpl_image_get_size_x() , and cpl_image_get_size_y() .
selfInput image to collapse. directionCollapsing direction. drop_llIgnore this many lower rows/leftmost columns drop_urIgnore this many upper rows/rightmost columnsThe collapsing direction is defined as for cpl_image_collapse_create() . For each output pixel, the median of the corresponding non-ignored pixels is computed. A combination of bad pixels and drop parameters can cause a median value in the output image to be undefined. Such pixels will be flagged as bad and set to zero.
If the output would contain only bad pixels an error is set.
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The returned image must be deallocated using cpl_image_delete() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , and CPL_ERROR_NULL_INPUT .
llx, lly, urx, ury are the image region coordinates in FITS convention. Those specified bounds are included in the collapsed region.
Possible _cpl_error_code_ set in this function:
References cpl_image_get_type() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , and CPL_TYPE_INT .
Referenced by cpl_image_collapse_create() .
Any bad pixels are also conjugated.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_ERROR_TYPE_MISMATCH , CPL_TYPE_DOUBLE_COMPLEX , and CPL_TYPE_FLOAT_COMPLEX .
im1the image in which im2 is inserted im2the inserted image xposthe x pixel position in im1 where the lower left pixel of im2 should go (from 1 to the x size of im1) yposthe y pixel position in im1 where the lower left pixel of im2 should go (from 1 to the y size of im1)(xpos, ypos) must be a valid position in im1. If im2 is bigger than the place left in im1, the part that falls outside of im1 is simply ignored, an no error is raised. The bad pixels are inherited from im2 in the concerned im1 zone.
The two input images must be of the same type, namely one of CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_ERROR_TYPE_MISMATCH , cpl_image_get_data() , cpl_image_get_size_x() , cpl_image_get_size_y() , cpl_image_get_type() , cpl_mask_copy() , cpl_mask_delete() , cpl_mask_new() , and cpl_type_get_sizeof() .
Referenced by cpl_image_filter_mask() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_NULL_INPUT , and cpl_mask_count() .
Frees all memory associated with a cpl_image. If the passed image is NULL, the function returns without doing anything.
References cpl_free() , and cpl_mask_delete() .
Referenced by cpl_apertures_extract_mask() , cpl_apertures_extract_window() , cpl_fit_image_gaussian() , cpl_geom_img_offset_fine() , cpl_geom_img_offset_saa() , cpl_image_abs_create() , cpl_image_add_scalar_create() , cpl_image_divide_create() , cpl_image_divide_scalar_create() , cpl_image_exponential_create() , cpl_image_fill_jacobian() , cpl_image_fill_test_create() , cpl_image_filter_linear() , cpl_image_filter_median() , cpl_image_filter_morpho() , cpl_image_filter_stdev() , cpl_image_fit_gaussian() , cpl_image_iqe() , cpl_image_logarithm_create() , cpl_image_multiply_scalar_create() , cpl_image_normalise_create() , cpl_image_power_create() , cpl_image_subtract_scalar_create() , cpl_imagelist_cast() , cpl_imagelist_collapse_create() , cpl_imagelist_empty() , cpl_imagelist_erase() , cpl_imagelist_load_frameset() , cpl_imagelist_set() , cpl_plot_image() , cpl_plot_image_col() , and cpl_plot_image_row() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_DIVISION_BY_ZERO , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_ERROR_TYPE_MISMATCH , cpl_mask_delete() , cpl_mask_duplicate() , cpl_mask_get_data() , cpl_mask_new() , cpl_mask_or() , CPL_TYPE_DOUBLE , CPL_TYPE_DOUBLE_COMPLEX , CPL_TYPE_FLOAT , CPL_TYPE_FLOAT_COMPLEX , and CPL_TYPE_INT .
Referenced by cpl_imagelist_collapse_create() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_DIVISION_BY_ZERO , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , CPL_ERROR_TYPE_MISMATCH , cpl_free() , cpl_image_delete() , cpl_image_wrap_double() , cpl_image_wrap_double_complex() , cpl_image_wrap_float() , cpl_image_wrap_float_complex() , cpl_image_wrap_int() , cpl_malloc() , cpl_mask_delete() , cpl_mask_duplicate() , cpl_mask_get_data() , cpl_mask_new() , cpl_mask_or() , CPL_TYPE_DOUBLE , CPL_TYPE_DOUBLE_COMPLEX , CPL_TYPE_FLOAT , CPL_TYPE_FLOAT_COMPLEX , and CPL_TYPE_INT .
Modifies the image by dividing each of its pixels with a number.
If the scalar is zero the image is not modified and an error is returned.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_DIVISION_BY_ZERO , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and cpl_image_get_type() .
Referenced by cpl_image_divide_scalar_create() , cpl_image_fft() , cpl_image_normalise() , and cpl_imagelist_divide_scalar() .
References cpl_ensure , cpl_error_get_code() , cpl_image_delete() , cpl_image_divide_scalar() , and cpl_image_duplicate() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_FILE_IO , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_mask_count() , CPL_SIZE_FORMAT , and cpl_type_get_name() .
Referenced by cpl_imagelist_dump_structure() .
selfImage to dump llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxSpecifies the window position urySpecifies the window position streamOutput stream, accepts
stdout
or
stderr
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_FILE_IO , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get() , cpl_image_get_complex() , cpl_mask_get() , cpl_mask_is_empty() , CPL_SIZE_FORMAT , CPL_TYPE_DOUBLE_COMPLEX , CPL_TYPE_FLOAT_COMPLEX , and CPL_TYPE_INT .
Referenced by cpl_imagelist_dump_window() .
Copy an image into a new image object. The pixels and the bad pixel map are also copied. The returned image must be deallocated using cpl_image_delete() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_NULL_INPUT , cpl_malloc() , cpl_mask_duplicate() , and cpl_type_get_sizeof() .
Referenced by cpl_geom_img_offset_saa() , cpl_image_abs_create() , cpl_image_add_scalar_create() , cpl_image_cast() , cpl_image_divide_scalar_create() , cpl_image_exponential_create() , cpl_image_logarithm_create() , cpl_image_multiply_scalar_create() , cpl_image_normalise_create() , cpl_image_power_create() , cpl_image_subtract_scalar_create() , cpl_imagelist_collapse_create() , and cpl_imagelist_duplicate() .
Modifies the image by computing the base-scalar exponential of each of its pixels.
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Pixels for which the power of the given base is not defined are rejected and set to zero.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , cpl_type_get_name() , and CPL_TYPE_INT .
Referenced by cpl_image_exponential_create() , and cpl_imagelist_exponential() .
The input coordinates define the extracted region by giving the coordinates of the lower left and upper right corners (inclusive).
Coordinates must be provided in the FITS convention: lower left corner of the image is at (1,1), x increasing from left to right, y increasing from bottom to top. Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
If the input image has a bad pixel map and if the extracted rectangle has bad pixel(s), then the extracted image will have a bad pixel map, otherwise it will not.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_apertures_extract_window() , cpl_fit_image_gaussian() , and cpl_image_iqe() .
step represents the sampling step in x and y: both steps = 2 will create an image with a quarter of the pixels of the input image.
image type can be CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. If the image has bad pixels, they will be resampled in the same way.
The flux of the sampled pixels will be preserved, while the flux of the pixels not sampled will be lost. Using steps = 2 in each direction on a uniform image will thus create an image with a quarter of the flux.
The returned image must be deallocated using cpl_image_delete() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , and cpl_mask_extract_subsample() .
img_realThe image real part to be transformed in place img_imagThe image imaginary part to be transformed in place modeThe desired FFT options (combined with bitwise or)The input images must be of double type.
If the second passed image is NULL, the resulting imaginary part cannot be returned. This can be useful if the input is real and the output is known to also be real. But if the output has a significant imaginary part, you might want to pass a 0-valued image as the second parameter.
Any rejected pixel is used as if it were a good pixel.
The image must be square with a size that is a power of two.
These are the supported FFT modes: CPL_FFT_DEFAULT: Default, forward FFT transform CPL_FFT_INVERSE: Inverse FFT transform CPL_FFT_UNNORMALIZED: Do not normalize (with N*N for N-by-N image) on inverse. Has no effect on forward transform. CPL_FFT_SWAP_HALVES: Swap the four quadrants of the result image.
Possible _cpl_error_code_ set in this function:
References cpl_calloc() , cpl_ensure_code , cpl_error_get_code() , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_ERROR_UNSUPPORTED_MODE , cpl_free() , cpl_image_divide_scalar() , cpl_image_move() , and CPL_TYPE_DOUBLE .
im_absPre-allocated image to hold the absolute part, or
NULL
im_argPre-allocated image to hold the argument part, or
NULL
selfComplex image to process
Any bad pixels are also processed.
Possible _cpl_error_code_ set in this function:
NULL
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_TYPE_COMPLEX , CPL_TYPE_DOUBLE_COMPLEX , and CPL_TYPE_FLOAT_COMPLEX .
imathe gaussian image to generate xcenx position of the center (1 for the first pixel) yceny position of the center (1 for the first pixel) normnorm of the gaussian. sig_xSigma in x for the gaussian distribution. sig_ySigma in y for the gaussian distribution.This function expects an already allocated image. This function generates an image of a 2d gaussian. The gaussian is defined by the position of its centre, given in pixel coordinates inside the image with the FITS convention (x from 1 to nx, y from 1 to ny), its norm and the value of sigma in x and y.
f(x, y) = (norm/(2*pi*sig_x*sig_y)) * exp(-(x-xcen)^2/(2*sig_x^2)) * exp(-(y-ycen)^2/(2*sig_y^2))
The input image type can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_image_fill_test_create() .
The shifts images deltax and deltay , describing the transformation, must be of type CPL_TYPE_DOUBLE and of the same size as out . For each pixel (u, v) of the out image, the deltax and deltay code the following transformation:
This function writes the density of the (u, v) coordinate system relative to the (x, y) coordinates for each (u, v) pixel of image out .
This is trivially obtained by computing the absolute value of the determinant of the Jacobian of the transformation for each pixel of the (u, v) image out .
The partial derivatives are estimated at the position (u, v) in the following way:
Typically this function would be used to determine a flux-conservation factor map for the target image specified in function
cpl_image_warp()
. For example,
where out_flux_corrected is the resampled image out after correction for flux conservation.
Possible _cpl_error_code_ set in this function:
References CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_ERROR_UNSPECIFIED , cpl_image_abs() , cpl_image_delete() , cpl_image_get_data_double() , cpl_image_get_data_double_const() , cpl_image_get_data_float() , cpl_image_get_size_x() , cpl_image_get_size_y() , cpl_image_get_type() , cpl_image_new() , CPL_TYPE_DOUBLE , and CPL_TYPE_FLOAT .
outPre-allocated image to hold the result poly_xDefines source x-pos corresponding to destination (u,v). poly_yDefines source y-pos corresponding to destination (u,v).Given an input image with pixel coordinates (x, y) which is mapped into an output image with pixel coordinates (u, v), and the polynomial inverse transformation (u, v) to (x, y) as in cpl_image_warp_polynomial() , this function writes the density of the (u, v) coordinate system relative to the (x, y) coordinates for each (u, v) pixel of image out .
This is trivially obtained by computing the absolute value of the determinant of the Jacobian of the transformation for each pixel of the (u, v) image out .
Typically this function would be used to determine a flux-conservation factor map for the target image specified in function
cpl_image_warp_polynomial()
. For example,
where out_flux_corrected is the resampled image out after correction for flux conservation.
Possible _cpl_error_code_ set in this function:
References CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_ERROR_UNSPECIFIED , cpl_image_abs() , cpl_image_get_data_double() , cpl_image_get_data_float() , cpl_image_get_size_x() , cpl_image_get_size_y() , cpl_image_get_type() , cpl_polynomial_delete() , cpl_polynomial_derivative() , cpl_polynomial_duplicate() , cpl_polynomial_eval() , cpl_polynomial_get_dimension() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , cpl_vector_delete() , cpl_vector_get_data() , and cpl_vector_new() .
Generate an image with a uniform random noise distribution. Pixel values are within the provided bounds. This function expects an already allocated image. The input image type can be CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_image_fill_test_create() .
imathe polynomial image to generate polythe 2d polynomial startxthe x value associated with the left pixels column stepxthe x step startythe y value associated with the bottom pixels row stepythe y stepThis function expects an already allocated image. The pixel value of the pixel (i, j) is set to poly(startx+(i-1)*stepx, starty+(j-1)*stepy).
The input image type can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
If you want to generate an image whose pixel values are the values of the polynomial applied to the pixel positions, just call cpl_image_fill_polynomial(ima, poly, 1.0, 1.0, 1.0, 1.0);
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and cpl_polynomial_get_dimension() .
im_realPre-allocated image to hold the real part, or
NULL
im_imagPre-allocated image to hold the imaginary part, or
NULL
selfComplex image to process
Any bad pixels are also processed.
Possible _cpl_error_code_ set in this function:
NULL
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_TYPE_COMPLEX , CPL_TYPE_DOUBLE_COMPLEX , and CPL_TYPE_FLOAT_COMPLEX .
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT, CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_mask_get_data() , and cpl_mask_is_empty() .
Referenced by cpl_geom_img_offset_saa() , and cpl_imagelist_collapse_create() .
Generates a reference pattern for testing purposes only. The created image has to be deallocated with cpl_image_delete() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , cpl_image_add() , cpl_image_delete() , cpl_image_fill_gaussian() , cpl_image_fill_noise_uniform() , cpl_image_multiply_scalar() , cpl_image_new() , and CPL_TYPE_DOUBLE .
selfThe image to fill llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxSpecifies the window position urySpecifies the window position valueThe value to fill withPossible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and CPL_TYPE_COMPLEX .
selfPre-allocated image to hold the filtered result otherImage to filter kernelPixel weigths filterCPL_FILTER_LINEAR, CPL_FILTER_MORPHO borderCPL_BORDER_FILTERThe two images must have equal dimensions.
The kernel must have an odd number of rows and an odd number of columns and at least one non-zero element.
For scaling filters (
CPL_FILTER_LINEAR_SCALE
and
CPL_FILTER_MORPHO_SCALE
) the flux of the filtered image will be scaled with the sum of the weights of the kernel. If for a given input pixel location the kernel covers only bad pixels, the filtered pixel value is flagged as bad and set to zero.
For flux-preserving filters (
CPL_FILTER_LINEAR
and
CPL_FILTER_MORPHO
) the filtered pixel must have at least one input pixel with a non-zero weight available. Output pixels where this is not the case are set to zero and flagged as bad.
In-place filtering is not supported.
Supported filters:
CPL_FILTER_LINEAR
,
CPL_FILTER_MORPHO
,
CPL_FILTER_LINEAR_SCALE
,
CPL_FILTER_MORPHO_SCALE
.
Supported borders modes:
CPL_BORDER_FILTER
Beware that the 1st pixel - at (1,1) - in an image is the lower left, while the 1st element in a matrix - at (0,0) - is the top left. Thus to shift an image 1 pixel up and 1 pixel right with the CPL_FILTER_LINEAR and a 3 by 3 kernel, one should set to 1.0 the bottom leftmost matrix element which is at row 3, column 1, i.e.
Possible _cpl_error_code_ set in this function:
References CPL_BORDER_CROP , CPL_BORDER_FILTER , cpl_ensure_code , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_DIVISION_BY_ZERO , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_ERROR_UNSUPPORTED_MODE , CPL_FILTER_LINEAR , CPL_FILTER_LINEAR_SCALE , CPL_FILTER_MORPHO , CPL_FILTER_MORPHO_SCALE , cpl_image_get_data() , cpl_image_get_data_const() , cpl_image_get_size_x() , cpl_image_get_size_y() , cpl_image_get_type() , cpl_mask_get_data() , cpl_mask_get_data_const() , cpl_mask_is_empty() , cpl_mask_wrap() , cpl_matrix_get_data_const() , cpl_matrix_get_ncol() , cpl_matrix_get_nrow() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , cpl_type_get_sizeof() , and CPL_TYPE_INT .
Referenced by cpl_image_filter_linear() , and cpl_image_filter_morpho() .
References CPL_BORDER_FILTER , cpl_ensure , CPL_ERROR_NULL_INPUT , CPL_FILTER_LINEAR , cpl_image_delete() , cpl_image_filter() , and cpl_image_new() .
selfPre-allocated image to hold the filtered result otherImage to filter kernelPixels to use, if set to CPL_BINARY_1 filterCPL_FILTER_MEDIAN, CPL_FILTER_AVERAGE and more, see below borderCPL_BORDER_FILTER and more, see belowThe kernel must have an odd number of rows and an odd number of columns.
The two images must have equal dimensions, except for the border mode CPL_BORDER_CROP, where the input image must have 2 * hx columns more and 2 * hy rows more than the output image, where the kernel has size (1 + 2 * hx, 1 + 2 * hy).
In standard deviation filtering the kernel must have at least two elements set to CPL_BINARY_1, for others at least one element must be set to CPL_BINARY_1.
Supported pixel types are: CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE.
In median filtering the two images must have the same pixel type.
In standard deviation filtering a filtered pixel must be computed from at least two input pixels, for other filters at least one input pixel must be available. Output pixels where this is not the case are set to zero and flagged as rejected.
In-place filtering is not supported.
Supported modes:
CPL_FILTER_MEDIAN: CPL_BORDER_FILTER, CPL_BORDER_COPY, CPL_BORDER_NOP, CPL_BORDER_CROP.
CPL_FILTER_AVERAGE: CPL_BORDER_FILTER
CPL_FILTER_AVERAGE_FAST: CPL_BORDER_FILTER
CPL_FILTER_STDEV: CPL_BORDER_FILTER
CPL_FILTER_STDEV_FAST: CPL_BORDER_FILTER
To shift an image 1 pixel up and 1 pixel right with the CPL_FILTER_MEDIAN filter and a 3 by 3 kernel, one should set to CPL_BINARY_1 the bottom leftmost kernel element - at row 3, column 1, i.e.
The kernel required to do a 5 x 5 median filtering is created like this:
Possible _cpl_error_code_ set in this function:
References CPL_BORDER_CROP , CPL_BORDER_FILTER , cpl_ensure_code , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_DATA_NOT_FOUND , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , CPL_ERROR_TYPE_MISMATCH , CPL_ERROR_UNSUPPORTED_MODE , CPL_FILTER_AVERAGE , CPL_FILTER_AVERAGE_FAST , CPL_FILTER_MEDIAN , CPL_FILTER_STDEV , CPL_FILTER_STDEV_FAST , cpl_image_copy() , cpl_image_get_data() , cpl_image_get_data_const() , cpl_image_get_size_x() , cpl_image_get_size_y() , cpl_image_get_type() , cpl_mask_get_data() , cpl_mask_get_data_const() , cpl_mask_get_size_x() , cpl_mask_get_size_y() , cpl_mask_is_empty() , cpl_mask_wrap() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , cpl_type_get_sizeof() , and CPL_TYPE_INT .
Referenced by cpl_geom_img_offset_fine() , cpl_image_filter_median() , cpl_image_filter_stdev() , and cpl_vector_filter_median_create() .
References CPL_BORDER_FILTER , cpl_ensure , cpl_error_get_code() , CPL_ERROR_NULL_INPUT , CPL_FILTER_MEDIAN , cpl_image_delete() , cpl_image_filter_mask() , cpl_image_new() , and cpl_mask_delete() .
References CPL_BORDER_FILTER , cpl_ensure , CPL_ERROR_NULL_INPUT , CPL_FILTER_MORPHO , cpl_image_delete() , cpl_image_filter() , and cpl_image_new() .
References CPL_BORDER_FILTER , cpl_ensure , cpl_error_get_code() , CPL_ERROR_NULL_INPUT , CPL_FILTER_STDEV , cpl_image_delete() , cpl_image_filter_mask() , cpl_image_new() , cpl_mask_delete() , cpl_mask_get_size_x() , and cpl_mask_get_size_y() .
imthe input image xposthe x position of the center (1 for the first pixel) yposthe y position of the center (1 for the first pixel) sizethe window size in pixels, at least 4 normthe norm of the gaussian or NULL xcenthe x center of the gaussian or NULL ycenthe y center of the gaussian or NULL sig_xthe semi-major axis of the gaussian or NULL sig_ythe semi-minor axis of the gaussian or NULL fwhm_xthe FHHM in x or NULL fwhm_ythe FHHM in y or NULLThis function is only acceptable for determining the position of a peak.
References cpl_bivector_delete() , cpl_bivector_get_x_data() , cpl_ensure_code , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_cast() , cpl_image_delete() , cpl_image_get_type() , cpl_image_iqe() , CPL_MATH_2PI , CPL_MATH_FWHM_SIG , and CPL_TYPE_FLOAT .
This function operates locally on the pixel buffer.
angle can take one of the following values:
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and cpl_mask_flip() .
imageInput image. xposPixel x position (FITS convention, 1 for leftmost) yposPixel y position (FITS convention, 1 for lowest) pis_rejected1 if the pixel is bad, 0 if good, negative on errorIf the pixel is flagged as bad, 0.0 is returned.
In case of an error, the _cpl_error_code_ code is set.
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , and CPL_TYPE_COMPLEX .
Referenced by cpl_fit_image_gaussian() , cpl_image_dump_window() , and cpl_image_get_fwhm() .
imageinput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention)The returned pointer refers to already allocated data. If the bad pixel map is NULL, an empty one is created.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_NULL_INPUT , and cpl_mask_new() .
Referenced by cpl_geom_img_offset_saa() , and cpl_image_reject_from_mask() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_detector_interpolate_rejected() , cpl_fit_image_gaussian() , cpl_fit_imagelist_polynomial_window() , cpl_geom_img_offset_saa() , cpl_image_new_from_accepted() , cpl_imagelist_cast() , cpl_imagelist_collapse_create() , cpl_imagelist_empty() , cpl_imagelist_erase() , cpl_imagelist_set() , and cpl_mask_threshold_image() .
imageinput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention)If the pixel is flagged as bad, 0.0 is returned.
In case of an error, the _cpl_error_code_ code is set.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_INVALID_TYPE , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_image_dump_window() .
The returned pointer refers to already allocated data.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_detector_interpolate_rejected() , cpl_image_copy() , cpl_image_filter() , and cpl_image_filter_mask() .
The returned pointer refers to already allocated data.
The pixels are stored in a one dimensional array. The pixel value PIXVAL at position (i, j) in the image - (0, 0) is the lower left pixel, i gives the column position from left to right, j gives the row position from bottom to top - is given by : PIXVAL = array[i + j*nx]; where nx is the x size of the image and array is the data array returned by this function. array can be used to access or modify the pixel value in the image.
Possible _cpl_error_code_ set in this function:
Referenced by cpl_image_fill_jacobian() , cpl_image_fill_jacobian_polynomial() , and cpl_plot_image() .
Referenced by cpl_fit_image_gaussian() , cpl_image_fill_jacobian() , cpl_image_warp() , cpl_plot_image() , cpl_plot_image_col() , and cpl_plot_image_row() .
Referenced by cpl_image_fill_jacobian() , cpl_image_fill_jacobian_polynomial() , and cpl_image_iqe() .
Referenced by cpl_image_labelise_mask_create() , and cpl_imagelist_collapse_sigclip_create() .
References cpl_ensure , CPL_ERROR_NULL_INPUT , and cpl_image_get_flux_window() .
Referenced by cpl_image_normalise() .
imageinput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention)Referenced by cpl_image_get_flux() .
inthe input image xposthe x position of the object (1 for the first pixel) yposthe y position of the object (1 for the first pixel) fwhm_xthe computed FWHM in x or -1 on error fwhm_ythe computed FWHM in y or -1 on errorThis function uses a basic method: start from the center of the object and go away until the half maximum value is reached in x and y.
For the FWHM in x (resp. y) to be computed, the image size in the x (resp. y) direction should be at least of 5 pixels.
If for any reason, one of the FHWMs cannot be computed, its returned value is -1.0, but an error is not necessarily raised. For example, if a 4 column image is passed, the fwhm_x would be -1.0, the fwhm_y would be correctly computed, and no error would be raised.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_DATA_NOT_FOUND , cpl_error_get_code() , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_errorstate_get() , cpl_errorstate_is_equal() , cpl_image_get() , cpl_vector_delete() , cpl_vector_new_from_image_column() , and cpl_vector_new_from_image_row() .
Referenced by cpl_apertures_get_fwhm() .
sourceInterpolation source xposPixel x floating-point position (FITS convention) yposPixel y floating-point position (FITS convention) xprofileInterpolation weight as a function of the distance in X xradiusPositive inclusion radius in the X-dimension yprofileInterpolation weight as a function of the distance in Y yradiusPositive inclusion radius in the Y-dimension pconfidConfidence level of the interpolated value (range 0 to 1)This function interpolates a single pixel value as a weighted average of its neigbors, specified as being inside a circle or ellipse with the distance dependent weights provided by the caller.
If the X- and Y-radii are identical the area of inclusion is a circle, otherwise it is an ellipse, with the larger of the two radii as the semimajor axis and the other as the semiminor axis.
The radii are only required to be positive. However, for small radii, especially radii less than 1/sqrt(2), (xpos, ypos) may be located such that no source pixels are included in the interpolation, causing the interpolated pixel value to be undefined.
The X- and Y-profiles can be generated with cpl_vector_fill_kernel_profile(profile, radius). For profiles generated with cpl_vector_fill_kernel_profile() it is important to use the same radius both there and in cpl_image_get_interpolated() .
A good profile length is CPL_KERNEL_DEF_SAMPLES, using radius CPL_KERNEL_DEF_WIDTH.
On error *pconfid is negative (unless pconfid is NULL). Otherwise, if *pconfid is zero, the interpolated pixel-value is undefined. Otherwise, if *pconfid is less than 1, the area of inclusion is close to the image border or contains rejected pixels.
The input image type can be CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE.
Here is an example of a simple image unwarping (with error-checking omitted for brevity):
Possible _cpl_error_code_ set in this function:
References cpl_ensure , cpl_error_get_code() , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , cpl_image_get_size_x() , cpl_image_get_size_y() , cpl_mask_get_data_const() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , CPL_TYPE_INT , cpl_vector_get_data_const() , and cpl_vector_get_size() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_NULL_INPUT , cpl_stats_get_mad() , cpl_stats_get_median() , and CPL_STATS_MAD .
imageInput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention) sigmaThe median of the absolute median deviation of the good pixelsFor each non-bad pixel in the window the absolute deviation from the median is computed. The median of these absolute deviations in returned via sigma, while the median itself is returned by the function.
If the pixels are gaussian, the computed sigma is a robust and consistent estimate of the standard deviation in the sense that the standard deviation is approximately k * MAD, where k is a constant equal to approximately 1.4826. CPL defines CPL_MATH_STD_MAD as this scaling constant.
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE. On error the _cpl_error_code_ code is set and the return value is undefined.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_NULL_INPUT , cpl_stats_get_mad() , cpl_stats_get_median() , and CPL_STATS_MAD .
imageinput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention)References cpl_ensure_code , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_stats_get_max_x() , cpl_stats_get_max_y() , and CPL_STATS_MAXPOS .
Referenced by cpl_fit_image_gaussian() .
imageInput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention) pxptr to the x coordinate of the maximum position pyptr to the y coordinate of the maximum positionReferences cpl_ensure_code , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_stats_get_max_x() , cpl_stats_get_max_y() , and CPL_STATS_MAXPOS .
imageinput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention)In case of error, the _cpl_error_code_ code is set, and the returned double is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
Referenced by cpl_fit_image_gaussian() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_NULL_INPUT , cpl_stats_get_median() , cpl_stats_get_median_dev() , and CPL_STATS_MEDIAN_DEV .
Referenced by cpl_apertures_extract_sigma() .
imageInput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention) sigmaThe mean of the absolute median deviation of the (good) pixelsFor each non-bad pixel in the window the absolute deviation from the median is computed. The mean of these absolute deviations in returned via sigma, while the median itself is returned by the function. The computed median and sigma may be a robust estimate of the mean and standard deviation of the pixels. The sigma is however still sensitive to outliers. See cpl_image_get_mad_window() for a more robust estimator.
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE. On error the _cpl_error_code_ code is set and the return value is undefined.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_NULL_INPUT , cpl_stats_get_median() , cpl_stats_get_median_dev() , and CPL_STATS_MEDIAN_DEV .
imageInput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention)The specified bounds are included in the specified region.
In case of error, the _cpl_error_code_ code is set, and the returned value is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.
For a finite population or sample, the median is the middle value of an odd number of values (arranged in ascending order) or any value between the two middle values of an even number of values. For an even number of elements in the array, the mean of the two central values is returned. Note that in this case, the median might not belong to the input array.
Possible _cpl_error_code_ set in this function:
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
Referenced by cpl_plot_image() .
imageinput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention)The specified bounds are included in the specified region.
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_stats_get_min_x() , cpl_stats_get_min_y() , and CPL_STATS_MINPOS .
Referenced by cpl_fit_image_gaussian() .
imageInput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention) pxptr to the x coordinate of the minimum position pyptr to the y coordinate of the minimum positionThe specified bounds are included in the specified region.
Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_stats_get_min_x() , cpl_stats_get_min_y() , and CPL_STATS_MINPOS .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_detector_interpolate_rejected() , cpl_fit_image_gaussian() , cpl_fit_imagelist_polynomial() , cpl_fit_imagelist_polynomial_window() , cpl_flux_get_noise_ring() , cpl_geom_img_offset_fine() , cpl_geom_img_offset_saa() , cpl_image_collapse_create() , cpl_image_copy() , cpl_image_fill_jacobian() , cpl_image_fill_jacobian_polynomial() , cpl_image_filter() , cpl_image_filter_mask() , cpl_image_get_interpolated() , cpl_image_iqe() , cpl_image_new_from_accepted() , cpl_image_rebin() , cpl_image_warp() , cpl_imagelist_collapse_median_create() , cpl_imagelist_collapse_minmax_create() , cpl_imagelist_collapse_sigclip_create() , cpl_imagelist_is_uniform() , cpl_imagelist_set() , cpl_imagelist_swap_axis_create() , cpl_mask_threshold_image() , cpl_mask_threshold_image_create() , cpl_plot_image() , cpl_plot_image_col() , cpl_plot_image_row() , and cpl_test_get_bytes_image() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_detector_interpolate_rejected() , cpl_fit_image_gaussian() , cpl_fit_imagelist_polynomial() , cpl_fit_imagelist_polynomial_window() , cpl_flux_get_noise_ring() , cpl_geom_img_offset_fine() , cpl_geom_img_offset_saa() , cpl_image_collapse_create() , cpl_image_copy() , cpl_image_fill_jacobian() , cpl_image_fill_jacobian_polynomial() , cpl_image_filter() , cpl_image_filter_mask() , cpl_image_get_interpolated() , cpl_image_iqe() , cpl_image_new_from_accepted() , cpl_image_warp() , cpl_imagelist_collapse_median_create() , cpl_imagelist_collapse_minmax_create() , cpl_imagelist_collapse_sigclip_create() , cpl_imagelist_is_uniform() , cpl_imagelist_set() , cpl_imagelist_swap_axis_create() , cpl_mask_threshold_image() , cpl_mask_threshold_image_create() , cpl_plot_image() , cpl_plot_image_col() , cpl_plot_image_row() , and cpl_test_get_bytes_image() .
imageinput image. llxLower left x position (FITS convention, 1 for leftmost) llyLower left y position (FITS convention, 1 for lowest) urxUpper right x position (FITS convention) uryUpper right y position (FITS convention)Referenced by cpl_flux_get_noise_ring() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_NULL_INPUT , and CPL_TYPE_INVALID .
Referenced by cpl_detector_interpolate_rejected() , cpl_fit_image_gaussian() , cpl_geom_img_offset_fine() , cpl_geom_img_offset_saa() , cpl_image_add_scalar() , cpl_image_and() , cpl_image_and_scalar() , cpl_image_collapse_window_create() , cpl_image_copy() , cpl_image_divide_scalar() , cpl_image_exponential() , cpl_image_fill_jacobian() , cpl_image_fill_jacobian_polynomial() , cpl_image_filter() , cpl_image_filter_mask() , cpl_image_fit_gaussian() , cpl_image_hypot() , cpl_image_logarithm() , cpl_image_multiply_scalar() , cpl_image_not() , cpl_image_or() , cpl_image_or_scalar() , cpl_image_power() , cpl_image_reject_value() , cpl_image_subtract_scalar() , cpl_image_warp() , cpl_image_xor() , cpl_image_xor_scalar() , cpl_imagelist_cast() , cpl_imagelist_collapse_median_create() , cpl_imagelist_collapse_minmax_create() , cpl_imagelist_collapse_sigclip_create() , cpl_imagelist_is_uniform() , cpl_imagelist_set() , cpl_imagelist_swap_axis_create() , cpl_mask_threshold_image() , cpl_plot_image() , cpl_plot_image_col() , cpl_plot_image_row() , and cpl_test_get_bytes_image() .
selfPre-allocated image to hold the result firstFirst operand, or NULL for an in-place operation secondSecond operandThe Euclidean distance function is useful for gaussian error propagation on addition/subtraction operations.
For pixel values a and b the Euclidean distance c is defined as: $$c = sqrt{a^2 + b^2}$$
first may be NULL, in this case the distance is computed in-place on self using second as the other operand.
Images can be of type CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
If both input operands are of type CPL_TYPE_FLOAT the distance is computed in single precision (using hypotf()), otherwise in double precision (using hypot()).
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , and cpl_type_get_name() .
llythe zone to analyse ((1, 1) for the first pixel) urxThe zone must be at least 4 by 4 pixelsThis function makes internal use of the iqe() MIDAS function (called here cpl_iqe()) written by P. Grosbol. Refer to the MIDAS documentation for more details. This function has proven to give good results over the years when called from RTD. The goal is to provide the exact same functionality in CPL as the one provided in RTD. The code is simply copied from the MIDAS package, it is not maintained by the CPL team.
The returned object must be deallocated with cpl_bivector_delete() . It contains in the first vector the computed values, and in the second one, the associated errors. The computed values are:
The bad pixels map of the image is not taken into account. The input image must be of type float.
Possible _cpl_error_code_ set in this function:
References cpl_bivector_get_x_data() , cpl_bivector_get_y_data() , cpl_bivector_new() , cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , cpl_image_delete() , cpl_image_extract() , cpl_image_get_data_float() , cpl_image_get_size_x() , cpl_image_get_size_y() , and CPL_TYPE_FLOAT .
Referenced by cpl_image_fit_gaussian() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_NULL_INPUT , and cpl_mask_get() .
This function labelises all blobs in a mask. All 4-neighbour connected zones set to 1 in the input mask will end up in the returned integer image as zones where all pixels are set to the same (unique for this blob in this image) label. A non-recursive flood-fill is applied to label the zones. The flood-fill is dimensioned by the number of lines in the image, and the maximal number of lines possibly covered by a blob. The returned image must be deallocated with cpl_image_delete()
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_NULL_INPUT , cpl_free() , cpl_image_get_data_int() , cpl_image_new() , cpl_malloc() , cpl_mask_get_data_const() , cpl_mask_get_size_x() , cpl_mask_get_size_y() , and CPL_TYPE_INT .
Referenced by cpl_apertures_extract_mask() .
This function loads an image from a FITS file (NAXIS=2 or 3).
The returned image has to be deallocated with cpl_image_delete() .
The passed type for the output image can be : CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE or CPL_TYPE_INT.
This type is there to specify the type of the cpl_image that will be created by the function. It is totally independant from the way the data are stored in the FITS file. A FITS image containg float pixels can be loaded as a cpl_image of type double. In this case, the user would specify CPL_TYPE_DOUBLE as im_type.
Additionally, CPL_TYPE_UNSPECIFIED can be passed to inherit the FITS file type. The type of the image is defined based on the BITPIX information of the FITS file. After a successful call, the type of the created image can be accessed via cpl_image_get_type() .
'xtnum' specifies from which extension the image should be loaded. This could be 0 for the main data section (files without extension), or any number between 1 and N, where N is the number of extensions present in the file.
The requested plane number runs from 0 to nplanes-1, where nplanes is the number of planes present in the requested data section.
The created image has an empty bad pixel map.
Examples:
Possible _cpl_error_code_ set in this function:
Possible _cpl_error_code_ set in this function:
Modifies the image by computing the base-scalar logarithm of each of its pixels.
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Pixels for which the logarithm is not defined are rejected and set to zero.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , cpl_type_get_name() , and CPL_TYPE_INT .
Referenced by cpl_image_logarithm_create() , and cpl_imagelist_logarithm() .
nb_cut^2 defines in how many tiles the images will be permuted. Each tile will then be moved to another place defined in new_pos. nb_cut equal 1 will leave the image unchanged, 2 is used to permute the four image quadrants, etc.. new_pos contains nb_cut^2 values between 1 and nb_cut^2, i.e. a permutation of the values from 1 to nb_cut^2. The zone positions are counted from the lower left part of the image. It is not allowed to move two tiles to the same position (the relation between th new tiles positions and the initial position is bijective !). The array with the permuted positions must contain nb_cut^2 values, the function is unable to verify this.
The image x and y sizes have to be multiples of nb_cut.
Example: 16 17 18 6 5 4 13 14 15 3 2 1 10 11 12 ----> 12 11 10 7 8 9 9 8 7 4 5 6 18 17 16 1 2 3 15 14 13 image 3x6 cpl_image_move(image, 3, new_pos); with new_pos = {9,8,7,6,5,4,3,2,1};
The bad pixels are moved in the same way.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_free() , cpl_malloc() , and cpl_mask_move() .
Referenced by cpl_image_fft() .
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and cpl_image_get_type() .
Referenced by cpl_image_fill_test_create() , cpl_image_multiply_scalar_create() , cpl_imagelist_multiply_scalar() , and cpl_plot_image() .
References cpl_ensure , cpl_error_get_code() , cpl_image_delete() , cpl_image_duplicate() , and cpl_image_multiply_scalar() .
Allocates space for the cpl_image structure and sets the dimensions and type of pixel data. The pixel buffer is allocated and initialised to zero. The pixel array will contain nx*ny values being the image pixels from the lower left to the upper right line by line.
Supported pixel types are CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT_COMPLEX and CPL_TYPE_DOUBLE_COMPLEX.
The returned cpl_image must be deallocated using cpl_image_delete() .
Possible _cpl_error_code_ set in this function:
Referenced by cpl_geom_img_offset_fine() , cpl_geom_img_offset_saa() , cpl_image_fill_jacobian() , cpl_image_fill_test_create() , cpl_image_filter_linear() , cpl_image_filter_median() , cpl_image_filter_morpho() , cpl_image_filter_stdev() , cpl_image_labelise_mask_create() , and cpl_image_new_from_accepted() .
The created image is of type CPL_TYPE_INT.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_NULL_INPUT , cpl_image_wrap_int() , cpl_malloc() , cpl_mask_get_data_const() , cpl_mask_get_size_x() , and cpl_mask_get_size_y() .
Referenced by cpl_geom_img_offset_saa() .
Normalises an image according to a given criterion.
Possible normalisations are:
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , cpl_error_get_code() , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_divide_scalar() , cpl_image_get_absflux() , cpl_image_get_flux() , cpl_image_get_mean() , cpl_image_subtract_scalar() , cpl_stats_get_max() , cpl_stats_get_min() , CPL_STATS_MAX , and CPL_STATS_MIN .
Referenced by cpl_image_normalise_create() , and cpl_imagelist_normalise() .
Stores the result in a newly allocated image and returns it. The returned image must be deallocated using cpl_image_delete() .
References cpl_ensure , CPL_ERROR_NULL_INPUT , cpl_image_delete() , cpl_image_duplicate() , and cpl_image_normalise() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , cpl_type_get_name() , cpl_type_get_sizeof() , and CPL_TYPE_INT .
selfPre-allocated image to hold the result firstFirst operand, or NULL for an in-place operation secondSecond operandPossible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , cpl_type_get_name() , cpl_type_get_sizeof() , and CPL_TYPE_INT .
selfPre-allocated image to hold the result firstFirst operand, or NULL for an in-place operation secondSecond operand (scalar)Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , cpl_type_get_name() , cpl_type_get_sizeof() , and CPL_TYPE_INT .
Modifies the image by lifting each of its pixels to exponent.
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Pixels for which the power to the given exponent is not defined are rejected and set to zero.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , CPL_TYPE_DOUBLE , CPL_TYPE_FLOAT , cpl_type_get_name() , and CPL_TYPE_INT .
Referenced by cpl_image_power_create() , and cpl_imagelist_power() .
imageThe image to rebin xstartstart x position of binning (starting from 1...) ystartstart y position of binning (starting from 1...) xstepBin size in x. ystepBin size in y.If both bin sizes in x and y are = 2, an image with (about) a quarter of the pixels of the input image will be created. Each new pixel will be the sum of the values of all contributing input pixels. If a bin is incomplete (i.e., the input image size is not a multiple of the bin sizes), it is not computed.
xstep and ystep must not be greater than the sizes of the rebinned region.
The input image type can be CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. If the image has bad pixels, they will be propagated to the rebinned image "pessimistically", i.e., if at least one of the contributing input pixels is bad, then the corresponding output pixel will also be flagged "bad". If you need an image of "weights" for each rebinned pixel, just cast the input image bpm into a CPL_TYPE_INT image, and apply cpl_image_rebin() to it too.
The returned image must be deallocated using cpl_image_delete() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , cpl_image_get_size_x() , cpl_mask_get_data() , cpl_mask_get_data_const() , and cpl_mask_new() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_NONE , and CPL_ERROR_NULL_INPUT .
If the input image has a bad pixel map prior to the call, it is overwritten.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_bpm() , cpl_mask_get_data() , cpl_mask_get_data_const() , cpl_mask_get_size_x() , and cpl_mask_get_size_y() .
Referenced by cpl_image_warp() , cpl_image_warp_polynomial() , and cpl_imagelist_swap_axis_create() .
Possible _cpl_error_code_ set in this function:
References CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , CPL_TYPE_DOUBLE , CPL_TYPE_DOUBLE_COMPLEX , CPL_TYPE_FLOAT , CPL_TYPE_FLOAT_COMPLEX , and CPL_TYPE_INT .
selfImage to write to disk or NULL filenameName of the file to write to typeThe type used to represent the data in the file plistProperty list for the output header or NULL modeThe desired output optionsThis function saves an image to a FITS file. If a property list is provided, it is written to the header where the image is written. The image may be NULL, in this case only the propertylist is saved.
Supported image types are CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT.
The type used in the file can be one of: CPL_TYPE_UCHAR (8 bit unsigned), CPL_TYPE_SHORT (16 bit signed), CPL_TYPE_USHORT (16 bit unsigned), CPL_TYPE_INT (32 bit signed), CPL_TYPE_FLOAT (32 bit floating point), or CPL_TYPE_DOUBLE (64 bit floating point). Additionally, the special value CPL_TYPE_UNSPECIFIED is allowed. This value means that the type used for saving is the pixel type of the input image. Using the image pixel type as saving type ensures that the saving incurs no loss of information.
Supported output modes are CPL_IO_CREATE (create a new file) and CPL_IO_EXTEND (append a new extension to an existing file).
Upon success the image will reside in a FITS data unit with NAXIS = 2. Is it possible to save a single image in a FITS data unit with NAXIS = 3, see cpl_imagelist_save() .
When the data written to disk are of an integer type, the output mode CPL_IO_EXTEND can be combined (via bit-wise or) with an option for tile-compression. This compression of integer data is lossless. The options are: CPL_IO_COMPRESS_GZIP, CPL_IO_COMPRESS_RICE, CPL_IO_COMPRESS_HCOMPRESS, CPL_IO_COMPRESS_PLIO. With compression the type must be CPL_TYPE_UNSPECIFIED or CPL_TYPE_INT.
Note that in append mode the file must be writable (and do not take for granted that a file is writable just because it was created by the same application, as this depends from the system umask ).
Possible _cpl_error_code_ set in this function:
References CPL_ERROR_NONE , and cpl_propertylist_save() .
imageinput image. xposPixel x position (FITS convention, 1 for leftmost) yposPixel y position (FITS convention, 1 for lowest) valueNew pixel valueImages can be CPL_TYPE_FLOAT, CPL_TYPE_INT, CPL_TYPE_DOUBLE.
If the pixel is flagged as rejected, this flag is removed.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and CPL_TYPE_COMPLEX .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_image_unset_bpm() .
imageinput image. xposPixel x position (FITS convention, 1 for leftmost) yposPixel y position (FITS convention, 1 for lowest) valueNew pixel valueImages can be CPL_TYPE_FLOAT_COMPLEX or CPL_TYPE_DOUBLE_COMPLEX.
If the pixel is flagged as rejected, this flag is removed.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ACCESS_OUT_OF_RANGE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and CPL_TYPE_FLOAT_COMPLEX .
The new zones (in the result image) where no new value is computed are set to 0 and flagged as bad pixels. The shift values have to be valid: -nx < dx < nx and -ny < dy < ny
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_mask_new() , cpl_mask_shift() , and cpl_type_get_sizeof() .
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and cpl_image_get_type() .
Referenced by cpl_image_normalise() , cpl_image_subtract_scalar_create() , cpl_imagelist_subtract_scalar() , and cpl_plot_image() .
References cpl_ensure , cpl_error_get_code() , cpl_image_delete() , cpl_image_duplicate() , and cpl_image_subtract_scalar() .
Referenced by cpl_plot_image() .
lo_cutLower bound. hi_cutHigher bound. assign_lo_cutValue to assign to pixels below low bound. assign_hi_cutValue to assign to pixels above high bound.Pixels outside of the provided interval are assigned the given values.
Use FLT_MIN and FLT_MAX for floating point images and DBL_MIN and DBL_MAX for double images for the lo_cut and hi_cut to avoid any pixel replacement.
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. lo_cut must be smaller than or equal to hi_cut.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , and CPL_ERROR_NULL_INPUT .
Referenced by cpl_imagelist_threshold() .
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
The definition of the rotation relies on the FITS convention: The lower left corner of the image is at (1,1), x increasing from left to right, y increasing from bottom to top.
For rotations of +90 or -90 degrees on rectangular non-1D-images, the pixel buffer is temporarily duplicated.
rot may be any integer value, its modulo 4 determines the rotation:
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , and cpl_mask_turn() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_NULL_INPUT , and cpl_image_set_bpm() .
Referenced by cpl_image_accept_all() , cpl_imagelist_cast() , cpl_imagelist_empty() , cpl_imagelist_erase() , and cpl_imagelist_set() .
Frees all memory associated to an cpl_image, except the pixel buffer. cpl_image_unwrap() is provided for images that are constructed by passing a pixel buffer to one of cpl_image_wrap_{double,float,int}().
References cpl_free() , and cpl_mask_delete() .
Referenced by cpl_vector_cycle() , and cpl_vector_filter_median_create() .
outPre-allocated destination image to hold the result inSource image to warp deltaxThe x shift of each pixel, same image size as out deltayThe y shift of each pixel, same image size as out xprofileInterpolation weight as a function of the distance in X xradiusPositive inclusion radius in the X-dimension yprofileInterpolation weight as a function of the distance in Y yradiusPositive inclusion radius in the Y-dimensionThe pixel value at the (integer) position (u, v) in the destination image is interpolated from the (typically non-integer) pixel position (x, y) in the source image, where
The identity transform is thus given by deltax and deltay filled with zeros.
The first pixel is (1, 1), located in the lower left. 'out' and 'in' may have different sizes, while deltax and deltay must have the same size as 'out'. deltax and deltay must have pixel type CPL_TYPE_DOUBLE.
Beware that extreme transformations may lead to blank images.
'out' and 'in' may be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Examples of profiles and radius are:
In case a correction for flux conservation were required, please create a correction map using the function
cpl_image_fill_jacobian()
.
Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_data_double_const() , cpl_image_get_size_x() , cpl_image_get_size_y() , cpl_image_get_type() , cpl_image_reject_from_mask() , cpl_mask_delete() , cpl_mask_get_data() , cpl_mask_get_data_const() , cpl_mask_new() , CPL_TYPE_DOUBLE , cpl_vector_get_data_const() , and cpl_vector_get_size() .
outPre-allocated image to hold the result inImage to warp. poly_xDefines source x-pos corresponding to destination (u,v). poly_yDefines source y-pos corresponding to destination (u,v). xprofileInterpolation weight as a function of the distance in X xradiusPositive inclusion radius in the X-dimension yprofileInterpolation weight as a function of the distance in Y yradiusPositive inclusion radius in the Y-dimension'out' and 'in' may have different dimensions and types.
The pair of 2D polynomials are used internally like this
where (u,v) are (integer) pixel positions in the destination image and (x,y) are the corresponding pixel positions (typically non-integer) in the source image.
The identity transform (poly_x(u,v) = u, poly_y(u,v) = v) would thus overwrite the 'out' image with the 'in' image, starting from the lower left if the two images are of different sizes.
Beware that extreme transformations may lead to blank images.
The input image type may be CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
In case a correction for flux conservation were required, please create a correction map using the function
cpl_image_fill_jacobian_polynomial()
.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , cpl_ensure_code , cpl_error_get_code() , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_reject_from_mask() , cpl_mask_delete() , cpl_mask_get_data() , cpl_mask_get_data_const() , cpl_mask_new() , cpl_polynomial_get_dimension() , cpl_vector_delete() , cpl_vector_get_data() , cpl_vector_get_data_const() , cpl_vector_get_size() , and cpl_vector_new() .
The pixel array is set to point to that of the argument. The pixel array must contain nx*ny doubles.
The allocated image must be deallocated with cpl_image_unwrap() .
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_NULL_INPUT , and CPL_TYPE_DOUBLE .
Referenced by cpl_image_divide_create() , cpl_vector_cycle() , and cpl_vector_filter_median_create() .
References cpl_ensure , CPL_ERROR_NULL_INPUT , and CPL_TYPE_DOUBLE_COMPLEX .
Referenced by cpl_image_divide_create() .
References cpl_ensure , CPL_ERROR_NULL_INPUT , and CPL_TYPE_FLOAT .
Referenced by cpl_image_divide_create() .
References cpl_ensure , CPL_ERROR_NULL_INPUT , and CPL_TYPE_FLOAT_COMPLEX .
Referenced by cpl_image_divide_create() .
References cpl_ensure , CPL_ERROR_NULL_INPUT , and CPL_TYPE_INT .
Referenced by cpl_geom_img_offset_saa() , cpl_image_divide_create() , and cpl_image_new_from_mask() .
selfPre-allocated image to hold the result firstFirst operand, or NULL for an in-place operation secondSecond operandPossible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , cpl_type_get_name() , cpl_type_get_sizeof() , and CPL_TYPE_INT .
selfPre-allocated image to hold the result firstFirst operand, or NULL for an in-place operation secondSecond operand (scalar)Possible _cpl_error_code_ set in this function:
References cpl_ensure_code , CPL_ERROR_INCOMPATIBLE_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NONE , CPL_ERROR_NULL_INPUT , cpl_image_get_type() , cpl_type_get_name() , cpl_type_get_sizeof() , and CPL_TYPE_INT .
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The returned vector must be deallocated using cpl_vector_delete() .
The bad pixels map is not taken into account in this function.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , cpl_vector_delete() , cpl_vector_get_data() , and cpl_vector_new() .
Referenced by cpl_image_get_fwhm() .
Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The returned vector must be deallocated using cpl_vector_delete() .
The bad pixels map is not taken into account in this function.
Possible _cpl_error_code_ set in this function:
References cpl_ensure , CPL_ERROR_ILLEGAL_INPUT , CPL_ERROR_INVALID_TYPE , CPL_ERROR_NULL_INPUT , cpl_vector_delete() , cpl_vector_get_data() , and cpl_vector_new() .
Referenced by cpl_image_get_fwhm() .