Mercurial > hg > orthanc-stone
annotate Framework/Fonts/GlyphTextureAlphabet.h @ 1412:0cbc85e0c583 legacy-loader-refactoring
dummy
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 04 May 2020 15:28:30 +0200 |
parents | 8a0a62189f46 |
children | 30deba7bc8e2 |
rev | line source |
---|---|
577 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
577
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
577 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
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 | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "GlyphBitmapAlphabet.h" | |
25 | |
26 #include <Core/Images/ImageAccessor.h> | |
27 | |
28 namespace OrthancStone | |
29 { | |
30 class GlyphTextureAlphabet : public boost::noncopyable | |
31 { | |
32 public: | |
33 class TextureLocation : public Orthanc::IDynamicObject | |
34 { | |
35 private: | |
36 unsigned int x_; | |
37 unsigned int y_; | |
38 | |
39 public: | |
40 TextureLocation(unsigned int x, | |
41 unsigned int y) : | |
42 x_(x), | |
43 y_(y) | |
44 { | |
45 } | |
46 | |
47 unsigned int GetX() const | |
48 { | |
49 return x_; | |
50 } | |
51 | |
52 unsigned int GetY() const | |
53 { | |
54 return y_; | |
55 } | |
56 }; | |
57 | |
58 private: | |
59 class GlyphSizeVisitor; | |
60 class TextureGenerator; | |
61 class RenderTextVisitor; | |
62 | |
63 GlyphAlphabet alphabet_; | |
1298
8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
64 std::unique_ptr<Orthanc::ImageAccessor> texture_; |
577 | 65 unsigned int textureWidth_; |
66 unsigned int textureHeight_; | |
67 | |
68 public: | |
69 GlyphTextureAlphabet(const GlyphBitmapAlphabet& sourceAlphabet); | |
70 | |
71 const Orthanc::ImageAccessor& GetTexture() const; | |
72 | |
73 Orthanc::ImageAccessor* ReleaseTexture(); | |
74 | |
75 Orthanc::ImageAccessor* RenderText(const std::string& utf8); | |
76 | |
77 const GlyphAlphabet& GetAlphabet() const | |
78 { | |
79 return alphabet_; | |
80 } | |
81 | |
82 unsigned int GetTextureWidth() const | |
83 { | |
84 return textureWidth_; | |
85 } | |
86 | |
87 unsigned int GetTextureHeight() const | |
88 { | |
89 return textureHeight_; | |
90 } | |
91 }; | |
92 } |