No description
Find a file
2016-06-08 02:07:22 +02:00
examples Fix deprecation warning 2015-03-28 01:14:41 +01:00
src Initial commit 2015-01-23 02:56:21 +01:00
bpg.nimble Update nimble 2016-06-08 02:07:22 +02:00
libbpg.h.patch Initial commit 2015-01-23 02:56:21 +01:00
README.md Initial commit 2015-01-23 02:56:21 +01:00

BPG (Better Portable Graphics) for Nim

This is a Nim wrapper of libbpg. I'm using my own fork which creates a libbpg.so.

Usage

For a usage example see decode.nim. Since libbpg isn't included in most distributions we have to build it ourselves:

$ git clone https://github.com/def-/libbpg.git
$ cd libbpg
$ make -j4
$ cp libbpg.so ../nim-bpg
$ cd ../nim-bpg

After this is done we can comfortably use the wrapper:

$ nim c examples/decode
$ examples/decode examples/lena512color.bpg
$ gimp out.ppm

Recreating the wrapper

To recreate the wrapper for new libbpg versions with a changed interface:

$ patch -p1 < libbpg.h.patch
patching file libbpg.h
$ c2nim -o:bpg.nim libbpg.h
Hint: operation successful (155 lines compiled; 0 sec total; 516.528KB) [SuccessX]

No manual interaction should be necessary.