Loading...
Searching...
No Matches
pngdriver.h
Go to the documentation of this file.
/*!
\file lib/pngdriver/pngdriver.h
\brief GRASS png display driver - header file
(C) 2007-2014 by Glynn Clements and the GRASS Development Team
This program is free software under the GNU General Public License
(>=v2). Read the file COPYING that comes with GRASS for details.
\author Glynn Clements
*/
#ifndef __PNGDRIVER_H__
#define __PNGDRIVER_H__
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#endif
#include <grass/config.h>
#include "driver.h"
#include "path.h"
#define FILE_NAME "map.png"
#define HEADER_SIZE 64
struct png_state {
char *file_name;
int current_color;
int true_color;
int has_alpha;
int mapped;
#ifdef _WIN32
HANDLE handle;
#endif
double clip_top, clip_bot, clip_left, clip_rite;
int width, height;
unsigned int *grid;
unsigned char palette[256][4];
unsigned int background;
int modified;
int linewidth;
};
extern struct png_state png;
extern void read_image(void);
extern void read_ppm(void);
extern void read_pgm(void);
extern void read_bmp(void);
#ifdef HAVE_PNG_H
extern void read_png(void);
#endif
extern void write_image(void);
extern void write_ppm(void);
extern void write_pgm(void);
extern void write_bmp(void);
#ifdef HAVE_PNG_H
extern void write_png(void);
#endif
extern void png_init_color_table(void);
extern unsigned int png_get_color(int, int, int, int);
extern void png_get_pixel(unsigned int, int *, int *, int *, int *);
extern void png_draw_line(double, double, double, double);
extern void png_polygon(struct path *);
extern const struct driver *PNG_Driver(void);
extern void PNG_Box(double, double, double, double);
extern void PNG_Client_Close(void);
extern void PNG_Erase(void);
extern void PNG_Graph_close(void);
extern int PNG_Graph_set(void);
extern const char *PNG_Graph_get_file(void);
extern void PNG_Line_width(double);
extern void PNG_begin_raster(int, int[2][2], double[2][2]);
extern int PNG_raster(int, int, const unsigned char *, const unsigned char *,
const unsigned char *, const unsigned char *);
extern void PNG_Begin(void);
extern void PNG_Move(double, double);
extern void PNG_Cont(double, double);
extern void PNG_Close(void);
extern void PNG_Stroke(void);
extern void PNG_Fill(void);
extern void PNG_Point(double, double);
extern void PNG_Set_window(double, double, double, double);
extern void PNG_color_rgb(int, int, int);
extern void PNG_draw_bitmap(int, int, int, const unsigned char *);
#endif /* __PNGDRIVER_H__ */
driver.h
path.h
png
struct png_state png
Definition pngdriver/graph_set.c:32
PNG_Close
void PNG_Close(void)
Definition pngdriver/draw.c:36
PNG_Driver
const struct driver * PNG_Driver(void)
Initialize display driver.
Definition pngdriver/driver.c:21
write_pgm
void write_pgm(void)
Definition pngdriver/write_ppm.c:49
PNG_raster
int PNG_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Draw raster row.
Definition pngdriver/raster.c:111
read_bmp
void read_bmp(void)
Definition pngdriver/read_bmp.c:79
PNG_Begin
void PNG_Begin(void)
Definition pngdriver/draw.c:21
write_ppm
void write_ppm(void)
Definition pngdriver/write_ppm.c:21
PNG_Move
void PNG_Move(double, double)
Definition pngdriver/draw.c:26
write_bmp
void write_bmp(void)
Definition pngdriver/write_bmp.c:63
PNG_Graph_close
void PNG_Graph_close(void)
Close down the graphics processing. This gets called only at driver termination time.
Definition pngdriver/graph_close.c:50
PNG_begin_raster
void PNG_begin_raster(int, int[2][2], double[2][2])
Start drawing raster.
Definition pngdriver/raster.c:80
PNG_Graph_set
int PNG_Graph_set(void)
Start up graphics processing.
Definition pngdriver/graph_set.c:86
PNG_Point
void PNG_Point(double, double)
Draw point.
Definition point.c:20
read_ppm
void read_ppm(void)
Definition pngdriver/read_ppm.c:22
PNG_Set_window
void PNG_Set_window(double, double, double, double)
Set window.
Definition pngdriver/set_window.c:23
png_get_pixel
void png_get_pixel(unsigned int, int *, int *, int *, int *)
Definition color_table.c:110
png_init_color_table
void png_init_color_table(void)
Definition color_table.c:72
write_image
void write_image(void)
Definition pngdriver/write.c:22
PNG_Line_width
void PNG_Line_width(double)
Set line width.
Definition pngdriver/line_width.c:23
png_polygon
void png_polygon(struct path *)
Draw polygon.
Definition pngdriver/polygon.c:135
PNG_Cont
void PNG_Cont(double, double)
Definition pngdriver/draw.c:31
PNG_Client_Close
void PNG_Client_Close(void)
PNG_Stroke
void PNG_Stroke(void)
Definition pngdriver/draw.c:41
read_image
void read_image(void)
Definition pngdriver/read.c:22
PNG_Box
void PNG_Box(double, double, double, double)
Draw a (filled) rectangle.
Definition pngdriver/box.c:23
PNG_draw_bitmap
void PNG_draw_bitmap(int, int, int, const unsigned char *)
Draw bitmap.
Definition pngdriver/draw_bitmap.c:32
PNG_Graph_get_file
const char * PNG_Graph_get_file(void)
Get render file.
Definition pngdriver/graph_set.c:184
png_get_color
unsigned int png_get_color(int, int, int, int)
Definition color_table.c:118
png_draw_line
void png_draw_line(double, double, double, double)
Definition draw_line.c:68
PNG_Fill
void PNG_Fill(void)
Definition pngdriver/draw.c:46
PNG_Erase
void PNG_Erase(void)
Erase screen.
Definition pngdriver/erase.c:20
read_pgm
void read_pgm(void)
Definition pngdriver/read_ppm.c:70
PNG_color_rgb
void PNG_color_rgb(int, int, int)
Identify a color.
Definition pngdriver/color.c:31
read_png
void read_png(void)
Definition read_png.c:45
driver
Definition driver.h:27
path
Definition path.h:15
png_state
Definition pngdriver.h:31
png_state::clip_left
double clip_left
Definition pngdriver.h:41
png_state::clip_bot
double clip_bot
Definition pngdriver.h:41
png_state::file_name
char * file_name
Definition pngdriver.h:32
png_state::mapped
int mapped
Definition pngdriver.h:36
png_state::has_alpha
int has_alpha
Definition pngdriver.h:35
png_state::clip_top
double clip_top
Definition pngdriver.h:41
png_state::current_color
int current_color
Definition pngdriver.h:33
png_state::true_color
int true_color
Definition pngdriver.h:34
png_state::height
int height
Definition pngdriver.h:42
png_state::grid
unsigned int * grid
Definition pngdriver.h:43
png_state::palette
unsigned char palette[256][4]
Definition pngdriver.h:44
png_state::width
int width
Definition pngdriver.h:42
png_state::background
unsigned int background
Definition pngdriver.h:45
png_state::clip_rite
double clip_rite
Definition pngdriver.h:41
png_state::linewidth
int linewidth
Definition pngdriver.h:48
png_state::modified
int modified
Definition pngdriver.h:46
write_png
void write_png(void)
Definition write_png.c:55