/* * Fill a screen size buffer with logo content * */ void fill_animation_logo(unsigned int index, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOGO_PARA_T logo_info; int raw_data_size; if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) return; raw_data_size = decompress_logo((void*)logo_info.inaddr, dec_logo_addr, logo_info.logolen, phical_screen.fb_size); if (0 == bits) { if (raw_data_size == phical_screen.width*phical_screen.height*4) { bits = 32; } else if (raw_data_size == phical_screen.width*phical_screen.height*2) { bits = 16; } else { LOG_ANIM("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__); return; } LOG_ANIM("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits); } RECT_REGION_T rect = {0, 0, phical_screen.width, phical_screen.height}; fill_rect_with_content(fill_addr, rect, dec_logo_addr, phical_screen, bits); }
/* * Fill a line with special color * */ void fill_animation_line(unsigned int index, unsigned int capacity_grids, void *fill_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOGO_PARA_T logo_info; int raw_data_size; if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) return; raw_data_size = decompress_logo((void*)logo_info.inaddr, (void*)line_pic_addr, logo_info.logolen, line_pic_size); if (0 == bits) { if (raw_data_size == (TOP_ANIMATION_RIGHT - TOP_ANIMATION_LEFT)*4) { bits = 32; } else if (raw_data_size == (TOP_ANIMATION_RIGHT - TOP_ANIMATION_LEFT)*2) { bits = 16; } else { LOG_ANIM("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__); return; } LOG_ANIM("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits); } RECT_REGION_T rect = {CAPACITY_LEFT, CAPACITY_TOP, CAPACITY_RIGHT, CAPACITY_BOTTOM}; int i = capacity_grids; for(; i < CAPACITY_BOTTOM; i++) { rect.top = i; rect.bottom = i+1; fill_rect_with_content(fill_addr, rect, line_pic_addr, phical_screen, bits); } }
/* * Fill a rectangle with number logo content * * number_position: 0~1st number, 1~2nd number */ void fill_animation_number(unsigned int index, unsigned int number_position, void *fill_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOG_ANIM("[show_animation_common: %s %d]index= %d, number_position = %d\n",__FUNCTION__,__LINE__, index, number_position); LOGO_PARA_T logo_info; int raw_data_size; if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) return; // draw default number rect, raw_data_size = decompress_logo((void*)logo_info.inaddr, (void*)number_pic_addr, logo_info.logolen, number_pic_size); //static RECT_REGION_T number_location_rect = {NUMBER_LEFT,NUMBER_TOP,NUMBER_RIGHT,NUMBER_BOTTOM}; RECT_REGION_T battery_number_rect = {NUMBER_LEFT + (NUMBER_RIGHT - NUMBER_LEFT)*number_position, NUMBER_TOP, NUMBER_RIGHT + (NUMBER_RIGHT - NUMBER_LEFT)*number_position, NUMBER_BOTTOM}; if (0 == bits) { if (raw_data_size == (NUMBER_RIGHT - NUMBER_LEFT)*(NUMBER_BOTTOM - NUMBER_TOP)*4) { bits = 32; } else if (raw_data_size == (NUMBER_RIGHT - NUMBER_LEFT)*(NUMBER_BOTTOM - NUMBER_TOP)*2) { bits = 16; } else { LOG_ANIM("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__); return; } LOG_ANIM("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits); } fill_rect_with_content(fill_addr, battery_number_rect, number_pic_addr,phical_screen, bits); }
/* * Fill a rectangle with logo content * */ void fill_animation_dynamic(unsigned int index, RECT_REGION_T rect, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOGO_PARA_T logo_info; if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) return; decompress_logo((void*)logo_info.inaddr, (void*)dec_logo_addr, logo_info.logolen, (rect.right-rect.left)*(rect.bottom-rect.top)*2); fill_rect_with_content(fill_addr, rect, (unsigned short *)dec_logo_addr, phical_screen); }
/* * Fill a screen size buffer with logo content * */ void fill_animation_logo(unsigned int index, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOGO_PARA_T logo_info; if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) return; decompress_logo((void*)logo_info.inaddr, dec_logo_addr, logo_info.logolen, phical_screen.fb_size); RECT_REGION_T rect = {0, 0, phical_screen.width, phical_screen.height}; fill_rect_with_content(fill_addr, rect, (unsigned short *)dec_logo_addr, phical_screen); }
/* * Fill a line with special color * */ void fill_animation_line(unsigned int index, unsigned int capacity_grids, void *fill_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOGO_PARA_T logo_info; if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) return; decompress_logo((void*)logo_info.inaddr, (void*)line_pic_addr, logo_info.logolen, line_pic_size); RECT_REGION_T rect = {CAPACITY_LEFT, CAPACITY_TOP, CAPACITY_RIGHT, CAPACITY_BOTTOM}; int i = capacity_grids; for(; i < CAPACITY_BOTTOM; i++) { rect.top = i; rect.bottom = i+1; fill_rect_with_content(fill_addr, rect, (unsigned short *)line_pic_addr, phical_screen); } }
/* * Fill a rectangle with number logo content * * number_position: 0~1st number, 1~2nd number */ void fill_animation_number(unsigned int index, unsigned int number_position, void *fill_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOG_ANIM("[show_animation_common: %s %d]index= %d, number_position = %d\n",__FUNCTION__,__LINE__, index, number_position); LOGO_PARA_T logo_info; if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) return; // draw default number rect, decompress_logo((void*)logo_info.inaddr, (void*)number_pic_addr, logo_info.logolen, number_pic_size); //static RECT_REGION_T number_location_rect = {NUMBER_LEFT,NUMBER_TOP,NUMBER_RIGHT,NUMBER_BOTTOM}; RECT_REGION_T battery_number_rect = {NUMBER_LEFT + (NUMBER_RIGHT - NUMBER_LEFT)*number_position, NUMBER_TOP, NUMBER_RIGHT + (NUMBER_RIGHT - NUMBER_LEFT)*number_position, NUMBER_BOTTOM}; fill_rect_with_content(fill_addr, battery_number_rect, (unsigned short *)number_pic_addr,phical_screen); }
/* * Fill a rectangle with logo content * */ void fill_animation_dynamic(unsigned int index, RECT_REGION_T rect, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOGO_PARA_T logo_info; int raw_data_size; if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) return; raw_data_size = decompress_logo((void*)logo_info.inaddr, (void*)dec_logo_addr, logo_info.logolen, (rect.right-rect.left)*(rect.bottom-rect.top)*4); if (0 == bits) { if (raw_data_size == (rect.right-rect.left)*(rect.bottom-rect.top)*4) { bits = 32; } else if (raw_data_size == (rect.right-rect.left)*(rect.bottom-rect.top)*2) { bits = 16; } else { LOG_ANIM("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__); return; } LOG_ANIM("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits); } fill_rect_with_content(fill_addr, rect, dec_logo_addr, phical_screen, bits); }