如何修改 zoomRatio
修改過程:
1, 先找到 gZoomRatio 數組序列的值
Location: V:\project_code\project_name\ALPS.JB.MP.V1_W_20120919\mediatek\platform\mt6577\hardware\camera\hal\CamAdapter\mHal\mHalCamParameters.cpp
/******************************************************************************
*
*******************************************************************************/
//NOTE: zoomRatio can be customized. BUT
//Ratio should be no less than 100. The first one must be 100.
//The upper bound is limited to hardware capability.
//Value must be ordered in ascedent
static const uint32_t gZoomRatio[] = {
// 100, 114, 132, 151, 174,
// 200, 229, 263, 303, 348,
100, 104, 109, 114, 119, 124, 130, 135, 141, 148, 154, 161, 168, 176, 183, 192,
201, 209, 218, 228, 238, 248, 260, 271, 283, 295, 308, 322, 336, 351, 367, 383,
400
};
*
*******************************************************************************/
//NOTE: zoomRatio can be customized. BUT
//Ratio should be no less than 100. The first one must be 100.
//The upper bound is limited to hardware capability.
//Value must be ordered in ascedent
static const uint32_t gZoomRatio[] = {
// 100, 114, 132, 151, 174,
// 200, 229, 263, 303, 348,
100, 104, 109, 114, 119, 124, 130, 135, 141, 148, 154, 161, 168, 176, 183, 192,
201, 209, 218, 228, 238, 248, 260, 271, 283, 295, 308, 322, 336, 351, 367, 383,
400
};
2, 修改 zoomRatio 當中的某一個值,譬如將 200 修改為 201
3, 編譯命令及模塊 ./mk -t mm mediatek/platform/mt6577/hardware/camera/
4, 將編譯得到的 out/target/product/bbk17_td3001_jb/system/lib/hw/camera.default.so push 到手機端 system/lib/hw 目錄下
5, 需要重啟 mediaserver
6, zoomRatio 的確定原則:
確定基准值 100, 200,400
得到 2開根號5次方 的值(1.14),每次用上一次的值去乘以該值,
譬如
100, 100*1.14, 100*1.14^2, 100*1.14^3, 100*1.14^4
200, 200*1.14, 200*1.14^2, 200*1.14^3, 200*1.14^4
400
這一組值。
這組值越多,手勢變焦時過渡就越平滑。而通過變焦條變焦只有8個級別,是通過index 除法運算得到的,每隔多少個值取一個值,組成的8個值
