From 19b1852d62edd807c7afb18ea8970a8c6b857762 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 4 Apr 2013 22:14:49 +0800 Subject: [PATCH] add missing files --- src/util/color.cc | 17 +++++++++++++++++ src/util/color.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/util/color.cc create mode 100644 src/util/color.h diff --git a/src/util/color.cc b/src/util/color.cc new file mode 100644 index 0000000..a220052 --- /dev/null +++ b/src/util/color.cc @@ -0,0 +1,17 @@ +#include "util/color.h" +#include "util/misc.h" + +namespace pdf2htmlEX { + +using std::ostream; + +ostream & operator << (ostream & out, const Color & color) +{ + if(color.transparent) + out << "transparent"; + else + out << color.rgb; + return out; +} + +} // namespace pdf2htmlEX diff --git a/src/util/color.h b/src/util/color.h new file mode 100644 index 0000000..5c54559 --- /dev/null +++ b/src/util/color.h @@ -0,0 +1,32 @@ +/* + * Header file for Color + * Copyright (C) 2013 Lu Wang + */ + +#ifndef COLOR_H__ +#define COLOR_H__ + +#include + +#include + +namespace pdf2htmlEX { + +struct Color +{ + bool transparent; + GfxRGB rgb; + bool operator == (const Color & c) const { + if(transparent != c.transparent) + return false; + if(transparent) + return true; + return ((rgb.r == c.rgb.r) && (rgb.g == c.rgb.g) && (rgb.b == c.rgb.b)); + } +}; + +std::ostream & operator << (std::ostream & out, const Color & color); + +} // namespace pdf2htmlEX + +#endif // COLOR_H__