diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-17 02:41:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-17 02:41:49 +0100 |
| commit | 5d2ba0d2f7855ffe18ff8e5a96156ca17e50cd2b (patch) | |
| tree | 0341572be05213e0dbfb94720577616d9e3b002f /src | |
| parent | 7ef2ba523ca2ddc0470f5837bc88ad9c597361e2 (diff) | |
Windows apparently has Rectangle in the global namespace.
Diffstat (limited to 'src')
| -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 | 6 | ||||
| -rw-r--r-- | src/lib/util.h | 8 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 6 |
6 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc index bf29e6819..24bf2173c 100644 --- a/src/lib/dcp_video_frame.cc +++ b/src/lib/dcp_video_frame.cc @@ -161,7 +161,7 @@ DCPVideoFrame::encode_locally () shared_ptr<Image> prepared = _input->scale_and_convert_to_rgb (_out_size, _padding, _scaler); if (_subtitle) { - Rectangle tx = subtitle_transformed_area ( + 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 dcb747828..451d83691 100644 --- a/src/lib/subtitle.cc +++ b/src/lib/subtitle.cc @@ -102,13 +102,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. */ -Rectangle +Rect subtitle_transformed_area ( float target_x_scale, float target_y_scale, - Rectangle sub_area, int subtitle_offset, float subtitle_scale + Rect sub_area, int subtitle_offset, float subtitle_scale ) { - Rectangle tx; + Rect tx; sub_area.y += subtitle_offset; @@ -137,8 +137,8 @@ subtitle_transformed_area ( } /** @return area that this subtitle take up, in the original uncropped source's coordinate space */ -Rectangle +Rect Subtitle::area () const { - return Rectangle (_position.x, _position.y, _image->size().width, _image->size().height); + return Rect (_position.x, _position.y, _image->size().width, _image->size().height); } diff --git a/src/lib/subtitle.h b/src/lib/subtitle.h index 1cc906ce0..38ba4e70e 100644 --- a/src/lib/subtitle.h +++ b/src/lib/subtitle.h @@ -46,17 +46,17 @@ public: return _image; } - Rectangle area () const; + Rect area () const; private: Position _position; boost::shared_ptr<Image> _image; }; -Rectangle +Rect subtitle_transformed_area ( float target_x_scale, float target_y_scale, - Rectangle sub_area, int subtitle_offset, float subtitle_scale + 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 cc201a0af..dc0ee5642 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -602,13 +602,13 @@ Socket::read_indefinite (uint8_t* data, int size, int timeout) memcpy (data, _buffer, size); } -Rectangle -Rectangle::intersection (Rectangle const & other) const +Rect +Rect::intersection (Rect const & other) const { int const tx = max (x, other.x); int const ty = max (y, other.y); - return Rectangle ( + return Rect ( tx, ty, min (x + width, other.x + other.width) - tx, min (y + height, other.y + other.height) - ty diff --git a/src/lib/util.h b/src/lib/util.h index da7e73f20..c2706a594 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -122,16 +122,16 @@ struct Position }; /** A rectangle */ -struct Rectangle +struct Rect { - Rectangle () + Rect () : x (0) , y (0) , width (0) , height (0) {} - Rectangle (int x_, int y_, int w_, int h_) + Rect (int x_, int y_, int w_, int h_) : x (x_) , y (y_) , width (w_) @@ -151,7 +151,7 @@ struct Rectangle return Size (width, height); } - Rectangle intersection (Rectangle const & other) const; + Rect intersection (Rect const & other) const; }; extern std::string crop_string (Position, Size); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 6c8f38cfc..e2ab1db5d 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -144,7 +144,7 @@ private: GetSize (&vw, &vh); /* Cropped rectangle */ - Rectangle cropped_area ( + Rect cropped_area ( _film->crop().left, _film->crop().top, _image->GetWidth() - (_film->crop().left + _film->crop().right), @@ -207,8 +207,8 @@ private: base_area.height = base_image.GetHeight (); } - Rectangle base_area; - Rectangle transformed_area; + Rect base_area; + Rect transformed_area; wxImage base_image; wxImage transformed_image; shared_ptr<wxBitmap> bitmap; |
