diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-14 21:38:26 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-14 21:38:26 +0200 |
| commit | 3b31d2d8a129ae6d8d267427bd6b5bc444b40b2a (patch) | |
| tree | 780947aefb2249a2614bf9e3d894b5256f015967 /src/lib/image_proxy.h | |
| parent | b029cb06c4e0fca1fad9fecd78939efe5532fa9a (diff) | |
Use a struct rather than a std::pair as the return type from ImageProxy::image.
Diffstat (limited to 'src/lib/image_proxy.h')
| -rw-r--r-- | src/lib/image_proxy.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/image_proxy.h b/src/lib/image_proxy.h index b6fe87732..9619fab75 100644 --- a/src/lib/image_proxy.h +++ b/src/lib/image_proxy.h @@ -60,14 +60,26 @@ class ImageProxy : public boost::noncopyable public: virtual ~ImageProxy () {} + struct Result { + Result (boost::shared_ptr<Image> image_, int log2_scaling_) + : image (image_) + , log2_scaling (log2_scaling_) + {} + + /** Image (which will be aligned) */ + boost::shared_ptr<Image> image; + /** log2 of any scaling down that has already been applied to the image; + * e.g. if the image is already half the size of the original, this value + * will be 1. + */ + int log2_scaling; + }; + /** @param log Log to write to, or 0. * @param size Size that the returned image will be scaled to, in case this * can be used as an optimisation. - * @return Image (which must be aligned) and log2 of any scaling down that has - * already been applied to the image; e.g. if the the image is already half the size - * of the original, the second part of the return value will be 1. */ - virtual std::pair<boost::shared_ptr<Image>, int> image ( + virtual Result image ( boost::optional<dcp::Size> size = boost::optional<dcp::Size> () ) const = 0; |
