use more precise RGB to gray conversion

we use this:
gray8 = rshift(4897*red + 9617*green + 1868*blue, 14)
Merge pull request #93 from hwhw/blitbuffer-conversion

use more precise RGB to gray conversion
add back missed sample jpg file for unit test
fix: convert emulator dimension from string to number

* also add comment in blitbuffer module
Merge pull request #94 from houqp/houqp-master

convert emulator dimension from string to number
add FFI linux framebuffer interface
Merge remote-tracking branch 'upstream/master' into ffi-framebuffer-native
remove RGB16

we won't likely use it, it is full of bitops, thus pretty slow
fix accidentally deleted types
one type deleted that really is gone now
bugfix for value setting
factor out POSIX API
blitbuffer with much more optimized blitting

this introduces the ability to implement n:m bpp optimized blitting.
This allows for a major speedup. Comes with implementation especially
for from/to 4bpp blitbuffer blitting.
use blitbuffer API for conversion

now that blitbuffer API for A8 format exists, we can use the output
of mupdf directly.
adapt blitbuffer API test to deletion of RGB16 format

RGB16 was dropped since it won't likely be used. Reflect this by
removing the according test routine.
Merge branch 'blitbuffer-optimization' into ffi-framebuffer-native
fix for rotation modes

4bpp handling was a bit adapted so rotated 4bpp can now be handled easier
remove test function from blitbuffer.lua

tests are now in our test suite
Add FFI implementation of drawcontext

Drawcontext was a bunch of accessor methods to a C struct.
We can do this easily with FFI.
Switch method to get drawcontext struct pointers from Lua

This change is backwards compatible - it will still work for the old
way of passing Lua userdata objects.