libzedmd
|
Public Member Functions | |
void | SetLogCallback (ZeDMD_LogCallback callback, const void *userData) |
void | IgnoreDevice (const char *const ignore_device) |
Ignore a serial device when searching for ZeDMD. More... | |
void | SetDevice (const char *const device) |
Use a specific serial device for ZeDMD. More... | |
bool | Open () |
Open the connection to ZeDMD. More... | |
bool | Open (uint16_t width, uint16_t height) |
Open the connection to ZeDMD. More... | |
bool | OpenWiFi (const char *ip, int port) |
Open a WiFi connection to ZeDMD. More... | |
void | Close () |
Close connection to ZeDMD. More... | |
void | Reset () |
Reset ZeDMD. More... | |
void | SetFrameSize (uint16_t width, uint16_t height) |
Set the frame size. More... | |
uint16_t const | GetWidth () |
Get the physical panel width. More... | |
uint16_t const | GetHeight () |
Get the physical panel height. More... | |
bool const | IsS3 () |
Does ZeDMD run on an ESP32 S3? More... | |
void | SetPalette (uint8_t *pPalette, uint8_t numColors) |
Set the palette. More... | |
void | SetPalette (uint8_t *pPalette) |
Set the 4 color palette. More... | |
void | SetDefaultPalette (uint8_t bitDepth) |
Set the default palette. More... | |
uint8_t * | GetDefaultPalette (uint8_t bitDepth) |
Get the default palette. More... | |
void | LedTest () |
Test the panels attached to ZeDMD. More... | |
void | EnableDebug () |
Enable debug mode. More... | |
void | DisableDebug () |
Disable debug mode. More... | |
void | SetRGBOrder (uint8_t rgbOrder) |
Set the RGB order. More... | |
void | SetBrightness (uint8_t brightness) |
Set the brightness. More... | |
void | SetWiFiSSID (const char *const ssid) |
Set the WiFi SSID. More... | |
void | SetWiFiPassword (const char *const password) |
Set the WiFi Password. More... | |
void | SetWiFiPort (int port) |
Set the WiFi Port. More... | |
void | SaveSettings () |
Save the current setting. More... | |
void | EnablePreDownscaling () |
Enable downscaling on the client side. More... | |
void | DisablePreDownscaling () |
Disable downscaling on the client side. More... | |
void | EnablePreUpscaling () |
Enable upscaling on the client side. More... | |
void | DisablePreUpscaling () |
Disable downscaling on the client side. More... | |
void | EnableUpscaling () |
Enable upscaling on ZeDMD itself. More... | |
void | DisableUpscaling () |
Disable upscaling on ZeDMD itself. More... | |
void | EnforceStreaming () |
Enforce zone streaming. More... | |
void | DisableRGB24Streaming () |
Disable zone streaming for RGB24. More... | |
void | ClearScreen () |
Clear the screen. More... | |
void | RenderGray2 (uint8_t *frame) |
Render a 2 bit gray scaled frame. More... | |
void | RenderGray4 (uint8_t *frame) |
Render a 4 bit gray scaled frame. More... | |
void | RenderColoredGray6 (uint8_t *frame, uint8_t *rotations) |
Render a 6 bit frame. More... | |
void | RenderColoredGray6 (uint8_t *frame, uint8_t *palette, uint8_t *rotations) |
Render a 6 bit frame. More... | |
void | RenderRgb24 (uint8_t *frame) |
Render a RGB24 frame. More... | |
void | RenderRgb24EncodedAs565 (uint8_t *frame) |
Render a RGB24 frame. More... | |
void | RenderRgb24EncodedAs16 (uint8_t *frame) |
Render a RGB24 frame. More... | |
void | RenderRgb565 (uint16_t *frame) |
Render a RGB565 frame. More... | |
void | RenderRgb16 (uint16_t *frame) |
Render a RGB16 frame. More... | |
void ZeDMD::ClearScreen | ( | ) |
Clear the screen.
Turn off all pixels of ZeDMD, so a blank black screen will be shown.
void ZeDMD::DisableDebug | ( | ) |
Disable debug mode.
void ZeDMD::DisablePreDownscaling | ( | ) |
Disable downscaling on the client side.
void ZeDMD::DisablePreUpscaling | ( | ) |
Disable downscaling on the client side.
void ZeDMD::DisableRGB24Streaming | ( | ) |
Disable zone streaming for RGB24.
By default, "zone streaming" is used for RenderRgb24(). That could be turned off using this function.
void ZeDMD::DisableUpscaling | ( | ) |
Disable upscaling on ZeDMD itself.
void ZeDMD::EnableDebug | ( | ) |
Enable debug mode.
ZeDMD will display various debug information as overlay to the displayed frame.
void ZeDMD::EnablePreDownscaling | ( | ) |
void ZeDMD::EnablePreUpscaling | ( | ) |
void ZeDMD::EnableUpscaling | ( | ) |
Enable upscaling on ZeDMD itself.
If enabled and required, the content will centered and scaled up to fit into the physical dimensions of the ZeDMD panels by ZeDMD itself. Compared to EnablePreUpscaling(), less data needs to be send to ZeDMD and this might resut in a higher frame rate. But this optimized variant won't work with zone streaming modes.
void ZeDMD::EnforceStreaming | ( | ) |
Enforce zone streaming.
ZeDMD has two different render modes. One renders entire frames. This is the classic way and works pretty well. The other one is "zone streaming" which will be enable by this function. Zone streaming divides a frame into rectangular zones and only updates zones that have changes compared to the previous frame. This method results in less data that needs to be transfered and in smoother animations. But it takes a bit longer if the entire frame changes. Zone streaming is the default for RenderRGB24() and RenderRgb24EncodedAs565(). All other modes use the classic way by default unless EnforceStreaming() is called.
uint8_t * ZeDMD::GetDefaultPalette | ( | uint8_t | bitDepth | ) |
Get the default palette.
Get the values of a default palette of shades of orange.
bitDepth | the bit depth, 2 means 4 colors, 4 means 16 colors |
uint16_t const ZeDMD::GetHeight | ( | ) |
Get the physical panel height.
Get the height of the physical dimensions of the LED panels.
uint16_t const ZeDMD::GetWidth | ( | ) |
Get the physical panel width.
Get the width of the physical dimensions of the LED panels.
void ZeDMD::IgnoreDevice | ( | const char *const | ignore_device | ) |
Ignore a serial device when searching for ZeDMD.
While searching for a ZeDMD any serial ports are tested. This could cause trouble with other devices attached via USB or serial ports. Using this mfunction, a serial device could be excluded from the scan. This function could be called multiple times to ignore multiple devices. Another option to limit the searching is to use SetDevice().
ignore_device | the device to ignore |
bool const ZeDMD::IsS3 | ( | ) |
Does ZeDMD run on an ESP32 S3?
On an ESP32 S3 a native USB connection is used to increase the bandwidth. Furthermore double buffering is active.
void ZeDMD::LedTest | ( | ) |
Test the panels attached to ZeDMD.
Renders a sequence of full red, full green and full blue frames.
bool ZeDMD::Open | ( | ) |
Open the connection to ZeDMD.
Open a cennection to ZeDMD. Therefore all serial ports will be scanned. Use IgnoreDevice() to exclude one or more specific serial devices during that scan. Use SetDevice() to omit the the scan and to use a specific seriel device instead.
bool ZeDMD::Open | ( | uint16_t | width, |
uint16_t | height | ||
) |
Open the connection to ZeDMD.
Backward compatibiility version of Open() which additionally sets the frame size. Use Open() and SetFrameSize() instead.
width | the frame width |
height | the frame height |
bool ZeDMD::OpenWiFi | ( | const char * | ip, |
int | port | ||
) |
void ZeDMD::RenderColoredGray6 | ( | uint8_t * | frame, |
uint8_t * | palette, | ||
uint8_t * | rotations | ||
) |
Render a 6 bit frame.
Renders a 6 bit(indexed) frame using 64 colors. In oposite to standrad RenderColoredGray6(), the colors will not be used from the current palette set via SetPalette() but form the one provided to this function. ZeDMD is able to rotate parts of the palette natively as defined by the Serum format until the next frame is received.
frame | the indexed frame |
palette | the colors to use |
rotations | optional rotation command array according to the Serum format |
void ZeDMD::RenderColoredGray6 | ( | uint8_t * | frame, |
uint8_t * | rotations | ||
) |
Render a 6 bit frame.
Renders a 6 bit(indexed) frame using 64 colors. The colors will be used from the current palette set via SetPalette(). ZeDMD is able to rotate parts of the palette natively as defined by the Serum format until the next frame is received.
frame | the indexed frame |
rotations | optional rotation command array according to the Serum format |
void ZeDMD::RenderGray2 | ( | uint8_t * | frame | ) |
Render a 2 bit gray scaled frame.
Renders a 2 bit gray scaled (indexed) frame using 4 colors. The colors will be used from the current palette set via SetPalette().
frame | the indexed frame |
void ZeDMD::RenderGray4 | ( | uint8_t * | frame | ) |
Render a 4 bit gray scaled frame.
Renders a 4 bit gray scaled (indexed) frame using 16 colors. The colors will be used from the current palette set via SetPalette().
frame | the indexed frame |
|
inline |
Render a RGB16 frame.
Renders a true color RGB16 frame. Only zone streaming mode is supported. In fact, RGB16 is just another name for RGB565.
frame | the RGB16 frame |
void ZeDMD::RenderRgb24 | ( | uint8_t * | frame | ) |
Render a RGB24 frame.
Renders a true color RGB frame. By default the zone streaming mode is used. The encoding is RGB888.
frame | the RGB frame |
|
inline |
Render a RGB24 frame.
Renders a true color RGB frame. Only zone streaming mode is supported. The encoding is RGB16. In fact, RGB16 is just another name for RGB565.
frame | the RGB frame |
void ZeDMD::RenderRgb24EncodedAs565 | ( | uint8_t * | frame | ) |
Render a RGB24 frame.
Renders a true color RGB frame. Only zone streaming mode is supported. The encoding is RGB565.
frame | the RGB frame |
void ZeDMD::RenderRgb565 | ( | uint16_t * | frame | ) |
Render a RGB565 frame.
Renders a true color RGB565 frame. Only zone streaming mode is supported.
frame | the RGB565 frame |
void ZeDMD::SaveSettings | ( | ) |
Save the current setting.
Saves all current setting within ZeDMD's EEPROM to be used as defualt at its next start.
brightness | a value between 0 and 15 |
void ZeDMD::SetBrightness | ( | uint8_t | brightness | ) |
Set the brightness.
Set the brightness of the LED panels.
brightness | a value between 0 and 15 |
void ZeDMD::SetDefaultPalette | ( | uint8_t | bitDepth | ) |
Set the default palette.
Use a default palette of shades of orange to render gray scaled content.
bitDepth | the bit depth, 2 means 4 colors, 4 means 16 colors |
void ZeDMD::SetDevice | ( | const char *const | device | ) |
void ZeDMD::SetFrameSize | ( | uint16_t | width, |
uint16_t | height | ||
) |
Set the frame size.
Set the frame size of the content that will be displayed next on the ZeDMD device. Depending on the settings and the physical dimensions of the LED panels, the content will by centered and scaled correctly.
width | the frame width |
height | the frame height |
void ZeDMD::SetPalette | ( | uint8_t * | pPalette | ) |
Set the 4 color palette.
Backward compatibility version of SetPalette() to directly set the 4 color palette.
pPalette | the palette as RGB array |
numColors | 4, 16, or 64 colors palette |
void ZeDMD::SetPalette | ( | uint8_t * | pPalette, |
uint8_t | numColors | ||
) |
Set the palette.
Set the color palette to use to render gray scaled content. This library stores and tracks changes to 4, 16 and 64 color palettes individually.
pPalette | the palette as RGB array |
numColors | 4, 16, or 64 colors palette |
void ZeDMD::SetRGBOrder | ( | uint8_t | rgbOrder | ) |
Set the RGB order.
ZeDMD supports different LED panels. Depending on the panel, the RGB order needs to be adjusted.
rgbOrder | a value between 0 and 5 |
void ZeDMD::SetWiFiPassword | ( | const char *const | password | ) |
Set the WiFi Password.
Set the WiFi Password ZeDMD should use to connect.
password | the password |
void ZeDMD::SetWiFiPort | ( | int | port | ) |
Set the WiFi Port.
Set the Port ZeDMD should listen at over WiFi.
port | the port |
void ZeDMD::SetWiFiSSID | ( | const char *const | ssid | ) |
Set the WiFi SSID.
Set the WiFi SSID ZeDMD should connect with.
brightness | a value between 0 and 15 |