加入收藏
举报
02-14 20:03
#0
文件名称:
multimedia_camera.md
所在目录:
Openharmony v1.0 / docs / docs-en / api / api-SmartVision-Devices
文件大小:
17.25 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# MultiMedia\_Camera
## **Overview**
Defines the **Camera** class for camera-related operations.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Files









File Name


Description


camera.h


Declares functions in the Camera class to implement camera operations.



## Data Structures









Data Structure Name


Description


OHOS::Media::Camera


Provides functions in the Camera class to implement camera operations. operations.



## Functions




































Function Name


Description


OHOS::Media::Camera::~Camera ()=default


virtual


A destructor used to delete the Camera instance.


OHOS::Media::Camera::GetCameraId ()


virtual std::string


Obtains the camera ID.


OHOS::Media::Camera::GetCameraConfig () const


virtual const CameraConfig *


Obtains the camera configuration. You can use the obtained CameraConfig object to configure the camera.


OHOS::Media::Camera::GetFrameConfig (int32_t type)


virtual FrameConfig *


Obtains the frame configuration.


OHOS::Media::Camera::Configure (CameraConfig &config)


virtual void


Configures the camera using the CameraConfig object.


OHOS::Media::Camera::TriggerLoopingCapture (FrameConfig &frameConfig)


virtual int32_t


Triggers looping-frame capture.


OHOS::Media::Camera::StopLoopingCapture ()


virtual void


Stops looping-frame capture.


OHOS::Media::Camera::TriggerSingleCapture (FrameConfig &frameConfig)


virtual int32_t


Starts single-frame capture. The frame parameters are set through the FrameConfig object, and the captured image data is stored in the surface of the FrameConfig object.


OHOS::Media::Camera::Release ()


virtual void


Releases the Camera object and associated resources.


OHOS::Media::Camera::Camera ()=default



A constructor used to create a Camera instance.



## **Details**
## **Function Documentation**
## Camera\(\)
```
OHOS::Media::Camera::Camera ()
```
**Description:**
A constructor used to create a **[Camera](ohos-media-camera.md)** instance.
## Configure\(\)
```
virtual void OHOS::Media::Camera::Configure ([CameraConfig](ohos-media-cameraconfig.md) & config)
```
**Description:**
Configures the camera using the **[CameraConfig](ohos-media-cameraconfig.md)** object.
**Parameters:**









Name


Description


config Indicates the pointer to the CameraConfig object.

## GetCameraConfig\(\)
```
virtual const [CameraConfig](ohos-media-cameraconfig.md)* OHOS::Media::Camera::GetCameraConfig () const
```
**Description:**
Obtains the camera configuration. You can use the obtained **[CameraConfig](ohos-media-cameraconfig.md)** object to configure the camera.
**Returns:**
Returns the pointer to the **[CameraConfig](ohos-media-cameraconfig.md)** object if obtained; returns **NULL** otherwise.
## GetCameraId\(\)
```
virtual std::string OHOS::Media::Camera::GetCameraId ()
```
**Description:**
Obtains the camera ID.
**Returns:**
Returns the camera ID if obtained; returns the "Error" string if the camera fails to be created.
## GetFrameConfig\(\)
```
virtual [FrameConfig](ohos-media-frameconfig.md)* OHOS::Media::Camera::GetFrameConfig (int32_t type)
```
**Description:**
Obtains the frame configuration.
**Parameters:**









Name


Description


type Indicates the type of the frame configuration.

**Returns:**
Returns the pointer to the **[FrameConfig](ohos-media-frameconfig.md)** object if obtained; returns **NULL** otherwise.
## Release\(\)
```
virtual void OHOS::Media::Camera::Release ()
```
**Description:**
Releases the **[Camera](ohos-media-camera.md)** object and associated resources.
## StopLoopingCapture\(\)
```
virtual void OHOS::Media::Camera::StopLoopingCapture ()
```
**Description:**
Stops looping-frame capture.
**Returns:**
Returns **true** if the looping-frame capture is successfully stopped; returns **false** otherwise.
## TriggerLoopingCapture\(\)
```
virtual int32_t OHOS::Media::Camera::TriggerLoopingCapture ([FrameConfig](ohos-media-frameconfig.md) & frameConfig)
```
**Description:**
Triggers looping-frame capture.
**Parameters:**









Name


Description


fc Indicates the frame configuration.

**Returns:**
Returns **true** if the looping-frame capture is successfully started; returns **false** otherwise.
## TriggerSingleCapture\(\)
```
virtual int32_t OHOS::Media::Camera::TriggerSingleCapture ([FrameConfig](ohos-media-frameconfig.md) & frameConfig)
```
**Description:**
Starts single-frame capture. The frame parameters are set through the **[FrameConfig](ohos-media-frameconfig.md)** object, and the captured image data is stored in the surface of the **[FrameConfig](ohos-media-frameconfig.md)** object.
**Parameters:**









Name


Description


fc Indicates the frame configuration.

**Returns:**
Returns **true** if the single-frame capture is successfully started and the data is stored; returns **false** otherwise.
## \~Camera\(\)
```
virtual OHOS::Media::Camera::~Camera ()
```
**Description:**
A destructor used to delete the **[Camera](ohos-media-camera.md)** instance.
点赞 回复
回帖
支持markdown部分语法 ?