comparison data/fft/FFTCache.h @ 0:fc9323a41f5a

start base : Sonic Visualiser sv1-1.0rc1
author lbajardsilogic
date Fri, 11 May 2007 09:08:14 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:fc9323a41f5a
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006 Chris Cannam.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
15
16 #ifndef _FFT_CACHE_H_
17 #define _FFT_CACHE_H_
18
19 #include <cstdlib>
20 #include <cmath>
21
22 //#include <stdint.h>
23 #include "system/System.h"
24
25 class FFTCache
26 {
27 public:
28 virtual ~FFTCache() { }
29
30 virtual size_t getWidth() const = 0;
31 virtual size_t getHeight() const = 0;
32
33 virtual void resize(size_t width, size_t height) = 0;
34 virtual void reset() = 0; // zero-fill or 1-fill as appropriate without changing size
35
36 virtual float getMagnitudeAt(size_t x, size_t y) const = 0;
37 virtual float getNormalizedMagnitudeAt(size_t x, size_t y) const = 0;
38 virtual float getMaximumMagnitudeAt(size_t x) const = 0;
39 virtual float getPhaseAt(size_t x, size_t y) const = 0;
40
41 virtual void getValuesAt(size_t x, size_t y, float &real, float &imaginary) const = 0;
42
43 virtual bool haveSetColumnAt(size_t x) const = 0;
44
45 // may modify argument arrays
46 virtual void setColumnAt(size_t x, float *mags, float *phases, float factor) = 0;
47
48 // may modify argument arrays
49 virtual void setColumnAt(size_t x, float *reals, float *imags) = 0;
50
51 virtual void suspend() { }
52
53 protected:
54 FFTCache() { }
55 };
56
57
58 #endif