Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Vision / Interop / Interop.MediaVision.BarCode.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18 using System.Runtime.InteropServices;
19 using Tizen.Multimedia;
20
21 /// <summary>
22 /// Interop APIs
23 /// </summary>
24 internal static partial class Interop
25 {
26     /// <summary>
27     /// Interop for media vision APIs
28     /// </summary>
29     internal static partial class MediaVision
30     {
31         /// <summary>
32         /// Interop for barcode detector APIs
33         /// </summary>
34         internal static partial class BarcodeDetector
35         {
36             [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_detect")]
37             internal static extern MediaVisionError Detect(IntPtr source, IntPtr engineCfg, Rectangle roi,
38                 DetectedCallback detectCb, IntPtr userData = default(IntPtr));
39
40             [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
41             internal delegate void DetectedCallback(
42                 IntPtr source,
43                 IntPtr engineCfg,
44                 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 5)]
45                 Quadrangle[] locations,
46                 [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 5)]
47                 string[] messages,
48                 BarcodeType[] types,
49                 int numberOfBarcodes,
50                 IntPtr userData);
51         }
52
53         /// <summary>
54         /// Interop for barcode generator APIs
55         /// </summary>
56         internal static partial class BarcodeGenerator
57         {
58             [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_generate_source")]
59             internal static extern MediaVisionError GenerateSource(IntPtr engineCfg, string message,
60                 BarcodeType type, int qrEncMode, int qrEcc, int qrVersion, IntPtr source);
61
62             [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_generate_image")]
63             internal static extern MediaVisionError GenerateImage(IntPtr engineCfg,
64                 string message, int imageWidth, int imageHeight, BarcodeType type,
65                 int qrEncMode, int qrEcc, int qrVersion, string imagePath, BarcodeImageFormat imageFormat);
66         }
67     }
68 }