Fix flora license version
[platform/framework/native/vision.git] / src / QRCodeRecognizer.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.1 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 #ifndef QRCODERECOGNIZER_H
19 #define QRCODERECOGNIZER_H
20
21 #include "QRCodeRecognitionInfo.h"
22
23 namespace sari2
24 {
25
26 /// \brief Class that provides utilities for QR code localization and recognition
27 class QRCodeRecognizer
28 {
29
30 public:
31     /// \brief Setup input video-frame width and height
32     ///
33     /// Must be called once before calling processFrame.
34     /// \param [in] width - frame width in pixels that is reported by video-capture device
35     /// \param [in] height - frame height in pixels that is reported by video-capture device
36     /// \return true on success, false on error
37     bool      setFrameSize(unsigned int width, unsigned int height);
38
39     /// \brief Process external buffer with captured frame image
40     /// \param [in] raw - pointer to buffer with intensity (grayscale8) data. Buffer size must not be less than it set with setFrameSize
41     /// \pre setFrameSize
42     /// \return true on success, false on error
43     bool      processFrame(const unsigned char* raw);
44
45     /// \brief Returns focusing ROI
46     /// \param[out] roi - float array for ROI in form {top_left_x, top_left_y, bottom_right_x, bottom_right_y}
47     /// \return true on success, false on error
48     bool      getROI(float* roi);
49
50     /// \brief Setting scene transformation
51     /// \param [in] left transformation matrix 4x4
52     /// \param [in] right transformation matrix 4x4
53     /// Default matrix is identity
54     void     setSceneTransform(const float* left, const float* right);
55
56     /// Updates information about objects on scene.
57     /// \return Pointer on first element of the array of structures that holds
58     /// information about qr code objects.
59     const QRCodeRecognitionInfo* objectsBegin();
60     /// \return Pointer on the end of the array of structures that holds
61     /// information about qr code objects.
62     const QRCodeRecognitionInfo* objectsEnd();
63
64     /// \brief Initialize the reader
65     /// \return true on success, false on error
66     bool      init(void);
67     /// \brief Dispose of the reader
68     /// \return true on success, false on error
69     bool      destroy(void);
70
71     QRCodeRecognizer(void);
72     ~QRCodeRecognizer(void);
73
74 private:
75     QRCodeRecognizer(const QRCodeRecognizer& in);
76     QRCodeRecognizer& operator=(const QRCodeRecognizer& in);
77     class QRCodeRecognizerImpl;
78     /// \brief Implementation bridge
79     QRCodeRecognizerImpl* mImpl;
80 };
81
82 }
83
84 #endif // QRCODERECOGNIZER_H