blob: 285a1fd2c97ca59e6eb3833fcec1d9caf3533a6c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
#ifndef TEST
void
rtgrpblib_fill_shapes(double *restrict image, size_t rowsize, const RASTER *raster)
{
const CELL *cells = raster->cells;
double inklevel;
size_t x, y;
#ifndef ROWWISE_RESET_INKLEVEL
inklevel = 0;
#endif
for (y = 0; y < raster->height; y++) {
#ifdef ROWWISE_RESET_INKLEVEL
inklevel = 0;
#endif
for (x = 0; x < raster->width; x++) {
image[x] = fmin(fabs(inklevel + cells[x].cell_coverage), 1.0);
inklevel += cells[x].opposite_coverage;
}
image = &image[rowsize];
cells = &cells[raster->width];
}
}
#else
int
main(void)
{
return 0; /* TODO add test */
}
#endif
|