Add simple test-transform program
diff --git a/Makefile b/Makefile
index 5e4e6af..32e6991 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@
QCMS_SRC=iccread.c transform.c matrix.c chain.c transform_util.c transform-sse2.c transform-sse1.c
QCMS_OBJS=iccread.o transform.o matrix.o chain.o transform_util.o transform-sse2.o transform-sse1.o
-PROGRAMS=profile-gen test test-invalid dump-profile div-test coverage malloc-fail invalid-coverage
+PROGRAMS=profile-gen test test-invalid test-transform dump-profile div-test coverage malloc-fail invalid-coverage
# I don't know a good way to get the exit code of pkg-config into a make variable
HAS_LCMS:=$(shell pkg-config --exists lcms; echo $$?)
diff --git a/test-transform.c b/test-transform.c
new file mode 100644
index 0000000..611cabc
--- /dev/null
+++ b/test-transform.c
@@ -0,0 +1,37 @@
+#include <stdlib.h>
+#include <time.h>
+#include "sum.h"
+#include "lcms.h"
+#include "qcms.h"
+
+int main(int argc, char **argv)
+{
+ char *input_path = argv[1];
+ char *output_path = argv[2];
+
+ qcms_profile *input_profile, *output_profile;
+ qcms_transform *transform;
+#define LENGTH (256*256*256)
+ static unsigned char src[LENGTH*3];
+ static unsigned char qoutput[LENGTH*3];
+
+ int i,j,k,l=0;
+ for (i=0; i<256; i++) {
+ for (j=0; j<256; j++) {
+ for (k=0; k<256; k++) {
+ src[l++] = i;
+ src[l++] = j;
+ src[l++] = k;
+ }
+ }
+ }
+ input_profile = qcms_profile_from_path(input_path);
+ output_profile = qcms_profile_from_path(output_path);
+ qcms_profile_precache_output_transform(output_profile);
+
+ transform = qcms_transform_create(input_profile, QCMS_DATA_RGB_8, output_profile, QCMS_DATA_RGB_8, QCMS_INTENT_PERCEPTUAL);
+ qcms_transform_data(transform, src, qoutput, LENGTH);
+ qcms_profile_release(input_profile);
+ qcms_profile_release(output_profile);
+ return 0;
+}