GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
Loading...
Searching...
No Matches
raster.c File Reference

GRASS png display driver - draw raster. More...

#include <string.h>
#include <math.h>
#include <grass/gis.h>
#include "driver.h"
#include "pngdriver.h"
Include dependency graph for pngdriver/raster.c:

Go to the source code of this file.

Macros

#define min(a, b)
 
#define max(a, b)
 

Functions

void PNG_begin_raster (int mask, int s[2][2], double fd[2][2])
 Start drawing raster.
 
int PNG_raster (UNUSED int n, int row, const unsigned char *red, const unsigned char *grn, const unsigned char *blu, const unsigned char *nul)
 Draw raster row.
 

Detailed Description

GRASS png display driver - draw raster.

(C) 2003-2014 by Per Henrik Johansen 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
Per Henrik Johansen (original contributor)
Glynn Clements

Definition in file pngdriver/raster.c.

Macro Definition Documentation

◆ max

#define max ( a,
b )
Value:
((a) > (b) ? (a) : (b))
double b

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

Referenced by PNG_raster().

◆ min

#define min ( a,
b )
Value:
((a) < (b) ? (a) : (b))

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

Referenced by PNG_raster().

Function Documentation

◆ PNG_begin_raster()

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.

Referenced by PNG_Driver().

◆ PNG_raster()

int PNG_raster ( UNUSED 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, png_state::grid, max, min, png_state::modified, png, png_get_color(), png_state::width, and x.