Skip to content

Commit 5c384cf

Browse files
Merge pull request #714 from dynamsoft-docs/preview
Preview
2 parents 40be462 + 41a8de3 commit 5c384cf

File tree

2 files changed

+77
-38
lines changed

2 files changed

+77
-38
lines changed

_includes/release-notes/product-highlight-10.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
`DynamsoftBarcodeReader` SDK has been refactored to integrate with `DynamsoftCaptureVision (DCV)` architecture, which is newly established to aggregate the features of functional products powered by Dynamsoft. The features are designed to be pluggable, customizable and interactable. In addition, the functional products share the computation so that their processing speed is much higher than working individually.
2+
`DynamsoftBarcodeReader` SDK has been revamped to integrate with `DynamsoftCaptureVision (DCV)` architecture, which is newly established to aggregate the features of functional products powered by Dynamsoft. The features are designed to be pluggable, customizable and interactable. In addition, the functional products share the computation so that their processing speed is much higher than working individually.
33

44
* `DynamsoftCaptureVision` architecture consists of:
55
* `ImageSourceAdapter(ISA)`, the standard input interface for you to convert image data from different sources into the standard input image data. In addition, `ISA` incorporates an image buffer management system that allows instant access to the buffered image data.

programming/usecases/read-postal-codes.md

Lines changed: 76 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Dynamsoft Barcode Reader (DBR) supports the following types of postal codes. Det
2323

2424
## Particular Parameter Required
2525

26-
DBR provides a parameter, [`BarcodeFormatIds`]({{ site.dcv_parameters_reference }}barcode-reader-task-settings/barcode-format-ids.html), to control the formats of the barcode to process. To enable decoding the postal codes, simply set a `BF_POSTALCODE` or a specific postal code format enumeration to this parameter.
26+
DBR provides a parameter, [`BarcodeFormatIds`]({{ site.dcv_parameters_reference }}barcode-reader-task-settings/barcode-format-ids.html){:target="_blank"}, to control the formats of the barcode to process. To enable decoding the postal codes, simply set a `BF_POSTALCODE` or a specific postal code format enumeration to this parameter.
2727

2828
## Sample Code
2929

@@ -33,6 +33,9 @@ You can configure the parameter `BarcodeFormatIds` in two different ways, depend
3333

3434
<div class="sample-code-prefix template2"></div>
3535
>- C++
36+
>- Android
37+
>- Objective-C
38+
>- Swift
3639
>
3740
>
3841
```c++
@@ -46,6 +49,42 @@ settings.barcodeSettings.barcodeFormatIds = BF_POSTALCODE;
4649
// Update the settings.
4750
cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 256);
4851
```
52+
>
53+
```java
54+
try {
55+
// Obtain current runtime settings. `cvr` is an instance of `CaptureVisionRouter`.
56+
// Here we use `EnumPresetTemplate.PT_READ_BARCODES` as an example. You can change it to your own template name or the name of other preset template.
57+
SimplifiedCaptureVisionSettings captureVisionSettings = cvr.getSimplifiedSettings(EnumPresetTemplate.PT_READ_BARCODES);
58+
captureVisionSettings.barcodeSettings.barcodeFormatIds = BF_POSTALCODE;
59+
// Update the settings. Remember to specify the same template name you used when getting the settings.
60+
cvr.updateSettings(EnumPresetTemplate.PT_READ_BARCODES, captureVisionSettings);
61+
} catch (CaptureVisionRouterException e) {
62+
e.printStackTrace();
63+
}
64+
```
65+
>
66+
```objc
67+
NSError *error;
68+
// Obtain current runtime settings. `cvr` is an instance of `CaptureVisionRouter`.
69+
// Here we use `EnumPresetTemplate.PT_READ_BARCODES` as an example. You can change it to your own template name or the name of other preset template.
70+
DSSimplifiedCaptureVisionSettings *captureVisionSettings = [self.cvr getSimplifiedSettings:DSPresetTemplateReadBarcodes error:&error];
71+
captureVisionSettings.barcodeSettings.barcodeFormatIds = DSBarcodeFormatPostalCode;
72+
// Update the settings. Remember to specify the same template name you used when getting the settings.
73+
[self.cvr updateSettings:DSPresetTemplateReadBarcodes settings:captureVisionSettings error:&error];
74+
```
75+
>
76+
```swift
77+
do{
78+
// Obtain current runtime settings. `cvr` is an instance of `CaptureVisionRouter`.
79+
// Here we use `EnumPresetTemplate.PT_READ_BARCODES` as an example. You can change it to your own template name or the name of other preset template.
80+
let captureVisionSettings = try cvr.getSimplifiedSettings(PresetTemplate.readBarcodes.rawValue)
81+
captureVisionSettings.barcodeSettings?.barcodeFormatIds = .postalCode
82+
// Update the settings. Remember to specify the same template name you used when getting the settings.
83+
try cvr.updateSettings(PresetTemplate.readBarcodes.rawValue, settings: captureVisionSettings)
84+
}catch{
85+
// Add code to do when error occurs.
86+
}
87+
```
4988

5089
* Configure barcode format via `JSON parameter template file`
5190
* update parameter `BarcodeFormatIds` in JSON template
@@ -76,40 +115,40 @@ cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 25
76115

77116
* apply settings by calling method `InitSettingsFromFile`
78117

79-
<div class="sample-code-prefix template2"></div>
80-
>- C++
81-
>- Android
82-
>- Objective-C
83-
>- Swift
84-
>
118+
<div class="sample-code-prefix template2"></div>
119+
>- C++
120+
>- Android
121+
>- Objective-C
122+
>- Swift
85123
>
86-
```c++
87-
char szErrorMsg[256] = {0};
88-
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
89-
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
90-
// more process here
91-
```
92-
>
93-
```java
94-
try {
95-
// `cvr` is an instance of `CaptureVisionRouter`.
96-
cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
97-
} catch (CaptureVisionRouterException e) {
98-
e.printStackTrace();
99-
}
100-
```
101-
>
102-
```objc
103-
NSError *error;
104-
// `cvr` is an instance of `DSCaptureVisionRouter`.
105-
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
106-
```
107-
>
108-
```swift
109-
do{
110-
//`cvr` is an instance of `CaptureVisionRouter`.
111-
try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
112-
}catch{
113-
// Add code to do when error occurs.
114-
}
115-
```
124+
>
125+
```c++
126+
char szErrorMsg[256] = {0};
127+
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
128+
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
129+
// more process here
130+
```
131+
>
132+
```java
133+
try {
134+
// `cvr` is an instance of `CaptureVisionRouter`.
135+
cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
136+
} catch (CaptureVisionRouterException e) {
137+
e.printStackTrace();
138+
}
139+
```
140+
>
141+
```objc
142+
NSError *error;
143+
// `cvr` is an instance of `DSCaptureVisionRouter`.
144+
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
145+
```
146+
>
147+
```swift
148+
do{
149+
//`cvr` is an instance of `CaptureVisionRouter`.
150+
try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
151+
}catch{
152+
// Add code to do when error occurs.
153+
}
154+
```

0 commit comments

Comments
 (0)