DMCP interface
03.15_020
|
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... | |
LCD image functions.
int create_screenshot | ( | int | report_error | ) |
Create screenshot.
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.
void draw_power_off_image | ( | int | allow_errors | ) |
Draw subsequent image from OFFIMG_DIR directory.
allow_errors | (0/1) 1 - info about errors fill be written to LCD |
void lcd_draw_img | ( | const char * | img, |
uint32_t | xo, | ||
uint32_t | yo, | ||
uint32_t | x, | ||
uint32_t | y | ||
) |
Put image into LCD buffer.
img | Image data |
xo | X origin coordinate at LCD |
yo | Y origin coordinate at LCD |
x | Width of image |
y | Height of image |
All operations are byte aligned. Image isn't pixel shifted.
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.
img | Image data |
xo | X origin coordinate at LCD |
yo | Y origin coordinate at LCD |
x | Width of image |
y | Height of image |
All operations are byte aligned. Image isn't pixel shifted.
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.
img | Image data |
xo | X origin coordinate at LCD |
yo | Y origin coordinate at LCD |
x | Width of image |
y | Height of image |
dx | Width of image data to put into LCD buffer |
All operations are byte aligned. Image isn't pixel shifted.
void reset_off_image_cycle | ( | ) |
Resets off image loop to first image.
Useful after changes in OFFIMG_DIR directory
int update_bmp_file_header | ( | FIL * | fp, |
int | width, | ||
int | height, | ||
uint32_t | bg_color | ||
) |
Write or update .bmp file header.
fp | Pointer to already opened file |
width | BMP image width |
height | BMP image height |
bg_color | Background color |
BMP header is written with following parameters
Application has to write correct bitmap data after header.