ConvertImageCommand() and Obj-C
Posted: 2012-02-07T01:50:36-07:00
I tried to convert cameradeblur sample by myself but stuck on "convert" to "ConvertImageCommand" translation of:
Please help me to convert this script.
Could anyone explain the meaning of XC and FX keywords too.
Code: Select all
w1=`convert xc: -format "%[fx:($width%2)==0?$width:($width+1)]" info:`
h1=`convert xc: -format "%[fx:($height%2)==0?$height:($height+1)]" info:`
cx=`convert xc: -format "%[fx:floor(($width+1)/2)]" info:`
cy=`convert xc: -format "%[fx:floor(($height+1)/2)]" info:`
d1=`convert xc: -format "%[fx:max($w1,$h1)]" info:`
fd1=`convert xc: -format "%[fx:$amount*pi/$d1]" info:`
sinang=`convert xc: -format "%[fx:sin($rotation*pi/180)]" info:`
cosang=`convert xc: -format "%[fx:cos($rotation*pi/180)]" info:`
qnoise=`convert xc: -format "%[fx:quantumrange*$noise]" info:`
convert -size ${w1}x1 xc: \
-fx "zz=$fd1*(i-$cx)*$cosang; zz?sin(zz)/(zz):1" \
-scale ${w1}x${h1}\! $tmpF
convert \( $infile -alpha off +fft \) \
\( $tmpF $tmpF -compose multiply -composite -evaluate add $qnoise \) \
\( -clone 0 $tmpF -compose multiply -composite \) \
\( -clone 1 $tmpF -compose multiply -composite \) \
\( -clone 3 -clone 2 +swap -compose divide -composite \) \
\( -clone 4 -clone 2 +swap -compose divide -composite \) \
Could anyone explain the meaning of XC and FX keywords too.