Root/
| 1 | /* |
| 2 | * gfx/cro.h - Cairo graphics back-end |
| 3 | * |
| 4 | * Written 2016 by Werner Almesberger |
| 5 | * Copyright 2016 by Werner Almesberger |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | */ |
| 12 | |
| 13 | |
| 14 | #ifndef GFX_CRO_H |
| 15 | #define GFX_CRO_H |
| 16 | |
| 17 | #include <stdint.h> |
| 18 | |
| 19 | #include <cairo/cairo.h> |
| 20 | |
| 21 | #include "gfx/gfx.h" |
| 22 | |
| 23 | |
| 24 | struct cro_ctx; |
| 25 | |
| 26 | |
| 27 | extern const struct gfx_ops cro_png_ops; |
| 28 | extern const struct gfx_ops cro_pdf_ops; |
| 29 | |
| 30 | #define cro_img_ops cro_png_ops /* just don't call cro_img_ops.end */ |
| 31 | #define cro_canvas_ops cro_png_ops /* just don't call cro_canvas_ops.end */ |
| 32 | |
| 33 | |
| 34 | void cro_color_override(struct cro_ctx *cc, int color); |
| 35 | |
| 36 | void cro_get_size(const struct cro_ctx *cc, int *w, int *h, int *x, int *y); |
| 37 | |
| 38 | uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride); |
| 39 | void cro_img_write(struct cro_ctx *cc, const char *name); |
| 40 | |
| 41 | void cro_canvas_end(struct cro_ctx *cc, int *w, int *h, int *xmin, int *ymin); |
| 42 | void cro_canvas_prepare(cairo_t *cr); |
| 43 | void cro_canvas_draw(struct cro_ctx *cc, cairo_t *cr, |
| 44 | int x, int y, float scale); |
| 45 | |
| 46 | uint32_t *cro_img(struct cro_ctx *ctx, int x0, int yo, int w, int h, |
| 47 | float scale, cairo_t **res_cr, int *res_stride); |
| 48 | |
| 49 | #endif /* !GFX_CRO_H */ |
| 50 |
Branches:
master
