8#define ZEDMD_VERSION_MAJOR 0
9#define ZEDMD_VERSION_MINOR 7
10#define ZEDMD_VERSION_PATCH 0
12#define _ZEDMD_STR(x) #x
13#define ZEDMD_STR(x) _ZEDMD_STR(x)
15#define ZEDMD_VERSION \
16 ZEDMD_STR(ZEDMD_VERSION_MAJOR) \
17 "." ZEDMD_STR(ZEDMD_VERSION_MINOR) "." ZEDMD_STR(ZEDMD_VERSION_PATCH)
18#define ZEDMD_MINOR_VERSION ZEDMD_STR(ZEDMD_VERSION_MAJOR) "." ZEDMD_STR(ZEDMD_VERSION_MINOR)
20#define ZEDMD_MAX_WIDTH 256
21#define ZEDMD_MAX_HEIGHT 64
22#define ZEDMD_MAX_PALETTE 192
25#define ZEDMDAPI __declspec(dllexport)
26#define ZEDMDCALLBACK __stdcall
28#define ZEDMDAPI __attribute__((visibility("default")))
37typedef void(ZEDMDCALLBACK* ZeDMD_LogCallback)(
const char* format, va_list args,
const void* userData);
48 void SetLogCallback(ZeDMD_LogCallback callback,
const void* userData);
65 void IgnoreDevice(
const char*
const ignore_device);
75 void SetDevice(
const char*
const device);
100 bool Open(uint16_t width, uint16_t height);
116 bool OpenWiFi(
const char* ip,
int port);
144 void SetFrameSize(uint16_t width, uint16_t height);
152 uint16_t
const GetWidth();
160 uint16_t
const GetHeight();
182 void SetPalette(uint8_t* pPalette, uint8_t numColors);
193 void SetPalette(uint8_t* pPalette);
204 void SetDefaultPalette(uint8_t bitDepth);
213 uint8_t* GetDefaultPalette(uint8_t bitDepth);
243 void SetRGBOrder(uint8_t rgbOrder);
252 void SetBrightness(uint8_t brightness);
261 void SetWiFiSSID(
const char*
const ssid);
270 void SetWiFiPassword(
const char*
const password);
279 void SetWiFiPort(
int port);
302 void EnablePreDownscaling();
308 void DisablePreDownscaling();
316 void EnablePreUpscaling();
322 void DisablePreUpscaling();
336 void EnableUpscaling();
342 void DisableUpscaling();
362 void EnforceStreaming();
370 void DisableRGB24Streaming();
386 void RenderGray2(uint8_t* frame);
396 void RenderGray4(uint8_t* frame);
410 void RenderColoredGray6(uint8_t* frame, uint8_t* rotations);
426 void RenderColoredGray6(uint8_t* frame, uint8_t* palette, uint8_t* rotations);
436 void RenderRgb24(uint8_t* frame);
445 void RenderRgb24EncodedAs565(uint8_t* frame);
462 void RenderRgb565(uint16_t* frame);
474 bool UpdateFrameBuffer8(uint8_t* pFrame);
475 bool UpdateFrameBuffer24(uint8_t* pFrame);
476 bool UpdateFrameBuffer565(uint16_t* pFrame);
477 uint8_t GetScaleMode(uint16_t frameWidth, uint16_t frameHeight, uint16_t* pWidth, uint16_t* pHeight,
478 uint8_t* pXOffset, uint8_t* pYOffset);
479 int Scale(uint8_t* pScaledFrame, uint8_t* pFrame, uint8_t bytes, uint16_t* width, uint16_t* height);
480 int Scale16(uint8_t* pScaledFrame, uint16_t* pFrame, uint16_t* width, uint16_t* height,
bool bigEndian);
486 uint16_t m_romHeight;
491 bool m_downscaling =
false;
492 bool m_upscaling =
false;
493 bool m_streaming =
false;
494 bool m_rgb24Streaming =
true;
495 bool m_paletteChanged =
false;
497 uint8_t* m_pFrameBuffer;
498 uint8_t* m_pScaledFrameBuffer;
499 uint8_t* m_pCommandBuffer;
501 uint8_t* m_pRgb565Buffer;
503 uint8_t m_palette4[4 * 3] = {0};
504 uint8_t m_palette16[16 * 3] = {0};
505 uint8_t m_palette64[64 * 3] = {0};
506 uint8_t m_DmdDefaultPalette2Bit[12] = {0, 0, 0, 144, 34, 0, 192, 76, 0, 255, 127, 0};
507 uint8_t m_DmdDefaultPalette4Bit[48] = {0, 0, 0, 51, 25, 0, 64, 32, 0, 77, 38, 0, 89, 44, 0, 102,
508 51, 0, 115, 57, 0, 128, 64, 0, 140, 70, 0, 153, 76, 0, 166, 83,
509 0, 179, 89, 0, 191, 95, 0, 204, 102, 0, 230, 114, 0, 255, 127, 0};
517 extern ZEDMDAPI
ZeDMD* ZeDMD_GetInstance();
518 extern ZEDMDAPI
void ZeDMD_IgnoreDevice(
ZeDMD* pZeDMD,
const char*
const ignore_device);
519 extern ZEDMDAPI
void ZeDMD_SetDevice(
ZeDMD* pZeDMD,
const char*
const device);
520 extern ZEDMDAPI
bool ZeDMD_Open(
ZeDMD* pZeDMD);
521 extern ZEDMDAPI
bool ZeDMD_OpenWiFi(
ZeDMD* pZeDMD,
const char* ip,
int port);
522 extern ZEDMDAPI
void ZeDMD_Close(
ZeDMD* pZeDMD);
524 extern ZEDMDAPI
void ZeDMD_SetFrameSize(
ZeDMD* pZeDMD, uint16_t width, uint16_t height);
525 extern ZEDMDAPI
void ZeDMD_SetPalette(
ZeDMD* pZeDMD, uint8_t* pPalette, uint8_t numColors);
526 extern ZEDMDAPI
void ZeDMD_SetDefaultPalette(
ZeDMD* pZeDMD, uint8_t bitDepth);
527 extern ZEDMDAPI uint8_t* ZeDMD_GetDefaultPalette(
ZeDMD* pZeDMD, uint8_t bitDepth);
528 extern ZEDMDAPI
void ZeDMD_LedTest(
ZeDMD* pZeDMD);
529 extern ZEDMDAPI
void ZeDMD_EnableDebug(
ZeDMD* pZeDMD);
530 extern ZEDMDAPI
void ZeDMD_DisableDebug(
ZeDMD* pZeDMD);
531 extern ZEDMDAPI
void ZeDMD_SetRGBOrder(
ZeDMD* pZeDMD, uint8_t rgbOrder);
532 extern ZEDMDAPI
void ZeDMD_SetBrightness(
ZeDMD* pZeDMD, uint8_t brightness);
533 extern ZEDMDAPI
void ZeDMD_SaveSettings(
ZeDMD* pZeDMD);
534 extern ZEDMDAPI
void ZeDMD_EnablePreDownscaling(
ZeDMD* pZeDMD);
535 extern ZEDMDAPI
void ZeDMD_DisablePreDownscaling(
ZeDMD* pZeDMD);
536 extern ZEDMDAPI
void ZeDMD_EnablePreUpscaling(
ZeDMD* pZeDMD);
537 extern ZEDMDAPI
void ZeDMD_DisablePreUpscaling(
ZeDMD* pZeDMD);
538 extern ZEDMDAPI
void ZeDMD_EnableUpscaling(
ZeDMD* pZeDMD);
539 extern ZEDMDAPI
void ZeDMD_DisableUpscaling(
ZeDMD* pZeDMD);
540 extern ZEDMDAPI
void ZeDMD_SetWiFiSSID(
ZeDMD* pZeDMD,
const char*
const ssid);
541 extern ZEDMDAPI
void ZeDMD_SetWiFiPassword(
ZeDMD* pZeDMD,
const char*
const password);
542 extern ZEDMDAPI
void ZeDMD_SetWiFiPort(
ZeDMD* pZeDMD,
int port);
543 extern ZEDMDAPI
void ZeDMD_EnforceStreaming(
ZeDMD* pZeDMD);
545 extern ZEDMDAPI
void ZeDMD_ClearScreen(
ZeDMD* pZeDMD);
546 extern ZEDMDAPI
void ZeDMD_RenderGray2(
ZeDMD* pZeDMD, uint8_t* frame);
547 extern ZEDMDAPI
void ZeDMD_RenderGray4(
ZeDMD* pZeDMD, uint8_t* frame);
548 extern ZEDMDAPI
void ZeDMD_RenderColoredGray6(
ZeDMD* pZeDMD, uint8_t* frame, uint8_t* rotations);
549 extern ZEDMDAPI
void ZeDMD_RenderRgb24(
ZeDMD* pZeDMD, uint8_t* frame);
550 extern ZEDMDAPI
void ZeDMD_RenderRgb24EncodedAs565(
ZeDMD* pZeDMD, uint8_t* frame);
Definition: ZeDMDComm.h:92
Definition: ZeDMDWiFi.h:16
void RenderRgb16(uint16_t *frame)
Render a RGB16 frame.
Definition: ZeDMD.h:471
void RenderRgb24EncodedAs16(uint8_t *frame)
Render a RGB24 frame.
Definition: ZeDMD.h:454