123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- #include "sys-defines.h"
- #include "extern.h"
- #ifndef LIBPLOTTER
- const Plotter _pl_z_default_plotter =
- {
-
- _pl_z_initialize, _pl_z_terminate,
-
- _pl_b_begin_page, _pl_b_erase_page, _pl_b_end_page,
-
- _pl_g_push_state, _pl_g_pop_state,
-
- _pl_b_paint_path, _pl_b_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments,
-
- _pl_g_paint_marker, _pl_b_paint_point,
-
- _pl_g_paint_text_string_with_escapes, _pl_g_paint_text_string,
- _pl_g_get_text_width,
-
- _pl_g_retrieve_font,
-
- _pl_g_flush_output,
-
- _pl_g_warning,
- _pl_g_error,
- };
- #endif
- void
- _pl_z_initialize (S___(Plotter *_plotter))
- {
- #ifndef LIBPLOTTER
-
- _pl_b_initialize (S___(_plotter));
- #endif
-
- #ifndef LIBPLOTTER
-
- _plotter->data->type = PL_PNG;
- #endif
-
- _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES;
-
-
- _plotter->z_interlace = false;
- _plotter->z_transparent = false;
- _plotter->z_transparent_color.red = 255;
- _plotter->z_transparent_color.green = 255;
- _plotter->z_transparent_color.blue = 255;
-
-
-
- {
- const char *interlace_s;
- interlace_s = (const char *)_get_plot_param (_plotter->data, "INTERLACE" );
- if (strcasecmp (interlace_s, "yes") == 0)
- _plotter->z_interlace = true;
- }
-
- {
- const char *transparent_name_s;
- plColor color;
- transparent_name_s = (const char *)_get_plot_param (_plotter->data, "TRANSPARENT_COLOR");
- if (transparent_name_s
- && _string_to_color (transparent_name_s, &color, _plotter->data->color_name_cache))
-
- {
- _plotter->z_transparent = true;
- _plotter->z_transparent_color = color;
- }
- }
- }
- void
- _pl_z_terminate (S___(Plotter *_plotter))
- {
- #ifndef LIBPLOTTER
-
- _pl_b_terminate (S___(_plotter));
- #endif
- }
- #ifdef LIBPLOTTER
- PNGPlotter::PNGPlotter (FILE *infile, FILE *outfile, FILE *errfile)
- : BitmapPlotter (infile, outfile, errfile)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter (FILE *outfile)
- : BitmapPlotter (outfile)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter (istream& in, ostream& out, ostream& err)
- : BitmapPlotter (in, out, err)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter (ostream& out)
- : BitmapPlotter (out)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter ()
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters)
- : BitmapPlotter (infile, outfile, errfile, parameters)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter (FILE *outfile, PlotterParams ¶meters)
- : BitmapPlotter (outfile, parameters)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters)
- : BitmapPlotter (in, out, err, parameters)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter (ostream& out, PlotterParams ¶meters)
- : BitmapPlotter (out, parameters)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::PNGPlotter (PlotterParams ¶meters)
- : BitmapPlotter (parameters)
- {
- _pl_z_initialize ();
- }
- PNGPlotter::~PNGPlotter ()
- {
- _pl_z_terminate ();
- }
- #endif
|