Read@CVL
Drawer.h
Go to the documentation of this file.
1 /*******************************************************************************************************
2  ReadFramework is the basis for modules developed at CVL/TU Wien for the EU project READ.
3 
4  Copyright (C) 2016 Markus Diem <diem@caa.tuwien.ac.at>
5  Copyright (C) 2016 Stefan Fiel <fiel@caa.tuwien.ac.at>
6  Copyright (C) 2016 Florian Kleber <kleber@caa.tuwien.ac.at>
7 
8  This file is part of ReadFramework.
9 
10  ReadFramework is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  ReadFramework is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23  The READ project has received funding from the European Union’s Horizon 2020
24  research and innovation programme under grant agreement No 674943
25 
26  related links:
27  [1] http://www.caa.tuwien.ac.at/cvl/
28  [2] https://transkribus.eu/Transkribus/
29  [3] https://github.com/TUWien/
30  [4] http://nomacs.org
31  *******************************************************************************************************/
32 
33 #pragma once
34 
35 #include <vector>
36 
37 #pragma warning(push, 0) // no warnings from includes
38 #include <QColor>
39 #include <QPen>
40 
41 #include <opencv2/core.hpp>
42 #pragma warning(pop)
43 
44 #ifndef DllCoreExport
45 #ifdef DLL_CORE_EXPORT
46 #define DllCoreExport Q_DECL_EXPORT
47 #else
48 #define DllCoreExport Q_DECL_IMPORT
49 #endif
50 #endif
51 
52 // Qt/CV defines
53 namespace cv {
54  class Mat;
55 }
56 
57 class QPainter;
58 class QPointF;
59 class QRectF;
60 class QPen;
61 
62 namespace rdf {
63 
64 // read defines
65 
66 namespace Drawer {
67 
68  DllCoreExport void drawPoints(QPainter& p, const std::vector<cv::Point>& pts);
69  DllCoreExport void drawPoints(QPainter& p, const QVector<QPointF>& pts);
70 
71  DllCoreExport void drawRects(QPainter& p, const QVector<QRectF>& rects);
72 
73  // add general drawing functions here
74 
75 }
76 
77 namespace ColorManager {
78 
79  DllCoreExport QColor randColor(double alpha = 1.0);
80  DllCoreExport QColor getColor(int idx, double alpha = 1.0);
81  DllCoreExport QVector<QColor> colors();
82 
83  DllCoreExport QColor lightGray(double alpha = 1.0);
84  DllCoreExport QColor darkGray(double alpha = 1.0);
85  DllCoreExport QColor red(double alpha = 1.0);
86  DllCoreExport QColor green(double alpha = 1.0);
87  DllCoreExport QColor blue(double alpha = 1.0);
88  DllCoreExport QColor pink(double alpha = 1.0);
89  DllCoreExport QColor white(double alpha = 1.0);
90 
91  // add your favorite colors here
92 }
93 
94 }
DllCoreExport QColor lightGray(double alpha=1.0)
Returns a light gray.
Definition: Drawer.cpp:137
DllCoreExport QColor randColor(double alpha=1.0)
Returns a pleasent color.
Definition: Drawer.cpp:79
DllCoreExport QColor red(double alpha=1.0)
Returns a dark red.
Definition: Drawer.cpp:155
Definition: Drawer.h:53
DllCoreExport QVector< QColor > colors()
Returns our color palette.
Definition: Drawer.cpp:118
DllCoreExport QColor darkGray(double alpha=1.0)
Returns a dark gray.
Definition: Drawer.cpp:146
DllCoreExport QColor blue(double alpha=1.0)
Returns the TU Wien blue.
Definition: Drawer.cpp:174
DllCoreExport QColor getColor(int idx, double alpha=1.0)
Returns a pleasent color.
Definition: Drawer.cpp:94
DllCoreExport void drawRects(QPainter &p, const QVector< QRectF > &rects)
Definition: Drawer.cpp:66
Definition: Algorithms.cpp:45
DllCoreExport QColor pink(double alpha=1.0)
Returns a pink color - not the artist.
Definition: Drawer.cpp:183
DllCoreExport QColor white(double alpha=1.0)
Returns white - yes it&#39;s #fff.
Definition: Drawer.cpp:192
#define DllCoreExport
Definition: Drawer.h:48
DllCoreExport QColor green(double alpha=1.0)
Returns a light green.
Definition: Drawer.cpp:164
DllCoreExport void drawPoints(QPainter &p, const QVector< QPointF > &pts)
Definition: Drawer.cpp:60