Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyTextLayer.h @ 1224:37bc7f115f81 broker
integration mainline->broker
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 07 Dec 2019 18:45:37 +0100 |
parents | b519c1c878f1 9ee6b28f53e8 |
children | 68579a31eeb4 |
comparison
equal
deleted
inserted
replaced
1222:21c2b0eee53c | 1224:37bc7f115f81 |
---|---|
29 | 29 |
30 class RadiographyTextLayer : public RadiographyAlphaLayer | 30 class RadiographyTextLayer : public RadiographyAlphaLayer |
31 { | 31 { |
32 private: | 32 private: |
33 std::string text_; | 33 std::string text_; |
34 std::string font_; | |
34 unsigned int fontSize_; | 35 unsigned int fontSize_; |
35 uint8_t foreground_; | 36 uint8_t foregroundGreyLevel_; |
36 | 37 |
37 static bool fontHasBeenConfigured_; | 38 static std::map<std::string, Orthanc::EmbeddedResources::FileResourceId> fonts_; |
38 static Orthanc::EmbeddedResources::FileResourceId fontResourceId_; | |
39 public: | 39 public: |
40 RadiographyTextLayer(const RadiographyScene& scene) : | 40 RadiographyTextLayer(const RadiographyScene& scene) : |
41 RadiographyAlphaLayer(scene) | 41 RadiographyAlphaLayer(scene) |
42 { | 42 { |
43 } | 43 } |
44 | 44 |
45 void SetText(const std::string& utf8, unsigned int fontSize, uint8_t foreground); | 45 void SetText(const std::string& utf8, const std::string& font, unsigned int fontSize, uint8_t foregroundGreyLevel); |
46 | 46 |
47 const std::string& GetText() const | 47 const std::string& GetText() const |
48 { | 48 { |
49 return text_; | 49 return text_; |
50 } | |
51 | |
52 const std::string& GetFont() const | |
53 { | |
54 return font_; | |
50 } | 55 } |
51 | 56 |
52 unsigned int GetFontSize() const | 57 unsigned int GetFontSize() const |
53 { | 58 { |
54 return fontSize_; | 59 return fontSize_; |
55 } | 60 } |
56 | 61 |
57 uint8_t GetForeground() const | 62 uint8_t GetForegroundGreyLevel() const |
58 { | 63 { |
59 return foreground_; | 64 return foregroundGreyLevel_; |
60 } | 65 } |
61 | 66 |
62 static void SetFont(Orthanc::EmbeddedResources::FileResourceId fontResourceId) | 67 static void RegisterFont(const std::string& name, Orthanc::EmbeddedResources::FileResourceId fontResourceId) |
63 { | 68 { |
64 fontResourceId_ = fontResourceId; | 69 fonts_[name] = fontResourceId; |
65 fontHasBeenConfigured_ = true; | |
66 } | 70 } |
67 }; | 71 }; |
68 } | 72 } |