ws-cleanup-types: TrueType names, mp3 index, aac options, imageops test: annotations
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c436f4d265
commit
d8c0394fbf
4 files changed
+6
-6
No files matched your search
@@ -136,7 +136,7 @@ local function index(r: Bytes.Reader, maxFrames: number): ({ number }, { number
|
||||
end
|
||||
|
||||
function AacFormat.open(r: Bytes.Reader, opts: DecodeOptions?): (Types.Decoder?, Err.Err?)
|
||||
local o = opts or {}
|
||||
local o: DecodeOptions = opts or {}
|
||||
local offs, sizes, first, ierr = index(r, o.maxFrames or 2 ^ 22)
|
||||
if ierr then
|
||||
return nil, ierr
|
||||
|
||||
@@ -101,7 +101,7 @@ function Index.build(b: buffer, start: number, stop: number): Index?
|
||||
|
||||
if first then
|
||||
first = false
|
||||
hz, nch, layer, spf = fHz, fCh, fLayer, Header.frameSamples(h1)
|
||||
hz, nch, layer, spf = fHz, fCh, fLayer, Header.frameSamples(h1) :: number
|
||||
version = if band(h1, 8) ~= 0 then 1 elseif band(h1, 0x10) ~= 0 then 2 else 2.5
|
||||
if fLayer == 3 then
|
||||
local ret, frames, d, p = Core.vbrTag(b, pos, fs)
|
||||
@@ -150,7 +150,7 @@ function Index.build(b: buffer, start: number, stop: number): Index?
|
||||
end
|
||||
if n == cap then
|
||||
cap *= 2
|
||||
OFF, SIZE, FLAGS, OUT, MAIN = grow(OFF, cap * 4), grow(SIZE, cap * 2), grow(FLAGS, cap), grow(OUT, cap * 4), grow(MAIN, cap * 2)
|
||||
OFF, SIZE, FLAGS, OUT, MAIN = grow(OFF, cap * 4), grow(SIZE, cap * 2), grow(FLAGS, cap), grow(OUT, cap * 4), grow(MAIN, cap * 2) :: buffer
|
||||
end
|
||||
buffer.writeu32(OFF, n * 4, pos)
|
||||
buffer.writeu16(SIZE, n * 2, fs)
|
||||
|
||||
@@ -452,7 +452,7 @@ local function macRoman(b: buffer, o: number, n: number): string
|
||||
return table.concat(out)
|
||||
end
|
||||
|
||||
local NAME_IDS = {
|
||||
local NAME_IDS: { [number]: string } = {
|
||||
[0] = "copyright",
|
||||
[1] = "family",
|
||||
[2] = "style",
|
||||
@@ -486,7 +486,7 @@ function Tables.names(b: buffer, o: number, n: number): { [string]: string }
|
||||
local len, off = u16(b, r + 8), u16(b, r + 10)
|
||||
local key = NAME_IDS[nid]
|
||||
if key and strings + off + len <= o + n then
|
||||
local rk, s = 0, nil
|
||||
local rk: number, s: string? = 0, nil
|
||||
if pid == 3 and (eid == 1 or eid == 10 or eid == 0) then
|
||||
rk = if lang == 0x409 then 4 else 2
|
||||
s = utf16be(b, strings + off, len)
|
||||
|
||||
@@ -43,7 +43,7 @@ do
|
||||
local ga = Ops.convert(rgba, "gray8") :: any
|
||||
t:check(buffer.tostring(ga.pixels) == Fx.graya, "rgba8 -> gray8 matches Pillow (alpha ignored)")
|
||||
local gray = Ops.convert(rgb, "gray8") :: any
|
||||
local worst = { nearest = 0, bilinear = 0, lanczos = 0 }
|
||||
local worst: { [string]: number } = { nearest = 0, bilinear = 0, lanczos = 0 }
|
||||
for _, c in Fx.resize do
|
||||
local src = if c.mode == "RGB" then rgb else gray
|
||||
local r = Ops.resize(src, c.w, c.h, c.filter) :: any
|
||||
|
||||
Reference in new issue
Block a user