Mercurial > hg > svcore
comparison data/fft/FFTFileCacheWriter.h @ 935:f960d67ce842 tonioni
Merge from branch warnfix_no_size_t
author | Chris Cannam |
---|---|
date | Wed, 18 Jun 2014 13:42:01 +0100 |
parents | 59e7fe1b1003 |
children | cc27f35aa75c |
comparison
equal
deleted
inserted
replaced
925:3efc20c59a94 | 935:f960d67ce842 |
---|---|
23 class FFTFileCacheWriter : public FFTCacheWriter | 23 class FFTFileCacheWriter : public FFTCacheWriter |
24 { | 24 { |
25 public: | 25 public: |
26 FFTFileCacheWriter(QString fileBase, | 26 FFTFileCacheWriter(QString fileBase, |
27 FFTCache::StorageType storageType, | 27 FFTCache::StorageType storageType, |
28 size_t width, size_t height); | 28 int width, int height); |
29 ~FFTFileCacheWriter(); | 29 ~FFTFileCacheWriter(); |
30 | 30 |
31 size_t getWidth() const; | 31 int getWidth() const; |
32 size_t getHeight() const; | 32 int getHeight() const; |
33 | 33 |
34 void setColumnAt(size_t x, float *mags, float *phases, float factor); | 34 void setColumnAt(int x, float *mags, float *phases, float factor); |
35 void setColumnAt(size_t x, float *reals, float *imags); | 35 void setColumnAt(int x, float *reals, float *imags); |
36 | 36 |
37 static size_t getCacheSize(size_t width, size_t height, | 37 static int getCacheSize(int width, int height, |
38 FFTCache::StorageType type); | 38 FFTCache::StorageType type); |
39 | 39 |
40 bool haveSetColumnAt(size_t x) const; | 40 bool haveSetColumnAt(int x) const; |
41 | 41 |
42 void allColumnsWritten(); | 42 void allColumnsWritten(); |
43 | 43 |
44 QString getFileBase() const; | 44 QString getFileBase() const; |
45 FFTCache::StorageType getStorageType() const { return m_storageType; } | 45 FFTCache::StorageType getStorageType() const { return m_storageType; } |
46 | 46 |
47 protected: | 47 protected: |
48 char *m_writebuf; | 48 char *m_writebuf; |
49 | 49 |
50 void setNormalizationFactorToWritebuf(float newfactor) { | 50 void setNormalizationFactorToWritebuf(float newfactor) { |
51 size_t h = m_mfc->getHeight(); | 51 int h = m_mfc->getHeight(); |
52 if (h < m_factorSize) return; | 52 if (h < m_factorSize) return; |
53 if (m_storageType != FFTCache::Compact) { | 53 if (m_storageType != FFTCache::Compact) { |
54 ((float *)m_writebuf)[h - 1] = newfactor; | 54 ((float *)m_writebuf)[h - 1] = newfactor; |
55 } else { | 55 } else { |
56 union { | 56 union { |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 QString m_fileBase; | 66 QString m_fileBase; |
67 FFTCache::StorageType m_storageType; | 67 FFTCache::StorageType m_storageType; |
68 size_t m_factorSize; | 68 int m_factorSize; |
69 MatrixFile *m_mfc; | 69 MatrixFile *m_mfc; |
70 }; | 70 }; |
71 | 71 |
72 #endif | 72 #endif |