android是什么职场礼仪-电子人才网
电子人才网|深圳MTK培训|深圳FPGA培训|深圳Symbian培训logo位置
首 页 企业招聘 人才求职 培训招生 高校招生 猎头服务 高级人才 职场资讯 会员帮助 在线支付

职场中最容易失业的白领     递名片的商务礼仪     

您当前位置: 电子人才网首页 >> Symbian和FPGA培训资料 HR资讯订阅

Symbian多媒体编程系列五 --摄像头编程(上)

Symbian培训-摄像头编程源代码下载(SDK第二版)

摄像头编程
一、要点
1.CCamera类---提供操作摄像头的各种API.
调用CCamera::NewL()静态函数创建一个摄像头对象,函数原型:
static CCamera::NewL(MCameraObserver& aObserver,TInt aCameraIndex);
第一各参数时侦听类对象,第二个时摄像头设备的编号。
创建了摄像头对象后,应该调用它的Reserve()保留摄像头。

2.MCameraObserver---侦听接口类
class MCameraObserver
{
public:
virtual void ReseverComplete(TInt aError)=0;
virtual void PowerOnComplete(TInt aError)=0;
virtual void ViewFinderFrameReady(CFbsBitmao& aFrame)=0;
virtual void ImageReady(CFbsBitmao* aBitmap,HBufC8* aData,TInt aError)=0;

}
二、步骤
1.创建和初始化
(1)声明observer
class CImageCapturerEngine : public CBase, public MCameraObserver
{
public: // Observer interface
class MObserver
{
public:
virtual void OnFrame(const CFbsBitmap& aFrame)=0;
virtual void OnImage(CFbsBitmap* aBitmap)=0;
virtual void OnError(TInt aError)=0;
};

public: // Static constants
static const TInt KDefaultImageWidth;
static const TInt KDefaultImageHeight;
static const CCamera::TFormat KDefaultImageFormat;
static const TInt KDefaultImageIndex;

public: // Constructors and destructor
/**
* Two-phased constructor.
*/
static CImageCapturerEngine* NewL(MObserver& aObserver);

/**
* Destructor.
*/
~CImageCapturerEngine();

private:
/**
* EPOC default constructor.
*/
CImageCapturerEngine(MObserver& aObserver);
void ConstructL();

public: // Functions from MCameraObserver
/**
* Indicates camera reservation is complete.
* Called asynchronously when CCamera::Reserve() completes.
* @param aError: An error on failure and KErrNone on success
*/
void ReserveComplete(TInt aError);

/**
* Indicates camera power on is complete.
* Called on completion of CCamera:PowerOn().
* @param aError: An error on failure and KErrNone on success
*/
void PowerOnComplete(TInt aError);

/**
* Called periodically in response to the use of
* CCamera::StartViewFinderBitmapsL().
* @param aFrame: A view finder frame
*/
void ViewFinderFrameReady(CFbsBitmap& aFrame);

/**
* Called asynchronously when CCamera::CaptureImage() completes.
* Transfers the current image from the camera to the client.
* @param aBitmap: An image held in CFbsBitmap form if this was the
* format specified in CCamera::PrepareImageCaptureL().
* @param aData: a pointer to an HBufC8 if this was the format
* specified in CCamera::PrepareImageCaptureL().
* @param aError KErrNone on success or an error code on failure
*/
void ImageReady(CFbsBitmap* aBitmap,HBufC8* aData,TInt aError);

/**
* Called asynchronously when a buffer has been filled with the
* required number of video frames by CCamera::StartVideoCapture().
* Passes a filled frame buffer to the client.
* @param aFrameBuffer: A pointer to an MFrameBuffer if successful, or
* NULL if not successful.
* @param aError: KErrNone on success or an error code on failure
*/
void FrameBufferReady(MFrameBuffer* aFrameBuffer,TInt aError);

public: // new public methods
/**
* Start the view finder
*/
void StartViewFinderL();

/**
* Stop the view finder
*/
void StopViewFinder();

/**
* Asynchronously performs still image capture.
* Calls MCameraObserver::ImageReady() when complete.
*/
void CaptureImage();

private: // new private methods
/**
* Performs setup and allocation of memory.
* Called prior to calling CaptureImage() to keep the latency of that
* function to a minimum. Needs to be called only once for multiple
* CaptureImage() calls.
* May leave with KErrNotSupported or KErrNoMemory
* @param aImageFormat: The image format, must be one of the formats
* supported (see TCameraInfo::iImageFormatsSupported)
*/
void PrepareImageCaptureL(CCamera::TFormat aImageFormat);

private: // member variables
/**
*
*/
MObserver& iObserver;

/**
* The camera object
*/
CCamera* iCamera;

/**
* The resolution of the captured image.
*/
TSize iSize;
};

#endif


完整版本请见http://www.morning-sea.com.cn
曙海教育
曙海嵌入式学院
(MTK培训,Android培训,FPGA培训,DSP培训,iPhone培训,Symbian培训)
上海总部电话:021-51875830 深圳:0755-61280252 北京:010-51292078
网址:http://www.51qianru.cn
版权所有-曙海教育 转发请注明出处
 

相关资讯 更多资讯  
·职场中最容易失业的白领 (6-17)
·递名片的商务礼仪 (10-16)

发表评论
(带*号为必填项)
登录名:* Email:
标 题:*
内 容:*
发表评论须知:
一、所发文章必须遵守《互联网电子公告服务管理规定》;
二、严禁发布供求代理信息、公司介绍、产品信息等广告宣传信息;
三、严禁对个人、实体、民族、国家等进行漫骂、污蔑、诽谤。

最新资讯
今日暂无资讯更新

热门资讯
·危险的试用期,你准备好了?
·[推荐]五大房产新政3月起实施
·从美女俊男案例看沟通
·国企、外企、民企之比较
·把握好你的职业生涯的每个阶段
·职工医保实际缴费年限有别
·员工薪酬 不患寡而患不均
·[推荐]吴邦国:将制定物权法劳动
·副总经理一夜成了操作工
·招聘实用政策解读:档案和保险问题
·连续工作满10年可签无固定期限劳
·用人单位未经协商不得擅自变换工种
·职场30万年薪金领心路
·李嘉诚卸甲的理由
·为网罗人才 日本IT企业推出在家
·毕业生档案转递这样办
·领导修炼:《中庸》的和谐共赢之道
·为即将毕业的海归寻找归途
·英语面试技巧 事先3项准备
·小心职业定位陷阱

关于我们 | 服务条款 | 法律声明 | 隐私声明 | 广告服务 | 友情连接 | 合作代理 | 联系我们
沪ICP备05001702号   Copyright 2003-2009 morning-sea.com.cn Inc All Rights Reserved.
电话:021-51875830 Email:officeoffice@126.com webmaster@morning-sea.com.cn 在线客服QQ:849322415