Added entireity of utility and generate-report(only works with PNG for now)
This commit is contained in:
31
src/Utility/CairoTools.hpp
Normal file
31
src/Utility/CairoTools.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <cairo/cairo.h>
|
||||
#include <dpp/dpp.h>
|
||||
#include <string>
|
||||
|
||||
#define REPORT_WIDTH 1000
|
||||
#define REPORT_HEIGHT 1200
|
||||
#define REPORT_HEIGHT_OFFSET 200
|
||||
#define REPORT_TEXT_START_X 40
|
||||
#define REPORT_TEXT_JUMP_Y 120
|
||||
#define REPORT_TEXT_FONT_SIZE 120.0
|
||||
#define REPORT_TEXT_LENGTH 26
|
||||
#define REPORT_RESOURCE_BUMPER_PATH "./assets/report_bumper.png"
|
||||
#define CAIRO_TEXT_WHITE 0.87, 0.87, 0.87
|
||||
|
||||
std::string GenerateReportImage(cairo_surface_t *background,
|
||||
std::string headline);
|
||||
|
||||
// File type management
|
||||
cairo_status_t cairoReadPNGdata(void *closure, unsigned char *data,
|
||||
unsigned int length);
|
||||
|
||||
cairo_status_t cairoOutputAsPNGStream(void *closure, const unsigned char *data,
|
||||
unsigned int length);
|
||||
|
||||
cairo_surface_t *pngToCairoSurface(const std::string &data);
|
||||
cairo_surface_t *jpegToCairoSurface(std::string data);
|
||||
cairo_surface_t *webpToCairoSurface(std::string data);
|
||||
|
||||
extern std::unordered_map<std::string,
|
||||
std::function<cairo_surface_t *(const std::string &)>>
|
||||
supportedImageFileTypes;
|
Reference in New Issue
Block a user