Mercurial > hg > orthanc-stone
diff Framework/Radiography/RadiographyScene.cpp @ 1299:c38c89684d83 broker
replacing std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Mar 2020 17:21:24 +0100 |
parents | 6ab03e429f06 |
children | 257f2c9a02ac |
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyScene.cpp Sun Feb 23 15:32:24 2020 +0100 +++ b/Framework/Radiography/RadiographyScene.cpp Mon Mar 02 17:21:24 2020 +0100 @@ -127,7 +127,7 @@ void RadiographyScene::_RegisterLayer(RadiographyLayer* layer) { - std::auto_ptr<RadiographyLayer> raii(layer); + std::unique_ptr<RadiographyLayer> raii(layer); // LOG(INFO) << "Registering layer: " << countLayers_; @@ -324,7 +324,7 @@ RadiographyLayer::Geometry* centerGeometry, bool isCenterGeometry) { - std::auto_ptr<RadiographyTextLayer> alpha(new RadiographyTextLayer(*this)); + std::unique_ptr<RadiographyTextLayer> alpha(new RadiographyTextLayer(*this)); alpha->SetText(utf8, font, fontSize, foreground); if (centerGeometry != NULL) { @@ -352,7 +352,7 @@ unsigned int height, RadiographyLayer::Geometry* geometry) { - std::auto_ptr<Orthanc::Image> block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false)); + std::unique_ptr<Orthanc::Image> block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false)); for (unsigned int padding = 0; (width > 2 * padding) && (height > 2 * padding); @@ -381,7 +381,7 @@ float foreground, RadiographyLayer::Geometry* geometry) { - std::auto_ptr<RadiographyMaskLayer> mask(new RadiographyMaskLayer(*this, dicomLayer, foreground)); + std::unique_ptr<RadiographyMaskLayer> mask(new RadiographyMaskLayer(*this, dicomLayer, foreground)); mask->SetCorners(corners); if (geometry != NULL) { @@ -394,7 +394,7 @@ RadiographyLayer& RadiographyScene::LoadAlphaBitmap(Orthanc::ImageAccessor* bitmap, RadiographyLayer::Geometry *geometry) { - std::auto_ptr<RadiographyAlphaLayer> alpha(new RadiographyAlphaLayer(*this)); + std::unique_ptr<RadiographyAlphaLayer> alpha(new RadiographyAlphaLayer(*this)); alpha->SetAlpha(bitmap); if (geometry != NULL) { @@ -533,7 +533,7 @@ content.assign(reinterpret_cast<const char*>(message.GetAnswer()), message.GetAnswerSize()); } - std::auto_ptr<Orthanc::PamReader> reader(new Orthanc::PamReader); + std::unique_ptr<Orthanc::PamReader> reader(new Orthanc::PamReader); reader->ReadFromMemory(content); dynamic_cast<RadiographyDicomLayer*>(layer->second)->SetSourceImage(reader.release()); @@ -724,7 +724,7 @@ Render(layers, view, interpolation, applyWindowing); - std::auto_ptr<Orthanc::Image> rendered(new Orthanc::Image(Orthanc::PixelFormat_Grayscale16, + std::unique_ptr<Orthanc::Image> rendered(new Orthanc::Image(Orthanc::PixelFormat_Grayscale16, layers.GetWidth(), layers.GetHeight(), false)); Orthanc::ImageProcessing::Convert(*rendered, layers); @@ -745,7 +745,7 @@ { LOG(INFO) << "Exporting RadiographyScene to DICOM"; - std::auto_ptr<Orthanc::Image> rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags + std::unique_ptr<Orthanc::Image> rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags createDicomRequestContent["Tags"] = dicomTags; @@ -800,7 +800,7 @@ LOG(INFO) << "Exporting RadiographyScene to DICOM"; VLOG(1) << "Exporting RadiographyScene to: export to image"; - std::auto_ptr<Orthanc::Image> rendered(ExportToCreateDicomRequestAndImage(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation)); + std::unique_ptr<Orthanc::Image> rendered(ExportToCreateDicomRequestAndImage(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation)); // convert the image into base64 for inclusing in the createDicomRequest std::string base64;