|
| 1 | +--- |
| 2 | +layout: default-layout |
| 3 | +title: CameraEnhancer Class - Dynamsoft Capture Vision MAUI Edition |
| 4 | +description: CameraEnhancer Class of DCV MAUI edition is the class that defines camera controlling APIs. |
| 5 | +keywords: Camera, scan region, focus mode, zoom factor |
| 6 | +needGenerateH3Content: true |
| 7 | +needAutoGenerateSidebar: true |
| 8 | +noTitleIndex: true |
| 9 | +--- |
| 10 | + |
| 11 | +# CameraEnhancer |
| 12 | + |
| 13 | +The `CameraEnhancer` class is the primary class of Dynamsoft Camera Enhancer that defines the camera controlling APIs. It is a subclass of `ImageSourceAdapter`. |
| 14 | + |
| 15 | +## Definition |
| 16 | + |
| 17 | +*Namespace:* Dynamsoft.CameraEnhancer.Maui |
| 18 | + |
| 19 | +*Assembly:* Dynamsoft.CaptureVisionRouter.Maui |
| 20 | + |
| 21 | +```java |
| 22 | +class CameraEnhancer : ImageSourceAdapter |
| 23 | +``` |
| 24 | + |
| 25 | +## Methods |
| 26 | + |
| 27 | +| Method | Description | |
| 28 | +|------- |-------------| |
| 29 | +| [`CameraEnhancer(CameraView cameraView)`](#cameraenhancercameraview-cameraview) | The constructor. Initialize the `CameraEnhancer` with a `CameraView` instance. | |
| 30 | +| [`CameraEnhancer`](#cameraenhancer-1) | The constructor. | |
| 31 | +| [`SetCameraView`](#setcameraview) | Set/get the `CameraView` instance that bind with this `CameraEnhancer` instance. | |
| 32 | +| [`GetCameraView`](#getcameraview) | Set/get the `CameraView` instance that bind with this `CameraEnhancer` instance. | |
| 33 | +| [`Open`](#open) | Open the camera. | |
| 34 | +| [`Close`](#close) | Close the camera. | |
| 35 | +| [`SetScanRegion`](#setscanregion) | Set a scan region. The video frame is cropped based on the scan region. | |
| 36 | +| [`GetScanRegion`](#getscanregion) | Get a scan region. | |
| 37 | +| [`EnableEnhancedFeatures`](#enableenhancedfeatures) | Enable the specified enhanced features. View EnumEnhancedFeatures for more details. | |
| 38 | +| [`DisableEnhancedFeatures`](#disableenhancedfeatures) | Disable the specified enhanced features. View EnumEnhancedFeatures for more details. | |
| 39 | +| [`SelectCamera`](#selectcamera) | Select a camera with a camera position. | |
| 40 | +| [`GetCameraPosition`](#getcameraposition) | Select a camera with a camera position. | |
| 41 | +| [`SetZoomFactor`](#setzoomfactor) | Set the zoom factor of the camera. | |
| 42 | +| [`GetZoomFactor`](#getzoomfactor) | Get the zoom factor of the camera. | |
| 43 | +| [`SetFocus`](#setfocus) | Set the focus point of interest and trigger an one-off auto-focus. After the focus, you can either lock the focalngth or keep the continuous auto focus enabled by configuring the subsequent focus mode. | |
| 44 | +| [`GetFocusMode`](#getfocusmode) | Set the focus point of interest and trigger an one-off auto-focus. After the focus, you can either lock the focalngth or keep the continuous auto focus enabled by configuring the subsequent focus mode. | |
| 45 | + |
| 46 | +The following methods are inherited from superclass [`ImageSourceAdapter`]({{ site.dcv_android_api }}core/image-source-adapter.html) |
| 47 | + |
| 48 | +| Method | Description | |
| 49 | +| ------ | ----------- | |
| 50 | +| [`StartFetching`]({{ site.dcv_maui_api }}core/image-source-adapter.html#startfetching) | Start fetching images from the source to the Video Buffer of ImageSourceAdapter. | |
| 51 | +| [`StopFetching`]({{ site.dcv_maui_api }}core/image-source-adapter.html#stopfetching) | Stop fetching images from the source to the Video Buffer of ImageSourceAdapter. | |
| 52 | +| [`SetMaximumImageCount`]({{ site.dcv_maui_api }}core/image-source-adapter.html#setmaximumimagecount) | Sets the maximum number of images that can be buffered at any time. | |
| 53 | +| [`GetMaximumImageCount`]({{ site.dcv_maui_api }}core/image-source-adapter.html#getmaximumimagecount) | Returns the maximum number of images that can be buffered. | |
| 54 | +| [`GetImageCount`]({{ site.dcv_maui_api }}core/image-source-adapter.html#getimagecount) | Returns the current number of images in the buffer. | |
| 55 | +| [`IsBufferEmpty`]({{ site.dcv_maui_api }}core/image-source-adapter.html#isbufferempty) | Determines whether the buffer is currently empty. | |
| 56 | +| [`ClearBuffer`]({{ site.dcv_maui_api }}core/image-source-adapter.html#clearbuffer) | Clears all images from the buffer, resetting the state for new image fetching. | |
| 57 | +| [`SetColourChannelUsageType`]({{ site.dcv_maui_api }}core/image-source-adapter.html#setcolourchannelusagetype) | Sets the usage type for color channels in images. | |
| 58 | +| [`GetColourChannelUsageType`]({{ site.dcv_maui_api }}core/image-source-adapter.html#getcolourchannelusagetype) | Returns the current usage type for color channels in images. | |
| 59 | + |
| 60 | +### CameraEnhancer(CameraView cameraView) |
| 61 | + |
| 62 | +The constructor. Initialize the `CameraEnhancer` with a `CameraView` instance. |
| 63 | + |
| 64 | +```csharp |
| 65 | +CameraEnhancer(CameraView cameraView); |
| 66 | +``` |
| 67 | + |
| 68 | +**Parameters** |
| 69 | + |
| 70 | +`cameraView`: A [`CameraView`](camera-view.md) instance. |
| 71 | + |
| 72 | +### CameraEnhancer |
| 73 | + |
| 74 | +The constructor. |
| 75 | + |
| 76 | +```csharp |
| 77 | +CameraEnhancer(); |
| 78 | +``` |
| 79 | + |
| 80 | +### SetCameraView |
| 81 | + |
| 82 | +Bind a `CameraView` instance with this `CameraEnhancer` instance. |
| 83 | + |
| 84 | +```csharp |
| 85 | +void SetCameraView(CameraView view); |
| 86 | +``` |
| 87 | + |
| 88 | +### GetCameraView |
| 89 | + |
| 90 | +Get the `CameraView` object that bind to this `CameraEnhancer`. |
| 91 | + |
| 92 | +```csharp |
| 93 | +CameraView GetCameraView(); |
| 94 | +``` |
| 95 | + |
| 96 | +### Open |
| 97 | + |
| 98 | +Open the camera. |
| 99 | + |
| 100 | +```csharp |
| 101 | +void Open(); |
| 102 | +``` |
| 103 | + |
| 104 | +### Close |
| 105 | + |
| 106 | +Close the camera. |
| 107 | + |
| 108 | +```csharp |
| 109 | +void Close(); |
| 110 | +``` |
| 111 | + |
| 112 | +### SetScanRegion |
| 113 | + |
| 114 | +Set a scan region. The video frame is cropped based on the scan region. To learn the full code to setting a scan region, please refer to the [scan region](../guide/scan-region.md) article. |
| 115 | + |
| 116 | +```csharp |
| 117 | +void SetScanRegion(DMRect scanRegion); |
| 118 | +``` |
| 119 | + |
| 120 | +**Parameters** |
| 121 | + |
| 122 | +`scanRegion`: A [`DMRect`]({{ site.dcv_maui_api }}core/rect.html) object. |
| 123 | + |
| 124 | +### GetScanRegion |
| 125 | + |
| 126 | +Get the scan region if one has been set. |
| 127 | + |
| 128 | +```csharp |
| 129 | +DMRect GetScanRegion(); |
| 130 | +``` |
| 131 | + |
| 132 | +**Return Value** |
| 133 | + |
| 134 | +A [`DMRect`]({{ site.dcv_android_api }}core/basic-structures/rect.html) object that represent the scan region area. |
| 135 | + |
| 136 | +### EnableEnhancedFeatures |
| 137 | + |
| 138 | +Enable the specified enhanced features. View [EnumEnhancedFeatures]({{ site.dce_maui_api }}enum/enhanced-features.html) to learn about these enhanced features. By default, these enhanced features are all disabled. |
| 139 | + |
| 140 | +```csharp |
| 141 | +void EnableEnhancedFeatures(EnumEnhancedFeatures features); |
| 142 | +``` |
| 143 | + |
| 144 | +**Parameters** |
| 145 | + |
| 146 | +`enhancedFeatures`: A combined value of `EnumEnhancedFeatures` which indicates a series of enhanced features. |
| 147 | + |
| 148 | +**Return Value** |
| 149 | + |
| 150 | +A bool value that indicates whether the enhanced features are enabled successfully. |
| 151 | + |
| 152 | +### DisableEnhancedFeatures |
| 153 | + |
| 154 | +Disable any enhanced features that have been previously enabled. View [EnumEnhancedFeatures]({{ site.dce_maui_api }}enum/enhanced-features.html) to learn about these enhanced features. |
| 155 | + |
| 156 | +```csharp |
| 157 | +void DisableEnhancedFeatures(EnumEnhancedFeatures features); |
| 158 | +``` |
| 159 | + |
| 160 | +**Parameters** |
| 161 | + |
| 162 | +`enhancedFeatures`: A combined value of `EnhancedFeatures` which indicates a series of enhanced features. |
| 163 | + |
| 164 | +### SelectCamera |
| 165 | + |
| 166 | +Select a camera with a camera position. |
| 167 | + |
| 168 | +```csharp |
| 169 | +void SelectCamera(EnumCameraPosition cameraPosition); |
| 170 | +``` |
| 171 | + |
| 172 | +**Parameters** |
| 173 | + |
| 174 | +`cameraPosition`: One of the [`EnumCameraPosition`]({{ site.dce_maui_api }}enum/camera-position.html) value. |
| 175 | + |
| 176 | +### GetCameraPosition |
| 177 | + |
| 178 | +Get the current camera position. |
| 179 | + |
| 180 | +```csharp |
| 181 | +EnumCameraPosition GetCameraPosition(); |
| 182 | +``` |
| 183 | + |
| 184 | +**Return Value** |
| 185 | + |
| 186 | +A `EnumCameraPosition` value that represents the current camera position. |
| 187 | + |
| 188 | +### SetZoomFactor |
| 189 | + |
| 190 | +Set the zoom factor of the camera. |
| 191 | + |
| 192 | +```csharp |
| 193 | +void SetZoomFactor(float zoomFactor); |
| 194 | +``` |
| 195 | + |
| 196 | +**Parameters** |
| 197 | + |
| 198 | +`zoomFactor`: The zoom factor. |
| 199 | + |
| 200 | +### GetZoomFactor |
| 201 | + |
| 202 | +Get the zoom factor of the camera. |
| 203 | + |
| 204 | +```csharp |
| 205 | +float GetZoomFactor(); |
| 206 | +``` |
| 207 | + |
| 208 | +**Return Value** |
| 209 | + |
| 210 | +The zoom factor. |
| 211 | + |
| 212 | +### SetFocus |
| 213 | + |
| 214 | +Set the focus point of interest and trigger an one-off auto-focus. After the focus, you can either lock the focalngth or keep the continuous auto focus enabled by configuring the subsequent focus mode. |
| 215 | + |
| 216 | +```csharp |
| 217 | +void SetFocus(Point focusPoint, EnumFocusMode subsequentFocusMode); |
| 218 | +``` |
| 219 | + |
| 220 | +**Parameters** |
| 221 | + |
| 222 | +`focusPoint`: The focus point of interest. The coordinate base of the point is "image". |
| 223 | +`subsequentFocusMode`: The subsequent focus mode of type [`EnumFocusMode`]({{ site.dce_maui_api }}enum/focus-mode.html). |
| 224 | + |
| 225 | +### GetFocusMode |
| 226 | + |
| 227 | +Get the current focus mode. |
| 228 | + |
| 229 | +```csharp |
| 230 | +EnumFocusMode GetFocusMode(); |
| 231 | +``` |
| 232 | + |
| 233 | +**Return Value** |
| 234 | + |
| 235 | +A [`EnumFocusMode`]({{ site.dce_maui_api }}enum/focus-mode.html) value that represents the current focus mode. |
0 commit comments