From 6d1a6b588c1c8add26a42dafc971146462cfccf0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 2 Oct 2021 11:34:01 +0200 Subject: Replace crop() with actual_crop and requested_crop() This means that the crop rounding we do is reported properly, not done behind the user's back. --- src/lib/video_content.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/lib/video_content.h') diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 31346ffcd..d670f72c8 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -112,27 +112,29 @@ public: return _frame_type; } - Crop crop () const { + Crop actual_crop () const; + + Crop requested_crop () const { boost::mutex::scoped_lock lm (_mutex); return _crop; } - int left_crop () const { + int requested_left_crop () const { boost::mutex::scoped_lock lm (_mutex); return _crop.left; } - int right_crop () const { + int requested_right_crop () const { boost::mutex::scoped_lock lm (_mutex); return _crop.right; } - int top_crop () const { + int requested_top_crop () const { boost::mutex::scoped_lock lm (_mutex); return _crop.top; } - int bottom_crop () const { + int requested_bottom_crop () const { boost::mutex::scoped_lock lm (_mutex); return _crop.bottom; } @@ -227,6 +229,7 @@ private: boost::optional _colour_conversion; dcp::Size _size; VideoFrameType _frame_type; + /** crop that the user has asked for; it may be rounded if we are cropping a subsampled source */ Crop _crop; /** ratio to scale cropped image to (or none to guess); i.e. if set, scale to _custom_ratio:1 */ boost::optional _custom_ratio; -- cgit v1.2.3