62 const char *mapset =
NULL;
75 if (color_mode > 3 || color_mode < 1)
98 voidc = (
CELL *)cell_buf;
100 voidc = (
FCELL *)fcell_buf;
102 voidc = (
DCELL *)dcell_buf;
106 if (color_mode == 1 ||
108 for (row = 0; row < rows; row++) {
113 alpha = (
unsigned char)255;
115 alpha = (
unsigned char)0;
117 for (col = 0; col < cols; col++) {
120 result[i++] = blue[col];
121 result[i++] = green[col];
122 result[i++] = red[col];
135 for (row = 0; row < rows; row++) {
140 if (color_mode == 3) {
141 for (col = 0; col < cols; col++) {
143 result[i++] = ((red[col]) * 11 + (green[col]) * 16 +
149 for (col = 0; col < cols; col++) {
151 result[i++] = ((red[col]) * 19 + (green[col]) * 38 +
void G_free(void *)
Free allocated memory.
const char * G_find_raster2(const char *, const char *)
Find a raster map (look but don't touch)
int Rast_is_null_value(const void *, RASTER_MAP_TYPE)
To check if a raster value is set to NULL.
int Rast_read_colors(const char *, const char *, struct Colors *)
Read color table of raster map.
void Rast_close(int)
Close a raster map.
void Rast_lookup_colors(const void *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, int, struct Colors *, RASTER_MAP_TYPE)
Lookup an array of colors.
int Rast_open_old(const char *, const char *)
Open an existing integer raster map (cell)
void Rast_free_colors(struct Colors *)
Free color structure memory.
FCELL * Rast_allocate_f_buf(void)
Allocates memory for a raster map of type FCELL.
CELL * Rast_allocate_c_buf(void)
Allocate memory for a CELL type raster map.
DCELL * Rast_allocate_d_buf(void)
Allocates memory for a raster map of type DCELL.
int Rast_window_cols(void)
Number of columns in active window.
int Rast_window_rows(void)
Number of rows in active window.
RASTER_MAP_TYPE Rast_get_map_type(int)
Determine raster type from descriptor.
void Rast_get_row(int, void *, int, RASTER_MAP_TYPE)
Get raster row.
int Rast_map_to_img_str(char *name, int color_mode, unsigned char *result)