mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 02:04:36 +01:00
DATATYPE_IMG_G5
This commit is contained in:
@@ -289,13 +289,8 @@ void drawNew(const uint8_t mac[8], tagRecord *&taginfo) {
|
||||
imageParams.dataType = DATATYPE_IMG_ZLIB;
|
||||
Serial.println("datatype: DATATYPE_IMG_ZLIB");
|
||||
} else if (imageParams.g5) {
|
||||
if (imageParams.hasRed) {
|
||||
imageParams.dataType = DATATYPE_IMG_G5_2BPP;
|
||||
Serial.println("datatype: DATATYPE_IMG_G5_2BPP");
|
||||
} else {
|
||||
imageParams.dataType = DATATYPE_IMG_G5_1BPP;
|
||||
Serial.println("datatype: DATATYPE_IMG_G5_1BPP");
|
||||
}
|
||||
imageParams.dataType = DATATYPE_IMG_G5;
|
||||
Serial.println("datatype: DATATYPE_IMG_G5");
|
||||
} else if (imageParams.hasRed) {
|
||||
imageParams.dataType = DATATYPE_IMG_RAW_2BPP;
|
||||
Serial.println("datatype: DATATYPE_IMG_RAW_2BPP");
|
||||
@@ -580,13 +575,8 @@ bool updateTagImage(String &filename, const uint8_t *dst, uint16_t nextCheckin,
|
||||
imageParams.dataType = DATATYPE_IMG_ZLIB;
|
||||
Serial.println("datatype: DATATYPE_IMG_ZLIB");
|
||||
} else if (imageParams.g5) {
|
||||
if (imageParams.hasRed) {
|
||||
imageParams.dataType = DATATYPE_IMG_G5_2BPP;
|
||||
Serial.println("datatype: DATATYPE_IMG_G5_2BPP");
|
||||
} else {
|
||||
imageParams.dataType = DATATYPE_IMG_G5_1BPP;
|
||||
Serial.println("datatype: DATATYPE_IMG_G5_1BPP");
|
||||
}
|
||||
imageParams.dataType = DATATYPE_IMG_G5;
|
||||
Serial.println("datatype: DATATYPE_IMG_G5");
|
||||
} else if (imageParams.hasRed) {
|
||||
imageParams.dataType = DATATYPE_IMG_RAW_2BPP;
|
||||
Serial.println("datatype: DATATYPE_IMG_RAW_2BPP");
|
||||
|
||||
@@ -274,8 +274,7 @@ void prepareExternalDataAvail(struct pendingData* pending, IPAddress remoteIP) {
|
||||
case DATATYPE_IMG_ZLIB:
|
||||
case DATATYPE_IMG_RAW_1BPP:
|
||||
case DATATYPE_IMG_RAW_2BPP:
|
||||
case DATATYPE_IMG_G5_1BPP:
|
||||
case DATATYPE_IMG_G5_2BPP:
|
||||
case DATATYPE_IMG_G5:
|
||||
case DATATYPE_IMG_RAW_3BPP: {
|
||||
char hexmac[17];
|
||||
mac2hex(pending->targetMac, hexmac);
|
||||
@@ -448,7 +447,7 @@ void processXferComplete(struct espXferComplete* xfc, bool local) {
|
||||
contentFS->remove(dst_path);
|
||||
}
|
||||
if (contentFS->exists(queueItem->filename)) {
|
||||
if (config.preview && (queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_3BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_G5_1BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_G5_2BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_ZLIB)) {
|
||||
if (config.preview && (queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_3BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_G5 || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_ZLIB)) {
|
||||
contentFS->rename(queueItem->filename, String(dst_path));
|
||||
} else {
|
||||
if (queueItem->pendingdata.availdatainfo.dataType != DATATYPE_FW_UPDATE) contentFS->remove(queueItem->filename);
|
||||
@@ -969,7 +968,7 @@ bool queueDataAvail(struct pendingData* pending, bool local) {
|
||||
}
|
||||
newPending.len = taginfo->len;
|
||||
|
||||
if ((pending->availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || pending->availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || pending->availdatainfo.dataType == DATATYPE_IMG_RAW_3BPP || pending->availdatainfo.dataType == DATATYPE_IMG_ZLIB || pending->availdatainfo.dataType == DATATYPE_IMG_G5_1BPP || pending->availdatainfo.dataType == DATATYPE_IMG_G5_2BPP) && (pending->availdatainfo.dataTypeArgument & 0xF8) == 0x00) {
|
||||
if ((pending->availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || pending->availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || pending->availdatainfo.dataType == DATATYPE_IMG_RAW_3BPP || pending->availdatainfo.dataType == DATATYPE_IMG_ZLIB || pending->availdatainfo.dataType == DATATYPE_IMG_G5) && (pending->availdatainfo.dataTypeArgument & 0xF8) == 0x00) {
|
||||
// in case of an image (no preload), remove already queued images
|
||||
pendingQueue.erase(std::remove_if(pendingQueue.begin(), pendingQueue.end(),
|
||||
[pending](const PendingItem& item) {
|
||||
|
||||
@@ -122,8 +122,7 @@
|
||||
// [uint32_t uncompressed size][2 byte zlib header][zlib compressed image]
|
||||
// image format: [uint8_t header length][uint16_t width][uint16_t height][uint8_t bpp (lower 4)][img data]
|
||||
|
||||
#define DATATYPE_IMG_G5_1BPP 0x31 // G5 compressed 1BPP
|
||||
#define DATATYPE_IMG_G5_2BPP 0x32 // G5 compressed 2BPP
|
||||
#define DATATYPE_IMG_G5 0x31 // G5 compressed 1BPP
|
||||
|
||||
#define DATATYPE_UK_SEGMENTED 0x51 // Segmented data for the UK Segmented display type (contained in availableData Reply)
|
||||
#define DATATYPE_EU_SEGMENTED 0x52 // Segmented data for the EU/DE Segmented display type (contained in availableData Reply)
|
||||
|
||||
Reference in New Issue
Block a user