Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/TextRenderer.h @ 1471:28c64c246312
working on a shared library
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 15 Jun 2020 12:57:54 +0200 |
parents | 182bf3106ee2 |
children |
comparison
equal
deleted
inserted
replaced
1470:390b0c30ba19 | 1471:28c64c246312 |
---|---|
20 | 20 |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include <Images/Image.h> | 24 #include <Images/Image.h> |
25 #include <EmbeddedResources.h> | |
26 | 25 |
27 namespace OrthancStone | 26 namespace OrthancStone |
28 { | 27 { |
29 // Helpers methods to render text in bitmaps. | 28 // Helpers methods to render text in bitmaps. |
30 // Compared to the GlyphBitmapAlphabet::RenderText, these methods do not need a | 29 // Compared to the GlyphBitmapAlphabet::RenderText, these methods do not need a |
31 // code page. | 30 // code page. |
32 class TextRenderer : public boost::noncopyable | 31 class TextRenderer : public boost::noncopyable |
33 { | 32 { |
34 public: | 33 public: |
35 // simply renders text in GrayScale8 with a black background and a white text | 34 // simply renders text in GrayScale8 with a black background and a white text |
36 static Orthanc::ImageAccessor* Render(Orthanc::EmbeddedResources::FileResourceId resource, | 35 static Orthanc::ImageAccessor* Render(const std::string& ttf, |
37 unsigned int fontSize, | 36 unsigned int fontSize, |
38 const std::string& utf8String); | 37 const std::string& utf8String); |
39 | 38 |
40 // renders text in "color" with alpha in a RGBA32 image | 39 // renders text in "color" with alpha in a RGBA32 image |
41 static Orthanc::ImageAccessor* RenderWithAlpha(Orthanc::EmbeddedResources::FileResourceId resource, | 40 static Orthanc::ImageAccessor* RenderWithAlpha(const std::string& ttf, |
42 unsigned int fontSize, | 41 unsigned int fontSize, |
43 const std::string& utf8String, | 42 const std::string& utf8String, |
44 uint8_t foreground); | 43 uint8_t foreground); |
45 | 44 |
46 // // renders text in color + a border with alpha in a RGBA32 image | 45 // // renders text in color + a border with alpha in a RGBA32 image |
47 // static Orthanc::ImageAccessor* RenderWithAlpha(Orthanc::EmbeddedResources::FileResourceId resource, | 46 // static Orthanc::ImageAccessor* RenderWithAlpha(const std::string& ttf, |
48 // unsigned int fontSize, | 47 // unsigned int fontSize, |
49 // const std::string& utf8String, | 48 // const std::string& utf8String, |
50 // uint8_t foreground, | 49 // uint8_t foreground, |
51 // uint8_t borderColor); | 50 // uint8_t borderColor); |
52 }; | 51 }; |