bbmp_utils
is a native library for working with BMP files.
It is written in POSIX C11 and its only dependency it the C stdlib. It has only been tested on amd64
, linux 5.1
and gcc 9.0
, though I see no reason why it shouldn't work on other architectures and/or POSIX systems (cross-compilation isn't yet supported by the build system but host-compilation should work).
As of now it includes:
- functionality for parsing metadata out of and writing it to BMP files
- a helper API for working with raw BMP image data
- userspace functions for editing raw bitmaps (e.g. a
rot90
function for rotating a pixelarray by 90 degrees in either direction) - optional python3 extension module for interacting with the library from within python
Development is done using meson
with the ninja
backend.
- Run
$ meson setup build_dbg -Dbuildtype=debug
(replacedebug
withrelease
if you wish to build a release build w/o debugging symbols and w/ optimizations) - Run
$ ninja -C build_dbg
to build the project - Run
# ninja -C build_dbg install
to install the library and the header files in the default location.
If you wish to not build the python extension module, pass -Dgen_py_bindings=false
to the initial meson setup
command.
If you're using the fish
shell, sourcing this file (e.g. $ source ./ali.fish
) will expose a few aliases for more convenient developing inside the shell:
b
: build the debug version of the projectrt
: run the default test application in the debug buildvrt
: run valgrind on the default test application in the debug buildg
: run GDB on the default test applicaiton in the debug build
The aliases are global (not universal) and live only in the current shell session.
Note that on linux, standard practice is to never install libraries w/ debugging symbols, so that should be avoided. (e.g. never install a build generated with meson setup build_* -Dbuildtype=debug
)
TODO:
- documentation
-
optimize the helper (internal representations of image data are horrendeously inefficient and memory hungry -- fix that) -
extend the parser with funtionality for easily modifying metadata of existing BMP files -
extend the build system to support more edge/use cases and installation
The BMP file format is thoroughly documented here.