GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
GRASS png display driver - header file. More...
Go to the source code of this file.
Data Structures | |
struct | png_state |
Macros | |
#define | FILE_NAME "map.png" |
#define | HEADER_SIZE 64 |
Functions | |
void | read_image (void) |
void | read_ppm (void) |
void | read_pgm (void) |
void | read_bmp (void) |
void | read_png (void) |
void | write_image (void) |
void | write_ppm (void) |
void | write_pgm (void) |
void | write_bmp (void) |
void | write_png (void) |
void | png_init_color_table (void) |
unsigned int | png_get_color (int, int, int, int) |
void | png_get_pixel (unsigned int, int *, int *, int *, int *) |
void | png_draw_line (double, double, double, double) |
void | png_polygon (struct path *) |
Draw polygon. More... | |
const struct driver * | PNG_Driver (void) |
Initialize display driver. More... | |
void | PNG_Box (double, double, double, double) |
Draw a (filled) rectangle. More... | |
void | PNG_Client_Close (void) |
void | PNG_Erase (void) |
Erase screen. More... | |
void | PNG_Graph_close (void) |
Close down the graphics processing. This gets called only at driver termination time. More... | |
int | PNG_Graph_set (void) |
Start up graphics processing. More... | |
const char * | PNG_Graph_get_file (void) |
Get render file. More... | |
void | PNG_Line_width (double) |
Set line width. More... | |
void | PNG_begin_raster (int, int[2][2], double[2][2]) |
Start drawing raster. More... | |
int | PNG_raster (int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *) |
void | PNG_Begin (void) |
void | PNG_Move (double, double) |
void | PNG_Cont (double, double) |
void | PNG_Close (void) |
void | PNG_Stroke (void) |
void | PNG_Fill (void) |
void | PNG_Point (double, double) |
Draw point. More... | |
void | PNG_Set_window (double, double, double, double) |
Set window. More... | |
void | PNG_color_rgb (int, int, int) |
Identify a color. More... | |
void | PNG_draw_bitmap (int, int, int, const unsigned char *) |
Draw bitmap. More... | |
Variables | |
struct png_state | png |
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.
Definition in file pngdriver.h.
#define FILE_NAME "map.png" |
Definition at line 27 of file pngdriver.h.
#define HEADER_SIZE 64 |
Definition at line 29 of file pngdriver.h.
void PNG_Begin | ( | void | ) |
Definition at line 21 of file pngdriver/draw.c.
References path_begin().
void PNG_begin_raster | ( | int | mask, |
int | s[2][2], | ||
double | fd[2][2] | ||
) |
Start drawing raster.
mask | non-zero int for mask |
s | source (map) extent (left, right, top, bottom) |
fd | destination (image) extent (left, right, top, bottom) |
Definition at line 80 of file pngdriver/raster.c.
void PNG_Box | ( | double | fx1, |
double | fy1, | ||
double | fx2, | ||
double | fy2 | ||
) |
Draw a (filled) rectangle.
fx1,fy1,fx2,fy2 | rectangle coordinates |
Definition at line 24 of file pngdriver/box.c.
Referenced by PNG_Point().
void PNG_Client_Close | ( | void | ) |
void PNG_Close | ( | void | ) |
Definition at line 36 of file pngdriver/draw.c.
References path_close().
void PNG_color_rgb | ( | int | r, |
int | g, | ||
int | b | ||
) |
Identify a color.
Identify a color that has been set in the reset_color() (found in Reset_clr.c file in this directory). Subsequent graphics calls will use this color.
Called by: Color() in ../lib/Color.c
r | red color value |
g | green color value |
b | blue color value |
Definition at line 32 of file pngdriver/color.c.
References b, png_state::current_color, g, png, png_get_color(), and r.
void PNG_Cont | ( | double | x, |
double | y | ||
) |
Definition at line 31 of file pngdriver/draw.c.
References path_cont(), and x.
void PNG_draw_bitmap | ( | int | ncols, |
int | nrows, | ||
int | threshold, | ||
const unsigned char * | buf | ||
) |
Draw bitmap.
ncols,nrows | number of columns and rows |
threshold | threshold value |
buf | data buffer |
Definition at line 33 of file pngdriver/draw_bitmap.c.
void png_draw_line | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Definition at line 68 of file draw_line.c.
Referenced by PNG_Stroke().
const struct driver* PNG_Driver | ( | void | ) |
Initialize display driver.
Definition at line 21 of file pngdriver/driver.c.
void PNG_Erase | ( | void | ) |
Erase screen.
Definition at line 20 of file pngdriver/erase.c.
References png_state::background, png_state::grid, png_state::height, png_state::modified, png, and png_state::width.
void PNG_Fill | ( | void | ) |
Definition at line 46 of file pngdriver/draw.c.
References png_polygon().
unsigned int png_get_color | ( | int | r, |
int | g, | ||
int | b, | ||
int | a | ||
) |
Definition at line 118 of file color_table.c.
Referenced by PNG_color_rgb(), and PNG_Graph_set().
void png_get_pixel | ( | unsigned int | pixel, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Definition at line 110 of file color_table.c.
void PNG_Graph_close | ( | void | ) |
Close down the graphics processing. This gets called only at driver termination time.
Definition at line 50 of file pngdriver/graph_close.c.
References png_state::mapped, png, and write_image().
const char* PNG_Graph_get_file | ( | void | ) |
Get render file.
Definition at line 179 of file pngdriver/graph_set.c.
References png_state::file_name, and png.
int PNG_Graph_set | ( | void | ) |
Start up graphics processing.
Anything that needs to be assigned, set up, started-up, or otherwise initialized happens here. This is called only at the startup of the graphics driver.
The external variables define the pixle limits of the graphics surface. The coordinate system used by the applications programs has the (0,0) origin in the upper left-hand corner. Hence, screen_left < screen_right screen_top < screen_bottom
Definition at line 81 of file pngdriver/graph_set.c.
References _, png_state::background, png_state::clip_bot, png_state::clip_left, png_state::clip_rite, png_state::clip_top, DEFAULT_FG_COLOR, FILE_NAME, png_state::file_name, G_debug(), G_gisinit, G_str_to_color(), G_strcasecmp(), G_verbose_message(), png_state::has_alpha, png_state::height, png, png_get_color(), png_init_color_table(), screen_height, screen_width, png_state::true_color, and png_state::width.
void png_init_color_table | ( | void | ) |
Definition at line 72 of file color_table.c.
References png, and png_state::true_color.
Referenced by PNG_Graph_set().
void PNG_Line_width | ( | double | width | ) |
Set line width.
width | line width (double precision) |
Definition at line 23 of file pngdriver/line_width.c.
void PNG_Move | ( | double | x, |
double | y | ||
) |
Definition at line 26 of file pngdriver/draw.c.
References path_move(), and x.
void PNG_Point | ( | double | x, |
double | y | ||
) |
void png_polygon | ( | struct path * | p | ) |
Draw polygon.
Definition at line 135 of file pngdriver/polygon.c.
References path::count, vertex::mode, P_CLOSE, path_close(), and path::vertices.
Referenced by PNG_Fill().
int PNG_raster | ( | int | , |
int | , | ||
const unsigned char * | , | ||
const unsigned char * | , | ||
const unsigned char * | , | ||
const unsigned char * | |||
) |
void PNG_Set_window | ( | double | t, |
double | b, | ||
double | l, | ||
double | r | ||
) |
Set window.
t,b,l,r | top, bottom, left, right |
Definition at line 23 of file pngdriver/set_window.c.
References b, png_state::clip_bot, png_state::clip_left, png_state::clip_rite, png_state::clip_top, png_state::height, l, png, r, t, and png_state::width.
void PNG_Stroke | ( | void | ) |
Definition at line 41 of file pngdriver/draw.c.
References path_stroke(), and png_draw_line().
void read_bmp | ( | void | ) |
Definition at line 79 of file pngdriver/read_bmp.c.
References HEADER_SIZE.
Referenced by read_image().
void read_image | ( | void | ) |
Definition at line 22 of file pngdriver/read.c.
References png_state::file_name, G_fatal_error(), G_strcasecmp(), png_state::has_alpha, png_state::modified, png, read_bmp(), read_pgm(), read_png(), and read_ppm().
void read_pgm | ( | void | ) |
Definition at line 68 of file pngdriver/read_ppm.c.
References png_state::file_name, G_store(), and png.
Referenced by read_image().
void read_png | ( | void | ) |
Definition at line 45 of file read_png.c.
Referenced by read_image().
void read_ppm | ( | void | ) |
Definition at line 21 of file pngdriver/read_ppm.c.
Referenced by read_image().
void write_bmp | ( | void | ) |
Definition at line 63 of file pngdriver/write_bmp.c.
References png_state::file_name, G_fatal_error(), HEADER_SIZE, output(), png, and x.
Referenced by write_image().
void write_image | ( | void | ) |
Definition at line 22 of file pngdriver/write.c.
References png_state::file_name, G_fatal_error(), G_strcasecmp(), png_state::has_alpha, png_state::mapped, png_state::modified, png, write_bmp(), write_pgm(), write_png(), and write_ppm().
Referenced by PNG_Graph_close().
void write_pgm | ( | void | ) |
Definition at line 49 of file pngdriver/write_ppm.c.
References png_state::file_name, G_fatal_error(), G_free(), G_store(), png_state::grid, png_state::height, output(), png, png_state::width, and x.
Referenced by write_image().
void write_png | ( | void | ) |
void write_ppm | ( | void | ) |
Definition at line 21 of file pngdriver/write_ppm.c.
References png_state::file_name, G_fatal_error(), png_state::grid, png_state::height, output(), png, png_state::width, and x.
Referenced by write_image().
|
extern |
Definition at line 1 of file pngdriver/graph_set.c.
Referenced by PNG_color_rgb(), PNG_draw_point(), PNG_Erase(), PNG_Graph_close(), PNG_Graph_get_file(), PNG_Graph_set(), png_init_color_table(), PNG_Set_window(), read_image(), read_pgm(), write_bmp(), write_image(), write_pgm(), and write_ppm().