Some work on DCI naming. Clean up compacted / aligned image handling somewhat.
[dcpomatic.git] / src / lib / util.h
index 8d98437afafd4eace452c4695a1d27d8687657a9..bd7675a8af28ae05676aba327794ef37b2b6105f 100644 (file)
@@ -33,9 +33,9 @@ extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libavfilter/avfilter.h>
 }
+#include "compose.hpp"
 
 #ifdef DVDOMATIC_DEBUG
-#include "compose.hpp"
 #define TIMING(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::TIMING);
 #else
 #define TIMING(...)
@@ -121,9 +121,35 @@ struct Position
        int y;
 };
 
+/** A rectangle */
+struct Rectangle
+{
+       Rectangle ()
+               : x (0)
+               , y (0)
+               , w (0)
+               , h (0)
+       {}
+
+       Rectangle (int x_, int y_, int w_, int h_)
+               : x (x_)
+               , y (y_)
+               , w (w_)
+               , h (h_)
+       {}
+
+       int x;
+       int y;
+       int w;
+       int h;
+
+       Rectangle intersection (Rectangle const & other) const;
+};
+
 extern std::string crop_string (Position, Size);
 extern int dcp_audio_sample_rate (int);
 extern std::string colour_lut_index_to_name (int index);
+extern int round_up (int, int);
 
 /** @class Socket
  *  @brief A class to wrap a boost::asio::ip::tcp::socket with some things
@@ -166,3 +192,4 @@ private:
 };
 
 #endif
+