Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #@gui Gradient norm [JR's mod] : fx_jr_gradient_norm, fx_jr_gradient_norm_preview(1)
- #@gui : Smoothness = float(0,0,10)
- #@gui : Contrast = float(0.45,0,1.5)
- #@gui : Min threshold = float(40,0,100)
- #@gui : Max threshold = float(60,0,100)
- #@gui : Negative = bool(0)
- #@gui : Include direction = bool(0)
- #@gui : Scale X = float(1,0,5)
- #@gui : Scale Y = float(1,0,5)
- #@gui : Interpolation = choice(2,"Nearest","Average","Bilinear","Bicubic")
- #@gui : Alpha = bool(0)
- #@gui : sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate top","Duplicate left","Duplicate bottom","Duplicate right","Duplicate horizontal","Duplicate vertical","Checkered","Checkered inverse"), Preview split = point(50,50,0,0,200,200,200,0,10,0)
- #@gui : sep = separator(), note = note("<small>Author: <i><a href="http://ow.ly/wpsV30fzhdI">David Tschumperlé</a></i>. Latest update: <i>2010/29/12</i>.</small>")
- jr_dir2rgb :
- v - channels 0,1 repeat $! l[$>] nm={0,n}
- s c complex2polar round.. 0.001
- *. {180/pi} %. 360 100%,100%,1,1,1 mv... $!
- c 0,360 if {im!=iM} n. 0,1 else f. 1 fi
- a c hsv2rgb
- nm $nm endl done v +
- jr_gradient_norm :
- b $1 gradient_norm c 0,255 ^ $2
- c $3%,$4%
- if $5 negate fi
- n 0,255
- fx_jr_gradient_norm :
- repeat $! l[$>]
- if {$9==3}
- inter=5
- else
- inter={1+$9}
- fi
- if {$7!=1||$8!=1}
- ww={w}
- hh={h}
- shift -0.5,-0.5,0,0,1
- r {max(1,$7*w)},{max(1,$8*h)},100%,100%,$inter
- fi
- if $6
- +l luminance gradient append c
- blur $1 orientation +jr_dir2rgb
- endl rm[1]
- if $5
- l[1]
- rgb2hsv8 100%,100%,1,1 f[1] "j(#0,0,0,0,2)" f[0] "[i0,i1,255]" hsv82rgb[0] a c
- fx_solidify_td 100,0,10,2,0
- rgb2hsv8 f "[i0,i1,255]" hsv82rgb
- endl
- fi
- fi
- jr_gradient_norm[0] ${1-5}
- if {$7!=1||$8!=1}
- r $ww,$hh,100%,100%,$inter
- fi
- if $6 blend multiply fi
- if $10 rgb2hsv8 100%,100%,1,1 f[1] "j(#0,0,0,0,2)" f[0] "[i0,i1,255]" hsv82rgb[0] a c fi
- endl done
- fx_jr_gradient_norm_preview :
- fx_jr_gradient_norm $*
- #gui_split_preview "fx_jr_gradient_norm $*",${-3--1}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement