Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function t_colormask( clip c, int color, int "tolerance", int "expandblur", bool "BT601", int "blur")
- {
- c.t_24colormask( color, \
- tolerance=tolerance, expandblur=expandblur, BT601=BT601, blur=blur )
- }
- function t_2colormask( clip c, int color1, int "color2", int "tolerance", int "expandblur", bool "BT601", int "blur")
- {
- c.t_24colormask( color1, color2, \
- tolerance=tolerance, expandblur=expandblur, BT601=BT601, blur=blur )
- }
- function t_3colormask( clip c, int color1, int "color2", int "color3", int "tolerance", int "expandblur", bool "BT601", int "blur")
- {
- c.t_24colormask( color1, color2, color3, \
- tolerance=tolerance, expandblur=expandblur, BT601=BT601, blur=blur )
- }
- function t_6colormask( clip c, int color1, int "color2", int "color3", int "color4", int "color5", int "color6", int "tolerance", int "expandblur", bool "BT601", int "blur")
- {
- c.t_24colormask( color1, color2, color3, color4, color5, color6, \
- tolerance=tolerance, expandblur=expandblur, BT601=BT601, blur=blur )
- }
- function t_9colormask( clip c, int color1, int "color2", int "color3", int "color4", int "color5", int "color6", int "color7", int "color8", int "color9", int "tolerance", int "expandblur", bool "BT601", int "blur")
- {
- c.t_24colormask( color1, color2, color3, color4, color5, color6, color7, color8, color9, \
- tolerance=tolerance, expandblur=expandblur, BT601=BT601, blur=blur )
- }
- function t_24colormask( clip c, int color1, int "color2", int "color3", int "color4", int "color5", int "color6", int "color7", int "color8", int "color9", int "color10", int "color11", int "color12", int "tolerance", int "expandblur", bool "BT601", int "blur")
- {
- c.t_24colormask( color1, color2, color3, color4, color5, color6, \
- color7, color8, color9, color10, color11, color12, \
- tolerance=tolerance, expandblur=expandblur, BT601=BT601, blur=blur )
- }
- function t_24colormask(clip c, int color1, int "color2", int "color3", int "color4", int "color5", int "color6", int "color7", int "color8", int "color9", int "color10", int "color11", int "color12", int "color12", int "color13", int "color14", int "color15", int "color16", int "color17", int "color18", int "color19", int "color20", int "color21", int "color22", int "color23", int "color24", int "tolerance", int "expandblur", bool "BT601", int "blur")
- {
- color2 = default(color2,-1)
- color3 = default(color3,-1)
- color4 = default(color4,-1)
- color5 = default(color5,-1)
- color6 = default(color6,-1)
- color7 = default(color7,-1)
- color8 = default(color8,-1)
- color9 = default(color9,-1)
- color10 = default(color10,-1)
- color11 = default(color11,-1)
- color12 = default(color12,-1)
- color13 = default(color13,-1)
- color14 = default(color14,-1)
- color15 = default(color15,-1)
- color16 = default(color16,-1)
- color17 = default(color17,-1)
- color18 = default(color18,-1)
- color19 = default(color19,-1)
- color20 = default(color20,-1)
- color21 = default(color21,-1)
- color22 = default(color22,-1)
- color23 = default(color23,-1)
- color24 = default(color24,-1)
- tolerance = default(tolerance,10)
- expandblur = default(expandblur,0)
- BT601 = default(BT601, c.height <= 576 && c.width <= 1024)
- blur = default(blur,0)
- kR = BT601 ? 0.299 : 0.2126
- kB = BT601 ? 0.114 : 0.0722
- B1 = float(color1 % 256)/255
- G1 = float((color1/256) % 256)/255
- R1 = float((color1/65536) % 256)/255
- B2 = float(color2 % 256)/255
- G2 = float((color2/256) % 256)/255
- R2 = float((color2/65536) % 256)/255
- B3 = float(color3 % 256)/255
- G3 = float((color3/256) % 256)/255
- R3 = float((color3/65536) % 256)/255
- B4 = float(color4 % 256)/255
- G4 = float((color4/256) % 256)/255
- R4 = float((color4/65536) % 256)/255
- B5 = float(color5 % 256)/255
- G5 = float((color5/256) % 256)/255
- R5 = float((color5/65536) % 256)/255
- B6 = float(color6 % 256)/255
- G6 = float((color6/256) % 256)/255
- R6 = float((color6/65536) % 256)/255
- B7 = float(color7 % 256)/255
- G7 = float((color7/256) % 256)/255
- R7 = float((color7/65536) % 256)/255
- B8 = float(color8 % 256)/255
- G8 = float((color8/256) % 256)/255
- R8 = float((color8/65536) % 256)/255
- B9 = float(color9 % 256)/255
- G9 = float((color9/256) % 256)/255
- R9 = float((color9/65536) % 256)/255
- B10 = float(color10 % 256)/255
- G10 = float((color10/256) % 256)/255
- R10 = float((color10/65536) % 256)/255
- B11 = float(color11 % 256)/255
- G11 = float((color11/256) % 256)/255
- R11 = float((color11/65536) % 256)/255
- B12 = float(color12 % 256)/255
- G12 = float((color12/256) % 256)/255
- R12 = float((color12/65536) % 256)/255
- B13 = float(color13 % 256)/255
- G13 = float((color13/256) % 256)/255
- R13 = float((color13/65536) % 256)/255
- B14 = float(color14 % 256)/255
- G14 = float((color14/256) % 256)/255
- R14 = float((color14/65536) % 256)/255
- B15 = float(color15 % 256)/255
- G15 = float((color15/256) % 256)/255
- R15 = float((color15/65536) % 256)/255
- B16 = float(color16 % 256)/255
- G16 = float((color16/256) % 256)/255
- R16 = float((color16/65536) % 256)/255
- B17 = float(color17 % 256)/255
- G17 = float((color17/256) % 256)/255
- R17 = float((color17/65536) % 256)/255
- B18 = float(color18 % 256)/255
- G18 = float((color18/256) % 256)/255
- R18 = float((color18/65536) % 256)/255
- B19 = float(color19 % 256)/255
- G19 = float((color19/256) % 256)/255
- R19 = float((color19/65536) % 256)/255
- B20 = float(color20 % 256)/255
- G20 = float((color20/256) % 256)/255
- R20 = float((color20/65536) % 256)/255
- B21 = float(color21 % 256)/255
- G21 = float((color21/256) % 256)/255
- R21 = float((color21/65536) % 256)/255
- B22 = float(color22 % 256)/255
- G22 = float((color22/256) % 256)/255
- R22 = float((color22/65536) % 256)/255
- B23 = float(color23 % 256)/255
- G23 = float((color23/256) % 256)/255
- R23 = float((color23/65536) % 256)/255
- B24 = float(color24 % 256)/255
- G24 = float((color24/256) % 256)/255
- R24 = float((color24/65536) % 256)/255
- y1 = kR*R1+(1-kR-kB)*G1+kB*B1
- u1 = 128+round(112.0*(B1-y1)/(1-kB))
- v1 = 128+round(112.0*(R1-y1)/(1-kR))
- y1 = 16+round(219.0*y1)
- y2 = kR*R2+(1-kR-kB)*G2+kB*B2
- u2 = 128+round(112.0*(B2-y2)/(1-kB))
- v2 = 128+round(112.0*(R2-y2)/(1-kR))
- y2 = 16+round(219.0*y2)
- y3 = kR*R3+(1-kR-kB)*G3+kB*B3
- u3 = 128+round(112.0*(B3-y3)/(1-kB))
- v3 = 128+round(112.0*(R3-y3)/(1-kR))
- y3 = 16+round(219.0*y3)
- y4 = kR*R4+(1-kR-kB)*G4+kB*B4
- u4 = 128+round(112.0*(B4-y4)/(1-kB))
- v4 = 128+round(112.0*(R4-y4)/(1-kR))
- y4 = 16+round(219.0*y4)
- y5 = kR*R5+(1-kR-kB)*G5+kB*B5
- u5 = 128+round(112.0*(B5-y5)/(1-kB))
- v5 = 128+round(112.0*(R5-y5)/(1-kR))
- y5 = 16+round(219.0*y5)
- y6 = kR*R6+(1-kR-kB)*G6+kB*B6
- u6 = 128+round(112.0*(B6-y6)/(1-kB))
- v6 = 128+round(112.0*(R6-y6)/(1-kR))
- y6 = 16+round(219.0*y6)
- y7 = kR*R7+(1-kR-kB)*G7+kB*B7
- u7 = 128+round(112.0*(B7-y7)/(1-kB))
- v7 = 128+round(112.0*(R7-y7)/(1-kR))
- y7 = 16+round(219.0*y7)
- y8 = kR*R8+(1-kR-kB)*G8+kB*B8
- u8 = 128+round(112.0*(B8-y8)/(1-kB))
- v8 = 128+round(112.0*(R8-y8)/(1-kR))
- y8 = 16+round(219.0*y8)
- y9 = kR*R9+(1-kR-kB)*G9+kB*B9
- u9 = 128+round(112.0*(B9-y9)/(1-kB))
- v9 = 128+round(112.0*(R9-y9)/(1-kR))
- y9 = 16+round(219.0*y9)
- y10 = kR*R10+(1-kR-kB)*G10+kB*B10
- u10 = 128+round(112.0*(B10-y10)/(1-kB))
- v10 = 128+round(112.0*(R10-y10)/(1-kR))
- y10 = 16+round(219.0*y10)
- y11 = kR*R11+(1-kR-kB)*G11+kB*B11
- u11 = 128+round(112.0*(B11-y11)/(1-kB))
- v11 = 128+round(112.0*(R11-y11)/(1-kR))
- y11 = 16+round(219.0*y11)
- y12 = kR*R12+(1-kR-kB)*G12+kB*B12
- u12 = 128+round(112.0*(B12-y12)/(1-kB))
- v12 = 128+round(112.0*(R12-y12)/(1-kR))
- y12 = 16+round(219.0*y12)
- y13 = kR*R13+(1-kR-kB)*G13+kB*B13
- u13 = 128+round(112.0*(B13-y13)/(1-kB))
- v13 = 128+round(112.0*(R13-y13)/(1-kR))
- y13 = 16+round(219.0*y13)
- y14 = kR*R14+(1-kR-kB)*G14+kB*B14
- u14 = 128+round(112.0*(B14-y14)/(1-kB))
- v14 = 128+round(112.0*(R14-y14)/(1-kR))
- y14 = 16+round(219.0*y14)
- y15 = kR*R15+(1-kR-kB)*G15+kB*B15
- u15 = 128+round(112.0*(B15-y15)/(1-kB))
- v15 = 128+round(112.0*(R15-y15)/(1-kR))
- y15 = 16+round(219.0*y15)
- y16 = kR*R16+(1-kR-kB)*G16+kB*B16
- u16 = 128+round(112.0*(B16-y16)/(1-kB))
- v16 = 128+round(112.0*(R16-y16)/(1-kR))
- y16 = 16+round(219.0*y16)
- y17 = kR*R17+(1-kR-kB)*G17+kB*B17
- u17 = 128+round(112.0*(B17-y17)/(1-kB))
- v17 = 128+round(112.0*(R17-y17)/(1-kR))
- y17 = 16+round(219.0*y17)
- y18 = kR*R18+(1-kR-kB)*G18+kB*B18
- u18 = 128+round(112.0*(B18-y18)/(1-kB))
- v18 = 128+round(112.0*(R18-y18)/(1-kR))
- y18 = 16+round(219.0*y18)
- y19 = kR*R19+(1-kR-kB)*G19+kB*B19
- u19 = 128+round(112.0*(B19-y19)/(1-kB))
- v19 = 128+round(112.0*(R19-y19)/(1-kR))
- y19 = 16+round(219.0*y19)
- y20 = kR*R20+(1-kR-kB)*G20+kB*B20
- u20 = 128+round(112.0*(B20-y20)/(1-kB))
- v20 = 128+round(112.0*(R20-y20)/(1-kR))
- y20 = 16+round(219.0*y20)
- y21 = kR*R21+(1-kR-kB)*G21+kB*B21
- u21 = 128+round(112.0*(B21-y21)/(1-kB))
- v21 = 128+round(112.0*(R21-y21)/(1-kR))
- y21 = 16+round(219.0*y21)
- y22 = kR*R22+(1-kR-kB)*G22+kB*B22
- u22 = 128+round(112.0*(B22-y22)/(1-kB))
- v22 = 128+round(112.0*(R22-y22)/(1-kR))
- y22 = 16+round(219.0*y22)
- y23 = kR*R23+(1-kR-kB)*G23+kB*B23
- u23 = 128+round(112.0*(B23-y23)/(1-kB))
- v23 = 128+round(112.0*(R23-y23)/(1-kR))
- y23 = 16+round(219.0*y23)
- y24 = kR*R24+(1-kR-kB)*G24+kB*B24
- u24 = 128+round(112.0*(B24-y24)/(1-kB))
- v24 = 128+round(112.0*(R24-y24)/(1-kR))
- y24 = 16+round(219.0*y24)
- c.mt_lut(
- \ yExpr = "x "+string(y1)+" - abs "+string(tolerance)+" < "+
- \(color2!=-1 ? "x "+string(y2)+" - abs "+string(tolerance)+" < | " : "")+
- \(color3!=-1 ? "x "+string(y3)+" - abs "+string(tolerance)+" < | " : "")+
- \(color4!=-1 ? "x "+string(y4)+" - abs "+string(tolerance)+" < | " : "")+
- \(color5!=-1 ? "x "+string(y5)+" - abs "+string(tolerance)+" < | " : "")+
- \(color6!=-1 ? "x "+string(y6)+" - abs "+string(tolerance)+" < | " : "")+
- \(color7!=-1 ? "x "+string(y7)+" - abs "+string(tolerance)+" < | " : "")+
- \(color8!=-1 ? "x "+string(y8)+" - abs "+string(tolerance)+" < | " : "")+
- \(color9!=-1 ? "x "+string(y9)+" - abs "+string(tolerance)+" < | " : "")+
- \(color10!=-1 ? "x "+string(y10)+" - abs "+string(tolerance)+" < | " : "")+
- \(color11!=-1 ? "x "+string(y11)+" - abs "+string(tolerance)+" < | " : "")+
- \(color12!=-1 ? "x "+string(y12)+" - abs "+string(tolerance)+" < | " : "")+
- \(color13!=-1 ? "x "+string(y13)+" - abs "+string(tolerance)+" < | " : "")+
- \(color14!=-1 ? "x "+string(y14)+" - abs "+string(tolerance)+" < | " : "")+
- \(color15!=-1 ? "x "+string(y15)+" - abs "+string(tolerance)+" < | " : "")+
- \(color16!=-1 ? "x "+string(y16)+" - abs "+string(tolerance)+" < | " : "")+
- \(color17!=-1 ? "x "+string(y17)+" - abs "+string(tolerance)+" < | " : "")+
- \(color18!=-1 ? "x "+string(y18)+" - abs "+string(tolerance)+" < | " : "")+
- \(color19!=-1 ? "x "+string(y19)+" - abs "+string(tolerance)+" < | " : "")+
- \(color20!=-1 ? "x "+string(y20)+" - abs "+string(tolerance)+" < | " : "")+
- \(color21!=-1 ? "x "+string(y21)+" - abs "+string(tolerance)+" < | " : "")+
- \(color22!=-1 ? "x "+string(y22)+" - abs "+string(tolerance)+" < | " : "")+
- \(color23!=-1 ? "x "+string(y23)+" - abs "+string(tolerance)+" < | " : "")+
- \(color24!=-1 ? "x "+string(y24)+" - abs "+string(tolerance)+" < | " : "")+"255 0 ?",
- \ uExpr = "x "+string(u1)+" - abs "+string(tolerance/2)+" < "+
- \(color2!=-1 ? "x "+string(u2)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color3!=-1 ? "x "+string(u3)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color4!=-1 ? "x "+string(u4)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color5!=-1 ? "x "+string(u5)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color6!=-1 ? "x "+string(u6)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color7!=-1 ? "x "+string(u7)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color8!=-1 ? "x "+string(u8)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color9!=-1 ? "x "+string(u9)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color10!=-1 ? "x "+string(u10)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color11!=-1 ? "x "+string(u11)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color12!=-1 ? "x "+string(u12)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color13!=-1 ? "x "+string(u13)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color14!=-1 ? "x "+string(u14)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color15!=-1 ? "x "+string(u15)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color16!=-1 ? "x "+string(u16)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color17!=-1 ? "x "+string(u17)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color18!=-1 ? "x "+string(u18)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color19!=-1 ? "x "+string(u19)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color20!=-1 ? "x "+string(u20)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color21!=-1 ? "x "+string(u21)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color22!=-1 ? "x "+string(u22)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color23!=-1 ? "x "+string(u23)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color24!=-1 ? "x "+string(u24)+" - abs "+string(tolerance/2)+" < | " : "")+"255 0 ?",
- \ vExpr = "x "+string(v1)+" - abs "+string(tolerance/2)+" < "+
- \(color2!=-1 ? "x "+string(v2)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color3!=-1 ? "x "+string(v3)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color4!=-1 ? "x "+string(v4)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color5!=-1 ? "x "+string(v5)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color6!=-1 ? "x "+string(v6)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color7!=-1 ? "x "+string(v7)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color8!=-1 ? "x "+string(v8)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color9!=-1 ? "x "+string(v9)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color10!=-1 ? "x "+string(v10)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color11!=-1 ? "x "+string(v11)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color12!=-1 ? "x "+string(v12)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color13!=-1 ? "x "+string(v13)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color14!=-1 ? "x "+string(v14)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color15!=-1 ? "x "+string(v15)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color16!=-1 ? "x "+string(v16)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color17!=-1 ? "x "+string(v17)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color18!=-1 ? "x "+string(v18)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color19!=-1 ? "x "+string(v19)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color20!=-1 ? "x "+string(v20)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color21!=-1 ? "x "+string(v21)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color22!=-1 ? "x "+string(v22)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color23!=-1 ? "x "+string(v23)+" - abs "+string(tolerance/2)+" < | " : "")+
- \(color24!=-1 ? "x "+string(v24)+" - abs "+string(tolerance/2)+" < | " : "")+"255 0 ?",u=3,v=3)
- mt_logic(mt_logic(utoy,vtoy,"min").bicubicresize(width,height),"min")
- expandblur>0 ? binomialblur(expandblur,u=1,v=1).mt_lut("x 5 *") : last
- blur>0 ? binomialblur(blur,u=1,v=1) : last
- }
- function t_24colormask2( clip c, \
- int color1, int "tolerance1", int "color2", int "tolerance2", int "color3", int "tolerance3", int "color4", int "tolerance4", int "color5", int "tolerance5", int "color6", int "tolerance6", int "color7", int "tolerance7", int "color8", int "tolerance8", int "color9", int "tolerance9", int "color10", int "tolerance10", int "color11", int "tolerance11", int "color12", int "tolerance12", int "color12", int "tolerance12", int "color13", int "tolerance13", int "color14", int "tolerance14", int "color15", int "tolerance15", int "color16", int "tolerance16", int "color17", int "tolerance17", int "color18", int "tolerance18", int "color19", int "tolerance19", int "color20", int "tolerance20", int "color21", int "tolerance21", int "color22", int "tolerance22", int "color23", int "tolerance23", int "color24", int "tolerance24", \
- int "expandblur", bool "BT601", int "blur" )
- {
- color2 = default(color2,-1)
- color3 = default(color3,-1)
- color4 = default(color4,-1)
- color5 = default(color5,-1)
- color6 = default(color6,-1)
- color7 = default(color7,-1)
- color8 = default(color8,-1)
- color9 = default(color9,-1)
- color10 = default(color10,-1)
- color11 = default(color11,-1)
- color12 = default(color12,-1)
- color13 = default(color13,-1)
- color14 = default(color14,-1)
- color15 = default(color15,-1)
- color16 = default(color16,-1)
- color17 = default(color17,-1)
- color18 = default(color18,-1)
- color19 = default(color19,-1)
- color20 = default(color20,-1)
- color21 = default(color21,-1)
- color22 = default(color22,-1)
- color23 = default(color23,-1)
- color24 = default(color24,-1)
- tolerance1 = default(tolerance1,10)
- tolerance2 = default(tolerance2,10)
- tolerance3 = default(tolerance3,10)
- tolerance4 = default(tolerance4,10)
- tolerance5 = default(tolerance5,10)
- tolerance6 = default(tolerance6,10)
- tolerance7 = default(tolerance7,10)
- tolerance8 = default(tolerance8,10)
- tolerance9 = default(tolerance9,10)
- tolerance10 = default(tolerance10,10)
- tolerance11 = default(tolerance11,10)
- tolerance12 = default(tolerance12,10)
- tolerance13 = default(tolerance13,10)
- tolerance14 = default(tolerance14,10)
- tolerance15 = default(tolerance15,10)
- tolerance16 = default(tolerance16,10)
- tolerance17 = default(tolerance17,10)
- tolerance18 = default(tolerance18,10)
- tolerance19 = default(tolerance19,10)
- tolerance20 = default(tolerance20,10)
- tolerance21 = default(tolerance21,10)
- tolerance22 = default(tolerance22,10)
- tolerance23 = default(tolerance23,10)
- tolerance24 = default(tolerance24,10)
- expandblur = default(expandblur,0)
- BT601 = default(BT601, c.height <= 576 && c.width <= 1024)
- blur = default(blur,0)
- kR = BT601 ? 0.299 : 0.2126
- kB = BT601 ? 0.114 : 0.0722
- B1 = float(color1 % 256)/255
- G1 = float((color1/256) % 256)/255
- R1 = float((color1/65536) % 256)/255
- B2 = float(color2 % 256)/255
- G2 = float((color2/256) % 256)/255
- R2 = float((color2/65536) % 256)/255
- B3 = float(color3 % 256)/255
- G3 = float((color3/256) % 256)/255
- R3 = float((color3/65536) % 256)/255
- B4 = float(color4 % 256)/255
- G4 = float((color4/256) % 256)/255
- R4 = float((color4/65536) % 256)/255
- B5 = float(color5 % 256)/255
- G5 = float((color5/256) % 256)/255
- R5 = float((color5/65536) % 256)/255
- B6 = float(color6 % 256)/255
- G6 = float((color6/256) % 256)/255
- R6 = float((color6/65536) % 256)/255
- B7 = float(color7 % 256)/255
- G7 = float((color7/256) % 256)/255
- R7 = float((color7/65536) % 256)/255
- B8 = float(color8 % 256)/255
- G8 = float((color8/256) % 256)/255
- R8 = float((color8/65536) % 256)/255
- B9 = float(color9 % 256)/255
- G9 = float((color9/256) % 256)/255
- R9 = float((color9/65536) % 256)/255
- B10 = float(color10 % 256)/255
- G10 = float((color10/256) % 256)/255
- R10 = float((color10/65536) % 256)/255
- B11 = float(color11 % 256)/255
- G11 = float((color11/256) % 256)/255
- R11 = float((color11/65536) % 256)/255
- B12 = float(color12 % 256)/255
- G12 = float((color12/256) % 256)/255
- R12 = float((color12/65536) % 256)/255
- B13 = float(color13 % 256)/255
- G13 = float((color13/256) % 256)/255
- R13 = float((color13/65536) % 256)/255
- B14 = float(color14 % 256)/255
- G14 = float((color14/256) % 256)/255
- R14 = float((color14/65536) % 256)/255
- B15 = float(color15 % 256)/255
- G15 = float((color15/256) % 256)/255
- R15 = float((color15/65536) % 256)/255
- B16 = float(color16 % 256)/255
- G16 = float((color16/256) % 256)/255
- R16 = float((color16/65536) % 256)/255
- B17 = float(color17 % 256)/255
- G17 = float((color17/256) % 256)/255
- R17 = float((color17/65536) % 256)/255
- B18 = float(color18 % 256)/255
- G18 = float((color18/256) % 256)/255
- R18 = float((color18/65536) % 256)/255
- B19 = float(color19 % 256)/255
- G19 = float((color19/256) % 256)/255
- R19 = float((color19/65536) % 256)/255
- B20 = float(color20 % 256)/255
- G20 = float((color20/256) % 256)/255
- R20 = float((color20/65536) % 256)/255
- B21 = float(color21 % 256)/255
- G21 = float((color21/256) % 256)/255
- R21 = float((color21/65536) % 256)/255
- B22 = float(color22 % 256)/255
- G22 = float((color22/256) % 256)/255
- R22 = float((color22/65536) % 256)/255
- B23 = float(color23 % 256)/255
- G23 = float((color23/256) % 256)/255
- R23 = float((color23/65536) % 256)/255
- B24 = float(color24 % 256)/255
- G24 = float((color24/256) % 256)/255
- R24 = float((color24/65536) % 256)/255
- y1 = kR*R1+(1-kR-kB)*G1+kB*B1
- u1 = 128+round(112.0*(B1-y1)/(1-kB))
- v1 = 128+round(112.0*(R1-y1)/(1-kR))
- y1 = 16+round(219.0*y1)
- y2 = kR*R2+(1-kR-kB)*G2+kB*B2
- u2 = 128+round(112.0*(B2-y2)/(1-kB))
- v2 = 128+round(112.0*(R2-y2)/(1-kR))
- y2 = 16+round(219.0*y2)
- y3 = kR*R3+(1-kR-kB)*G3+kB*B3
- u3 = 128+round(112.0*(B3-y3)/(1-kB))
- v3 = 128+round(112.0*(R3-y3)/(1-kR))
- y3 = 16+round(219.0*y3)
- y4 = kR*R4+(1-kR-kB)*G4+kB*B4
- u4 = 128+round(112.0*(B4-y4)/(1-kB))
- v4 = 128+round(112.0*(R4-y4)/(1-kR))
- y4 = 16+round(219.0*y4)
- y5 = kR*R5+(1-kR-kB)*G5+kB*B5
- u5 = 128+round(112.0*(B5-y5)/(1-kB))
- v5 = 128+round(112.0*(R5-y5)/(1-kR))
- y5 = 16+round(219.0*y5)
- y6 = kR*R6+(1-kR-kB)*G6+kB*B6
- u6 = 128+round(112.0*(B6-y6)/(1-kB))
- v6 = 128+round(112.0*(R6-y6)/(1-kR))
- y6 = 16+round(219.0*y6)
- y7 = kR*R7+(1-kR-kB)*G7+kB*B7
- u7 = 128+round(112.0*(B7-y7)/(1-kB))
- v7 = 128+round(112.0*(R7-y7)/(1-kR))
- y7 = 16+round(219.0*y7)
- y8 = kR*R8+(1-kR-kB)*G8+kB*B8
- u8 = 128+round(112.0*(B8-y8)/(1-kB))
- v8 = 128+round(112.0*(R8-y8)/(1-kR))
- y8 = 16+round(219.0*y8)
- y9 = kR*R9+(1-kR-kB)*G9+kB*B9
- u9 = 128+round(112.0*(B9-y9)/(1-kB))
- v9 = 128+round(112.0*(R9-y9)/(1-kR))
- y9 = 16+round(219.0*y9)
- y10 = kR*R10+(1-kR-kB)*G10+kB*B10
- u10 = 128+round(112.0*(B10-y10)/(1-kB))
- v10 = 128+round(112.0*(R10-y10)/(1-kR))
- y10 = 16+round(219.0*y10)
- y11 = kR*R11+(1-kR-kB)*G11+kB*B11
- u11 = 128+round(112.0*(B11-y11)/(1-kB))
- v11 = 128+round(112.0*(R11-y11)/(1-kR))
- y11 = 16+round(219.0*y11)
- y12 = kR*R12+(1-kR-kB)*G12+kB*B12
- u12 = 128+round(112.0*(B12-y12)/(1-kB))
- v12 = 128+round(112.0*(R12-y12)/(1-kR))
- y12 = 16+round(219.0*y12)
- y13 = kR*R13+(1-kR-kB)*G13+kB*B13
- u13 = 128+round(112.0*(B13-y13)/(1-kB))
- v13 = 128+round(112.0*(R13-y13)/(1-kR))
- y13 = 16+round(219.0*y13)
- y14 = kR*R14+(1-kR-kB)*G14+kB*B14
- u14 = 128+round(112.0*(B14-y14)/(1-kB))
- v14 = 128+round(112.0*(R14-y14)/(1-kR))
- y14 = 16+round(219.0*y14)
- y15 = kR*R15+(1-kR-kB)*G15+kB*B15
- u15 = 128+round(112.0*(B15-y15)/(1-kB))
- v15 = 128+round(112.0*(R15-y15)/(1-kR))
- y15 = 16+round(219.0*y15)
- y16 = kR*R16+(1-kR-kB)*G16+kB*B16
- u16 = 128+round(112.0*(B16-y16)/(1-kB))
- v16 = 128+round(112.0*(R16-y16)/(1-kR))
- y16 = 16+round(219.0*y16)
- y17 = kR*R17+(1-kR-kB)*G17+kB*B17
- u17 = 128+round(112.0*(B17-y17)/(1-kB))
- v17 = 128+round(112.0*(R17-y17)/(1-kR))
- y17 = 16+round(219.0*y17)
- y18 = kR*R18+(1-kR-kB)*G18+kB*B18
- u18 = 128+round(112.0*(B18-y18)/(1-kB))
- v18 = 128+round(112.0*(R18-y18)/(1-kR))
- y18 = 16+round(219.0*y18)
- y19 = kR*R19+(1-kR-kB)*G19+kB*B19
- u19 = 128+round(112.0*(B19-y19)/(1-kB))
- v19 = 128+round(112.0*(R19-y19)/(1-kR))
- y19 = 16+round(219.0*y19)
- y20 = kR*R20+(1-kR-kB)*G20+kB*B20
- u20 = 128+round(112.0*(B20-y20)/(1-kB))
- v20 = 128+round(112.0*(R20-y20)/(1-kR))
- y20 = 16+round(219.0*y20)
- y21 = kR*R21+(1-kR-kB)*G21+kB*B21
- u21 = 128+round(112.0*(B21-y21)/(1-kB))
- v21 = 128+round(112.0*(R21-y21)/(1-kR))
- y21 = 16+round(219.0*y21)
- y22 = kR*R22+(1-kR-kB)*G22+kB*B22
- u22 = 128+round(112.0*(B22-y22)/(1-kB))
- v22 = 128+round(112.0*(R22-y22)/(1-kR))
- y22 = 16+round(219.0*y22)
- y23 = kR*R23+(1-kR-kB)*G23+kB*B23
- u23 = 128+round(112.0*(B23-y23)/(1-kB))
- v23 = 128+round(112.0*(R23-y23)/(1-kR))
- y23 = 16+round(219.0*y23)
- y24 = kR*R24+(1-kR-kB)*G24+kB*B24
- u24 = 128+round(112.0*(B24-y24)/(1-kB))
- v24 = 128+round(112.0*(R24-y24)/(1-kR))
- y24 = 16+round(219.0*y24)
- c.mt_lut(
- \ yExpr = "x "+string(y1)+" - abs "+string(tolerance1)+" < "+
- \(color2!=-1 ? "x "+string(y2)+" - abs "+string(tolerance2)+" < | " : "")+
- \(color3!=-1 ? "x "+string(y3)+" - abs "+string(tolerance3)+" < | " : "")+
- \(color4!=-1 ? "x "+string(y4)+" - abs "+string(tolerance4)+" < | " : "")+
- \(color5!=-1 ? "x "+string(y5)+" - abs "+string(tolerance5)+" < | " : "")+
- \(color6!=-1 ? "x "+string(y6)+" - abs "+string(tolerance6)+" < | " : "")+
- \(color7!=-1 ? "x "+string(y7)+" - abs "+string(tolerance7)+" < | " : "")+
- \(color8!=-1 ? "x "+string(y8)+" - abs "+string(tolerance8)+" < | " : "")+
- \(color9!=-1 ? "x "+string(y9)+" - abs "+string(tolerance9)+" < | " : "")+
- \(color10!=-1 ? "x "+string(y10)+" - abs "+string(tolerance10)+" < | " : "")+
- \(color11!=-1 ? "x "+string(y11)+" - abs "+string(tolerance11)+" < | " : "")+
- \(color12!=-1 ? "x "+string(y12)+" - abs "+string(tolerance12)+" < | " : "")+
- \(color13!=-1 ? "x "+string(y13)+" - abs "+string(tolerance13)+" < | " : "")+
- \(color14!=-1 ? "x "+string(y14)+" - abs "+string(tolerance14)+" < | " : "")+
- \(color15!=-1 ? "x "+string(y15)+" - abs "+string(tolerance15)+" < | " : "")+
- \(color16!=-1 ? "x "+string(y16)+" - abs "+string(tolerance16)+" < | " : "")+
- \(color17!=-1 ? "x "+string(y17)+" - abs "+string(tolerance17)+" < | " : "")+
- \(color18!=-1 ? "x "+string(y18)+" - abs "+string(tolerance18)+" < | " : "")+
- \(color19!=-1 ? "x "+string(y19)+" - abs "+string(tolerance19)+" < | " : "")+
- \(color20!=-1 ? "x "+string(y20)+" - abs "+string(tolerance20)+" < | " : "")+
- \(color21!=-1 ? "x "+string(y21)+" - abs "+string(tolerance21)+" < | " : "")+
- \(color22!=-1 ? "x "+string(y22)+" - abs "+string(tolerance22)+" < | " : "")+
- \(color23!=-1 ? "x "+string(y23)+" - abs "+string(tolerance23)+" < | " : "")+
- \(color24!=-1 ? "x "+string(y24)+" - abs "+string(tolerance24)+" < | " : "")+"255 0 ?",
- \ uExpr = "x "+string(u1)+" - abs "+string(tolerance1/2)+" < "+
- \(color2!=-1 ? "x "+string(u2)+" - abs "+string(tolerance2/2)+" < | " : "")+
- \(color3!=-1 ? "x "+string(u3)+" - abs "+string(tolerance3/2)+" < | " : "")+
- \(color4!=-1 ? "x "+string(u4)+" - abs "+string(tolerance4/2)+" < | " : "")+
- \(color5!=-1 ? "x "+string(u5)+" - abs "+string(tolerance5/2)+" < | " : "")+
- \(color6!=-1 ? "x "+string(u6)+" - abs "+string(tolerance6/2)+" < | " : "")+
- \(color7!=-1 ? "x "+string(u7)+" - abs "+string(tolerance7/2)+" < | " : "")+
- \(color8!=-1 ? "x "+string(u8)+" - abs "+string(tolerance8/2)+" < | " : "")+
- \(color9!=-1 ? "x "+string(u9)+" - abs "+string(tolerance9/2)+" < | " : "")+
- \(color10!=-1 ? "x "+string(u10)+" - abs "+string(tolerance10/2)+" < | " : "")+
- \(color11!=-1 ? "x "+string(u11)+" - abs "+string(tolerance11/2)+" < | " : "")+
- \(color12!=-1 ? "x "+string(u12)+" - abs "+string(tolerance12/2)+" < | " : "")+
- \(color13!=-1 ? "x "+string(u13)+" - abs "+string(tolerance13/2)+" < | " : "")+
- \(color14!=-1 ? "x "+string(u14)+" - abs "+string(tolerance14/2)+" < | " : "")+
- \(color15!=-1 ? "x "+string(u15)+" - abs "+string(tolerance15/2)+" < | " : "")+
- \(color16!=-1 ? "x "+string(u16)+" - abs "+string(tolerance16/2)+" < | " : "")+
- \(color17!=-1 ? "x "+string(u17)+" - abs "+string(tolerance17/2)+" < | " : "")+
- \(color18!=-1 ? "x "+string(u18)+" - abs "+string(tolerance18/2)+" < | " : "")+
- \(color19!=-1 ? "x "+string(u19)+" - abs "+string(tolerance19/2)+" < | " : "")+
- \(color20!=-1 ? "x "+string(u20)+" - abs "+string(tolerance20/2)+" < | " : "")+
- \(color21!=-1 ? "x "+string(u21)+" - abs "+string(tolerance21/2)+" < | " : "")+
- \(color22!=-1 ? "x "+string(u22)+" - abs "+string(tolerance22/2)+" < | " : "")+
- \(color23!=-1 ? "x "+string(u23)+" - abs "+string(tolerance23/2)+" < | " : "")+
- \(color24!=-1 ? "x "+string(u24)+" - abs "+string(tolerance24/2)+" < | " : "")+"255 0 ?",
- \ vExpr = "x "+string(v1)+" - abs "+string(tolerance1/2)+" < "+
- \(color2!=-1 ? "x "+string(v2)+" - abs "+string(tolerance2/2)+" < | " : "")+
- \(color3!=-1 ? "x "+string(v3)+" - abs "+string(tolerance3/2)+" < | " : "")+
- \(color4!=-1 ? "x "+string(v4)+" - abs "+string(tolerance4/2)+" < | " : "")+
- \(color5!=-1 ? "x "+string(v5)+" - abs "+string(tolerance5/2)+" < | " : "")+
- \(color6!=-1 ? "x "+string(v6)+" - abs "+string(tolerance6/2)+" < | " : "")+
- \(color7!=-1 ? "x "+string(v7)+" - abs "+string(tolerance7/2)+" < | " : "")+
- \(color8!=-1 ? "x "+string(v8)+" - abs "+string(tolerance8/2)+" < | " : "")+
- \(color9!=-1 ? "x "+string(v9)+" - abs "+string(tolerance9/2)+" < | " : "")+
- \(color10!=-1 ? "x "+string(v10)+" - abs "+string(tolerance10/2)+" < | " : "")+
- \(color11!=-1 ? "x "+string(v11)+" - abs "+string(tolerance11/2)+" < | " : "")+
- \(color12!=-1 ? "x "+string(v12)+" - abs "+string(tolerance12/2)+" < | " : "")+
- \(color13!=-1 ? "x "+string(v13)+" - abs "+string(tolerance13/2)+" < | " : "")+
- \(color14!=-1 ? "x "+string(v14)+" - abs "+string(tolerance14/2)+" < | " : "")+
- \(color15!=-1 ? "x "+string(v15)+" - abs "+string(tolerance15/2)+" < | " : "")+
- \(color16!=-1 ? "x "+string(v16)+" - abs "+string(tolerance16/2)+" < | " : "")+
- \(color17!=-1 ? "x "+string(v17)+" - abs "+string(tolerance17/2)+" < | " : "")+
- \(color18!=-1 ? "x "+string(v18)+" - abs "+string(tolerance18/2)+" < | " : "")+
- \(color19!=-1 ? "x "+string(v19)+" - abs "+string(tolerance19/2)+" < | " : "")+
- \(color20!=-1 ? "x "+string(v20)+" - abs "+string(tolerance20/2)+" < | " : "")+
- \(color21!=-1 ? "x "+string(v21)+" - abs "+string(tolerance21/2)+" < | " : "")+
- \(color22!=-1 ? "x "+string(v22)+" - abs "+string(tolerance22/2)+" < | " : "")+
- \(color23!=-1 ? "x "+string(v23)+" - abs "+string(tolerance23/2)+" < | " : "")+
- \(color24!=-1 ? "x "+string(v24)+" - abs "+string(tolerance24/2)+" < | " : "")+"255 0 ?",u=3,v=3)
- mt_logic(mt_logic(utoy,vtoy,"min").bicubicresize(width,height),"min")
- expandblur>0 ? binomialblur(expandblur,u=1,v=1).mt_lut("x 5 *") : last
- blur>0 ? binomialblur(blur,u=1,v=1) : last
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement