summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-17 02:41:49 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-17 02:41:49 +0100
commit5d2ba0d2f7855ffe18ff8e5a96156ca17e50cd2b (patch)
tree0341572be05213e0dbfb94720577616d9e3b002f /src/lib
parent7ef2ba523ca2ddc0470f5837bc88ad9c597361e2 (diff)
Windows apparently has Rectangle in the global namespace.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dcp_video_frame.cc2
-rw-r--r--src/lib/subtitle.cc10
-rw-r--r--src/lib/subtitle.h6
-rw-r--r--src/lib/util.cc6
-rw-r--r--src/lib/util.h8
5 files changed, 16 insertions, 16 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);