Photon 1.0.0
Loading...
Searching...
No Matches
render2png.h
Go to the documentation of this file.
1#ifndef LITEHTML_RENDER2PNG_H
2#define LITEHTML_RENDER2PNG_H
3
4#include <string>
5#include <cairo.h>
6#include <gdk/gdk.h>
7
8namespace html2png
9{
11 {
14 double m_dpi;
15 const char* m_default_font;
16 cairo_font_options_t* m_font_options;
17 public:
18 converter(int screen_width = 800, int screen_height = 600, double dpi = 96, const char* default_font = nullptr, cairo_font_options_t* font_options = nullptr);
19 bool to_png(const std::string &html_file, const std::string &png_file);
20 GdkPixbuf* to_pixbuf(const std::string &html_file);
21
22 int get_screen_width() const { return m_screen_width; }
23 int get_screen_height() const { return m_screen_height; }
24 const char* get_default_font() const { return m_default_font; }
25 double get_dpi() const { return m_dpi; }
26 cairo_font_options_t* get_font_options() { return m_font_options; }
27 };
28
36
37 extern png_diff_t pngcmp(const std::string &png_file1, const std::string &png_file2);
38 extern png_diff_t pngcmp(const GdkPixbuf* pixbuf1, const GdkPixbuf* pixbuf2);
39 extern png_diff_t pngcmp(const GdkPixbuf* pixbuf, const std::string &png_file);
40}
41
42#endif //LITEHTML_RENDER2PNG_H
Definition render2png.h:11
int get_screen_height() const
Definition render2png.h:23
const char * get_default_font() const
Definition render2png.h:24
cairo_font_options_t * get_font_options()
Definition render2png.h:26
bool to_png(const std::string &html_file, const std::string &png_file)
Definition render2png.cpp:252
int get_screen_width() const
Definition render2png.h:22
cairo_font_options_t * m_font_options
Definition render2png.h:16
const char * m_default_font
Definition render2png.h:15
int m_screen_height
Definition render2png.h:13
int m_screen_width
Definition render2png.h:12
double get_dpi() const
Definition render2png.h:25
GdkPixbuf * to_pixbuf(const std::string &html_file)
Definition render2png.cpp:200
double m_dpi
Definition render2png.h:14
Definition render2png.cpp:14
png_diff_t
Definition render2png.h:30
@ png_diff_same
Definition render2png.h:31
@ png_diff_dimensions
Definition render2png.h:32
@ png_diff_error
Definition render2png.h:34
@ png_diff_data
Definition render2png.h:33
png_diff_t pngcmp(const GdkPixbuf *pixbuf1, const GdkPixbuf *pixbuf2)
Definition render2png.cpp:264