GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-e6660eef60
Go to the documentation of this file.
1 /*!
2  \file lib/pngdriver/pngdriver.h
4  \brief GRASS png display driver - header file
6  (C) 2007-2014 by Glynn Clements and the GRASS Development Team
8  This program is free software under the GNU General Public License
9  (>=v2). Read the file COPYING that comes with GRASS for details.
11  \author Glynn Clements
12 */
14 #ifndef __PNGDRIVER_H__
15 #define __PNGDRIVER_H__
17 #include <stdio.h>
19 #ifdef __MINGW32__
20 #include <windows.h>
21 #endif
23 #include <grass/config.h>
24 #include "driver.h"
25 #include "path.h"
27 #define FILE_NAME "map.png"
29 #define HEADER_SIZE 64
31 struct png_state
32 {
33  char *file_name;
36  int has_alpha;
37  int mapped;
38 #ifdef __MINGW32__
39  HANDLE handle;
40 #endif
43  int width, height;
44  unsigned int *grid;
45  unsigned char palette[256][4];
46  unsigned int background;
47  int modified;
49  int linewidth;
50 };
52 extern struct png_state png;
54 extern void read_image(void);
55 extern void read_ppm(void);
56 extern void read_pgm(void);
57 extern void read_bmp(void);
58 extern void read_png(void);
60 extern void write_image(void);
61 extern void write_ppm(void);
62 extern void write_pgm(void);
63 extern void write_bmp(void);
64 extern void write_png(void);
66 extern void png_init_color_table(void);
67 extern unsigned int png_get_color(int, int, int, int);
68 extern void png_get_pixel(unsigned int, int *, int *, int *, int *);
69 extern void png_draw_line(double, double, double, double);
70 extern void png_polygon(struct path *);
72 extern const struct driver *PNG_Driver(void);
74 extern void PNG_Box(double, double, double, double);
75 extern void PNG_Client_Close(void);
76 extern void PNG_Erase(void);
77 extern void PNG_Graph_close(void);
78 extern int PNG_Graph_set(void);
79 extern const char *PNG_Graph_get_file(void);
80 extern void PNG_Line_width(double);
81 extern void PNG_begin_raster(int, int[2][2], double[2][2]);
82 extern int PNG_raster(int, int, const unsigned char *,
83  const unsigned char *, const unsigned char *,
84  const unsigned char *);
85 extern void PNG_Begin(void);
86 extern void PNG_Move(double, double);
87 extern void PNG_Cont(double, double);
88 extern void PNG_Close(void);
89 extern void PNG_Stroke(void);
90 extern void PNG_Fill(void);
91 extern void PNG_Point(double, double);
92 extern void PNG_Set_window(double, double, double, double);
93 extern void PNG_color_rgb(int, int, int);
94 extern void PNG_draw_bitmap(int, int, int, const unsigned char *);
96 #endif /* __PNGDRIVER_H__ */
void PNG_Close(void)
void write_pgm(void)
int PNG_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Draw raster row.
const char * PNG_Graph_get_file(void)
Get render file.
void read_bmp(void)
void PNG_Begin(void)
void write_ppm(void)
void PNG_Move(double, double)
void write_bmp(void)
const struct driver * PNG_Driver(void)
Initialize display driver.
void PNG_Graph_close(void)
Close down the graphics processing. This gets called only at driver termination time.
void PNG_begin_raster(int, int[2][2], double[2][2])
Start drawing raster.
struct png_state png
int PNG_Graph_set(void)
Start up graphics processing.
void PNG_Point(double, double)
Draw point.
Definition: point.c:20
void read_ppm(void)
void PNG_Set_window(double, double, double, double)
Set window.
void png_get_pixel(unsigned int, int *, int *, int *, int *)
Definition: color_table.c:112
void png_init_color_table(void)
Definition: color_table.c:73
void write_image(void)
void PNG_Line_width(double)
Set line width.
void write_png(void)
Definition: write_png.c:56
void png_polygon(struct path *)
Draw polygon.
void PNG_Cont(double, double)
void PNG_Client_Close(void)
void read_png(void)
Definition: read_png.c:45
void PNG_Stroke(void)
void read_image(void)
void PNG_Box(double, double, double, double)
Draw a (filled) rectangle.
Definition: pngdriver/box.c:24
void PNG_draw_bitmap(int, int, int, const unsigned char *)
Draw bitmap.
unsigned int png_get_color(int, int, int, int)
Definition: color_table.c:120
void png_draw_line(double, double, double, double)
Definition: draw_line.c:65
void PNG_Fill(void)
void PNG_Erase(void)
Erase screen.
void read_pgm(void)
void PNG_color_rgb(int, int, int)
Identify a color.
Definition: driver.h:23
Definition: path.h:16
double clip_left
Definition: pngdriver.h:42
double clip_bot
Definition: pngdriver.h:42
char * file_name
Definition: pngdriver.h:33
int mapped
Definition: pngdriver.h:37
int has_alpha
Definition: pngdriver.h:36
double clip_top
Definition: pngdriver.h:42
int current_color
Definition: pngdriver.h:34
int true_color
Definition: pngdriver.h:35
int height
Definition: pngdriver.h:43
unsigned int * grid
Definition: pngdriver.h:44
unsigned char palette[256][4]
Definition: pngdriver.h:45
int width
Definition: pngdriver.h:43
unsigned int background
Definition: pngdriver.h:46
double clip_rite
Definition: pngdriver.h:42
int linewidth
Definition: pngdriver.h:49
int modified
Definition: pngdriver.h:47