Mercurial > hg > svgui
comparison view/ViewProxy.h @ 1085:179ea8a2f650 spectrogram-minor-refactor
Add VerticalBinLayer to SpectrogramLayer
author | Chris Cannam |
---|---|
date | Fri, 01 Jul 2016 17:54:31 +0100 |
parents | ee01a4062747 |
children | a34a2a25907c |
comparison
equal
deleted
inserted
replaced
1084:db976e9f385a | 1085:179ea8a2f650 |
---|---|
61 double minFreq, double maxFreq, | 61 double minFreq, double maxFreq, |
62 bool logarithmic) const { | 62 bool logarithmic) const { |
63 return m_scaleFactor * | 63 return m_scaleFactor * |
64 m_view->getYForFrequency(frequency, minFreq, maxFreq, logarithmic); | 64 m_view->getYForFrequency(frequency, minFreq, maxFreq, logarithmic); |
65 } | 65 } |
66 virtual double getFrequencyForY(int y, double minFreq, double maxFreq, | 66 virtual double getFrequencyForY(double y, double minFreq, double maxFreq, |
67 bool logarithmic) const { | 67 bool logarithmic) const { |
68 double f0 = m_view->getFrequencyForY | 68 return m_view->getFrequencyForY |
69 (y / m_scaleFactor, minFreq, maxFreq, logarithmic); | 69 (y / m_scaleFactor, minFreq, maxFreq, logarithmic); |
70 if (m_scaleFactor == 1) return f0; | |
71 double f1 = m_view->getFrequencyForY | |
72 ((y / m_scaleFactor) + 1, minFreq, maxFreq, logarithmic); | |
73 return f0 + ((f1 - f0) * (y % m_scaleFactor)) / m_scaleFactor; | |
74 } | 70 } |
75 virtual int getTextLabelHeight(const Layer *layer, QPainter &paint) const { | 71 virtual int getTextLabelHeight(const Layer *layer, QPainter &paint) const { |
76 return m_scaleFactor * m_view->getTextLabelHeight(layer, paint); | 72 return m_scaleFactor * m_view->getTextLabelHeight(layer, paint); |
77 } | 73 } |
78 virtual bool getValueExtents(QString unit, double &min, double &max, | 74 virtual bool getValueExtents(QString unit, double &min, double &max, |