Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #@gui CubeHelix: fx_cubehelix, fx_cubehelix_preview(1)
- #@gui : Convert to grayscale = bool(1)
- #@gui : Min threshold = float(0,0,100)
- #@gui : Max threshold = float(100,0,100)
- #@gui : Pre-normalise = bool(0)
- #@gui : Start colour = color(0,0,0)
- #@gui : End colour = color(255,255,255)
- #@gui : Start hue = float(1,0,3)
- #@gui : Rotations = float(-1.5,-20,20)
- #@gui : Hue intensity = float(1,0,5)
- #@gui : Gamma power = float(0,-4,4)
- #@gui : Flatten hues = float(0.5,0,1)
- #@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)
- fx_cubehelix :
- repeat $! l[$>]
- if $1 to_gray fi to_rgb abs c 0,255 c $2%,$3% if $4 n 0,255 fi *. {1/255}
- f "angle=(2*pi*(($11/3)+1+$12*I));fract=(I^(2^($14^2)));amp=($13*fract*(1-fract)/2);
- helix=(amp*[-0.14861*cos(angle[0])+1.78277*sin(angle[0]),-0.29227*cos(angle[1])-0.90649*sin(angle[1]),1.97294*cos(angle[2])]);
- scale=([${8-10}]-[${5-7}])/255;
- ([${5-7}]/255)+(1-$15)*(fract*scale+helix)+$15*(fract+(helix*sign(scale)))*scale"
- c 0,1
- *. 255
- endl done
- fx_cubehelix_preview :
- gui_split_preview "fx_cubehelix $*",${-3--1}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement