Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyWidget.cpp @ 1258:9c20ae049669
more logs to debug exceptions in Render
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 14 Jan 2020 15:22:10 +0100 |
parents | 771913258728 |
children | 2d8ab34c8c91 |
comparison
equal
deleted
inserted
replaced
1257:6af941a68472 | 1258:9c20ae049669 |
---|---|
74 floatBuffer_->GetWidth() != width || | 74 floatBuffer_->GetWidth() != width || |
75 floatBuffer_->GetHeight() != height) | 75 floatBuffer_->GetHeight() != height) |
76 { | 76 { |
77 floatBuffer_.reset(new Orthanc::Image( | 77 floatBuffer_.reset(new Orthanc::Image( |
78 Orthanc::PixelFormat_Float32, width, height, false)); | 78 Orthanc::PixelFormat_Float32, width, height, false)); |
79 | |
80 if (floatBuffer_.get() == NULL) | |
81 { | |
82 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotEnoughMemory, "RadiographyWidget::RenderInternal: unable to allocate float buffer"); | |
83 } | |
79 } | 84 } |
80 | 85 |
81 if (cairoBuffer_.get() == NULL || | 86 if (cairoBuffer_.get() == NULL || |
82 cairoBuffer_->GetWidth() != width || | 87 cairoBuffer_->GetWidth() != width || |
83 cairoBuffer_->GetHeight() != height) | 88 cairoBuffer_->GetHeight() != height) |
84 { | 89 { |
85 cairoBuffer_.reset(new CairoSurface(width, height, false /* no alpha */)); | 90 cairoBuffer_.reset(new CairoSurface(width, height, false /* no alpha */)); |
91 | |
92 if (cairoBuffer_.get() == NULL) | |
93 { | |
94 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotEnoughMemory, "RadiographyWidget::RenderInternal: unable to allocate cairo buffer"); | |
95 } | |
86 } | 96 } |
87 | 97 |
88 RenderBackground(*floatBuffer_, 0.0, 65535.0); | 98 RenderBackground(*floatBuffer_, 0.0, 65535.0); |
89 | 99 |
90 scene_->Render(*floatBuffer_, GetView().GetMatrix(), interpolation, true); | 100 scene_->Render(*floatBuffer_, GetView().GetMatrix(), interpolation, true); |