/*
- 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 {
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