GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
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 */
21 const 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;
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 }
void(* Fill)(void)
Definition: driver.h:45
char * name
Definition: driver.h:24
void PNG_Fill(void)
void(* Stroke)(void)
Definition: driver.h:44
void PNG_Begin(void)
int(* Graph_set)(void)
Definition: driver.h:28
void(* Line_width)(double)
Definition: driver.h:31
int(* Raster)(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Definition: driver.h:34
GRASS png display driver - header file.
void PNG_Close(void)
void(* Begin_raster)(int, int[2][2], double[2][2])
Definition: driver.h:33
void(* Begin)(void)
Definition: driver.h:40
void PNG_Move(double x, double y)
void PNG_Stroke(void)
void(* Color)(int, int, int)
Definition: driver.h:48
#define NULL
Definition: ccmath.h:32
void(* Set_window)(double, double, double, double)
Definition: driver.h:32
const char * PNG_Graph_get_file(void)
Get render file.
void(* Graph_close)(void)
Definition: driver.h:29
void PNG_Box(double fx1, double fy1, double fx2, double fy2)
Draw a (filled) rectangle.
Definition: pngdriver/box.c:24
void(* Move)(double, double)
Definition: driver.h:41
void PNG_Erase(void)
Erase screen.
int PNG_Graph_set(void)
Start up graphics processing.
void(* Text)(const char *)
Definition: driver.h:50
int PNG_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Draw raster row.
void(* Box)(double, double, double, double)
Definition: driver.h:26
void(* Font_list)(char ***, int *)
Definition: driver.h:53
const char *(* Graph_get_file)(void)
Definition: driver.h:30
void(* End_raster)(void)
Definition: driver.h:39
void(* Text_box)(const char *, double *, double *, double *, double *)
Definition: driver.h:51
void(* Point)(double, double)
Definition: driver.h:46
Definition: driver.h:22
void(* Font_info)(char ***, int *)
Definition: driver.h:54
const struct driver * PNG_Driver(void)
Initialize display driver.
void(* Close)(void)
Definition: driver.h:43
void PNG_Line_width(double width)
Set line width.
void PNG_begin_raster(int, int[2][2], double[2][2])
Start drawing raster.
void PNG_Cont(double x, double y)
void PNG_color_rgb(int r, int g, int b)
Identify a color.
void PNG_Graph_close(void)
Close down the graphics processing. This gets called only at driver termination time.
void PNG_Point(double, double)
Draw point.
Definition: point.c:20
void PNG_Set_window(double, double, double, double)
Set window.
void(* Bitmap)(int, int, int, const unsigned char *)
Definition: driver.h:49
void(* Set_font)(const char *)
Definition: driver.h:52
void(* Cont)(double, double)
Definition: driver.h:42
void PNG_draw_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Draw bitmap.
void(* Erase)(void)
Definition: driver.h:27