diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-09-15 00:42:15 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-09-27 13:41:46 +0200 |
| commit | c59981ce92898f6be6987f10ebb29161e36e6766 (patch) | |
| tree | a06ac20b947af1f5c96c844052dbd00da60a2c81 | |
| parent | 00da1e02bb8ebfbc377ad34d9810ef1cd72b9cd0 (diff) | |
Some const correctness.
| -rw-r--r-- | src/lib/bitmap_text.h | 4 | ||||
| -rw-r--r-- | src/lib/content_text.h | 2 | ||||
| -rw-r--r-- | src/lib/image_proxy.h | 5 | ||||
| -rw-r--r-- | src/lib/player_video.h | 2 | ||||
| -rw-r--r-- | src/lib/position_image.h | 4 | ||||
| -rw-r--r-- | src/lib/text_decoder.cc | 4 | ||||
| -rw-r--r-- | 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<Image> i, dcpomatic::Rect<double> r) + BitmapText (std::shared_ptr<const Image> i, dcpomatic::Rect<double> r) : image (i) , rectangle (r) {} - std::shared_ptr<Image> image; + std::shared_ptr<const Image> 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<Image> im, dcpomatic::Rect<double> r) + ContentBitmapText (dcpomatic::ContentTime f, std::shared_ptr<const Image> im, dcpomatic::Rect<double> 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> image_, int log2_scaling_) + Result (std::shared_ptr<const Image> 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> image; + std::shared_ptr<const 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. 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<AVPixelFormat (AVPixelFormat)> pixel_format, VideoRange video_range, bool aligned, bool fast, bool proxy_only); std::shared_ptr<Image> image (std::function<AVPixelFormat (AVPixelFormat)> pixel_format, VideoRange video_range, bool aligned, bool fast) const; - std::shared_ptr<Image> raw_image () const; + std::shared_ptr<const Image> 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<Image> i, Position<int> p) + PositionImage (std::shared_ptr<const Image> i, Position<int> p) : image (i) , position (p) {} - std::shared_ptr<Image> image; + std::shared_ptr<const Image> image; Position<int> 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> image, dcpomatic::Rect<double> rect) +TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr<const Image> image, dcpomatic::Rect<double> 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> image, dcpomatic::Rect<double> rect) +TextDecoder::emit_bitmap (ContentTimePeriod period, shared_ptr<const Image> image, dcpomatic::Rect<double> 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> image, dcpomatic::Rect<double> rect); - void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr<Image> image, dcpomatic::Rect<double> rect); + void emit_bitmap_start (dcpomatic::ContentTime from, std::shared_ptr<const Image> image, dcpomatic::Rect<double> rect); + void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr<const Image> image, dcpomatic::Rect<double> rect); void emit_plain_start (dcpomatic::ContentTime from, std::list<dcp::SubtitleString> s); void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle); void emit_plain (dcpomatic::ContentTimePeriod period, std::list<dcp::SubtitleString> s); |
