GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
pngdriver/driver.c
Go to the documentation of this file.
1/*!
2 \file lib/pngdriver/driver.c
3
4 \brief GRASS png display driver - driver initialization
5
6 (C) 2007-2014 by Glynn Clements and the GRASS Development Team
7
8 This program is free software under the GNU General Public License
9 (>=v2). Read the file COPYING that comes with GRASS for details.
10
11 \author Glynn Clements
12 */
13
14#include "pngdriver.h"
15
16/*!
17 \brief Initialize display driver
18
19 \return pointer driver structure
20 */
21const struct driver *PNG_Driver(void)
22{
23 static struct driver drv;
24 static int initialized;
25
26 if (initialized)
27 return &drv;
28
29 drv.name = "png";
30 drv.Box = PNG_Box;
31 drv.Erase = PNG_Erase;
32 drv.Graph_set = PNG_Graph_set;
33 drv.Graph_close = PNG_Graph_close;
34 drv.Graph_get_file = PNG_Graph_get_file;
35 drv.Line_width = PNG_Line_width;
36 drv.Set_window = PNG_Set_window;
37 drv.Begin_raster = PNG_begin_raster;
38 drv.Raster = PNG_raster;
39 drv.End_raster = NULL;
40 drv.Begin = PNG_Begin;
41 drv.Move = PNG_Move;
42 drv.Cont = PNG_Cont;
43 drv.Close = PNG_Close;
44 drv.Stroke = PNG_Stroke;
45 drv.Fill = PNG_Fill;
46 drv.Point = PNG_Point;
47 drv.Color = PNG_color_rgb;
48 drv.Bitmap = PNG_draw_bitmap;
49 drv.Text = NULL;
50 drv.Text_box = NULL;
51 drv.Set_font = NULL;
52 drv.Font_list = NULL;
53 drv.Font_info = NULL;
54
55 initialized = 1;
56
57 return &drv;
58}
#define NULL
Definition ccmath.h:32
AMI_err name(char **stream_name)
Definition ami_stream.h:426
void PNG_Box(double fx1, double fy1, double fx2, double fy2)
Draw a (filled) rectangle.
void PNG_color_rgb(int r, int g, int b)
Identify a color.
void PNG_Close(void)
void PNG_Begin(void)
void PNG_Cont(double x, double y)
void PNG_Move(double x, double y)
void PNG_Stroke(void)
void PNG_Fill(void)
void PNG_draw_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Draw bitmap.
const struct driver * PNG_Driver(void)
Initialize display driver.
void PNG_Erase(void)
Erase screen.
void PNG_Graph_close(void)
Close down the graphics processing. This gets called only at driver termination time.
int PNG_Graph_set(void)
Start up graphics processing.
const char * PNG_Graph_get_file(void)
Get render file.
void PNG_Line_width(double width)
Set line width.
GRASS png display driver - header file.
int PNG_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Draw raster row.
void PNG_begin_raster(int, int[2][2], double[2][2])
Start drawing raster.
void PNG_Point(double, double)
Draw point.
Definition point.c:20
void PNG_Set_window(double, double, double, double)
Set window.