Add support for PNG images in .spv files.
[pspp] / src / output / cairo-chart.h
index 24a2dce51690fd0e1007712f6d7dcd56a4602e39..f02fd4efac9ef80a9007ce3429203891ae772181 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2011, 2015 Free Software Foundation, Inc.
 
    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
@@ -23,6 +23,7 @@
 #include "libpspp/compiler.h"
 
 struct chart_item;
+struct cell_color;
 
 struct xrchart_colour
   {
@@ -117,13 +118,12 @@ void xrchart_write_title (cairo_t *, const struct xrchart_geometry *,
   PRINTF_FORMAT (3, 4);
 
 /* Set the scale for the abscissa */
-void xrchart_write_xscale (cairo_t *, struct xrchart_geometry *,
-                           double min, double max);
-
+bool xrchart_write_xscale (cairo_t *, struct xrchart_geometry *,
+                           double min, double max) WARN_UNUSED_RESULT;
 
 /* Set the scale for the ordinate */
-void xrchart_write_yscale (cairo_t *, struct xrchart_geometry *,
-                           double smin, double smax);
+bool xrchart_write_yscale (cairo_t *, struct xrchart_geometry *,
+                           double smin, double smax) WARN_UNUSED_RESULT;
 
 void xrchart_write_xlabel (cairo_t *, const struct xrchart_geometry *,
                            const char *label) ;
@@ -178,5 +178,23 @@ void xrchart_draw_spreadlevel (const struct chart_item *, cairo_t *,
 void xrchart_draw_scatterplot (const struct chart_item *, cairo_t *,
                          struct xrchart_geometry *);
 
+void xr_draw_chart (const struct chart_item *, cairo_t *,
+                    double width, double height);
+
+cairo_surface_t *xr_draw_image_chart (const struct chart_item *,
+                                      const struct cell_color *fg,
+                                      const struct cell_color *bg);
+char *xr_write_png_image (cairo_surface_t *,
+                          const char *file_name_template, int number);
+
+char *xr_draw_png_chart (const struct chart_item *,
+                         const char *file_name_template, int number,
+                         const struct cell_color *fg,
+                        const struct cell_color *bg);
+
+char *xr_draw_eps_chart (const struct chart_item *item,
+                         const char *file_name_template, int number,
+                         const struct cell_color *fg,
+                         const struct cell_color *bg);
 
 #endif /* output/cairo-chart.h */