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:
1 parent
2956576d7f
commit
22ddcd78fa
941 files changed
+3364
-3364
No files matched your search
@@ -1,9 +1,9 @@
|
||||
-- tools/fixtures/_ours.luau: our encoders' output for the reference tools to read (run by tools/fixtures/*.py through
|
||||
-- `luau tools/fixtures/_ours.luau -a <format>`). Prints one JSON object: { "data": hex of the encoded file, ... the
|
||||
-- facts the python side checks the reference's reading against }.
|
||||
local Types = require("@formats/Types")
|
||||
local Crc32 = require("@formats/core/Crc32")
|
||||
local LayerOps = require("@formats/ops/LayerOps")
|
||||
local Types = require("@rosetta/Types")
|
||||
local Crc32 = require("@rosetta/core/Crc32")
|
||||
local LayerOps = require("@rosetta/ops/LayerOps")
|
||||
|
||||
local function hex(b: buffer): string
|
||||
local t = table.create(buffer.len(b))
|
||||
@@ -145,7 +145,7 @@ end
|
||||
|
||||
local which, arg = ...
|
||||
if which == "psd" then
|
||||
local Psd = require("@formats/layered/psd")
|
||||
local Psd = require("@rosetta/layered/psd")
|
||||
local doc = psdDoc()
|
||||
local data = Psd.encode(doc) :: buffer
|
||||
local flat = LayerOps.flatten(doc) :: Types.Image
|
||||
@@ -156,7 +156,7 @@ if which == "psd" then
|
||||
end
|
||||
print(json({ data = hex(data), composite = Crc32.of(flat.pixels), layers = layers }))
|
||||
elseif which == "aseprite" then
|
||||
local Ase = require("@formats/layered/aseprite")
|
||||
local Ase = require("@rosetta/layered/aseprite")
|
||||
local doc = aseDoc()
|
||||
local data = Ase.encode(doc) :: buffer
|
||||
local frames = {}
|
||||
@@ -165,15 +165,15 @@ elseif which == "aseprite" then
|
||||
end
|
||||
print(json({ data = hex(data), nframes = 3, frames = frames }))
|
||||
elseif which == "tiled" then
|
||||
local Tiled = require("@formats/vector/tiled")
|
||||
local Tiled = require("@rosetta/vector/tiled")
|
||||
local m = tiledMap()
|
||||
local tmx = Tiled.encode(m, { format = "tmx" }) :: buffer
|
||||
local tmj = Tiled.encode(m, { format = "tmj" }) :: buffer
|
||||
print(json({ tmx = hex(tmx), tmj = hex(tmj) }))
|
||||
elseif which == "svg" then
|
||||
-- the SVG text given on the command line, decoded and written back by our encoder
|
||||
local Svg = require("@formats/vector/svg")
|
||||
local Bytes = require("@formats/core/Bytes")
|
||||
local Svg = require("@rosetta/vector/svg")
|
||||
local Bytes = require("@rosetta/core/Bytes")
|
||||
local v = Svg.decode(Bytes.reader(buffer.fromstring(arg)))
|
||||
local out = if v then Svg.encode(v) else nil
|
||||
print(json({ svg = if out then buffer.tostring(out) else "" }))
|
||||
|
||||
Reference in new issue
Block a user