Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Toolbox/TextRenderer.h @ 1881:a05529952510
fix build of unit tests in SDL project
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 12 Jan 2022 10:01:25 +0100 |
parents | 7053b8a0aaec |
children | 07964689cb0b |
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 | |
1871
7053b8a0aaec
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1870
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
7053b8a0aaec
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1870
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1463 | 7 * |
8 * 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
|
9 * modify it under the terms of the GNU Lesser General Public License |
1463 | 10 * as published by the Free Software Foundation, either version 3 of |
11 * the License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * 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
|
15 * 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
|
16 * Lesser General Public License for more details. |
1463 | 17 * |
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
|
18 * 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
|
19 * 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
|
20 * <http://www.gnu.org/licenses/>. |
1463 | 21 **/ |
22 | |
23 | |
24 #pragma once | |
25 | |
26 #include <Images/Image.h> | |
27 | |
28 namespace OrthancStone | |
29 { | |
30 // Helpers methods to render text in bitmaps. | |
31 // Compared to the GlyphBitmapAlphabet::RenderText, these methods do not need a | |
32 // code page. | |
33 class TextRenderer : public boost::noncopyable | |
34 { | |
35 public: | |
36 // 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
|
37 static Orthanc::ImageAccessor* Render(const std::string& ttf, |
1463 | 38 unsigned int fontSize, |
39 const std::string& utf8String); | |
40 | |
41 // 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
|
42 static Orthanc::ImageAccessor* RenderWithAlpha(const std::string& ttf, |
1463 | 43 unsigned int fontSize, |
44 const std::string& utf8String, | |
45 uint8_t foreground); | |
46 | |
47 // // 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
|
48 // static Orthanc::ImageAccessor* RenderWithAlpha(const std::string& ttf, |
1463 | 49 // unsigned int fontSize, |
50 // const std::string& utf8String, | |
51 // uint8_t foreground, | |
52 // uint8_t borderColor); | |
53 }; | |
54 } |