Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #@gui Cascading self glitching: fx_self_glitching_cascade, fx_self_glitching_cascade_preview(1)
- #@gui : Channels = choice("RGB","CMY","CMYK","HSV","HSL","HSI","LCH","YCbCr","YIQ","YUV","HCY","Bayer")
- #@gui : Alpha Glitch = bool(0)
- #@gui : Zeroth shift = point(50,50)
- #@gui : Boundary = choice(3,"Zero","Nearest","Periodic","Mirror")
- #@gui : Iterations = int(3,1,10)
- #@gui : Power = float(0,-5,5)
- #@gui : Bias = float(0,-255,255)
- #@gui : Negate = bool(0)
- #@gui : Operator = choice("Add","Multiply","Bitwise And","Bitwise Or","Bitwise Xor","Power","Reverse Power","Modulo","Reverse Modulo","Divide","Reverse Divide","Subtract","Reverse Subtract","Left Bitwise Shift", "ReverseLBS", "Right Bitwise Shift", "ReverseRBS","Average","Round","Reverse Round","Sine","Reverse Sine","Cosine","Reverse Cosine","Tangent (CPU-intensive)","Reverse Tangent (CPU-intensive)")
- #@gui : First shift target = point(50,50)
- #@gui : Cascade centre point = point(50,50)
- #@gui : Shift randomness = float(0.75,0,4)
- #@gui : Boundary = choice(3,"Zero","Nearest","Periodic","Mirror")
- #@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="https://goo.gl/Ryf7Cv">David Tschumperlé</a></i>. Latest update: <i>2018/08/19</i>.</small>")
- fx_self_glitching_cascade :
- shift {$3-50}%,{$4-50}%,0,0,$5,0
- repeat $6
- repeat $! l[$>] if {!$2} split_opacity fi l[0]
- if {$1==1} rgb2cmy elif {$1==2} rgb2cmyk elif {$1==3} rgb2hsv elif {$1==4} rgb2hsl elif {$1==5} rgb2hsi elif {$1==6} rgb2lch elif {$1==7} rgb2ycbcr elif {$1==8} rgb2yiq elif {$1==9} rgb2yuv elif {$1==10} rgb2hcy elif {$1==11} rgb2bayer 0 fi
- f "init(
- shift = ([w,h]-1)*([$13,$14]-[$11,$12]+(2*(u-0.5)*sqrt((($13-$11)^2)+(($14-$12)^2))*($15^3)))%;
- const sign = $9?-1:1;
- const boundary = $16;
- );
- val = sign*((2^$7)*j(shift) + $8);
- ($10==0?(val + i):
- $10==1?(val * i):
- $10==2?(val & i):
- $10==3?(val | i):
- $10==4?xor(val,i):
- $10==5?(val^i):
- $10==6?(i^val):
- $10==7?(val%i):
- $10==8?(i%val):
- $10==9?(val / i):
- $10==10?(i / val):
- $10==11?(i - val):
- $10==12?(val - i):
- $10==13?(val << i):
- $10==14?(i << val):
- $10==15?(val >> i):
- $10==16?(i >> val):
- $10==17?avg(i,val):
- $10==18?round(val,i,0):
- $10==19?round(i,val,0):
- $10==20?i*sin(val*2*pi/255):
- $10==21?val*sin(i*2*pi/255):
- $10==22?i*cos(val*2*pi/255):
- $10==23?val*cos(i*2*pi/255):
- $10==24?(i*tan(val*pi/255)):
- (val*tan(i*pi/255))
- )%255;
- "
- if {$1==1} cmy2rgb elif {$1==2} cmyk2rgb elif {$1==3} hsv2rgb elif {$1==4} hsl2rgb elif {$1==5} rgb2hsi elif {$1==6} lch2rgb elif {$1==7} ycbcr2rgb elif {$1==8} yiq2rgb elif {$1==9} yuv2rgb elif {$1==10} hcy2rgb elif {$1==11} bayer2rgb 0,0,0 fi
- endl a c endl done done
- fx_self_glitching_cascade_preview :
- fx_self_glitching_cascade $*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement