aboutsummaryrefslogtreecommitdiff
path: root/pixelsort.h
diff options
context:
space:
mode:
Diffstat (limited to 'pixelsort.h')
-rw-r--r--pixelsort.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/pixelsort.h b/pixelsort.h
new file mode 100644
index 0000000..4e6dcd0
--- /dev/null
+++ b/pixelsort.h
@@ -0,0 +1,37 @@
+#ifndef PXLSORT_H
+#define PXLSORT_H
+
+#include <FreeImage.h>
+#include <stdbool.h>
+
+#define BPP 3
+#define ANGLE_HORI 0
+#define ANGLE_VERT 90
+
+typedef struct context {
+ // Image variables
+ unsigned width;
+ unsigned height;
+
+ unsigned angle;
+
+ // Threshold variables
+ int upper;
+ int lower;
+ char *dirs;
+
+ // Functions
+ bool (*check_color)(struct context *ctx, BYTE *line);
+ BYTE *(*index_color)(struct context *ctx, BYTE *line, unsigned index);
+} context_t;
+
+// Interval functions
+bool checkThreshold(struct context *ctx, BYTE *color);
+
+// Nextcolor functions
+BYTE *indexcolor_horizontal(struct context *ctx, BYTE *line, unsigned index);
+BYTE *indexcolor_vertical(struct context *ctx, BYTE *line, unsigned index);
+
+int pixelsort(context_t *ctx, FIBITMAP *img);
+
+#endif