charing animation

 

FHD : full high definition,1920 x 1080,全高清

 

vendor/mediatek/proprietary/bootable/bootloader/lk/dev/logo/update  // 這隻檔主要負責將關機充電動畫所需要的全部小圖示及第1個開機logo(fhd_uboot.bmp)由 bmp_to_raw 做轉檔,從 .bmp 轉成 .raw,再使用 zpipe 將這些.raw 集結起來壓縮成一個檔 fhd.raw

1 #!/bin/bash 2 if [ "$1" = "" ]; then // 這個 project 使用的是 fhd。 3 echo "Please input resolution," 4 echo "Such as: qvga, wqvga, wvga, hvga" 5 exit 6 fi 7 p=$1 // ${p} = fhd 8 ./tool/bmp_to_raw ./temp0.raw ./$p/"${p}_uboot".bmp 9 ./tool/bmp_to_raw ./temp1.raw ./$p/"${p}_battery".bmp 10 ./tool/bmp_to_raw ./temp2.raw ./$p/"${p}_low_battery".bmp 11 ./tool/bmp_to_raw ./temp3.raw ./$p/"${p}_charger_ov".bmp 12 ./tool/bmp_to_raw ./temp4.raw ./$p/"${p}_num_0".bmp 13 ./tool/bmp_to_raw ./temp5.raw ./$p/"${p}_num_1".bmp 14 ./tool/bmp_to_raw ./temp6.raw ./$p/"${p}_num_2".bmp 15 ./tool/bmp_to_raw ./temp7.raw ./$p/"${p}_num_3".bmp 16 ./tool/bmp_to_raw ./temp8.raw ./$p/"${p}_num_4".bmp 17 ./tool/bmp_to_raw ./temp9.raw ./$p/"${p}_num_5".bmp 18 ./tool/bmp_to_raw ./temp10.raw ./$p/"${p}_num_6".bmp 19 ./tool/bmp_to_raw ./temp11.raw ./$p/"${p}_num_7".bmp 20 ./tool/bmp_to_raw ./temp12.raw ./$p/"${p}_num_8".bmp 21 ./tool/bmp_to_raw ./temp13.raw ./$p/"${p}_num_9".bmp 22 ./tool/bmp_to_raw ./temp14.raw ./$p/"${p}_num_percent".bmp 23 ./tool/bmp_to_raw ./temp15.raw ./$p/"${p}_bat_animation_01".bmp 24 ./tool/bmp_to_raw ./temp16.raw ./$p/"${p}_bat_animation_02".bmp 25 ./tool/bmp_to_raw ./temp17.raw ./$p/"${p}_bat_animation_03".bmp 26 ./tool/bmp_to_raw ./temp18.raw ./$p/"${p}_bat_animation_04".bmp 27 ./tool/bmp_to_raw ./temp19.raw ./$p/"${p}_bat_animation_05".bmp 28 ./tool/bmp_to_raw ./temp20.raw ./$p/"${p}_bat_animation_06".bmp 29 ./tool/bmp_to_raw ./temp21.raw ./$p/"${p}_bat_animation_07".bmp 30 ./tool/bmp_to_raw ./temp22.raw ./$p/"${p}_bat_animation_08".bmp 31 ./tool/bmp_to_raw ./temp23.raw ./$p/"${p}_bat_animation_09".bmp 32 ./tool/bmp_to_raw ./temp24.raw ./$p/"${p}_bat_animation_10".bmp 33 ./tool/bmp_to_raw ./temp25.raw ./$p/"${p}_bat_10_01".bmp 34 ./tool/bmp_to_raw ./temp26.raw ./$p/"${p}_bat_10_02".bmp 35 ./tool/bmp_to_raw ./temp27.raw ./$p/"${p}_bat_10_03".bmp 36 ./tool/bmp_to_raw ./temp28.raw ./$p/"${p}_bat_10_04".bmp 37 ./tool/bmp_to_raw ./temp29.raw ./$p/"${p}_bat_10_05".bmp 38 ./tool/bmp_to_raw ./temp30.raw ./$p/"${p}_bat_10_06".bmp 39 ./tool/bmp_to_raw ./temp31.raw ./$p/"${p}_bat_10_07".bmp 40 ./tool/bmp_to_raw ./temp32.raw ./$p/"${p}_bat_10_08".bmp 41 ./tool/bmp_to_raw ./temp33.raw ./$p/"${p}_bat_10_09".bmp 42 ./tool/bmp_to_raw ./temp34.raw ./$p/"${p}_bat_10_10".bmp 43 ./tool/bmp_to_raw ./temp35.raw ./$p/"${p}_bat_bg".bmp 44 ./tool/bmp_to_raw ./temp36.raw ./$p/"${p}_bat_img".bmp 45 ./tool/bmp_to_raw ./temp37.raw ./$p/"${p}_bat_100".bmp 46 ./tool/bmp_to_raw ./boot_logo ./$p/"${p}_kernel".bmp 47 ./tool/zpipe -l 9 ./"${p}.raw" temp0.raw temp1.raw temp2.raw temp3.raw temp4.raw temp5.raw temp6.raw temp7.raw temp8.raw temp9.raw temp10.raw temp11.raw temp12.raw temp13.raw temp14.raw temp15.raw temp16.raw temp17.raw temp18.raw temp19.raw temp20.raw temp21.raw temp22.raw temp23.raw temp24.raw temp25.raw temp26.raw temp27.r aw temp28.raw temp29.raw temp30.raw temp31.raw temp32.raw temp33.raw temp34.raw temp35.raw temp36.raw temp37.raw 48 rm -rf ./temp0.raw ./temp1.raw ./temp2.raw ./temp3.raw ./temp4.raw ./temp5.raw ./temp6.raw ./temp7.raw ./temp8.raw ./temp9.raw ./temp10.raw ./temp11.raw ./temp12.raw ./temp13.raw ./temp14.raw ./temp15.raw ./temp16.raw ./temp17.raw ./temp18.raw ./temp19.raw ./temp20.raw ./temp21.raw ./temp22.raw ./temp23.raw ./temp24.raw ./te mp25.raw ./temp26.raw ./temp27.raw ./temp28.raw ./temp29.raw ./temp30.raw ./temp31.raw ./temp32.raw ./temp33.raw ./temp34.raw ./temp35.raw ./temp36.raw ./temp37.raw ./bootlogo.raw 49 echo "conversion finished"

 

 

 

以下是 bmp 轉成 raw 檔後,在 bin 檔的排列順序,
之後需指定排列順序方可將圖片取出

... ... ... ifeq ($(strip $(SUPPORT_CARRIEREXPRESS_PACK)),yes) RESOLUTION :
= $(word $(COUNT),$(TEMP)) RESOURCE_OBJ_LIST := \ $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_uboot.raw else RESOURCE_OBJ_LIST := \ $(BOOT_LOGO_DIR)/$(BOOT_LOGO)/$(BOOT_LOGO)_uboot.raw endif ifneq ($(strip $(MACH_TYPE)), 2701) ifneq ($(strip $(MTK_ALPS_BOX_SUPPORT)), yes) RESOURCE_OBJ_LIST += \ $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_low_battery.raw \ $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_low_power_no_charger.raw \ # $(BOOT_LOGO_DIR)/$(BOOT_LOGO)/$(BOOT_LOGO)_1_pixel.raw # $(BOOT_LOGO_DIR)/$(BOOT_LOGO)/$(BOOT_LOGO)_kernel.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_charger_ov.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_0.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_1.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_2.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_3.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_4.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_5.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_6.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_7.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_8.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_9.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_num_percent.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_01.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_02.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_03.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_04.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_05.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_06.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_07.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_08.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_09.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_animation_10.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_01.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_02.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_03.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_04.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_05.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_06.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_07.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_08.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_09.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_10_10.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_bg.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_img.raw \ # $(BOOT_LOGO_DIR)/$(BASE_LOGO)/$(BASE_LOGO)_bat_100.raw \ # $(BOOT_LOGO_DIR)/$(BOOT_LOGO)/$(BOOT_LOGO)_kernel.raw \ endif endif ... ... ...

 

 

 

 

alps/vendor/mediatek/proprietary/external/libshowlogo / show_animation_common.c
... ... ...
#if 0 // original code #else

// 整個電池容量分成 7 個圖片往上貼,讓其有往上充電的感覺
// 以下這個 function 是自已寫的用來取得在當時的容量所對應的 scale base
// ex: 若 capacity 在 54,則取得第3個動畫貼片,然後依序往上貼到第6個,再取得當時的 capacity 所對應的 scale base,再依序重復。
// 此算法使用了二分法,讓比較次數限制在 3 次內,以優化整個顯示時間。
unsigned int check_animation_scale_base(unsigned int capacity) { // // 100% : 6 // 84% ~ 99% : 5 // 67% ~ 83% : 4 // 50% ~ 66% : 3 // 33% ~ 49% : 2 // 16% ~ 32% : 1 // 0% ~ 15% : 0 // if(capacity >= 50) if(capacity >= 84) if(capacity == 100) return 6; else return 5; else if(capacity >= 67) return 4; else return 3; else if(capacity >= 16) if(capacity >= 33) return 2; else return 1; else return 0; }
//
// fill_addr : framebuffer address
// dec_logo_addr : 解壓縮後的 logo address
// logo_addr : logo 在壓縮檔內的 address, 您也可以將常用的小圖示如 number 先行壓縮成數據再直接 include 進來,則 logo_addr 就改成 壓縮後的數據的變數名。
//
void fill_animation_battery_new_ex(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { unsigned int animation_scale_base = 0; static unsigned int animation_scale_offset = 0; if (capacity > 100) capacity = 100;
// 底圖 fill_animation_logo(ANIM_V0_BACKGROUND_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); RECT_REGION_T rect
= {STATE_LEFT, STATE_TOP, STATE_RIGHT, STATE_BOTTOM}; switch (g_batNotifyCode) { case 0x0002: case 0x0020: case 0x0040: case 0x0080: //Temperatures fill_animation_dynamic(7, rect, fill_addr, dec_logo_addr, logo_addr, phical_screen); } // // display a digit in hundreds // if (capacity == 100) { fill_animation_number(NUMBER_PIC_START_0+1, -1, fill_addr, logo_addr, phical_screen); } // // display a digit in tens // if (capacity == 100) { fill_animation_number(NUMBER_PIC_START_0, 0, fill_addr, logo_addr, phical_screen); } else if (capacity >= 10) { fill_animation_number(NUMBER_PIC_START_0 + (capacity/10), 0, fill_addr, logo_addr, phical_screen); } // // display a digit in ones // fill_animation_number(NUMBER_PIC_START_0 + (capacity%10), 1, fill_addr, logo_addr, phical_screen); // // display % symbol // fill_animation_dynamic(NUMBER_PIC_PERCENT, percent_location_rect, fill_addr, percent_pic_addr, logo_addr, phical_screen); // // scale animation position. // rect.left = BATTERY_LEFT; rect.top = BATTERY_TOP; rect.right = BATTERY_RIGHT; rect.bottom = BATTERY_BOTTOM; // // scale animation // animation_scale_base = check_animation_scale_base(capacity); if (animation_scale_base + animation_scale_offset > 6) animation_scale_offset = 0; fill_animation_dynamic(SCALE_PIC_START_0 + animation_scale_base + animation_scale_offset, rect, fill_addr, dec_logo_addr, logo_addr, phical_screen); animation_scale_offset++; } #endif ... ... ...

 

 

logo.bin

     1 0000000: 8816 8858 130d 3000 6c6f 676f 0000 0000  ...X..0.logo....                                                                                              
     2 0000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
     3 0000020: 0000 0000 0000 0000 ffff ffff ffff ffff  ................
     4 0000030: 8916 8958 0002 0000 0100 0000 0000 0000  ...X............
     5 0000040: 0000 0000 1000 0000 0000 0000 0000 0000  ................
     6 0000050: ffff ffff ffff ffff ffff ffff ffff ffff  ................
     7 0000060: ffff ffff ffff ffff ffff ffff ffff ffff  ................
     8 0000070: ffff ffff ffff ffff ffff ffff ffff ffff  ................
     9 0000080: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    10 0000090: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    11 00000a0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    12 00000b0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    13 00000c0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    14 00000d0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    15 00000e0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    16 00000f0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    17 0000100: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    18 0000110: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    19 0000120: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    20 0000130: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    21 0000140: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    22 0000150: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    23 0000160: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    24 0000170: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    25 0000180: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    26 0000190: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    27 00001a0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    28 00001b0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    29 00001c0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    30 00001d0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    31 00001e0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    32 00001f0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
    33 0000200: 3900 0000 130d 3000 ec00 0000 5e71 0000  9.....0.....^q..
    34 0000210: 3aa6 0c00 3558 0d00 b0d1 0e00 72d5 0e00  :...5X......r...
    35 0000220: 9cd6 0e00 1cda 0e00 86de 0e00 3ee1 0e00  ............>...
    36 0000230: 38e5 0e00 ece9 0e00 11ec 0e00 24f1 0e00  8...........$...
    37 0000240: eff5 0e00 85fb 0e00 8716 0f00 6833 0f00  ............h3..
    38 0000250: 4e50 0f00 3d6a 0f00 2182 0f00 7399 0f00  NP..=j..!...s...
    39 0000260: 2eb3 0f00 4ccf 0f00 f2eb 0f00 dd07 1000  ....L...........
    40 0000270: 51a3 1000 3e43 1100 62e3 1100 2d7e 1200  Q...>C..b...-~..
    41 0000280: 1c16 1300 e4ac 1300 8f46 1400 4ae4 1400  .........F..J...
    42 0000290: 7d83 1500 3b22 1600 2daa 1600 5fac 1600  }...;"..-..._...
    43 00002a0: 0d48 1700 0cbb 1700 a127 1b00 55dd 1d00  .H.......'..U...
    .....................................................................
    .....................................................................
    .....................................................................
196847 0300ee0: 4551 1445 5114 4551 1445 5114 4551 1445 EQ.EQ.EQ.EQ.EQ.E
196848 0300ef0: 5114 4551 1445 5114 4551 1445 5114 4551 Q.EQ.EQ.EQ.EQ.EQ
196849 0300f00: 1445 5114 4551 1445 5114 4539 9a7f 0167 .EQ.EQ.EQ.E9...g
196850 0300f10: 0c47 cf00 0000 0000 0000 0000 0000 0000 .G..............
196851 0300f20: 0a

 

0x200 = 00000039,代表這個 logo.bin 由39 個圖片組成。

0x204 = 00300d13,代表這個 logo.bin 的 length,

0x300F20 代表 logo.bin 的 bytes size

但為什麼 300d13 和 300f20 不一致呢?

是否是因為加了其它資訊?

0x300F20 - 0x300d13 = 0x20D 

待解決?

 

待續!

 

 


 

關機充電動畫如以下4張,

特地將會變動的水波紋獨立出來看較易理解。

 

 

 

 

 

 

 

 

下面是在描述 畫數字及電池容量圖案的 LCM 上的啟始點。

 

130 #if defined(FHD) || defined(CU_FHD) || defined(CMCC_FHD) || defined(CT_FHD) || defined(CMCC_LTE_FHD) || defined(CT_LTE_FHD) || defined(CU_LTE_FHD)
131         // fhd 1080*1920
132         
133         // battery capacity rectangle
134         #define CAPACITY_LEFT                (387) // battery capacity center
135         #define CAPACITY_TOP                 (802)
136         #define CAPACITY_RIGHT               (691)
137         #define CAPACITY_BOTTOM              (1292)
138 
139         // first number rectangle
140         #define NUMBER_LEFT                  (351+84) // number
141         #define NUMBER_TOP                   (479)
142         #define NUMBER_RIGHT                 (435+84)
143         #define NUMBER_BOTTOM                (600)
144 
145         // %  rectangle
146         #define PERCENT_LEFT                 (519+84) // percent number_left + 2*number_width
147         #define PERCENT_TOP                  (479)
148         #define PERCENT_RIGHT                (627+84)
149         #define PERCENT_BOTTOM               (600)
150 
151         // top animation part
152         // youchihwang
153         #define TOP_ANIMATION_LEFT           (387) // top animation
154         #define TOP_ANIMATION_TOP            (100)
155         #define TOP_ANIMATION_RIGHT          (691)
156         #define TOP_ANIMATION_BOTTOM         (152)

 

 

 

 

 

133         // battery capacity rectangle
134         #define CAPACITY_LEFT                (387) // battery capacity center
135         #define CAPACITY_TOP                 (802)
136         #define CAPACITY_RIGHT               (691)
137         #define CAPACITY_BOTTOM              (1292)

 

 

 

 

 

 

139         // first number rectangle
140         #define NUMBER_LEFT                  (351+84) // number
141         #define NUMBER_TOP                   (479)
142         #define NUMBER_RIGHT                 (435+84)
143         #define NUMBER_BOTTOM                (600)

 

 

 

 

 

 

145         // %  rectangle
146         #define PERCENT_LEFT                 (519+84) // percent number_left + 2*number_width
147         #define PERCENT_TOP                  (479)
148         #define PERCENT_RIGHT                (627+84)
149         #define PERCENT_BOTTOM               (600)

 

 

 

 

 

 這是水波紋動畫的大小size,不是啟始點。

151         // top animation part
152         #define TOP_ANIMATION_LEFT           (387) // top animation                                                                                                
153         #define TOP_ANIMATION_TOP            (100)
154         #define TOP_ANIMATION_RIGHT          (691)
155         #define TOP_ANIMATION_BOTTOM         (152)

 

 

 

linux_repo/vendor/mediatek/proprietary/external/libshowlogo/show_animation_common.c


66 /* 67 * Check logo.bin address if valid, and get logo related info 68 * 69 */ 70 int check_logo_index_valid(unsigned int index, void * logo_addr, LOGO_PARA_T * logo_info) 71 { 72 unsigned int *pinfo = (unsigned int*)logo_addr; 73 logo_info->logonum = pinfo[0]; 74 75 SLOGD("[show_animation_common: %s %d]logonum =%d, index =%d\n", __FUNCTION__,__LINE__,logo_info->logonum, index); 76 if (index >= logo_info->logonum) 77 { 78 SLOGE("[show_animation_common: %s %d]unsupported logo, index =%d\n", __FUNCTION__,__LINE__, index); 79 return CHECK_LOGO_BIN_ERROR; 80 81 } 82 // SLOGD("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", 83 // pinfo[1],pinfo[2+index],pinfo[3+index], pinfo[3+index] - pinfo[2+index],pinfo[1] - pinfo[2+index]); 84 85 if(index < logo_info->logonum - 1)

//
// ex:以第5張圖為例,
// logolen = pinfo[3+5] - pinfo[2+5]
// 以上算法是屬於相對的,
// 原先假設 pinfo[2+5] 是 壓縮檔裡picture 4 data 的 end address.
// 原先假設 pinfo[3+5] 是 壓縮檔裡picture 5 data 的 end address.
// 相減 為 壓縮檔裡picture 5 data 的長度,
// 但看了 90 行的code,推理 pinfo[2+5] 應是壓縮檔裡 picture 5 data 在 logo.bin 的相對啟始位置。
// 所以 pinfo[3+5] 則是 壓縮檔裡picture 5 data 在 logo.bin 的相對啟始位置。
//
86 logo_info->logolen = pinfo[3+index] - pinfo[2+index]; 87 else 88 logo_info->logolen = pinfo[1] - pinfo[2+index]; 89
//
// 取出 picture 的 raw data,
// logo_addr :壓縮檔 logo.bin 在系統的啟始位置
// pinfo[2+index] :第 index 圖在壓縮檔 logo.bin 的相對啟始位置
// logo_addr + pinfo[2+index]:第 index 圖在整個系統的啟始位置 90 logo_info->inaddr = (unsigned int)logo_addr + pinfo[2+index]; 91 SLOGD("show_animation_common, in_addr=0x%08x, logolen=%d\n", 92 logo_info->inaddr, logo_info->logolen); 93 94 return CHECK_LOGO_BIN_OK; 95 }

 

 

linux_repo/vendor/mediatek/proprietary/external/libshowlogo/show_animation_common.c


98 /* 99 * Fill a screen size buffer with logo content 100 * 101 */ 102 void fill_animation_logo(unsigned int index, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) 103 { 104 LOGO_PARA_T logo_info; 105 int logo_width; 106 int logo_height; 107 int raw_data_size; 108 if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK) 109 return; 110
//
// decompress_logo (in, out, in_length, out_length)
// 111 raw_data_size = decompress_logo((void*)logo_info.inaddr, dec_logo_addr, logo_info.logolen, phical_screen.fb_size); 112 //RECT_REGION_T rect = {0, 0, phical_screen.width, phical_screen.height}; 113 logo_width =phical_screen.width; 114 logo_height = phical_screen.height; 115 if (phical_screen.rotation == 270 || phical_screen.rotation == 90) { 116 logo_width =phical_screen.height; 117 logo_height = phical_screen.width; 118 } 119 if (0 == bits) { 120 if (raw_data_size == logo_width*logo_height*4) { 121 bits = 32; 122 } else if (raw_data_size == logo_width*logo_height*2) { 123 bits = 16; 124 } else { 125 SLOGE("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__); 126 return; 127 } 128 SLOGD("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits); 129 } 130
//
// 以下代表,要填入的 rectangle 的長度與寬度,
// 因為 fill_animation_logo() 是將整張圖片顯示出來,
// 所以 起始點是從 0,0 開始到整個 panel 的寬度與長度。
// RECT_REGION_T rect = {左,上,右,下}
// 131 RECT_REGION_T rect = {0, 0, logo_width, logo_height}; 132 133 fill_rect_with_content(fill_addr, rect, dec_logo_addr, phical_screen, bits); 134 135 }

 

 

 

 

繼續編輯

待續

 

posted @ 2016-12-21 17:54  wangchangruei  阅读(302)  评论(0编辑  收藏  举报