Mercurial > hg > svgui
comparison layer/Colour3DPlotRenderer.cpp @ 1219:c06861dec245
Fix incorrect call to getColumn() that broke the peak-frequency spectrogram and close zoom levels of the colour 3d plot
author | Chris Cannam |
---|---|
date | Mon, 16 Jan 2017 10:00:19 +0000 |
parents | 4f1f3e1a4f63 |
children | eaab8bab3522 |
comparison
equal
deleted
inserted
replaced
1218:4f1f3e1a4f63 | 1219:c06861dec245 |
---|---|
400 // order: | 400 // order: |
401 // get column -> scale -> normalise -> record extents -> | 401 // get column -> scale -> normalise -> record extents -> |
402 // peak pick -> distribute/interpolate -> apply display gain | 402 // peak pick -> distribute/interpolate -> apply display gain |
403 | 403 |
404 // this does the first three: | 404 // this does the first three: |
405 preparedColumn = getColumn(sx, minbin, nbins, false); | 405 preparedColumn = getColumn(sx, minbin, nbins, -1); |
406 | 406 |
407 magRange.sample(preparedColumn); | 407 magRange.sample(preparedColumn); |
408 | 408 |
409 if (m_params.binDisplay == BinDisplay::PeakBins) { | 409 if (m_params.binDisplay == BinDisplay::PeakBins) { |
410 preparedColumn = ColumnOp::peakPick(preparedColumn); | 410 preparedColumn = ColumnOp::peakPick(preparedColumn); |
1076 if (sx < 0 || sx >= modelWidth) { | 1076 if (sx < 0 || sx >= modelWidth) { |
1077 continue; | 1077 continue; |
1078 } | 1078 } |
1079 | 1079 |
1080 if (sx != psx) { | 1080 if (sx != psx) { |
1081 preparedColumn = getColumn(sx, minbin, nbins, false); | 1081 preparedColumn = getColumn(sx, minbin, nbins, -1); |
1082 magRange.sample(preparedColumn); | 1082 magRange.sample(preparedColumn); |
1083 psx = sx; | 1083 psx = sx; |
1084 } | 1084 } |
1085 | 1085 |
1086 if (sx == sx0) { | 1086 if (sx == sx0) { |
1117 (freq, minFreq, maxFreq, logarithmic); | 1117 (freq, minFreq, maxFreq, logarithmic); |
1118 | 1118 |
1119 int iy = int(y + 0.5); | 1119 int iy = int(y + 0.5); |
1120 if (iy < 0 || iy >= h) continue; | 1120 if (iy < 0 || iy >= h) continue; |
1121 | 1121 |
1122 m_drawBuffer.setPixel | 1122 auto pixel = m_params.colourScale.getPixel(value); |
1123 (x, | 1123 |
1124 iy, | 1124 #ifdef DEBUG_COLOUR_PLOT_REPAINT |
1125 m_params.colourScale.getPixel(value)); | 1125 // SVDEBUG << "frequency " << freq << " for bin " << bin |
1126 // << " -> y = " << y << ", iy = " << iy << ", value = " | |
1127 // << value << ", pixel " << pixel << "\n"; | |
1128 #endif | |
1129 | |
1130 m_drawBuffer.setPixel(x, iy, pixel); | |
1126 } | 1131 } |
1127 | 1132 |
1128 m_magRanges.push_back(magRange); | 1133 m_magRanges.push_back(magRange); |
1129 | 1134 |
1130 } else { | 1135 } else { |