comparison data/model/DenseThreeDimensionalModel.h @ 929:59e7fe1b1003 warnfix_no_size_t

Unsigned removals and warning fixes in data/
author Chris Cannam
date Tue, 17 Jun 2014 14:33:42 +0100
parents 68f3eaefe297
children f073d924a7c3
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
31 31
32 public: 32 public:
33 /** 33 /**
34 * Return the number of sample frames covered by each column of bins. 34 * Return the number of sample frames covered by each column of bins.
35 */ 35 */
36 virtual size_t getResolution() const = 0; 36 virtual int getResolution() const = 0;
37 37
38 /** 38 /**
39 * Return the number of columns of bins in the model. 39 * Return the number of columns of bins in the model.
40 */ 40 */
41 virtual size_t getWidth() const = 0; 41 virtual int getWidth() const = 0;
42 42
43 /** 43 /**
44 * Return the number of bins in each column. 44 * Return the number of bins in each column.
45 */ 45 */
46 virtual size_t getHeight() const = 0; 46 virtual int getHeight() const = 0;
47 47
48 /** 48 /**
49 * Return the minimum permissible value in each bin. 49 * Return the minimum permissible value in each bin.
50 */ 50 */
51 virtual float getMinimumLevel() const = 0; 51 virtual float getMinimumLevel() const = 0;
60 * This should return true only if getColumn(column) would not 60 * This should return true only if getColumn(column) would not
61 * have to do any substantial work to calculate its return values. 61 * have to do any substantial work to calculate its return values.
62 * If this function returns false, it may still be possible to 62 * If this function returns false, it may still be possible to
63 * retrieve the column, but its values may have to be calculated. 63 * retrieve the column, but its values may have to be calculated.
64 */ 64 */
65 virtual bool isColumnAvailable(size_t column) const = 0; 65 virtual bool isColumnAvailable(int column) const = 0;
66 66
67 typedef QVector<float> Column; 67 typedef QVector<float> Column;
68 68
69 /** 69 /**
70 * Get data from the given column of bin values. 70 * Get data from the given column of bin values.
71 */ 71 */
72 virtual Column getColumn(size_t column) const = 0; 72 virtual Column getColumn(int column) const = 0;
73 73
74 /** 74 /**
75 * Get the single data point from the n'th bin of the given column. 75 * Get the single data point from the n'th bin of the given column.
76 */ 76 */
77 virtual float getValueAt(size_t column, size_t n) const = 0; 77 virtual float getValueAt(int column, int n) const = 0;
78 78
79 /** 79 /**
80 * Get the name of a given bin (i.e. a label to associate with 80 * Get the name of a given bin (i.e. a label to associate with
81 * that bin across all columns). 81 * that bin across all columns).
82 */ 82 */
83 virtual QString getBinName(size_t n) const = 0; 83 virtual QString getBinName(int n) const = 0;
84 84
85 /** 85 /**
86 * Return true if the bins have values as well as names. If this 86 * Return true if the bins have values as well as names. If this
87 * returns true, getBinValue() may be used to retrieve the values. 87 * returns true, getBinValue() may be used to retrieve the values.
88 */ 88 */
91 /** 91 /**
92 * Return the value of bin n, if any. This is a "vertical scale" 92 * Return the value of bin n, if any. This is a "vertical scale"
93 * value which does not vary from one column to the next. This is 93 * value which does not vary from one column to the next. This is
94 * only meaningful if hasBinValues() returns true. 94 * only meaningful if hasBinValues() returns true.
95 */ 95 */
96 virtual float getBinValue(size_t n) const { return n; } 96 virtual float getBinValue(int n) const { return n; }
97 97
98 /** 98 /**
99 * Obtain the name of the unit of the values returned from 99 * Obtain the name of the unit of the values returned from
100 * getBinValue(), if any. 100 * getBinValue(), if any.
101 */ 101 */
109 109
110 /** 110 /**
111 * Utility function to query whether a given bin is greater than 111 * Utility function to query whether a given bin is greater than
112 * its (vertical) neighbours. 112 * its (vertical) neighbours.
113 */ 113 */
114 bool isLocalPeak(size_t x, size_t y) { 114 bool isLocalPeak(int x, int y) {
115 float value = getValueAt(x, y); 115 float value = getValueAt(x, y);
116 if (y > 0 && value < getValueAt(x, y - 1)) return false; 116 if (y > 0 && value < getValueAt(x, y - 1)) return false;
117 if (y < getHeight() - 1 && value < getValueAt(x, y + 1)) return false; 117 if (y < getHeight() - 1 && value < getValueAt(x, y + 1)) return false;
118 return true; 118 return true;
119 } 119 }
120 120
121 /** 121 /**
122 * Utility function to query whether a given bin is greater than a 122 * Utility function to query whether a given bin is greater than a
123 * certain threshold. 123 * certain threshold.
124 */ 124 */
125 bool isOverThreshold(size_t x, size_t y, float threshold) { 125 bool isOverThreshold(int x, int y, float threshold) {
126 return getValueAt(x, y) > threshold; 126 return getValueAt(x, y) > threshold;
127 } 127 }
128 128
129 QString getTypeName() const { return tr("Dense 3-D"); } 129 QString getTypeName() const { return tr("Dense 3-D"); }
130 130