GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71793
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 write_pgm(void)
void PNG_Fill(void)
int width
Definition: pngdriver.h:43
double clip_left
Definition: pngdriver.h:42
void PNG_Begin(void)
int current_color
Definition: pngdriver.h:34
void PNG_Close(void)
void write_png(void)
Definition: write_png.c:56
void write_bmp(void)
unsigned char palette[256][4]
Definition: pngdriver.h:45
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 x, double y)
void PNG_Stroke(void)
void png_get_pixel(unsigned int pixel, int *r, int *g, int *b, int *a)
Definition: color_table.c:112
double clip_bot
Definition: pngdriver.h:42
void write_ppm(void)
const char * PNG_Graph_get_file(void)
Get render file.
struct png_state png
void read_image(void)
void PNG_Box(double fx1, double fy1, double fx2, double fy2)
Draw a (filled) rectangle.
Definition: pngdriver/box.c:24
struct driver * PNG_Driver(void)
Initialize display driver.
int linewidth
Definition: pngdriver.h:49
int mapped
Definition: pngdriver.h:37
unsigned int png_get_color(int r, int g, int b, int a)
Definition: color_table.c:120
void PNG_Erase(void)
Erase screen.
int modified
Definition: pngdriver.h:47
int PNG_Graph_set(void)
Start up graphics processing.
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_draw_line(double x1, double y1, double x2, double y2)
Definition: draw_line.c:65
Definition: driver.h:22
Definition: path.h:16
void png_polygon(struct path *)
Draw polygon.
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)
int true_color
Definition: pngdriver.h:35
void read_png(void)
Definition: read_png.c:45
void read_ppm(void)
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.
unsigned int background
Definition: pngdriver.h:46
void png_init_color_table(void)
Definition: color_table.c:73
void PNG_Client_Close(void)
void PNG_draw_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Draw bitmap.
void read_pgm(void)