ws-cleanup-types: archive, audio, data, font, image, layered, music, playlist, subtitle, vector, video: annotations, casts, one value per re-assignment where the solver loses the type
This commit is contained in:
1 parent
dc98aec2ec
commit
f459b2dcdf
44 files changed
+172
-119
No files matched your search
@@ -57,7 +57,7 @@ function Channels.rleCounts(src: buffer, p: number, limit: number, rows: number,
|
||||
if rows < 0 or p + rows * size > limit then
|
||||
return nil, p
|
||||
end
|
||||
local counts = table.create(rows)
|
||||
local counts: { number } = table.create(rows) :: { number }
|
||||
for i = 1, rows do
|
||||
if psb then
|
||||
counts[i] = byteswap(readu32(src, p))
|
||||
@@ -247,11 +247,15 @@ function Channels.toRGBA(planes: { [any]: buffer }, w: number, h: number, depth:
|
||||
local mm = if c2 then sample8(c2, i, depth) else 255
|
||||
local yy = if c3 then sample8(c3, i, depth) else 255
|
||||
local kk = if c4 then sample8(c4, i, depth) else 255
|
||||
r, g, b = floor(cc * kk / 255 + 0.5), floor(mm * kk / 255 + 0.5), floor(yy * kk / 255 + 0.5)
|
||||
r = floor(cc * kk / 255 + 0.5)
|
||||
g = floor(mm * kk / 255 + 0.5)
|
||||
b = floor(yy * kk / 255 + 0.5)
|
||||
elseif mode == 2 then
|
||||
local k = if c1 then readu8(c1, i) else 0
|
||||
if palette and blen(palette) >= 768 then
|
||||
r, g, b = readu8(palette, k), readu8(palette, 256 + k), readu8(palette, 512 + k)
|
||||
r = readu8(palette, k)
|
||||
g = readu8(palette, 256 + k)
|
||||
b = readu8(palette, 512 + k)
|
||||
else
|
||||
r, g, b = k, k, k
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user