Mercurial > hg > orthanc-wsi
comparison Framework/Algorithms/PyramidReader.cpp @ 199:a1c265cb2174
replacing deprecated std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 06 Jul 2020 16:29:41 +0200 |
parents | f299c191cd76 |
children | 1e864138f0da |
comparison
equal
deleted
inserted
replaced
198:2d3fe6967894 | 199:a1c265cb2174 |
---|---|
21 | 21 |
22 #include "../PrecompiledHeadersWSI.h" | 22 #include "../PrecompiledHeadersWSI.h" |
23 #include "PyramidReader.h" | 23 #include "PyramidReader.h" |
24 | 24 |
25 #include "../ImageToolbox.h" | 25 #include "../ImageToolbox.h" |
26 | |
27 #include <Compatibility.h> // For std::unique_ptr | |
26 #include <Logging.h> | 28 #include <Logging.h> |
27 #include <OrthancException.h> | 29 #include <OrthancException.h> |
28 | 30 |
29 #include <cassert> | 31 #include <cassert> |
30 | 32 |
38 unsigned int tileY_; | 40 unsigned int tileY_; |
39 bool hasRawTile_; | 41 bool hasRawTile_; |
40 std::string rawTile_; | 42 std::string rawTile_; |
41 ImageCompression rawTileCompression_; | 43 ImageCompression rawTileCompression_; |
42 | 44 |
43 std::auto_ptr<Orthanc::ImageAccessor> decoded_; | 45 std::unique_ptr<Orthanc::ImageAccessor> decoded_; |
44 | 46 |
45 bool IsRepaintNeeded() const | 47 bool IsRepaintNeeded() const |
46 { | 48 { |
47 return (that_.parameters_.IsRepaintBackground() && | 49 return (that_.parameters_.IsRepaintBackground() && |
48 ((tileX_ + 1) * that_.sourceTileWidth_ > that_.levelWidth_ || | 50 ((tileX_ + 1) * that_.sourceTileWidth_ > that_.levelWidth_ || |
195 void PyramidReader::CheckTileSize(const std::string& tile, | 197 void PyramidReader::CheckTileSize(const std::string& tile, |
196 ImageCompression compression) const | 198 ImageCompression compression) const |
197 { | 199 { |
198 if (parameters_.IsSafetyCheck()) | 200 if (parameters_.IsSafetyCheck()) |
199 { | 201 { |
200 std::auto_ptr<Orthanc::ImageAccessor> decoded(ImageToolbox::DecodeTile(tile, compression)); | 202 std::unique_ptr<Orthanc::ImageAccessor> decoded(ImageToolbox::DecodeTile(tile, compression)); |
201 CheckTileSize(*decoded); | 203 CheckTileSize(*decoded); |
202 } | 204 } |
203 } | 205 } |
204 | 206 |
205 | 207 |