1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

add missing files

This commit is contained in:
Lu Wang 2013-04-04 22:14:49 +08:00
parent a641bee616
commit 19b1852d62
2 changed files with 49 additions and 0 deletions

17
src/util/color.cc Normal file
View File

@ -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

32
src/util/color.h Normal file
View File

@ -0,0 +1,32 @@
/*
* Header file for Color
* Copyright (C) 2013 Lu Wang <coolwanglu@gmail.com>
*/
#ifndef COLOR_H__
#define COLOR_H__
#include <ostream>
#include <GfxState.h>
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__