comparison Plugin/DecodedImageAdapter.cpp @ 227:e4def26f0fd3

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 13 Mar 2020 12:38:45 +0100
parents aee499712ac4
children cce89307af28
comparison
equal deleted inserted replaced
226:aee499712ac4 227:e4def26f0fd3
148 !GetJsonFromOrthanc(tags, context_, "/instances/" + instanceId + "/tags")) 148 !GetJsonFromOrthanc(tags, context_, "/instances/" + instanceId + "/tags"))
149 { 149 {
150 throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource); 150 throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource);
151 } 151 }
152 152
153 std::auto_ptr<OrthancImageWrapper> image(new OrthancImageWrapper(context_, OrthancPluginDecodeDicomImage(context_, dicom.c_str(), dicom.size(), frameIndex))); 153 std::unique_ptr<OrthancImageWrapper> image(
154 new OrthancImageWrapper(context_, OrthancPluginDecodeDicomImage(
155 context_, dicom.c_str(), dicom.size(), frameIndex)));
154 156
155 Json::Value json; 157 Json::Value json;
156 if (GetCornerstoneMetadata(json, tags, *image)) 158 if (GetCornerstoneMetadata(json, tags, *image))
157 { 159 {
158 if (type == CompressionType_Deflate) 160 if (type == CompressionType_Deflate)
313 { 315 {
314 Orthanc::ImageAccessor accessor; 316 Orthanc::ImageAccessor accessor;
315 accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()), image.GetWidth(), 317 accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()), image.GetWidth(),
316 image.GetHeight(), image.GetPitch(), image.GetBuffer()); 318 image.GetHeight(), image.GetPitch(), image.GetBuffer());
317 319
318 std::auto_ptr<Orthanc::ImageBuffer> buffer; 320 std::unique_ptr<Orthanc::ImageBuffer> buffer;
319 321
320 Orthanc::ImageAccessor converted; 322 Orthanc::ImageAccessor converted;
321 323
322 switch (accessor.GetFormat()) 324 switch (accessor.GetFormat())
323 { 325 {
425 { 427 {
426 Orthanc::ImageAccessor accessor; 428 Orthanc::ImageAccessor accessor;
427 accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()), image.GetWidth(), 429 accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()), image.GetWidth(),
428 image.GetHeight(), image.GetPitch(), image.GetBuffer()); 430 image.GetHeight(), image.GetPitch(), image.GetBuffer());
429 431
430 std::auto_ptr<Orthanc::ImageBuffer> buffer; 432 std::unique_ptr<Orthanc::ImageBuffer> buffer;
431 433
432 Orthanc::ImageAccessor converted; 434 Orthanc::ImageAccessor converted;
433 435
434 if (accessor.GetFormat() == Orthanc::PixelFormat_Grayscale8 || 436 if (accessor.GetFormat() == Orthanc::PixelFormat_Grayscale8 ||
435 accessor.GetFormat() == Orthanc::PixelFormat_RGB24) 437 accessor.GetFormat() == Orthanc::PixelFormat_RGB24)