GRASS GIS 8 Programmer's Manual 8.4.1(2025)-45ca3179ab
Loading...
Searching...
No Matches
raster.c File Reference

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

#include <math.h>
#include "cairodriver.h"
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for cairodriver/raster.c:

Go to the source code of this file.

Macros

#define MAX_IMAGE_SIZE   32767
 

Functions

void Cairo_begin_raster (int mask, int s[2][2], double d[2][2])
 Start drawing raster.
 
int Cairo_raster (int n, int row, const unsigned char *red, const unsigned char *grn, const unsigned char *blu, const unsigned char *nul)
 Draw raster row.
 
void Cairo_end_raster (void)
 Finish drawing raster.
 

Detailed Description

GRASS cairo display driver - draw raster.

(C) 2007-2014 by Lars Ahlzen 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
Lars Ahlzen <lars ahlzen.com> (original contributor)
Glynn Clements

Definition in file cairodriver/raster.c.

Macro Definition Documentation

◆ MAX_IMAGE_SIZE

#define MAX_IMAGE_SIZE   32767

Definition at line 21 of file cairodriver/raster.c.

Referenced by Cairo_begin_raster().

Function Documentation

◆ Cairo_begin_raster()

void Cairo_begin_raster ( int mask,
int s[2][2],
double d[2][2] )

Start drawing raster.

Todo
are top and left swapped?
Parameters
masknon-zero int for mask
ssource (map) extent (left, right, top, bottom)
ddestination (image) extent (left, right, top, bottom)

Definition at line 71 of file cairodriver/raster.c.

References ca, G_debug(), G_fatal_error(), and MAX_IMAGE_SIZE.

Referenced by Cairo_Driver().

◆ Cairo_end_raster()

void Cairo_end_raster ( void )

Finish drawing raster.

Definition at line 180 of file cairodriver/raster.c.

References ca, cairo, G_debug(), and G_free().

Referenced by Cairo_Driver().

◆ Cairo_raster()

int Cairo_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 (starting at 0)
red,grn,blu,nulred,green,blue and null value
Returns
next row

Definition at line 130 of file cairodriver/raster.c.

References b, ca, g, G_debug(), MAX, MIN, r, and x.

Referenced by Cairo_Driver().