/* api functions */ bool remote_backdrop_load(const char *filename, char* backdrop_buffer) { struct bitmap bm; int ret; /* load the image */ bm.data = backdrop_buffer; ret = read_bmp_file(filename, &bm, REMOTE_LCD_BACKDROP_BYTES, FORMAT_NATIVE | FORMAT_DITHER | FORMAT_REMOTE, NULL); return ((ret > 0) && (bm.width == LCD_REMOTE_WIDTH) && (bm.height == LCD_REMOTE_HEIGHT)); }
/* load a backdrop into a buffer */ static bool load_backdrop(const char* filename, fb_data* backdrop_buffer) { struct bitmap bm; int ret; /* load the image */ bm.data=(char*)backdrop_buffer; ret = read_bmp_file(filename, &bm, sizeof(main_backdrop), FORMAT_NATIVE | FORMAT_DITHER, NULL); return ((ret > 0) && (bm.width == LCD_WIDTH) && (bm.height == LCD_HEIGHT)); }
static void load_icons(const char* filename, enum Iconset iconset) { int size_read; bool *loaded_ok = NULL; struct bitmap *bmp = NULL; int bmpformat = (FORMAT_NATIVE|FORMAT_DITHER); switch (iconset) { case Iconset_Mainscreen: loaded_ok = &custom_icons_loaded[SCREEN_MAIN]; bmp = &user_iconset[SCREEN_MAIN]; bmp->data = icon_buffer[SCREEN_MAIN]; break; case Iconset_Mainscreen_viewers: loaded_ok = &viewer_icons_loaded[SCREEN_MAIN]; bmp = &viewer_iconset[SCREEN_MAIN]; bmp->data = viewer_icon_buffer[SCREEN_MAIN]; break; #if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1) case Iconset_Remotescreen: loaded_ok = &custom_icons_loaded[SCREEN_REMOTE]; bmp = &user_iconset[SCREEN_REMOTE]; bmp->data = icon_buffer[SCREEN_REMOTE]; bmpformat |= FORMAT_REMOTE; break; case Iconset_Remotescreen_viewers: loaded_ok = &viewer_icons_loaded[SCREEN_REMOTE]; bmp = &viewer_iconset[SCREEN_REMOTE]; bmp->data = viewer_icon_buffer[SCREEN_REMOTE]; bmpformat |= FORMAT_REMOTE; break; #endif } *loaded_ok = false; if (filename[0] && filename[0] != '-') { char path[MAX_PATH]; snprintf(path, sizeof(path), ICON_DIR "/%s.bmp", filename); size_read = read_bmp_file(path, bmp, IMG_BUFSIZE, bmpformat, NULL); if (size_read > 0) { *loaded_ok = true; } } }