Common Pipeline Library Reference 7.3.2
|
Typedefs | |
typedef enum _cpl_fft_mode_ | cpl_fft_mode |
The CPL fft mode. | |
Enumerations | |
enum | _cpl_fft_mode_ { CPL_FFT_FORWARD , CPL_FFT_BACKWARD , CPL_FFT_NOSCALE , CPL_FFT_FIND_MEASURE , CPL_FFT_FIND_PATIENT , CPL_FFT_FIND_EXHAUSTIVE } |
The supported values of the CPL fft mode. More... | |
Functions | |
cpl_error_code | cpl_fft_image (cpl_image *self, const cpl_image *other, cpl_fft_mode mode) |
Perform a FFT operation on an image. | |
cpl_error_code | cpl_fft_imagelist (cpl_imagelist *self, const cpl_imagelist *other, cpl_fft_mode mode) |
Perform a FFT operation on the images in an imagelist. | |
This module provides FFTW wrappers
typedef enum _cpl_fft_mode_ cpl_fft_mode |
The CPL fft mode.
enum _cpl_fft_mode_ |
The supported values of the CPL fft mode.
cpl_error_code cpl_fft_image | ( | cpl_image * | self, |
const cpl_image * | other, | ||
cpl_fft_mode | mode | ||
) |
Perform a FFT operation on an image.
self | Pre-allocated output image to transform to |
other | Input image to transform from, use self for in-place transform |
mode | CPL_FFT_FORWARD or CPL_FFT_BACKWARD, optionally CPL_FFT_NOSCALE |
This function performs an FFT on an image, using FFTW. CPL may be configured without this library, in this case an otherwise valid call will set and return the error CPL_ERROR_UNSUPPORTED_MODE.
The input and output images must match in precision level. Integer images are not supported.
In a forward transform the input image may be non-complex. In this case a real-to-complex transform is performed. This will only compute the first nx/2 + 1 columns of the transform. In this transform it is allowed to pass an output image with nx/2 + 1 columns.
Similarly, in a backward transform the output image may be non-complex. In this case a complex-to-real transform is performed. This will only transform the first nx/2 + 1 columns of the input. In this transform it is allowed to pass an input image with nx/2 + 1 columns.
Per default the backward transform scales (divides) the result with the number of elements transformed (i.e. the number of pixels in the result image). This scaling can be turned off with CPL_FFT_NOSCALE.
If many transformations in the same direction are to be done on data of the same size and type, a reduction in the time required to perform the transformations can be achieved by adding the flag CPL_FFT_FIND_MEASURE to the first transformation. For a larger number of transformations a further reduction may be achived with the flag CPL_FFT_FIND_PATIENT and for an even larger number of transformations a further reduction may be achived with the flag CPL_FFT_FIND_EXHAUSTIVE.
If many transformations are to be done then a reduction in the time required to perform the transformations can be achieved by using cpl_fft_imagelist().
Possible _cpl_error_code_ set in this function:
References CPL_ERROR_NONE.
cpl_error_code cpl_fft_imagelist | ( | cpl_imagelist * | self, |
const cpl_imagelist * | other, | ||
cpl_fft_mode | mode | ||
) |
Perform a FFT operation on the images in an imagelist.
self | Pre-allocated output imagelist to transform to |
other | Input imagelist to transform from |
mode | CPL_FFT_FORWARD or CPL_FFT_BACKWARD, optionally CPL_FFT_NOSCALE |
References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_imagelist_get(), cpl_imagelist_get_const(), and cpl_imagelist_get_size().