Doly C++ SDK v1.00
Loading...
Searching...
No Matches
LcdControl Namespace Reference

Functions

int8_t init (LcdColorDepth depth=LcdColorDepth::L12BIT)
 Initialize the LCD device.
int8_t dispose ()
 Release resources and deinitialize the LCD device.
bool isActive ()
 Check whether the LCD subsystem is active (initialized).
void LcdColorFill (LcdSide side, uint8_t R, uint8_t G, uint8_t B)
 Fill a panel with a solid RGB color.
int8_t writeLcd (LcdData *frame_data)
 Write a buffer to the LCD.
int getBufferSize ()
 Get required buffer size in bytes for one full frame.
LcdColorDepth getColorDepth ()
 Get the currently configured LCD color depth.
int8_t setBrightness (uint8_t value)
 Set LCD backlight brightness.
void toLcdBuffer (uint8_t *output, uint8_t *input, bool input_RGBA=false)
 Convert 24-bit (RGB) or 32-bit (RGBA) image data to the LCD buffer format.
float getVersion ()
 Get current library version.

Function Documentation

◆ dispose()

int8_t LcdControl::dispose ( )

Release resources and deinitialize the LCD device.

Returns
Status code:
  • 0 : success
  • 1 : already closed or not opened
Examples
LcdControl/main.cpp.

◆ getBufferSize()

int LcdControl::getBufferSize ( )

Get required buffer size in bytes for one full frame.

Size depends on panel resolution and configured color depth. Example: 240*240*3 for 18-bit depth represented as 3 bytes/pixel.

Returns
Buffer size in bytes.
Examples
LcdControl/main.cpp.

◆ getColorDepth()

LcdColorDepth LcdControl::getColorDepth ( )

Get the currently configured LCD color depth.

Returns
Current color depth.
Examples
LcdControl/main.cpp.

◆ getVersion()

float LcdControl::getVersion ( )

Get current library version.

Original note: format 0.XYZ (3 digits after major).

Returns
Version as float.
Examples
LcdControl/main.cpp.

◆ init()

int8_t LcdControl::init ( LcdColorDepth depth = LcdColorDepth::L12BIT)

Initialize the LCD device.

Parameters
depthLCD color depth to configure.
Returns
Status code:
  • 0 : success
  • 1 : already initialized
  • -1 : open device failed
  • -2 : ioctl failed
Examples
LcdControl/main.cpp.

◆ isActive()

bool LcdControl::isActive ( )

Check whether the LCD subsystem is active (initialized).

Returns
true if initialized; false otherwise.

◆ LcdColorFill()

void LcdControl::LcdColorFill ( LcdSide side,
uint8_t R,
uint8_t G,
uint8_t B )

Fill a panel with a solid RGB color.

Parameters
sideLCD side to fill.
RRed component (0..255).
GGreen component (0..255).
BBlue component (0..255).
Examples
LcdControl/main.cpp.

◆ setBrightness()

int8_t LcdControl::setBrightness ( uint8_t value)

Set LCD backlight brightness.

Parameters
valueBrightness value (min = 0, max = 10).
Returns
Status code (implementation-defined).
Examples
LcdControl/main.cpp.

◆ toLcdBuffer()

void LcdControl::toLcdBuffer ( uint8_t * output,
uint8_t * input,
bool input_RGBA = false )

Convert 24-bit (RGB) or 32-bit (RGBA) image data to the LCD buffer format.

Parameters
outputOutput buffer pointer (must have at least getBufferSize() bytes).
inputInput image data pointer (RGB or RGBA).
input_RGBASet true if input contains RGBA data (alpha is discarded).
Warning
output and input must be valid (non-null).

◆ writeLcd()

int8_t LcdControl::writeLcd ( LcdData * frame_data)

Write a buffer to the LCD.

Parameters
frame_dataFrame descriptor containing target side and buffer pointer.
Returns
Status code:
  • 0 : success
  • -1 : ioctl error
  • -2 : not active (init() not called or failed)
Warning
frame_data and frame_data->buffer must be valid (non-null).
Examples
LcdControl/main.cpp.