Mercurial > hg > svgui
comparison layer/Colour3DPlotRenderer.cpp @ 1112:d578b685d912 spectrogram-minor-refactor
Colourmap rotation (inelegantly)
author | Chris Cannam |
---|---|
date | Tue, 19 Jul 2016 10:12:30 +0100 |
parents | 67dd16e33a3d |
children | 261a00010918 |
comparison
equal
deleted
inserted
replaced
1111:953ce409ccfb | 1112:d578b685d912 |
---|---|
368 int ry0 = m_sources.verticalBinLayer->getIYForBin(v, sy); | 368 int ry0 = m_sources.verticalBinLayer->getIYForBin(v, sy); |
369 int ry1 = m_sources.verticalBinLayer->getIYForBin(v, sy + 1); | 369 int ry1 = m_sources.verticalBinLayer->getIYForBin(v, sy + 1); |
370 QRect r(rx0, ry1, rw, ry0 - ry1); | 370 QRect r(rx0, ry1, rw, ry0 - ry1); |
371 | 371 |
372 float value = preparedColumn[sy - minbin]; | 372 float value = preparedColumn[sy - minbin]; |
373 QColor colour = m_params.colourScale.getColour(value, 0);//!!! +rotation | 373 QColor colour = m_params.colourScale.getColour(value, |
374 m_params.colourRotation); | |
374 | 375 |
375 if (rw == 1) { | 376 if (rw == 1) { |
376 paint.setPen(colour); | 377 paint.setPen(colour); |
377 paint.setBrush(Qt::NoBrush); | 378 paint.setBrush(Qt::NoBrush); |
378 paint.drawLine(r.x(), r.y(), r.x(), r.y() + r.height() - 1); | 379 paint.drawLine(r.x(), r.y(), r.x(), r.y() + r.height() - 1); |
936 Colour3DPlotRenderer::recreateDrawBuffer(int w, int h) | 937 Colour3DPlotRenderer::recreateDrawBuffer(int w, int h) |
937 { | 938 { |
938 m_drawBuffer = QImage(w, h, QImage::Format_Indexed8); | 939 m_drawBuffer = QImage(w, h, QImage::Format_Indexed8); |
939 | 940 |
940 for (int pixel = 0; pixel < 256; ++pixel) { | 941 for (int pixel = 0; pixel < 256; ++pixel) { |
941 //!!! todo: colour rotation (here 0) | |
942 m_drawBuffer.setColor | 942 m_drawBuffer.setColor |
943 ((unsigned char)pixel, | 943 ((unsigned char)pixel, |
944 m_params.colourScale.getColourForPixel(pixel, 0).rgb()); | 944 m_params.colourScale.getColourForPixel |
945 (pixel, m_params.colourRotation).rgb()); | |
945 } | 946 } |
946 | 947 |
947 m_drawBuffer.fill(0); | 948 m_drawBuffer.fill(0); |
948 } | 949 } |
949 | 950 |