comparison layer/SpectrogramLayer.cpp @ 209:b6af2eb00780

...
author Chris Cannam
date Tue, 27 Feb 2007 17:51:52 +0000
parents 258af0c4dc28
children 748985c7e2c1
comparison
equal deleted inserted replaced
208:8495187c13ce 209:b6af2eb00780
2097 m_columnMags[s].sample(mag); 2097 m_columnMags[s].sample(mag);
2098 2098
2099 if (overallMag.sample(mag)) { 2099 if (overallMag.sample(mag)) {
2100 //!!! scaling would change here 2100 //!!! scaling would change here
2101 overallMagChanged = true; 2101 overallMagChanged = true;
2102 #ifdef DEBUG_SPECTROGRAM_REPAINT
2102 std::cerr << "Overall mag changed (again?) at column " << s << ", to [" << overallMag.getMin() << "->" << overallMag.getMax() << "]" << std::endl; 2103 std::cerr << "Overall mag changed (again?) at column " << s << ", to [" << overallMag.getMin() << "->" << overallMag.getMax() << "]" << std::endl;
2104 #endif
2103 } 2105 }
2104 } 2106 }
2105 } 2107 }
2106 2108
2107 for (int y = 0; y < h; ++y) { 2109 for (int y = 0; y < h; ++y) {
2121 } 2123 }
2122 } 2124 }
2123 2125
2124 if (overallMagChanged) { 2126 if (overallMagChanged) {
2125 m_viewMags[v] = overallMag; 2127 m_viewMags[v] = overallMag;
2128 #ifdef DEBUG_SPECTROGRAM_REPAINT
2126 std::cerr << "Overall mag is now [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "] - will be updating" << std::endl; 2129 std::cerr << "Overall mag is now [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "] - will be updating" << std::endl;
2130 #endif
2127 } else { 2131 } else {
2132 #ifdef DEBUG_SPECTROGRAM_REPAINT
2128 std::cerr << "Overall mag unchanged at [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl; 2133 std::cerr << "Overall mag unchanged at [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl;
2134 #endif
2129 } 2135 }
2130 2136
2131 Profiler profiler2("SpectrogramLayer::paint: draw image", true); 2137 Profiler profiler2("SpectrogramLayer::paint: draw image", true);
2132 2138
2133 paint.drawImage(x0, y0, m_drawBuffer, 0, 0, w, h); 2139 paint.drawImage(x0, y0, m_drawBuffer, 0, 0, w, h);