28 #include <grass/gis.h>
29 #include <grass/raster.h>
30 #include <grass/display.h>
34 static int src[2][2], dst[2][2];
36 static int draw_cell(
int,
const void *,
struct Colors *, RASTER_MAP_TYPE);
40 struct Colors *colors, RASTER_MAP_TYPE data_type)
42 return draw_cell(A_row, array, colors, data_type);
47 return draw_cell(A_row, darray, colors, DCELL_TYPE);
52 return draw_cell(A_row, farray, colors, FCELL_TYPE);
57 return draw_cell(A_row, carray, colors, CELL_TYPE);
77 int D_draw_cell(
int A_row,
const CELL * carray,
struct Colors *colors)
79 return draw_cell(A_row, carray, colors, CELL_TYPE);
82 static int draw_cell(
int A_row,
84 struct Colors *colors, RASTER_MAP_TYPE data_type)
86 static unsigned char *red, *grn, *blu, *
set;
89 int ncols = src[0][1] - src[0][0];
94 red = G_realloc(red, nalloc);
95 grn = G_realloc(grn, nalloc);
96 blu = G_realloc(blu, nalloc);
97 set = G_realloc(set, nalloc);
104 for (i = 0; i < ncols; i++) {
113 return (A_row < src[1][1])
134 struct Cell_head window;
151 const void *r_raster,
const void *g_raster,
152 const void *b_raster,
struct Colors *r_colors,
153 struct Colors *g_colors,
struct Colors *b_colors,
154 RASTER_MAP_TYPE r_type, RASTER_MAP_TYPE g_type,
155 RASTER_MAP_TYPE b_type)
157 static unsigned char *r_buf, *g_buf, *b_buf, *n_buf;
163 int ncols = src[0][1] - src[0][0];
167 if (nalloc < ncols) {
169 r_buf = G_realloc(r_buf, nalloc);
170 g_buf = G_realloc(g_buf, nalloc);
171 b_buf = G_realloc(b_buf, nalloc);
172 n_buf = G_realloc(n_buf, nalloc);
184 for (i = 0; i < ncols; i++) {
198 return (A_row < src[1][1])