Provide the correct JPG RGB565 for EVE2 display in Linux

I'm using this library with a NHD-7.0-800480FT-CSXV-CTP display on an ESP32-S3.

Since the AssetBuilder is available for Windows only, I'm trying to prepare the images on Ubuntu.

As first try, I have a small PNG image 57*60 pixel.
Using GIMP I exported it as "C code"with the format RGB565, then I changed the source file to meet the required one. My files are:

logo_small_57x60.h

#ifndef LOGO_SMALL_57X60_H
#define LOGO_SMALL_57X60_H

#include <stdint.h>

#if !defined(PROGMEM)
    #define PROGMEM
#endif

extern const uint8_t LOGO_SMALL[6841] PROGMEM;

#endif // LOGO_SMALL_57X60_H

logo_small_57x60.c

#include "logo_small_57x60_ARGB2.h"

const uint8_t LOGO_SMALL[6841] = {
  "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
  "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004!\014c,c\206\061\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
  "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
  "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
  "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\206\061mk\216s\216s\216s\206\061\000\000\000"
//...
};

here how I use these data:

#define MEM_LOGO 0x000f8000

// ...

EVE_init_spi();
EVE_init();
EVE_cmd_loadimage(MEM_LOGO, 0, LOGO_SMALL, sizeof(LOGO_SMALL));

// ...

EVE_cmd_dl(CMD_DLSTART); 
EVE_cmd_dl(DL_CLEAR_COLOR_RGB | COLOR_WHITE); 
EVE_cmd_dl(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG); 
EVE_cmd_dl(DL_TAG);
EVE_color_rgb(COLOR_WHITE);
EVE_cmd_dl(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_setbitmap(MEM_LOGO, EVE_RGB565, 57, 60);
EVE_cmd_dl(VERTEX2F(200 * 16, 200 * 16));
EVE_cmd_dl(DL_END);
EVE_cmd_dl(DL_DISPLAY);
EVE_cmd_dl(CMD_SWAP);
EVE_execute_cmd();

but no picture is displayed on the screen.
The display is working, as I have other stuff and it is displayed correctly.
Also, if I use the AssetBuilder the picture is shown, I'm just trying to provide the correct jpg format using my Linux dev machine.

You have a lot of stray characters in your bitmap, as well, you should replace all the slashes and quotes with commas.

1 Like

Ah ok, I thought the stray characters were allowed (like \n or \r) otherwise why GIMP would output such a "C" code? If I replace the quotes with commas I create a integer array. Is it not the same as a binary string?

Example, I thought that:

char array1[2] = { 13, 10 };

was the same of:

char array2[2] = "\r\n";

in fact:

printf("%d,%d", array2[0], array2[1]);

outputs:

13,10

what am I not understanding?

There is no (\r\n) in bitmap. You are enabling a pixel (0, 1) and maybe coloring it (256,256,256).

Check an EVE2 example.

1 Like

\n\r was just an example to say I can initialize an array using integers of escape (stray?) characters in hex or octal base. And, yes, in the binary data I can have \n (10) or \r (13). Of course they have not the meaning of carriage return or new line, but only the same value.