Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Toolbox/TextRenderer.h @ 1798:41f3872bd7d2
create angle tool and delete measure tool
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 20 May 2021 11:10:14 +0200 |
parents | 9ac2a65d4172 |
children | 3889ae96d2e9 |
rev | line source |
---|---|
1463 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1739
9ac2a65d4172
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
1463 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
1463 | 9 * as published by the Free Software Foundation, either version 3 of |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
15 * Lesser General Public License for more details. |
1463 | 16 * |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
18 * License along with this program. If not, see |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
1463 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include <Images/Image.h> | |
26 | |
27 namespace OrthancStone | |
28 { | |
29 // Helpers methods to render text in bitmaps. | |
30 // Compared to the GlyphBitmapAlphabet::RenderText, these methods do not need a | |
31 // code page. | |
32 class TextRenderer : public boost::noncopyable | |
33 { | |
34 public: | |
35 // simply renders text in GrayScale8 with a black background and a white text | |
1471
28c64c246312
working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1463
diff
changeset
|
36 static Orthanc::ImageAccessor* Render(const std::string& ttf, |
1463 | 37 unsigned int fontSize, |
38 const std::string& utf8String); | |
39 | |
40 // renders text in "color" with alpha in a RGBA32 image | |
1471
28c64c246312
working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1463
diff
changeset
|
41 static Orthanc::ImageAccessor* RenderWithAlpha(const std::string& ttf, |
1463 | 42 unsigned int fontSize, |
43 const std::string& utf8String, | |
44 uint8_t foreground); | |
45 | |
46 // // renders text in color + a border with alpha in a RGBA32 image | |
1471
28c64c246312
working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1463
diff
changeset
|
47 // static Orthanc::ImageAccessor* RenderWithAlpha(const std::string& ttf, |
1463 | 48 // unsigned int fontSize, |
49 // const std::string& utf8String, | |
50 // uint8_t foreground, | |
51 // uint8_t borderColor); | |
52 }; | |
53 } |