From 405874b7b8dd61bfde843c0229c268a5ce37edc2 Mon Sep 17 00:00:00 2001 From: Mayank Date: Mon, 12 Feb 2024 10:00:16 +0100 Subject: [PATCH 01/14] - Updated the SDK to v4.2.0 and fixed the breaking changes. --- Scanbot.SDK.Example.Forms/MainPage.cs | 2 +- .../Pages/ImageResultsPage.cs | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Scanbot.SDK.Example.Forms/MainPage.cs b/Scanbot.SDK.Example.Forms/MainPage.cs index cd33764..3b65143 100644 --- a/Scanbot.SDK.Example.Forms/MainPage.cs +++ b/Scanbot.SDK.Example.Forms/MainPage.cs @@ -88,7 +88,7 @@ async void ScanningUIClicked(object sender, EventArgs e) // If encryption is enabled, load the decrypted document. // Else accessible via page.Document - var blur = await SBSDK.Operations.EstimateBlurriness(await page.DecryptedDocument()); + var blur = await SBSDK.Operations.DetectDocumentQualityAsync(await page.DecryptedDocument()); //var blur = await SBSDK.Operations.EstimateBlurriness(page.Document); Console.WriteLine("Estimated blurriness for detected document: " + blur); } diff --git a/Scanbot.SDK.Example.Forms/Pages/ImageResultsPage.cs b/Scanbot.SDK.Example.Forms/Pages/ImageResultsPage.cs index 13fd834..e1b10ae 100644 --- a/Scanbot.SDK.Example.Forms/Pages/ImageResultsPage.cs +++ b/Scanbot.SDK.Example.Forms/Pages/ImageResultsPage.cs @@ -123,16 +123,26 @@ async void OnSaveButtonClick(object sender, EventArgs e) if (action.Equals(parameters[0])) { var fileUri = await SBSDK.Operations - .CreatePdfAsync(Pages.Instance.DocumentSources, PDFPageSize.FixedA4); + .CreatePdfAsync(Pages.Instance.DocumentSources, PDFPageSize.A4); ViewUtils.Alert(this, "Success: ", "Wrote documents to: " + fileUri.AbsolutePath); } else if (action.Equals(parameters[1])) { string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); string pdfFilePath = Path.Combine(path, Guid.NewGuid() + ".pdf"); - var languages = new[] { "en" }; - var result = await SBSDK.Operations.PerformOcrAsync(Pages.Instance.DocumentSources, languages, pdfFilePath); - // Or do something else with the results: result.Pages... + + var ocrConfig = SBSDK.Operations.OcrConfigs; + // Uncomment below code to use the old OCR approach. Use [OCRMode.Legacy] and set the required [InstalledLanguages] property. + //var languages = new List { "en", "de" }; + //var ocrConfig = new OcrConfigs + //{ + // InstalledLanguages = languages, + // OcrMode = OCRMode.Legacy, + // LanguageDataPath = ocrConfig.LanguageDataPath + //}; + + var result = await SBSDK.Operations.PerformOcrAsync(Pages.Instance.DocumentSources, ocrConfig, pdfFilePath); + // Or do something else with the result: result.Pages... ViewUtils.Alert(this, "PDF with OCR layer stored: ", pdfFilePath); } else if (action.Equals(parameters[2])) From 70cfe9967345f4c6fd16b159e5222f7758e90fbb Mon Sep 17 00:00:00 2001 From: Mayank Date: Mon, 12 Feb 2024 12:16:58 +0100 Subject: [PATCH 02/14] Native Renderer - Updated the projects with latest SDK. Fixed the issues related to OverlayConfigurations. --- .../Renderers/AndroidBarcodeCameraRenderer.cs | 32 ++++--- .../Delegates/BarcodeScannerDelegates.cs | 42 +++++++++ .../Native.Renderers.Example.Forms.iOS.csproj | 6 +- .../Renderers/IOSBarcodeCameraRenderer.cs | 85 ++++++++++--------- .../Utils/ViewUtils.cs | 24 ++++++ 5 files changed, 136 insertions(+), 53 deletions(-) create mode 100644 Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Delegates/BarcodeScannerDelegates.cs create mode 100644 Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Utils/ViewUtils.cs diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.Android/Renderers/AndroidBarcodeCameraRenderer.cs b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.Android/Renderers/AndroidBarcodeCameraRenderer.cs index 0430735..fec2335 100644 --- a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.Android/Renderers/AndroidBarcodeCameraRenderer.cs +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.Android/Renderers/AndroidBarcodeCameraRenderer.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using AndroidBarcode = IO.Scanbot.Sdk.Barcode.Entity.BarcodeItem; using ScanbotSDK.Xamarin.Forms; +using IO.Scanbot.Barcodescanner.Model; /* This is the Android Custom Renderer that will provide the actual implementation for BarcodeCameraView. @@ -43,6 +44,7 @@ class AndroidBarcodeCameraRenderer : ViewRenderer { e }; - var args = new BarcodeEventArgs(new IO.Scanbot.Sdk.Barcode.Entity.BarcodeScanningResult(items, new Java.Util.Date().Time), null); - OnBarcodeResult(this, args); + ScanbotSDK.Xamarin.Forms.BarcodeScanningResult outResult = new ScanbotSDK.Xamarin.Forms.BarcodeScanningResult + { + Barcodes = new List { e.ToFormsBarcode() }, + Image = e.Image.ToImageSource() + }; + + Element.OnBarcodeScanResult?.Invoke(outResult); } private void OnBarcodeResult(object sender, BarcodeEventArgs e) { - if (e.Result != null) + if (!SBSDK.IsLicenseValid && !showToast) + { + showToast = true; + cameraView.Post(() => Toast.MakeText(Context.GetActivity(), "License has expired!", ToastLength.Long).Show()); + return; + } + + var overlayEnabled = Element.OverlayConfiguration?.Enabled ?? false; + if (overlayEnabled == false || Element.OverlayConfiguration?.AutomaticSelectionEnabled == true) { ScanbotSDK.Xamarin.Forms.BarcodeScanningResult outResult = new ScanbotSDK.Xamarin.Forms.BarcodeScanningResult { @@ -153,11 +167,6 @@ private void OnBarcodeResult(object sender, BarcodeEventArgs e) Element.OnBarcodeScanResult?.Invoke(outResult); } - - if (e.Error != null) - { - cameraView.Post(() => Toast.MakeText(Context.GetActivity(), "License has expired!", ToastLength.Long).Show()); - } } #endregion @@ -186,11 +195,6 @@ private void SetSelectionOverlayConfiguration() cameraView.SelectionOverlayController.SetEnabled(Element.OverlayConfiguration.Enabled); cameraView.SelectionOverlayController.SetBarcodeHighlightedDelegate(this); cameraView.SelectionOverlayController.SetBarcodeAppearanceDelegate(this); - - if (resultHandler != null) - { - resultHandler.Success -= OnBarcodeResult; - } } } diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Delegates/BarcodeScannerDelegates.cs b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Delegates/BarcodeScannerDelegates.cs new file mode 100644 index 0000000..71204fd --- /dev/null +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Delegates/BarcodeScannerDelegates.cs @@ -0,0 +1,42 @@ +using Native.Renderers.Example.Forms.iOS.Utils; +using ScanbotSDK.iOS; +using ScanbotSDK.Xamarin.Forms; + +namespace Native.Renderers.Example.Forms.iOS +{ + + // Since we cannot directly inherit from SBSDKBarcodeScannerViewControllerDelegate in our ViewRenderer, + // we have created this wrapper class to allow binding to its events through the use of delegates + internal class BarcodeScannerDelegate : SBSDKBarcodeScannerViewControllerDelegate + { + public delegate void OnDetectHandler(SBSDKBarcodeScannerResult[] codes); + public OnDetectHandler OnDetect; + + public override void DidDetectBarcodes(SBSDKBarcodeScannerViewController controller, SBSDKBarcodeScannerResult[] codes) + { + OnDetect?.Invoke(codes); + } + + public override bool ShouldDetectBarcodes(SBSDKBarcodeScannerViewController controller) + { + if (!SBSDK.IsLicenseValid) + { + ViewUtils.ShowAlert("License Expired!", "Ok"); + return false; + } + return true; + } + } + + internal class BarcodeTrackingOverlayDelegate : SBSDKBarcodeTrackingOverlayControllerDelegate + { + public delegate void DidTapOnBarcodeAROverlay(SBSDKBarcodeScannerResult barcode); + public DidTapOnBarcodeAROverlay DidTapBarcodeOverlay; + + public override void DidTapOnBarcode(SBSDKBarcodeTrackingOverlayController controller, SBSDKBarcodeScannerResult barcode) + { + DidTapBarcodeOverlay?.Invoke(barcode); + } + } +} + diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Native.Renderers.Example.Forms.iOS.csproj b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Native.Renderers.Example.Forms.iOS.csproj index f66f541..abb31cf 100644 --- a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Native.Renderers.Example.Forms.iOS.csproj +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Native.Renderers.Example.Forms.iOS.csproj @@ -74,6 +74,8 @@ + + @@ -135,12 +137,14 @@ - 3.10.2 + 4.2.0-local.1 + + diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Renderers/IOSBarcodeCameraRenderer.cs b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Renderers/IOSBarcodeCameraRenderer.cs index 6c1c80f..9c72c69 100644 --- a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Renderers/IOSBarcodeCameraRenderer.cs +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Renderers/IOSBarcodeCameraRenderer.cs @@ -27,8 +27,6 @@ private UIViewController CurrentViewController } } - private BarcodeCameraView.BarcodeScannerResultHandler barcodeScannerResultHandler; - public IOSBarcodeCameraRenderer() : base() { } protected override void OnElementChanged(ElementChangedEventArgs e) @@ -46,61 +44,42 @@ protected override void OnElementChanged(ElementChangedEventArgs { barcode.ToFormsBarcode() } + }); } } diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Utils/ViewUtils.cs b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Utils/ViewUtils.cs new file mode 100644 index 0000000..090c45e --- /dev/null +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Utils/ViewUtils.cs @@ -0,0 +1,24 @@ +using UIKit; + +namespace Native.Renderers.Example.Forms.iOS.Utils +{ + public static class ViewUtils + { + /// + /// RootViewContoller from the view hierarchy. + /// + internal static UIViewController RooViewController => (UIApplication.SharedApplication?.Delegate as AppDelegate)?.Window?.RootViewController; + + // ------------------------------------------------------------------------------------------------------------------------ + // Displays a popup message with message and a single button.s + // ------------------------------------------------------------------------------------------------------------------------ + internal static void ShowAlert(string message, string buttonTitle) + { + var alert = UIAlertController.Create("Alert", message, UIAlertControllerStyle.Alert); + var action = UIAlertAction.Create(buttonTitle ?? "Ok", UIAlertActionStyle.Cancel, (obj) => { }); + alert.AddAction(action); + RooViewController?.PresentViewController(alert, true, null); + } + } +} + From edc93e89c8c4093086bc8478371b97c8c736ac81 Mon Sep 17 00:00:00 2001 From: Mayank Date: Mon, 19 Feb 2024 20:13:43 +0100 Subject: [PATCH 03/14] - Updated the Libraries.txt and beta packages to latest SDK 4.2.0 - Turned off encryption by default. --- Libraries.txt | 853 ++++++++++++++---- ...ive.Renderers.Example.Forms.Android.csproj | 3 +- .../Native.Renderers.Example.Forms.iOS.csproj | 2 +- .../Native.Renderers.Example.Forms.csproj | 2 +- .../MainApplication.cs | 15 +- .../Scanbot.SDK.Example.Forms.Android.csproj | 2 +- Scanbot.SDK.Example.Forms.iOS/AppDelegate.cs | 15 +- .../Scanbot.SDK.Example.Forms.iOS.csproj | 2 +- 8 files changed, 685 insertions(+), 209 deletions(-) diff --git a/Libraries.txt b/Libraries.txt index 0cc37ca..6adad8e 100644 --- a/Libraries.txt +++ b/Libraries.txt @@ -1,4 +1,4 @@ -Open Source libraries used in the Scanbot SDK for Xamarin and Xamarin.Forms version 3.10.2: +Open Source libraries used in the Scanbot SDK for Xamarin and Xamarin.Forms version 4.2.0: Xamarin.AndroidX: @@ -55,7 +55,7 @@ SOFTWARE. ------------------------------------------------------------------------------------------------------------------------ -Open Source libraries used in the Scanbot SDK for Android version 3.0.1 +Open Source libraries used in the Scanbot SDK for Android version 4.2.0 CWAC-Camera @@ -98,49 +98,6 @@ See the License for the specific language governing permissions and limitations under the License. -Android PDF Writer - -Version 1.0.10 -(https://github.com/Turbo87/apwlibrary/) - -Copyright (c) 2010 - 2013, Javier Santo Domingo (j-a-s-d@coderesearchlabs.com). -All rights reserved. - -Android PDF Writer (APW) is a simple Java library to generate simple PDF documents in -Google's Android devices distributed under a 2-clause -BSD license (https://github.com/Turbo87/apwlibrary/blob/master/doc/APW.pdf). - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of -conditions and the following disclaimer in the documentation and/or other materials -provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This software includes several classes from the Android Open Source Project Copyright 2010 -The Android Open Source Project. Licensed under the Apache License, Version 2.0 -(the License); you may not use this file except in compliance with the License. -You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the -License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -either express or implied. See the License for the specific language governing -permissions and limitations under the License. - - - Kotlin Standard Library Version 1.7.10 @@ -445,37 +402,517 @@ furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +Licenses for support code +------------------------- + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +BoringSSL uses the Chromium test infrastructure to run a continuous build, +trybots etc. The scripts which manage this, and the script for generating build +metadata, are under the Chromium license. Distributing code linked against +BoringSSL does not trigger this license. + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +icu4c + +Version 73.1 +(https://github.com/unicode-org/icu) + +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +See Terms of Use +for definitions of Unicode Inc.’s Data Files and Software. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2023 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in https://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +---------------------------------------------------------------------- + +Third-Party Software Licenses + +This section contains third-party software notices and/or additional +terms for licensed third-party software components included within ICU +libraries. + +---------------------------------------------------------------------- + +ICU License - ICU 1.8.1 to ICU 57.1 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. + +---------------------------------------------------------------------- + +Chinese/Japanese Word Break Dictionary Data (cjdict.txt) + + # The Google Chrome software developed by Google is licensed under + # the BSD license. Other software included in this distribution is + # provided under other licenses, as set forth below. + # + # The BSD License + # http://opensource.org/licenses/bsd-license.php + # Copyright (C) 2006-2008, Google Inc. + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided with + # the distribution. + # Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + # + # The word list in cjdict.txt are generated by combining three word lists + # listed below with further processing for compound word breaking. The + # frequency is generated with an iterative training against Google web + # corpora. + # + # * Libtabe (Chinese) + # - https://sourceforge.net/project/?group_id=1519 + # - Its license terms and conditions are shown below. + # + # * IPADIC (Japanese) + # - http://chasen.aist-nara.ac.jp/chasen/distribution.html + # - Its license terms and conditions are shown below. + # + # ---------COPYING.libtabe ---- BEGIN-------------------- + # + # /* + # * Copyright (c) 1999 TaBE Project. + # * Copyright (c) 1999 Pai-Hsiang Hsiao. + # * All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the TaBE Project nor the names of its + # * contributors may be used to endorse or promote products derived + # * from this software without specific prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # /* + # * Copyright (c) 1999 Computer Systems and Communication Lab, + # * Institute of Information Science, Academia + # * Sinica. All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the Computer Systems and Communication Lab + # * nor the names of its contributors may be used to endorse or + # * promote products derived from this software without specific + # * prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + # University of Illinois + # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 + # + # ---------------COPYING.libtabe-----END-------------------------------- + # + # + # ---------------COPYING.ipadic-----BEGIN------------------------------- + # + # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science + # and Technology. All Rights Reserved. + # + # Use, reproduction, and distribution of this software is permitted. + # Any copy of this software, whether in its original form or modified, + # must include both the above copyright notice and the following + # paragraphs. + # + # Nara Institute of Science and Technology (NAIST), + # the copyright holders, disclaims all warranties with regard to this + # software, including all implied warranties of merchantability and + # fitness, in no event shall NAIST be liable for + # any special, indirect or consequential damages or any damages + # whatsoever resulting from loss of use, data or profits, whether in an + # action of contract, negligence or other tortuous action, arising out + # of or in connection with the use or performance of this software. + # + # A large portion of the dictionary entries + # originate from ICOT Free Software. The following conditions for ICOT + # Free Software applies to the current dictionary as well. + # + # Each User may also freely distribute the Program, whether in its + # original form or modified, to any third party or parties, PROVIDED + # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear + # on, or be attached to, the Program, which is distributed substantially + # in the same form as set out herein and that such intended + # distribution, if actually made, will neither violate or otherwise + # contravene any of the laws and regulations of the countries having + # jurisdiction over the User or the intended distribution itself. + # + # NO WARRANTY + # + # The program was produced on an experimental basis in the course of the + # research and development conducted during the project and is provided + # to users as so produced on an experimental basis. Accordingly, the + # program is provided without any warranty whatsoever, whether express, + # implied, statutory or otherwise. The term "warranty" used herein + # includes, but is not limited to, any warranty of the quality, + # performance, merchantability and fitness for a particular purpose of + # the program and the nonexistence of any infringement or violation of + # any right of any third party. + # + # Each user of the program will agree and understand, and be deemed to + # have agreed and understood, that there is no warranty whatsoever for + # the program and, accordingly, the entire risk arising from or + # otherwise connected with the program is assumed by the user. + # + # Therefore, neither ICOT, the copyright holder, or any other + # organization that participated in or was otherwise related to the + # development of the program and their respective officials, directors, + # officers and other employees shall be held liable for any and all + # damages, including, without limitation, general, special, incidental + # and consequential damages, arising out of or otherwise in connection + # with the use or inability to use the program or any product, material + # or result produced or otherwise obtained by using the program, + # regardless of whether they have been advised of, or otherwise had + # knowledge of, the possibility of such damages at any time during the + # project or thereafter. Each user will be deemed to have agreed to the + # foregoing by his or her commencement of use of the program. The term + # "use" as used herein includes, but is not limited to, the use, + # modification, copying and distribution of the program and the + # production of secondary products from the program. + # + # In the case where the program, whether in its original form or + # modified, was distributed or delivered to or received by a user from + # any person, organization or entity other than ICOT, unless it makes or + # grants independently of ICOT any specific warranty to the user in + # writing, such person, organization or entity, will also be exempted + # from and not be held liable to the user for any such damages as noted + # above as far as the program is concerned. + # + # ---------------COPYING.ipadic-----END---------------------------------- + +---------------------------------------------------------------------- + +Lao Word Break Dictionary Data (laodict.txt) + + # Copyright (C) 2016 and later: Unicode, Inc. and others. + # License & terms of use: http://www.unicode.org/copyright.html + # Copyright (c) 2015 International Business Machines Corporation + # and others. All Rights Reserved. + # + # Project: https://github.com/rober42539/lao-dictionary + # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt + # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt + # (copied below) + # + # This file is derived from the above dictionary version of Nov 22, 2020 + # ---------------------------------------------------------------------- + # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, this + # list of conditions and the following disclaimer. Redistributions in binary + # form must reproduce the above copyright notice, this list of conditions and + # the following disclaimer in the documentation and/or other materials + # provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # OF THE POSSIBILITY OF SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Burmese Word Break Dictionary Data (burmesedict.txt) + + # Copyright (c) 2014 International Business Machines Corporation + # and others. All Rights Reserved. + # + # This list is part of a project hosted at: + # github.com/kanyawtech/myanmar-karen-word-lists + # + # -------------------------------------------------------------------------- + # Copyright (c) 2013, LeRoy Benjamin Sharon + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions + # are met: Redistributions of source code must retain the above + # copyright notice, this list of conditions and the following + # disclaimer. Redistributions in binary form must reproduce the + # above copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided + # with the distribution. + # + # Neither the name Myanmar Karen Word Lists, nor the names of its + # contributors may be used to endorse or promote products derived + # from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + # SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- +Time Zone Database -Licenses for support code -------------------------- + ICU uses the public domain data and code derived from Time Zone +Database for its time zone support. The ownership of the TZ database +is explained in BCP 175: Procedure for Maintaining the Time Zone +Database section 7. -Parts of the TLS test suite are under the Go license. This code is not included -in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so -distributing code linked against BoringSSL does not trigger this license: + # 7. Database Ownership + # + # The TZ database itself is not an IETF Contribution or an IETF + # document. Rather it is a pre-existing and regularly updated work + # that is in the public domain, and is intended to remain in the + # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do + # not apply to the TZ Database or contributions that individuals make + # to it. Should any claims be made and substantiated against the TZ + # Database, the organization that is providing the IANA + # Considerations defined in this RFC, under the memorandum of + # understanding with the IETF, currently ICANN, may act in accordance + # with all competent court orders. No ownership claims will be made + # by ICANN or the IETF Trust on the database or the code. Any person + # making a contribution to the database or code waives all rights to + # future claims in that contribution or in the TZ Database. -Copyright (c) 2009 The Go Authors. All rights reserved. +---------------------------------------------------------------------- + +Google double-conversion +Copyright 2006-2011, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -489,39 +926,87 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +---------------------------------------------------------------------- -BoringSSL uses the Chromium test infrastructure to run a continuous build, -trybots etc. The scripts which manage this, and the script for generating build -metadata, are under the Chromium license. Distributing code linked against -BoringSSL does not trigger this license. +File: aclocal.m4 (only for ICU4C) +Section: pkg.m4 - Macros to locate and utilise pkg-config. -Copyright 2015 The Chromium Authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Copyright © 2004 Scott James Remnant . +Copyright © 2012-2015 Dan Nicholson - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: config.guess (only for ICU4C) + + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, see . + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. This Exception is an additional permission under section 7 +of the GNU General Public License, version 3 ("GPLv3"). + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: install-sh (only for ICU4C) + + +Copyright 1991 by the Massachusetts Institute of Technology + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of M.I.T. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. M.I.T. makes no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -531,7 +1016,7 @@ JSON for Modern C++ Version v3.11.2 (https://github.com/nlohmann/json) -MIT License +MIT License Copyright (c) 2013-2022 Niels Lohmann @@ -589,6 +1074,35 @@ Version 1.82.0 ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +libharu + +Version 2.4.3 +(https://github.com/libharu/libharu) + + +Copyright (C) 1999-2006 Takeshi Kanno +Copyright (C) 2007-2009 Antony Dovgal + +This software is provided 'as-is', without any express or implied warranty. + +In no event will the authors be held liable for any damages arising from the +use of this software. + +Permission is granted to anyone to use this software for any purpose,including +commercial applications, and to alter it and redistribute it freely, subject +to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim + that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ libjpeg-turbo @@ -883,7 +1397,7 @@ Version 4.2.0 Copyright (c) 1988-1997 Sam Leffler Copyright (c) 1991-1997 Silicon Graphics, Inc. -Permission to use, copy, modify, distribute, and sell this software and +Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that (i) the above copyright notices and this permission notice appear in all copies of the software and related documentation, and (ii) the names of @@ -891,15 +1405,15 @@ Sam Leffler and Silicon Graphics may not be used in any advertising or publicity relating to the software without the specific, prior written permission of Sam Leffler and Silicon Graphics. -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. @@ -937,12 +1451,12 @@ SOFTWARE. Nameof C++ -Version v0.10.1 +Version v0.10.3 (https://github.com/Neargye/nameof) MIT License -Copyright (c) 2016, 2018 - 2021 Daniil Goncharov +Copyright (c) 2016 - 2023 Daniil Goncharov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -967,7 +1481,7 @@ SOFTWARE. OpenCV -Version 4.5.3 +Version 4.8.0 (https://github.com/opencv/opencv) @@ -1200,7 +1714,7 @@ Version 1.1.0h * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -1255,21 +1769,21 @@ Version 1.1.0h * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. - * + * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * + * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -1284,10 +1798,10 @@ Version 1.1.0h * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from + * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * + * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -1299,7 +1813,7 @@ Version 1.1.0h * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * + * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence @@ -1308,44 +1822,6 @@ Version 1.1.0h -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - -Skia - -Version 47b4b19 -(https://github.com/google/skia) - -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ spdlog @@ -2213,9 +2689,9 @@ Version 1.1.0 See the License for the specific language governing permissions and limitations under the License. ------------------------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------ -Open Source libraries used in ScanbotSDK for iOS version 3.0.2: +Open Source libraries used in ScanbotSDK for iOS version 4.2.1: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -3103,6 +3579,35 @@ Version 1.82.0 ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +libharu + +Version 2.4.3 +(https://github.com/libharu/libharu) + + +Copyright (C) 1999-2006 Takeshi Kanno +Copyright (C) 2007-2009 Antony Dovgal + +This software is provided 'as-is', without any express or implied warranty. + +In no event will the authors be held liable for any damages arising from the +use of this software. + +Permission is granted to anyone to use this software for any purpose,including +commercial applications, and to alter it and redistribute it freely, subject +to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim + that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ libjpeg-turbo @@ -3451,12 +3956,12 @@ SOFTWARE. Nameof C++ -Version v0.10.1 +Version v0.10.3 (https://github.com/Neargye/nameof) MIT License -Copyright (c) 2016, 2018 - 2021 Daniil Goncharov +Copyright (c) 2016 - 2023 Daniil Goncharov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -3481,7 +3986,7 @@ SOFTWARE. OpenCV -Version 4.5.3 +Version 4.8.0 (https://github.com/opencv/opencv) @@ -3822,44 +4327,6 @@ Version 1.1.1t -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - -Skia - -Version 47b4b19 -(https://github.com/google/skia) - -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ spdlog diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.Android/Native.Renderers.Example.Forms.Android.csproj b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.Android/Native.Renderers.Example.Forms.Android.csproj index 3bafafb..c4fd3b6 100644 --- a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.Android/Native.Renderers.Example.Forms.Android.csproj +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.Android/Native.Renderers.Example.Forms.Android.csproj @@ -51,7 +51,6 @@ - false 8.0 1G @@ -69,7 +68,7 @@ - 3.10.2 + 4.2.0-beta.1 diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Native.Renderers.Example.Forms.iOS.csproj b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Native.Renderers.Example.Forms.iOS.csproj index abb31cf..fb35c91 100644 --- a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Native.Renderers.Example.Forms.iOS.csproj +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Native.Renderers.Example.Forms.iOS.csproj @@ -137,7 +137,7 @@ - 4.2.0-local.1 + 4.2.0-beta.1 diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.csproj b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.csproj index 96ab990..6df1850 100644 --- a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.csproj +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.csproj @@ -8,7 +8,7 @@ - + diff --git a/Scanbot.SDK.Example.Forms.Android/MainApplication.cs b/Scanbot.SDK.Example.Forms.Android/MainApplication.cs index 49c0a8a..6c08dbb 100644 --- a/Scanbot.SDK.Example.Forms.Android/MainApplication.cs +++ b/Scanbot.SDK.Example.Forms.Android/MainApplication.cs @@ -3,6 +3,7 @@ using Android.App; using Android.Runtime; using Android.Util; +using ScanbotSDK.Xamarin; using ScanbotSDK.Xamarin.Forms; namespace Scanbot.SDK.Example.Forms.Droid @@ -44,11 +45,15 @@ public override void OnCreate() // If no StorageBaseDirectory is specified, the default will be used StorageBaseDirectory = GetDemoStorageBaseDirectory(), DetectorType = DocumentDetectorType.MLBased, - Encryption = new ScanbotSDK.Xamarin.SBSDKEncryption - { - Mode = ScanbotSDK.Xamarin.EncryptionMode.AES256, - Password = "S0m3W3irDL0ngPa$$w0rdino!!!!" - } + // Uncomment the below to test our encyption functionality. + //Encryption = new SBSDKEncryption + //{ + // Mode = EncryptionMode.AES256, + // Password = "S0m3W3irDL0ngPa$$w0rdino!!!!" + //} + // Note: all the images and files exported through the SDK will + // not be openable from external applications, since they will be + // encrypted. }; SBSDKInitializer.Initialize(this, LICENSE_KEY, configuration); } diff --git a/Scanbot.SDK.Example.Forms.Android/Scanbot.SDK.Example.Forms.Android.csproj b/Scanbot.SDK.Example.Forms.Android/Scanbot.SDK.Example.Forms.Android.csproj index 7423e51..e2c0fc8 100644 --- a/Scanbot.SDK.Example.Forms.Android/Scanbot.SDK.Example.Forms.Android.csproj +++ b/Scanbot.SDK.Example.Forms.Android/Scanbot.SDK.Example.Forms.Android.csproj @@ -72,7 +72,7 @@ 2.1.2 - 3.10.2 + 4.2.0-beta.1 diff --git a/Scanbot.SDK.Example.Forms.iOS/AppDelegate.cs b/Scanbot.SDK.Example.Forms.iOS/AppDelegate.cs index 167d6cb..bb4248d 100644 --- a/Scanbot.SDK.Example.Forms.iOS/AppDelegate.cs +++ b/Scanbot.SDK.Example.Forms.iOS/AppDelegate.cs @@ -2,6 +2,7 @@ using System.IO; using Foundation; +using ScanbotSDK.Xamarin; using ScanbotSDK.Xamarin.Forms; using UIKit; @@ -30,11 +31,15 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary options) EnableLogging = true, StorageBaseDirectory = GetDemoStorageBaseDirectory(), DetectorType = DocumentDetectorType.MLBased, - Encryption = new ScanbotSDK.Xamarin.SBSDKEncryption - { - Mode = ScanbotSDK.Xamarin.EncryptionMode.AES256, - Password = "S0m3W3irDL0ngPa$$w0rdino!!!!" - } + // Uncomment the below to test our encyption functionality. + //Encryption = new SBSDKEncryption + //{ + // Mode = EncryptionMode.AES256, + // Password = "S0m3W3irDL0ngPa$$w0rdino!!!!" + //} + // Note: all the images and files exported through the SDK will + // not be openable from external applications, since they will be + // encrypted. }); global::Xamarin.Forms.Forms.Init(); diff --git a/Scanbot.SDK.Example.Forms.iOS/Scanbot.SDK.Example.Forms.iOS.csproj b/Scanbot.SDK.Example.Forms.iOS/Scanbot.SDK.Example.Forms.iOS.csproj index a932953..a64daff 100644 --- a/Scanbot.SDK.Example.Forms.iOS/Scanbot.SDK.Example.Forms.iOS.csproj +++ b/Scanbot.SDK.Example.Forms.iOS/Scanbot.SDK.Example.Forms.iOS.csproj @@ -150,7 +150,7 @@ 5.0.0.2612 - 3.10.2 + 4.2.0-beta.1 From 1775590750d0799712d5c14ecd0502480cc933b6 Mon Sep 17 00:00:00 2001 From: Mayank Date: Tue, 27 Feb 2024 12:06:37 +0100 Subject: [PATCH 04/14] Forms: - Updated the DetectDocumentQuality result paramter. --- Scanbot.SDK.Example.Forms/MainPage.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Scanbot.SDK.Example.Forms/MainPage.cs b/Scanbot.SDK.Example.Forms/MainPage.cs index 3b65143..de37d38 100644 --- a/Scanbot.SDK.Example.Forms/MainPage.cs +++ b/Scanbot.SDK.Example.Forms/MainPage.cs @@ -88,9 +88,8 @@ async void ScanningUIClicked(object sender, EventArgs e) // If encryption is enabled, load the decrypted document. // Else accessible via page.Document - var blur = await SBSDK.Operations.DetectDocumentQualityAsync(await page.DecryptedDocument()); - //var blur = await SBSDK.Operations.EstimateBlurriness(page.Document); - Console.WriteLine("Estimated blurriness for detected document: " + blur); + var quality = await SBSDK.Operations.DetectDocumentQualityAsync(await page.DecryptedDocument()); + Console.WriteLine("Estimated quality for detected document: " + quality); } await Navigation.PushAsync(new ImageResultsPage()); From 66daffa7a5d995d6bf4de4a2adaee375c21df918 Mon Sep 17 00:00:00 2001 From: Mayank Date: Thu, 29 Feb 2024 11:14:45 +0100 Subject: [PATCH 05/14] - Rebased develop with BarcodeImageGenerationType feature branch. --- .../Renderers/IOSBarcodeCameraRenderer.cs | 80 +++++++++++++++++-- .../MainPage.xaml | 45 ++++++----- .../MainPage.xaml.cs | 66 +++++++++------ .../Views/BarcodeCameraView.cs | 6 ++ 4 files changed, 144 insertions(+), 53 deletions(-) diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Renderers/IOSBarcodeCameraRenderer.cs b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Renderers/IOSBarcodeCameraRenderer.cs index 9c72c69..f4bce9c 100644 --- a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Renderers/IOSBarcodeCameraRenderer.cs +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms.iOS/Renderers/IOSBarcodeCameraRenderer.cs @@ -1,5 +1,7 @@ -using System.Linq; +using System; +using System.Linq; using CoreGraphics; +using HomeKit; using Native.Renderers.Example.Forms.iOS.Renderers; using Native.Renderers.Example.Forms.Views; using ScanbotSDK.iOS; @@ -42,6 +44,30 @@ protected override void OnElementChanged(ElementChangedEventArgs + { + cameraView.Controller.UnfreezeCamera(); + cameraView.ScannerDelegate.isScanning = true; + }; + + Element.StartDetectionHandler = (sender, e2) => + { + cameraView.Controller.UnfreezeCamera(); + cameraView.ScannerDelegate.isScanning = true; + }; + + Element.OnPauseHandler = (sender, e3) => + { + cameraView.Controller.FreezeCamera(); + cameraView.ScannerDelegate.isScanning = false; + }; + + Element.StopDetectionHandler = (sender, e4) => + { + cameraView.Controller.FreezeCamera(); + cameraView.ScannerDelegate.isScanning = false; + }; } public override void LayoutSubviews() @@ -57,32 +83,55 @@ public override void LayoutSubviews() } } - internal class IOSBarcodeCameraView : UIView + // Since we cannot directly inherit from SBSDKBarcodeScannerViewControllerDelegate in our ViewRenderer, + // we have created this wrapper class to allow binding to its events through the use of delegates + class BarcodeScannerDelegate : SBSDKBarcodeScannerViewControllerDelegate + { + internal bool isScanning = true; + public delegate void OnDetectHandler(SBSDKBarcodeScannerResult[] codes); + public OnDetectHandler OnDetect; + + public override void DidDetectBarcodes(SBSDKBarcodeScannerViewController controller, SBSDKBarcodeScannerResult[] codes) + { + if (controller.BarcodeImageGenerationType == SBSDKBarcodeImageGenerationType.CapturedImage) + { + isScanning = false; // it will restrict further scans and stop scanning when the image is captured. + } + OnDetect?.Invoke(codes); + } + + public override bool ShouldDetectBarcodes(SBSDKBarcodeScannerViewController controller) + { + return isScanning; + } + } + + class IOSBarcodeCameraView : UIView { public bool initialised = false; public SBSDKBarcodeScannerViewController Controller { get; private set; } - private BarcodeScannerDelegate scannerDelegate; + internal BarcodeScannerDelegate ScannerDelegate; private BarcodeCameraView element; - public IOSBarcodeCameraView(CGRect frame) : base(frame) { } public void Initialize(UIViewController parentViewController) { initialised = true; Controller = new SBSDKBarcodeScannerViewController(parentViewController, this); - scannerDelegate = new BarcodeScannerDelegate(); - Controller.Delegate = scannerDelegate; + ScannerDelegate = new BarcodeScannerDelegate(); + Controller.Delegate = ScannerDelegate; } internal void SetBarcodeConfigurations(BarcodeCameraView element) { this.element = element; Controller.AcceptedBarcodeTypes = SBSDKBarcodeType.AllTypes; - scannerDelegate.OnDetect = HandleBarcodeScannerResults; + Controller.BarcodeImageGenerationType = element.ImageGenerationType.ToNative(); + ScannerDelegate.OnDetect = HandleBarcodeScannerResults; SetSelectionOverlayConfiguration(element.OverlayConfiguration); } - internal void SetSelectionOverlayConfiguration(SelectionOverlayConfiguration configuration) + private void SetSelectionOverlayConfiguration(SelectionOverlayConfiguration configuration) { if (configuration != null && configuration.Enabled) { @@ -158,5 +207,20 @@ public static SBSDKBarcodeOverlayFormat ToNative(this OverlayFormat overlayTextF return SBSDKBarcodeOverlayFormat.CodeAndType; } } + + public static SBSDKBarcodeImageGenerationType ToNative(this BarcodeImageGenerationType imageGenerationType) + { + switch (imageGenerationType) + { + case BarcodeImageGenerationType.None: + return SBSDKBarcodeImageGenerationType.None; + case BarcodeImageGenerationType.CapturedImage: + return SBSDKBarcodeImageGenerationType.CapturedImage; + case BarcodeImageGenerationType.FromVideoFrame: + return SBSDKBarcodeImageGenerationType.FromVideoFrame; + default: + return SBSDKBarcodeImageGenerationType.None; + } + } } } diff --git a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms/MainPage.xaml b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms/MainPage.xaml index 996bdf6..17b8485 100644 --- a/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms/MainPage.xaml +++ b/Native.Renderers.Example.Forms/Native.Renderers.Example.Forms/MainPage.xaml @@ -6,36 +6,37 @@ ios:Page.UseSafeArea="true" BackgroundColor="#c8193c" x:Class="Native.Renderers.Example.Forms.MainPage"> - - - - - - + + + + + + - + + + + + - - - - - - + +