diff options
author | Julian T <julian@jtle.dk> | 2020-07-16 21:49:05 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-07-16 21:49:05 +0200 |
commit | 3a4b55c20ac040ace53aba5f2715b9c080bea17f (patch) | |
tree | 9acbfd74f93fc011329a40dd0a4dc5213fadec3e /pixelsort.h |
Initial working pixelsorter
Diffstat (limited to 'pixelsort.h')
-rw-r--r-- | pixelsort.h | 37 |
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 |