#!/usr/bin/env bash

#  ---------- fractal agregation

# setup for povray 

#  dimensions=" -W1024 -H384"
#  povopt=" +Q9 +A +WT8 -D -V"
dimensions=" -W1920 -H1080"
povopt=" +Q9 +A0.01 +WT8 -D -V"

povopt="${povopt} +L/home/tth/POV/Xper/povinc"

fname=$(printf "img/a/%06d.png" $1)
tmpfile="agreg-tmp.png"

povray37 -iscene.pov -o${tmpfile} ${dimensions} ${povopt} +K$1 2> run.povray

hextxt=$(printf "o%05o " $1               )
timestamp=$(date -u +"%Y%m%dt%H%M"               )
txtcolor="Pink"
txtfont="Courier"
txtsz=" 72 "
txtopt=" -gravity North -fill $txtcolor -font $txtfont "

convert  ${tmpfile}						\
	 ${txtopt}						\
	-pointsize $txtsz -annotate -410+32 "$hextxt"		\
	-pointsize $txtsz -annotate +210+32 "$timestamp"	\
	${fname}
	
date


