ws-tex: docs/guide sections (textures / HDR, OpenRaster); DDS / KTX pixelFormat option; XBM / XPM names from F.save
F.save sets opts.format to the file format, so the DDS / KTX layout option is pixelFormat; XBM / XPM make a C identifier of opts.name (F.save passes the file name).
This commit is contained in:
1 parent
d618795ce7
commit
918c8310af
10 files changed
+90
-30
No files matched your search
@@ -163,7 +163,7 @@ do
|
||||
local img = Types.Image.new(37, 23)
|
||||
img.pixels = src
|
||||
for _, f in { "rgba8", "bgra8" } do
|
||||
local back = dec(Dds.encode(img, { format = f :: any }) :: buffer)
|
||||
local back = dec(Dds.encode(img, { pixelFormat = f :: any }) :: buffer)
|
||||
t:eq(buffer.tostring(back.pixels), buffer.tostring(src), f .. " round trip")
|
||||
end
|
||||
local f = Types.Image.new(3, 2, "rgbaf32")
|
||||
@@ -172,9 +172,9 @@ do
|
||||
end
|
||||
local back = dec(Dds.encode(f) :: buffer, { native = true })
|
||||
t:eq(buffer.tostring(back.pixels), buffer.tostring(f.pixels), "rgba32f round trip")
|
||||
local _, e1 = Dds.encode(f, { format = "bc1" })
|
||||
local _, e1 = Dds.encode(f, { pixelFormat = "bc1" })
|
||||
t:check(e1 and e1.code == Err.ARG, "bc1 needs rgba8")
|
||||
local _, e2 = Dds.encode(img, { format = "bc7" :: any })
|
||||
local _, e2 = Dds.encode(img, { pixelFormat = "bc7" :: any })
|
||||
t:check(e2 and e2.code == Err.ARG, "no bc7 encoder")
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user