orig/pgblur.csh
author Axel Jacobs <axel@jaloxa.eu>
Mon, 14 Apr 2014 22:21:17 +0100
changeset 73 87fa3132a136
parent 0 0aa115157c9c
permissions -rw-r--r--
New IES test file with spaces in file name
axel@0
     1
#!/bin/csh -f
axel@0
     2
# RCSid $Id: pgblur.csh,v 1.2 2008/11/10 19:08:19 greg Exp $
axel@0
     3
#
axel@0
     4
# Apply Gaussian blur without resizing image
axel@0
     5
# More efficient than straight pfilt for large blurs
axel@0
     6
#
axel@0
     7
if ( $#argv != 3 ) then
axel@0
     8
	goto userr
axel@0
     9
endif
axel@0
    10
if ( "$1" != "-r" ) then
axel@0
    11
	goto userr
axel@0
    12
endif
axel@0
    13
if ( "$2" !~ [1-9]* ) then
axel@0
    14
	goto userr
axel@0
    15
endif
axel@0
    16
set rad = $2
axel@0
    17
set inp = "$3"
axel@0
    18
set reduc = `ev "floor($rad/1.8)"`
axel@0
    19
if ( $reduc <= 1 ) then
axel@0
    20
	exec pfilt -1 -r $rad $inp:q
axel@0
    21
endif
axel@0
    22
set filt = `ev "$rad/$reduc"`
axel@0
    23
set pr=`getinfo -d < $inp:q | sed 's/^-Y \([1-9][0-9]*\) +X \([1-9][0-9]*\)$/\2 \1/'`
axel@0
    24
pfilt -1 -x /$reduc -y /$reduc $inp:q \
axel@0
    25
	| pfilt -1 -r $filt -x $pr[1] -y $pr[2]
axel@0
    26
exit 0
axel@0
    27
userr:
axel@0
    28
echo Usage: "$0 -r radius input.hdr"
axel@0
    29
exit 1