2012-08-10 13:30:41 +00:00
|
|
|
/*
|
2012-11-29 09:45:26 +00:00
|
|
|
* Help classes and Functions
|
2012-08-10 13:30:41 +00:00
|
|
|
*
|
|
|
|
* by WangLu
|
|
|
|
* 2012.08.10
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef UTIL_H__
|
|
|
|
#define UTIL_H__
|
|
|
|
|
2012-09-10 16:45:00 +00:00
|
|
|
#include <cstdio>
|
2012-08-27 10:37:00 +00:00
|
|
|
#include <iostream>
|
2012-09-09 17:18:09 +00:00
|
|
|
#include <algorithm>
|
2012-09-09 19:03:21 +00:00
|
|
|
#include <cmath>
|
|
|
|
#include <vector>
|
2012-09-10 05:03:25 +00:00
|
|
|
#include <string>
|
|
|
|
#include <map>
|
2012-08-14 13:23:33 +00:00
|
|
|
|
2012-11-29 09:45:26 +00:00
|
|
|
#include "const.h"
|
2012-11-26 21:23:13 +00:00
|
|
|
|
2012-09-10 05:03:25 +00:00
|
|
|
#ifndef nullptr
|
|
|
|
#define nullptr (NULL)
|
|
|
|
#endif
|
|
|
|
|
2012-09-11 13:52:46 +00:00
|
|
|
namespace pdf2htmlEX {
|
|
|
|
|
2012-09-06 16:58:23 +00:00
|
|
|
static inline long long hash_ref(const Ref * id)
|
|
|
|
{
|
|
|
|
return (((long long)(id->num)) << (sizeof(id->gen)*8)) | (id->gen);
|
|
|
|
}
|
|
|
|
|
2012-09-09 18:07:35 +00:00
|
|
|
|
2012-10-01 17:59:04 +00:00
|
|
|
/*
|
|
|
|
* In PDF, edges of the rectangle are in the middle of the borders
|
|
|
|
* In HTML, edges are completely outside the rectangle
|
|
|
|
*/
|
|
|
|
void css_fix_rectangle_border_width(double x1, double y1, double x2, double y2,
|
|
|
|
double border_width,
|
|
|
|
double & x, double & y, double & w, double & h,
|
|
|
|
double & border_top_bottom_width,
|
|
|
|
double & border_left_right_width);
|
|
|
|
|
2012-10-01 20:06:38 +00:00
|
|
|
std::ostream & operator << (std::ostream & out, const GfxRGB & rgb);
|
|
|
|
|
2012-11-29 09:45:26 +00:00
|
|
|
} // namespace pdf2htmlEX
|
|
|
|
|
2012-08-10 13:30:41 +00:00
|
|
|
#endif //UTIL_H__
|