3 * dyncnn is a deep-learning algorithm for the prediction of
4 * interacting object dynamics
6 * Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
7 * Written by Francois Fleuret <francois.fleuret@idiap.ch>
9 * This file is part of dyncnn.
11 * dyncnn is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License version 3 as
13 * published by the Free Software Foundation.
15 * dyncnn is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with dyncnn. If not, see <http://www.gnu.org/licenses/>.
25 #ifndef CANVAS_CAIRO_H
26 #define CANVAS_CAIRO_H
33 class CanvasCairo : public Canvas {
35 cairo_surface_t *_image;
36 cairo_t *_context_resource;
39 const static int _depth = 4;
40 int _actual_width, _actual_height;
43 CanvasCairo(scalar_t scale, int nb_rows, int nb_cols, CanvasCairo **ca);
44 CanvasCairo(scalar_t scale, int width, int height);
45 CanvasCairo(int nb_rows, int nb_cols, CanvasCairo **x);
47 virtual ~CanvasCairo();
50 virtual void set_line_width(scalar_t w);
51 virtual void set_drawing_color(scalar_t r, scalar_t g, scalar_t b);
52 virtual void draw_polygon(int filled, int nb, scalar_t *x, scalar_t *y);
53 virtual void write_png(FILE *file);