comparison layer/ColourScale.cpp @ 1079:7ebfb61b1701 spectrogram-minor-refactor

More filling in render & cache code
author Chris Cannam
date Thu, 30 Jun 2016 15:46:14 +0100
parents 65b183494331
children ea5ae9dd10ba
comparison
equal deleted inserted replaced
1078:ee01a4062747 1079:7ebfb61b1701
58 58
59 ColourScale::~ColourScale() 59 ColourScale::~ColourScale()
60 { 60 {
61 } 61 }
62 62
63 ColourScale::Scale
64 ColourScale::getScale() const
65 {
66 return m_params.scale;
67 }
68
63 int 69 int
64 ColourScale::getPixel(double value) 70 ColourScale::getPixel(double value) const
65 { 71 {
66 double maxPixF = m_maxPixel; 72 double maxPixF = m_maxPixel;
67 73
68 if (m_params.scale == PhaseColourScale) { 74 if (m_params.scale == PhaseColourScale) {
69 double half = (maxPixF - 1.f) / 2.f; 75 double half = (maxPixF - 1.f) / 2.f;
110 } 116 }
111 return pixel; 117 return pixel;
112 } 118 }
113 119
114 QColor 120 QColor
115 ColourScale::getColourForPixel(int pixel, int rotation) 121 ColourScale::getColourForPixel(int pixel, int rotation) const
116 { 122 {
117 if (pixel < 0) { 123 if (pixel < 0) {
118 pixel = 0; 124 pixel = 0;
119 } 125 }
120 if (pixel > m_maxPixel) { 126 if (pixel > m_maxPixel) {