diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_video_frame.cc | 2 | ||||
| -rw-r--r-- | src/lib/subtitle.cc | 10 | ||||
| -rw-r--r-- | src/lib/subtitle.h | 6 | ||||
| -rw-r--r-- | src/lib/util.cc | 4 | ||||
| -rw-r--r-- | src/lib/util.h | 7 |
5 files changed, 18 insertions, 11 deletions
diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc index d674393a9..77b81a658 100644 --- a/src/lib/dcp_video_frame.cc +++ b/src/lib/dcp_video_frame.cc @@ -164,7 +164,7 @@ DCPVideoFrame::encode_locally () shared_ptr<Image> prepared = _input->scale_and_convert_to_rgb (_out_size, _padding, _scaler, true); if (_subtitle) { - Rect tx = subtitle_transformed_area ( + dvdomatic::Rect tx = subtitle_transformed_area ( float (_out_size.width) / _input->size().width, float (_out_size.height) / _input->size().height, _subtitle->area(), _subtitle_offset, _subtitle_scale diff --git a/src/lib/subtitle.cc b/src/lib/subtitle.cc index 5c1ad9706..5c2a0d0b5 100644 --- a/src/lib/subtitle.cc +++ b/src/lib/subtitle.cc @@ -108,13 +108,13 @@ Subtitle::Subtitle (Position p, shared_ptr<Image> i) * in the coordinate space of the source. * @param subtitle_scale scaling factor to apply to the subtitle image. */ -Rect +dvdomatic::Rect subtitle_transformed_area ( float target_x_scale, float target_y_scale, - Rect sub_area, int subtitle_offset, float subtitle_scale + dvdomatic::Rect sub_area, int subtitle_offset, float subtitle_scale ) { - Rect tx; + dvdomatic::Rect tx; sub_area.y += subtitle_offset; @@ -143,8 +143,8 @@ subtitle_transformed_area ( } /** @return area that this subtitle takes up, in the original uncropped source's coordinate space */ -Rect +dvdomatic::Rect Subtitle::area () const { - return Rect (_position.x, _position.y, _image->size().width, _image->size().height); + return dvdomatic::Rect (_position.x, _position.y, _image->size().width, _image->size().height); } diff --git a/src/lib/subtitle.h b/src/lib/subtitle.h index 38ba4e70e..e3a853695 100644 --- a/src/lib/subtitle.h +++ b/src/lib/subtitle.h @@ -46,17 +46,17 @@ public: return _image; } - Rect area () const; + dvdomatic::Rect area () const; private: Position _position; boost::shared_ptr<Image> _image; }; -Rect +dvdomatic::Rect subtitle_transformed_area ( float target_x_scale, float target_y_scale, - Rect sub_area, int subtitle_offset, float subtitle_scale + dvdomatic::Rect sub_area, int subtitle_offset, float subtitle_scale ); /** A Subtitle class with details of the time over which it should be shown */ diff --git a/src/lib/util.cc b/src/lib/util.cc index 2f8be6edd..b8b60c6f6 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -637,8 +637,8 @@ Socket::read_uint32 () /** @param other A Rect. * @return The intersection of this with `other'. */ -Rect -Rect::intersection (Rect const & other) const +dvdomatic::Rect +dvdomatic::Rect::intersection (Rect const & other) const { int const tx = max (x, other.x); int const ty = max (y, other.y); diff --git a/src/lib/util.h b/src/lib/util.h index d0c350a56..3e1d7f4b4 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -44,6 +44,8 @@ extern "C" { #define TIMING(...) #endif +#undef check + /** The maximum number of audio channels that we can cope with */ #define MAX_AUDIO_CHANNELS 6 @@ -150,6 +152,9 @@ struct Position int y; }; +namespace dvdomatic +{ + /** @struct Rect * @brief A rectangle. */ @@ -185,6 +190,8 @@ struct Rect Rect intersection (Rect const & other) const; }; +} + extern std::string crop_string (Position, libdcp::Size); extern int dcp_audio_sample_rate (int); extern std::string colour_lut_index_to_name (int index); |
