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. | |
void | SetDevice (const char *const device) |
Use a specific serial device for ZeDMD. | |
bool | Open () |
Open the connection to ZeDMD. | |
bool | Open (uint16_t width, uint16_t height) |
Open the connection to ZeDMD. | |
bool | OpenWiFi (const char *ip, int port) |
Open a WiFi connection to ZeDMD. | |
void | Close () |
Close connection to ZeDMD. | |
void | SetFrameSize (uint16_t width, uint16_t height) |
Set the frame size. | |
uint16_t | GetWidth () |
Get the physical panel width. | |
uint16_t | GetHeight () |
Get the physical panel height. | |
void | SetPalette (uint8_t *pPalette, uint8_t numColors) |
Set the palette. | |
void | SetPalette (uint8_t *pPalette) |
Set the 4 color palette. | |
void | SetDefaultPalette (uint8_t bitDepth) |
Set the default palette. | |
uint8_t * | GetDefaultPalette (uint8_t bitDepth) |
Get the default palette. | |
void | LedTest () |
Test the panels attached to ZeDMD. | |
void | EnableDebug () |
Enable debug mode. | |
void | DisableDebug () |
Disable debug mode. | |
void | SetRGBOrder (uint8_t rgbOrder) |
Set the RGB order. | |
void | SetBrightness (uint8_t brightness) |
Set the brightness. | |
void | SetWiFiSSID (const char *const ssid) |
Set the WiFi SSID. | |
void | SetWiFiPassword (const char *const password) |
Set the WiFi Password. | |
void | SetWiFiPort (int port) |
Set the WiFi Port. | |
void | SaveSettings () |
Save the current setting. | |
void | EnablePreDownscaling () |
Enable downscaling on the client side. | |
void | DisablePreDownscaling () |
Disable downscaling on the client side. | |
void | EnablePreUpscaling () |
Enable upscaling on the client side. | |
void | DisablePreUpscaling () |
Disable downscaling on the client side. | |
void | EnableUpscaling () |
Enable upscaling on ZeDMD itself. | |
void | DisableUpscaling () |
Disable upscaling on ZeDMD itself. | |
void | EnforceStreaming () |
Enforce zone streaming. | |
void | DisableRGB24Streaming () |
Disable zone streaming for RGB24. | |
void | ClearScreen () |
Clear the screen. | |
void | RenderGray2 (uint8_t *frame) |
Render a 2 bit gray scaled frame. | |
void | RenderGray4 (uint8_t *frame) |
Render a 4 bit gray scaled frame. | |
void | RenderColoredGray6 (uint8_t *frame, uint8_t *rotations) |
Render a 6 bit frame. | |
void | RenderColoredGray6 (uint8_t *frame, uint8_t *palette, uint8_t *rotations) |
Render a 6 bit frame. | |
void | RenderRgb24 (uint8_t *frame) |
Render a RGB24 frame. | |
void | RenderRgb24EncodedAs565 (uint8_t *frame) |
Render a RGB24 frame. | |
void | RenderRgb565 (uint16_t *frame) |
Render a RGB565 frame. | |
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 ZeDMD::GetHeight | ( | ) |
Get the physical panel height.
Get the height of the physical dimensions of the LED panels.
uint16_t 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 |
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 ) |
Open a WiFi connection to ZeDMD.
ZeDMD could be connected via WiFi instead of USB. The WiFi settings need to be stored in ZeDMD's EEPROM first using a USB connection.
ip | the IPv4 address of the ZeDMD device |
port | the 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 |
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 |
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 |