projects
/
libsub.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add FIXME.
[libsub.git]
/
src
/
colour.h
diff --git
a/src/colour.h
b/src/colour.h
index 55d2239b99ca6e1e10ae558e2267d0331bad3247..f3a4964819d72d1e38821cd66a79e75e7d0f3283 100644
(file)
--- a/
src/colour.h
+++ b/
src/colour.h
@@
-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
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
@@
-17,10
+17,16
@@
*/
*/
+/** @file src/colour.h
+ * @brief Colour class.
+ */
+
#ifndef LIBSUB_COLOUR_H
#define LIBSUB_COLOUR_H
#ifndef LIBSUB_COLOUR_H
#define LIBSUB_COLOUR_H
+#include <dcp/types.h>
#include <string>
#include <string>
+#include <cmath>
namespace sub {
namespace sub {
@@
-51,6
+57,10
@@
public:
float g;
/** blue component (from 0 to 1) */
float b;
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
};
bool