UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dcf::CFFT2DCalcBlock Class Reference

#include <cfft2d_calc_block.hpp>

Inheritance diagram for dcf::CFFT2DCalcBlock:
dcf::CalcBlock

Public Member Functions

 CFFT2DCalcBlock (const dcf::Manager &manager, int direction=1, bool normalize=true)
 
virtual ~CFFT2DCalcBlock ()
 
virtual void start ()
 
void setData (size_t dim_x, size_t dim_y, float *re_data, float *im_data)
 
void setDirection (int dir)
 
int getDirection () const
 
bool isNormalize () const
 
void setNormalize (bool normalize)
 
void calcModule (size_t dim_x, size_t dim_y, float *re, float *im, float *mod)
 
- Public Member Functions inherited from dcf::CalcBlock
 CalcBlock (const dcf::Manager &manager)
 
 CalcBlock (const dcf::CalcBlock &cb)
 
virtual ~CalcBlock ()
 
virtual void stop ()
 
virtual void wait ()
 
virtual bool running () const
 
const dcf::Managermanager () const
 
dcf::error_t resultCode ()
 

Protected Member Functions

virtual void run ()
 
bool cuda_fft ()
 
dcf::error_t select_device ()
 
dcf::error_t free_device ()
 
void cuda_set_data (size_t dim_x, size_t dim_y, float *re_data, float *im_data)
 

Protected Attributes

struct {
   size_t   dim_x
 
   size_t   dim_y
 
   bool   new_plan
 
   float *   re
 
   float *   im
 
   int   dir
 
   bool   normalize
 
m_data
 
- Protected Attributes inherited from dcf::CalcBlock
dcf::Managerm_manager
 
dcf::error_t m_result_code
 

Detailed Description

FFT Calculation block

Constructor & Destructor Documentation

dcf::CFFT2DCalcBlock::CFFT2DCalcBlock ( const dcf::Manager manager,
int  direction = 1,
bool  normalize = true 
)
Default FFT calculations block constructor 

with DCF Manager provided. Direction should be 1 for direct fft and -1 for inverse fft. By default spectrum will be normalized.

virtual dcf::CFFT2DCalcBlock::~CFFT2DCalcBlock ( )
virtual

Destructs object.

Member Function Documentation

void dcf::CFFT2DCalcBlock::calcModule ( size_t  dim_x,
size_t  dim_y,
float *  re,
float *  im,
float *  mod 
)

Calculates module mod for complex data (re, im). All arrays should be predefined.

bool dcf::CFFT2DCalcBlock::cuda_fft ( )
protected

Calculates FFT using CUDA. Returns false on error.

void dcf::CFFT2DCalcBlock::cuda_set_data ( size_t  dim_x,
size_t  dim_y,
float *  re_data,
float *  im_data 
)
protected

Set data for CUDA (construct or not new fft plan depended on new sizes provided)

dcf::error_t dcf::CFFT2DCalcBlock::free_device ( )
protected

Free selected device

int dcf::CFFT2DCalcBlock::getDirection ( ) const
inline

Gets current fft direction.

bool dcf::CFFT2DCalcBlock::isNormalize ( ) const
inline

Gets normalize status.

virtual void dcf::CFFT2DCalcBlock::run ( )
protectedvirtual

Main calculations method. Provides result code.

Reimplemented from dcf::CalcBlock.

dcf::error_t dcf::CFFT2DCalcBlock::select_device ( )
protected

Try to select free device with maximal weight.

void dcf::CFFT2DCalcBlock::setData ( size_t  dim_x,
size_t  dim_y,
float *  re_data,
float *  im_data 
)
Sets pointers of input/output data without copying inside. 

Provides result code.

void dcf::CFFT2DCalcBlock::setDirection ( int  dir)
inline

Sets fft direction. True for direct fft, false for inverse fft.

void dcf::CFFT2DCalcBlock::setNormalize ( bool  normalize)
inline

Sets normalize status.

virtual void dcf::CFFT2DCalcBlock::start ( )
virtual

Runs DFT

Reimplemented from dcf::CalcBlock.

Member Data Documentation

size_t dcf::CFFT2DCalcBlock::dim_y

sizes

int dcf::CFFT2DCalcBlock::dir

i/o direction

float* dcf::CFFT2DCalcBlock::im

i/o image data

struct { ... } dcf::CFFT2DCalcBlock::m_data

DFT in/out data

bool dcf::CFFT2DCalcBlock::new_plan

true if we have to reconstruct plan

bool dcf::CFFT2DCalcBlock::normalize

true if spectrum has to be normalized

float* dcf::CFFT2DCalcBlock::re

i/o real data


The documentation for this class was generated from the following file: