View Single Post
Old 04-14-2013, 08:13 AM   #157
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by dimasic View Post
It does not work at all. Dark grey background with no visible information.

In K4 reading of framebuffer with read() function returns bytes, in which high 4 bits are equal to low 4 bits. So all the bytes look as 00, 11, 22, ... FF. But I can't find the way to translate XX into 0X - and not sure that it should be so in the resulting 8bit pgm. I'm not familiar with Lua and had not programming practice for years, alas. I tried to build array as for 4bpp devices, but with different values; tried to read values byte by byte and divide them with math.floor by 16, but it won't work still.

I would appreciate your help, but I'll try to do it by myself. It's interesting task for me. Anyway, it's possible to make inverted screenshot and invert it with external tools - any raster graphics editor or something like imagemagick, it's not a big problem.
Yes, that 4bits duplicated in the high/low nibble of a byte is a hardware requirement.
Just set the high 4 bits to zero - the image is stored 4bits per byte.
knc1 is offline   Reply With Quote