2016-08-02 17:00:08 +03:00
|
|
|
/*
|
2016-08-18 03:28:42 +03:00
|
|
|
* gfx/cro.h - Cairo graphics back-end
|
2016-08-02 17:00:08 +03:00
|
|
|
*
|
|
|
|
* Written 2016 by Werner Almesberger
|
|
|
|
* Copyright 2016 by Werner Almesberger
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2016-08-18 03:28:42 +03:00
|
|
|
#ifndef GFX_CRO_H
|
|
|
|
#define GFX_CRO_H
|
2016-08-02 17:00:08 +03:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2016-08-03 13:38:57 +03:00
|
|
|
#include <cairo/cairo.h>
|
|
|
|
|
2016-08-18 03:28:42 +03:00
|
|
|
#include "gfx/gfx.h"
|
2016-08-02 17:00:08 +03:00
|
|
|
|
|
|
|
|
2016-08-03 13:38:57 +03:00
|
|
|
struct cro_ctx;
|
|
|
|
|
|
|
|
|
2016-08-02 17:00:08 +03:00
|
|
|
extern const struct gfx_ops cro_png_ops;
|
|
|
|
extern const struct gfx_ops cro_pdf_ops;
|
|
|
|
|
|
|
|
#define cro_img_ops cro_png_ops /* just don't call cro_img_ops.end */
|
2016-08-03 13:38:57 +03:00
|
|
|
#define cro_canvas_ops cro_png_ops /* just don't call cro_canvas_ops.end */
|
2016-08-02 17:00:08 +03:00
|
|
|
|
|
|
|
|
2016-08-07 14:13:16 +03:00
|
|
|
void cro_color_override(struct cro_ctx *cc, int color);
|
|
|
|
|
2016-08-08 23:13:30 +03:00
|
|
|
void cro_get_size(const struct cro_ctx *cc, int *w, int *h, int *x, int *y);
|
|
|
|
|
2016-08-03 13:41:44 +03:00
|
|
|
uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride);
|
|
|
|
void cro_img_write(struct cro_ctx *cc, const char *name);
|
2016-08-02 17:00:08 +03:00
|
|
|
|
2016-08-03 15:33:16 +03:00
|
|
|
void cro_canvas_end(struct cro_ctx *cc, int *w, int *h, int *xmin, int *ymin);
|
2016-08-07 20:06:50 +03:00
|
|
|
void cro_canvas_prepare(cairo_t *cr);
|
|
|
|
void cro_canvas_draw(struct cro_ctx *cc, cairo_t *cr,
|
|
|
|
int x, int y, float scale);
|
2016-08-03 13:38:57 +03:00
|
|
|
|
2016-08-09 16:09:08 +03:00
|
|
|
uint32_t *cro_img(struct cro_ctx *ctx, int x0, int yo, int w, int h,
|
2016-08-09 18:10:53 +03:00
|
|
|
int xe, int ye,
|
2016-08-09 16:09:08 +03:00
|
|
|
float scale, cairo_t **res_cr, int *res_stride);
|
|
|
|
|
2016-08-18 03:28:42 +03:00
|
|
|
#endif /* !GFX_CRO_H */
|