GetROI fixed. arengine 0.99L4
authorOleksandr Kaspruk <a.kaspruk@samsung.com>
Fri, 12 Apr 2013 10:47:53 +0000 (19:47 +0900)
committerOleksandr Kaspruk <a.kaspruk@samsung.com>
Fri, 12 Apr 2013 10:47:53 +0000 (19:47 +0900)
Change-Id: Idf4f9c2151c69a735faf744c0dd51a1ba41f8486
Signed-off-by: Oleksandr Kaspruk <a.kaspruk@samsung.com>
lib/armv7-a/libarengine.so [changed mode: 0755->0644]
lib/x86/libarengine.so [changed mode: 0755->0644]
src/FUixVisionQrCodeRecognizer.cpp
src/FUixVision_QrCodeRecognizerImpl.cpp
src/FUixVision_QrCodeRecognizerImpl.h

old mode 100755 (executable)
new mode 100644 (file)
index b3fee86..ce2d7ce
Binary files a/lib/armv7-a/libarengine.so and b/lib/armv7-a/libarengine.so differ
old mode 100755 (executable)
new mode 100644 (file)
index d696daf..d5831a9
Binary files a/lib/x86/libarengine.so and b/lib/x86/libarengine.so differ
index be6a792..1278ccb 100644 (file)
@@ -55,7 +55,7 @@ QrCodeRecognizer::SetImageSize(int width, int height)
     SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
 
     SysTryReturn(NID_UIX, width > 0 && height > 0, false, E_INVALID_ARG,
-            "raw pointer must not be null. [E_INVALID_ARG]");
+            "width and height must be greater then 0. [E_INVALID_ARG]");
 
     return __pQrCodeRecognizerImpl->SetFrameSize(width, height) ? E_SUCCESS : E_FAILURE;
 }
@@ -65,7 +65,7 @@ QrCodeRecognizer::GetFocusRoi(Tizen::Graphics::Rectangle& roi)
 {
     SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
 
-    static float array[4] = {0.f};
+    static int array[4] = {0};
     result r = __pQrCodeRecognizerImpl->GetROI(array) ? E_SUCCESS : E_FAILURE;
 
     if (r == E_SUCCESS)
index d218977..9299651 100644 (file)
@@ -33,8 +33,10 @@ _QrCodeRecognizerImpl::~_QrCodeRecognizerImpl(void)
 }
 
 bool
-_QrCodeRecognizerImpl::SetFrameSize(unsigned int width, unsigned int height)
+_QrCodeRecognizerImpl::SetFrameSize(int width, int height)
 {
+       __width = width;
+       __height = height;
     return __qrCodeRecognizer.setFrameSize(width, height);
 }
 
@@ -45,9 +47,21 @@ _QrCodeRecognizerImpl::ProcessFrame(const unsigned char* raw)
 }
 
 bool
-_QrCodeRecognizerImpl::GetROI(float* roi)
+_QrCodeRecognizerImpl::GetROI(int* roi)
 {
-    return __qrCodeRecognizer.getROI(roi);
+
+       static float array[4] = {0.};
+       result r = __qrCodeRecognizer.getROI(array) ? E_SUCCESS : E_FAILURE;
+
+       if (E_SUCCESS == r)
+       {
+               roi[0] = ((1. + array[0]) / 2.) * __width;
+               roi[1] = ((1. + array[1]) / 2.) * __height;
+               roi[2] = ((1. + array[2]) / 2.) * __width;
+               roi[3] = ((1. + array[3]) / 2.) * __height;
+       }
+
+    return E_SUCCESS == r;
 }
 
 void
index a72de06..94ca31d 100644 (file)
@@ -37,9 +37,9 @@ public:
     _QrCodeRecognizerImpl(void);
     ~_QrCodeRecognizerImpl(void);
 
-    bool SetFrameSize(unsigned int width, unsigned int height);
+    bool SetFrameSize(int width, int height);
     bool ProcessFrame(const unsigned char* raw);
-    bool GetROI(float* roi);
+    bool GetROI(int* roi);
     void SetSceneTransform(const float* left, const float* right);
     void FillObjectStorage(void);
 
@@ -61,6 +61,8 @@ private:
     _QrCodeRecognizerImpl& operator=(const _QrCodeRecognizerImpl&); ///< Forbides assignment operator.
     QrCodeObject* __objectStorage;
     int __objectStorageSize;
+    int __width;
+    int __height;
     sari2::QRCodeRecognizer __qrCodeRecognizer;
 };