comparison UnitTestsSources/ImageToolboxTests.cpp @ 1298:8a0a62189f46

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 16:31:30 +0100
parents 86400fa16091
children 30deba7bc8e2
comparison
equal deleted inserted replaced
1296:86400fa16091 1298:8a0a62189f46
21 #include <Framework/Toolbox/ImageToolbox.h> 21 #include <Framework/Toolbox/ImageToolbox.h>
22 22
23 // #include <boost/chrono.hpp> 23 // #include <boost/chrono.hpp>
24 // #include <boost/lexical_cast.hpp> 24 // #include <boost/lexical_cast.hpp>
25 25
26 #include <Core/Compatibility.h>
26 #include <Core/Images/Image.h> 27 #include <Core/Images/Image.h>
27 #include <Core/Images/PixelTraits.h> 28 #include <Core/Images/PixelTraits.h>
28 29
29 #include "stdint.h" 30 #include "stdint.h"
30 31
50 // ... 51 // ...
51 // 16 will be 15 times 52 // 16 will be 15 times
52 53
53 size_t pixCounter = 0; 54 size_t pixCounter = 0;
54 55
55 std::auto_ptr<Orthanc::Image> image(new Orthanc::Image( 56 std::unique_ptr<Orthanc::Image> image(new Orthanc::Image(
56 Orthanc::PixelFormat_Grayscale8, W, H, false)); 57 Orthanc::PixelFormat_Grayscale8, W, H, false));
57 58
58 for (unsigned int y = 0; y < H; ++y) 59 for (unsigned int y = 0; y < H; ++y)
59 { 60 {
60 uint8_t* buffer = reinterpret_cast<uint8_t*>(image->GetRow(y)); 61 uint8_t* buffer = reinterpret_cast<uint8_t*>(image->GetRow(y));
90 // ... 91 // ...
91 // 16 will be 15 times 92 // 16 will be 15 times
92 93
93 size_t pixCounter = 0; 94 size_t pixCounter = 0;
94 95
95 std::auto_ptr<Orthanc::Image> image(new Orthanc::Image( 96 std::unique_ptr<Orthanc::Image> image(new Orthanc::Image(
96 Orthanc::PixelFormat_Grayscale8, W, H, false)); 97 Orthanc::PixelFormat_Grayscale8, W, H, false));
97 98
98 for (unsigned int y = 0; y < H; ++y) 99 for (unsigned int y = 0; y < H; ++y)
99 { 100 {
100 uint8_t* buffer = reinterpret_cast<uint8_t*>(image->GetRow(y)); 101 uint8_t* buffer = reinterpret_cast<uint8_t*>(image->GetRow(y));
131 // ... 132 // ...
132 // 16 will be 15 times 133 // 16 will be 15 times
133 134
134 size_t pixCounter = 0; 135 size_t pixCounter = 0;
135 136
136 std::auto_ptr<Orthanc::Image> image(new Orthanc::Image( 137 std::unique_ptr<Orthanc::Image> image(new Orthanc::Image(
137 Format, W, H, false)); 138 Format, W, H, false));
138 139
139 typedef typename Orthanc::PixelTraits<Format>::PixelType PixelType; 140 typedef typename Orthanc::PixelTraits<Format>::PixelType PixelType;
140 141
141 PixelType pixValue = 0; 142 PixelType pixValue = 0;
201 // ... 202 // ...
202 // 16 will be 15 times 203 // 16 will be 15 times
203 204
204 size_t pixCounter = 0; 205 size_t pixCounter = 0;
205 206
206 std::auto_ptr<Orthanc::Image> image(new Orthanc::Image( 207 std::unique_ptr<Orthanc::Image> image(new Orthanc::Image(
207 Format, W, H, false)); 208 Format, W, H, false));
208 209
209 typedef typename Orthanc::PixelTraits<Format>::PixelType PixelType; 210 typedef typename Orthanc::PixelTraits<Format>::PixelType PixelType;
210 211
211 PixelType pixValue = 0; 212 PixelType pixValue = 0;