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