From aad231f5e406a7c1eaafe6595a64b9c55f230692 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 16 Oct 2023 21:37:02 +0200 Subject: [PATCH] =?UTF-8?q?Generate=20test=20textures=20with=20scanline=20?= =?UTF-8?q?order=20=E2=80=9Ctop-bottom=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/generate_test_textures.lua | 73 +++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/tools/generate_test_textures.lua b/tools/generate_test_textures.lua index 01349f3d6..24e4b3278 100755 --- a/tools/generate_test_textures.lua +++ b/tools/generate_test_textures.lua @@ -17,7 +17,19 @@ local pixels_colormapped_bt = { { R, R, R, _, _, _, _, _, }, } +local pixels_colormapped_tb = { + { R, R, R, _, _, _, _, _, }, + { _, R, _, _, _, _, _, _, }, + { _, R, G, G, G, _, _, _, }, + { _, R, G, _, _, _, _, _, }, + { _, _, G, _, G, B, B, B, }, + { _, _, G, G, G, B, _, B, }, + { _, _, _, _, _, B, B, B, }, + { _, _, _, _, _, B, _, B, }, +} + image_colormapped_bt = tga_encoder.image(pixels_colormapped_bt) +image_colormapped_tb = tga_encoder.image(pixels_colormapped_tb) colormap_32bpp = { { 0, 0, 0, 128 }, @@ -29,10 +41,18 @@ image_colormapped_bt:save( "type1_32bpp_bt.tga", { colormap = colormap_32bpp, color_format = "B8G8R8A8", scanline_order = "bottom-top" } ) +image_colormapped_tb:save( + "type1_32bpp_tb.tga", + { colormap = colormap_32bpp, color_format = "B8G8R8A8", scanline_order = "top-bottom" } +) image_colormapped_bt:save( "type1_16bpp_bt.tga", { colormap = colormap_32bpp, color_format = "A1R5G5B5", scanline_order = "bottom-top" } ) +image_colormapped_tb:save( + "type1_16bpp_tb.tga", + { colormap = colormap_32bpp, color_format = "A1R5G5B5", scanline_order = "top-bottom" } +) colormap_24bpp = { { 0, 0, 0 }, @@ -44,6 +64,10 @@ image_colormapped_bt:save( "type1_24bpp_bt.tga", { colormap = colormap_32bpp, color_format = "B8G8R8", scanline_order = "bottom-top" } ) +image_colormapped_tb:save( + "type1_24bpp_tb.tga", + { colormap = colormap_32bpp, color_format = "B8G8R8", scanline_order = "top-bottom" } +) local _ = { 0, 0, 0, 128 } local R = { 255, 0, 0, 255 } @@ -61,16 +85,36 @@ local pixels_rgba_bt = { { R, R, R, _, _, _, _, _, }, } +local pixels_rgba_tb = { + { R, R, R, _, _, _, _, _, }, + { _, R, _, _, _, _, _, _, }, + { _, R, G, G, G, _, _, _, }, + { _, R, G, _, _, _, _, _, }, + { _, _, G, _, G, B, B, B, }, + { _, _, G, G, G, B, _, B, }, + { _, _, _, _, _, B, B, B, }, + { _, _, _, _, _, B, _, B, }, +} + image_rgba_bt = tga_encoder.image(pixels_rgba_bt) +image_rgba_tb = tga_encoder.image(pixels_rgba_tb) image_rgba_bt:save( "type2_32bpp_bt.tga", { color_format="B8G8R8A8", compression="RAW", scanline_order = "bottom-top" } ) +image_rgba_tb:save( + "type2_32bpp_tb.tga", + { color_format="B8G8R8A8", compression="RAW", scanline_order = "top-bottom" } +) image_rgba_bt:save( "type10_32bpp_bt.tga", { color_format="B8G8R8A8", compression="RLE", scanline_order = "bottom-top" } ) +image_rgba_tb:save( + "type10_32bpp_tb.tga", + { color_format="B8G8R8A8", compression="RLE", scanline_order = "top-bottom" } +) local _ = { 0, 0, 0 } local R = { 255, 0, 0 } @@ -88,22 +132,49 @@ local pixels_rgb_bt = { { R, R, R, _, _, _, _, _, }, } +local pixels_rgb_tb = { + { R, R, R, _, _, _, _, _, }, + { _, R, _, _, _, _, _, _, }, + { _, R, G, G, G, _, _, _, }, + { _, R, G, _, _, _, _, _, }, + { _, _, G, _, G, B, B, B, }, + { _, _, G, G, G, B, _, B, }, + { _, _, _, _, _, B, B, B, }, + { _, _, _, _, _, B, _, B, }, +} + image_rgb_bt = tga_encoder.image(pixels_rgb_bt) +image_rgb_tb = tga_encoder.image(pixels_rgb_tb) image_rgb_bt:save( "type2_24bpp_bt.tga", { color_format="B8G8R8", compression="RAW", scanline_order = "bottom-top" } ) +image_rgb_tb:save( + "type2_24bpp_tb.tga", + { color_format="B8G8R8", compression="RAW", scanline_order = "top-bottom" } +) image_rgb_bt:save( "type10_24bpp_bt.tga", { color_format="B8G8R8", compression="RLE", scanline_order = "bottom-top" } ) - +image_rgb_tb:save( + "type10_24bpp_tb.tga", + { color_format="B8G8R8", compression="RLE", scanline_order = "top-bottom" } +) image_rgb_bt:save( "type2_16bpp_bt.tga", { color_format="A1R5G5B5", compression="RAW", scanline_order = "bottom-top" } ) +image_rgb_tb:save( + "type2_16bpp_tb.tga", + { color_format="A1R5G5B5", compression="RAW", scanline_order = "top-bottom" } +) image_rgb_bt:save( "type10_16bpp_bt.tga", { color_format="A1R5G5B5", compression="RLE", scanline_order = "bottom-top" } ) +image_rgb_tb:save( + "type10_16bpp_tb.tga", + { color_format="A1R5G5B5", compression="RLE", scanline_order = "top-bottom" } +)