diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-01-22 00:53:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-22 00:53:30 +0100 |
| commit | bebe2f996176113a527bf2492fd179420493d0ff (patch) | |
| tree | dae6c7cee330d56fbbd6c6da826052f09c063aaf /examples | |
| parent | 472b1e897fd6031bfeaac93d715391cc221067d1 (diff) | |
c++11 bits in examples/
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/make_dcp.cc | 4 | ||||
| -rw-r--r-- | examples/read_dcp.cc | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/examples/make_dcp.cc b/examples/make_dcp.cc index 3326fcf2..8683dc30 100644 --- a/examples/make_dcp.cc +++ b/examples/make_dcp.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -93,7 +93,7 @@ main () sound_writer->finalize (); /* Now create a reel */ - std::shared_ptr<dcp::Reel> reel (new dcp::Reel ()); + auto reel = std::make_shared<dcp::Reel>(); /* Add picture and sound to it. The zeros are the `entry points', i.e. the first (video) frame from the assets that the reel should play. diff --git a/examples/read_dcp.cc b/examples/read_dcp.cc index 4664fea4..998d0dc4 100644 --- a/examples/read_dcp.cc +++ b/examples/read_dcp.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -78,21 +78,21 @@ main () } /* Take the first CPL */ - std::shared_ptr<dcp::CPL> cpl = dcp.cpls().front (); + auto cpl = dcp.cpls().front(); /* Get the picture asset in the first reel */ - std::shared_ptr<dcp::MonoPictureAsset> picture_asset = std::dynamic_pointer_cast<dcp::MonoPictureAsset> ( - cpl->reels().front()->main_picture()->asset() + auto picture_asset = std::dynamic_pointer_cast<dcp::MonoPictureAsset>( + cpl->reels()[0]->main_picture()->asset() ); /* Get a reader for it */ - std::shared_ptr<dcp::MonoPictureAssetReader> picture_asset_reader = picture_asset->start_read(); + auto picture_asset_reader = picture_asset->start_read(); /* Get the 1000th frame of it */ - std::shared_ptr<const dcp::MonoPictureFrame> picture_frame_j2k = picture_asset_reader->get_frame(999); + auto picture_frame_j2k = picture_asset_reader->get_frame(999); /* Get the frame as an XYZ image */ - std::shared_ptr<const dcp::OpenJPEGImage> picture_image_xyz = picture_frame_j2k->xyz_image (); + auto picture_image_xyz = picture_frame_j2k->xyz_image (); /* Convert to ARGB */ boost::scoped_array<uint8_t> rgba (new uint8_t[picture_image_xyz->size().width * picture_image_xyz->size().height * 4]); |
