shithub: sce

ref: b803bdeacb20ea454f7511c5bcd8e9bf0a49a564
dir: /utils/scerot/

View raw version
#!/bin/rc -e
if(! ~ $#* 2){
	echo usage: sceass radix nrot
	exit usage
}
id=`{awk 'BEGIN{for(i=1; i<='^$2^'/2-1; i++) printf "%02d\n", i}'}
rev=`{awk 'BEGIN{for(i='^$2^'-1; i>='^$2^'/2+1; i--) printf "%02d\n", i}'}
n=`{seq 1 $#id}
echo `"{for(i in $n){
	echo !r $1^.^$id($i)^.bit s
	echo 'm = s[X-x-1,y,z]'
	echo !w m $1^.$rev($i)^.bit
}} | pico
for(i in $n){
	t=`{read -c 46 $1^.^$id($i)^.bit | awk '{print $2, $3}'}
	f=$1^.^$rev($i)^.bit
	iconv -c r8g8b8 $f | crop -t $t > a && mv a $f
}