From 6a0a88cdf8ab69e9f8664c747ee752c516e4fe4e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 9 Jan 2018 20:32:31 +0000 Subject: Add a method to convert to a libdcp colour. --- src/colour.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/colour.h b/src/colour.h index 55d2239..dbdd534 100644 --- a/src/colour.h +++ b/src/colour.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington 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 @@ -20,7 +20,9 @@ #ifndef LIBSUB_COLOUR_H #define LIBSUB_COLOUR_H +#include #include +#include namespace sub { @@ -51,6 +53,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 -- cgit v1.2.3