~evan/bitart

0b0f29c9f9fcbf721b43181b33e930fc1a2f3b33 — Evan Johnston 3 months ago 3cc2640
unflip x and y
2 files changed, 4 insertions(+), 4 deletions(-)

M README.md
M main.c
M README.md => README.md +1 -1
@@ 24,7 24,7 @@ bitart -o or_mod7.png "x y | 7 %"
```
![](or_mod7.png)
```
bitart -o stripes.png -s 1024 'x#y#*x100/1+%'
bitart -o stripes.png -s 1024 'x#y#*y100/1+%'
```
![](stripes.png)
# description

M main.c => main.c +3 -3
@@ 192,15 192,15 @@ main(int ac, char **av)
	/* stack cannot ever be larger than the program length, since there are
	* no instructions which grow the stack by more than one */
	unsigned int *stack = calloc(strlen(program), sizeof(*stack));
	for (unsigned x = 1; x < width; x++)
	for (unsigned y = 1; y < height; y++) {
	for (unsigned y = 1; y < height; y++)
	for (unsigned x = 1; x < width; x++) {
		unsigned int *sp = eval(program, x, y, stack);
		if (sp - stack < channels) {
			fprintf(stderr, "insufficient values left on the stack\n");
			exit(1);
		}
		for (int i = 0; i < channels; i++) {
			data[((x * height) + y) * channels + i] =
			data[(x + y * width) * channels + i] =
				gradient ? stack[i] : ((!!stack[i]) != invert) ? -1 : 0;
		}
	}