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
* 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;
}
/** @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);
}
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 */
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
};
/** 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_)
return Size (width, height);
}
- Rectangle intersection (Rectangle const & other) const;
+ Rect intersection (Rect const & other) const;
};
extern std::string crop_string (Position, Size);
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),
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;