shithub: pdffs

ref: 23c3f961d78789878f39211fb6f1ac85697d4da1
dir: /f_jpx.c/

View raw version
#include <u.h>
#include <libc.h>
#include "pdf.h"

/* 7.4.9 JPXDecode filter */

static void *
memimage(Buffer *b)
{
	char *argv[] = {"jp2", nil};
	return buf2memimage(b, "/bin/jp2", argv);
}

static int
flreadall(void *aux, Buffer *bi, Buffer *bo)
{
	USED(aux);

	bufput(bo, bi->b, bi->sz);
	bi->off = bi->sz;
	bo->memimage = memimage;

	return 0;
}

Filter filterJPX = {
	.name = "JPXDecode",
	.readall = flreadall,
};