GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-b4187339ee
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  char *file_name;
35  int has_alpha;
36  int mapped;
37 #ifdef __MINGW32__
38  HANDLE handle;
39 #endif
40 
42  int width, height;
43  unsigned int *grid;
44  unsigned char palette[256][4];
45  unsigned int background;
46  int modified;
47 
48  int linewidth;
49 };
50 
51 extern struct png_state png;
52 
53 extern void read_image(void);
54 extern void read_ppm(void);
55 extern void read_pgm(void);
56 extern void read_bmp(void);
57 #ifdef HAVE_PNG_H
58 extern void read_png(void);
59 #endif
60 
61 extern void write_image(void);
62 extern void write_ppm(void);
63 extern void write_pgm(void);
64 extern void write_bmp(void);
65 #ifdef HAVE_PNG_H
66 extern void write_png(void);
67 #endif
68 
69 extern void png_init_color_table(void);
70 extern unsigned int png_get_color(int, int, int, int);
71 extern void png_get_pixel(unsigned int, int *, int *, int *, int *);
72 extern void png_draw_line(double, double, double, double);
73 extern void png_polygon(struct path *);
74 
75 extern const struct driver *PNG_Driver(void);
76 
77 extern void PNG_Box(double, double, double, double);
78 extern void PNG_Client_Close(void);
79 extern void PNG_Erase(void);
80 extern void PNG_Graph_close(void);
81 extern int PNG_Graph_set(void);
82 extern const char *PNG_Graph_get_file(void);
83 extern void PNG_Line_width(double);
84 extern void PNG_begin_raster(int, int[2][2], double[2][2]);
85 extern int PNG_raster(int, int, const unsigned char *, const unsigned char *,
86  const unsigned char *, const unsigned char *);
87 extern void PNG_Begin(void);
88 extern void PNG_Move(double, double);
89 extern void PNG_Cont(double, double);
90 extern void PNG_Close(void);
91 extern void PNG_Stroke(void);
92 extern void PNG_Fill(void);
93 extern void PNG_Point(double, double);
94 extern void PNG_Set_window(double, double, double, double);
95 extern void PNG_color_rgb(int, int, int);
96 extern void PNG_draw_bitmap(int, int, int, const unsigned char *);
97 
98 #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 *)
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:110
void png_init_color_table(void)
Definition: color_table.c:72
void write_image(void)
void PNG_Line_width(double)
Set line width.
void write_png(void)
Definition: write_png.c:55
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:118
void png_draw_line(double, double, double, double)
Definition: draw_line.c:68
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:21
Definition: path.h:15
double clip_left
Definition: pngdriver.h:41
double clip_bot
Definition: pngdriver.h:41
char * file_name
Definition: pngdriver.h:32
int mapped
Definition: pngdriver.h:36
int has_alpha
Definition: pngdriver.h:35
double clip_top
Definition: pngdriver.h:41
int current_color
Definition: pngdriver.h:33
int true_color
Definition: pngdriver.h:34
int height
Definition: pngdriver.h:42
unsigned int * grid
Definition: pngdriver.h:43
unsigned char palette[256][4]
Definition: pngdriver.h:44
int width
Definition: pngdriver.h:42
unsigned int background
Definition: pngdriver.h:45
double clip_rite
Definition: pngdriver.h:41
int linewidth
Definition: pngdriver.h:48
int modified
Definition: pngdriver.h:46