Quote:
Originally Posted by dimasic
And maybe it's better to modify "Screen:" functions in lua than add three more compiled files?
|
If the following code still does not work, you may adjust it by yourself -- i still have neither K4 nor the framebuffer dump made by some lucky K4-owner.
Udachi!
Spoiler:
Code:
function Screen:fb2pgm(fin, fout, pack, bpp)
local inputf = assert(io.open(fin,"rb"))
if inputf then
local outputf = assert(io.open(fout,"wb"))
outputf:write("P5\n# Created by kindlepdfviewer\n"..G_width.." "..G_height.."\n255\n")
if bpp == 8 then -- then needs free memory of G_width bytes, and not too fast
local i, j, line
for i=1, G_height do
line = inputf:read(G_width)
for j=1, G_width do
outputf:write(string.char(255-string.byte(line, j)))
end
end
else
...