Mercurial > hg > orthanc-stone
comparison Framework/Layers/GrayscaleFrameRenderer.cpp @ 338:b3b3fa0e3689 am-2
BitmapStack
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 19 Oct 2018 12:50:38 +0200 |
parents | c80b5bddf86b |
children | 557c8ff1db5c |
comparison
equal
deleted
inserted
replaced
337:c4d4213f095c | 338:b3b3fa0e3689 |
---|---|
25 | 25 |
26 namespace OrthancStone | 26 namespace OrthancStone |
27 { | 27 { |
28 CairoSurface* GrayscaleFrameRenderer::GenerateDisplay(const RenderStyle& style) | 28 CairoSurface* GrayscaleFrameRenderer::GenerateDisplay(const RenderStyle& style) |
29 { | 29 { |
30 assert(frame_->GetFormat() == Orthanc::PixelFormat_Float32); | |
31 | |
30 std::auto_ptr<CairoSurface> result; | 32 std::auto_ptr<CairoSurface> result; |
31 | 33 |
32 float windowCenter, windowWidth; | 34 float windowCenter, windowWidth; |
33 style.ComputeWindowing(windowCenter, windowWidth, | 35 style.ComputeWindowing(windowCenter, windowWidth, |
34 defaultWindowCenter_, defaultWindowWidth_); | 36 defaultWindowCenter_, defaultWindowWidth_); |
124 if (frame == NULL) | 126 if (frame == NULL) |
125 { | 127 { |
126 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | 128 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
127 } | 129 } |
128 | 130 |
129 converter.ConvertFrame(frame_); | 131 converter.ConvertFrameInplace(frame_); |
130 assert(frame_.get() != NULL); | 132 assert(frame_.get() != NULL); |
131 | 133 |
132 if (frame_->GetFormat() != Orthanc::PixelFormat_Float32) | 134 if (frame_->GetFormat() != Orthanc::PixelFormat_Float32) |
133 { | 135 { |
134 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); | 136 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); |