android KK上,前摄,对于normal、zsd、facebeauty拍照,实现mirror
normal shot.
alps\mediatek\platform\mt6595\hardware\mtkcam\v1\adapter\Scenario\Shot\NormalShot\NormalShot.cpp,
bool
NormalShot::
onCmd_capture()
{
...
//加上以下code
if(getOpenId() == 1 && bFlip){
switch(mShotParam.mu4Transform){
case eTransform_ROT_90:
mShotParam.mu4Transform = eTransform_FLIP_V | eTransform_ROT_90;
break;
case eTransform_ROT_270:
mShotParam.mu4Transform = eTransform_FLIP_H | eTransform_ROT_90;
break;
case eTransform_ROT_180:
mShotParam.mu4Transform = eTransform_FLIP_V;
break;
default:
mShotParam.mu4Transform = eTransform_FLIP_H;
break;
}
}
//加上code,end
// shot param
NSCamShot::ShotParam rShotParam(
eImgFmt_YUY2, //yuv format
mShotParam.mi4PictureWidth, //picutre width
mShotParam.mi4PictureHeight, //picture height
mShotParam.mu4Transform, //picture transform
ePostViewFmt, //postview format
mShotParam.mi4PostviewWidth, //postview width
mShotParam.mi4PostviewHeight, //postview height
0, //postview transform
mShotParam.mu4ZoomRatio //zoom
);
(2)Face beauty,
alps\mediatek\platform\mt6595\hardware\mtkcam\v1\adapter\Scenario\Shot\FBShot\Facebeauty.cpp,
MBOOL
Mhal_facebeauty::
createJpegImg(IImageBuffer const * rSrcImgBufInfo
, NSCamShot::JpegParam const & rJpgParm
, MUINT32 const u4Transform
, IImageBuffer const * rJpgImgBufInfo
, MUINT32 & u4JpegSize)
{
...
将
pISImager->setTransform(u4Transform);
替换为
if(getOpenId() == 1 && bFlip){
MUINT32 mu4Transform = 0;
switch(u4Transform){
case eTransform_ROT_90:
mu4Transform = eTransform_FLIP_V | eTransform_ROT_90;
break;
case eTransform_ROT_270:
mu4Transform = eTransform_FLIP_H | eTransform_ROT_90;
break;
case eTransform_ROT_180:
mu4Transform = eTransform_FLIP_V;
break;
default:
mu4Transform = eTransform_FLIP_H;
break;
}
pISImager->setTransform(mu4Transform);
}else
pISImager->setTransform(u4Transform);
(3)zsd shot,
alps\mediatek\platform\mt6595\hardware\mtkcam\v1\adapter\Scenario\Shot\CapBufShot\CapBufShot.cpp,
bool
CapBufShot::
onCmd_capture()
{
...
//加上以下code
if(getOpenId() == 1 && bFlip){
switch(mShotParam.mu4Transform){
case eTransform_ROT_90:
mShotParam.mu4Transform = eTransform_FLIP_V | eTransform_ROT_90;
break;
case eTransform_ROT_270:
mShotParam.mu4Transform = eTransform_FLIP_H | eTransform_ROT_90;
break;
case eTransform_ROT_180:
mShotParam.mu4Transform = eTransform_FLIP_V;
break;
default:
mShotParam.mu4Transform = eTransform_FLIP_H;
break;
}
}
//加上code,end
// shot param
NSCamShot::ShotParam rShotParam(
eImgFmt_YUY2, //yuv format
mShotParam.mi4PictureWidth, //picutre width
mShotParam.mi4PictureHeight, //picture height
mShotParam.mu4Transform, //picture transform
ePostViewFmt, //postview format
mShotParam.mi4PostviewWidth, //postview width
mShotParam.mi4PostviewHeight, //postview height
0, //postview transform
mShotParam.mu4ZoomRatio //zoom
);
2、
alps/mediatek/platform/mt6595/hardware/mtkcam/core/
SingleShot.cpp
BurstShot.cpp
MultiShot.cpp
pass2node.preview.cpp
pass2node.capture.cpp
搜索eTransform_ROT_90,
将
if( XX == eTransform_ROT_90 ||
XX == eTransform_ROT_270 )
替换为
if( XX & eTransform_ROT_90 ||
XX == eTransform_ROT_270)
3、
(1)alps/mediatek/platform/mt6595/hardware/mtkcam/core/iopipe/SImager/ImageTransform/ImageTransform.cpp
MBOOL
ImageTransform::
convertTransform(
MUINT32 const u4Transform,
MUINT32 & u4Rotation,
MUINT32 & u4Flip
)
{
。。。
将
#define TransCase( trans, rot, flip ) \
case trans: \
u4Rotation = (rot); \
u4Flip = (flip); \
break;
TransCase(0 , 0 , 0)
TransCase(eTransform_FLIP_H , 180 , 1)
TransCase(eTransform_FLIP_V , 0 , 1)
TransCase(eTransform_ROT_90 , 90 , 0)
TransCase(eTransform_ROT_180 , 180 , 0)
TransCase(eTransform_ROT_270 , 270 , 0)
default:
MY_LOGE("not supported transform(0x%x)", u4Transform);
u4Rotation = 0;
u4Flip = 0;
return MFALSE;
break;
#undef TransCase
替换为
#define TransCase( trans, rot, flip ) \
case trans: \
u4Rotation = (rot); \
u4Flip = (flip); \
break;
TransCase(0 , 0 , 0)
TransCase(eTransform_FLIP_H , 0 , 1)
TransCase(eTransform_FLIP_V , 180 , 1)
TransCase(eTransform_ROT_90 , 90 , 0)
TransCase(eTransform_ROT_180 , 180 , 0)
TransCase(eTransform_FLIP_H|eTransform_ROT_90 , 270 , 1)
TransCase(eTransform_FLIP_V|eTransform_ROT_90 , 90 , 1)
TransCase(eTransform_ROT_270 , 270 , 0)
default:
MY_LOGE("not supported transform(0x%x)", u4Transform);
u4Rotation = 0;
u4Flip = 0;
return MFALSE;
break;
#undef TransCase
(2)alps\mediatek\platform\mt6595\hardware\mtkcam\core\iopipe\PostProc\HalPipeWrapper.cpp,
将
TransformMapping mTransformMapping[TRANSFORM_MAX]=
{
{0, NSImageio::NSIspio::eImgRot_0, NSImageio::NSIspio::eImgFlip_OFF},
{eTransform_FLIP_H, NSImageio::NSIspio::eImgRot_0, NSImageio::NSIspio::eImgFlip_ON},
{eTransform_FLIP_V, NSImageio::NSIspio::eImgRot_0, NSImageio::NSIspio::eImgFlip_ON},
{eTransform_ROT_180,NSImageio::NSIspio::eImgRot_180,NSImageio::NSIspio::eImgFlip_OFF},
{eTransform_ROT_90, NSImageio::NSIspio::eImgRot_90, NSImageio::NSIspio::eImgFlip_OFF},
{0, NSImageio::NSIspio::eImgRot_0, NSImageio::NSIspio::eImgFlip_OFF},
{0, NSImageio::NSIspio::eImgRot_0, NSImageio::NSIspio::eImgFlip_OFF},
{eTransform_ROT_270,NSImageio::NSIspio::eImgRot_270,NSImageio::NSIspio::eImgFlip_OFF}
};
替换为
TransformMapping mTransformMapping[TRANSFORM_MAX]=
{
{0, NSImageio::NSIspio::eImgRot_0, NSImageio::NSIspio::eImgFlip_OFF},
{eTransform_FLIP_H, NSImageio::NSIspio::eImgRot_0, NSImageio::NSIspio::eImgFlip_ON},
{eTransform_FLIP_V, NSImageio::NSIspio::eImgRot_180, NSImageio::NSIspio::eImgFlip_ON},
{eTransform_ROT_180,NSImageio::NSIspio::eImgRot_180,NSImageio::NSIspio::eImgFlip_OFF},
{eTransform_ROT_90, NSImageio::NSIspio::eImgRot_90, NSImageio::NSIspio::eImgFlip_OFF},
{eTransform_FLIP_H|eTransform_ROT_90, NSImageio::NSIspio::eImgRot_270, NSImageio::NSIspio::eImgFlip_ON},
{eTransform_FLIP_V|eTransform_ROT_90, NSImageio::NSIspio::eImgRot_90, NSImageio::NSIspio::eImgFlip_ON},
{eTransform_ROT_270,NSImageio::NSIspio::eImgRot_270,NSImageio::NSIspio::eImgFlip_OFF}
};
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。