From 9d4e31b01beeb809d78cc19b34d8108ead9895d0 Mon Sep 17 00:00:00 2001 From: Jelmer Date: Wed, 4 Dec 2024 00:48:21 +0100 Subject: [PATCH] Added G5 to M2 (zbs243) tag types --- ESP32_AP-Flasher/src/g5/Group5.cpp.tmp | 46 -------------------------- ESP32_AP-Flasher/src/g5/Group5.h | 4 +++ resources/tagtypes/03.json | 1 + resources/tagtypes/04.json | 1 + resources/tagtypes/11.json | 1 + resources/tagtypes/12.json | 1 + resources/tagtypes/22.json | 1 + resources/tagtypes/27.json | 1 + 8 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 ESP32_AP-Flasher/src/g5/Group5.cpp.tmp diff --git a/ESP32_AP-Flasher/src/g5/Group5.cpp.tmp b/ESP32_AP-Flasher/src/g5/Group5.cpp.tmp deleted file mode 100644 index a37c1793..00000000 --- a/ESP32_AP-Flasher/src/g5/Group5.cpp.tmp +++ /dev/null @@ -1,46 +0,0 @@ -#include "g5enc.inl" -#include "g5dec.inl" -// -// Group5 1-bit image compression library -// Written by Larry Bank -// Copyright (c) 2024 BitBank Software, Inc. -// -// Use of this software is governed by the Business Source License -// included in the file ./LICENSE. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// ./APL.txt. - -// -// Decoder C++ wrapper functions -// -int G5DECODER::init(int iWidth, int iHeight, uint8_t *pData, int iDataSize) -{ - return g5_decode_init(&_g5dec, iWidth, iHeight, pData, iDataSize); -} /* init() */ - -int G5DECODER::decodeLine(uint8_t *pOut) -{ - return g5_decode_line(&_g5dec, pOut); -} /* decodeLine() */ - -// -// Encoder C++ wrapper functions -// -int G5ENCODER::init(int iWidth, int iHeight, uint8_t *pOut, int iOutSize) -{ - return g5_encode_init(&_g5enc, iWidth, iHeight, pOut, iOutSize); -} /* init() */ - -int G5ENCODER::encodeLine(uint8_t *pPixels) -{ - return g5_encode_encodeLine(&_g5enc, pPixels); -} /* encodeLine() */ - -int G5ENCODER::size() -{ - return g5_encode_getOutSize(&_g5enc); -} /* size() */ - diff --git a/ESP32_AP-Flasher/src/g5/Group5.h b/ESP32_AP-Flasher/src/g5/Group5.h index 7641ea45..fe6c5f1a 100644 --- a/ESP32_AP-Flasher/src/g5/Group5.h +++ b/ESP32_AP-Flasher/src/g5/Group5.h @@ -43,6 +43,10 @@ // a maximum of 7 color changes // You can define this in your compiler macros to override the default vlaue // + + +#define MAX_IMAGE_FLIPS 640 + #ifndef MAX_IMAGE_FLIPS #ifdef __AVR__ #define MAX_IMAGE_FLIPS 32 diff --git a/resources/tagtypes/03.json b/resources/tagtypes/03.json index ee6ffa6d..3ffa7235 100644 --- a/resources/tagtypes/03.json +++ b/resources/tagtypes/03.json @@ -10,6 +10,7 @@ "black": [ 0, 0, 0 ], "red": [ 255, 0, 0 ] }, + "g5_compression": "29", "shortlut": 2, "options": [ "button", "customlut" ], "contentids": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 19, 20, 21, 22, 23, 27 ], diff --git a/resources/tagtypes/04.json b/resources/tagtypes/04.json index f96131f4..f153e8e6 100644 --- a/resources/tagtypes/04.json +++ b/resources/tagtypes/04.json @@ -10,6 +10,7 @@ "black": [ 0, 0, 0 ], "red": [ 255, 0, 0 ] }, + "g5_compression": "29", "shortlut": 2, "options": [ "button", "customlut" ], "contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 27 ], diff --git a/resources/tagtypes/11.json b/resources/tagtypes/11.json index 96aa3051..9eeca64e 100644 --- a/resources/tagtypes/11.json +++ b/resources/tagtypes/11.json @@ -10,6 +10,7 @@ "black": [ 0, 0, 0 ], "red": [ 255, 0, 0 ] }, + "g5_compression": "29", "shortlut": 0, "options": [ "button" ], "contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 27 ], diff --git a/resources/tagtypes/12.json b/resources/tagtypes/12.json index 81df6747..b17f0d4b 100644 --- a/resources/tagtypes/12.json +++ b/resources/tagtypes/12.json @@ -10,6 +10,7 @@ "black": [ 0, 0, 0 ], "red": [ 255, 0, 0 ] }, + "g5_compression": "29", "shortlut": 1, "options": [ "button" ], "contentids": [ 22, 23, 1, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20, 27 ], diff --git a/resources/tagtypes/22.json b/resources/tagtypes/22.json index dd7bcb77..357f5127 100644 --- a/resources/tagtypes/22.json +++ b/resources/tagtypes/22.json @@ -10,6 +10,7 @@ "black": [ 0, 0, 0 ], "red": [ 255, 0, 0 ] }, + "g5_compression": "29", "shortlut": 0, "options": [ "button" ], "contentids": [ 0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20 ], diff --git a/resources/tagtypes/27.json b/resources/tagtypes/27.json index 2fb9f78e..27419338 100644 --- a/resources/tagtypes/27.json +++ b/resources/tagtypes/27.json @@ -9,6 +9,7 @@ "white": [ 255, 255, 255 ], "black": [ 0, 0, 0 ] }, + "g5_compression": "29", "highlight_color": 5, "shortlut": 0, "options": [ "button", "customlut" ],