demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h
changeset 25 e24348a560a6
equal deleted inserted replaced
23:89e065397ea6 25:e24348a560a6
       
     1 /***************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     5 **
       
     6 ** This file is part of the examples of the Qt Toolkit.
       
     7 **
       
     8 ** This program is free software: you can redistribute it and/or modify
       
     9 ** it under the terms of the GNU Lesser General Public License as
       
    10 ** published by the Free Software Foundation, either version 2.1. This
       
    11 ** program is distributed in the hope that it will be useful, but WITHOUT
       
    12 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
       
    14 ** for more details. You should have received a copy of the GNU General
       
    15 ** Public License along with this program. If not, see
       
    16 ** <http://www.gnu.org/licenses/>.
       
    17 **
       
    18 ***************************************************************************/
       
    19 
       
    20 #ifndef FFTREAL_WRAPPER_H
       
    21 #define FFTREAL_WRAPPER_H
       
    22 
       
    23 #include <QtCore/QtGlobal>
       
    24 
       
    25 #if defined(FFTREAL_LIBRARY)
       
    26 #  define FFTREAL_EXPORT Q_DECL_EXPORT
       
    27 #else
       
    28 #  define FFTREAL_EXPORT Q_DECL_IMPORT
       
    29 #endif
       
    30 
       
    31 class FFTRealWrapperPrivate;
       
    32 
       
    33 // Each pass of the FFT processes 2^X samples, where X is the
       
    34 // number below.
       
    35 static const int FFTLengthPowerOfTwo = 12;
       
    36 
       
    37 /**
       
    38  * Wrapper around the FFTRealFixLen template provided by the FFTReal
       
    39  * library
       
    40  *
       
    41  * This class instantiates a single instance of FFTRealFixLen, using
       
    42  * FFTLengthPowerOfTwo as the template parameter.  It then exposes
       
    43  * FFTRealFixLen<FFTLengthPowerOfTwo>::do_fft via the calculateFFT
       
    44  * function, thereby allowing an application to dynamically link
       
    45  * against the FFTReal implementation.
       
    46  *
       
    47  * See http://ldesoras.free.fr/prod.html
       
    48  */
       
    49 class FFTREAL_EXPORT FFTRealWrapper
       
    50 {
       
    51 public:
       
    52     FFTRealWrapper();
       
    53     ~FFTRealWrapper();
       
    54 
       
    55     typedef float DataType;
       
    56     void calculateFFT(DataType in[], const DataType out[]);
       
    57 
       
    58 private:
       
    59     FFTRealWrapperPrivate*  m_private;
       
    60 };
       
    61 
       
    62 #endif // FFTREAL_WRAPPER_H
       
    63