patch for rc20 tizen_2.2 2.2.1_release submit/tizen_2.2/20131107.161613
authorJinkun Jang <jinkun.jang@samsung.com>
Thu, 7 Nov 2013 16:16:01 +0000 (01:16 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Thu, 7 Nov 2013 16:16:01 +0000 (01:16 +0900)
46 files changed:
CMakeLists.txt [new file with mode: 0755]
LICENSE.APLv2 [new file with mode: 0755]
LICENSE.Flora [new file with mode: 0644]
NOTICE [new file with mode: 0644]
inc/FUixVisionImageFeatureInfo.h [new file with mode: 0644]
inc/FUixVisionImageFeatureManager.h [new file with mode: 0644]
inc/FUixVisionImageObject.h [new file with mode: 0644]
inc/FUixVisionImageRecognizer.h [new file with mode: 0644]
inc/FUixVisionQrCodeGenerator.h [new file with mode: 0644]
inc/FUixVisionQrCodeObject.h [new file with mode: 0644]
inc/FUixVisionQrCodeRecognizer.h [new file with mode: 0644]
inc/FUixVisionQrCodeTypes.h [new file with mode: 0644]
lib/armv7-a/libarengine.so [new file with mode: 0755]
lib/x86/libarengine.so [new file with mode: 0644]
osp-vision.manifest [new file with mode: 0755]
osp-vision.pc.in [new file with mode: 0755]
packaging/osp-vision.spec [new file with mode: 0644]
src/FUixVisionImageFeatureInfo.cpp [new file with mode: 0644]
src/FUixVisionImageFeatureManager.cpp [new file with mode: 0644]
src/FUixVisionImageObject.cpp [new file with mode: 0644]
src/FUixVisionImageRecognizer.cpp [new file with mode: 0644]
src/FUixVisionQrCodeGenerator.cpp [new file with mode: 0644]
src/FUixVisionQrCodeObject.cpp [new file with mode: 0644]
src/FUixVisionQrCodeRecognizer.cpp [new file with mode: 0644]
src/FUixVision_ImageFeatureInfoImpl.cpp [new file with mode: 0644]
src/FUixVision_ImageFeatureInfoImpl.h [new file with mode: 0644]
src/FUixVision_ImageFeatureManagerImpl.cpp [new file with mode: 0644]
src/FUixVision_ImageFeatureManagerImpl.h [new file with mode: 0644]
src/FUixVision_ImageObjectImpl.cpp [new file with mode: 0644]
src/FUixVision_ImageObjectImpl.h [new file with mode: 0644]
src/FUixVision_ImageRecognizerImpl.cpp [new file with mode: 0644]
src/FUixVision_ImageRecognizerImpl.h [new file with mode: 0644]
src/FUixVision_QrCodeGeneratorImpl.cpp [new file with mode: 0644]
src/FUixVision_QrCodeGeneratorImpl.h [new file with mode: 0644]
src/FUixVision_QrCodeObjectImpl.cpp [new file with mode: 0644]
src/FUixVision_QrCodeObjectImpl.h [new file with mode: 0644]
src/FUixVision_QrCodeRecognizerImpl.cpp [new file with mode: 0644]
src/FUixVision_QrCodeRecognizerImpl.h [new file with mode: 0644]
src/ImageFeatureInfo.h [new file with mode: 0644]
src/ImageFeatureManager.h [new file with mode: 0644]
src/ImageRecognitionInfo.h [new file with mode: 0644]
src/ImageRecognizer.h [new file with mode: 0644]
src/QRCodeGenerator.h [new file with mode: 0644]
src/QRCodeRecognitionInfo.h [new file with mode: 0644]
src/QRCodeRecognizer.h [new file with mode: 0644]
src/QRCodeTypes.h [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..392b9cb
--- /dev/null
@@ -0,0 +1,110 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET (this_target osp-vision)
+
+SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output)
+
+INCLUDE_DIRECTORIES(
+       inc
+       src
+       /usr/include/osp
+       /usr/include/media  
+       /usr/include/osp/media
+       )
+
+SET (${this_target}_SOURCE_FILES
+       src/FUixVision_ImageRecognizerImpl.cpp
+       src/FUixVision_QrCodeObjectImpl.h
+       src/FUixVision_ImageFeatureInfoImpl.cpp
+       src/FUixVision_ImageFeatureManagerImpl.cpp
+       src/FUixVisionImageRecognizer.cpp
+       src/FUixVision_QrCodeGeneratorImpl.h
+       src/FUixVision_QrCodeRecognizerImpl.cpp
+       src/FUixVisionQrCodeRecognizer.cpp
+       src/FUixVisionImageObject.cpp
+       src/FUixVisionQrCodeGenerator.cpp
+       src/FUixVision_QrCodeObjectImpl.cpp
+       src/FUixVisionImageFeatureManager.cpp
+       src/FUixVision_QrCodeRecognizerImpl.h
+       src/FUixVision_ImageObjectImpl.cpp
+       src/FUixVisionImageFeatureInfo.cpp
+       src/FUixVision_ImageFeatureManagerImpl.h
+       src/FUixVision_ImageFeatureInfoImpl.h
+       src/FUixVision_ImageObjectImpl.h
+       src/FUixVision_ImageRecognizerImpl.h
+       src/FUixVisionQrCodeObject.cpp
+       src/FUixVision_QrCodeGeneratorImpl.cpp
+       )
+
+SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -Wall" )
+
+## SET C COMPILER FLAGS
+SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
+
+## SET CPP COMPILER FLAGS
+SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
+
+## Create Library
+ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})
+
+IF("${ARCH}" MATCHES "arm")
+ADD_CUSTOM_COMMAND(TARGET ${this_target} PRE_BUILD
+       COMMAND cp -f ${CMAKE_SOURCE_DIR}/lib/armv7-a/libarengine.so ${LIBRARY_OUTPUT_PATH})
+#      COMMAND ln -s -f libarengine.so ${LIBRARY_OUTPUT_PATH}/libarengine.so)
+ELSEIF("${ARCH}" MATCHES "x86")        
+ADD_CUSTOM_COMMAND(TARGET ${this_target} PRE_BUILD
+       COMMAND cp -f ${CMAKE_SOURCE_DIR}/lib/x86/libarengine.so ${LIBRARY_OUTPUT_PATH})
+#      COMMAND ln -s -f libarengine.so ${LIBRARY_OUTPUT_PATH}/libarengine.so)
+ENDIF("${ARCH}" MATCHES "arm")
+
+## SET DEPENDENCY FLAGS
+ADD_DEPENDENCIES(${this_target} osp-appfw)
+ADD_DEPENDENCIES(${this_target} osp-uifw)
+ADD_DEPENDENCIES(${this_target} osp-media)
+ADD_DEPENDENCIES(${this_target} osp-image)
+ADD_DEPENDENCIES(${this_target} osp-image-core)
+
+## SET LINKER FLAGS
+SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined)
+
+TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" )
+TARGET_LINK_LIBRARIES(${this_target} "-losp-uifw" )
+TARGET_LINK_LIBRARIES(${this_target} "-losp-media" )
+TARGET_LINK_LIBRARIES(${this_target} "-losp-image" )
+TARGET_LINK_LIBRARIES(${this_target} "-losp-image-core" )
+TARGET_LINK_LIBRARIES(${this_target} "-L${LIBRARY_OUTPUT_PATH} -larengine" )
+
+SET_TARGET_PROPERTIES(${this_target} 
+       PROPERTIES 
+       VERSION ${FULLVER}
+       SOVERSION ${MAJORVER}
+       CLEAN_DIRECT_OUTPUT 1
+       )
+
+ADD_CUSTOM_COMMAND(TARGET ${this_target}
+    POST_BUILD
+               COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} 
+               COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER}
+               COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}
+    COMMENT "strip ${this_target}"
+               )   
+
+INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp 
+                               FILES_MATCHING PATTERN "*.so*" 
+                               PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
+                                                                               GROUP_EXECUTE GROUP_READ
+                                                                               WORLD_EXECUTE WORLD_READ)
+INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug 
+                               FILES_MATCHING PATTERN "*.so*" 
+                               PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
+                                                                               GROUP_EXECUTE GROUP_READ
+                                                                               WORLD_EXECUTE WORLD_READ)
+
+INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libarengine.so DESTINATION lib/osp)
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h")
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/ DESTINATION include/osp/vision FILES_MATCHING PATTERN "*.h")
+
+
+# pkgconfig file
+CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)
diff --git a/LICENSE.APLv2 b/LICENSE.APLv2
new file mode 100755 (executable)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
diff --git a/LICENSE.Flora b/LICENSE.Flora
new file mode 100644 (file)
index 0000000..571fe79
--- /dev/null
@@ -0,0 +1,206 @@
+Flora License
+
+Version 1.1, April, 2013
+
+http://floralicense.org/license/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and
+all other entities that control, are controlled by, or are
+under common control with that entity. For the purposes of
+this definition, "control" means (i) the power, direct or indirect,
+to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
+or more of the outstanding shares, or (iii) beneficial ownership of
+such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form,
+made available under the License, as indicated by a copyright notice
+that is included in or attached to the work (an example is provided
+in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this License,
+Derivative Works shall not include works that remain separable from,
+or merely link (or bind by name) to the interfaces of, the Work and
+Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner.
+For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or
+its representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor
+for the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated
+in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies
+with the standards set forth in the Tizen Compliance Specification
+and passes the Tizen Compliance Tests as defined from time to time
+by the Tizen Technical Steering Group and certified by the Tizen
+Association or its designated agent.
+
+2. Grant of Copyright License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work
+solely as incorporated into a Tizen Certified Platform, where such
+license applies only to those patent claims licensable by such
+Contributor that are necessarily infringed by their Contribution(s)
+alone or by combination of their Contribution(s) with the Work solely
+as incorporated into a Tizen Certified Platform to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim
+in a lawsuit) alleging that the Work or a Contribution incorporated
+within the Work constitutes direct or contributory patent infringement,
+then any patent licenses granted to You under this License for that
+Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.  You may reproduce and distribute copies of the
+Work or Derivative Works thereof pursuant to the copyright license
+above, in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  1. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+  2. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+  3. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+  4. If the Work includes a "NOTICE" text file as part of its distribution,
+     then any Derivative Works that You distribute must include a readable
+     copy of the attribution notices contained within such NOTICE file,
+     excluding those notices that do not pertain to any part of
+     the Derivative Works, in at least one of the following places:
+     within a NOTICE text file distributed as part of the Derivative Works;
+     within the Source form or documentation, if provided along with the
+     Derivative Works; or, within a display generated by the Derivative Works,
+     if and wherever such third-party notices normally appear.
+     The contents of the NOTICE file are for informational purposes only
+     and do not modify the License. You may add Your own attribution notices 
+     within Derivative Works that You distribute, alongside or as an addendum 
+     to the NOTICE text from the Work, provided that such additional attribution 
+     notices cannot be construed as modifying the License. You may add Your own
+     copyright statement to Your modifications and may provide additional or
+     different license terms and conditions for use, reproduction, or
+     distribution of Your modifications, or for any such Derivative Works
+     as a whole, provided Your use, reproduction, and distribution of
+     the Work otherwise complies with the conditions stated in this License
+     and your own copyright statement or terms and conditions do not conflict
+     the conditions stated in the License including section 3.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks.  This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "[]"
+replaced with your own identifying information. (Don't include
+the brackets!) The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Flora License, Version 1.1 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://floralicense.org/license/
+
+   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.
+
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..64d4fbe
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,6 @@
+Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.Apache-2.0 file for Apache License terms and conditions.
+
+libarengine.so, ImageFeatureInfo.h, ImageFeatureManager.h, ImageRecognitionInfo.h, ImageRecognizer.h, QRCodeGenerator.h, QRCodeRecognitionInfo.h, QRCodeRecognizer.h, and QRCodeTypes.h files are licensed under Flora License, Version 1.1
+Please, see LICENSE.Flora file for Flora License, Version 1.1 terms and conditions
diff --git a/inc/FUixVisionImageFeatureInfo.h b/inc/FUixVisionImageFeatureInfo.h
new file mode 100644 (file)
index 0000000..e891570
--- /dev/null
@@ -0,0 +1,143 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVisionImageFeatureInfo.h
+ * @brief    This is the header file for the %ImageFeatureInfo class.
+ *
+ * This header file contains the declarations of the %ImageFeatureInfo class.
+ */
+
+#ifndef _FUIX_VISION_IMAGE_FEATURE_INFO_H_
+#define _FUIX_VISION_IMAGE_FEATURE_INFO_H_
+
+#include <FBaseObject.h>
+#include <FGraphics.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+/**
+ * @class    ImageFeatureInfo
+ * @brief    This class holds information on the individual image feature data that is present in an image feature set.
+ *
+ * @since    2.1
+ *
+ * The %ImageFeatureInfo class holds information on the individual image feature data that is present in an image feature set.
+ *
+ * @see      Tizen::Uix::Vision::ImageFeatureManager
+ */
+class _OSP_EXPORT_ ImageFeatureInfo
+    : public Tizen::Base::Object
+{
+public:
+
+    /**
+     * Gets the detailed description of the feature set.
+     *
+     * @since       2.1
+     *
+     * @return      The detailed description of the feature set
+     *
+     */
+    Tizen::Base::String GetDescription(void) const;
+
+    /**
+     * Gets the width of the thumbnail image.
+     *
+     * @since       2.1
+     *
+     * @return      The thumbnail image width
+     *
+     */
+    int GetThumbnailWidth(void) const;
+
+    /**
+     * Gets the height of the thumbnail image.
+     *
+     * @since       2.1
+     *
+     * @return      The thumbnail image height
+     *
+     * @exception   E_SUCCESS     The method is successful.
+     */
+    int GetThumbnailHeight(void) const;
+
+    /**
+     * Gets the thumbnail image through extraction.
+     *
+     * @since       2.1
+     *
+     * @return      A pointer to the Tizen::Base::ByteBuffer instance that contains the thumbnail image
+     */
+    Tizen::Base::ByteBuffer* GetThumbnailN(void) const;
+
+    /**
+     * Compares the specified instance with the current instance.
+     *
+     * @since       2.1
+     *
+     * @return      @c true if the specified instance of Tizen::Base::Object is equal to the current %ImageFeatureInfo instance, @n
+     *              else @c false
+     * @param[in]   obj               The object to compare
+     */
+    virtual bool Equals(const Tizen::Base::Object& obj) const;
+
+    /**
+     * Gets the hash value of the current instance.
+     *
+     * @since        2.1
+     *
+     * @return       The hash value of the current instance
+     */
+    virtual int GetHashCode(void) const;
+
+private:
+    /**
+     * This is the default constructor for this class.
+     * The implementation of this constructor is declared as private to prohibit construction of the object by user.
+     *
+     * @since         2.1
+     */
+    ImageFeatureInfo(void);
+
+    /**
+     * This is the destructor for this class. @n
+     * The resources are deallocated by this method.
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since         2.1
+     */
+    ~ImageFeatureInfo(void);
+    /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    ImageFeatureInfo(const ImageFeatureInfo&);
+
+    /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    ImageFeatureInfo& operator=(const ImageFeatureInfo&);
+
+private:
+    class _ImageFeatureInfoImpl* __pImageFeatureInfoImpl;
+    friend class _ImageFeatureInfoImpl;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif /* _FUIX_VISION_IMAGE_FEATURE_INFO_H_ */
diff --git a/inc/FUixVisionImageFeatureManager.h b/inc/FUixVisionImageFeatureManager.h
new file mode 100644 (file)
index 0000000..42cceea
--- /dev/null
@@ -0,0 +1,314 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVisionImageFeatureManager.h
+ * @brief    This is the header file for the %ImageFeatureManager class.
+ *
+ * This header file contains the declarations of the %ImageFeatureManager class.
+ */
+
+#ifndef _FUIX_VISION_IMAGE_FEATURE_MANAGER_H_
+#define _FUIX_VISION_IMAGE_FEATURE_MANAGER_H_
+#include <FBaseObject.h>
+#include <FBase.h>
+#include <FGrpBitmap.h>
+#include <FUixVisionImageFeatureInfo.h>
+#include <FMedia.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+/**
+ * @class    ImageFeatureManager
+ * @brief    This class provides methods to generate individual feature data from an individual image data, and load it into a feature set file.
+ *
+ * @since    2.1
+ *
+ * The %ImageFeatureManager class provides methods to generate individual feature data from an individual image data. 
+ * This class also provides methods to manage the image feature set which is a collection of individual feature data.
+ *
+ * The following example demonstrates how to use the %ImageFeatureManager class.
+ *
+ * @code
+ * 
+ * #include <FBase.h>
+ * #include <FUix.h>
+ * #include <FGraphics.h>
+ * #include <FIo.h>
+ * #include <FMedia.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Media;
+ * using namespace Tizen::Graphics;
+ * using namespace Tizen::Io;
+ * using namespace Tizen::Uix::Vision;
+ *
+ * class MyClass
+ * {
+ *
+ * public:
+ *     MyClass();
+ *     ~MyClass();
+ *     result GenerateFeatureSet(void);
+ *     result AddImageFeatureSet(void);
+ * };
+ *
+ * result
+ * MyClass::GenerateFeatureSet(void)
+ * {
+ *     result r;
+ *     ImageFeatureManager imageFeatureManager;
+ *     r = imageFeatureManager.Construct();
+ *
+ *     //Creates new feature sets
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image1.jpg");
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image2.jpg");
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image3.jpg");
+ *     r = imageFeatureManager.Flush(new String("/opt/usr/media/Images/testFeatureSet.xdb"));
+ *
+ *     return r;
+ * }
+ *
+ * result
+ * MyClass::AddImageFeatureSet()
+ * {
+ *     result r;
+ *     ImageFeatureManager imageFeatureManager;
+ *     imageFeatureManager.Construct();
+ *     imageFeatureManager.Load("/opt/usr/media/Images/testFeatureSet.xdb");
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image1.jpg");
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image2.jpg");
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image3.jpg");
+ *     r = imageFeatureManager.Flush();
+ *
+ *     return r;
+ * }
+ * @endcode
+ */
+class _OSP_EXPORT_ ImageFeatureManager
+    : public Tizen::Base::Object
+{
+public:
+
+    /**
+     * This is the default constructor for this class. @n
+     * The object is not fully constructed after this constructor is called. @n
+     * For full construction, the Construct() method must be called right after calling this constructor.
+     *
+     * @since    2.1
+     */
+    ImageFeatureManager(void);
+
+    /**
+     * This is the destructor for this class. @n
+     * The resources are deallocated by this method.
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since    2.1
+     */
+    ~ImageFeatureManager(void);
+
+    /**
+     * Initializes this instance of %ImageFeatureManager and creates an image feature set. @n
+     * Every application must call the %Construct() method before calling any other method of %ImageFeatureManager.
+     *
+     * @since       2.1
+     *
+     * @feature     %http://tizen.org/feature/vision.image_recognition
+     *
+     * @return      An error code
+     *
+     * @exception   E_SUCCESS                            The method is successful.
+     * @exception   E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature. 
+     *                                                                                   For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
+     * @remarks     Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
+     */
+    result Construct(void);
+
+    /**
+     * Loads the feature set file.
+     *
+     * @since       2.1
+     *
+     * @return      An error code
+     *
+     * @param[in]   featureSetFilePath       The feature set file path at which to load the file
+     *
+     * @exception   E_SUCCESS                The method is successful.
+     * @exception   E_INVALID_ARG            The specified @c featureSetFilePath is invalid.
+     * @exception   E_OUT_OF_MEMORY          The memory is insufficient.
+     *
+     * @remarks     
+     *              - If a feature set file exists, it is updated.
+     *              - If a feature set file does not exist, it is newly created.
+     *              - It is not mandatory to call this method to create a new feature set file, but the Flush() method must be called with a valid feature set file path.
+     */
+    result Load(const Tizen::Base::String& featureSetFilePath);
+
+    /**
+     * Gets the list of supported image file formats used to add the feature.
+     *
+     * @since       2.1
+        *
+     * @return      The list of supported image file formats
+     */
+    static Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>* GetSupportedImageFileFormatsListN(void);
+
+    /**
+     * Adds a feature to the feature set.
+     *
+     * @since       2.1
+     *
+     * @return      The feature index of the newly and successfully created feature, @n
+        *                              else @c -1 is returned
+     *
+     * @param[in]   imagePath            The input image file path
+     *
+     * @exception   E_INVALID_ARG        The specified input parameter is invalid.
+     *
+     * @remarks     
+     *              - The specific error code can be accessed using the GetLastResult() method.
+     *              - The input image file must have one of the supported image file formats.
+     *              - Calling this method actually means 'Mark As Add Feature' 
+        *                                and the marked feature data is added to the feature set file after calling the Flush() method.
+     * @see         GetSupportedImageFileFormatsListN()
+     */
+    int AddFeature(const Tizen::Base::String& imagePath);
+
+    /**
+     * Adds a feature to the feature set.
+     *
+     * @since       2.1
+     *
+     * @return      The feature index of the newly and successfully created feature, @n
+        *                              else @c -1 is returned
+     *
+     * @param[in]   imageBuffer              The image buffer of the grayscale image data with the specified @c width and @c height
+     * @param[in]   width                    The width of the input image
+     * @param[in]   height                   The height of the input image
+     * @param[in]   description              The description of the feature
+     *
+     * @exception   E_INVALID_ARG            A specified input parameter is invalid.
+     *
+     * @remarks     
+     *              - The specific error code can be accessed using the GetLastResult() method.
+     *              - Calling this method actually means 'Mark As Add Feature'.
+     *                and the marked feature data is added to the feature set file after calling the Flush() method.
+     * @see         Flush(const Tizen::Base::String*)
+     */
+    int AddFeature(const Tizen::Base::ByteBuffer& imageBuffer, int width, int height, const Tizen::Base::String& description);
+
+    /**
+     * Gets the total number of features in the feature set.
+     *
+     * @since       2.1
+     *
+     * @return      The total number of features in the feature set
+     */
+    int GetTotalNumberOfFeatures(void);
+
+    /**
+     * Deletes the feature at the specified index in the feature set.
+     *
+     * @since       2.1
+     *
+     * @return      An error code
+     *
+     * @param[in]   featureIndex             The feature index in the feature set
+     *
+     * @exception   E_SUCCESS                The method is successful.
+     * @exception   E_INVALID_ARG            The specified input parameter is invalid.
+     * @exception   E_OUT_OF_MEMORY          The memory is insufficient.
+     *
+     * @remarks     Calling this method actually means 'Mark As Delete Feature'.
+     *              and the marked feature data is deleted after calling the Flush() method.
+     * @see    Flush(const Tizen::Base::String*)
+     */
+    result DeleteFeature(int featureIndex);
+
+    /**
+     * Deletes all the features in the feature set.
+     *
+     * @since       2.1
+     *
+     * @return      An error code
+     *
+     * @exception   E_SUCCESS          The method is successful.
+     * @exception   E_OUT_OF_MEMORY    The memory is insufficient.
+     *
+     * @remarks     Calling this method actually means 'Mark As Delete All Features'.
+     *              and all the feature data is deleted after calling the Flush() method.
+     * @see         Flush(const Tizen::Base::String*)
+     */
+    result DeleteAllFeatures(void);
+
+    /**
+     * Flushes features from the feature set file and updates all the changes as marked.
+     *
+     *
+     * @since       2.1
+     *
+     * @return      An error code
+     *
+     * @param[in]   featureSetFilePath   The feature set file path
+     * @exception   E_SUCCESS            The method is successful.
+     * @exception   E_INVALID_ARG        The specified @c featureSetFilePath is invalid.
+     *
+     * @remarks     
+     *              - All the changes in the feature set file used by the AddFeature(), DeleteFeature(), or DeleteAllFeatures() method are updated by calling this method.
+     *              - If the @c featureSetFilePath is not decided or is same as the file path used in the Load() method, the loaded feature set file is updated.
+     *              - If the @c featureSetFilePath is not same as the file path used by the %Load() method, the loaded feature set file is retained and a new feature set file is created.
+     *              - If the @c featureSetFilePath is @c null, the feature set file loaded by the %Load() method is overwritten.
+     *                                 - If the @c featureSetFilePath is not decided or is same as the file path used by the %Load() method, and the loaded feature set file is a read-only file, then @c E_INVALID_ARG exception is returned.
+     *                                 - If the %Load() method is not called to create a new feature set file, this method must be called with a valid @c featureSetFilePath.
+     *
+     */
+    result Flush(const Tizen::Base::String* featureSetFilePath = null);
+
+    /**
+     * Gets the information of the specified feature.
+     *
+     * @since       2.1
+     *
+     * @return      A pointer to the ImageFeatureInfo instance
+     *
+     * @param[in]   featureIndex       The feature index in the feature set
+     */
+    const Tizen::Uix::Vision::ImageFeatureInfo* GetImageFeatureInfo(int featureIndex) const;
+
+
+private:
+    /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    ImageFeatureManager(const ImageFeatureManager&);
+
+    /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    ImageFeatureManager& operator=(const ImageFeatureManager&);
+
+private:
+    class _ImageFeatureManagerImpl* __pImageFeatureManagerImpl;
+    friend class _ImageFeatureManagerImpl;
+  };
+
+} } } //Tizen::Uix::Vision
+
+#endif // _FUIX_VISION_IMAGE_FEATURE_MANAGER_H_
diff --git a/inc/FUixVisionImageObject.h b/inc/FUixVisionImageObject.h
new file mode 100644 (file)
index 0000000..21f4109
--- /dev/null
@@ -0,0 +1,137 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVisionImageObject.h
+ * @brief    This is the header file for the %ImageObject class.
+ *
+ * This header file contains the declarations of the %ImageObject class.
+ */
+
+#ifndef _FUIX_VISION_IMAGE_OBJECT_H_
+#define _FUIX_VISION_IMAGE_OBJECT_H_
+
+#include <FBaseObject.h>
+#include <FGraphics.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+/**
+ * @class    ImageObject
+ * @brief    This class represents a single image object recognized by the %ImageRecognizer class and provides methods to access the information of a recognized image object.
+ *
+ * @since    2.1
+ *
+ * The %ImageObject class represents a single image object recognized by the ImageRecognizer class and provides methods to access the information of a recognized image object.
+ *
+ */
+class _OSP_EXPORT_ ImageObject
+    : public Tizen::Base::Object
+{
+public:
+    /**
+     * Gets the unique identifier of the recognized image object in the scene.
+     *
+     * @since        2.1
+     *
+     * @return       The unique identifier of the recognized image object in the scene
+     */
+    int GetId(void) const;
+
+    /**
+     * Gets the feature index of the recognized image object in the feature set.
+     *
+     * @since        2.1
+     *
+     * @return       The feature index of the recognized image object in the feature set
+     */
+    int GetFeatureId(void) const;
+
+    /**
+     * Gets the transformation matrix 4x4 for the 3D pose of the recognized image object.
+     *
+     * @since        2.1
+     *
+     * @return       A pointer to the transformation matrix 4x4 that contains the object position
+     */
+    const Tizen::Graphics::FloatMatrix4* GetTransformMatrix(void) const;
+
+    /**
+     * Gets the transformed quadrilateral of the recognized image object.
+     *
+     * @since        2.1
+     *
+     * @return       The array list that contains the 4 points of the quadrilateral of the recognized image object
+     */
+    const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>* GetRectangle(void) const;
+
+    /**
+     * Compares the specified instance with the current instance.
+     *
+     * @since         2.1
+     *
+     * @return        @c true if the specified instance of Tizen::Base::Object is equal to the current %ImageObject instance, @n
+     *                else @c false
+     * @param[in]     obj                 The object to compare
+     */
+    virtual bool Equals(const Tizen::Base::Object& obj) const;
+
+    /**
+     * Gets the hash value of the current instance.
+     *
+     * @since          2.1
+     *
+     * @return         The hash value of the current instance
+     */
+    virtual int GetHashCode(void) const;
+
+private:
+    /**
+     * This is the default constructor for this class.
+     * The implementation of this constructor is declared as private to prohibit construction of the object by user.
+     *
+     * @since    2.1
+     */
+    ImageObject(void);
+
+    /**
+     * This is the destructor for this class. @n
+     * The resources are deallocated by this method.
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since    2.1
+     */
+    ~ImageObject(void);
+    /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    ImageObject(const ImageObject&);
+
+    /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    ImageObject& operator=(const ImageObject&);
+
+private:
+    class _ImageObjectImpl* __pImageObjectImpl;
+    friend class _ImageObjectImpl;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif /* _FUIX_VISION_IMAGE_OBJECT_H_ */
diff --git a/inc/FUixVisionImageRecognizer.h b/inc/FUixVisionImageRecognizer.h
new file mode 100644 (file)
index 0000000..c9af6a8
--- /dev/null
@@ -0,0 +1,269 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVisionImageRecognizer.h
+ * @brief    This is the header file for the %ImageRecognizer class.
+ *
+ * This header file contains the declarations of the %ImageRecognizer class.
+ */
+
+#ifndef _FUIX_VISION_IMAGE_RECOGNIZER_H_
+#define _FUIX_VISION_IMAGE_RECOGNIZER_H_
+#include <FBaseObject.h>
+#include <FBase.h>
+#include <FUixVisionImageObject.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+class ImageFeatureManager;
+/**
+ * @class    ImageRecognizer
+ * @brief    This class provides methods to find similar image objects that are used as the input images to the feature set that stores the features of the reference images.
+ *
+ * @since    2.1
+ *
+ * The %ImageRecognizer class provides methods to find similar image objects that are used as the input images to the feature set that stores the features of the reference images.
+ * This class also provides methods to calculate the 2D position and 3D pose transform matrix of the recognized image objects.
+ *
+ * The following example demonstrates how to use the %ImageRecognizer class.
+ *
+ * @code
+ * #include <FBase.h>
+ * #include <FUix.h>
+ * #include <FGraphics.h>
+ * #include <FIo.h>
+ * #include <FMedia.h>
+ * 
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Media;
+ * using namespace Tizen::Graphics;
+ * using namespace Tizen::Io;
+ * using namespace Tizen::Uix::Vision;
+ * class MyClass
+ *     : ICameraEventListener
+ * {
+ * public:
+ *     MyClass();
+ *     ~MyClass();
+ *     result Initialize(void);
+ * 
+ *     // Called when camera auto focus occurred
+ *     void OnCameraAutoFocused(bool completeCondition);
+ *     // Called when camera preview occurred
+ *     void OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r);
+ *     // Called when camera captured image
+ *     void OnCameraCaptured(Tizen::Base::ByteBuffer& capturedData, result r);
+ *     // Called when camera error occurred
+ *     void OnCameraErrorOccurred(Tizen::Media::CameraErrorReason r);
+ * 
+ * private:
+ *     ImageRecognizer*        __pImageRecognizer;
+ *     ImageFeatureManager*    __pFeatureManager;
+ * };
+ * 
+ * result
+ * MyClass::Initialize(void)
+ * {
+ *     result r;
+ * 
+ *     // Creates and initializes a recognition engine
+ *     __pImageRecognizer = new Tizen::Uix::Vision::ImageRecognizer();
+ *     r = __pImageRecognizer->Construct();
+ *
+ *     // Creates an initialized ImageFeatureManager
+ *     __pFeatureManager  = new Tizen::Uix::Vision::ImageFeatureManager();
+ *     r = __pFeatureManager->Construct();
+ * 
+ *     // Loads a feature set
+ *     r = __pFeatureManager->Load("/opt/usr/media/Images/testFeatureSet.xdb");
+ * 
+ *     // Configures the recognition engine
+ *     r =__pImageRecognizer->SetFeatureManager(*__pFeatureManager);
+ *
+ *   // Sets the image size to be same as the camera preview size
+ *     r = __pImageRecognizer->SetImageSize(640, 480);
+ * 
+ *     __pImageRecognizer->SetMultiTrackingEnabled(false);
+ * 
+ *     return r;
+ * }
+ * 
+ * // We suppose camera to be initialized with Tizen::Graphics::PIXEL_FORMAT_YCbCr420_PLANAR format
+ * void
+ * MyClass::OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r)
+ * {
+ *     // Processes the camera image
+ *     __pImageRecognizer->ProcessImage(previewedData);
+ * 
+ *     // Loops through all recognized images
+ *     for (int i = 0; i < __pImageRecognizer->GetRecognizedObjectCount(); i++)
+ *     {
+ *             const ImageObject *o = __pImageRecognizer->GetRecognizedObject(i);
+ *             int featId = o->GetFeatureId();
+ *     }
+ * }
+ *
+ * @endcode
+ */
+
+class _OSP_EXPORT_ ImageRecognizer
+    : public Tizen::Base::Object
+{
+public:
+
+    /**
+     * This is the default constructor for this class. @n
+     * The object is not fully constructed after this constructor is called. @n
+     * For full construction, the Construct() method must be called right after calling this constructor.
+     *
+     * @since    2.1
+     */
+    ImageRecognizer(void);
+
+    /**
+     * This is the destructor for this class. @n
+     * The resources are deallocated by this method.
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since    2.1
+     */
+    ~ImageRecognizer(void);
+
+    /**
+     * Initializes this instance of %ImageRecognizer. @n
+     * Every application must call the %Construct() method before calling any other method of %ImageRecognizer.
+     *
+     * @since        2.1
+     *
+     * @feature      %http://tizen.org/feature/vision.image_recognition
+     *
+     * @exception    E_SUCCESS                    The method is successful.
+     * @exception    E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature. 
+     *                                                                                    For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
+     * @remarks      Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
+     */
+    result Construct(void);
+
+    /**
+     * Enables or disables the single or multiple tracking mode.
+     *
+     * @since        2.1
+        *
+     * @param[in]    enable        The boolean value that enables or disables the multiple tracking mode @n
+        *                                                         The default mode is the single tracking mode.
+     *
+     * @remarks      
+     *                 - In the single tracking mode, only one image is recognized at a time on the screen.
+     *                 - In the multiple tracking mode, multiple images (maximum 3) can be recognized and tracked simultaneously.
+     */
+    void SetMultiTrackingEnabled(bool enable);
+
+    /**
+     * Sets the width and the height of the input image.
+     *
+     * @since        2.1
+     *
+     * @return       An error code
+     *
+     * @param[in]    width            The width of the input image
+     * @param[in]    height           The height of the input image
+     *
+     * @exception    E_SUCCESS        The method is successful.
+     * @exception    E_INVALID_ARG    A specified input parameter is invalid.
+     */
+    result SetImageSize(int width, int height);
+
+    /**
+     * Sets the ImageFeatureManager instance for initialization.
+     *
+     * @since       2.1
+     * @pre         The ImageFeatureManager should be initialized by loading the feature set file using the ImageFeatureManager::Load() method.
+     *
+     * @return      An error code
+     * @param[in]   imageFeatureManager      The ImageFeatureManager instance that manages the image feature set to use for recognition
+     * @exception   E_SUCCESS                The method is successful.
+     * @exception   E_INVALID_ARG            The ImageFeatureManager is invalid.
+     *
+     * @remarks     The ImageFeatureManager should be initialized by loading the feature set file.
+     */
+    result SetFeatureManager(ImageFeatureManager& imageFeatureManager);
+
+    /**
+     * Gets the count of the recognized image object.
+     *
+     * @since        2.1
+     *
+     * @return       The count of the recognized image object
+     *
+     * @remarks      The recognized object has an index value that ranges from @c 0 to (count of the recognized image objects) @c - 1.
+     * @see          GetRecognizedObject()
+     */
+    int GetRecognizedObjectCount(void);
+
+    /**
+     * Gets the recognized image object that contains the information.
+     *
+     * @since        2.1
+     *
+     * @return       A pointer to the ImageObject instance that includes all the information about the recognized image object
+     * @param[in]    index             The index of the recognized image object @n
+     *                                 The valid range for this parameter is @c 0 to (count of the recognized image objects) @c - 1.
+     * @exception    E_SUCCESS         The method is successful.
+     *
+     * @see          GetRecognizedObjectCount()
+     */
+    const ImageObject* GetRecognizedObject(int index) const;
+
+    /**
+     * Processes the input image for recognition.
+     *
+     * @since        2.1
+     *
+     * @return       An error code
+     *
+     * @param[in]    imageBuffer        The input image buffer @n
+     *                                  It must be allocated externally and have a size of (width*height) set by SetImageSize().
+     * @exception    E_SUCCESS          The method is successful.
+     * @exception    E_INVALID_ARG      Either of the following conditions has occurred:
+        *                                                                      - The specified @c imageBuffer is not allocated.
+        *                                                                      - The size of the specified @c imageBuffer is not equal to the input image size set by SetImageSize().
+     * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
+     * @see          SetImageSize(int, int)
+     */
+    result ProcessImage(const Tizen::Base::ByteBuffer& imageBuffer);
+
+private:
+    /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    ImageRecognizer(const ImageRecognizer&);
+
+    /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    ImageRecognizer& operator=(const ImageRecognizer&);
+
+private:
+    class _ImageRecognizerImpl* __pImageRecognizerImpl; ///< implementation bridge
+    friend class _ImageRecognizerImpl;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif // _FUIX_VISION_IMAGE_RECOGNIZER_H_
diff --git a/inc/FUixVisionQrCodeGenerator.h b/inc/FUixVisionQrCodeGenerator.h
new file mode 100644 (file)
index 0000000..1559cb1
--- /dev/null
@@ -0,0 +1,198 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVisionQrCodeGenerator.h
+ * @brief    This is the header file for the %QrCodeGenerator class.
+ *
+ * This header file contains the declarations of the %QrCodeGenerator class.
+ */
+
+#ifndef _FUIX_VISION_QR_CODE_GENERATOR_H_
+#define _FUIX_VISION_QR_CODE_GENERATOR_H_
+#include <FBaseObject.h>
+#include <FGrpBitmap.h>
+#include <FBase.h>
+#include <FMedia.h>
+#include "FUixVisionQrCodeTypes.h"
+
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+/**
+ * @class    QrCodeGenerator
+ * @brief    This class provides methods to generate a QR code image.
+ *
+ * @since    2.1
+ *
+ * The %QrCodeGenerator class provides methods to generate a QR code image.
+ *
+ * The following example demonstrates how to use the %QrCodeGenerator class.
+ *
+ * @code
+ * #include <FBase.h>
+ * #include <FUix.h>
+ * #include <FGraphics.h>
+ * #include <FIo.h>
+ * #include <FMedia.h>
+ * 
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Media;
+ * using namespace Tizen::Graphics;
+ * using namespace Tizen::Io;
+ * using namespace Tizen::Uix::Vision;
+ * 
+ * class MyClass
+ * {
+ * public:
+ *     MyClass();
+ *     ~MyClass();
+ *     result TestQrCodeGenerator(void);
+ * };
+ * 
+ * result
+ * MyClass::TestQrCodeGenerator(void)
+ * {
+ *     result r;
+ *     QrCodeGenerator qrGen;
+ *     qrGen.Construct();
+ * 
+ *     int width(0), height(0);
+ *     r = qrGen.EncodeToFile("Hello Tizen!",
+ *                     QR_CODE_MODE_UTF8,
+ *                     QR_CODE_ERROR_CORRECTION_LEVEL_Q,
+ *                     true,
+ *                     "/opt/usr/media/Images/temp.png",
+ *                     Tizen::Media::IMG_FORMAT_PNG,
+ *                     width,
+ *                     height);
+ *     return r;
+ * }
+ * @endcode
+ */
+class _OSP_EXPORT_ QrCodeGenerator
+    : public Tizen::Base::Object
+{
+public:
+
+    /**
+     * This is the default constructor for this class. @n
+     * The object is not fully constructed after this constructor is called. @n
+     * For full construction, the Construct() method must be called right after calling this constructor.
+     *
+     * @since    2.1
+     */
+    QrCodeGenerator(void);
+
+    /**
+     * This is the destructor for this class. @n
+     * The resources are deallocated by this method.
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since    2.1
+     */
+    ~QrCodeGenerator(void);
+
+    /**
+     * Initializes this instance of %QRCodeGenerator. @n
+     * Every application must call the %Construct() method before calling any other method of %QRCodeGenerator.
+     *
+     * @since        2.1
+     *
+     * @feature      %http://tizen.org/feature/vision.qrcode_generation
+     *
+     * @exception    E_SUCCESS                    The method is successful.
+     * @exception    E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature. 
+     *                                                                                    For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
+     * @remarks      Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
+     */
+    result Construct(void);
+
+    /**
+     * Gets the list of supported image file formats.
+     *
+     * @since        2.1
+        *
+     * @return       The list of supported image file formats
+     */
+    static Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>* GetSupportedImageFileFormatsListN(void);
+
+    /**
+     * Encodes the QR code into the file.
+     *
+     * @since        2.1
+     *
+     * @return       An error code
+     * @param[in]    message                The text used to encode the QR code image
+     * @param[in]    mode                   The input text encoding format (@c QR_CODE_MODE_ALPHANUMERIC, @c QR_CODE_MODE_BYTE, or @c QR_CODE_MODE_UTF8)
+     * @param[in]    errorCorrectionLevel   The QR code error correction level
+     * @param[in]    compatibility          The compatibility mode with the zxing library for the UTF-8 codes mode, which is activated when the mode selected is @c QR_MODE_UTF8
+     * @param[in]    imageFilePath          The file path of the generated QR code image
+     * @param[in]    imageFormat            The image file format of the generated QR code image
+     * @param[out]   width                  The width of the generated QR code image
+     * @param[out]   height                 The height of the generated QR code image
+     * @exception    E_SUCCESS              The method is successful.
+     * @exception    E_INVALID_ARG          A specified input parameter is invalid.
+     * @exception    E_FILE_NOT_FOUND       The specified file cannot be found or accessed.
+     *
+     * @remarks      The QR code encoding for the UTF-8 codes mode is not standardized as yet,
+     *               so the UTF-8 encoding/decoding compatibility with the zxing(http://code.google.com/p/zxing/) library is currently supported.
+     */
+    result EncodeToFile(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel errorCorrectionLevel, bool compatibility, const Tizen::Base::String& imageFilePath, Tizen::Media::ImageFormat imageFormat, int& width, int& height);
+
+    /**
+     * Encodes the QR code into the byte buffer.
+     *
+     * @since        2.1
+     *
+     * @return       A pointer to the Tizen::Base::ByteBuffer instance that contains the generated QR code image
+     * @param[in]    message                  The text used to encode the QR code image
+     * @param[in]    mode                     The input text encoding format (@c QR_CODE_MODE_ALPHANUMERIC, @c QR_CODE_MODE_BYTE, or @c QR_CODE_MODE_UTF8)
+     * @param[in]    error_level              The QR code error correction level
+     * @param[in]    compatibility            The compatibility mode with the zxing library for the UTF-8 codes mode, which is activated when the mode selected is @c QR_CODE_MODE_UTF8
+     * @param[out]   width                    The width of the generated QR code image
+     * @param[out]   height                   The height of the generated QR code image
+     * @exception    E_SUCCESS                The method is successful.
+     * @exception    E_INVALID_ARG            A specified input parameter is invalid.
+     *
+     * @remarks      The QR code encoding for the UTF-8 codes mode is not standardized as yet,
+     *               so the UTF-8 encoding/decoding compatibility with the zxing(http://code.google.com/p/zxing/) library is currently supported.
+     */
+    Tizen::Base::ByteBuffer* EncodeToBufferN(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel error_level, bool compatibility, int& width, int& height);
+
+
+private:
+    /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    QrCodeGenerator(const QrCodeGenerator& in);
+
+    /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    QrCodeGenerator& operator=(const QrCodeGenerator& in);
+
+private:
+    class _QrCodeGeneratorImpl* __pQrCodeGeneratorImpl;
+    friend class _QrCodeGeneratorImpl;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif // _FUIX_VISION_QR_CODE_GENERATOR_H_
diff --git a/inc/FUixVisionQrCodeObject.h b/inc/FUixVisionQrCodeObject.h
new file mode 100644 (file)
index 0000000..f4b7702
--- /dev/null
@@ -0,0 +1,158 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVisionQrCodeObject.h
+ * @brief    This is the header file for the %QrCodeObject class.
+ *
+ * This header file contains the declarations of the %QrCodeObject class.
+ */
+
+#ifndef _FUIX_VISION_QR_CODE_OBJECT_H_
+#define _FUIX_VISION_QR_CODE_OBJECT_H_
+
+#include <FUixVisionQrCodeTypes.h>
+#include <FBaseObject.h>
+#include <FBase.h>
+#include <FGraphics.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+/**
+ * @class    QrCodeObject
+ * @brief    This class represents a single QR code object recognized by the %QrCodeRecognizer class and provides methods to access the information of a recognized QR code object.
+ *
+ * @since    2.1
+ *
+ * The %QrCodeObject class represents a single QR code object recognized by the QrCodeRecognizer class and provides methods to access the information of a recognized QR code object.
+ */
+
+class _OSP_EXPORT_ QrCodeObject
+    : public Tizen::Base::Object
+{
+
+public:
+
+    /**
+     * Gets the unique identifier of the recognized QR code object in the scene.
+     *
+     * @since        2.1
+     *
+     * @return       The unique identifier of the recognized QR code object in the scene
+     */
+    int GetId(void) const;
+
+    /**
+     * Gets the version of the recognized QR code object.
+     *
+     * @since        2.1
+     *
+     * @return       The version of the recognized QR code object
+     */
+    int GetVersion(void) const;
+
+    /**
+     * Gets the error correction level of the recognized QR code object.
+     *
+     * @since        2.1
+     *
+     * @return       The error correction level of the recognized QR code object
+     */
+    Tizen::Uix::Vision::QrCodeErrorCorrectionLevel GetErrorCorrectionLevel(void) const;
+
+    /**
+     * Gets the text of the QR code object.
+     *
+     * @since        2.1
+     *
+     * @return       The text of the QR code object
+     */
+    Tizen::Base::String GetText(void) const;
+
+    /**
+     * Gets the transformation matrix 4x4 for the 3D pose of the recognized QR code object.
+     *
+     * @since        2.1
+     *
+     * @return       A pointer to the transformation matrix 4x4 that contains the object position
+     */
+    const Tizen::Graphics::FloatMatrix4* GetTransformMatrix(void) const;
+
+    /**
+     * Gets the transformed quadrilateral of the recognized QR code object.
+     *
+     * @since        2.1
+     *
+     * @return       The array list that contains the 4 points of the quadrilateral of the recognized QR code object
+     */
+    const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>* GetRectangle(void) const;
+
+    /**
+     * Compares the specified instance with the current instance.
+     *
+     * @since        2.1
+     *
+     * @return       @c true if the specified instance of Tizen::Base::Object is equal to the current %QrCodeObject instance, @n
+     *               else @c false
+     * @param[in]    obj                 The object to compare
+     */
+    virtual bool Equals(const Tizen::Base::Object& obj) const;
+
+    /**
+     * Gets the hash value of the current instance.
+     *
+     * @since     2.1
+     *
+     * @return    The hash value of the current instance
+     */
+    virtual int GetHashCode(void) const;
+
+private:
+    /**
+     * This is the default constructor for this class.
+     * The implementation of this constructor is declared as private to prohibit construction of the object by user.
+     *
+     * @since    2.1
+     */
+    QrCodeObject(void);
+
+    /**
+     * This is the destructor for this class. @n
+     *
+     * @since    2.1
+     */
+    ~QrCodeObject(void);
+
+    /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    QrCodeObject(const QrCodeObject&);
+
+    /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    QrCodeObject& operator=(const QrCodeObject&);
+
+private:
+    class _QrCodeObjectImpl* __pQrCodeObjectImpl;
+    friend class _QrCodeObjectImpl;
+};
+
+} } } //Tizen::Uix::Vision
+#endif // _FUIX_VISION_QR_CODE_OBJECT_H_
diff --git a/inc/FUixVisionQrCodeRecognizer.h b/inc/FUixVisionQrCodeRecognizer.h
new file mode 100644 (file)
index 0000000..f0545ea
--- /dev/null
@@ -0,0 +1,240 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVisionQrCodeRecognizer.h
+ * @brief    This is the header file for the %QrCodeRecognizer class.
+ *
+ * This header file contains the declarations of the %QrCodeRecognizer class.
+ */
+#ifndef _FUIX_VISION_QR_CODE_RECOGNIZER_H_
+#define _FUIX_VISION_QR_CODE_RECOGNIZER_H_
+#include <FBaseObject.h>
+#include <FUixVisionQrCodeObject.h>
+#include <FBase.h>
+#include <FGraphics.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+/**
+ * @class    QrCodeRecognizer
+ * @brief    This class provides methods to recognize a QR code image.
+ *
+ * @since    2.1
+ *
+ * The %QrCodeRecognizer class provides methods to recognize a QR code image.
+ *
+ * The following example demonstrates how to use the %QrCodeRecognizer class.
+ *
+ * @code
+ * #include <FBase.h>
+ * #include <FUix.h>
+ * #include <FGraphics.h>
+ * #include <FIo.h>
+ * #include <FMedia.h>
+ * 
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Media;
+ * using namespace Tizen::Graphics;
+ * using namespace Tizen::Io;
+ * using namespace Tizen::Uix::Vision;
+ * 
+ * class MyClass
+ *     : ICameraEventListener
+ * {
+ * public:
+ *     MyClass();
+ *     ~MyClass();
+ *     result Initialize(void);
+ * 
+ *     // Called when camera auto focus occurred
+ *     void OnCameraAutoFocused(bool completeCondition);
+ *     // Called when camera preview occurred
+ *     void OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r);
+ *     // Called when camera captured image
+ *     void OnCameraCaptured(Tizen::Base::ByteBuffer& capturedData, result r);
+ *     // Called when camera  error occurred
+ *     void OnCameraErrorOccurred(Tizen::Media::CameraErrorReason r);
+ * 
+ * private:
+ *     QrCodeRecognizer*               __pQrRecognizer;
+ * };
+ * 
+ * result
+ * MyClass::Initialize(void)
+ * {
+ *     result r;
+ * 
+ *     // Creates and initializes recognition engine
+ *     __pQrRecognizer = new Tizen::Uix::Vision::QrCodeRecognizer();
+ *     r = __pQrRecognizer->Construct();
+ * 
+ *     //Image size must be same as camera preview size
+ *     r = __pQrRecognizer->SetImageSize(640, 480);
+ * 
+ *     return r;
+ * }
+ * 
+ * // We suppose camera to be initialized with Tizen::Graphics::PIXEL_FORMAT_YCbCr420_PLANAR format
+ * void
+ * MyClass::OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r)
+ * {
+ *     // Processing of the camera image follows
+ *     __pQrRecognizer->ProcessImage(previewedData);
+ * 
+ *     // Loops through all recognized QRs
+ *     for (int i = 0; i < __pQrRecognizer->GetRecognizedObjectCount(); i++)
+ *     {
+ *             const QrCodeObject *o = __pQrRecognizer->GetRecognizedObject(i);
+ *             String qrText = o->GetText();
+ *     }
+ * }
+ *
+ * @endcode
+ */
+class _OSP_EXPORT_ QrCodeRecognizer
+    : public Tizen::Base::Object
+{
+public:
+
+    /**
+     * This is the default constructor for this class. @n
+     * The object is not fully constructed after this constructor is called. @n
+     * For full construction, the Construct() method must be called right after calling this constructor.
+     *
+     * @since    2.1
+     */
+    QrCodeRecognizer(void);
+
+    /**
+     * This is the destructor for this class. @n
+     * The resources are deallocated by this method.
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since    2.1
+     */
+    ~QrCodeRecognizer(void);
+
+    /**
+     * Initializes this instance of %QrCodeRecognizer. @n
+     * Every application must call the %Construct() method before calling any other method of %QrCodeRecognizer.
+     *
+     * @since        2.1
+     *
+     * @feature      %http://tizen.org/feature/vision.qrcode_recognition
+     *
+     * @exception    E_SUCCESS                    The method is successful.
+     * @exception    E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature. 
+     *                                                                                    For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
+     * @remarks      Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
+     */
+    result Construct(void);
+
+    /**
+     * Sets the width and the height of the input image.
+     *
+     * @since        2.1
+     *
+     * @return       An error code
+     *
+     * @param[in]    width               The width of the frame in pixels
+     * @param[in]    height              The height of the frame in pixels
+     * @exception    E_SUCCESS           The method is successful.
+     * @exception    E_INVALID_ARG       A specified input parameter is invalid.
+     * @remarks      This method must be called once before calling the ProcessImage() method.
+     */
+    result SetImageSize(int width, int height);
+
+    /**
+     * Processes the input image for recognition.
+     *
+     * @since        2.1
+     *
+     * @return       An error code
+     *
+     * @param[in]    imageBuffer        The input image buffer @n
+     *                                  It must be allocated externally and have a size of (width*height) set by SetImageSize().
+     * @exception    E_SUCCESS          The method is successful.
+     * @exception    E_INVALID_ARG      Either of the following conditions has occurred;
+        *                                                                      - The specified @c imageBuffer is not allocated 
+        *                                                                      - The size of the specified @c imageBuffer is not equal to the input image size set by SetImageSize().
+     * @exception    E_OUT_OF_MEMORY    The memory is insufficient.
+     */
+    result ProcessImage(const Tizen::Base::ByteBuffer& imageBuffer);
+
+    /**
+     * Gets the expected ROI (Region of Interest) of the recognized QR code for focusing.
+     *
+     * @since        2.1
+     *
+     * @return       An error code
+     * @param[out]   roi                 The expected ROI (Region of Interest) of the recognized QR code
+     * @exception    E_SUCCESS           The method is successful.
+     * @exception    E_INVALID_ARG       The specified input parameter is invalid.
+     *
+     * @remarks      The ROI is used to reset the camera focus to get a better image and it can be obtained after calling the ProcessImage() method at least once.
+     */
+    result GetFocusRoi(Tizen::Graphics::Rectangle& roi);
+
+    /**
+     * Gets the count of the recognized QR code object.
+     *
+     * @since        2.1
+     *
+     * @return       The count of the recognized QR code object
+     *
+     * @remarks      The recognized QR code object has an index value that ranges from @c 0 to (count of the recognized QR code objects) @c - 1.
+     * @see          GetRecognizedObject()
+     */
+    int GetRecognizedObjectCount(void);
+
+    /**
+     * Gets the recognized QR code object that contains the information.
+     *
+     * @since        2.1
+     *
+     * @return       A pointer to the QrCodeObject that includes all the information about the recognized QR code object
+     * @param[in]    index          The index of the recognized QR code object @n
+     *                              The valid range for this parameter is @c 0 to (count of the recognized QR code objects) @c - 1.
+     * @exception    E_SUCCESS      The method is successful.
+     *
+     * @see          GetRecognizedObjectCount()
+     */
+    const QrCodeObject* GetRecognizedObject(int index) const;
+
+
+private:
+    /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    QrCodeRecognizer(const QrCodeRecognizer& in);
+
+    /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     */
+    QrCodeRecognizer& operator=(const QrCodeRecognizer& in);
+
+private:
+    class _QrCodeRecognizerImpl* __pQrCodeRecognizerImpl;
+    friend class _QrCodeRecognizerImpl;
+
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif // _FUIX_VISION_QR_CODE_RECOGNIZER_H_
diff --git a/inc/FUixVisionQrCodeTypes.h b/inc/FUixVisionQrCodeTypes.h
new file mode 100644 (file)
index 0000000..7bc2474
--- /dev/null
@@ -0,0 +1,63 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVisionQrCodeTypes.h
+ * @brief    This is the header file for the QR code types.
+ *
+ * This header file contains the declarations of the QR code types.
+ */
+
+#ifndef _FUIX_VISION_QR_CODE_TYPES_H_
+#define _FUIX_VISION_QR_CODE_TYPES_H_
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+/**
+ * @enum     QrCodeErrorCorrectionLevel
+ *
+ * Defines the possible error correction levels for the QR code.
+ *
+ * @since    2.1
+ */
+enum QrCodeErrorCorrectionLevel
+{
+    QR_CODE_ERROR_CORRECTION_LEVEL_L = 1, /**< Low */
+    QR_CODE_ERROR_CORRECTION_LEVEL_M = 2, /**< Medium */
+    QR_CODE_ERROR_CORRECTION_LEVEL_Q = 3, /**< Quartile */
+    QR_CODE_ERROR_CORRECTION_LEVEL_H = 4  /**< High */
+};
+
+/**
+ * @enum     QrCodeMode
+ *
+ * Defines the possible encoding modes of the QR code.
+ *
+ * @since    2.1
+ */
+enum QrCodeMode
+{
+    QR_CODE_MODE_ALPHANUMERIC = 0,  /**< Alphanumeric */
+    QR_CODE_MODE_BYTE = 1,          /**< Byte */
+    QR_CODE_MODE_UTF8 = 2           /**< UTF8 */
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif // _FUIX_VISION_QR_CODE_TYPES_H_
diff --git a/lib/armv7-a/libarengine.so b/lib/armv7-a/libarengine.so
new file mode 100755 (executable)
index 0000000..6098a94
Binary files /dev/null and b/lib/armv7-a/libarengine.so differ
diff --git a/lib/x86/libarengine.so b/lib/x86/libarengine.so
new file mode 100644 (file)
index 0000000..94ba5c5
Binary files /dev/null and b/lib/x86/libarengine.so differ
diff --git a/osp-vision.manifest b/osp-vision.manifest
new file mode 100755 (executable)
index 0000000..ae3e6f7
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
\ No newline at end of file
diff --git a/osp-vision.pc.in b/osp-vision.pc.in
new file mode 100755 (executable)
index 0000000..eb6c3b7
--- /dev/null
@@ -0,0 +1,14 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=/usr/lib/osp
+includedir=/usr/include/osp
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@ 
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
+
diff --git a/packaging/osp-vision.spec b/packaging/osp-vision.spec
new file mode 100644 (file)
index 0000000..fac6e0d
--- /dev/null
@@ -0,0 +1,113 @@
+%define debug_package %{nil}
+%define __strip /bin/true
+
+Name:          osp-vision
+Summary:       osp vision library
+Version:       1.2.2.0
+Release:       2
+Group:         System/Libraries
+License:       TO_BE/FILLED_IN
+Source0:       %{name}-%{version}.tar.gz
+BuildRequires:  cmake
+BuildRequires:  pkgconfig(osp-appfw)
+BuildRequires:  osp-appfw-internal-devel
+BuildRequires:  pkgconfig(osp-uifw)
+BuildRequires:  osp-uifw-internal-devel
+BuildRequires:  pkgconfig(osp-media)
+BuildRequires:  osp-media-internal-devel
+BuildRequires:  pkgconfig(osp-image-core)
+BuildRequires:  osp-image-core-internal-devel
+BuildRequires:  pkgconfig(osp-image)
+BuildRequires:  osp-image-internal-devel
+
+Provides:       libarengine.so
+
+# runtime requires
+Requires: osp-appfw 
+Requires: osp-uifw
+Requires: osp-media
+Requires: osp-image
+Requires: osp-image-core
+
+%description
+osp vision library
+
+%package devel
+Summary:    osp vision library (Development)
+Group:      TO_BE/FILLED_IN
+Requires:   %{name} = %{version}-%{release}
+
+%description devel
+osp vision library (DEV)
+
+%package internal-devel
+Summary:    osp vision internal (Internal)
+Group:      TO_BE/FILLED_IN
+Requires:   %{name} = %{version}-%{release}
+
+%description internal-devel
+osp vision library (Internal-DEV)
+
+%package debug
+Summary:    osp vision library (Development)
+Group:      TO_BE/FILLED_IN
+Requires:   %{name} = %{version}-%{release}
+
+%description debug
+osp vision library (DEV)
+
+%prep
+%setup -q
+
+%build
+%if 0%{?tizen_build_binary_release_type_eng}
+CXXFLAGS="$CXXFLAGS -D_SECURE_LOG"
+%endif 
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%ifarch %{ix86}
+%if 0%{?simulator}
+CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=x86
+%else
+CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ " cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=x86
+%endif
+%else
+
+%if 0%{?tizen_build_binary_release_type_eng}
+CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_SECURE_LOG -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=arm
+%else
+CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=arm
+%endif
+
+
+%endif
+
+
+# Call make instruction with smp support
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/usr/share/license
+cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
+cat %{_builddir}/%{name}-%{version}/LICENSE.Flora >> %{buildroot}/usr/share/license/%{name}
+
+%make_install
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest osp-vision.manifest
+/usr/share/license/%{name}
+%{_libdir}/osp/*.so*
+
+%files devel
+%{_includedir}/osp/*.h
+%{_libdir}/pkgconfig/osp-vision.pc
+
+%files internal-devel
+%{_includedir}/osp/vision/*
+
+%files debug
+%{_libdir}/osp/debug/*.so*
diff --git a/src/FUixVisionImageFeatureInfo.cpp b/src/FUixVisionImageFeatureInfo.cpp
new file mode 100644 (file)
index 0000000..53924ac
--- /dev/null
@@ -0,0 +1,113 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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 languae governing permissions and
+// limitations under the License.
+//
+
+#include <FUixVisionImageFeatureInfo.h>
+#include "FUixVision_ImageFeatureInfoImpl.h"
+#include <FText.h>
+#include <FBaseSysLog.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+ImageFeatureInfo::ImageFeatureInfo()
+    : __pImageFeatureInfoImpl(0)
+{
+    std::unique_ptr<_ImageFeatureInfoImpl> pImageFeatureInfoImpl (new (std::nothrow) _ImageFeatureInfoImpl());
+    __pImageFeatureInfoImpl = pImageFeatureInfoImpl.release();
+}
+
+ImageFeatureInfo::~ImageFeatureInfo()
+{
+    if (__pImageFeatureInfoImpl != null)
+    {
+        delete __pImageFeatureInfoImpl;
+        __pImageFeatureInfoImpl = null;
+    }
+}
+
+Tizen::Base::String
+ImageFeatureInfo::GetDescription() const
+{
+    ClearLastResult();
+
+    char ch;
+    int length = -1;
+
+    //get true length of path to allocate memory
+    length = __pImageFeatureInfoImpl->GetDescription(&ch, 1);
+    if (!length)
+    {
+        return Tizen::Base::String("");
+    }
+
+    std::unique_ptr<char[]> pName(new (std::nothrow) char[length + 1]);
+    SysSecureTryReturn(NID_UIX, pName != null, Tizen::Base::String(""), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY))
+
+    //set data to char pointer, with allocated memory
+    __pImageFeatureInfoImpl->GetDescription(pName.get(), length + 1);
+
+    Tizen::Base::String description(pName.get());
+    return description;
+}
+
+int
+ImageFeatureInfo::GetThumbnailWidth(void) const
+{
+    return __pImageFeatureInfoImpl->GetThumbnailWidth();
+}
+
+int
+ImageFeatureInfo::GetThumbnailHeight(void) const
+{
+    return __pImageFeatureInfoImpl->GetThumbnailHeight();
+}
+
+Tizen::Base::ByteBuffer*
+ImageFeatureInfo::GetThumbnailN(void) const
+{
+    int bufWidth  = __pImageFeatureInfoImpl->GetThumbnailWidth();
+    SysSecureTryReturn(NID_UIX, bufWidth > 0, null, E_FAILURE, "[%s] Failed to get thumbnail width.", GetErrorMessage(E_FAILURE));
+
+    int bufHeight = __pImageFeatureInfoImpl->GetThumbnailHeight();
+    SysSecureTryReturn(NID_UIX, bufHeight > 0, null, E_FAILURE, "[%s] Failed to get thumbnail height.", GetErrorMessage(E_FAILURE));
+
+    std::unique_ptr<Tizen::Base::ByteBuffer> pOutBuffer(new (std::nothrow) Tizen::Base::ByteBuffer());
+    SysSecureTryReturn(NID_UIX, pOutBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    result res = pOutBuffer->Construct(bufWidth * bufHeight);
+    SysSecureTryReturn(NID_UIX, res == E_SUCCESS, null, res, "[%s] Failed to construct ByteBuffer.", GetErrorMessage(res));
+
+    bool success = __pImageFeatureInfoImpl->GetThumbnail((char*)pOutBuffer->GetPointer(), bufWidth, bufHeight, false);
+    SysSecureTryReturn(NID_UIX, success == true, null, E_FAILURE, "[%s] Failed to get thumbnail.", GetErrorMessage(E_FAILURE));
+
+    return pOutBuffer.release();
+}
+
+bool
+ImageFeatureInfo::Equals(const Object& obj) const
+{
+    return (static_cast<const Object*>(this) == &obj);
+}
+
+int
+ImageFeatureInfo::GetHashCode(void) const
+{
+    return (int)__pImageFeatureInfoImpl;
+}
+
+} } } //Tizen::Uix::Vision
+
diff --git a/src/FUixVisionImageFeatureManager.cpp b/src/FUixVisionImageFeatureManager.cpp
new file mode 100644 (file)
index 0000000..7b8eea4
--- /dev/null
@@ -0,0 +1,172 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include <FUixVisionImageFeatureManager.h>
+#include "FUixVision_ImageFeatureManagerImpl.h"
+#include <FMedia.h>
+#include <FGraphics.h>
+#include <FText.h>
+#include <FBaseSysLog.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+ImageFeatureManager::ImageFeatureManager(void)
+    : __pImageFeatureManagerImpl(0)
+{
+}
+
+ImageFeatureManager::~ImageFeatureManager(void)
+{
+    if (__pImageFeatureManagerImpl != null)
+    {
+        delete __pImageFeatureManagerImpl;
+        __pImageFeatureManagerImpl = null;
+    }
+}
+
+result
+ImageFeatureManager::Construct(void)
+{
+    SysAssertf(__pImageFeatureManagerImpl == null, "Already constructed! ",
+            "Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+    std::unique_ptr<_ImageFeatureManagerImpl> pImageFeatureManagerImpl (new (std::nothrow) _ImageFeatureManagerImpl());
+    SysSecureTryReturn(NID_UIX, pImageFeatureManagerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    __pImageFeatureManagerImpl = pImageFeatureManagerImpl.release();
+    __pImageFeatureManagerImpl->InitDB();
+    return E_SUCCESS;
+}
+
+result
+ImageFeatureManager::DeleteFeature(int featureIndex)
+{
+    SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturn(NID_UIX, featureIndex >= 0, E_FAILURE, E_INVALID_ARG,
+            "index should be greater than 0. [E_INVALID_ARG]");
+
+    return __pImageFeatureManagerImpl->DeleteFeature(featureIndex) ? E_SUCCESS : E_FAILURE;
+}
+
+int
+ImageFeatureManager::GetTotalNumberOfFeatures(void)
+{
+    SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+    return __pImageFeatureManagerImpl->GetTotalNumberOfFeatures();
+}
+
+result
+ImageFeatureManager::DeleteAllFeatures(void)
+{
+    SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+    SysSecureTryReturnResult(NID_UIX, __pImageFeatureManagerImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
+    __pImageFeatureManagerImpl->ReleaseDB();
+    __pImageFeatureManagerImpl->InitDB();
+    return E_SUCCESS;
+}
+
+int
+ImageFeatureManager::AddFeature(const Tizen::Base::ByteBuffer& imageBuffer, int width, int height, const Tizen::Base::String& descr)
+{
+
+    SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturn(NID_UIX, width > 0 && height > 0, -1, E_INVALID_ARG,
+            "Width and height must me more than 0. [E_INVALID_ARG]");
+
+    const unsigned char* image = (unsigned char*) imageBuffer.GetPointer();
+
+    SysSecureTryReturn(NID_UIX, image != null, -1, E_INVALID_ARG,
+            "image pointer must not be null. [E_INVALID_ARG]");
+
+    return (int) __pImageFeatureManagerImpl->AddFeature(image, width, height, descr);
+}
+
+int
+ImageFeatureManager::AddFeature(const Tizen::Base::String& imagePath)
+{
+    SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturn(NID_UIX, !imagePath.IsEmpty(), -1, E_INVALID_ARG,
+            "image path must not be empty. [E_INVALID_ARG]");
+
+    SysSecureTryReturn(NID_UIX, Tizen::Io::File::IsFileExist(imagePath), -1, E_INVALID_ARG,
+                "image path must exist. [E_INVALID_ARG]");
+
+       Tizen::Io::FileAttributes _fileAtt;
+
+       SysSecureTryReturn(NID_UIX, Tizen::Io::File::GetAttributes(imagePath, _fileAtt) == E_SUCCESS, -1, E_INVALID_ARG,
+                       "image file must have attributes. [E_INVALID_ARG]");
+
+       SysSecureTryReturn(NID_UIX, !_fileAtt.IsDirectory(), -1, E_INVALID_ARG,
+                       "image file must exist. [E_INVALID_ARG]");
+
+    return (int) __pImageFeatureManagerImpl->AddFeature(imagePath);
+}
+
+result
+ImageFeatureManager::Flush(const Tizen::Base::String* featureSetFilePath)
+{
+    SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    return __pImageFeatureManagerImpl->SaveDB(true, featureSetFilePath);
+}
+
+result
+ImageFeatureManager::Load(const Tizen::Base::String& featureSetFilePath)
+{
+    SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturnResult(NID_UIX, !featureSetFilePath.IsEmpty(), E_INVALID_ARG,
+            "feature set path must not be empty. [E_INVALID_ARG]");
+
+    SysSecureTryReturnResult(NID_UIX, Tizen::Io::File::IsFileExist(featureSetFilePath), E_INVALID_ARG,
+            "feature set path must exist. [E_INVALID_ARG]");
+
+       Tizen::Io::FileAttributes _fileAtt;
+
+    SysSecureTryReturnResult(NID_UIX, Tizen::Io::File::GetAttributes(featureSetFilePath, _fileAtt) == E_SUCCESS, E_INVALID_ARG,
+            "feature set file must have attributes. [E_INVALID_ARG]");
+
+    SysSecureTryReturnResult(NID_UIX, !_fileAtt.IsDirectory(), E_INVALID_ARG,
+            "feature set file must exist. [E_INVALID_ARG]");
+
+    return __pImageFeatureManagerImpl->OpenDB(featureSetFilePath) ? E_SUCCESS : E_FAILURE;
+}
+
+Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>*
+ImageFeatureManager::GetSupportedImageFileFormatsListN(void)
+{
+    std::unique_ptr<Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat> > pFormatList(new (std::nothrow) Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat>);
+    SysSecureTryReturn(NID_UIX, pFormatList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    pFormatList->Add(Tizen::Media::IMG_FORMAT_BMP);
+    pFormatList->Add(Tizen::Media::IMG_FORMAT_JPG);
+    pFormatList->Add(Tizen::Media::IMG_FORMAT_PNG);
+    return pFormatList.release();
+}
+
+const Tizen::Uix::Vision::ImageFeatureInfo*
+ImageFeatureManager::GetImageFeatureInfo(int index) const
+{
+    SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+    return __pImageFeatureManagerImpl->GetImageFeatureInfo(index);
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVisionImageObject.cpp b/src/FUixVisionImageObject.cpp
new file mode 100644 (file)
index 0000000..2c8347f
--- /dev/null
@@ -0,0 +1,105 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include <FUixVisionImageObject.h>
+#include "FUixVision_ImageObjectImpl.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+ImageObject::ImageObject()
+    : __pImageObjectImpl(0)
+{
+    std::unique_ptr<_ImageObjectImpl> pImageObjectImpl (new (std::nothrow) _ImageObjectImpl);
+    __pImageObjectImpl = pImageObjectImpl.release();
+}
+
+ImageObject::~ImageObject()
+{
+    if (__pImageObjectImpl != null)
+    {
+        delete __pImageObjectImpl;
+        __pImageObjectImpl = null;
+    }
+}
+
+int
+ImageObject::GetId(void) const
+{
+    if (__pImageObjectImpl)
+    {
+        return __pImageObjectImpl->GetId();
+    }
+    else
+    {
+        return -1;
+    }
+}
+
+int
+ImageObject::GetFeatureId(void) const
+{
+    if (__pImageObjectImpl)
+    {
+        return __pImageObjectImpl->GetFeatureId();
+    }
+    else
+    {
+        return -1;
+    }
+}
+
+const Tizen::Graphics::FloatMatrix4*
+ImageObject::GetTransformMatrix(void) const
+{
+    if (__pImageObjectImpl)
+    {
+        return __pImageObjectImpl->GetTransformMatrix();
+    }
+    else
+    {
+        return 0;
+    }
+}
+
+const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>*
+ImageObject::GetRectangle(void) const
+{
+    if (__pImageObjectImpl)
+    {
+        return __pImageObjectImpl->GetRectangle();
+    }
+    else
+    {
+        return 0;
+    }
+}
+
+bool
+ImageObject::Equals(const Object& obj) const
+{
+    return (static_cast<const Object*>(this) == &obj);
+}
+
+int
+ImageObject::GetHashCode(void) const
+{
+    return (int)__pImageObjectImpl;
+}
+
+} } } //Tizen::Uix::Vision
+
diff --git a/src/FUixVisionImageRecognizer.cpp b/src/FUixVisionImageRecognizer.cpp
new file mode 100644 (file)
index 0000000..070d5f9
--- /dev/null
@@ -0,0 +1,106 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include <FUixVisionImageRecognizer.h>
+#include "FUixVision_ImageRecognizerImpl.h"
+#include <cstring>
+#include <FText.h>
+#include <FBaseSysLog.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+ImageRecognizer::ImageRecognizer(void)
+    : __pImageRecognizerImpl(0)
+{
+}
+
+ImageRecognizer::~ImageRecognizer(void)
+{
+    if (__pImageRecognizerImpl != null)
+    {
+        delete __pImageRecognizerImpl;
+        __pImageRecognizerImpl = null;
+    }
+}
+
+result
+ImageRecognizer::Construct(void)
+{
+    SysAssertf(__pImageRecognizerImpl == null, "Already constructed! ",
+            "Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+    std::unique_ptr<_ImageRecognizerImpl> pImageRecognizerImpl (new (std::nothrow) _ImageRecognizerImpl);
+    SysSecureTryReturn(NID_UIX, pImageRecognizerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+    __pImageRecognizerImpl = pImageRecognizerImpl.release();
+
+    return E_SUCCESS;
+}
+
+void
+ImageRecognizer::SetMultiTrackingEnabled(bool enable)
+{
+    SysAssertf(__pImageRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+    __pImageRecognizerImpl->SetMultiTracking(enable);
+}
+
+result
+ImageRecognizer::SetImageSize(int width, int height)
+{
+    SysAssertf(__pImageRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturnResult(NID_UIX, width > 0 && height > 0, E_INVALID_ARG,
+            "Width and height must me more than 0. [E_INVALID_ARG]");
+
+    return __pImageRecognizerImpl->SetImageSize(width, height) ? E_SUCCESS : E_FAILURE;
+}
+
+result
+ImageRecognizer::SetFeatureManager(ImageFeatureManager& imageFeatureManager)
+{
+    SysAssertf(__pImageRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    return __pImageRecognizerImpl->SetImageDatabase(&imageFeatureManager) ? E_SUCCESS : E_FAILURE;
+}
+
+int
+ImageRecognizer::GetRecognizedObjectCount(void)
+{
+    SysAssertf(__pImageRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+    __pImageRecognizerImpl->FillObjectStorage();
+    return __pImageRecognizerImpl->GetRecognizedObjectsCount();
+}
+
+const ImageObject*
+ImageRecognizer::GetRecognizedObject(int index) const
+{
+    SysAssertf(__pImageRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+    return __pImageRecognizerImpl->GetRecognizedObject(index);
+}
+
+result
+ImageRecognizer::ProcessImage(const Tizen::Base::ByteBuffer& imageBuffer)
+{
+    SysAssertf(__pImageRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturn(NID_UIX, imageBuffer.GetPointer(), -1, E_INVALID_ARG,
+            "imageBuffer must not be null. [E_INVALID_ARG]");
+
+    return __pImageRecognizerImpl->ProcessImage((unsigned char*) imageBuffer.GetPointer()) != -1 ? E_SUCCESS : E_FAILURE;
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVisionQrCodeGenerator.cpp b/src/FUixVisionQrCodeGenerator.cpp
new file mode 100644 (file)
index 0000000..54d55b5
--- /dev/null
@@ -0,0 +1,136 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include <FUixVisionQrCodeGenerator.h>
+#include "FUixVision_QrCodeGeneratorImpl.h"
+#include <FText.h>
+#include <FBaseSysLog.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+QrCodeGenerator::QrCodeGenerator(void)
+    : __pQrCodeGeneratorImpl(0)
+{
+}
+
+QrCodeGenerator::~QrCodeGenerator(void)
+{
+    if (__pQrCodeGeneratorImpl != null)
+    {
+        delete __pQrCodeGeneratorImpl;
+        __pQrCodeGeneratorImpl = null;
+    }
+}
+
+result
+QrCodeGenerator::Construct(void)
+{
+    SysAssertf(__pQrCodeGeneratorImpl == null, "Already constructed! ",
+            "Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+    std::unique_ptr<_QrCodeGeneratorImpl> pQrCodeGeneratorImpl(new (std::nothrow) _QrCodeGeneratorImpl());
+    SysSecureTryReturn(NID_UIX, pQrCodeGeneratorImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+    __pQrCodeGeneratorImpl = pQrCodeGeneratorImpl.release();
+
+    return E_SUCCESS;
+}
+
+Tizen::Base::ByteBuffer*
+QrCodeGenerator::EncodeToBufferN(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel error_level, bool compatibility, int& width, int& height)
+{
+    SysAssertf(__pQrCodeGeneratorImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturnResult(NID_UIX, !message.IsEmpty(), null,
+            "message must not be empty. [E_INVALID_ARG]");
+
+    Tizen::Text::Utf8Encoding utf8;
+    std::unique_ptr<Tizen::Base::ByteBuffer> pMessageBuffer(utf8.GetBytesN(message));
+    __pQrCodeGeneratorImpl->Encode((char*) pMessageBuffer->GetPointer(), mode, error_level, compatibility);
+    __pQrCodeGeneratorImpl->GetSize(width, height);
+
+    std::unique_ptr<Tizen::Base::ByteBuffer> pBuffer(new (std::nothrow) Tizen::Base::ByteBuffer());
+    SysSecureTryReturn(NID_UIX, pBuffer != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    pBuffer->Construct(width * height);
+
+    if (__pQrCodeGeneratorImpl->SaveToBuffer((unsigned char*) pBuffer->GetPointer()))
+    {
+        return pBuffer.release();
+    }
+    else
+    {
+        return null;
+    }
+
+}
+
+result
+QrCodeGenerator::EncodeToFile(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel errorCorrectionLevel, bool compatibility, const Tizen::Base::String& imageFilePath, Tizen::Media::ImageFormat imageFormat, int& width, int& height)
+{
+    result r =   E_SUCCESS;
+    SysAssertf(__pQrCodeGeneratorImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturnResult(NID_UIX, !message.IsEmpty(), E_INVALID_ARG,
+            "message must not be empty. [E_INVALID_ARG]");
+
+    SysSecureTryReturnResult(NID_UIX, !imageFilePath.IsEmpty(), E_INVALID_ARG,
+            "image path must not be empty. [E_INVALID_ARG]");
+
+    Tizen::Text::Utf8Encoding utf8;
+    std::unique_ptr<Tizen::Base::ByteBuffer> pBuffer(utf8.GetBytesN(message));
+    if (!__pQrCodeGeneratorImpl->Encode((char*) pBuffer->GetPointer(), mode, errorCorrectionLevel, compatibility))
+    {
+       return E_FAILURE;
+    }
+
+    if(!__pQrCodeGeneratorImpl->SaveToFile(imageFilePath, imageFormat,width, height))
+    {
+       r = GetLastResult();
+       if( r == E_ILLEGAL_ACCESS || r == E_OUT_OF_RANGE)
+       {
+               r = E_FILE_NOT_FOUND;
+       }
+       else if (r == E_UNSUPPORTED_FORMAT)
+       {
+               r = E_INVALID_ARG;
+       }
+       else
+       {
+               r = E_FAILURE;
+       }
+
+    }
+
+    return r;
+}
+
+Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>*
+QrCodeGenerator::GetSupportedImageFileFormatsListN(void)
+{
+    std::unique_ptr<Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat> > pFormatList(
+            new (std::nothrow) Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat>);
+    SysSecureTryReturn(NID_UIX, pFormatList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+
+    pFormatList->Add(Tizen::Media::IMG_FORMAT_BMP);
+    pFormatList->Add(Tizen::Media::IMG_FORMAT_JPG);
+    pFormatList->Add(Tizen::Media::IMG_FORMAT_PNG);
+    return pFormatList.release();
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVisionQrCodeObject.cpp b/src/FUixVisionQrCodeObject.cpp
new file mode 100644 (file)
index 0000000..973eedd
--- /dev/null
@@ -0,0 +1,129 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include <FUixVisionQrCodeObject.h>
+#include "FUixVision_QrCodeObjectImpl.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+QrCodeObject::QrCodeObject(void)
+    : __pQrCodeObjectImpl(0)
+{
+    std::unique_ptr<_QrCodeObjectImpl> pQrCodeObjectImpl(new (std::nothrow) _QrCodeObjectImpl());
+    __pQrCodeObjectImpl = pQrCodeObjectImpl.release();
+}
+
+QrCodeObject::~QrCodeObject(void)
+{
+    if (__pQrCodeObjectImpl != null)
+    {
+        delete __pQrCodeObjectImpl;
+        __pQrCodeObjectImpl = null;
+    }
+}
+
+int
+QrCodeObject::GetId(void) const
+{
+    if (__pQrCodeObjectImpl)
+    {
+        return __pQrCodeObjectImpl->GetId();
+    }
+    else
+    {
+        return -1;
+    }
+}
+
+int
+QrCodeObject::GetVersion(void) const
+{
+    if (__pQrCodeObjectImpl)
+    {
+        return __pQrCodeObjectImpl->GetVersion();
+    }
+    else
+    {
+        return 0;
+    }
+}
+
+Tizen::Uix::Vision::QrCodeErrorCorrectionLevel
+QrCodeObject::GetErrorCorrectionLevel(void) const
+{
+    if (__pQrCodeObjectImpl)
+    {
+        return __pQrCodeObjectImpl->GetErrorCorrectionLevel();
+    }
+    else
+    {
+        return Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_L;
+    }
+}
+
+Tizen::Base::String
+QrCodeObject::GetText(void) const
+{
+    if (__pQrCodeObjectImpl)
+    {
+        return __pQrCodeObjectImpl->GetText();
+    }
+    else
+    {
+        return Tizen::Base::String("");
+    }
+}
+
+const Tizen::Graphics::FloatMatrix4*
+QrCodeObject::GetTransformMatrix(void) const
+{
+    if (__pQrCodeObjectImpl)
+    {
+        return __pQrCodeObjectImpl->GetTransformMatrix();
+    }
+    else
+    {
+        return null;
+    }
+}
+const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>*
+QrCodeObject::GetRectangle(void) const
+{
+    if (__pQrCodeObjectImpl)
+    {
+        return __pQrCodeObjectImpl->GetRectangle();
+    }
+    else
+    {
+        return null;
+    }
+}
+
+bool
+QrCodeObject::Equals(const Object& obj) const
+{
+    return (static_cast<const Object*>(this) == &obj);
+}
+
+int
+QrCodeObject::GetHashCode(void) const
+{
+    return (int)__pQrCodeObjectImpl;
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVisionQrCodeRecognizer.cpp b/src/FUixVisionQrCodeRecognizer.cpp
new file mode 100644 (file)
index 0000000..d979a99
--- /dev/null
@@ -0,0 +1,104 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include <FUixVisionQrCodeRecognizer.h>
+#include "FUixVision_QrCodeRecognizerImpl.h"
+#include <FBaseSysLog.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+QrCodeRecognizer::QrCodeRecognizer(void)
+    : __pQrCodeRecognizerImpl(0)
+{
+}
+
+QrCodeRecognizer::~QrCodeRecognizer(void)
+{
+    if (__pQrCodeRecognizerImpl != null)
+    {
+        delete __pQrCodeRecognizerImpl;
+        __pQrCodeRecognizerImpl = null;
+    }
+}
+
+result
+QrCodeRecognizer::Construct(void)
+{
+    SysAssertf(__pQrCodeRecognizerImpl == null, "Already constructed! ",
+            "Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+    std::unique_ptr<_QrCodeRecognizerImpl> pQrCodeRecognizerImpl(new (std::nothrow) _QrCodeRecognizerImpl());
+    SysSecureTryReturn(NID_UIX, pQrCodeRecognizerImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+    __pQrCodeRecognizerImpl = pQrCodeRecognizerImpl.release();
+
+    return __pQrCodeRecognizerImpl->Init() ? E_SUCCESS : E_FAILURE;
+}
+
+result
+QrCodeRecognizer::SetImageSize(int width, int height)
+{
+    SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturn(NID_UIX, width > 0 && height > 0, false, E_INVALID_ARG,
+            "width and height must be greater then 0. [E_INVALID_ARG]");
+
+    return __pQrCodeRecognizerImpl->SetFrameSize(width, height) ? E_SUCCESS : E_FAILURE;
+}
+
+result
+QrCodeRecognizer::GetFocusRoi(Tizen::Graphics::Rectangle& roi)
+{
+    SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    static int array[4] = {0};
+    result r = __pQrCodeRecognizerImpl->GetROI(array) ? E_SUCCESS : E_FAILURE;
+
+    if (r == E_SUCCESS)
+    {
+        roi.SetBounds(array[0], array[1], array[2] - array[0], array[3] - array[1]);
+    }
+    return r;
+}
+
+int
+QrCodeRecognizer::GetRecognizedObjectCount(void)
+{
+    SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+    __pQrCodeRecognizerImpl->FillObjectStorage();
+    return __pQrCodeRecognizerImpl->GetRecognizedObjectsCount();
+}
+
+const QrCodeObject*
+QrCodeRecognizer::GetRecognizedObject(int index) const
+{
+    SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+    return __pQrCodeRecognizerImpl->GetQrCodeObject(index);
+}
+
+result
+QrCodeRecognizer::ProcessImage(const Tizen::Base::ByteBuffer& imageBuffer)
+{
+    SysAssertf(__pQrCodeRecognizerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+    SysSecureTryReturn(NID_UIX, imageBuffer.GetPointer(), false, E_INVALID_ARG,
+            "image buffer must not be null. [E_INVALID_ARG]");
+
+    return __pQrCodeRecognizerImpl->ProcessFrame((unsigned char*) imageBuffer.GetPointer()) ? E_SUCCESS : E_FAILURE;
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVision_ImageFeatureInfoImpl.cpp b/src/FUixVision_ImageFeatureInfoImpl.cpp
new file mode 100644 (file)
index 0000000..48369e7
--- /dev/null
@@ -0,0 +1,91 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+#include "FUixVision_ImageFeatureInfoImpl.h"
+#include <FMedia.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+_ImageFeatureInfoImpl::_ImageFeatureInfoImpl(void)
+{
+}
+
+_ImageFeatureInfoImpl::~_ImageFeatureInfoImpl(void)
+{
+}
+
+float
+_ImageFeatureInfoImpl::GetAspect(void) const
+{
+       return __imageFeatureDatabaseInfo.aspect();
+}
+
+void
+_ImageFeatureInfoImpl::SetSariPointer(const sari2::ImageFeatureInfo& sari)
+{
+       __imageFeatureDatabaseInfo = sari;
+}
+
+_ImageFeatureInfoImpl*
+_ImageFeatureInfoImpl::GetInstance(ImageFeatureInfo* pImageFeatureDatabaseInfo)
+{
+    return pImageFeatureDatabaseInfo->__pImageFeatureInfoImpl;
+}
+const _ImageFeatureInfoImpl*
+_ImageFeatureInfoImpl::GetInstance(const ImageFeatureInfo* pImageFeatureDatabaseInfo)
+{
+    return pImageFeatureDatabaseInfo->__pImageFeatureInfoImpl;
+}
+
+unsigned int
+_ImageFeatureInfoImpl::GetDescription(char* name, int length) const
+{
+    return __imageFeatureDatabaseInfo.imagePath(name, length);
+}
+
+int
+_ImageFeatureInfoImpl::GetThumbnailWidth(void) const
+{
+    return __imageFeatureDatabaseInfo.imageWidth();
+}
+
+int
+_ImageFeatureInfoImpl::GetThumbnailHeight(void) const
+{
+    return __imageFeatureDatabaseInfo.imageHeight();
+}
+bool
+_ImageFeatureInfoImpl::GetThumbnail(char* outBuffer, int bufWidth, int bufHeight, bool fit) const
+{
+    return __imageFeatureDatabaseInfo.getThumbnailImage(outBuffer, bufWidth, bufHeight, fit);
+}
+
+Tizen::Uix::Vision::ImageFeatureInfo*
+_ImageFeatureInfoImpl::CreateImageFeatureInfoStorageN(const unsigned int size)
+{
+    Tizen::Uix::Vision::ImageFeatureInfo* objectStorage = new Tizen::Uix::Vision::ImageFeatureInfo[size];
+    return objectStorage;
+}
+
+Tizen::Uix::Vision::ImageFeatureInfo*
+_ImageFeatureInfoImpl::CreateImageFeatureInfoN()
+{
+    Tizen::Uix::Vision::ImageFeatureInfo* object = new Tizen::Uix::Vision::ImageFeatureInfo;
+    return object;
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVision_ImageFeatureInfoImpl.h b/src/FUixVision_ImageFeatureInfoImpl.h
new file mode 100644 (file)
index 0000000..11bee97
--- /dev/null
@@ -0,0 +1,63 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVision_ImageFeatureInfoImpl.h
+ * @brief    This is the header file for the %Tizen::Uix::_ImageFeatureInfoImpl class.
+ */
+
+#ifndef _FUIX_VISION_IMAGE_FEATURE_INFO_IMPL_H_
+#define _FUIX_VISION_IMAGE_FEATURE_INFO_IMPL_H_
+
+#include <FUixVisionImageFeatureInfo.h>
+#include <FBase.h>
+#include "ImageFeatureInfo.h"
+#include <cstring>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+class _ImageFeatureInfoImpl
+{
+public:
+    _ImageFeatureInfoImpl(void);
+    ~_ImageFeatureInfoImpl(void);
+
+    float GetAspect(void) const;
+    void SetSariPointer(const sari2::ImageFeatureInfo& sari);
+
+    unsigned int GetDescription(char* name, int length) const;
+    int GetThumbnailWidth(void) const;
+    int GetThumbnailHeight(void) const;
+    bool GetThumbnail(char* outBuffer, int bufWidth, int bufHeight, bool fit = true) const;
+    int GetLocalizingFeaturesNumber(void) const;
+    int GetTrackingFeaturesNumber(void) const;
+
+public:
+    static Tizen::Uix::Vision::ImageFeatureInfo* CreateImageFeatureInfoStorageN(const unsigned int size); //WHY should we need a storage?
+    static Tizen::Uix::Vision::ImageFeatureInfo* CreateImageFeatureInfoN();
+    static _ImageFeatureInfoImpl* GetInstance(Tizen::Uix::Vision::ImageFeatureInfo* pImageFeatureDatabaseInfo);
+    static const _ImageFeatureInfoImpl* GetInstance(const Tizen::Uix::Vision::ImageFeatureInfo* pImageFeatureDatabaseInfo);
+
+private:
+    sari2::ImageFeatureInfo __imageFeatureDatabaseInfo;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_IMAGE_FEATURE_INFO_IMPL_H_
diff --git a/src/FUixVision_ImageFeatureManagerImpl.cpp b/src/FUixVision_ImageFeatureManagerImpl.cpp
new file mode 100644 (file)
index 0000000..79318f9
--- /dev/null
@@ -0,0 +1,309 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include "FUixVision_ImageFeatureManagerImpl.h"
+#include "FUixVision_ImageFeatureInfoImpl.h"
+#include "FText.h"
+#include <FMedia.h>
+#include <FBaseSysLog.h>
+#include <string>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+_ImageFeatureManagerImpl::_ImageFeatureManagerImpl(void)
+    : __imageFeatureManager(0)
+    , __readOnly(false)
+    , __minSupportedSize(100)
+    , __maxSupportedResolution(16000000)
+{
+}
+
+_ImageFeatureManagerImpl::~_ImageFeatureManagerImpl(void)
+{
+    if (__imageFeatureManager)
+    {
+        delete __imageFeatureManager;
+    }
+}
+
+_ImageFeatureManagerImpl*
+_ImageFeatureManagerImpl::GetInstance(ImageFeatureManager& imageFeatureManager)
+{
+    return imageFeatureManager.__pImageFeatureManagerImpl;
+}
+
+const _ImageFeatureManagerImpl*
+_ImageFeatureManagerImpl::GetInstance(const ImageFeatureManager& imageFeatureManager)
+{
+    return imageFeatureManager.__pImageFeatureManagerImpl;
+}
+
+void
+_ImageFeatureManagerImpl::InitDB(void)
+{
+    __indices.RemoveAll();
+    if (__imageFeatureManager)
+    {
+        delete __imageFeatureManager;
+    }
+    __imageFeatureManager = new sari2::ImageFeatureManager();
+    __imageFeatureManager->initDB();
+}
+
+int
+_ImageFeatureManagerImpl::AddFeature(const Tizen::Base::String& filepath)
+{
+    Tizen::Media::ImageFormat imgFormat;
+    int imgWidth = 0, imgHeight = 0;
+    result r = Tizen::Media::ImageBuffer::GetImageInfo(filepath, imgFormat, imgWidth, imgHeight);
+
+    if (IsFailed(r))
+    {
+        SetLastResult(E_INVALID_ARG);
+        return -1;
+    }
+
+    if ((imgWidth < __minSupportedSize || imgHeight < __minSupportedSize) || (imgWidth * imgHeight > __maxSupportedResolution))
+    {
+        SetLastResult(E_INVALID_ARG);
+        return -1;
+    }
+
+    Tizen::Media::ImageBuffer imBuf;
+    r = imBuf.Construct(filepath, null, false);
+
+    if(IsFailed(r))
+    {
+        SetLastResult(E_INVALID_ARG);
+        return -1;
+    }
+
+    Tizen::Base::ByteBuffer* yuvBuf = imBuf.GetByteBufferN(Tizen::Media::MEDIA_PIXEL_FORMAT_YUV420P);
+    if (yuvBuf == null)
+    {
+        return -1;
+    }
+
+    int res = AddFeature(yuvBuf->GetPointer(), imBuf.GetWidth(), imBuf.GetHeight(), filepath);
+    delete yuvBuf;
+
+    return res;
+}
+
+int
+_ImageFeatureManagerImpl::AddFeature(const unsigned char* data, int width, int height, const Tizen::Base::String& info)
+{
+    if (!__imageFeatureManager)
+    {
+        return -1;
+    }
+
+    if ((width < __minSupportedSize || height < __minSupportedSize) || (width * height > __maxSupportedResolution))
+    {
+        SetLastResult(E_INVALID_ARG); 
+        return -1;
+    }
+
+    Tizen::Text::Utf8Encoding utf8;
+    std::unique_ptr<Tizen::Base::ByteBuffer> pBuffer(utf8.GetBytesN(info));
+    int index = (int) __imageFeatureManager->addImageToDB(data, width, height, (char*) pBuffer->GetPointer());
+
+    if (index > -1)
+    {
+        __indices.Add(index);
+        return __indices.GetCount() - 1;
+    }
+    return -1;
+}
+
+bool
+_ImageFeatureManagerImpl::DeleteFeature(int index)
+{
+    if (!__imageFeatureManager)
+    {
+        return false;
+    }
+
+    if (index < __indices.GetCount() && index >= 0)
+    {
+        int realIndex(0);
+        __indices.GetAt(index, realIndex);
+        if (__imageFeatureManager->deleteImageFromDB(realIndex))
+        {
+            __indices.RemoveAt(index);
+            return true;
+        }
+    }
+    else
+    {
+        SetLastResult(E_INVALID_ARG);
+    }
+
+    return false;
+}
+
+unsigned int
+_ImageFeatureManagerImpl::GetTotalNumberOfFeatures(void)
+{
+    return __indices.GetCount();
+}
+
+result
+_ImageFeatureManagerImpl::SaveDB(bool optimizeDatabase, const Tizen::Base::String* dbPath)
+{
+    SysSecureTryReturnResult(NID_UIX, (!__path.IsEmpty()) || (null != dbPath), E_INVALID_ARG,
+            "You need to open some database first or specify path to save data. [E_INVALID_ARG]");
+
+    UpdateDB();
+
+    __indices.RemoveAll();
+    result result = E_FAILURE;
+
+    if (!__imageFeatureManager)
+    {
+        return E_FAILURE;
+    }
+
+
+    if (null != dbPath)
+    {
+        SysSecureTryReturnResult(NID_UIX, !dbPath->IsEmpty(), E_INVALID_ARG,
+                "database path must not be empty. [E_INVALID_ARG]");
+        Tizen::Text::Utf8Encoding utf8;
+        std::unique_ptr<Tizen::Base::ByteBuffer> pBuffer(utf8.GetBytesN(*dbPath));
+        result = __imageFeatureManager->saveDB(optimizeDatabase, (const char*) pBuffer->GetPointer()) ? E_SUCCESS : E_FAILURE;
+    }
+    else
+    {
+        if (!__path.IsEmpty())
+        {
+            Tizen::Text::Utf8Encoding utf8;
+            std::unique_ptr<Tizen::Base::ByteBuffer> pBuffer(utf8.GetBytesN(__path));
+            result = __imageFeatureManager->saveDB(optimizeDatabase, (const char*) pBuffer->GetPointer()) ? E_SUCCESS : E_FAILURE;
+            if (E_FAILURE == result && __readOnly)
+            {
+                result = E_INVALID_ARG;
+            }
+        }
+    }
+
+    return result;
+}
+
+bool
+_ImageFeatureManagerImpl::UpdateDB()
+{
+    __indices.RemoveAll();
+
+    if (__imageFeatureManager->updateDB())
+    {
+        UpdateFeatureIndices();
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+bool
+_ImageFeatureManagerImpl::OpenDB(const Tizen::Base::String& dbpath)
+{
+    if (__imageFeatureManager)
+    {
+        delete __imageFeatureManager;
+    }
+    __imageFeatureManager = new sari2::ImageFeatureManager();
+    __imageFeatureManager->initDB();
+
+    Tizen::Text::Utf8Encoding utf8;
+    std::unique_ptr<Tizen::Base::ByteBuffer> pBuffer(utf8.GetBytesN(dbpath));
+    switch (__imageFeatureManager->openDB((const char*) pBuffer->GetPointer()))
+    {
+    case 0: //ok
+        __path = dbpath;
+        UpdateFeatureIndices();
+        break;
+    case -2: //read only feature set file
+        __path = dbpath;
+        UpdateFeatureIndices();
+        __readOnly = true;
+        break;
+    default: //error
+        return false;
+    }
+
+    return true;
+}
+
+void
+_ImageFeatureManagerImpl::ReleaseDB(void)
+{
+    if (!__imageFeatureManager)
+    {
+        return;
+    }
+
+    __imageFeatureManager->releaseDB();
+    __indices.RemoveAll();
+}
+
+const Tizen::Uix::Vision::ImageFeatureInfo*
+_ImageFeatureManagerImpl::GetImageFeatureInfo(int index)
+{
+    if (!__imageFeatureManager)
+    {
+        return null;
+    }
+
+    if (index < __indices.GetCount() && index >= 0)
+    {
+        Tizen::Uix::Vision::ImageFeatureInfo* di = _ImageFeatureInfoImpl::CreateImageFeatureInfoN();
+        int realIndex(0);
+        __indices.GetAt(index, realIndex);
+        _ImageFeatureInfoImpl::GetInstance(di)->SetSariPointer(sari2::ImageFeatureInfo(__imageFeatureManager, realIndex));
+        return di;
+    }
+    else
+    {
+        SetLastResult(E_INVALID_ARG);
+        return null;
+    }
+}
+
+void
+_ImageFeatureManagerImpl::UpdateFeatureIndices(void)
+{
+    __indices.RemoveAll();
+
+    if (!__imageFeatureManager)
+    {
+        return;
+    }
+
+    int total = __imageFeatureManager->totalNumberOfImages();
+    for (int i = 0; i < total; i++)
+    {
+        if (sari2::ImageFeatureInfo(__imageFeatureManager, i).isActive())
+        {
+            __indices.Add(i);
+        }
+    }
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVision_ImageFeatureManagerImpl.h b/src/FUixVision_ImageFeatureManagerImpl.h
new file mode 100644 (file)
index 0000000..f2e9b65
--- /dev/null
@@ -0,0 +1,70 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVision_ImageFeatureManagerImpl.h
+ * @brief    This is the header file for the %Tizen::Uix::_ImageFeatureManagerImpl class.
+ */
+
+#ifndef _FUIX_VISION_INTERNAL_IMAGE_FEATURE_MANAGER_IMPL_H_
+#define _FUIX_VISION_INTERNAL_IMAGE_FEATURE_MANAGER_IMPL_H_
+
+#include <FUixVisionImageFeatureManager.h>
+#include <FUixVisionImageRecognizer.h>
+#include "ImageFeatureManager.h"
+#include <FBase.h>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+class _ImageFeatureManagerImpl
+{
+public:
+    _ImageFeatureManagerImpl(void);
+    ~_ImageFeatureManagerImpl(void);
+
+    static        _ImageFeatureManagerImpl* GetInstance(ImageFeatureManager& imageFeatureManager);
+    static const _ImageFeatureManagerImpl* GetInstance(const ImageFeatureManager& imageFeatureManager);
+
+    void InitDB(void);
+    int AddFeature(const Tizen::Base::String& filepath);
+    int AddFeature(const unsigned char* data, int width, int height, const Tizen::Base::String& info);
+    bool DeleteFeature(int index);
+    unsigned int GetTotalNumberOfFeatures(void);
+    result SaveDB(bool optimizeDatabase, const Tizen::Base::String* dbPath = null);
+    bool UpdateDB(void);
+    bool OpenDB(const Tizen::Base::String& dbPath);
+    void ReleaseDB(void);
+    const Tizen::Uix::Vision::ImageFeatureInfo* GetImageFeatureInfo(int);
+
+private:
+    friend class _ImageRecognizerImpl;
+    _ImageFeatureManagerImpl(const _ImageFeatureManagerImpl&);
+    _ImageFeatureManagerImpl& operator=(const _ImageFeatureManagerImpl&);
+    void UpdateFeatureIndices(void);
+    sari2::ImageFeatureManager*              __imageFeatureManager;
+    Tizen::Base::String                      __path;
+    Tizen::Base::Collection::ArrayListT<int> __indices;
+       bool                                                                     __readOnly;
+    int __minSupportedSize;
+    int __maxSupportedResolution;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_INTERNAL_IMAGE_FEATURE_MANAGER_IMPL_H_
diff --git a/src/FUixVision_ImageObjectImpl.cpp b/src/FUixVision_ImageObjectImpl.cpp
new file mode 100644 (file)
index 0000000..07899c2
--- /dev/null
@@ -0,0 +1,119 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include "FUixVision_ImageObjectImpl.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+_ImageObjectImpl::_ImageObjectImpl(void)
+    : __pRectangleList(0)
+    , __pMatrix(0)
+{
+    __pRectangleList = new Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>();
+    __pMatrix = new Tizen::Graphics::FloatMatrix4();
+}
+
+_ImageObjectImpl::~_ImageObjectImpl(void)
+{
+    delete __pRectangleList;
+    delete __pMatrix;
+}
+
+int
+_ImageObjectImpl::GetId(void) const
+{
+    return __ImageRecognitionInfo.index();
+}
+
+int
+_ImageObjectImpl::GetFeatureId(void) const
+{
+    return __ImageRecognitionInfo.typeId();
+}
+
+const Tizen::Graphics::FloatMatrix4*
+_ImageObjectImpl::GetTransformMatrix(void) const
+{
+    memcpy(__pMatrix->matrix, __ImageRecognitionInfo.transform(), 16 * sizeof(float));
+    return __pMatrix;
+}
+
+float
+_ImageObjectImpl::GetAspect(void) const
+{
+    return __ImageRecognitionInfo.aspect();
+}
+
+void
+_ImageObjectImpl::SetSariPointer(const sari2::ImageRecognitionInfo& sari)
+{
+    __ImageRecognitionInfo = sari;
+}
+
+const Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>*
+_ImageObjectImpl::GetRectangle(void) const
+{
+    __pRectangleList->RemoveAll();
+    static float coordinates[8] = {0.f};
+    __ImageRecognitionInfo.rectangle(coordinates);
+
+    for (int i = 0; i < 4; ++i)
+        __pRectangleList->Add(Tizen::Graphics::FloatPoint(coordinates[2 * i], coordinates[(2 * i) + 1]));
+
+    return __pRectangleList;
+}
+
+_ImageObjectImpl*
+_ImageObjectImpl::GetInstance(ImageObject* pImageObject)
+{
+    return pImageObject->__pImageObjectImpl;
+}
+
+const _ImageObjectImpl*
+_ImageObjectImpl::GetInstance(const ImageObject* pImageObject)
+{
+    return pImageObject->__pImageObjectImpl;
+}
+
+void
+_ImageObjectImpl::ReleaseImageObject(ImageObject* pImageObject)
+{
+    delete pImageObject;
+}
+
+void
+_ImageObjectImpl::ReleaseImageObjectArray(ImageObject* pImageObject)
+{
+    delete[] pImageObject;
+}
+
+ImageObject*
+_ImageObjectImpl::CreateImageObjectStorageN(const unsigned int size)
+{
+    ImageObject* objectStorage = new ImageObject[size];
+    return objectStorage;
+}
+
+ImageObject*
+_ImageObjectImpl::CreateImageObjectN()
+{
+       ImageObject* object = new ImageObject;
+    return object;
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVision_ImageObjectImpl.h b/src/FUixVision_ImageObjectImpl.h
new file mode 100644 (file)
index 0000000..2c4c129
--- /dev/null
@@ -0,0 +1,63 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVision_ImageObjectImpl.h
+ * @brief    This is the header file for the %Tizen::Uix::_ImageObjectImpl class.
+ */
+
+#ifndef _FUIX_VISION_INTERNAL_IMAGE_OBJECT_IMPL_H_
+#define _FUIX_VISION_INTERNAL_IMAGE_OBJECT_IMPL_H_
+
+#include <FUixVisionImageObject.h>
+#include <FBase.h>
+#include "ImageRecognitionInfo.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+class _ImageObjectImpl
+{
+public:
+    _ImageObjectImpl(void);
+    ~_ImageObjectImpl(void);
+
+    int GetId(void) const;
+    int GetFeatureId(void) const;
+    const Tizen::Graphics::FloatMatrix4* GetTransformMatrix(void) const;
+    const Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>* GetRectangle(void) const;
+    float GetAspect(void) const;
+    void SetSariPointer(const sari2::ImageRecognitionInfo& sari);
+
+public:
+    static ImageObject* CreateImageObjectStorageN(const unsigned int size);
+    static ImageObject* CreateImageObjectN();
+    static void ReleaseImageObject(ImageObject* pImageObject);
+    static void ReleaseImageObjectArray(ImageObject* pImageObject);
+    static _ImageObjectImpl* GetInstance(ImageObject* pImageObject);
+    static const _ImageObjectImpl* GetInstance(const ImageObject* pImageObject);
+
+private:
+    sari2::ImageRecognitionInfo                                       __ImageRecognitionInfo;
+    Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>* __pRectangleList;
+    Tizen::Graphics::FloatMatrix4*                                    __pMatrix;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_INTERNAL_IMAGE_OBJECT_IMPL_H_
diff --git a/src/FUixVision_ImageRecognizerImpl.cpp b/src/FUixVision_ImageRecognizerImpl.cpp
new file mode 100644 (file)
index 0000000..ba3a5bc
--- /dev/null
@@ -0,0 +1,126 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include "FUixVision_ImageRecognizerImpl.h"
+#include "FUixVisionImageFeatureManager.h"
+#include "FUixVision_ImageFeatureManagerImpl.h"
+#include "FUixVision_ImageObjectImpl.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+_ImageRecognizerImpl::_ImageRecognizerImpl(void)
+       : __objectStorage(0)
+{
+    __objectStorage = _ImageObjectImpl::CreateImageObjectStorageN(MAX_TRACKABLE_OBJECTS);
+}
+
+_ImageRecognizerImpl::~_ImageRecognizerImpl(void)
+{
+        _ImageObjectImpl::ReleaseImageObjectArray(__objectStorage);
+}
+
+_ImageRecognizerImpl*
+_ImageRecognizerImpl::GetInstance(ImageRecognizer& imageRecognizer)
+{
+    return imageRecognizer.__pImageRecognizerImpl;
+}
+
+const _ImageRecognizerImpl*
+_ImageRecognizerImpl::GetInstance(const ImageRecognizer& imageRecognizer)
+{
+    return imageRecognizer.__pImageRecognizerImpl;
+}
+
+void
+_ImageRecognizerImpl::SetMultiTracking(bool useMultiTracking)
+{
+    __imageRecognizer.setMultiTracking(useMultiTracking);
+}
+
+bool
+_ImageRecognizerImpl::SetImageSize(unsigned int width, unsigned int height)
+{
+    return __imageRecognizer.setImageSize(width, height);
+}
+
+void
+_ImageRecognizerImpl::SetSceneTransform(const float* left, const float* right)
+{
+    __imageRecognizer.setSceneTransform(left, right);
+}
+
+bool
+_ImageRecognizerImpl::SetImageDatabase(const ImageFeatureManager* imgFMan)
+{
+    const _ImageFeatureManagerImpl* pImageFeatureManagerImpl = _ImageFeatureManagerImpl::GetInstance(*imgFMan);
+    //    __featureManager = pImageFeatureManagerImpl->GetFeatureManager();////!!!!!!!!!!!!!!
+    return __imageRecognizer.setImageDatabase(pImageFeatureManagerImpl->__imageFeatureManager);
+
+}
+
+int
+_ImageRecognizerImpl::ProcessImage(const unsigned char* frame)
+{
+    return __imageRecognizer.processImage(frame);
+}
+
+void
+_ImageRecognizerImpl::FillObjectStorage(void)
+{
+    __objectStorageSize = 0;
+    for (const sari2::ImageRecognitionInfo *o = __imageRecognizer.objectsBegin(), *e = __imageRecognizer.objectsEnd(); o != e; ++o)
+    {
+       Tizen::Uix::Vision::ImageObject& to = __objectStorage[__objectStorageSize++];
+        _ImageObjectImpl::GetInstance(&to)->SetSariPointer(*o);
+    }
+}
+
+const Tizen::Uix::Vision::ImageObject*
+_ImageRecognizerImpl::GetRecognizedObjectBegin(void) const
+{
+    return __objectStorage;
+}
+
+const Tizen::Uix::Vision::ImageObject*
+_ImageRecognizerImpl::GetRecognizedObjectEnd(void) const
+{
+    return __objectStorage + __objectStorageSize;
+}
+
+int
+_ImageRecognizerImpl::GetRecognizedObjectsCount(void)
+{
+       return __objectStorageSize;
+}
+
+const ImageObject*
+_ImageRecognizerImpl::GetRecognizedObject(int index)
+{
+       ClearLastResult();
+       if (index < __objectStorageSize)
+       {
+               return &__objectStorage[index];
+       }
+       else
+       {
+               SetLastResult(E_INVALID_ARG);
+               return 0;
+       }
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVision_ImageRecognizerImpl.h b/src/FUixVision_ImageRecognizerImpl.h
new file mode 100644 (file)
index 0000000..961028e
--- /dev/null
@@ -0,0 +1,72 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVision_ImageRecognizerImpl.h
+ * @brief    This is the header file for the %Tizen::Uix::_ImageRecognizerImpl class.
+ */
+
+
+#ifndef _FUIX_VISION_INTERNAL_IMAGE_RECOGNIZER_IMPL_H_
+#define _FUIX_VISION_INTERNAL_IMAGE_RECOGNIZER_IMPL_H_
+
+#include <FUixVisionImageObject.h>
+#include <FUixVisionImageRecognizer.h>
+#include "ImageRecognizer.h"
+#include "ImageFeatureManager.h"
+#include <cstring>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+static const int MAX_TRACKABLE_OBJECTS = 10;
+
+class _ImageRecognizerImpl
+{
+public:
+    _ImageRecognizerImpl(void);
+    ~_ImageRecognizerImpl(void);
+
+    static        _ImageRecognizerImpl* GetInstance(ImageRecognizer& imageRecognizer);
+    static const _ImageRecognizerImpl* GetInstance(const ImageRecognizer& imageRecognizer);
+
+    void SetMultiTracking(bool useMultiTracking);
+    bool SetImageSize(unsigned int width, unsigned int height);
+    void SetSceneTransform(const float* left, const float* right);
+    bool SetImageDatabase(const Tizen::Uix::Vision::ImageFeatureManager* imgFMan);
+    int ProcessImage(const unsigned char* frame);
+    void FillObjectStorage(void);
+
+    const ImageObject* GetRecognizedObjectBegin(void) const;
+    const ImageObject* GetRecognizedObjectEnd(void) const;
+
+    int GetRecognizedObjectsCount(void);
+    const ImageObject* GetRecognizedObject(int index);
+
+private:
+    _ImageRecognizerImpl(const _ImageRecognizerImpl&);
+    _ImageRecognizerImpl& operator=(const _ImageRecognizerImpl&);
+    ImageObject* __objectStorage;//[MAX_TRACKABLE_OBJECTS];
+    int __objectStorageSize;
+    sari2::ImageRecognizer      __imageRecognizer;
+    sari2::ImageFeatureManager  __featureManager;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_INTERNAL_IMAGE_RECOGNIZER_IMPL_H_
diff --git a/src/FUixVision_QrCodeGeneratorImpl.cpp b/src/FUixVision_QrCodeGeneratorImpl.cpp
new file mode 100644 (file)
index 0000000..0c07d69
--- /dev/null
@@ -0,0 +1,127 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include "FUixVision_QrCodeGeneratorImpl.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+_QrCodeGeneratorImpl::_QrCodeGeneratorImpl(void)
+{
+
+}
+
+_QrCodeGeneratorImpl::~_QrCodeGeneratorImpl(void)
+{
+
+}
+
+bool
+_QrCodeGeneratorImpl::Encode(const char* message, QrCodeMode mode, QrCodeErrorCorrectionLevel error_level, bool compatibility)
+{
+    sari2::QRCodeMode sariMode(sari2::QR_MODE_UTF8);
+    sari2::QRCodeErrorCorrectionLevel errorLevel(sari2::QR_ECL_Q);
+
+    switch(mode)
+    {
+    case Tizen::Uix::Vision::QR_CODE_MODE_ALPHANUMERIC:
+        sariMode = sari2::QR_MODE_ALPHANUMERIC; break;
+    case Tizen::Uix::Vision::QR_CODE_MODE_BYTE:
+        sariMode = sari2::QR_MODE_BYTE; break;
+    case Tizen::Uix::Vision::QR_CODE_MODE_UTF8:
+        sariMode = sari2::QR_MODE_UTF8; break;
+    default:
+        break;
+    }
+
+    switch(error_level)
+    {
+    case Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_H:
+        errorLevel= sari2::QR_ECL_H;    break;
+    case Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_L:
+        errorLevel = sari2::QR_ECL_L;   break;
+    case Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_M:
+        errorLevel = sari2::QR_ECL_M;   break;
+    case Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_Q:
+        errorLevel = sari2::QR_ECL_Q;   break;
+    default:
+        break;
+    }
+    return __qrCodeGenerator.encode(message, sariMode, errorLevel, compatibility);
+}
+
+bool
+_QrCodeGeneratorImpl::GetSize(int& width, int& height)
+{
+    return __qrCodeGenerator.getSize((unsigned int&)width, (unsigned int&)height);
+}
+
+bool
+_QrCodeGeneratorImpl::SaveToFile(const Tizen::Base::String& imagepath, Tizen::Media::ImageFormat imageFormat, int& width, int& height)
+{
+    if(!GetSize(width, height))
+    {
+       SetLastResult(E_INVALID_ARG);
+        return false;
+    }
+
+    unsigned char* grayBuffer = new unsigned char[(width * height * 3) >> 1];
+    if(!SaveToBuffer(grayBuffer))
+    {
+       SetLastResult(E_OPERATION_FAILED);  //No proper error returned from SaveToBuffer() Api.
+        return false;
+    }
+
+    memset(grayBuffer + width * height, 128, (width * height) >> 1);
+    Tizen::Media::ImageBuffer imBuf;
+    result r = imBuf.Construct(width, height, Tizen::Media::MEDIA_PIXEL_FORMAT_YUV420P, grayBuffer, (width * height * 3) >> 1);
+    delete[] grayBuffer;
+    if(IsFailed(r))
+    {
+       SetLastResult(r);
+       return false;
+    }
+
+    r = imBuf.EncodeToFile(imagepath, imageFormat, true);
+    if(IsFailed(r))
+    {
+       SetLastResult(r);
+       return false;
+    }
+
+    return true;
+}
+
+bool
+_QrCodeGeneratorImpl::SaveToBuffer(unsigned char* image)
+{
+    return __qrCodeGenerator.saveToBuffer(image);
+}
+
+_QrCodeGeneratorImpl*
+_QrCodeGeneratorImpl::GetInstance(QrCodeGenerator* pQrGenerator)
+{
+    return pQrGenerator->__pQrCodeGeneratorImpl;
+}
+
+const _QrCodeGeneratorImpl*
+_QrCodeGeneratorImpl::GetInstance(const QrCodeGenerator* pQrGenerator)
+{
+    return pQrGenerator->__pQrCodeGeneratorImpl;
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVision_QrCodeGeneratorImpl.h b/src/FUixVision_QrCodeGeneratorImpl.h
new file mode 100644 (file)
index 0000000..91702f5
--- /dev/null
@@ -0,0 +1,58 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVision_QrCodeGeneratorImpl.h
+ * @brief    This is the header file for the %Tizen::Uix::_QrCodeGeneratorImpl class.
+ */
+
+#ifndef _FUIX_VISION_INTERNAL_QR_CODE_GENERATOR_IMPL_H_
+#define _FUIX_VISION_INTERNAL_QR_CODE_GENERATOR_IMPL_H_
+
+#include <FUixVisionQrCodeGenerator.h>
+#include "QRCodeGenerator.h"
+#include <cstring>
+
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+class _QrCodeGeneratorImpl
+{
+public:
+    _QrCodeGeneratorImpl(void);
+    ~_QrCodeGeneratorImpl(void);
+
+    bool Encode(const char* message, QrCodeMode mode, QrCodeErrorCorrectionLevel error_level, bool compatibility = true);
+    bool GetSize(int& width, int& height);
+    bool SaveToFile(const Tizen::Base::String& imagepath, Tizen::Media::ImageFormat, int& width, int& height);
+    bool SaveToBuffer(unsigned char* image);
+
+public:
+    static _QrCodeGeneratorImpl* GetInstance(QrCodeGenerator* pQrGenerator);
+    static const _QrCodeGeneratorImpl* GetInstance(const QrCodeGenerator* pQrGenerator);
+
+private:
+    _QrCodeGeneratorImpl(const _QrCodeGeneratorImpl&); ///< Forbides copy constructor.
+    _QrCodeGeneratorImpl& operator=(const _QrCodeGeneratorImpl&); ///< Forbides assignment operator.
+    sari2::QRCodeGenerator __qrCodeGenerator;
+
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_INTERNAL_QR_CODE_GENERATOR_IMPL_H_
diff --git a/src/FUixVision_QrCodeObjectImpl.cpp b/src/FUixVision_QrCodeObjectImpl.cpp
new file mode 100644 (file)
index 0000000..3af40a3
--- /dev/null
@@ -0,0 +1,148 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include "FUixVision_QrCodeObjectImpl.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+_QrCodeObjectImpl::_QrCodeObjectImpl(void)
+    : __qrCodeObject()
+    , __pRectangleList(null)
+    , __Matrix(null)
+{
+    __pRectangleList = new Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>();
+    __Matrix = new Tizen::Graphics::FloatMatrix4();
+
+}
+
+_QrCodeObjectImpl::~_QrCodeObjectImpl(void)
+{
+    delete __pRectangleList;
+    delete __Matrix;
+}
+
+int
+_QrCodeObjectImpl::GetId(void) const
+{
+    return __qrCodeObject.id();
+}
+
+unsigned char
+_QrCodeObjectImpl::GetVersion(void) const
+{
+    return __qrCodeObject.version();
+}
+
+Tizen::Uix::Vision::QrCodeErrorCorrectionLevel
+_QrCodeObjectImpl::GetErrorCorrectionLevel(void)
+{
+    switch(__qrCodeObject.errorCorrectionLevel())
+    {
+    case sari2::QR_ECL_L:
+        __qrCodeErrorCorrectionLevel = Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_L;
+        break;
+    case sari2::QR_ECL_M:
+        __qrCodeErrorCorrectionLevel = Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_M;
+        break;
+    case sari2::QR_ECL_Q:
+        __qrCodeErrorCorrectionLevel = Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_Q;
+        break;
+    case sari2::QR_ECL_H:
+        __qrCodeErrorCorrectionLevel = Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_H;
+        break;
+    }
+
+    return __qrCodeErrorCorrectionLevel;
+}
+
+Tizen::Base::String
+_QrCodeObjectImpl::GetText(void) const
+{
+    return Tizen::Base::String(__qrCodeObject.text());
+}
+
+const Tizen::Graphics::FloatMatrix4*
+_QrCodeObjectImpl::GetTransformMatrix(void) const
+{
+    float* dst = (float*)__Matrix->matrix;
+    const float* src = __qrCodeObject.transform();
+    memcpy(dst, src, 16*sizeof(float));
+    return __Matrix;
+}
+
+const Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>*
+_QrCodeObjectImpl::GetRectangle(void) const
+{
+    __pRectangleList->RemoveAll();
+    static float coordinates[8] = {0.f};
+    __qrCodeObject.rectangle(coordinates);
+
+    for (int i = 0; i < 4; ++i)
+    {
+        __pRectangleList->Add(Tizen::Graphics::FloatPoint(coordinates[2 * i], coordinates[(2 * i) + 1]));
+    }
+
+    return __pRectangleList;
+
+}
+
+void
+_QrCodeObjectImpl::SetSariPointer(const sari2::QRCodeRecognitionInfo& sari)
+{
+    __qrCodeObject = sari;
+}
+
+_QrCodeObjectImpl*
+_QrCodeObjectImpl::GetInstance(QrCodeObject* pQrObject)
+{
+    return pQrObject->__pQrCodeObjectImpl;
+}
+
+const _QrCodeObjectImpl*
+_QrCodeObjectImpl::GetInstance(const QrCodeObject* pQrObject)
+{
+    return pQrObject->__pQrCodeObjectImpl;
+}
+
+void
+_QrCodeObjectImpl::ReleaseQrCodeObject(QrCodeObject* pQrCodeObject)
+{
+    delete pQrCodeObject;
+}
+
+void
+_QrCodeObjectImpl::ReleaseQrCodeObjectArray(QrCodeObject* pQrCodeObject)
+{
+    delete[] pQrCodeObject;
+}
+
+Tizen::Uix::Vision::QrCodeObject*
+_QrCodeObjectImpl::CreateQRCodeObjectStorageN(const unsigned int size)
+{
+    Tizen::Uix::Vision::QrCodeObject* objectStorage = new Tizen::Uix::Vision::QrCodeObject[size];
+    return objectStorage;
+}
+
+Tizen::Uix::Vision::QrCodeObject*
+_QrCodeObjectImpl::CreateQRCodeObjectN()
+{
+    Tizen::Uix::Vision::QrCodeObject* object = new Tizen::Uix::Vision::QrCodeObject;
+    return object;
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVision_QrCodeObjectImpl.h b/src/FUixVision_QrCodeObjectImpl.h
new file mode 100644 (file)
index 0000000..9f5f770
--- /dev/null
@@ -0,0 +1,69 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+
+/**
+ * @file     FUixVision_QrCodeObjectImpl.h
+ * @brief    This is the header file for the %Tizen::Uix::Vision::_QrCodeObjectImpl class.
+ */
+
+#ifndef _FUIX_VISION_INTERNAL_QR_CODE_RECOGNITION_INFO_IMPL_H_
+#define _FUIX_VISION_INTERNAL_QR_CODE_RECOGNITION_INFO_IMPL_H_
+
+#include <FUixVisionQrCodeObject.h>
+#include <FBase.h>
+#include <FGraphics.h>
+#include "QRCodeRecognitionInfo.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+class _QrCodeObjectImpl
+{
+public:
+    _QrCodeObjectImpl(void);
+    ~_QrCodeObjectImpl(void);
+
+
+    int GetId(void) const;
+    unsigned char GetVersion(void) const;
+    Tizen::Uix::Vision::QrCodeErrorCorrectionLevel GetErrorCorrectionLevel(void);
+    Tizen::Base::String GetText(void) const;
+    const Tizen::Graphics::FloatMatrix4* GetTransformMatrix(void) const;
+    const Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>* GetRectangle(void) const;
+    void SetSariPointer(const sari2::QRCodeRecognitionInfo& sari);
+
+public:
+    static Tizen::Uix::Vision::QrCodeObject* CreateQRCodeObjectStorageN(const unsigned int size);
+    static Tizen::Uix::Vision::QrCodeObject* CreateQRCodeObjectN();
+    static void ReleaseQrCodeObject(QrCodeObject* pQrCodeObject);
+    static void ReleaseQrCodeObjectArray(QrCodeObject* pQrCodeObject);
+    static _QrCodeObjectImpl* GetInstance(QrCodeObject* pQrObject);
+    static const _QrCodeObjectImpl* GetInstance(const QrCodeObject* pQrObject);
+
+private:
+
+    Tizen::Uix::Vision::QrCodeErrorCorrectionLevel                    __qrCodeErrorCorrectionLevel;
+    sari2::QRCodeRecognitionInfo                                      __qrCodeObject;
+    Tizen::Base::Collection::ArrayListT<Tizen::Graphics::FloatPoint>* __pRectangleList;
+    Tizen::Graphics::FloatMatrix4*                                    __Matrix;
+
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_INTERNAL_QR_CODE_OBJECT_IMPL_H_
diff --git a/src/FUixVision_QrCodeRecognizerImpl.cpp b/src/FUixVision_QrCodeRecognizerImpl.cpp
new file mode 100644 (file)
index 0000000..9299651
--- /dev/null
@@ -0,0 +1,138 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+#include "FUixVision_QrCodeRecognizerImpl.h"
+#include "FUixVision_QrCodeObjectImpl.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+_QrCodeRecognizerImpl::_QrCodeRecognizerImpl(void)
+    : __objectStorage(0)
+{
+    __objectStorage = _QrCodeObjectImpl::CreateQRCodeObjectStorageN(MAX_TRACKABLE_OBJECTS);
+}
+
+_QrCodeRecognizerImpl::~_QrCodeRecognizerImpl(void)
+{
+    _QrCodeObjectImpl::ReleaseQrCodeObjectArray(__objectStorage);
+}
+
+bool
+_QrCodeRecognizerImpl::SetFrameSize(int width, int height)
+{
+       __width = width;
+       __height = height;
+    return __qrCodeRecognizer.setFrameSize(width, height);
+}
+
+bool
+_QrCodeRecognizerImpl::ProcessFrame(const unsigned char* raw)
+{
+    return __qrCodeRecognizer.processFrame(raw);
+}
+
+bool
+_QrCodeRecognizerImpl::GetROI(int* 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
+_QrCodeRecognizerImpl::SetSceneTransform(const float* left, const float* right)
+{
+    __qrCodeRecognizer.setSceneTransform(left, right);
+}
+
+void
+_QrCodeRecognizerImpl::FillObjectStorage(void)
+{
+    __objectStorageSize = 0;
+    for (const sari2::QRCodeRecognitionInfo *o = __qrCodeRecognizer.objectsBegin(), *e = __qrCodeRecognizer.objectsEnd(); o != e; ++o)
+    {
+        Tizen::Uix::Vision::QrCodeObject& to = __objectStorage[__objectStorageSize++];
+        _QrCodeObjectImpl::GetInstance(&to)->SetSariPointer(*o);
+    }
+}
+
+const
+QrCodeObject* _QrCodeRecognizerImpl::QRCodeObjectsBegin(void)
+{
+    return __objectStorage;
+}
+
+const
+QrCodeObject* _QrCodeRecognizerImpl::QRCodeObjectsEnd(void)
+{
+    return __objectStorage + __objectStorageSize;
+}
+
+int _QrCodeRecognizerImpl::GetRecognizedObjectsCount(void)
+{
+    return __objectStorageSize;
+}
+
+const QrCodeObject*
+_QrCodeRecognizerImpl::GetQrCodeObject(int index)
+{
+    ClearLastResult();
+    if (index < __objectStorageSize)
+    {
+        return &__objectStorage[index];
+    }
+    else
+    {
+        SetLastResult(E_INVALID_ARG);
+        return null;
+    }
+}
+
+_QrCodeRecognizerImpl* _QrCodeRecognizerImpl::GetInstance(QrCodeRecognizer* pQrRecognizer)
+{
+    return pQrRecognizer->__pQrCodeRecognizerImpl;
+}
+
+const _QrCodeRecognizerImpl* _QrCodeRecognizerImpl::GetInstance(const QrCodeRecognizer* pQrRecognizer)
+{
+    return pQrRecognizer->__pQrCodeRecognizerImpl;
+}
+
+bool
+_QrCodeRecognizerImpl::Init(void)
+{
+    return __qrCodeRecognizer.init();
+}
+
+bool
+_QrCodeRecognizerImpl::Destroy(void)
+{
+    return __qrCodeRecognizer.destroy();
+}
+
+} } } //Tizen::Uix::Vision
diff --git a/src/FUixVision_QrCodeRecognizerImpl.h b/src/FUixVision_QrCodeRecognizerImpl.h
new file mode 100644 (file)
index 0000000..94ca31d
--- /dev/null
@@ -0,0 +1,71 @@
+//
+// Open Service Platform
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// 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.
+//
+
+/**
+ * @file     FUixVision_QrCodeRecognizerImpl.h
+ * @brief    This is the header file for the %Tizen::Uix::Vision::_QrCodeRecognizerImpl class.
+ */
+
+#ifndef _FUIX_VISION_INTERNAL_QR_CODE_RECOGNIZER_IMPL_H_
+#define _FUIX_VISION_INTERNAL_QR_CODE_RECOGNIZER_IMPL_H_
+
+#include <FUixVisionQrCodeRecognizer.h>
+#include "QRCodeRecognizer.h"
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+static const int MAX_TRACKABLE_OBJECTS = 10;
+
+class _QrCodeRecognizerImpl
+{
+public:
+    _QrCodeRecognizerImpl(void);
+    ~_QrCodeRecognizerImpl(void);
+
+    bool SetFrameSize(int width, int height);
+    bool ProcessFrame(const unsigned char* raw);
+    bool GetROI(int* roi);
+    void SetSceneTransform(const float* left, const float* right);
+    void FillObjectStorage(void);
+
+    const QrCodeObject* QRCodeObjectsBegin(void);
+    const QrCodeObject* QRCodeObjectsEnd(void);
+
+    int GetRecognizedObjectsCount(void);
+    const QrCodeObject* GetQrCodeObject(int index);
+
+    bool Init(void);
+    bool Destroy(void);
+
+public:
+    static _QrCodeRecognizerImpl* GetInstance(QrCodeRecognizer* pQrRecognizer);
+    static const _QrCodeRecognizerImpl* GetInstance(const QrCodeRecognizer* pQrRecognizer);
+
+private:
+    _QrCodeRecognizerImpl(const _QrCodeRecognizerImpl&); ///< Forbides copy constructor.
+    _QrCodeRecognizerImpl& operator=(const _QrCodeRecognizerImpl&); ///< Forbides assignment operator.
+    QrCodeObject* __objectStorage;
+    int __objectStorageSize;
+    int __width;
+    int __height;
+    sari2::QRCodeRecognizer __qrCodeRecognizer;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_INTERNAL_QR_CODE_RECOGNIZER_IMPL_H_
diff --git a/src/ImageFeatureInfo.h b/src/ImageFeatureInfo.h
new file mode 100644 (file)
index 0000000..76cd0dc
--- /dev/null
@@ -0,0 +1,90 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// 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.
+//
+
+#ifndef IMAGEFEATUREINFO_H_
+#define IMAGEFEATUREINFO_H_
+
+namespace sari2
+{
+
+class ImageFeatureManager;
+
+/// Holds all required information about one object on scene.
+class ImageFeatureInfo
+{
+    friend class ImageRecognizer;
+
+public:
+    /// \brief Default constructor.
+    ImageFeatureInfo(void);
+
+    /// \brief Constructor.
+    ///
+    /// Gives information about image of specified object from database,
+    /// without providing tracking information.
+    /// \param[in] ifm ImageFeatureManager instance (holds image database).
+    /// \param[in] index ID of object in database.
+    ImageFeatureInfo(const ImageFeatureManager* ifm, int index);
+
+    ImageFeatureInfo(const ImageFeatureInfo&);
+    ~ImageFeatureInfo(void) {}
+    ImageFeatureInfo& operator=(const ImageFeatureInfo&);
+
+    /// \brief Outputs file path to image of corresponding object from the
+    /// database.
+    /// \param[out] path Buffer to write image path into. Must be allocated
+    /// outside with specified size.
+    /// \param[in] length Allocated buffer size.
+    /// \return Path size.
+    unsigned int imagePath(char* path, unsigned int length) const;
+
+    /// \brief valuate if the object is available for query.
+    /// \return true if object is available
+    bool isActive(void) const;
+
+    /// \brief Width of image of corresponding object from the database.
+    /// \return Image width.
+    int imageWidth(void) const;
+
+    /// \brief Height of image of corresponding object from the database.
+    /// \return Image height.
+    int imageHeight(void) const;
+
+    /// \breif Outputs thumbnail of image of corresponding object from the
+    /// database.
+    /// \param[out] outBuffer Buffer to store corresponding image thumbnail.
+    /// Must be allocated outside and have size 'bufWidth*bufHeight'.
+    /// \param[in] bufWidth Width of thumbnail image.
+    /// \param[in] bufHeight Height of thumbnail image.
+    /// \param[in] fit Specifies if fitting image is requires. If 'false', then
+    /// thumbnail image will be cropped.
+    /// \return 'true' on success.
+    bool getThumbnailImage(char* outBuffer, int bufWidth, int bufHeight, bool fit = true) const;
+
+    /// \return Object's rectangle aspect ratio.
+    inline float aspect(void) const { int w = imageWidth(); return w > 0 ? imageHeight() / (float) w : 0.f; }
+
+
+private:
+    int mTypeId; ///< ID of object type.
+    const void* mDatabase; ///< Objects database.
+
+};
+
+}
+
+#endif // IMAGEFEATUREINFO_H_
diff --git a/src/ImageFeatureManager.h b/src/ImageFeatureManager.h
new file mode 100644 (file)
index 0000000..0e9488a
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// 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.
+//
+
+#ifndef IMAGEFEATUREMANAGER_H_
+#define IMAGEFEATUREMANAGER_H_
+
+namespace sari2
+{
+
+class ImageFeatureManager
+{
+    friend class ImageRecognizer;
+    friend class ImageFeatureInfo;
+
+public:
+    ImageFeatureManager(void);
+    ~ImageFeatureManager(void);
+
+public:
+    /// \breif Creates object database.
+    ///
+    /// Releases previously created DB if there is any.
+    void initDB(void);
+
+    /// Adds an object to referencing database.
+    /// \param[in] filepath Path to image on the disk.
+    /// \return index of newly created object on success, otherwise -1.
+    int addImageToDB(const char* filepath);
+
+    /// Adds an object to referencing database.
+    /// \param[in] data Buffer of grayscale 8 bit image data of specified width
+    /// and height.
+    /// \param[in] width Width of input image.
+    /// \param[in] height Height of input image.
+    /// \return index of newly created object on success, otherwise -1.
+    int addImageToDB(const unsigned char* data, int width, int height, const char* imageinfo);
+
+    /// \brief Removed object from referencing database.
+    /// \param[in] index Index of object saved in database.
+    /// \return 'true' on success.
+    bool deleteImageFromDB(int index);
+
+    /// \brief Undelete object in referencing database.
+    /// \param[in] index Index of object saved in database.
+    /// \return 'true' on success.
+    bool undeleteImageFromDB(int index);
+
+    /// \return Total number of images in database.
+    unsigned int totalNumberOfImages(void);
+
+    /// \brief Serializes database to output file.
+    /// \param[in] optimizeDatabase Specifies if database optimization is
+    /// required. Optimized database performs better, but optimization process
+    /// takes some time.
+    /// \param[in] dbpath Database file path. If equal to '0' and database was
+    /// loaded from file with 'openDB()' call, saves database to that file.
+    /// \return 'true' on success.
+    bool saveDB(bool optimizeDatabase, const char* dbPath = 0);
+
+    /// \brief Updates opened database.
+    /// \return 'true' on success.
+    bool updateDB(void);
+
+    /// \brief Loads database from input file.
+    /// \param[in] dbPath Database file path.
+    /// \return 0 on success.
+    /// \return -1 on failure.
+    /// \return -2 on readonly file.
+    int openDB(const char* dbPath);
+
+    /// \brief Delete all objects from the database.
+    void releaseDB(void);
+
+private:
+    void* databasePtr(void) const;
+    ImageFeatureManager(const ImageFeatureManager&);
+    ImageFeatureManager& operator=(const ImageFeatureManager&);
+
+private:
+    class ImageFeatureManagerImpl;
+    ImageFeatureManagerImpl* d; ///< implementation
+};
+
+}
+#endif // IMAGEFEATUREMANAGER_H_
diff --git a/src/ImageRecognitionInfo.h b/src/ImageRecognitionInfo.h
new file mode 100644 (file)
index 0000000..66a3ba9
--- /dev/null
@@ -0,0 +1,80 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// 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.
+//
+
+#ifndef IMAGERECOGNITIONINFO_H_
+#define IMAGERECOGNITIONINFO_H_
+
+namespace sari2
+{
+class ImageFeatureManager;
+class Database;
+
+/// Holds all required information about one object on scene.
+class ImageRecognitionInfo
+{
+    friend class ImageRecognizer;
+
+public:
+    /// \brief Default constructor.
+    ImageRecognitionInfo(void);
+
+    /// \brief Constructor.
+    ///
+    /// Gives information about image of specified object from database,
+    /// without providing tracking information.
+    /// \param[in] ifm ImageFeatureManager instance (holds image database).
+    /// \param[in] index ID of object in database.
+    ImageRecognitionInfo(const ImageFeatureManager* ifm, int index);
+
+    ImageRecognitionInfo(const ImageRecognitionInfo&);
+    ~ImageRecognitionInfo(void) {}
+    ImageRecognitionInfo& operator=(const ImageRecognitionInfo&);
+
+    /// \return Unique ID of object on scene.
+    inline int index(void) const { return mIndex; }
+    /// \return ID of object type.
+    inline int typeId(void) const { return mTypeId; }
+    /// \return OpenGL transformation matrix for object position.
+    inline const float* transform(void) const { return mTransform; }
+
+    inline const float aspect(void) const { int w = imageWidth(); return w > 0 ? imageHeight() / (float) w : 0.f; }
+
+    /// \brief Width of image of corresponding object from the database.
+    /// \return Image width.
+    int imageWidth(void) const;
+
+    /// \brief Height of image of corresponding object from the database.
+    /// \return Image height.
+    int imageHeight(void) const;
+
+    /// \brief Calculates homogeneous coordinates of reference image rectangle
+    /// verteces projections on current view.
+    /// \param[out] coordinates Buffer of size 8 to store calculation result as
+    /// follows: {x1, y1, x2, y2, x3, y3, x4, y4}.
+    /// \return 'true' on success.
+    bool rectangle(float *coordinates) const;
+
+private:
+    int mIndex; ///< Unique ID of object on scene.
+    int mTypeId; ///< ID of object type.
+    float mTransform[16]; ///< OpenGL transformation matrix for object position.
+    const Database*     mDatabase;
+};
+
+}
+
+#endif // IMAGERECOGNITIONINFO_H_
diff --git a/src/ImageRecognizer.h b/src/ImageRecognizer.h
new file mode 100644 (file)
index 0000000..fccf41e
--- /dev/null
@@ -0,0 +1,95 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// 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.
+//
+
+#ifndef IMAGERECOGNIZER_H_
+#define IMAGERECOGNIZER_H_
+
+#include "ImageRecognitionInfo.h"
+
+namespace sari2
+{
+       class ImageFeatureManager;
+}
+
+
+namespace sari2
+{
+
+class ImageRecognizer
+{
+public:
+    ImageRecognizer(void);
+    ~ImageRecognizer(void);
+
+public:
+    /// \brief Enables single or multi tracking mode.
+    /// \param[in] useMultiTracking Specifies if multiple objects tracking must
+    /// be enabled. If 'false', enables single object tracking.
+    void setMultiTracking(bool useMultiTracking);
+
+    /// \brief Setup input video-frame width and height.
+    ///
+    /// Must be called once before calling processFrame.
+    /// \param[in] width Frame width in pixels that is reported by
+    /// video-capture device.
+    /// \param[in] height Frame height in pixels that is reported by
+    /// video-capture device.
+    /// \return 'true' on success.
+    bool setImageSize(unsigned int width, unsigned int height);
+
+    /// \brief Setting scene transformation.
+    ///
+    /// Default matrix is identity.
+    /// \param[in] left Left transformation matrix 4x4.
+    /// \param[in] right Right transformation matrix 4x4.
+    void setSceneTransform(const float* left, const float* right);
+
+    /// \brief Sets object database for tracking.
+    /// \param[in] imgFMan Pointer on DB manager.
+    /// \return 'true' on success.
+    bool setImageDatabase(const ImageFeatureManager* imgFMan);
+
+    /// \brief Process external buffer with captured frame image.
+    /// \param[in] frame Pointer to buffer with intensity (grayscale8) data.
+    /// Buffer size must not be less than it set with setFrameSize
+    /// \pre setFrameSize
+    /// \return -1 on any error and processing time in ms on success.
+    int processImage(const unsigned char* frame);
+
+    /// Updates information about objects on scene.
+    /// \return Pointer on first element of the array of structures that holds
+    /// information about scene objects.
+    const ImageRecognitionInfo* objectsBegin(void) const;
+
+    /// \return Pointer on the end of the array of structures that holds
+    /// information about scene objects.
+    const ImageRecognitionInfo* objectsEnd(void) const;
+
+    /// \return Total number of images in database.
+    unsigned int databaseSize(void) const;
+
+private:
+    ImageRecognizer(const ImageRecognizer&);
+    ImageRecognizer& operator=(const ImageRecognizer&);
+
+private:
+    class ImageRecognizerImpl;
+    ImageRecognizerImpl* d; ///< implementation bridge
+};
+
+}
+#endif // IMAGERECOGNIZER_H_
diff --git a/src/QRCodeGenerator.h b/src/QRCodeGenerator.h
new file mode 100644 (file)
index 0000000..6ca1a58
--- /dev/null
@@ -0,0 +1,68 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// 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.
+//
+
+#ifndef QRCODEGENERATOR_H
+#define QRCODEGENERATOR_H
+
+#include "QRCodeTypes.h"
+namespace sari2
+{
+
+enum QRCodeSaveFormats
+{
+    QR_SAVE_FORMAT_BMP = 1,
+    QR_SAVE_FORMAT_PNG = 2,
+    QR_SAVE_FORMAT_JPG = 3,
+};
+
+/// \brief Class that provides utilities for QR codes generation
+class QRCodeGenerator
+{
+public:
+    QRCodeGenerator();
+    ~QRCodeGenerator();
+
+    /// \brief Generates QR code
+    /// \param[in] message - text to be encoded
+    /// \param[in] mode - QR code mode
+    /// \param[in] error_level - error correction level
+    /// \param[in] compatibility - compatibility mode with zxing library for UTF codes
+    /// \returns OK on success
+    bool encode(const char* message, QRCodeMode mode, QRCodeErrorCorrectionLevel error_level, bool compatibility = true);
+    /// \brief Determines the generated QR code image size
+    /// \param[out] width - image width
+    /// \param[out] height - image height
+    /// \returns OK on success
+    bool getSize(unsigned int& width, unsigned int& height);
+    /// \brief Writes generated QR code to file
+    /// \param[in] imagepath - path to file to be used
+    /// \returns OK on success
+    bool saveToFile(const char* imagepath, QRCodeSaveFormats imageFormat);
+    /// \brief Copies generated QR code image into given buffer. Buffer size should be no less than returned by size() method
+    /// \pre size
+    /// \returns OK on success
+    bool saveToBuffer(unsigned char* image);
+private:
+    QRCodeGenerator(const QRCodeGenerator& in);
+    QRCodeGenerator& operator=(const QRCodeGenerator& in);
+    class QRCodeGeneratorImpl;
+    QRCodeGeneratorImpl* mImpl;
+};
+
+}///SARI2
+
+#endif // QRCODEGENERATOR_H
diff --git a/src/QRCodeRecognitionInfo.h b/src/QRCodeRecognitionInfo.h
new file mode 100644 (file)
index 0000000..b52069b
--- /dev/null
@@ -0,0 +1,60 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// 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.
+//
+
+#ifndef QRCODERECOGNITIONINFO_H
+#define QRCODERECOGNITIONINFO_H
+
+#include "QRCodeTypes.h"
+
+namespace sari2
+{
+
+class QRCodeRecognitionInfo
+{
+
+friend class QRCodeRecognizer;
+
+public:
+       QRCodeRecognitionInfo();
+       ~QRCodeRecognitionInfo();
+       QRCodeRecognitionInfo(const QRCodeRecognitionInfo&);
+       QRCodeRecognitionInfo& operator=(const QRCodeRecognitionInfo&);
+
+    inline unsigned char id() const { return mId; }
+
+    inline unsigned char version() const { return mVersion; }
+
+    inline QRCodeErrorCorrectionLevel errorCorrectionLevel() const { return mErrorCorrectionLevel; }
+
+    inline const char* text() const { return mText; }
+
+    inline const float* transform() const { return mTransform; }
+
+    void rectangle(float *coordinates) const;
+
+private:
+
+    unsigned char mId;
+    unsigned char mVersion;
+    QRCodeErrorCorrectionLevel mErrorCorrectionLevel;
+    char* mText;
+    float mTransform[16];
+    const float *mLeft, *mRight;
+};
+
+}
+#endif // QRCODERECOGNITIONINFO_H
diff --git a/src/QRCodeRecognizer.h b/src/QRCodeRecognizer.h
new file mode 100644 (file)
index 0000000..dd1926d
--- /dev/null
@@ -0,0 +1,84 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// 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.
+//
+
+#ifndef QRCODERECOGNIZER_H
+#define QRCODERECOGNIZER_H
+
+#include "QRCodeRecognitionInfo.h"
+
+namespace sari2
+{
+
+/// \brief Class that provides utilities for QR code localization and recognition
+class QRCodeRecognizer
+{
+
+public:
+    /// \brief Setup input video-frame width and height
+    ///
+    /// Must be called once before calling processFrame.
+    /// \param [in] width - frame width in pixels that is reported by video-capture device
+    /// \param [in] height - frame height in pixels that is reported by video-capture device
+    /// \return true on success, false on error
+    bool      setFrameSize(unsigned int width, unsigned int height);
+
+    /// \brief Process external buffer with captured frame image
+    /// \param [in] raw - pointer to buffer with intensity (grayscale8) data. Buffer size must not be less than it set with setFrameSize
+    /// \pre setFrameSize
+    /// \return true on success, false on error
+    bool      processFrame(const unsigned char* raw);
+
+    /// \brief Returns focusing ROI
+    /// \param[out] roi - float array for ROI in form {top_left_x, top_left_y, bottom_right_x, bottom_right_y}
+    /// \return true on success, false on error
+    bool      getROI(float* roi);
+
+    /// \brief Setting scene transformation
+    /// \param [in] left transformation matrix 4x4
+    /// \param [in] right transformation matrix 4x4
+    /// Default matrix is identity
+    void     setSceneTransform(const float* left, const float* right);
+
+    /// Updates information about objects on scene.
+    /// \return Pointer on first element of the array of structures that holds
+    /// information about qr code objects.
+    const QRCodeRecognitionInfo* objectsBegin();
+    /// \return Pointer on the end of the array of structures that holds
+    /// information about qr code objects.
+    const QRCodeRecognitionInfo* objectsEnd();
+
+    /// \brief Initialize the reader
+    /// \return true on success, false on error
+    bool      init(void);
+    /// \brief Dispose of the reader
+    /// \return true on success, false on error
+    bool      destroy(void);
+
+    QRCodeRecognizer(void);
+    ~QRCodeRecognizer(void);
+
+private:
+    QRCodeRecognizer(const QRCodeRecognizer& in);
+    QRCodeRecognizer& operator=(const QRCodeRecognizer& in);
+    class QRCodeRecognizerImpl;
+    /// \brief Implementation bridge
+    QRCodeRecognizerImpl* mImpl;
+};
+
+}
+
+#endif // QRCODERECOGNIZER_H
diff --git a/src/QRCodeTypes.h b/src/QRCodeTypes.h
new file mode 100644 (file)
index 0000000..4a56d2c
--- /dev/null
@@ -0,0 +1,57 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.1 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// 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.
+//
+
+#ifndef QRCODETYPES_H
+#define QRCODETYPES_H
+
+namespace sari2
+{
+
+/// \brief Enumeration that defines possible error correction levels for QR code
+enum QRCodeErrorCorrectionLevel
+{
+    QR_ECL_L = 1,
+    QR_ECL_M = 2,
+    QR_ECL_Q = 3,
+    QR_ECL_H = 4
+};
+
+/// \brief Enumeration that defines possible encoding modes for QR code
+enum QRCodeMode
+{
+    QR_MODE_ALPHANUMERIC = 0,
+    QR_MODE_BYTE = 1,
+    QR_MODE_UTF8 = 2
+};
+
+enum QRCodeMessageType
+{
+    QR_MESSAGE_NULL = -1,
+    QR_MESSAGE_TEXT = 0,
+    QR_MESSAGE_PHONE = 1,
+    QR_MESSAGE_SMS = 2,
+    QR_MESSAGE_EMAIL = 3,
+    QR_MESSAGE_CONTACT = 4,
+    QR_MESSAGE_URL = 5,
+    QR_MESSAGE_EVENT = 6,
+    QR_MESSAGE_LOCATION = 7,
+    QR_MESSAGE_WIFI = 8
+};
+
+}
+
+#endif // QRCODETYPES_H