shithub: pdffs

ref: b574ea6ce2f6fb2aa129da26687d4affeb1faabc
dir: /f_dct.c/

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

/* 7.4.8 DCTDecode filter */

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

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

	/* FIXME not doing anything about ColorTransform here? */

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

	return 0;
}

Filter filterDCT = {
	.name = "DCTDecode",
	.readall = flreadall,
};