From 884a129a7373813a48b3ff4f685749caaa38a38d Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Tue, 25 Nov 2025 14:17:14 +0800 Subject: [PATCH] update to internal commit 68b9b4f8 --- .../flutter/api-reference/camera-enhancer.md | 116 ++++++++++-------- .../api-reference/camera-toggle-button.md | 26 ++-- .../flutter/api-reference/camera-view.md | 42 +++---- .../api-reference/enum/camera-position.md | 35 ------ .../api-reference/enum/colour-channel.md | 39 ------ .../api-reference/enum/drawing-layer-id.md | 35 ------ .../enum/enhanced-features-camera.md | 39 ------ .../flutter/api-reference/enum/focus-mode.md | 34 ----- programming/flutter/api-reference/feedback.md | 4 +- .../image-editor-view-controller.md | 61 +++++++++ .../api-reference/image-editor-view.md | 64 ++++++++++ .../flutter/api-reference/permission-util.md | 34 +++++ .../flutter/api-reference/torch-button.md | 30 +++-- 13 files changed, 282 insertions(+), 277 deletions(-) delete mode 100644 programming/flutter/api-reference/enum/camera-position.md delete mode 100644 programming/flutter/api-reference/enum/colour-channel.md delete mode 100644 programming/flutter/api-reference/enum/drawing-layer-id.md delete mode 100644 programming/flutter/api-reference/enum/enhanced-features-camera.md delete mode 100644 programming/flutter/api-reference/enum/focus-mode.md create mode 100644 programming/flutter/api-reference/image-editor-view-controller.md create mode 100644 programming/flutter/api-reference/image-editor-view.md create mode 100644 programming/flutter/api-reference/permission-util.md diff --git a/programming/flutter/api-reference/camera-enhancer.md b/programming/flutter/api-reference/camera-enhancer.md index d5cd21f..9acf1fb 100644 --- a/programming/flutter/api-reference/camera-enhancer.md +++ b/programming/flutter/api-reference/camera-enhancer.md @@ -17,7 +17,19 @@ The `CameraEnhancer` class provides camera-specific functionality including came *Assembly:* dynamsoft_capture_vision_flutter ```dart -class CameraEnhancer +class CameraEnhancer extends ImageSourceAdapter +``` + +## Static Properties + +| Property | Description | +| -------- | ----------- | +| [`instance`](#instance) | Returns the singleton instance of `CameraEnhancer`. | + +### instance + +```dart +static CameraEnhancer get instance; ``` ## Methods @@ -29,24 +41,42 @@ class CameraEnhancer | [`disableEnhancedFeatures`](#disableenhancedfeatures) | Disables the selected and activated enhanced features of the Camera Enhancer. | | [`enableEnhancedFeatures`](#enableenhancedfeatures) | Activates the selected enhanced features provided by the Camera Enhancer library, including the auto-zoom and smart torch features. | | [`getCameraPosition`](#getcameraposition) | Returns the current camera being used. | -| [`getColourChannelUsageType`](#getcolourchannelusagetype) | Retrieves the current colour channel that is being used by the camera enhancer. | | [`getFocusMode`](#getfocusmode) | Returns the current focus mode of the camera. | | [`getScanRegion`](#getscanregion) | Returns the current scan region. | +| [`getZoomFactor`](#getzoomfactor) | Returns the current zoom factor of the camera. | | [`open`](#open) | Opens the selected camera to begin the capture process. | | [`selectCamera`](#selectcamera) | Selects the camera based on the specified camera position. | -| [`setColourChannelUsageType`](#setcolourchannelusagetype) | Defines the colour channel used by the camera enhancer. | | [`setFocus`](#setfocus) | Sets the focus point as well as the mode for the camera. | +| [`setResolution`](#setresolution) | Sets the resolution of the camera. | | [`setScanRegion`](#setscanregion) | Sets the scan region of the camera and displays a bordered area on the UI. | | [`setZoomFactor`](#setzoomfactor) | Sets the zoom factor of the camera. | | [`turnOffTorch`](#turnofftorch) | Turns off the camera's flashlight (if available). | | [`turnOnTorch`](#turnontorch) | Turns on the camera's flashlight (if available). | +The following methods are inherited from superclass [`ImageSourceAdapter`]({{ site.dcv_flutter_api }}core/image-source-adapter.html) + +| Method | Description | +| ------ | ----------- | +| [`addImageToBuffer`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#addimagetobuffer) | Adds an image to the internal buffer. | +| [`clearBuffer`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#clearbuffer) | Clears all images from the buffer, resetting the state for new image fetching. | +| [`getBufferOverflowProtectionMode`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#getbufferoverflowprotectionmode) | Get the current mode for handling buffer overflow. | +| [`getColourChannelUsageType`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#getcolourchannelusagetype) | Get the current usage type for color channels in images. | +| [`getImage`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#getimage) | Get a buffered image. Implementing classes should return a Promise that resolves with an instance of `ImageData`. | +| [`getMaximumImageCount`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#getmaximumimagecount) | Get the maximum number of images that can be buffered. | +| [`hasImage`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#hasimage) | Checks if an image with the specified ID is present in the buffer. | +| [`setBufferOverflowProtectionMode`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#setbufferoverflowprotectionmode) | Sets the behavior for handling new incoming images when the buffer is full. | +| [`setColourChannelUsageType`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#setcolourchannelusagetype) | Sets the usage type for color channels in images. | +| [`setMaximumImageCount`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#setmaximumimagecount) | Sets the maximum number of images that can be buffered at any time. | +| [`setNextImageToReturn`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#setnextimagetoreturn) | Sets the processing priority of a specific image. This can affect the order in which images are returned by getImage. | +| [`startFetching`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#startfetching) | Start fetching images from the source to the Video Buffer of `ImageSourceAdapter`. | +| [`stopFetching`]({{ site.dcv_flutter_api }}core/image-source-adapter.html#stopfetching) | Stop fetching images from the source to the Video Buffer of `ImageSourceAdapter`. | + ### close Closes the camera and releases the related resources. When the `CaptureVisionRouter` instance calls `stopCapturing`, please make sure to call this method as well to ensure that the resources are released properly. ```dart -Future close() +Future close(); ``` ### destroy @@ -54,28 +84,28 @@ Future close() Destroys the camera enhancer instance and releases the related resources on the host side. ```dart -Future destroy() +Future destroy(); ``` ### disableEnhancedFeatures -Disables the selected and activated enhanced features (represented by [`EnumEnhancedFeatures`](./enum/enhanced-features-camera.md)) of the Camera Enhancer. +Disables the selected and activated enhanced features (represented by [`EnumEnhancedFeatures`]({{ site.dcv_flutter_api }}core/enum/enhanced-features-camera.md)) of the Camera Enhancer. ```dart -Future disableEnhancedFeatures(int features) +Future disableEnhancedFeatures(int features); ``` ### enableEnhancedFeatures -Activates the selected enhanced features (represented by [`EnumEnhancedFeatures`](./enum/enhanced-features-camera.md)) provided by the Camera Enhancer library, including the auto-zoom and smart torch features. +Activates the selected enhanced features (represented by [`EnumEnhancedFeatures`]({{ site.dcv_flutter_api }}core/enum/enhanced-features-camera.md)) provided by the Camera Enhancer library, including the auto-zoom and smart torch features. ```dart -Future enableEnhancedFeatures(int features) +Future enableEnhancedFeatures(int features); ``` **Remarks** -This method must be used **after [`setInput`]({{ site.dcv_flutter_api }}capture-vision-router/capture-vision-router.html#setinput) and before the [`open`](#open) method**. If you would like to activate multiple enhanced features, then they must be combined using the OR (`|`) operator. +If you would like to activate multiple enhanced features, then they must be combined using the OR (`|`) operator. ```dart await _cvr.setInput(_camera); @@ -85,38 +115,34 @@ _camera.open(); ### getCameraPosition -Returns the current camera being used, represented as a [`EnumCameraPosition`](./enum/camera-position.md). +Returns the current camera being used, represented as a [`EnumCameraPosition`]({{ site.dcv_flutter_api }}core/enum/enhanced-features-camera.md). ```dart -Future getCameraPosition() async +Future getCameraPosition() async; ``` -### getColourChannelUsageType +### getFocusMode -Retrieves the current colour channel (as a [`EnumColourChannelUsageType`](./enum/colour-channel.md)) that is being used by the camera enhancer. +Returns the current focus mode of the camera, represented as a [`EnumFocusMode`]({{ site.dcv_flutter_api }}core/enum/focus-mode.md). ```dart -Future getColourChannelUsageType() +Future getFocusMode() async; ``` -**Remarks** - -This method should be used to verify which colour channel the camera is using, and in turn verify what pixel type any images retrieved during the capture process will come out in. - -### getFocusMode +### getScanRegion -Returns the current focus mode of the camera, represented as a [`EnumFocusMode`](./enum/focus-mode.md). +Returns the current scan region as a [`DSRect`]({{ site.dcv_flutter_api }}core/dsrect.html) object. ```dart -Future getFocusMode() async +Future getScanRegion() async; ``` -### getScanRegion +### getZoomFactor -Returns the current scan region as a [`DSRect`]({{ site.dcv_flutter_api }}core/dsrect.html) object. +Returns the current zoom factor of the camera. ```dart -Future getScanRegion() async +Future getZoomFactor(); ``` ### open @@ -124,41 +150,35 @@ Future getScanRegion() async Opens the selected camera to begin the capture process. ```dart -Future open() +Future open(); ``` ### selectCamera -Selects the camera based on the specified [`EnumCameraPosition`](./enum/camera-position.md). +Selects the camera based on the specified [`EnumCameraPosition`]({{ site.dcv_flutter_api }}core/enum/camera-position.md). ```dart -Future selectCamera(EnumCameraPosition position) +Future selectCamera(EnumCameraPosition position); ``` **Remarks** -If you attempt to select the **backDualWideAuto** or the **backUltraWide** cameras on an Android phone, an exception will be thrown as those cameras are only available on iPhones. Supported devices include: iPhone 13 Pro, iPhone 13 Pro Max, iPhone 14 Pro, iPhone 14 Pro Max, iPhone 15 Pro, iPhone 15 Pro Max. This method must be called **after [`setInput`]({{ site.dcv_flutter_api }}capture-vision-router/capture-vision-router.html#setinput) and before the [`open`](#open) method**. - -> *Exception* - "This camera position is only supported on iOS" +- **backUltraWide** & **backDualWideAuto**: iPhone only. -### setColourChannelUsageType +### setFocus -Defines the colour channel (as a [`EnumColourChannelUsageType`](./enum/colour-channel.md)) used by the camera enhancer - therefore determining whether the captured images or frames will come out in grayscale or colour (or one of the individual colours). +Sets the focus point as well as the mode (as a [`EnumFocusMode`]({{ site.dcv_flutter_api }}core/enum/focus-mode.md)) for the camera. ```dart -Future setColourChannelUsageType(EnumColourChannelUsageType type) +Future setFocus(Point point, EnumFocusMode focusMode); ``` -**Remarks** - -This method should be used to change the pixel type of the original image or captured frame should you choose to retrieve it after the capture process. In order to retrieve the original image after the barcode is decoded or the captured result is received, please refer to [this article]. - -### setFocus +### setResolution -Sets the focus point as well as the mode (as a [`EnumFocusMode`](./enum/focus-mode.md)) for the camera. +Sets the resolution of the camera. ```dart -Future setFocus(Point point, EnumFocusMode focusMode) +Future setResolution(EnumResolution resolution); ``` ### setScanRegion @@ -166,21 +186,19 @@ Future setFocus(Point point, EnumFocusMode focusMode) Sets the scan region of the camera and displays a bordered area on the UI to represent the scan region. To learn how to specify the scan region when using the Barcode Reader, please visit this [section of the foundational user guide]({{ site.dbr_flutter }}explore-features/ui-customization.html#specifying-a-scan-region). ```dart -Future setScanRegion(DSRect region) async +Future setScanRegion(DSRect region) async; ``` -**Remarks** - -This method must be called **after [`setInput`]({{ site.dcv_flutter_api }}capture-vision-router/capture-vision-router.html#setinput) and before the [`open`](#open) method**. The region is represented as a [`DSRect`]({{ site.dcv_flutter_api }}core/dsrect.html). +**See also** -> *Exception* - "Failed to set the scan region" +- [`DSRect`]({{ site.dcv_flutter_api }}core/dsrect.html). ### setZoomFactor Sets the zoom factor of the camera. ```dart -Future setZoomFactor(double zoom) +Future setZoomFactor(double zoom); ``` ### turnOffTorch @@ -188,7 +206,7 @@ Future setZoomFactor(double zoom) Turns off the camera's flashlight (if available). ```dart -Future turnOffTorch() +Future turnOffTorch(); ``` ### turnOnTorch @@ -196,5 +214,5 @@ Future turnOffTorch() Turns on the camera's flashlight (if available). ```dart -Future turnOnTorch() +Future turnOnTorch(); ``` diff --git a/programming/flutter/api-reference/camera-toggle-button.md b/programming/flutter/api-reference/camera-toggle-button.md index 61f97b3..6472288 100644 --- a/programming/flutter/api-reference/camera-toggle-button.md +++ b/programming/flutter/api-reference/camera-toggle-button.md @@ -20,11 +20,25 @@ noTitleIndex: true class CameraToggleButton ``` +## Constructors + +```dart +CameraToggleButton({ + required this.location, + this.imageBase64, +}); +``` + ## Properties +| Properties | Type | Description | +| ---------- | ---- | ----------- | +| [`location`](#location) | *Rect* | Defines the location of the camera button. This rectangle specifies the button's position and size on the screen. Coordinates are in logical pixels. | +| [`imageBase64`](#imagebase64) | *String* | A base 64 string that specifies the camera toggle image. | + ### location -Defines the location of the camera toggle button (as a [Rect](https://api.flutter.dev/flutter/dart-ui/Rect-class.html)). This rectangle specifies the button's position and size on the screen. Coordinates are in pixels. +Defines the location of the camera button. This rectangle specifies the button's position and size on the screen. Coordinates are in logical pixels. ```dart Rect location; @@ -32,7 +46,7 @@ Rect location; ### imageBase64 -Sets the image (as a base64 string) to be used for the camera toggle button. +A base 64 string that specifies the camera toggle image. ```dart String? imageBase64; @@ -42,11 +56,3 @@ String? imageBase64; When setting the imageBase64 string, please note that the string should not include the `data:image/png;base64,` portion of the base64 string. -## Code Snippet - -```dart -final CameraToggleButton _cameraToggleBtn = CameraToggle( - location: Rect.fromLTWH(300, 30, 50, 50), - imageBase64: "" -) -``` \ No newline at end of file diff --git a/programming/flutter/api-reference/camera-view.md b/programming/flutter/api-reference/camera-view.md index c0d5509..acc125a 100644 --- a/programming/flutter/api-reference/camera-view.md +++ b/programming/flutter/api-reference/camera-view.md @@ -17,7 +17,23 @@ noTitleIndex: true *Assembly:* dynamsoft_capture_vision_flutter ```dart -class CameraView +class CameraView extends StatefulWidget +``` + +## Constructors + +```dart +const CameraView({ + super.key, + required this.cameraEnhancer, + this.torchButtonVisible, + this.scanRegionMaskVisible, + this.scanLaserVisible, + this.torchButton, + this.visibleLayerIds, + this.cameraToggleButtonVisible, + this.cameraToggleButton, +}); ``` ## Properties @@ -28,7 +44,7 @@ class CameraView | [`cameraToggleButton`](#cameratogglebutton) | Defines a custom widget to replace the default camera toggle button. | | [`cameraToggleButtonVisible`](#cameratogglebuttonvisible) | Determines whether the camera toggle button is visible. | | [`scanLaserVisible`](#scanlaservisible) | Determines whether the scan laser will be visible in the scan region. | -| [`scanRegionMaskVisible`](#scanregionmaskvisible) | Establishes whether the scan region will be represented visually using a mask. | +| [`scanRegionMaskVisible`](#scanregionmaskvisible) | Determines whether the scan region mask will be visible. (Scan region mask is a mask covered outside the scan region.) | | [`torchButtonVisible`](#torchbuttonvisible) | Controls the visibility of the torch/flash button. | | [`torchButton`](#torchbutton) | Defines a custom `TorchButton` instead of the default torch icon. | | [`visibleLayerIds`](#visiblelayerids) | Defines which drawing layer(s) to display on the camera view. | @@ -79,7 +95,7 @@ Defaults to `true` if not specified. ### scanRegionMaskVisible -Establishes whether the scan region (if defined via the `CameraEnhancer`) will be represented visually using a mask. The mask highlights the area where the barcode scanning occurs, and it defaults to `true` if not specified. +Determines whether the scan region mask will be visible. Scan region mask is a mask covered outside the scan region. ```dart final bool? scanRegionMaskVisible; @@ -111,7 +127,7 @@ final TorchButton? torchButton; ### visibleLayerIds -Defines which drawing layer(s) (see [`EnumDrawingLayerId`](../enum/drawing-layer-id.md)) to display on the camera view. The drawing layer is responsible for highlighting the captured result, so in the case of the Barcode Reader, the drawing layer would highlight any recognized barcodes. +Defines which drawing layer(s) (see [`EnumDrawingLayerId`]({{site.dcv_flutter_api}}core/enum/drawing-layer-id.html)) to display on the camera view. The drawing layer is responsible for highlighting the captured result, so in the case of the Barcode Reader, the drawing layer would highlight any recognized barcodes. ```dart final List? visibleLayerIds; @@ -120,21 +136,3 @@ final List? visibleLayerIds; **Remarks** The Capture Vision library can work with multiple functional products, including the Barcode Reader, Label Recognizer, and the Document Normalizer. If you would like to disable the feature to highlight any found barcodes, then the `visibleLayerIds` must not include `EnumDrawingLayerId.dbr`. - -## Code Snippet - -```dart -@override -Widget build(BuildContext context) { -return Scaffold( - appBar: AppBar(backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text(widget.title)), - body: Center(child: CameraView( - cameraEnhancer: _camera, - torchButtonVisible: true, - scanRegionMaskVisible: false, - scanLaserVisible: true, - torchButton: _torch, - visibleLayerIds: [EnumDrawingLayerId.dbr]) - ), -); -``` \ No newline at end of file diff --git a/programming/flutter/api-reference/enum/camera-position.md b/programming/flutter/api-reference/enum/camera-position.md deleted file mode 100644 index f85248a..0000000 --- a/programming/flutter/api-reference/enum/camera-position.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -layout: default-layout -title: EnumCameraPosition - Dynamsoft Barcode Reader Flutter -description: Enumeration EnumCameraPosition of DBR Flutter Edition defines the possible camera(s) to choose from. -keywords: camera enhancer, position, flutter, barcode -needAutoGenerateSidebar: true -needGenerateH3Content: true -breadcrumbText: EnumCameraPosition ---- - -# EnumCameraPosition - -`EnumCameraPosition` is an enumeration that defines the possible camera positions that are available to a device. The majority of modern mobile devices have a front and a rear camera. The more recent iPhones also come with multiple rear cameras, each being suited to different scenarios. - -## Definition - -*Assembly:* dynamsoft_capture_vision_flutter - -```dart -enum EnumCameraPosition { - back, - front, - backUltraWide, - backDualWideAuto -} -``` - -## Members - -| Member | Description | -| ------ | ----------- | -| `back` | The default, back-facing camera. It is a wide-angle camera for general usage. | -| `front` | The front-facing camera. | -| `backUltraWide` | The back-facing ultra-wide-angle camera - which should be used for macro-distance scenarios. (iOS ONLY) | -| `backDualWideAuto` | The back-facing virtual camera that can automatically switch between the default wide-angle and the ultra-wide-angle cameras. Supported devices include: iPhone 13 Pro, iPhone 13 Pro Max, iPhone 14 Pro, iPhone 14 Pro Max, iPhone 15 Pro, iPhone 15 Pro Max. (iOS ONLY) | diff --git a/programming/flutter/api-reference/enum/colour-channel.md b/programming/flutter/api-reference/enum/colour-channel.md deleted file mode 100644 index 745dd7c..0000000 --- a/programming/flutter/api-reference/enum/colour-channel.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: default-layout -title: EnumColourChannelUsageType - Dynamsoft Barcode Reader Flutter -description: Enumeration EnumColourChannelUsageType of DBR Flutter Edition defines the available colour channels for the Camera Enhancer to use when capturing images or frames -keywords: colour channel, capture vision, camera, enhancer, pixel, format -needAutoGenerateSidebar: true -needGenerateH3Content: true -breadcrumbText: EnumColourChannelUsageType ---- - -# EnumColourChannelUsageType - -`EnumColourChannelUsageType` is an enumeration that specifies the different colour channels that are available to the Camera Enhancer. The colour channel affects the pixel type that the captured images or frames will come out in, so it can output grayscale or colour images. - -## Definition - -*Assembly:* dynamsoft_capture_vision_flutter - -```dart -enum EnumColourChannelUsageType { - auto, - fullChannel, - yChannelOnly, - rgbRChannelOnly, - rgbGChannelOnly, - rgbBChannelOnly -} -``` - -## Members - -| Member | Description | -| ------ | ----------- | -| `auto` | Automatic colour channel usage determination based on image pixel format and scene. | -| `fullChannel` | Uses all colour channels to output a full colour image. | -| `yChannelOnly` | Uses only the luminance channel to output a grayscale image. | -| `rgbRChannelOnly` | Uses only the red channel of the RGB space. | -| `rgbGChannelOnly` | Uses only the green channel of the RGB space. | -| `rgbBChannelOnly` | Uses only the blue channel of the RGB space. | diff --git a/programming/flutter/api-reference/enum/drawing-layer-id.md b/programming/flutter/api-reference/enum/drawing-layer-id.md deleted file mode 100644 index 3d4779b..0000000 --- a/programming/flutter/api-reference/enum/drawing-layer-id.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -layout: default-layout -title: EnumDrawingLayerId - Dynamsoft Barcode Reader Flutter -description: Enumeration EnumDrawingLayerId of DBR Flutter Edition defines the different drawing layers that the CameraView provides. -keywords: drawing layer, Flutter, camera enhancer, UI -needAutoGenerateSidebar: true -needGenerateH3Content: true -breadcrumbText: EnumDrawingLayerId ---- - -# EnumDrawingLayerId - -`EnumDrawingLayerId` is an enumeration that defines the different drawing layers that the CameraView provides. The drawing layer is responsible for creating the highlight boxes around detected barcodes and other captured results. By default, there is a drawing layer assigned to each functional product under Capture Vision. - -## Definition - -*Assembly:* dynamsoft_capture_vision_flutter - -```dart -enum EnumDrawingLayerId { - ddn, - dbr, - dlr, - tip -} -``` - -## Members - -| Member | Description | -| ------ | ----------- | -| `ddn` | The preset DrawingLayer for the Dynamsoft Document Normalizer. | -| `dbr` | The preset DrawingLayer for the Dynamsoft Barcode Reader. | -| `dlr` | The preset DrawingLayer for the Dynamsoft Label Recognizer. | -| `tip` | A custom DrawingLayer for tips. | diff --git a/programming/flutter/api-reference/enum/enhanced-features-camera.md b/programming/flutter/api-reference/enum/enhanced-features-camera.md deleted file mode 100644 index aedd024..0000000 --- a/programming/flutter/api-reference/enum/enhanced-features-camera.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: default-layout -title: EnumEnhancedFeatures - Dynamsoft Barcode Reader Flutter -description: Enumeration EnumEnhancedFeatures of DBR Flutter Edition defines the enhanced features of the Camera Enhancer that can be activated. -keywords: enhanced features, Flutter, camera enhancer, zoom, torch -needAutoGenerateSidebar: true -needGenerateH3Content: true -breadcrumbText: EnumEnhancedFeatures ---- - -# EnumEnhancedFeatures - -`EnumEnhancedFeatures` is an enumeration that defines the set of enhanced features that the Camera Enhancer offers. These enhanced features can help improve the performance of the Barcode Reader or adapt it to certain difficult scenarios e.g. using auto-zoom for barcodes that are farther than normal. - -## Definition - -*Assembly:* dynamsoft_capture_vision_flutter - -```dart -enum EnumEnhancedFeatures { - frameFilter, - sensorControl, - enhancedFocus, - autoZoom, - smartTorch, - all -} -``` - -## Members - -| Member | Description | -| ------ | ----------- | -| `frameFilter` | Enables frame filtering to improve image quality, potentially leading to better read rate results. | -| `sensorControl` | Allows sensor control to automatically filter out any frames while the device is shaking. | -| `enhancedFocus` | Enhances the camera's focus capabilities, facilitating the camera to trigger auto-focus. This is especially useful for low-end mobile devices that do not have the ability to auto-focus. | -| `autoZoom` | Causes the camera to zoom in automatically when the barcode that it is trying to capture is far away, making the localization and decoding process easier for the Barcode Reader. | -| `smartTorch` | Activates the smart torch feature, which displays a torch button in the camera view when the environment brightness is low and hides the button if the brightness is high. | -| `all` | Enables all of the above enhanced features. | diff --git a/programming/flutter/api-reference/enum/focus-mode.md b/programming/flutter/api-reference/enum/focus-mode.md deleted file mode 100644 index 5f3256b..0000000 --- a/programming/flutter/api-reference/enum/focus-mode.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -layout: default-layout -title: EnumFocusMode - Dynamsoft Barcode Reader Flutter -description: Enumeration EnumFocusMode of DBR Flutter Edition defines the available focus modes of the Camera Enhancer. -keywords: focus mode, capture vision, camera, enhancer -needAutoGenerateSidebar: true -needGenerateH3Content: true -breadcrumbText: EnumFocusMode ---- - -# EnumFocusMode - -`EnumFocusMode` is an enumeration that specifies the different modes of focus that the Camera Enhancer can apply to the camera feed. - -> [!TIP] -> If you choose to use the locked focus mode, the focal length used is determined by the input value of [`setFocus`](../camera-enhancer.md#setfocus). - -## Definition - -*Assembly:* dynamsoft_capture_vision_flutter - -```dart -enum EnumFocusMode { - locked, - continuousAuto -} -``` - -## Members - -| Member | Description | -| ------ | ----------- | -| `locked` | Lock the focal length with an input value. | -| `continuousAuto` | Implements a continuous autoFocus. | diff --git a/programming/flutter/api-reference/feedback.md b/programming/flutter/api-reference/feedback.md index 6afbbe2..a073c72 100644 --- a/programming/flutter/api-reference/feedback.md +++ b/programming/flutter/api-reference/feedback.md @@ -27,7 +27,7 @@ class FeedBack Plays a beep sound when a captured result is found. ```dart -Future beep() +static Future beep() ``` ### vibrate @@ -35,7 +35,7 @@ Future beep() Triggers a vibration when a captured result is found. ```dart -Future vibrate() +static Future vibrate() ``` ## Code Snippet diff --git a/programming/flutter/api-reference/image-editor-view-controller.md b/programming/flutter/api-reference/image-editor-view-controller.md new file mode 100644 index 0000000..eac762f --- /dev/null +++ b/programming/flutter/api-reference/image-editor-view-controller.md @@ -0,0 +1,61 @@ +--- +layout: default-layout +title: ImageEditorViewController Class - Dynamsoft Capture Vision Flutter +description: ImageEditorViewController class of Dynamsoft Capture Vision Flutter edition is the controller for managing and interacting with an ImageEditorView instance. +keywords: camera, enhancer, barcode reader, flutter, capture vision, view +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# ImageEditorViewController + +`ImageEditorViewController` is the controller for managing and interacting with an [`ImageEditorView`](image-editor-view.md) instance. + +Provides methods to control the native image editor platform view, including image manipulation and quadrilateral drawing operations. This controller bridges Flutter code with native platform functionality. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class ImageEditorViewController +``` + +## Constructors + +```dart +ImageEditorViewController(int id); +``` + +## Methods + +| Methods | Description | +| ------- | ----------- | +| [`setImageData`](#setimagedata) | Sets the image data to be displayed and edited in the native view. | +| [`setDrawingQuads`](#setdrawingquads) | Updates the drawing quadrilaterals on a specific drawing layer. | +| [`getSelectedQuad`](#getselectedquad) | Retrieves the currently selected quadrilateral from the editor. | + +### setImageData + +Sets the image data to be displayed and edited in the native view. + +```dart +Future setImageData(ImageData imageData) async; +``` + +### setDrawingQuads + +Updates the drawing quadrilaterals on a specific drawing layer. + +```dart +Future setDrawingQuads(List drawingQuads, int drawingLayerId) async; +``` + +### getSelectedQuad + +Retrieves the currently selected quadrilateral from the editor. + +```dart +Future getSelectedQuad() async; +``` diff --git a/programming/flutter/api-reference/image-editor-view.md b/programming/flutter/api-reference/image-editor-view.md new file mode 100644 index 0000000..8e6def2 --- /dev/null +++ b/programming/flutter/api-reference/image-editor-view.md @@ -0,0 +1,64 @@ +--- +layout: default-layout +title: ImageEditorView Class - Dynamsoft Capture Vision Flutter +description: ImageEditorView class of DCV Flutter edition represents an image editor view, which allows users to add interactable UI elements on the view. +keywords: camera, enhancer, barcode reader, flutter, capture vision, view +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# ImageEditorView + +`ImageEditorView` is a widget that allows users to add interactable UI elements on the view. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class ImageEditorView extends StatefulWidget +``` + +## Constructors + +```dart +const ImageEditorView({ + super.key, + this.imageData, + this.drawingQuadsByLayer, + this.onPlatformViewCreated, +}); +``` + +## Properties + +| Property | Description | +| -------- | ----------- | +| [`imageData`](#imagedata) | The initial image to display in the editor when created. | +| [`drawingQuadsByLayer`](#drawingquadsbylayer) | Pre-populated drawing quadrilaterals organized by layer. | +| [`onPlatformViewCreated`](#onplatformviewcreated) | Callback invoked when the native platform view is successfully created. | + +### imageData + +The initial image to display in the editor when created. + +```dart +final ImageData? imageData; +``` + +### drawingQuadsByLayer + +Pre-populated drawing quadrilaterals organized by layer. + +```dart +final Map>? drawingQuadsByLayer; +``` + +### onPlatformViewCreated + +Callback invoked when the native platform view is successfully created. + +```dart +final void Function(ImageEditorViewController)? onPlatformViewCreated; +``` diff --git a/programming/flutter/api-reference/permission-util.md b/programming/flutter/api-reference/permission-util.md new file mode 100644 index 0000000..83f99ad --- /dev/null +++ b/programming/flutter/api-reference/permission-util.md @@ -0,0 +1,34 @@ +--- +layout: default-layout +title: PermissionUtil Class - Dynamsoft Capture Vision Flutter +description: PermissionUtil class of DCV Flutter handles the camera permissions on Android devices. +keywords: permission util, camera, capture vision, android, camera enhancer +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# PermissionUtil + +The `PermissionUtil` class handles the camera permissions on Android devices. It provides static methods for requesting camera permissions specifically on Android devices. + +> [!NOTE] +> For iOS, the camera permissions are granted via the Info.plist or the Info settings of the project. + +## Definition + +*Assembly:* dynamsoft_capture_vision_flutter + +```dart +class PermissionUtil +``` + +## Methods + +### requestCameraPermission + +Requests camera permission from the Android user. On other platforms (iOS), this method does nothing and returns immediately. + +```dart +static Future requestCameraPermission(); +``` diff --git a/programming/flutter/api-reference/torch-button.md b/programming/flutter/api-reference/torch-button.md index e424a1d..3f16796 100644 --- a/programming/flutter/api-reference/torch-button.md +++ b/programming/flutter/api-reference/torch-button.md @@ -20,15 +20,31 @@ noTitleIndex: true class TorchButton ``` +## Constructor + +```dart +TorchButton({ + required this.location, + this.torchOnImageBase64, + this.torchOffImageBase64, +}); +``` + ## Properties +| Property | Description | +| -------- | ----------- | +| [`location`](#location) | *Rect* | Defines the location of the camera button. This rectangle specifies the button's position and size on the screen. Coordinates are in logical pixels. | +| [`torchOnImageBase64`](#torchonimagebase64) | *String* | Sets the icon image (as a base64 string) that will be displayed when the torch is on. | +| [`torchOffImageBase64`](#torchoffimagebase64) | *String* | Sets the icon image (as a base64 string) that will be displayed when the torch is off. | + ### location Sets the location of the torch button as a [Rect](https://api.flutter.dev/flutter/dart-ui/Rect-class.html) - this rectangle specifies the button's position and size on the screen. When creating a custom torch button, **this property must be set**. ```dart - Rect location; - ``` +Rect location; +``` **Remarks** @@ -49,13 +65,3 @@ Sets the icon image (as a base64 string) that will be displayed when the torch i ```dart String? torchOffImageBase64; ``` - -## Code Snippet - -```dart -final TorchButton _torch = TorchButton( - location: Rect.fromLTWH(300, 30, 50, 50), // places the torch button towards the top-right corner of the camera view - torchOffImageBase64: 'insert_base64_string_here', - torchOnImageBase64: 'insert_base64_string_here' -); -```