comparison Framework/Radiography/RadiographyAlphaLayer.cpp @ 1308:adf234ecaa00 broker

Merge
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 04 Mar 2020 10:21:54 +0100
parents 257f2c9a02ac
children
comparison
equal deleted inserted replaced
1307:8a28a9bf8876 1308:adf234ecaa00
21 21
22 #include "RadiographyAlphaLayer.h" 22 #include "RadiographyAlphaLayer.h"
23 23
24 #include "RadiographyScene.h" 24 #include "RadiographyScene.h"
25 25
26 #include <Core/Compatibility.h>
26 #include <Core/Images/Image.h> 27 #include <Core/Images/Image.h>
27 #include <Core/OrthancException.h> 28 #include <Core/OrthancException.h>
29
28 #include "../Toolbox/ImageGeometry.h" 30 #include "../Toolbox/ImageGeometry.h"
29 31
30 namespace OrthancStone 32 namespace OrthancStone
31 { 33 {
32 34
33 void RadiographyAlphaLayer::SetAlpha(Orthanc::ImageAccessor* image) 35 void RadiographyAlphaLayer::SetAlpha(Orthanc::ImageAccessor* image)
34 { 36 {
35 std::auto_ptr<Orthanc::ImageAccessor> raii(image); 37 std::unique_ptr<Orthanc::ImageAccessor> raii(image);
36 38
37 if (image == NULL) 39 if (image == NULL)
38 { 40 {
39 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); 41 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
40 } 42 }
43 { 45 {
44 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); 46 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat);
45 } 47 }
46 48
47 SetSize(image->GetWidth(), image->GetHeight()); 49 SetSize(image->GetWidth(), image->GetHeight());
48 alpha_ = raii; 50
51 #if __cplusplus < 201103L
52 alpha_.reset(raii.release());
53 #else
54 alpha_ = std::move(raii);
55 #endif
49 56
50 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); 57 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
51 } 58 }
52 59
53 void RadiographyAlphaLayer::Render(Orthanc::ImageAccessor& buffer, 60 void RadiographyAlphaLayer::Render(Orthanc::ImageAccessor& buffer,