From c59981ce92898f6be6987f10ebb29161e36e6766 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 15 Sep 2021 00:42:15 +0200 Subject: [PATCH] Some const correctness. --- src/lib/bitmap_text.h | 4 ++-- src/lib/content_text.h | 2 +- src/lib/image_proxy.h | 5 ++--- src/lib/player_video.h | 2 +- src/lib/position_image.h | 4 ++-- src/lib/text_decoder.cc | 4 ++-- src/lib/text_decoder.h | 4 ++-- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/lib/bitmap_text.h b/src/lib/bitmap_text.h index b8861c10a..46b6fd142 100644 --- a/src/lib/bitmap_text.h +++ b/src/lib/bitmap_text.h @@ -31,12 +31,12 @@ class Image; class BitmapText { public: - BitmapText (std::shared_ptr i, dcpomatic::Rect r) + BitmapText (std::shared_ptr i, dcpomatic::Rect r) : image (i) , rectangle (r) {} - std::shared_ptr image; + std::shared_ptr image; /** Area that the subtitle covers on its corresponding video, expressed in * proportions of the image size; e.g. rectangle.x = 0.5 would mean that * the rectangle starts half-way across the video. diff --git a/src/lib/content_text.h b/src/lib/content_text.h index c6d7d6ec2..5edb9af20 100644 --- a/src/lib/content_text.h +++ b/src/lib/content_text.h @@ -48,7 +48,7 @@ private: class ContentBitmapText : public ContentText { public: - ContentBitmapText (dcpomatic::ContentTime f, std::shared_ptr im, dcpomatic::Rect r) + ContentBitmapText (dcpomatic::ContentTime f, std::shared_ptr im, dcpomatic::Rect r) : ContentText (f) , sub (im, r) {} diff --git a/src/lib/image_proxy.h b/src/lib/image_proxy.h index 22946ed98..cf1fb9a2d 100644 --- a/src/lib/image_proxy.h +++ b/src/lib/image_proxy.h @@ -64,7 +64,7 @@ public: ImageProxy& operator= (ImageProxy const&) = delete; struct Result { - Result (std::shared_ptr image_, int log2_scaling_) + Result (std::shared_ptr image_, int log2_scaling_) : image (image_) , log2_scaling (log2_scaling_) , error (false) @@ -76,8 +76,7 @@ public: , error (error_) {} - /** Image (which will be aligned) */ - std::shared_ptr image; + std::shared_ptr 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. diff --git a/src/lib/player_video.h b/src/lib/player_video.h index 347d10667..872bc9864 100644 --- a/src/lib/player_video.h +++ b/src/lib/player_video.h @@ -76,7 +76,7 @@ public: void prepare (std::function pixel_format, VideoRange video_range, bool aligned, bool fast, bool proxy_only); std::shared_ptr image (std::function pixel_format, VideoRange video_range, bool aligned, bool fast) const; - std::shared_ptr raw_image () const; + std::shared_ptr raw_image () const; static AVPixelFormat force (AVPixelFormat, AVPixelFormat); static AVPixelFormat keep_xyz_or_rgb (AVPixelFormat); diff --git a/src/lib/position_image.h b/src/lib/position_image.h index 2b7e7080a..ee352647c 100644 --- a/src/lib/position_image.h +++ b/src/lib/position_image.h @@ -35,12 +35,12 @@ class PositionImage public: PositionImage () {} - PositionImage (std::shared_ptr i, Position p) + PositionImage (std::shared_ptr i, Position p) : image (i) , position (p) {} - std::shared_ptr image; + std::shared_ptr image; Position position; bool same (PositionImage const & other) const; diff --git a/src/lib/text_decoder.cc b/src/lib/text_decoder.cc index 6ee6ed079..8111154e3 100644 --- a/src/lib/text_decoder.cc +++ b/src/lib/text_decoder.cc @@ -61,7 +61,7 @@ TextDecoder::TextDecoder ( * of the video frame) */ void -TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr image, dcpomatic::Rect rect) +TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr image, dcpomatic::Rect rect) { BitmapStart (ContentBitmapText (from, image, rect)); _position = from; @@ -286,7 +286,7 @@ TextDecoder::emit_plain (ContentTimePeriod period, sub::Subtitle const & s) * of the video frame) */ void -TextDecoder::emit_bitmap (ContentTimePeriod period, shared_ptr image, dcpomatic::Rect rect) +TextDecoder::emit_bitmap (ContentTimePeriod period, shared_ptr image, dcpomatic::Rect rect) { emit_bitmap_start (period.from, image, rect); emit_stop (period.to); diff --git a/src/lib/text_decoder.h b/src/lib/text_decoder.h index 6e96b6b91..d1355afb0 100644 --- a/src/lib/text_decoder.h +++ b/src/lib/text_decoder.h @@ -52,8 +52,8 @@ public: return _position; } - void emit_bitmap_start (dcpomatic::ContentTime from, std::shared_ptr image, dcpomatic::Rect rect); - void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr image, dcpomatic::Rect rect); + void emit_bitmap_start (dcpomatic::ContentTime from, std::shared_ptr image, dcpomatic::Rect rect); + void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr image, dcpomatic::Rect rect); void emit_plain_start (dcpomatic::ContentTime from, std::list s); void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle); void emit_plain (dcpomatic::ContentTimePeriod period, std::list s); -- 2.30.2