Mercurial > hg > orthanc-stone
changeset 1234:e99e09143c64 broker
integration mainline->broker
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Dec 2019 17:48:54 +0100 |
parents | f621b57c9f37 (current diff) 8154350aa195 (diff) |
children | e71ee3e88448 |
files | |
diffstat | 2 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyAlphaLayer.cpp Mon Dec 09 17:48:14 2019 +0100 +++ b/Framework/Radiography/RadiographyAlphaLayer.cpp Mon Dec 09 17:48:54 2019 +0100 @@ -91,6 +91,7 @@ return; // layer is outside the buffer } + printf("rendering alpha: %d \n", y1); t.Apply(tmp, cropped, interpolation, true /* clear */); float value = foreground_;
--- a/Framework/Toolbox/TextRenderer.cpp Mon Dec 09 17:48:14 2019 +0100 +++ b/Framework/Toolbox/TextRenderer.cpp Mon Dec 09 17:48:54 2019 +0100 @@ -57,7 +57,22 @@ posInString += utf8CharLength; } - return alphabet->RenderText(utf8String); + + std::auto_ptr<Orthanc::ImageAccessor> renderedText(alphabet->RenderText(utf8String)); + + // add a blank line on top of the text (to improve bilinear filtering of the topmost line) + std::auto_ptr<Orthanc::Image> renderedTextExtended(new Orthanc::Image(renderedText->GetFormat(), renderedText->GetWidth(), renderedText->GetHeight() + 1, true)); + + Orthanc::ImageAccessor textRegion; + Orthanc::ImageAccessor firstLineRegion; + + renderedTextExtended->GetRegion(firstLineRegion, 0, 0, renderedText->GetWidth(), 1); + Orthanc::ImageProcessing::Set(firstLineRegion, 0); + + renderedTextExtended->GetRegion(textRegion, 0, 1, renderedText->GetWidth(), renderedText->GetHeight()); + Orthanc::ImageProcessing::Copy(textRegion, *renderedText); + + return renderedTextExtended.release(); }