GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73587
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pngdriver.h File Reference

GRASS png display driver - header file. More...

#include <stdio.h>
#include <grass/config.h>
#include "driver.h"
#include "path.h"
Include dependency graph for pngdriver.h:
This graph shows which files directly or indirectly include this file:

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...
 
struct driverPNG_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 *)
 Draw raster row. More...
 
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
 

Detailed Description

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

Definition in file pngdriver.h.

Macro Definition Documentation

#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.

Function Documentation

void PNG_Begin ( void  )

Definition at line 21 of file pngdriver/draw.c.

References path_begin().

Referenced by PNG_Driver().

void PNG_begin_raster ( int  mask,
int  s[2][2],
double  fd[2][2] 
)

Start drawing raster.

Parameters
masknon-zero int for mask
ssource (map) extent (left, right, top, bottom)
fddestination (image) extent (left, right, top, bottom)

Definition at line 80 of file pngdriver/raster.c.

References dst, and int.

Referenced by PNG_Driver().

void PNG_Box ( double  fx1,
double  fy1,
double  fx2,
double  fy2 
)

Draw a (filled) rectangle.

Parameters
fx1,fy1,fx2,fy2rectangle coordinates

Definition at line 24 of file pngdriver/box.c.

References png_state::clip_bot, png_state::clip_left, png_state::clip_rite, png_state::clip_top, png_state::current_color, png_state::grid, png_state::height, int, png_state::modified, png, png_state::width, and x.

Referenced by PNG_Driver(), and PNG_Point().

void PNG_Client_Close ( void  )
void PNG_Close ( void  )

Definition at line 36 of file pngdriver/draw.c.

References path_close().

Referenced by PNG_Driver().

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

Parameters
rred color value
ggreen color value
bblue color value

Definition at line 32 of file pngdriver/color.c.

References png_state::current_color, png, and png_get_color().

Referenced by PNG_Driver().

void PNG_Cont ( double  ,
double   
)

Definition at line 31 of file pngdriver/draw.c.

References path_cont().

Referenced by PNG_Driver().

void PNG_draw_bitmap ( int  ncols,
int  nrows,
int  threshold,
const unsigned char *  buf 
)

Draw bitmap.

Parameters
ncols,nrowsnumber of columns and rows
thresholdthreshold value
bufdata buffer

Definition at line 33 of file pngdriver/draw_bitmap.c.

References b, png_state::clip_bot, png_state::clip_left, png_state::clip_rite, png_state::clip_top, cur_x, cur_y, png_state::current_color, g, png_state::grid, max, min, png_state::modified, png, png_get_color(), png_get_pixel(), r, png_state::true_color, png_state::width, and x.

Referenced by PNG_Driver().

void png_draw_line ( double  ,
double  ,
double  ,
double   
)
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.

Referenced by PNG_Driver(), and PNG_Graph_set().

void PNG_Fill ( void  )

Definition at line 46 of file pngdriver/draw.c.

References png_polygon().

Referenced by PNG_Driver().

unsigned int png_get_color ( int  ,
int  ,
int  ,
int   
)
void png_get_pixel ( unsigned  int,
int ,
int ,
int ,
int  
)

Definition at line 112 of file color_table.c.

References png, and png_state::true_color.

Referenced by PNG_draw_bitmap(), write_bmp(), write_pgm(), write_png(), and write_ppm().

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 G_free(), png_state::grid, png_state::mapped, png, and write_image().

Referenced by PNG_Driver().

const char* PNG_Graph_get_file ( void  )

Get render file.

Returns
file name

Definition at line 180 of file pngdriver/graph_set.c.

References png_state::file_name, and png.

Referenced by PNG_Driver().

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 82 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(), getenv(), png_state::grid, png_state::has_alpha, png_state::height, png_state::mapped, png_state::modified, png, PNG_Erase(), png_get_color(), png_init_color_table(), read_image(), screen_height, screen_width, png_state::true_color, png_state::width, and write_image().

Referenced by PNG_Driver().

void png_init_color_table ( void  )

Definition at line 73 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.

Parameters
widthline width (double precision)

Definition at line 23 of file pngdriver/line_width.c.

References int, png_state::linewidth, and png.

Referenced by PNG_Driver().

void PNG_Move ( double  ,
double   
)

Definition at line 26 of file pngdriver/draw.c.

References path_move().

Referenced by PNG_Driver().

void PNG_Point ( double  ,
double   
)

Draw point.

Definition at line 20 of file point.c.

References PNG_Box().

Referenced by PNG_Driver().

void png_polygon ( struct path )

Draw polygon.

Definition at line 138 of file pngdriver/polygon.c.

References path::count, vertex::mode, png_state::modified, P_CLOSE, path_close(), png, and path::vertices.

Referenced by png_draw_line(), and PNG_Fill().

int PNG_raster ( int  n,
int  row,
const unsigned char *  red,
const unsigned char *  grn,
const unsigned char *  blu,
const unsigned char *  nul 
)

Draw raster row.

Parameters
nnumber of cells
rowraster row (starts at 0)
red,grn,blu,nulred,green,blue and null value
Returns
next row

Definition at line 111 of file pngdriver/raster.c.

References png_state::clip_bot, png_state::clip_left, png_state::clip_rite, png_state::clip_top, dst, png_state::grid, max, min, png_state::modified, png, png_get_color(), png_state::width, x, and line_pnts::y.

Referenced by PNG_Driver().

void PNG_Set_window ( double  t,
double  b,
double  l,
double  r 
)

Set window.

Parameters
t,b,l,rtop, bottom, left, right

Definition at line 23 of file pngdriver/set_window.c.

References png_state::clip_bot, png_state::clip_left, png_state::clip_rite, png_state::clip_top, png_state::height, png, and png_state::width.

Referenced by PNG_Driver().

void PNG_Stroke ( void  )

Definition at line 41 of file pngdriver/draw.c.

References path_stroke(), and png_draw_line().

Referenced by PNG_Driver().

void read_ppm ( void  )
void write_bmp ( void  )
void write_pgm ( void  )
void write_ppm ( void  )

Variable Documentation