]> git.sesse.net Git - qscale/commitdiff
Drew up a first API for libqscale.
authorsgunderson@bigfoot.com <>
Wed, 28 May 2008 18:37:29 +0000 (11:37 -0700)
committersgunderson@bigfoot.com <>
Wed, 28 May 2008 18:37:29 +0000 (11:37 -0700)
libqscale.h [new file with mode: 0644]

diff --git a/libqscale.h b/libqscale.h
new file mode 100644 (file)
index 0000000..14cc2d0
--- /dev/null
@@ -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) */