From a27311a1e468ec0ea8205cc362dc69386675f704 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 8 Nov 2021 20:42:43 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libtracebitmap.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 libtracebitmap.h (limited to 'libtracebitmap.h') 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 +#include + +#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 -- cgit v1.2.3-70-g09d2