projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix horrid memory corruptions.
[dcpomatic.git]
/
src
/
lib
/
subtitle.h
diff --git
a/src/lib/subtitle.h
b/src/lib/subtitle.h
index 18d2590ebf62c6617f377e43bff36ee2e6133baa..de8f025964fc468683573813f8948ad6715d81c7 100644
(file)
--- a/
src/lib/subtitle.h
+++ b/
src/lib/subtitle.h
@@
-22,42
+22,54
@@
#include "util.h"
struct AVSubtitle;
#include "util.h"
struct AVSubtitle;
-class SubtitleImage;
-class SimpleImage;
+class Image;
class Subtitle
{
public:
class Subtitle
{
public:
- Subtitle (
AVSubtitle const &
);
+ Subtitle (
Position p, boost::shared_ptr<Image> i
);
- bool displayed_at (double t);
+ void set_position (Position p) {
+ _position = p;
+ }
- std::list<boost::shared_ptr<SubtitleImage> > images () const {
- return _images;
+ Position position () const {
+ return _position;
+ }
+
+ boost::shared_ptr<Image> image () const {
+ return _image;
}
}
+ Rectangle area () const;
+
private:
private:
- /** display from time in seconds from the start of the film */
- double _from;
- /** display to time in seconds from the start of the film */
- double _to;
- std::list<boost::shared_ptr<SubtitleImage> > _images;
+ Position _position;
+ boost::shared_ptr<Image> _image;
};
};
-class SubtitleImage
+Rectangle
+subtitle_transformed_area (
+ float target_x_scale, float target_y_scale,
+ Rectangle sub_area, int subtitle_offset, float subtitle_scale
+ );
+
+class TimedSubtitle
{
public:
{
public:
-
SubtitleImage (AVSubtitleRect const *
);
+
TimedSubtitle (AVSubtitle const &
);
- Position position () const {
- return _position;
- }
+ bool displayed_at (double t) const;
- boost::shared_ptr<S
impleImage> imag
e () const {
- return _
imag
e;
+ boost::shared_ptr<S
ubtitle> subtitl
e () const {
+ return _
subtitl
e;
}
private:
}
private:
- Position _position;
- boost::shared_ptr<SimpleImage> _image;
+ boost::shared_ptr<Subtitle> _subtitle;
+
+ /** display from time in seconds from the start of the film */
+ double _from;
+ /** display to time in seconds from the start of the film */
+ double _to;
};
};