aboutsummaryrefslogtreecommitdiffstats
path: root/libtracebitmap.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-11-08 20:42:43 +0100
committerMattias Andrée <maandree@kth.se>2021-11-08 20:42:43 +0100
commita27311a1e468ec0ea8205cc362dc69386675f704 (patch)
treeeaf006b7660c98025af5302b8df331fb015e2695 /libtracebitmap.h
downloadlibtracebitmap-a27311a1e468ec0ea8205cc362dc69386675f704.tar.gz
libtracebitmap-a27311a1e468ec0ea8205cc362dc69386675f704.tar.bz2
libtracebitmap-a27311a1e468ec0ea8205cc362dc69386675f704.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libtracebitmap.h')
-rw-r--r--libtracebitmap.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/libtracebitmap.h b/libtracebitmap.h
new file mode 100644
index 0000000..1f8b13e
--- /dev/null
+++ b/libtracebitmap.h
@@ -0,0 +1,25 @@
+/* See LICENSE file for copyright and license details. */
+#ifndef LIBTRACEBITMAP_H
+#define LIBTRACEBITMAP_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#define LIBTRACEBITMAP_INK_OFF 0
+#define LIBTRACEBITMAP_INK_ON 1
+/* Other values in (struct libtracebitmap_bitmap).image invoke undefined behaviour */
+
+struct libtracebitmap_bitmap {
+ size_t height;
+ size_t width;
+ uint8_t *image; /* (uint8_t [.height][.width]) */
+};
+
+int libtracebitmap_trace(
+ struct libtracebitmap_bitmap *bitmap, /* image will be erased, but not deallocated */
+ int (*new_component)(int negative, void *user_data),
+ int (*new_stop)(size_t y, size_t x, void *user_data),
+ int (*component_finished)(void *user_data),
+ void *user_data);
+
+#endif