Add FIXME.
[libsub.git] / src / colour.h
index 55d2239b99ca6e1e10ae558e2267d0331bad3247..f3a4964819d72d1e38821cd66a79e75e7d0f3283 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
+/** @file  src/colour.h
+ *  @brief Colour class.
+ */
+
 #ifndef LIBSUB_COLOUR_H
 #define LIBSUB_COLOUR_H
 
+#include <dcp/types.h>
 #include <string>
+#include <cmath>
 
 namespace sub {
 
@@ -51,6 +57,10 @@ public:
        float g;
        /** blue component (from 0 to 1) */
        float b;
+
+       dcp::Colour dcp() const {
+               return dcp::Colour(lrintf(r * 255), lrintf(g * 255), lrintf(b * 255));
+       }
 };
 
 bool