DMCP interface  03.15_020
Image manipulation

LCD image functions. More...

Macros

#define SCR_DIR   "/SCREENS"
 Default directory for screenshots.
 
#define OFFIMG_DIR   "/OFFIMG"
 Default directory for power off images.
 
#define BG_COL_PAPER   0xf4f2dc
 Default paper background color.
 
#define BG_COL_LCD   0xdff5cc
 Default LCD background color.
 

Functions

int create_screenshot (int report_error)
 Create screenshot. More...
 
void lcd_draw_img (const char *img, uint32_t xo, uint32_t yo, uint32_t x, uint32_t y)
 Put image into LCD buffer. More...
 
void lcd_draw_img_direct (const char *img, uint32_t xo, uint32_t yo, uint32_t x, uint32_t y)
 Put image directly on LCD. More...
 
void lcd_draw_img_part (const char *img, uint32_t xo, uint32_t yo, uint32_t x, uint32_t y, uint32_t dx)
 Put part of image into LCD buffer. More...
 
void draw_power_off_image (int allow_errors)
 Draw subsequent image from OFFIMG_DIR directory. More...
 
void reset_off_image_cycle ()
 Resets off image loop to first image. More...
 
int update_bmp_file_header (FIL *fp, int width, int height, uint32_t bg_color)
 Write or update .bmp file header. More...
 

Detailed Description

LCD image functions.

Function Documentation

◆ create_screenshot()

int create_screenshot ( int  report_error)

Create screenshot.

Parameters
report_error(0/1) 0 - errors prints to LCD are suppressed

Creates screenshot into BMP file in SCR_DIR. Filename is created from current date/time.

◆ draw_power_off_image()

void draw_power_off_image ( int  allow_errors)

Draw subsequent image from OFFIMG_DIR directory.

Parameters
allow_errors(0/1) 1 - info about errors fill be written to LCD

◆ lcd_draw_img()

void lcd_draw_img ( const char *  img,
uint32_t  xo,
uint32_t  yo,
uint32_t  x,
uint32_t  y 
)

Put image into LCD buffer.

Parameters
imgImage data
xoX origin coordinate at LCD
yoY origin coordinate at LCD
xWidth of image
yHeight of image

All operations are byte aligned. Image isn't pixel shifted.

◆ lcd_draw_img_direct()

void lcd_draw_img_direct ( const char *  img,
uint32_t  xo,
uint32_t  yo,
uint32_t  x,
uint32_t  y 
)

Put image directly on LCD.

Parameters
imgImage data
xoX origin coordinate at LCD
yoY origin coordinate at LCD
xWidth of image
yHeight of image

All operations are byte aligned. Image isn't pixel shifted.

◆ lcd_draw_img_part()

void lcd_draw_img_part ( const char *  img,
uint32_t  xo,
uint32_t  yo,
uint32_t  x,
uint32_t  y,
uint32_t  dx 
)

Put part of image into LCD buffer.

Parameters
imgImage data
xoX origin coordinate at LCD
yoY origin coordinate at LCD
xWidth of image
yHeight of image
dxWidth of image data to put into LCD buffer

All operations are byte aligned. Image isn't pixel shifted.

◆ reset_off_image_cycle()

void reset_off_image_cycle ( )

Resets off image loop to first image.

Useful after changes in OFFIMG_DIR directory

◆ update_bmp_file_header()

int update_bmp_file_header ( FIL fp,
int  width,
int  height,
uint32_t  bg_color 
)

Write or update .bmp file header.

Parameters
fpPointer to already opened file
widthBMP image width
heightBMP image height
bg_colorBackground color

BMP header is written with following parameters

  • foreground color is black.
  • 1 bpp
  • top to bottom data (negative height is written)

Application has to write correct bitmap data after header.