From dfcd65c8f10aa94f19fe40940565681ab9a73e44 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Wed, 12 Mar 2014 00:52:17 -0400 Subject: trying to build a djvu decoder --- djvu.js/test_djvu.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 djvu.js/test_djvu.cpp (limited to 'djvu.js/test_djvu.cpp') diff --git a/djvu.js/test_djvu.cpp b/djvu.js/test_djvu.cpp new file mode 100644 index 0000000..5e09a64 --- /dev/null +++ b/djvu.js/test_djvu.cpp @@ -0,0 +1,19 @@ +#include +#include +#include +#include +#include + +int main(){ + int fh = open("image.jb2", O_RDONLY, 0); + int fh2 = open("image.pbm", O_WRONLY | O_CREAT, 0600); + GP gbs = ByteStream::create(fh, "r", true); + GP gbs2 = ByteStream::create(fh2, "w", true); + GP img = JB2Image::create(); + img->decode(gbs, 0, 0); + int w =img->get_width(); + int h = img->get_height(); + GP gbmp = img->get_bitmap(1, 1); + gbmp->save_pbm(*gbs2); + printf("taille est %d %d", w, h); +} -- cgit v1.2.3-70-g09d2