Image Component Library (ICL)
|
This class implements the unary operator for the inverse fast and discrete 2D fourier transformation. More...
#include <IFFTOp.h>
Public Types | |
enum | SizeAdaptionMode { NO_SCALE, PAD_REMOVE, SCALE_UP, SCALE_DOWN } |
Modes how the sourceimage is to adapt before fftcomputation. More... | |
enum | ResultMode { REAL_ONLY, IMAG_ONLY, TWO_CHANNEL_COMPLEX } |
Public Member Functions | |
IFFTOp (ResultMode rm=REAL_ONLY, SizeAdaptionMode sam=NO_SCALE, utils::Rect roi=Rect(0, 0, 0, 0), bool join=true, bool ifftshift=true, bool forceIDFT=false) | |
Creates a new IFFTOp-object. | |
~IFFTOp () | |
void | setJoinMatrix (bool pJoin) |
Sets if two channels shall be joined to one complex. | |
bool | getJoinMatrix () |
Returns if two channels shall be joined to one complex. | |
void | setROI (utils::Rect roi) |
Sets the roi. | |
Rect | getRoi () |
Returns the current roi. | |
void | setResultMode (ResultMode rm) |
Sets the resultmode. | |
int | getResultMode () |
Returns the resultmode as int. | |
void | setSizeAdaptionMode (SizeAdaptionMode sam) |
Sets the sizeadaptionmode. | |
int | getSizeAdaptionMode () |
Returns the sizeadaptionmode. | |
bool | getForceIDFT () |
Returns true if the discrete inverse fourier transfarmation shall be used, else false. | |
void | setForceIDFT (bool pForceDFT) |
Set wether to force the discrete inverse fourier transformation or to use the fast inverse fourier transformation. | |
virtual void | apply (const core::ImgBase *src, core::ImgBase **dst) |
Call this method to start ifftcomputation. | |
Private Member Functions | |
template<class SrcT , class DstT > | |
void | apply_internal (const core::Img< SrcT > &src, core::Img< DstT > &dst, math::DynMatrix< std::complex< DstT > > &buf, math::DynMatrix< std::complex< DstT > > &dstBuf) |
template<class T > | |
const core::Img< T > * | adapt_source (const core::Img< T > *src) |
template<typename T > | |
void | apply_inplace_ifftshift (math::DynMatrix< T > &m) |
Private Attributes | |
Data * | m_data |
Class for internal params and buffers. |
This class implements the unary operator for the inverse fast and discrete 2D fourier transformation.
As known the ifft can only be applied if the datasize is a power of 2. This implementation uses the ifft as far as it can be applied and switches to the idft, so you can use it if datasize is not a power of 2 too. If MKL or IPP is available, IFFTOp tries to use it if possible.
Modes how the sourceimage is to adapt before fftcomputation.
Several sizeadaptionmodes for sourceimage.
icl::filter::IFFTOp::IFFTOp | ( | ResultMode | rm = REAL_ONLY , |
SizeAdaptionMode | sam = NO_SCALE , |
||
utils::Rect | roi = Rect(0, 0, 0, 0) , |
||
bool | join = true , |
||
bool | ifftshift = true , |
||
bool | forceIDFT = false |
||
) |
Creates a new IFFTOp-object.
Constructor. Params can be changed later.
rm | the resultmode |
sam | the sizeadaptionmode before applying IFFTOp |
roi | determinates the size if removing padding is needed |
join | wether to join to channel to one complex for the ifftcomputation or not |
ifftshift | undo fftshift before the isfftcomputation or not |
forceIDFT | wether to apply idft or ifft |
Destructor
const core::Img<T>* icl::filter::IFFTOp::adapt_source | ( | const core::Img< T > * | src | ) | [private] |
Called by apply. Adapts sourceimage to specified values(scaling, padding on so on). Possible sourceparam is: Img<icl8u>, Img<icl16s>, Img<icl32s>, Img<icl32f>, Img<icl64f>
virtual void icl::filter::IFFTOp::apply | ( | const core::ImgBase * | src, |
core::ImgBase ** | dst | ||
) | [virtual] |
Call this method to start ifftcomputation.
Applies IFFTOp on src and dst.
*src | pointer to sourceimage |
**dst | pointer to pointer to destinationimage |
Implements icl::filter::UnaryOp.
void icl::filter::IFFTOp::apply_inplace_ifftshift | ( | math::DynMatrix< T > & | m | ) | [private] |
Applies inplace ifftshift on destinationimage after ifftcomputation. Possible sourceparam is: Img<icl32f> and Img<icl64f>
void icl::filter::IFFTOp::apply_internal | ( | const core::Img< SrcT > & | src, |
core::Img< DstT > & | dst, | ||
math::DynMatrix< std::complex< DstT > > & | buf, | ||
math::DynMatrix< std::complex< DstT > > & | dstBuf | ||
) | [private] |
Called by apply. Aplies ifft/idft and resultmode. Possible sourceparam is: Img<icl8u>, Img<icl16s>, Img<icl32s>, Img<icl32f>, Img<icl64f>. Possible destinationparam is: Img<icl32f> and Img<icl64f>.
bool icl::filter::IFFTOp::getForceIDFT | ( | ) |
Returns true if the discrete inverse fourier transfarmation shall be used, else false.
bool icl::filter::IFFTOp::getJoinMatrix | ( | ) |
Returns if two channels shall be joined to one complex.
Returns the resultmode as int.
Returns the current roi.
Returns the sizeadaptionmode.
void icl::filter::IFFTOp::setForceIDFT | ( | bool | pForceDFT | ) |
Set wether to force the discrete inverse fourier transformation or to use the fast inverse fourier transformation.
pForceDFT |
void icl::filter::IFFTOp::setJoinMatrix | ( | bool | pJoin | ) |
Sets if two channels shall be joined to one complex.
pJoin | true if channels shall be joined to one complex |
void icl::filter::IFFTOp::setResultMode | ( | ResultMode | rm | ) |
Sets the resultmode.
void icl::filter::IFFTOp::setROI | ( | utils::Rect | roi | ) |
Sets the roi.
roi | the new roi |
Sets the sizeadaptionmode.
sam | the sizeadaptionmode to be set |
Data* icl::filter::IFFTOp::m_data [private] |
Class for internal params and buffers.