diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-14 12:10:59 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-14 12:10:59 +0100 |
| commit | b19543a036c389c9970a65f77606afb55d9fd11d (patch) | |
| tree | 3a78d574e16a26717ba8d22c2c49bc9b867beba4 /src/lib/video_frame.cc | |
| parent | 4b7b0edb359ae68f2dbcab90c7c10382f507fa5b (diff) | |
Fix some confusion with filling and VideoFrame.
Diffstat (limited to 'src/lib/video_frame.cc')
| -rw-r--r-- | src/lib/video_frame.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/video_frame.cc b/src/lib/video_frame.cc index e2223ff9e..e7c6a226a 100644 --- a/src/lib/video_frame.cc +++ b/src/lib/video_frame.cc @@ -19,6 +19,7 @@ */ #include "video_frame.h" +#include "dcpomatic_assert.h" VideoFrame & VideoFrame::operator++ () @@ -46,3 +47,31 @@ operator!= (VideoFrame const & a, VideoFrame const & b) { return !(a == b); } + +bool +operator> (VideoFrame const & a, VideoFrame const & b) +{ + if (a.index() != b.index()) { + return a.index() > b.index(); + } + + /* indexes are the same */ + + if (a.eyes() == b.eyes()) { + return false; + } + + /* eyes are not the same */ + + if (a.eyes() == EYES_LEFT && b.eyes() == EYES_RIGHT) { + return false; + } + + if (a.eyes() == EYES_RIGHT && b.eyes() == EYES_LEFT) { + return true; + } + + /* should never get here; we are comparing 2D with 3D */ + + DCPOMATIC_ASSERT (false); +} |
