Mercurial > hg > svgui
comparison layer/PaintAssistant.h @ 1078:ee01a4062747 spectrogram-minor-refactor
Move drawVisibleText to PaintAssistant
author | Chris Cannam |
---|---|
date | Thu, 30 Jun 2016 12:40:22 +0100 |
parents | b66fb15de477 |
children | dc6457ac4d07 |
comparison
equal
deleted
inserted
replaced
1077:5144d7185fb5 | 1078:ee01a4062747 |
---|---|
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _PAINT_ASSISTANT_H_ | 16 #ifndef PAINT_ASSISTANT_H |
17 #define _PAINT_ASSISTANT_H_ | 17 #define PAINT_ASSISTANT_H |
18 | 18 |
19 #include <QRect> | 19 #include <QRect> |
20 #include <vector> | 20 #include <vector> |
21 | 21 |
22 class QPainter; | 22 class QPainter; |
23 class Layer; | |
24 class LayerGeometryProvider; | |
23 | 25 |
24 class PaintAssistant | 26 class PaintAssistant |
25 { | 27 { |
26 public: | 28 public: |
27 enum Scale { LinearScale, MeterScale, dBScale }; | 29 enum Scale { LinearScale, MeterScale, dBScale }; |
32 std::vector<int> *markCoordRtns = 0); | 34 std::vector<int> *markCoordRtns = 0); |
33 | 35 |
34 static int getYForValue(Scale scale, double value, | 36 static int getYForValue(Scale scale, double value, |
35 double minVal, double maxVal, | 37 double minVal, double maxVal, |
36 int minY, int height); | 38 int minY, int height); |
39 | |
40 enum TextStyle { | |
41 BoxedText, | |
42 OutlinedText, | |
43 OutlinedItalicText | |
44 }; | |
45 | |
46 static void drawVisibleText(const LayerGeometryProvider *, | |
47 QPainter &p, int x, int y, | |
48 QString text, TextStyle style); | |
37 }; | 49 }; |
38 | 50 |
39 #endif | 51 #endif |