Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyTextLayer.cpp @ 1196:a5f2a6b04a31
RadiographyScene: windowing is now only applied to the Dicom layer
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 27 Nov 2019 17:51:33 +0100 |
parents | f417a0ae282b |
children | ab958fd99b07 |
comparison
equal
deleted
inserted
replaced
1191:c6a36ecd641d | 1196:a5f2a6b04a31 |
---|---|
28 { | 28 { |
29 bool RadiographyTextLayer::fontHasBeenConfigured_ = false; | 29 bool RadiographyTextLayer::fontHasBeenConfigured_ = false; |
30 Orthanc::EmbeddedResources::FileResourceId RadiographyTextLayer::fontResourceId_; | 30 Orthanc::EmbeddedResources::FileResourceId RadiographyTextLayer::fontResourceId_; |
31 | 31 |
32 void RadiographyTextLayer::LoadText(const std::string& utf8, | 32 void RadiographyTextLayer::LoadText(const std::string& utf8, |
33 size_t fontSize, | 33 unsigned int fontSize, |
34 uint8_t foreground) | 34 uint8_t foreground) |
35 { | 35 { |
36 if (!fontHasBeenConfigured_) | 36 if (!fontHasBeenConfigured_) |
37 { | 37 { |
38 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls, "No font has been loaded"); | 38 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls, "No font has been loaded"); |
43 foreground_ = foreground; | 43 foreground_ = foreground; |
44 | 44 |
45 SetAlpha(TextRenderer::Render(fontResourceId_, | 45 SetAlpha(TextRenderer::Render(fontResourceId_, |
46 fontSize_, | 46 fontSize_, |
47 text_)); | 47 text_)); |
48 SetForegroundValue(foreground * 256.0f); | |
48 } | 49 } |
49 } | 50 } |