GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
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

◆ Rast_get_row_colors()

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.