我翻译的是关于摄像头的一个API帮助文档,头文件是cameraserv.h,类名是RCameraServ
其中的头文件的内容是如下:
00001 /*
00002 * ============================================================================
00003 * Name : RCameraServ
00004 * Part of : CameraServWrapperECam
00005 *
00006 * Description:
00007 * Implements the Camera server session resource class on the client side
00008 * Version:
00009 *
00010 * Copyright (C) 2002 Nokia Corporation.
00011 * This material, including documentation and any related
00012 * computer programs, is protected by copyright controlled by
00013 * Nokia Corporation. All rights are reserved. Copying,
00014 * including reproducing, storing, adapting or translating, any
00015 * or all of this material requires the prior written consent of
00016 * Nokia Corporation. This material also contains confidential
00017 * information which may not be disclosed to others without the
00018 * prior written consent of Nokia Corporation.
00019 * ============================================================================
00020 */
00021
00022 #ifndef __CAMERA_SERV__
00023 #define __CAMERA_SERV__
00024
00025 // INCLUDES
00026 #include
00027
00028 // FORWARD DECLARATIONS
00029 class CFbsBitmap;
00030
00031 // CLASS DEFINITIONS
00032
00044 class RCameraServ : public RSessionBase
00045 {
00046 public:
00052 enum TLighting
00053 {
00054 ELightingNormal,
00055 ELightingNight
00056 };
00057
00063 enum TImageQuality
00064 {
00065 EQualityHigh,
00066 EQualityLow
00067 };
00068
00072 IMPORT_C RCameraServ();
00073
00077 IMPORT_C virtual ~RCameraServ();
00078
00079
00085 IMPORT_C TInt SetLightingConditions( const TLighting aLightCondition );
00086
00087
00093 IMPORT_C TInt SetImageQuality( const TImageQuality aQuality );
00094
00095
00100 IMPORT_C TInt Connect();
00101
00111 IMPORT_C void TurnCameraOn( TRequestStatus& aStatus );
00112
00117 IMPORT_C TInt TurnCameraOff();
00118
00132 IMPORT_C void GetImage( TRequestStatus& aStatus, CFbsBitmap& aBitmap );
00133
00139 IMPORT_C TVersion Version Version() const;
00140
00141
00142 // Unused, reserved for future expandability
00143 IMPORT_C void ReservedFunction1();
00144 IMPORT_C void ReservedFunction2();
00145 IMPORT_C void ReservedFunction3();
00146 IMPORT_C void ReservedFunction4();
00147
00148 private:
00149 TImageQuality iImageQuality;
00150 };
00151
00152 #endif //__CAMERA_SERV__
00153
00154 // End of File
所以我们可以看出来这个类是从对话基类RSessionBase继承过来的,其中有两个枚举量TLighting and TImageQuality,这两个枚举量主要设置
拍照参数的,其中TLighting是设置拍照光强的,ELightingNormal表示在正常光照下拍照,ELightingNight则表示在夜间拍照,而TImageQuality则是说明拍照质量的,用来设定照片的分辨率的。下面我们来说一下成员函数。
成员函数:
IMPORT_C RCameraServ ()
这个函数是构造函数
virtual IMPORT_C ~RCameraServ ()
析构函数
IMPORT_C TInt SetLightingConditions (const TLighting aLightCondition)
设置拍照的光线条件,返回值为标准Symbian错误码
IMPORT_C TInt SetImageQuality (const TImageQuality aQuality)
设置拍摄照片的质量,返回值为标准Symbian错误码
IMPORT_C TInt Connect ()
连接拍照设备,返回值为标准Symbian错误码
IMPORT_C void TurnCameraOn (TRequestStatus &aStatus)
打开摄像头电源,无返回值
IMPORT_C TInt TurnCameraOff ()
关闭摄像头电源,返回值为标准Symbian错误码
IMPORT_C void GetImage (TRequestStatus &aStatus, CFbsBitmap &aBitmap)
获取图像,返回在状态在aStatus中,包括错误码等,如果成功则将位图信息保存到aBitmap中,这个CFbsBitmap类我没有找到,如果有人找到了麻烦发到群里给看一下,比如说的结构是什么样的
IMPORT_C TVersion Version () const
这个是获取CameraServ的版式信息,返回值是TVersion类
以下四个函数为保留的,以做将来系扩展使用
IMPORT_C void ReservedFunction1 ()
IMPORT_C void ReservedFunction2 ()
IMPORT_C void ReservedFunction3 ()
IMPORT_C void ReservedFunction4 ()
另外就是我发现SDK文档中有很多地方有错误,比如说参数定义等,所以翻译的时候尽量以头文件为标准,这样能够保证准确性。