From 5d571e1553d42b28f69d860c1877f237e1a39195 Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Wed, 28 May 2008 11:37:29 -0700 Subject: [PATCH] Drew up a first API for libqscale. --- libqscale.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 libqscale.h diff --git a/libqscale.h b/libqscale.h new file mode 100644 index 0000000..14cc2d0 --- /dev/null +++ b/libqscale.h @@ -0,0 +1,29 @@ +#ifndef _LIBQSCALE_H +#define _LIBQSCALE_H + +#include "jpeglib.h" + +typedef struct { + /* True image size */ + int width, height; + + /* Component image sizes (possibly subsampled) */ + int w0, h0; + int w1, h1; + int w2, h2; + + /* The data itself */ + JSAMPLE *data_y, *data_cb, *data_cr; +} qscale_img; + +enum qscale_scaling_filter { + LANCZOS = 0, +}; + +qscale_img *qscale_load_jpeg(const char *filename); +int qscale_save_jpeg(const qscale_img *image, const char *filename); + +qscale_img *qscale_scale(qscale_img *source, int width, int height, int samp_h0, int samp_v0, int samp_h1, int samp_v1, int samp_h2, int samp_v2); +void qscale_destroy(qscale_img *image); + +#endif /* !defined(_LIBQSCALE_H) */ -- 2.39.2