Some bits in the attic.
[dcpomatic.git] / src / lib / video_frame.cc
index e2223ff9ec2132d65f3b8a85d3c4d6e2122ba7ba..e7c6a226aed47355f272aaf6d052bad7915d482e 100644 (file)
@@ -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);
+}