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

Raster Library - Get raster row (colors) More...

#include <grass/gis.h>
#include <grass/raster.h>
#include "R.h"
Include dependency graph for get_row_colr.c:

Go to the source code of this file.

Functions

void Rast_get_row_colors (int fd, int row, struct Colors *colors, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *nul)
 Reads a row of raster data and converts it to RGB. More...
 

Detailed Description

Raster Library - Get raster row (colors)

(C) 1999-2009 by 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
USACERL and many others

Definition in file get_row_colr.c.

Function Documentation

void Rast_get_row_colors ( int  fd,
int  row,
struct Colors colors,
unsigned char *  red,
unsigned char *  grn,
unsigned char *  blu,
unsigned char *  nul 
)

Reads a row of raster data and converts it to RGB.

Reads a row of raster data and converts it to red, green and blue components according to the colors parameter. This provides a convenient way to treat a raster layer as a color image without having to explicitly cater for each of CELL, FCELL and DCELL types.

Parameters
fdfield descriptor
rowrow number
colorspointer to Colors structure which holds color info
[out]redred value
[out]grngreen value
[out]blublue value
[out]nulnull value
Returns
void

Definition at line 39 of file get_row_colr.c.

References G_free(), G_incr_void_ptr(), Rast_cell_size(), Rast_get_map_type(), Rast_get_row(), Rast_is_null_value(), Rast_lookup_colors(), and Rast_window_cols().