lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

By diabolical luck (or lack of it) though the biggest thing I had tried
to load so far was a 256x256 RGBA image which has 65536 4-component
pixels for a total of 262144 elements which is *right on* the limit.

Can't you format that table as a table with 65536 subtables, each with
the 4 components of a pixel? (Or to pack the 4 components into a
single string or number?)

Or perhaps take it to another level, have a table for each scanline, and a table for each pixel. Then if you need to add in extra channels (Z? ObjID? etc) it won't mess up the format entirely. So something like:

my_image =
   { {r,g,b,a}, {r,g,b,a}, ... }, -- scanline 1
   { {r,g,b,a}, {r,g,b,a}, ... }, -- scanline 2

This would allow for up to 256k x 256k textures, with up to 256k channels.

Love, Light and Peace,
- Peter Loveday
Director of Development, eyeon Software