/* * 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 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 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); }
/* * Check logo.bin address if valid, and get logo related info * */ int check_logo_index_valid(unsigned int index, void * logo_addr, LOGO_PARA_T * logo_info) { unsigned int *pinfo = (unsigned int*)logo_addr; logo_info->logonum = pinfo[0]; LOG_ANIM("[show_animation_common: %s %d]logonum =%d, index =%d\n", __FUNCTION__,__LINE__,logo_info->logonum, index); if (index >= logo_info->logonum) { LOG_ANIM("[show_animation_common: %s %d]unsupported logo, index =%d\n", __FUNCTION__,__LINE__, index); return CHECK_LOGO_BIN_ERROR; } // LOG_ANIM("show_animation_common, pinfo[1]=%d, pinfo[2+index]=%d, pinfo[3+index]=%d, pinfo[3+index] - pinfo[2+index]= %d, pinfo[1] - pinfo[2+index] =%d \n", // pinfo[1],pinfo[2+index],pinfo[3+index], pinfo[3+index] - pinfo[2+index],pinfo[1] - pinfo[2+index]); if(index < logo_info->logonum - 1) logo_info->logolen = pinfo[3+index] - pinfo[2+index]; else logo_info->logolen = pinfo[1] - pinfo[2+index]; logo_info->inaddr = (unsigned int)logo_addr + pinfo[2+index]; LOG_ANIM("show_animation_common, in_addr=0x%08x, logolen=%d\n", logo_info->inaddr, logo_info->logolen); return CHECK_LOGO_BIN_OK; }
int decompress_logo(void *in, void *out, int inlen, int outlen) { LOG_ANIM("[decompress_logo %s %d]in=0x%08x, out=0x%08x, inlen=%d, logolen=%d\n",__FUNCTION__,__LINE__, (unsigned int)in, (unsigned int)out, inlen, outlen); int ret; int have = 0; z_stream strm; memset(&strm, 0, sizeof(z_stream)); /* allocate inflate state */ strm.zalloc = Z_NULL; strm.zfree = Z_NULL; strm.opaque = Z_NULL; strm.avail_in = 0; strm.next_in = Z_NULL; ret = inflateInit(&strm); if (ret != Z_OK) return ret; /* decompress until deflate stream ends or end of file */ do { strm.avail_in = inlen; if (strm.avail_in <= 0) { LOG_ANIM("[decompress_logo %s %d]strm.avail_in <= 0\n",__FUNCTION__,__LINE__); break; } strm.next_in = (Bytef*)in; /* run inflate() on input until output buffer not full */ do { strm.avail_out = outlen; strm.next_out = (Bytef*)out; ret = inflate(&strm, Z_NO_FLUSH); switch (ret) { case Z_NEED_DICT: ret = Z_DATA_ERROR; /* and fall through */ case Z_DATA_ERROR: case Z_MEM_ERROR: LOG_ANIM("[decompress_logo %s %d]Z_DATA_ERROR or Z_MEM_ERROR\n",__FUNCTION__,__LINE__); (void)inflateEnd(&strm); return ret; } have += outlen - strm.avail_out; } while (strm.avail_out == 0); /* done when inflate() says it's done */ } while (ret != Z_STREAM_END); if (ret == Z_STREAM_END) /* clean up and return */ (void)inflateEnd(&strm); LOG_ANIM("[decompress_logo %s %d]have=%d\n",__FUNCTION__,__LINE__,have); //return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR; return have; }
void fill_animation_battery_ver_2(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOG_ANIM("[show_animation_common: %s %d]capacity : %d\n",__FUNCTION__,__LINE__, capacity); // RECT_REGION_T wireless_bgd_rect = {0, 0, phical_screen.width, phical_screen.height}; charging_low_index >= 3? charging_low_index = 0:charging_low_index++; LOG_ANIM("[show_animation_common: %s %d]charging_low_index = %d\n",__FUNCTION__,__LINE__, charging_low_index); if (capacity >= 100) { // battery 100 fill_animation_logo(V2_BAT_100_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); } else if (capacity <= 0) { fill_animation_logo(V2_BAT_0_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); } else { int bg_index = V2_BAT_0_10_START_INDEX; //capacity > 0 && capacity < 10 if (capacity >= 10 && capacity < 40) { bg_index = V2_BAT_10_40_START_INDEX; } else if (capacity >= 40 && capacity < 80) { bg_index = V2_BAT_40_80_START_INDEX; } else if (capacity >= 80 && capacity < 100) { bg_index = V2_BAT_80_100_START_NDEX; } fill_animation_logo(bg_index + charging_low_index, fill_addr, dec_logo_addr, logo_addr,phical_screen); RECT_REGION_T tmp_rect = {(int)phical_screen.width * 4/10, (int) phical_screen.height * 1/6, (int)phical_screen.width* 5/10, (int)phical_screen.height*16/60 }; unsigned short tmp_num_addr[(int)phical_screen.width * phical_screen.height/100]; //addr if (capacity >= 10) { LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__, tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom); fill_animation_dynamic(V2_NUM_START_0_INDEX + (capacity/10), tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen); tmp_rect.left += (int)phical_screen.width /10; tmp_rect.right += (int)phical_screen.width /10; } LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__, tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom); fill_animation_dynamic(V2_NUM_START_0_INDEX + (capacity%10), tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen); tmp_rect.left += (int)phical_screen.width /10; tmp_rect.right += (int)phical_screen.width /10; LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__, tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom); fill_animation_dynamic(V2_NUM_PERCENT_INDEX, tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen); } }
/* * Show charging animation version 1 * */ void fill_animation_battery_ver_1(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOG_ANIM("[show_animation_common: %s %d]capacity : %d\n",__FUNCTION__,__LINE__, capacity); if (capacity >= 100) { //show_logo(37); // battery 100 fill_animation_logo(FULL_BATTERY_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); } else if (capacity < 10) { LOG_ANIM("[show_animation_common: %s %d]charging_low_index = %d\n",__FUNCTION__,__LINE__, charging_low_index); charging_low_index ++ ; fill_animation_logo(LOW_BAT_ANIM_START_0 + charging_low_index, fill_addr, dec_logo_addr, logo_addr,phical_screen); fill_animation_number(NUMBER_PIC_START_0 + capacity, 1, fill_addr, logo_addr, phical_screen); fill_animation_dynamic(NUMBER_PIC_PERCENT, percent_location_rect, fill_addr, percent_pic_addr, logo_addr, phical_screen); if (charging_low_index >= 9) charging_low_index = 0; } else { unsigned int capacity_grids = 0; //static RECT_REGION_T battery_rect = {CAPACITY_LEFT,CAPACITY_TOP,CAPACITY_RIGHT,CAPACITY_BOTTOM}; capacity_grids = CAPACITY_BOTTOM - (CAPACITY_BOTTOM - CAPACITY_TOP) * (capacity - 10) / 90; LOG_ANIM("[show_animation_common: %s %d]capacity_grids : %d,charging_animation_index = %d\n",__FUNCTION__,__LINE__, capacity_grids,charging_animation_index); //background fill_animation_logo(ANIM_V1_BACKGROUND_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); fill_animation_line(ANIM_LINE_INDEX, capacity_grids, fill_addr, logo_addr, phical_screen); fill_animation_number(NUMBER_PIC_START_0 + (capacity/10), 0, fill_addr, logo_addr, phical_screen); fill_animation_number(NUMBER_PIC_START_0 + (capacity%10), 1, fill_addr, logo_addr, phical_screen); fill_animation_dynamic(NUMBER_PIC_PERCENT, percent_location_rect, fill_addr, percent_pic_addr, logo_addr, phical_screen); if (capacity <= 90) { RECT_REGION_T top_animation_rect = {TOP_ANIMATION_LEFT, capacity_grids - (TOP_ANIMATION_BOTTOM - TOP_ANIMATION_TOP), TOP_ANIMATION_RIGHT, capacity_grids}; //top_animation_rect.bottom = capacity_grids; //top_animation_rect.top = capacity_grids - top_animation_height; charging_animation_index++; //show_animation_dynamic(15 + charging_animation_index, top_animation_rect, top_animation_addr); fill_animation_dynamic(BAT_ANIM_START_0 + charging_animation_index, top_animation_rect, fill_addr, top_animation_addr, logo_addr, phical_screen); if (charging_animation_index >= 9) charging_animation_index = 0; } } }
/* * Show charging animation by version * */ void fill_animation_battery_by_ver(unsigned int capacity,void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen, int version) { LOG_ANIM("[show_animation_common: %s %d]version : %d\n",__FUNCTION__,__LINE__, version); switch (version) { case 0: fill_animation_battery_ver_0(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; case 1: fill_animation_battery_ver_1(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; case WIRELESS_CHARGING_ANIM_VER: fill_animation_battery_ver_2(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; case EXPAND_CHARGING_ANIM_VER: fill_animation_battery_ver_3(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; default: fill_animation_battery_ver_0(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; } }
/* * Check the rectangle if valid * * * */ int check_rect_valid(RECT_REGION_T rect) { int draw_width = rect.right - rect.left; int draw_height = rect.bottom - rect.top; if (draw_width < 0 || draw_height < 0) { LOG_ANIM("[show_logo_common %s %d]drawing width or height is error\n",__FUNCTION__,__LINE__); LOG_ANIM("[show_logo_common %s %d]rect:left= %d ,right= %d,top= %d,bottom= %d\n",__FUNCTION__,__LINE__,rect.left,rect.right,rect.top,rect.bottom); return CHECK_RECT_SIZE_ERROR; } return CHECK_RECT_OK; }
/* * Show charging animation version 0 * */ void fill_animation_battery_ver_0(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { unsigned int capacity_grids = 0; if (capacity > 100) capacity = 100; capacity_grids = (capacity * (ANIM_V0_REGIONS)) / 100; LOG_ANIM("[show_animation_common: %s %d]capacity =%d, capacity_grids = %d\n",__FUNCTION__,__LINE__, capacity, capacity_grids); //show_logo(1); fill_animation_logo(ANIM_V0_BACKGROUND_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); // Fill Occupied Color //RECT_REGION_T bar_rect = {BAR_LEFT, BAR_TOP, BAR_RIGHT, BAR_BOTTOM}; RECT_REGION_T rect_bar = {bar_rect.left + 1, bar_rect.top + 1, bar_rect.right, bar_rect.bottom}; // RECT_REGION_T rect_bar = {BAR_LEFT + 1, BAR_TOP + 1,BAR_RIGHT, BAR_BOTTOM}; fill_animation_prog_bar(rect_bar, (unsigned int)(BAR_OCCUPIED_COLOR), 0, capacity_grids, fill_addr, phical_screen); fill_animation_prog_bar(rect_bar, (unsigned int)(BAR_EMPTY_COLOR), capacity_grids, ANIM_V0_REGIONS - capacity_grids, fill_addr, phical_screen); }
/* * Fill one point address with source color and color pixel bits * * @parameter * */ void fill_point_buffer(unsigned int *fill_addr, unsigned int src_color, unsigned int bits_per_pixel) { if (32 == bits_per_pixel) { *fill_addr = RGB565_TO_ARGB8888(src_color); } else if (16 == bits_per_pixel) { *fill_addr = src_color; } else { LOG_ANIM("[show_logo_common %s %d]not support bits_per_pixel = %d \n",__FUNCTION__,__LINE__,(int)bits_per_pixel); } }
/* * Draw a rectangle region with spcial color * * * */ void fill_rect_with_color(void *fill_addr, RECT_REGION_T rect, unsigned int src_color, LCM_SCREEN_T phical_screen) { if (check_rect_valid(rect) != CHECK_RECT_OK) return; if (phical_screen.fill_dst_bits == 16) { fill_rect_with_color_by_16bit((unsigned short *)fill_addr, rect, src_color, phical_screen); } else if (phical_screen.fill_dst_bits == 32) { fill_rect_with_color_by_32bit((unsigned int *)fill_addr, rect, src_color, phical_screen); } else { LOG_ANIM("[show_logo_common %s %d]unsupported phical_screen.fill_dst_bits =%d\n",__FUNCTION__,__LINE__, phical_screen.fill_dst_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; 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); }
void fill_rect_with_content(void *fill_addr, RECT_REGION_T rect, void *src_addr, LCM_SCREEN_T phical_screen, unsigned int bits) { if (check_rect_valid(rect) != CHECK_RECT_OK) return; if (bits == 32) { if (phical_screen.fill_dst_bits == 16) { fill_rect_with_content_by_16bit_argb8888((unsigned short *)fill_addr, rect, (unsigned int *)src_addr, phical_screen); } else if (phical_screen.fill_dst_bits == 32){ fill_rect_with_content_by_32bit_argb8888((unsigned int *)fill_addr, rect, (unsigned int *)src_addr, phical_screen, bits); } else { LOG_ANIM("[show_logo_common %s %d]unsupported phical_screen.fill_dst_bits =%d\n",__FUNCTION__,__LINE__, phical_screen.fill_dst_bits ); } } else { if (phical_screen.fill_dst_bits == 16) { fill_rect_with_content_by_16bit_rgb565((unsigned short *)fill_addr, rect, (unsigned short *)src_addr, phical_screen); } else if (phical_screen.fill_dst_bits == 32){ fill_rect_with_content_by_32bit_rgb565((unsigned int *)fill_addr, rect, (unsigned short *)src_addr, phical_screen, bits); } else { LOG_ANIM("[show_logo_common %s %d]unsupported phical_screen.fill_dst_bits =%d\n",__FUNCTION__,__LINE__, phical_screen.fill_dst_bits ); } } }
/* * Draw a rectangle region (16 bits per pixel) with logo content * * * */ void fill_rect_with_content_by_16bit_argb8888(unsigned short *fill_addr, RECT_REGION_T rect, unsigned int *src_addr, LCM_SCREEN_T phical_screen) { int draw_height = rect.bottom - rect.top; int virtual_width = phical_screen.needAllign == 0? phical_screen.width:phical_screen.allignWidth; int virtual_height = phical_screen.height; int i = 0; int j = 0; unsigned short * dst_addr = fill_addr; unsigned int * color_addr = src_addr; for(i = rect.top; i < rect.bottom; i++) { for(j = rect.left; j < rect.right; j++) { switch (phical_screen.rotation) { case 90: color_addr = src_addr++; dst_addr = fill_addr + (virtual_width * j + virtual_width - i - 1); break; case 270: color_addr = src_addr++; dst_addr = fill_addr + ((virtual_width * (virtual_height - j - 1)+ i)); break; case 180: // adjust fill in address color_addr = src_addr++; dst_addr = fill_addr + virtual_width * (virtual_height - i)- j-1-(virtual_width-phical_screen.width); break; default: color_addr = src_addr++; dst_addr = fill_addr + virtual_width * i + j; } if(11 == phical_screen.blue_offset) { *dst_addr = ARGB8888_TO_BGR565(*color_addr); } else { *dst_addr = ARGB8888_TO_RGB565(*color_addr); } if((i == rect.top && j == rect.left) || (i == rect.bottom - 1 && j == rect.left) || (i == rect.top && j == rect.right - 1) || (i == rect.bottom - 1 && j == rect.right - 1)){ LOG_ANIM("[show_logo_common]dst_addr= 0x%08x, color_addr= 0x%08x, i= %d, j=%d\n", *dst_addr, *color_addr, i , j); } } } }
/* * Draw a rectangle region (32 bits perpixel) with logo content * * * */ void fill_rect_with_content_by_32bit_rgb565(unsigned int *fill_addr, RECT_REGION_T rect, unsigned short *src_addr, LCM_SCREEN_T phical_screen, unsigned int bits) { int draw_height = rect.bottom - rect.top; int virtual_width = phical_screen.needAllign == 0? phical_screen.width:phical_screen.allignWidth; int virtual_height = phical_screen.height; int i = 0; int j = 0; unsigned int * dst_addr = fill_addr; unsigned int * color_addr = (unsigned int *)src_addr; for(i = rect.top; i < rect.bottom; i++) { for(j = rect.left; j < rect.right; j++) { switch (phical_screen.rotation) { case 90: color_addr = (unsigned int *) (src_addr + draw_height*j + i); dst_addr = fill_addr + ((virtual_width * i + virtual_width - j)); break; case 270: color_addr = (unsigned int *) (src_addr + draw_height*j + i); dst_addr = fill_addr + ((virtual_width * (virtual_height - i - 1)+ j)); break; case 180: // adjust fill in address color_addr = (unsigned int *)src_addr++; dst_addr = fill_addr + virtual_width * (virtual_height - i)- j-1-(virtual_width-phical_screen.width); break; default: color_addr = (unsigned int *)src_addr++; dst_addr = fill_addr + virtual_width * i + j; } fill_point_buffer(dst_addr, *color_addr, phical_screen, bits); if((i == rect.top && j == rect.left) || (i == rect.bottom - 1 && j == rect.left) || (i == rect.top && j == rect.right - 1) || (i == rect.bottom - 1 && j == rect.right - 1)){ LOG_ANIM("[show_logo_common]dst_addr= 0x%08x, color_addr= 0x%08x, i= %d, j=%d\n", *dst_addr, *color_addr, i , j); } } } }
/* * 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 one point address with source color and color pixel bits * * @parameter * */ void fill_point_buffer(unsigned int *fill_addr, unsigned int src_color, LCM_SCREEN_T phical_screen, unsigned int bits) { if (32 == phical_screen.bits_per_pixel) { if (32 == bits) { if(16 == phical_screen.blue_offset) { *fill_addr = ARGB8888_TO_ABGR8888(src_color); } else { *fill_addr = src_color; } } else { if(16 == phical_screen.blue_offset) { *fill_addr = RGB565_TO_ABGR8888(src_color); } else { *fill_addr = RGB565_TO_ARGB8888(src_color); } } } else { LOG_ANIM("[show_logo_common %s %d]not support bits_per_pixel = %d \n",__FUNCTION__,__LINE__,(int)phical_screen.bits_per_pixel); } }
/* * Show charging animation by version * */ void fill_animation_battery_by_ver(unsigned int capacity,void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen, int version) { LOG_ANIM("[show_animation_common: %s %d]version : %d\n",__FUNCTION__,__LINE__, version); switch (version) { case VERION_OLD_ANIMATION: fill_animation_battery_old(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; case VERION_NEW_ANIMATION: fill_animation_battery_new(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; case VERION_WIRELESS_CHARGING_ANIMATION: fill_animation_battery_wireless_charging(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; default: fill_animation_battery_old(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen); break; } }