aboutsummaryrefslogblamecommitdiffstats
path: root/rtgrpblib_fill_shapes.c
blob: 285a1fd2c97ca59e6eb3833fcec1d9caf3533a6c (plain) (tree)





































                                                                                      
/* 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