From f401289e371a76ff0dbaea40f7f94f7b85c4b2bd Mon Sep 17 00:00:00 2001 From: banana Date: Fri, 22 Mar 2024 13:52:05 -0700 Subject: Initial commit --- inc/num.h | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ inc/tga.h | 1 + inc/upc.h | 2 + 3 files changed, 163 insertions(+) create mode 100644 inc/num.h create mode 100644 inc/tga.h create mode 100644 inc/upc.h (limited to 'inc') diff --git a/inc/num.h b/inc/num.h new file mode 100644 index 0000000..7cd93d8 --- /dev/null +++ b/inc/num.h @@ -0,0 +1,160 @@ +const char NUMBER[10][16][8] = { 0, 0, 0, 0, 0, 0, 0, 0, // NUMBER 0 + 0, 0, 1, 1, 1, 1, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 0, 1, 1, 1, 0, + 0, 1, 1, 0, 1, 1, 1, 0, + 0, 1, 1, 1, 1, 1, 1, 0, + 0, 1, 1, 1, 1, 1, 1, 0, + 0, 1, 1, 1, 0, 1, 1, 0, + 0, 1, 1, 1, 0, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, // NUMBER 1 + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 1, 1, 1, 1, 0, 0, 0, + 0, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 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1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 0, 0, 1, 1, 0, + 0, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 1, 1, 0, + 0, 0, 0, 0, 0, 1, 1, 0, + 0, 0, 0, 0, 0, 1, 1, 0, + 0, 1, 1 ,0, 0, 1, 1, 0, + 0, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 }; diff --git a/inc/tga.h b/inc/tga.h new file mode 100644 index 0000000..4b449f4 --- /dev/null +++ b/inc/tga.h @@ -0,0 +1 @@ +void CreateTGA( char *filename, short width, short height, void *image ); diff --git a/inc/upc.h b/inc/upc.h new file mode 100644 index 0000000..fd0cf01 --- /dev/null +++ b/inc/upc.h @@ -0,0 +1,2 @@ +const char* create_upc_a( char *input ); +char upc_a_calculate_check_digit( char *digits ); -- cgit v1.2.3