aboutsummaryrefslogtreecommitdiff
path: root/gen-pow-imagery
blob: 4906933282d4c8ab669c78abe9cef3abbd948654 (plain)
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
#!/bin/sh

OUT_DIR="pow_imagery"

mkdir -p $OUT_DIR



make_sample () {
	N="$1-$2-$3pow"

	if [ -e $OUT_DIR/$N.png ]; then
		echo $OUT_DIR/$N : Already exists, skipping.
	else 
		# Configure the generator
		echo unsigned int SIZE=$1\;unsigned int ITERATIONS=$2\;float POWER=$3\; > config.c
		make config
	
		# Generate raw data
		./mbrot-gen > $OUT_DIR/$N.raw
	
		# Make normal colour image
		./raw-to-png $OUT_DIR/$N.raw $1 $1
		mv 0,0.png $OUT_DIR/$N.png
	
		# Make (hypnotic) bw image to show boundaries clearly
		./raw-to-png-bw $OUT_DIR/$N.raw $1 $1
		mv 0,0.png $OUT_DIR/$N-bw.png

		rm $OUT_DIR/$N.raw
	fi
}

for pow in $(seq 0.01 0.01 2); do
	make_sample 560 50 $pow
done