GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
pngdriver.h
Go to the documentation of this file.
1 /*!
2  \file lib/pngdriver/pngdriver.h
3 
4  \brief GRASS png display driver - header file
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 #ifndef __PNGDRIVER_H__
15 #define __PNGDRIVER_H__
16 
17 #include <stdio.h>
18 
19 #ifdef __MINGW32__
20 #include <windows.h>
21 #endif
22 
23 #include <grass/config.h>
24 #include "driver.h"
25 #include "path.h"
26 
27 #define FILE_NAME "map.png"
28 
29 #define HEADER_SIZE 64
30 
31 struct png_state
32 {
33  char *file_name;
36  int has_alpha;
37  int mapped;
38 #ifdef __MINGW32__
39  HANDLE handle;
40 #endif
41 
43  int width, height;
44  unsigned int *grid;
45  unsigned char palette[256][4];
46  unsigned int background;
47  int modified;
48 
49  int linewidth;
50 };
51 
52 extern struct png_state png;
53 
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);
59 
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);
65 
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 *);
71 
72 extern const struct driver *PNG_Driver(void);
73 
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 *);
95 
96 #endif /* __PNGDRIVER_H__ */
void write_pgm(void)
const struct driver * PNG_Driver(void)
Initialize display driver.
int width
Definition: pngdriver.h:43
double clip_left
Definition: pngdriver.h:42
struct png_state png
int current_color
Definition: pngdriver.h:34
void PNG_Cont(double, double)
void PNG_Erase(void)
Erase screen.
void png_init_color_table(void)
Definition: color_table.c:73
void write_png(void)
Definition: write_png.c:56
void write_bmp(void)
unsigned char palette[256][4]
Definition: pngdriver.h:45
void PNG_Begin(void)
const char * PNG_Graph_get_file(void)
Get render file.
void read_bmp(void)
int height
Definition: pngdriver.h:43
double clip_top
Definition: pngdriver.h:42
double clip_rite
Definition: pngdriver.h:42
void PNG_Move(double, double)
double clip_bot
Definition: pngdriver.h:42
void PNG_Graph_close(void)
Close down the graphics processing. This gets called only at driver termination time.
void PNG_Stroke(void)
void write_ppm(void)
void read_image(void)
void PNG_color_rgb(int, int, int)
Identify a color.
int linewidth
Definition: pngdriver.h:49
int mapped
Definition: pngdriver.h:37
void PNG_Close(void)
int modified
Definition: pngdriver.h:47
unsigned int png_get_color(int, int, int, int)
Definition: color_table.c:120
void PNG_Fill(void)
void write_image(void)
char * file_name
Definition: pngdriver.h:33
unsigned int * grid
Definition: pngdriver.h:44
int PNG_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Draw raster row.
int has_alpha
Definition: pngdriver.h:36
void png_get_pixel(unsigned int, int *, int *, int *, int *)
Definition: color_table.c:112
void png_draw_line(double, double, double, double)
Definition: draw_line.c:65
int PNG_Graph_set(void)
Start up graphics processing.
Definition: driver.h:22
Definition: path.h:16
void png_polygon(struct path *)
Draw polygon.
void PNG_begin_raster(int, int[2][2], double[2][2])
Start drawing raster.
int true_color
Definition: pngdriver.h:35
void read_png(void)
Definition: read_png.c:45
void read_ppm(void)
void PNG_Point(double, double)
Draw point.
Definition: point.c:20
void PNG_Set_window(double, double, double, double)
Set window.
unsigned int background
Definition: pngdriver.h:46
void PNG_Line_width(double)
Set line width.
void PNG_Box(double, double, double, double)
Draw a (filled) rectangle.
Definition: pngdriver/box.c:24
void PNG_Client_Close(void)
void read_pgm(void)
void PNG_draw_bitmap(int, int, int, const unsigned char *)
Draw bitmap.