Unoptimized conversion works, let's see if it breaks the calculator.
This commit is contained in:
parent
a1ead55053
commit
21b54c0683
18
demo.lua
18
demo.lua
|
@ -1,16 +1,13 @@
|
|||
local bitmap = require'bitmap' --used to read its content
|
||||
|
||||
function int_exa(nb)
|
||||
output = "0123456789abcdef"
|
||||
first_digit = 0
|
||||
while nb > 15 do
|
||||
nb = nb - 16
|
||||
first_digit = first_digit + 1
|
||||
end
|
||||
return output:sub(first_digit + 1, 1)..output:sub(nb + 1, 1)
|
||||
if nb < 16 then add = "0"
|
||||
else add = "" end
|
||||
return [[\x]]..add..string.format("%x", nb)
|
||||
end
|
||||
|
||||
io.write("from casioplot import set_pixel, show_screen as S, R\n")
|
||||
io.write([[from casioplot import set_pixel, show_screen as S, R
|
||||
data=b"]])
|
||||
|
||||
do --open image
|
||||
local cairo = require'cairo' --used to open the file
|
||||
|
@ -23,7 +20,6 @@ local getpixel, setpixel = bitmap.pixel_interface(image_bitmap)
|
|||
pallet = {} --will store colors
|
||||
pallet_last = 0
|
||||
|
||||
|
||||
for j = 1, image_infos.height, 1 do
|
||||
for i = 1, image_infos.width, 1 do
|
||||
r, g, b = getpixel(i, j)
|
||||
|
@ -35,4 +31,6 @@ for j = 1, image_infos.height, 1 do
|
|||
end
|
||||
end
|
||||
|
||||
io.write("\nR()")
|
||||
io.write([["
|
||||
R()
|
||||
]])
|
||||
|
|
Loading…
Reference in New Issue