This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function StackedNto16(clip c, int n) | |
{ | |
Assert(8 <= n <= 15, "StackedNto16: bitdepth should be in range 8-15") | |
h = c.Height / 2 | |
msb = c.Crop(0,0,0,-h) | |
lsb = c.Crop(0,h,0,0) | |
shamt = string(16-n) | |
msb16 = (n != 8) ? msb.mt_lutxy(lsb, "x " + shamt + " << y 8 " + shamt + " - >> +", v=3, u=3) : lsb | |
lsb16 = (n != 8) ? lsb.mt_lut("x " + shamt + " << 255 &u", v=3, u=3) : msb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###### nnedi3_resize16 v3.0 ###### by mawen1250 ###### 2013.11.15 ###### | |
###### from v2.8 on, nnedi3_resize16 only supports AviSynth v2.6 ###### | |
###### Requirements: masktools v2.0a48, dither v1.24.0, nnedi3 v0.9.4, ###### | |
###### SmoothAdjust v2.90, Contra-Sharpen mod 3.4, ###### | |
###### FTurn v1.3.5 (not necessarily required but will improve speed) ###### | |
###### Accept Y8, YV12, YV16, YV24 input, use nnedi3 and Dither_resize16(nr) for scaling ###### | |
###### output format can be 8bit/16bit Y8/YV12/YV16/YV24 or RGB32/RGB24/RGB48YV12/RGB48Y ###### | |
Function nnedi3_resize16(clip input, int "target_width", int "target_height", float "src_left", float "src_top", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function RGB48YV12toRGB48Y(clip c) | |
{ | |
vers = VersionNumber() | |
tPref = IsFunction("FTurnLeft") ? "F" : "" | |
w = c.Width | |
h = c.Height | |
y = (vers < 2.60) ? c : c.ConvertToY8() | |
u = (vers < 2.60) ? c.UtoY() : c.UtoY8() | |
v = (vers < 2.60) ? c.VtoY() : c.VtoY8() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src=last | |
Spline36Resize(width*2,height*2) | |
a=tcolormask("$ffffb5 $ecc96c $eff1ac $eeecbf $ecc250 $eef1ee",14,false,true).mt_expand_multi(sw=4, sh=4).mt_inflate().Spline36Resize(1920,1080) | |
b=tcolormask("$ffffb5 $ecc96c $eff1ac $eeecbf $ecc250 $dcc85f",11,false,true).mt_expand_multi(sw=6, sh=6).mt_inpand_multi(sw=2,sh=2).Spline36Resize(1920,1080) | |
ribbon=src.tcolormask("$e57f7f",16).mt_expand_multi(sw=3, sh=3).mt_inflate() | |
exclude=src.tcolormask("$65a2a6 $2f91a6 $357d98 $47a9c0 $84b0af",12,false,true).mt_expand_multi(sw=8,sh=8).mt_inpand_multi(sw=8,sh=8).RemoveGrain(17).mt_invert() | |
b.Crop(0,0,1232,0).StackHorizontal(a.mt_logic(exclude,"and").Crop(1232,0,0,0)).mt_logic(ribbon, "or") | |
HiAA(aa="sangnom2", preaa=True, ss="nnedi3") | |
mt_invert().ConvertToY8() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
import ctypes as ct | |
class GetPoint(ct.Structure): | |
_fields_ = [("x", ct.c_long), ("y", ct.c_long)] | |
def get_mousepos(): | |
pt = GetPoint() | |
ct.windll.user32.GetCursorPos(ct.byref(pt)) | |
return int(pt.x), int(pt.y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Tkinter import Tk | |
tk = Tk() | |
import json | |
glyphs = fl.font.glyphs | |
sel = [] | |
for i in range(len(glyphs)): | |
if fl.Selected(i): | |
sel.append({'name':glyphs[i].name, 'unicode':glyphs[i].unicode}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Tkinter import Tk | |
tk = Tk() | |
import json | |
tk.withdraw() | |
sel = json.loads(tk.clipboard_get()) | |
tk.destroy() | |
glyphs = fl.font.glyphs | |
fl.Unselect() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import robofab | |
import random | |
def drawRaster(glyph, raster, box): | |
colCnt = len(raster) | |
rowCnt = len(raster[0]) | |
pen = glyph.getPen() | |
offY = box[1] | |
offX = box[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sel = [ | |
{"name": ".notdef", "unicode": None}, | |
{"name": "cid1", "unicode": 0}, | |
{"name": "cid2", "unicode": 33}, | |
{"name": "cid3", "unicode": 34}, | |
{"name": "cid4", "unicode": 35}, | |
{"name": "cid5", "unicode": 36}, | |
{"name": "cid6", "unicode": 37}, | |
{"name": "cid7", "unicode": 38}, | |
{"name": "cid8", "unicode": 39}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def process(f, g, t, index): | |
fl.SetUndo(index) | |
upm = f.upm | |
g.RemoveOverlap() | |
outlines = Glyph(g) | |
g.Distance(upm/100, upm/100, 1) | |
g.RemoveOverlap() | |
outlines.Bsubtract(t) | |
g.Bsubtract(outlines) |
OlderNewer