rename: src/Formats -> src/Rosetta, @formats -> @rosetta requires, build/luajit/rosetta + rosetta._compat, build/roblox/Rosetta, ROSETTA_* env/globals, writer vendor strings

This commit is contained in:
4DBug committed 2026-11-01 01:19:16 -05:00
1 parent 2956576d7f
commit 22ddcd78fa
941 files changed
+3364 -3364

No files matched your search

+13 -13
View File
@@ -1,7 +1,7 @@
-- tools/fixtures/_tex_encode.luau: our texture encoders' output for the reference tools to read (run by
-- tools/fixtures/{dds,ktx,exr}.py as `luau tools/fixtures/_tex_encode.luau -a <format>`). Prints "name\thex" lines.
-- The source images are generated here (tools/fixtures/_tex_reference.py makes the same ones: source()).
local Types = require("@formats/Types")
local Types = require("@rosetta/Types")
local which = ({ ... } :: { string })[1] or "dds"
@@ -53,7 +53,7 @@ local function emit(name: string, b: buffer?, err: any?)
end
if which == "dds" then
local Dds = require("@formats/image/dds")
local Dds = require("@rosetta/image/dds")
local img = image(37, 23, "rgba8", 0)
for _, f in { "rgba8", "bgra8", "bc1", "bc3", "bc4", "bc5" } do
emit("ours_" .. f .. ".dds", Dds.encode(img, { pixelFormat = f :: any }))
@@ -75,7 +75,7 @@ if which == "dds" then
end
if which == "ktx" then
local Ktx = require("@formats/image/ktx")
local Ktx = require("@rosetta/image/ktx")
local img = image(37, 23, "rgba8", 0)
emit("ours_rgba8.ktx2", Ktx.encode(img))
emit("ours_rgba8_mips.ktx2", Ktx.encode(img, { mips = true }))
@@ -95,7 +95,7 @@ if which == "ktx" then
end
if which == "exr" then
local Exr = require("@formats/image/exr")
local Exr = require("@rosetta/image/exr")
local f = image(37, 23, "rgbaf32", 0, 4)
for _, c in { "none", "zips", "zip" } do
emit("ours_half_" .. c .. ".exr", Exr.encode(f, { compression = c :: any }))
@@ -131,17 +131,17 @@ local function few(): Types.Image
end
local function simple(): any
if which == "pcx" then
return require("@formats/image/pcx")
return require("@rosetta/image/pcx")
elseif which == "sgi" then
return require("@formats/image/sgi")
return require("@rosetta/image/sgi")
elseif which == "sunras" then
return require("@formats/image/sunras")
return require("@rosetta/image/sunras")
elseif which == "xbm" then
return require("@formats/image/xbm")
return require("@rosetta/image/xbm")
elseif which == "xpm" then
return require("@formats/image/xpm")
return require("@rosetta/image/xpm")
elseif which == "ilbm" then
return require("@formats/image/ilbm")
return require("@rosetta/image/ilbm")
end
return nil
end
@@ -159,7 +159,7 @@ end
if which == "icns" then
-- square icons 16 / 32 / 48 / 128 as RLE entries (no encodeImage hook here)
local Icns = require("@formats/image/icns")
local Icns = require("@rosetta/image/icns")
local base = image(128, 128, "rgba8", 1)
base.frames = {}
for i, s in { 16, 32, 48, 128 } do
@@ -171,8 +171,8 @@ end
if which == "ora" then
-- a layered document: background, an offset half-opaque multiply layer, a hidden one, a group with a screen layer
local Ora = require("@formats/layered/ora")
local Png = require("@formats/image/png")
local Ora = require("@rosetta/layered/ora")
local Png = require("@rosetta/image/png")
local doc = Types.Layered.new(40, 30)
local bg = Types.Layered.layer("background", image(40, 30, "rgba8", 0))
for i = 0, 40 * 30 - 1 do