comparison layer/Colour3DPlotRenderer.cpp @ 1116:e7a07cd63d21 spectrogram-minor-refactor

Wire up invertVertical
author Chris Cannam
date Tue, 19 Jul 2016 15:08:22 +0100
parents ee8e73dc5c8b
children 64709d4d09ef
comparison
equal deleted inserted replaced
1115:ee8e73dc5c8b 1116:e7a07cd63d21
363 363
364 for (int sy = minbin; sy <= maxbin; ++sy) { 364 for (int sy = minbin; sy <= maxbin; ++sy) {
365 365
366 int ry0 = m_sources.verticalBinLayer->getIYForBin(v, sy); 366 int ry0 = m_sources.verticalBinLayer->getIYForBin(v, sy);
367 int ry1 = m_sources.verticalBinLayer->getIYForBin(v, sy + 1); 367 int ry1 = m_sources.verticalBinLayer->getIYForBin(v, sy + 1);
368
369 if (m_params.invertVertical) {
370 ry0 = h - ry0 - 1;
371 ry1 = h - ry1 - 1;
372 }
373
368 QRect r(rx0, ry1, rw, ry0 - ry1); 374 QRect r(rx0, ry1, rw, ry0 - ry1);
369 375
370 float value = preparedColumn[sy - minbin]; 376 float value = preparedColumn[sy - minbin];
371 QColor colour = m_params.colourScale.getColour(value, 377 QColor colour = m_params.colourScale.getColour(value,
372 m_params.colourRotation); 378 m_params.colourRotation);
767 } 773 }
768 } 774 }
769 775
770 if (!pixelPeakColumn.empty()) { 776 if (!pixelPeakColumn.empty()) {
771 for (int y = 0; y < h; ++y) { 777 for (int y = 0; y < h; ++y) {
778 int py;
779 if (m_params.invertVertical) {
780 py = y;
781 } else {
782 py = h - y - 1;
783 }
772 m_drawBuffer.setPixel 784 m_drawBuffer.setPixel
773 (x, 785 (x,
774 h-y-1, 786 py,
775 m_params.colourScale.getPixel(pixelPeakColumn[y])); 787 m_params.colourScale.getPixel(pixelPeakColumn[y]));
776 } 788 }
777 } 789 }
778 790
779 double fractionComplete = double(columnCount) / double(w); 791 double fractionComplete = double(columnCount) / double(w);