Merge pull request #233 from hwhw/master

fix bugs in blitbuffer implementation, fix unit test spec
fix(test): move blend method call out of assignment
add(test): test blend method for Color4U and Color4L
Merge pull request #234 from koreader/houqp-master

fix blitbuffer unit tests
add setViewDimen API for crengine backend
Merge pull request #235 from koreader/chrox-master

add setViewDimen API for crengine backend
add image data validation when loading image data
Merge pull request #237 from koreader/chrox-master

add image data validation when loading image data
add wrappers for mupdf API that will handle exceptions

This will provide wrapper functions for mupdf functions that
might throw exceptions.

These wrapper functions will catch exceptions and instead return
a dedicated error value.

This error value could be NULL for functions that return pointers,
could be -1 for functions that return ints or could be anything else.

Note that in any case the functions will have a fz_context as their
first argument - indepedent of it is demanded by the mupdf API (in
most cases, it's the same for the mupdf API, but there are exceptions
to that rule).

As a convention, the wrapper functions start with "mupdf_" rather
than "fz_" or "pdf_" as per the original mupdf API.
use mupdf wrapper in mupdfbmp

Probably, we can do everything in mupdf.lua that is still being
done in mupdfbmp. For now, just switch to the wrapper API.
fix a bug in old mupdf Lua/C API

wrong return values for functions: The Lua/C interface expects
the functions to return the number of return values, which should
have been put onto the stack. That wasn't done here, so we return
0 in all cases.
pthread API declarations

TODO: check if this applies the same way to Android. Otherwise, split
this up conditionally on the system it runs on.
FFI-based interface for mupdf

This replaces the old Lua/C API for mupdf. It is a drop-in replacement
for the old API, i.e. the calls are the same for now.
test suite for the mupdf API

this ought to work for both the new FFI based interface and the old
Lua/C API based one.
remove old Lua/C based mupdf API
remove old mupdfimg wrapper

functionality is now included in the mupdf FFI API

Note that this will need slight modifications where the old interface
was used.