--- /dev/null
+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)
--- /dev/null
+
+ 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.
--- /dev/null
+Flora License
+
+Version 1.0, May, 2012
+
+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 Compatibility Definition Document
+and passes the Compatibility Test Suite 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.
+
+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.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://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.
+
--- /dev/null
+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, QRCodeTypes.h, and QRGenericFormatParser.h files are licensed under Flora License, Version 1
+Please, see LICENSE.Flora file for Flora License, Version 1 terms and conditions
--- /dev/null
+//
+// 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 %Tizen::Uix::Vision::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 of individual image feature data in image feature set.
+ *
+ * @since 2.1
+ *
+ * @see Tizen::Uix::Vision::ImageFeatureManager
+ *
+ */
+class _OSP_EXPORT_ ImageFeatureInfo
+ : public Tizen::Base::Object
+{
+public:
+
+ /*
+ * Gets detail description for feature set.
+ *
+ * @since 2.1
+ *
+ * @return Detail description for feature set
+ *
+ */
+ Tizen::Base::String GetDescription(void) const;
+
+ /*
+ * Gets width of thumbnail image.
+ *
+ * @since 2.1
+ *
+ * @return Thumbnail image width.
+ *
+ */
+ int GetThumbnailWidth(void) const;
+
+ /*
+ * Gets height of thumbnail image.
+ *
+ * @since 2.1
+ *
+ * @return Thumbnail image height.
+ *
+ * @exception E_SUCCESS The method is successful.
+ */
+ int GetThumbnailHeight(void) const;
+
+ /**
+ * Extracts thumbnail image.
+ *
+ * @since 2.1
+ *
+ * @return A pointer to the ByteBuffer instance containing the thumbnail image.
+ *
+ * @param[out] thumbnailBuffer Buffer to store corresponding grayscale thumbnail image.
+ * It must be allocated outside and have size 'width*height'.
+ *
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG thumbnailBuffer is not allocated or width and height is not same to real thumbnail width and height.
+ */
+ Tizen::Base::ByteBuffer* GetThumbnailN(void) const;
+
+ /**
+ * Compares the calling instance with the specified instance.
+ *
+ * @since 2.1
+ *
+ * @return true if the specified instance of Object is equal to the calling ImageFeatureInfo instance,
+ * 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 address of the current instance pointer
+ */
+ 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_ */
--- /dev/null
+//
+// 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 %Tizen::Uix::Vision::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 individual image data.
+ * And this class also provides method to manage image feature set which is the collection of individual feature data.
+ *
+ * @since 2.1
+ *
+ * The %ImageFeatureManager class provides the ability to generate individual image feature data and manage image feature set.
+ *
+ * The following example demonstrates how to use the %ImageFeatureManager class.
+ *
+ * @code
+ * void GenerateImageFeatureSet()
+ * {
+ * Tizen::Uix::Vision::ImageFeatureManager imageFeatureManager;
+ * imageFeatureManager.Construct();
+ * imageFeatureManager.Load("/mnt/ums/Images/testFeatureSet.xdb");
+ * imageFeatureManager.AddFeature("/mnt/ums/Images/image1.jpg");
+ * imageFeatureManager.AddFeature("/mnt/ums/Images/image2.jpg");
+ * imageFeatureManager.AddFeature("/mnt/ums/Images/image3.jpg");
+ * imageFeatureManager.Flush();
+ * }
+ */
+class _OSP_EXPORT_ ImageFeatureManager
+ : public Tizen::Base::Object
+{
+public:
+
+ /**
+ * This is the default constructor for this class.
+ * The object is not fully constructed after this constructor is called.
+ * 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);
+
+ /**
+ * Initialize this instance of ImageFeatureManager and create image feature set.
+ * Every application must call Construct() before calling any other method of ImageFeatureManager.
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ *
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @see
+ */
+ result Construct(void);
+
+ /**
+ * Loads feature set file
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ *
+ * @param[in] featureSetFilePath Feature set file path
+ *
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG A specified feature set file path is invalid.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ *
+ * @remarks if feature set file exists, it will be updated.
+ * if feature set file does not exist, it will be newly created.
+ * @see
+ */
+ result Load(const Tizen::Base::String& featureSetFilePath);
+
+ /**
+ * Returns list of supported image file formats for adding feature.
+ *
+ * @since 2.1
+ * @return list of supported image file formats
+ *
+ * @see
+ */
+ static Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>* GetSupportedImageFileFormatsListN(void);
+
+ /**
+ * Adds a feature to feature set
+ *
+ * @since 2.1
+ *
+ * @return Feature index of newly created feature on success.
+ * If the specified input image file path is invalid, it returns -1.
+ *
+ * @param[in] imagePath Input image file path
+ *
+ * @exception E_INVALID_ARG A specified input parameter is invalid.
+ *
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * Input image file must be one of the supported image file formats.
+ * Calling this method actually means 'Mark As Add Feature'.
+ * And the marked feature data will be added to feature set file after calling Flush();
+ * @see GetSupportedImageFileFormatsListN(void)
+ * Flush(const Tizen::Base::String* featureSetFilePath = 0);
+ */
+ int AddFeature(const Tizen::Base::String& imagePath);
+
+ /**
+ * Adds a feature to feature set
+ *
+ * @since 2.1
+ *
+ * @return Feature index of newly created feature on success.
+ * If A specified input image file path is invalid, it returns -1.
+ *
+ * @param[in] imageBuffer Image buffer of grayscale image data of specified width and height
+ * @param[in] width Width of input image
+ * @param[in] height Height of input image
+ * @param[in] description 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 will be added to feature set file after calling Flush();
+ * @see Flush(const Tizen::Base::String* featureSetFilePath = 0);
+ */
+ int AddFeature(const Tizen::Base::ByteBuffer& imageBuffer, int width, int height, const Tizen::Base::String& description);
+
+ /**
+ * Gets total number of features in feature set.
+ *
+ * @since 2.1
+ *
+ * @return Total number of features in the feature set.
+ * @see
+ */
+ int GetTotalNumberOfFeatures(void);
+
+ /**
+ * Deletes a feature of specified index in the feature set
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ *
+ * @param[in] featureIndex Feature index in feature set
+ *
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG A 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 will be deleted after calling Flush();
+ * @see Flush(const Tizen::Base::String* featureSetFilePath = 0);
+ */
+ result DeleteFeature(int featureIndex);
+
+ /**
+ * Deletes all features in 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 feature data will be deleted after calling Flush();
+ * @see Flush(const Tizen::Base::String* featureSetFilePath = 0);
+ */
+ result DeleteAllFeatures(void);
+
+ /**
+ * Saves features into feature set file and update all changes as marked.
+ *
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ *
+ * @param[in] featureSetFilePath Feature set file path
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG A specified Feature set path is invalid.
+ *
+ * @remarks All changes in feature set file by 'AddFeature' or 'DeleteFeature' or 'DeleteAllFeatures' are updated by calling this Flush() method.
+ * If featureSetFilePath is not decided or is same to file path used in Load(), the loaded feature set file will be updated.
+ * If featureSetFilePath is not same to file path used in Load(), the loaded feature set file is remained and new feature set file will be created.
+ * @remarks If featureSetFilePath is null, the feature set file loaded by Load() method will be overwritten.
+ *
+ * @see
+ */
+ result Flush(const Tizen::Base::String* featureSetFilePath = null);
+
+ /**
+ * Gets information of the individual feature
+ *
+ * @since 2.1
+ *
+ * @return pointer to ImageFeatureInfo
+ *
+ * @param[in] index Feature index in feature set.
+ * @see
+ */
+ 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_
--- /dev/null
+//
+// 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 %Tizen::Uix::Vision::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 single image object recognized by ImageRecognizer and provide the method to access information of the recognized image object.
+ *
+ * @since 2.1
+ *
+ * The %ImageObject class holds information about object tracking.
+ *
+ */
+class _OSP_EXPORT_ ImageObject
+ : public Tizen::Base::Object
+{
+public:
+ /**
+ * Gets unique identifier of the recognized image object in a scene
+ *
+ * @since 2.1
+ *
+ * @return Unique identifier of the recognized image object in a scene
+ *
+ * @see
+ */
+ int GetId(void) const;
+
+ /**
+ * Gets feature index of the recognized image object in feature set
+ *
+ * @since 2.1
+ *
+ * @return feature index of the recognized image object in feature set
+ *
+ * @see
+ */
+ int GetFeatureId(void) const;
+
+ /**
+ * Gets transformation matrix 4x4 for 3D pose of the recognized image object
+ *
+ * @since 2.1
+ *
+ * @return Pointer to transformation matrix 4x4 for object position
+ * @see
+ */
+ const Tizen::Graphics::FloatMatrix4* GetTransformMatrix(void) const;
+
+ /**
+ * Get the transformed quadrilateral of the recognized image object
+ *
+ * @since 2.1
+ *
+ * @return The array list of 4 points of the quadrilateral of the recognized image object
+ *
+ * @see
+ */
+ const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>* GetRectangle(void) const;
+
+ /**
+ * Compares the calling instance with the specified instance.
+ *
+ * @since 2.1
+ *
+ * @return true if the specified instance of Object is equal to the calling ImageObject instance,
+ * 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 address of the current instance pointer
+ */
+ 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_ */
--- /dev/null
+//
+// 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 %Tizen::Uix::Vision::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 same image objects to input image in the feature set which stores features of the reference images.
+ * And this class also provide methods to calculate 2D position and 3D pose transform matrix of the recognized image objects.
+ *
+ * @since 2.1
+ *
+ * The following example demonstrates how to use the ImageRecognizer class.
+ *
+ * @code
+ *
+ * //Process of initalization follows
+ * void
+ * Tracker::Initialize()
+ * {
+ * //Creating and initializing recognition engine
+ * __pImageRecognizer = new Tizen::Uix::Vision::ImageRecognizer();
+ * __pImageRecognizer->Construct();
+ *
+ * //Creating an initialized ImageFeatureManager
+ * __pFeatureManager = new Tizen::Uix::Vision::ImageFeatureManager();
+ * __pFeatureManager->Construct();
+ *
+ * //Loading feature set
+ * __pFeatureManager->Load("/mnt/ums/Images/sharks/testFeatureSet.xdb");
+ *
+ * //Configuring recognition engine
+ * __pImageRecognizer->SetFeatureManager(__pFeatureManager);
+ * __pImageRecognizer->SetImageSize(CAMERA_WIDTH, CAMERA_HEIGHT);
+ *
+ * __pImageRecognizer->SetMultiTracking(true);
+ * }
+ *
+ * //We suppose camera to be initialized with Tizen::Graphics::PIXEL_FORMAT_YCbCr420_PLANAR format
+ *
+ * void
+ * Tracker::OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r)
+ * {
+ * //Processing of the camera image follows
+ * __pImageRecognizer->ProcessImage(previewedData);
+ *
+ * //Loop through all recognized images
+ * for (int i = 0; i < __pImageRecognizer->GetRecognizedObjectCount(); i++)
+ * {
+ * const Tizen::Uix::Vision::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.
+ * The object is not fully constructed after this constructor is called.
+ * 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.
+ * Every application must call Construct() before calling any other method of ImageRecognizer.
+ *
+ * @since 2.1
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @see
+ */
+ result Construct(void);
+
+ /**
+ * Enables single or multiple tracking mode
+ *
+ *
+ * @since 2.1
+ * @param[in] enable Enable multiple tracking mode on true, default is single tracking mode.
+ *
+ * @remarks In single tracking mode, only one image will be recognized in the screen at once.
+ * In multiple tracking mode, multiple images can be recognized and tracked simultaneously.
+ * (Max : 3 images simultaneously)
+ * @exception
+ * @see
+ */
+ void SetMultiTrackingEnabled(bool enable);
+
+
+ /**
+ * Sets width and height of input image
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ *
+ * @param[in] width Input image width
+ * @param[in] height Input image height
+ *
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @see
+ */
+ result SetImageSize(int width, int height);
+
+
+ /**
+ * Sets ImageFeatureManager instance for initialization
+ *
+ * @since 2.1
+ * @pre ImageFeatureManager should be initialized by loading feature set file using call Load() method.
+ *
+ * @return An error code.
+ * @param[in] imageFeatureManager ImageFeatureManager managing image feature set to be used for recognition
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG An input ImageFeatureManager is invalid.
+ *
+ * @remarks ImageFeatureManager should be initialized by loading feature set file.
+ * @see result ImageFeatureManager::Load(const Tizen::Base::String& featureSetFilePath).
+ */
+ result SetFeatureManager(ImageFeatureManager& imageFeatureManager);
+
+ /**
+ * Gets the number of the recognized image object
+ *
+ * @since 2.1
+ *
+ * @return Number of recognized image object
+ *
+ * @remarks The recognized object has index value from 0 to (number of the recognized image objects - 1)
+ * @see GetRecognizedObject(int index)
+ */
+ int GetRecognizedObjectCount(void);
+
+ /**
+ * Gets the recognized image object to get information
+ *
+ * @since 2.1
+ *
+ * @return The pointer of ImageObject including all information about the reconginzed image object
+ * @param[in] index Index of the recognized image object.
+ * Valid range of this parameter is 0 to (number of the recognized image objects - 1).
+ * @exception E_SUCCESS The method is successful.
+ *
+ * @see GetRecognizedObjectCount(void)
+ */
+ const ImageObject* GetRecognizedObject(int index) const;
+
+ /**
+ * Process input image for recognition
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ *
+ * @param[in] imageBuffer Input image buffer
+ * It must be allocated outside and have size of (width*height) by SetImageSize().
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG imageBuffer is not allocated or the size of imageBuffer is not equal to input image size by SetImageSize().
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @see SetImageSize(int width, int height)
+ */
+ 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_
--- /dev/null
+//
+// 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 %Tizen::Uix::Vision::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 QR code image.
+ *
+ * @since 2.1
+ * The following example demonstrates how to use the %QrCodeGenerator class.
+ *
+ * @code
+ * Tizen::Uix::Vision::QrCodeGenerator qrGen;
+ * qrGen.Construct();
+ *
+ * qrGen.EncodeToFile("test message", Tizen::Uix::Vision::QR_MODE_UTF8, Tizen::Uix::Vision::QR_ECL_Q, "/mnt/ums/Others/temp.bmp", Tizen::Media::IMG_FORMAT_PNG);
+ * @endcode
+ */
+class _OSP_EXPORT_ QrCodeGenerator
+ : public Tizen::Base::Object
+{
+public:
+
+ /**
+ * This is the default constructor for this class.
+ * The object is not fully constructed after this constructor is called.
+ * 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.
+ * Every application must call Construct() before calling any other method of QRCodeGenerator.
+ *
+ * @since 2.1
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @see
+ */
+ result Construct(void);
+
+ /**
+ * Returns list of supported image file formats .
+ *
+ * @return list of supported image file formats
+ * @since 2.1
+ *
+ * @remarks
+ * @see
+ */
+ static Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>* GetSupportedImageFileFormatsListN(void);
+
+ /**
+ * Generates QR code into file
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ * @param[in] message Text to be encoded to QR code image
+ * @param[in] mode Input text encoding format (QR_CODE_MODE_ALPHANUMERIC, QR_CODE_MODE_BYTE, QR_CODE_MODE_UTF8)
+ * @param[in] errorCorrectionLevel QR code error correction level
+ * @param[in] compatibility Compatibility mode with zxing library for UTF-8 codes mode when mode is selected with QR_MODE_UTF8
+ * @param[in] imageFilePath File path of the generated QR code image
+ * @param[in] imageFormat Image file format of the generated QR code image
+ * @param[out] width Width of the generated QR code image
+ * @param[out] height 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 QR code encoding for UTF-8 is not standardized yet.
+ * So we support UTF-8 encoding/decoding compatibility to zxing(http://http://code.google.com/p/zxing/) library.
+ * @see
+ */
+ 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);
+
+ /**
+ * Generates QR code into a byte buffer
+ *
+ * @since 2.1
+ *
+ * @return A pointer to the ByteBuffer instance containing the generated QR code image
+ * @param[in] message Text to be encoded to QR code image
+ * @param[in] mode Input text encoding format (QR_MODE_ALPHANUMERIC, QR_MODE_BYTE, QR_MODE_UTF8)
+ * @param[in] errorCorrectionLevel QR code error correction level
+ * @param[in] compatibility Compatibility mode with zxing library for UTF-8 codes mode when mode is selected with QR_MODE_UTF8
+ * @param[out] width Width of the generated QR code image
+ * @param[out] height 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 QR code encoding for UTF-8 is not standardized yet.
+ * So we support UTF-8 encoding/decoding compatibility to zxing(http://http://code.google.com/p/zxing/) library.
+ * @see
+ */
+ 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_
--- /dev/null
+//
+// 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 %Tizen::Uix::Vision::QrCodeObject class.
+ *
+ * This header file contains the declarations of the %Tizen::Uix::Vision::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 single QR code object recognized by QrCodeRecognizer and provide the method to access information of the recognized QR code object.
+ *
+ * @since 2.1
+ *
+ */
+
+class _OSP_EXPORT_ QrCodeObject
+ : public Tizen::Base::Object
+{
+
+public:
+
+ /**
+ * Gets unique identifier of the recognized QR code object in a scene
+ *
+ * @since 2.1
+ *
+ * @return Unique identifier of the recognized QR code object in a scene *
+ * @see
+ */
+ int GetId(void) const;
+
+ /**
+ * Gets version of the recognized QR code object
+ *
+ * @since 2.1
+ *
+ * @return Version of current QR code object
+ * @see
+ */
+ int GetVersion(void) const;
+
+ /**
+ * Gets error correction level of the recognized QR code object
+ *
+ * @since 2.1
+ *
+ * @return error correction level of the recognized QR code object
+ * @see
+ */
+ Tizen::Uix::Vision::QrCodeErrorCorrectionLevel GetErrorCorrectionLevel(void) const;
+
+ /**
+ * Gets text of QR code object.
+ *
+ * @since 2.1
+ *
+ * @return text of QR code object
+ * @see
+ */
+ Tizen::Base::String GetText(void) const;
+
+ /**
+ * Gets transformation matrix 4x4 for 3D pose of the recognized QR code object
+ *
+ * @since 2.1
+ *
+ * @return Pointer to transformation matrix 4x4 for object position
+ *
+ * @see
+ */
+ const Tizen::Graphics::FloatMatrix4* GetTransformMatrix(void) const;
+
+ /**
+ * Get the transformed quadrilateral of the recognized QR code object
+ *
+ * @since 2.1
+ *
+ * @return The array list of 4 points of the quadrilateral of the recognized QR code object
+ *
+ * @see
+ */
+ const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>* GetRectangle(void) const;
+
+ /**
+ * Compares the calling instance with the specified instance.
+ *
+ * @since 2.1
+ *
+ * @return true if the specified instance of Object is equal to the calling QrCodeObject instance,
+ * else 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 address value of the current instance pointer
+ */
+ 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_
--- /dev/null
+//
+// 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 %Tizen::Uix::Vision::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>
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+/**
+ * @class QrCodeRecognizer
+ * @brief This class provides methods to generate QR code image.
+ *
+ * @since 2.1
+ *
+ * The following example demonstrates how to use the %QrCodeRecognizer class.
+ *
+ * @code
+ *
+ * // Recognition engine initialization
+ *
+ * void
+ * Tracker::Initialize()
+ *
+ * {
+ * __pQrRecognizer = new Tizen::Uix::Vision::QrCodeRecognizer();
+ * __pQrRecognizer->Construct();
+ * __pQrRecognizer->SetFrameSize(CAMERA_WIDTH, CAMERA_HEIGHT);
+ * }
+ *
+ * //We suppose camera to be initialized with Tizen::Graphics::PIXEL_FORMAT_YCbCr420_PLANAR format
+ *
+ * void
+ * Tracker::OnCameraPreviewed(Tizen::Base::ByteBuffer& previewedData, result r)
+ * {
+ * //Processing of the camera image follows
+ * __pQrRecognizer->ProcessFrame(previewedData);
+ *
+ * //Loop through all recognized QRs
+ * for (int i = 0; i < __pQrRecognizer->GetRecognizedObjectCount(); i++)
+ * {
+ *
+ * const Tizen::Uix::Vision::QrCodeObject *o = __pQrRecognizer->GetQrCodeObject(i);
+ * Tizen::Base::String qrText = o->GetText();
+ *
+ * }
+ * }
+ * }
+ *
+ * @endcode
+ */
+class _OSP_EXPORT_ QrCodeRecognizer
+ : public Tizen::Base::Object
+{
+public:
+
+ /**
+ * This is the default constructor for this class.
+ * The object is not fully constructed after this constructor is called.
+ * 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 ImageRecognizer.
+ * Every application must call Construct() before calling any other method of ImageRecognizer.
+ *
+ * @since 2.1
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @see
+ */
+ result Construct(void);
+
+ /**
+ * Sets width and height of input image
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ *
+ * @param[in] width frame width in pixels
+ * @param[in] height frame height in pixels
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @remarks This must be called once before calling processFrame.
+ * @see
+ */
+ result SetImageSize(int width, int height);
+
+ /**
+ * Process input image for recognition
+ *
+ * @since 2.1
+ *
+ * @return An error code.
+ *
+ * @param[in] imageBuffer Input image buffer
+ * It must be allocated outside and have size of (width*height) by SetImageSize().
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG imageBuffer is not allocated or the size of imageBuffer is not equal to input image size by SetImageSize().
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @see SetImageSize(int width, int height)
+ */
+ result ProcessImage(const Tizen::Base::ByteBuffer& imageBuffer);
+
+ /**
+ * Get 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 A specified input parameter is invalid.
+ *
+ * @remarks The ROI is used for reset of camera foucs to get better image and it can be obtained after calling ProcessImage() at least once.
+ * @see
+ */
+ result GetFocusRoi(Tizen::Graphics::Rectangle& roi);
+
+ /**
+ * Gets the number of the recognized QR code object
+ *
+ * @since 2.1
+ *
+ * @return Number of recognized QR code object
+ *
+ * @remarks The recognized QR code object has index value from 0 to (number of the recognized QR code objects - 1)
+ * @see GetRecognizedObject(int index)
+ */
+ int GetRecognizedObjectCount(void);
+
+ /**
+ * Gets the recognized QR code object to get information
+ *
+ * @since 2.1
+ *
+ * @return The pointer of QrCodeObject including all information about the reconginzed QR code object
+ * @param[in] index Index of the recognized QR code object
+ * Valid range of this parameter is 0 to (number of the recognized QR code objects - 1).
+ * @exception E_SUCCESS The method is successful.
+ *
+ * @see GetRecognizedObjectCount(void)
+ */
+ 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_
--- /dev/null
+//
+// 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.
+ */
+
+#ifndef _FUIX_VISION_QR_CODE_TYPES_H_
+#define _FUIX_VISION_QR_CODE_TYPES_H_
+
+namespace Tizen { namespace Uix { namespace Vision
+{
+
+/**
+ * @enum QrCodeErrorCorrectionLevel
+ *
+ * Defines possible error correction levels.
+ *
+ * @brief Enumeration that defines possible error correction levels for 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 possible encoding modes for QR codes.
+ *
+ * @brief Enumeration that defines possible encoding modes for 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_
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
\ No newline at end of file
--- /dev/null
+# 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}
+
--- /dev/null
+%define debug_package %{nil}
+%define __strip /bin/true
+
+Name: osp-vision
+Summary: osp vision library
+Version: 1.2.1.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
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%ifarch %{ix86}
+CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=x86
+%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
+
+# 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.Apache-2.0 %{buildroot}/usr/share/license/%{name}
+cp %{_builddir}/%{name}-%{version}/LICENSE.Flora %{buildroot}/usr/share/license/%{name}.Flora
+
+%make_install
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest osp-vision.manifest
+/usr/share/license/%{name}
+/usr/share/license/%{name}.Flora
+%{_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*
--- /dev/null
+//
+// 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(new _ImageFeatureInfoImpl)
+{
+}
+
+ImageFeatureInfo::~ImageFeatureInfo()
+{
+ delete __pImageFeatureInfoImpl;
+}
+
+Tizen::Base::String
+ImageFeatureInfo::GetDescription() const
+{
+ char ch;
+ int length = -1;
+
+ //get true length of path to allocate memory
+ length = __pImageFeatureInfoImpl->GetDescription(&ch, 1);
+ if (!length)
+ return Tizen::Base::String("");
+
+ char* pName = new char[length + 1];
+
+ //set data to char pointer, with allocated memory
+ __pImageFeatureInfoImpl->GetDescription(pName, length + 1);
+
+ Tizen::Base::String description(pName);
+ delete[] pName;
+ 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();
+ int bufHeight = __pImageFeatureInfoImpl->GetThumbnailHeight();
+
+ if ((bufWidth > 0) && (bufHeight > 0))
+ {
+ result res = E_FAILURE;
+ Tizen::Base::ByteBuffer* outBuffer = new Tizen::Base::ByteBuffer();
+ if (outBuffer == null)
+ {
+ return null;
+ }
+ res = outBuffer->Construct(bufWidth * bufHeight);
+ if(IsFailed(res))
+ {
+ return null;
+ }
+ if (__pImageFeatureInfoImpl->GetThumbnail((char*)outBuffer->GetPointer(), bufWidth, bufHeight, false))
+ {
+ return outBuffer;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ return null;
+ }
+}
+
+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
+
--- /dev/null
+//
+// 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)
+{
+ delete __pImageFeatureManagerImpl;
+}
+
+result
+ImageFeatureManager::Construct(void)
+{
+ SysAssertf(__pImageFeatureManagerImpl == null, "Already constructed! ",
+ "Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+ __pImageFeatureManagerImpl = new (std::nothrow) _ImageFeatureManagerImpl;
+ SysTryReturnResult(NID_UIX, __pImageFeatureManagerImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
+ __pImageFeatureManagerImpl->InitDB();
+ return E_SUCCESS;
+}
+
+result
+ImageFeatureManager::DeleteFeature(int featureIndex)
+{
+ SysAssertf(__pImageFeatureManagerImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+ SysTryReturn(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.");
+ SysTryReturnResult(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.");
+
+ SysTryReturn(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();
+
+ SysTryReturn(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.");
+
+ SysTryReturnResult(NID_UIX, !imagePath.IsEmpty(), E_INVALID_ARG,
+ "image path must not be empty. [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.");
+
+ SysTryReturnResult(NID_UIX, !featureSetFilePath.IsEmpty(), E_INVALID_ARG,
+ "database path must not be empty. [E_INVALID_ARG]");
+
+ return __pImageFeatureManagerImpl->OpenDB(featureSetFilePath) ? E_SUCCESS : E_FAILURE;
+}
+
+Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>*
+ImageFeatureManager::GetSupportedImageFileFormatsListN(void)
+{
+ Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat>* formatList = new Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat>;
+ formatList->Add(Tizen::Media::IMG_FORMAT_BMP);
+ formatList->Add(Tizen::Media::IMG_FORMAT_JPG);
+ formatList->Add(Tizen::Media::IMG_FORMAT_PNG);
+ return formatList;
+}
+
+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
--- /dev/null
+//
+// 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(new _ImageObjectImpl)
+{
+}
+
+ImageObject::~ImageObject()
+{
+ delete __pImageObjectImpl;
+}
+
+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
+
--- /dev/null
+//
+// 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)
+{
+ delete __pImageRecognizerImpl;
+}
+
+result
+ImageRecognizer::Construct(void)
+{
+ SysAssertf(__pImageRecognizerImpl == null, "Already constructed! ",
+ "Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+ __pImageRecognizerImpl = new (std::nothrow) _ImageRecognizerImpl;
+ SysTryReturnResult(NID_UIX, __pImageRecognizerImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
+ 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.");
+
+ SysTryReturnResult(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.");
+
+ SysTryReturn(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
--- /dev/null
+//
+// 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)
+{
+ delete __pQrCodeGeneratorImpl;
+}
+
+result
+QrCodeGenerator::Construct(void)
+{
+ SysAssertf(__pQrCodeGeneratorImpl == null, "Already constructed! ",
+ "Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+ __pQrCodeGeneratorImpl = new (std::nothrow) _QrCodeGeneratorImpl;
+ SysTryReturnResult(NID_UIX, __pQrCodeGeneratorImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
+ 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.");
+
+ SysTryReturnResult(NID_UIX, !message.IsEmpty(), null,
+ "message must not be empty. [E_INVALID_ARG]");
+
+ Tizen::Text::Utf8Encoding utf8;
+ __pQrCodeGeneratorImpl->Encode((char*) utf8.GetBytesN(message)->GetPointer(), mode, error_level, compatibility);
+
+ __pQrCodeGeneratorImpl->GetSize(width, height);
+
+ Tizen::Base::ByteBuffer* buffer = new Tizen::Base::ByteBuffer;
+ buffer->Construct(width * height);
+
+ if (__pQrCodeGeneratorImpl->SaveToBuffer((unsigned char*) buffer->GetPointer()))
+ {
+ return buffer;
+ } else {
+ delete buffer;
+ 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)
+{
+ SysAssertf(__pQrCodeGeneratorImpl != null, "Not yet constructed! Consruct() should be called before use.");
+
+ SysTryReturnResult(NID_UIX, !message.IsEmpty(), E_INVALID_ARG,
+ "message must not be empty. [E_INVALID_ARG]");
+
+ SysTryReturnResult(NID_UIX, !imageFilePath.IsEmpty(), E_INVALID_ARG,
+ "image path must not be empty. [E_INVALID_ARG]");
+
+ Tizen::Text::Utf8Encoding utf8;
+ if (!__pQrCodeGeneratorImpl->Encode((char*) utf8.GetBytesN(message)->GetPointer(), mode, errorCorrectionLevel, compatibility))
+ {
+ return E_FAILURE;
+ }
+
+ return __pQrCodeGeneratorImpl->SaveToFile(imageFilePath, imageFormat) ? E_SUCCESS : E_FAILURE;
+}
+
+Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>*
+QrCodeGenerator::GetSupportedImageFileFormatsListN(void)
+{
+ Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat>* formatList = new Tizen::Base::Collection::ArrayListT<Tizen::Media::ImageFormat>;
+ formatList->Add(Tizen::Media::IMG_FORMAT_BMP);
+ formatList->Add(Tizen::Media::IMG_FORMAT_JPG);
+ formatList->Add(Tizen::Media::IMG_FORMAT_PNG);
+ return formatList;
+}
+
+} } } //Tizen::Uix::Vision
--- /dev/null
+//
+// 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(new _QrCodeObjectImpl)
+{
+}
+
+QrCodeObject::~QrCodeObject(void)
+{
+ delete __pQrCodeObjectImpl;
+}
+
+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
--- /dev/null
+//
+// 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)
+ {
+ __pQrCodeRecognizerImpl->Destroy();
+ }
+
+ 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.");
+
+ __pQrCodeRecognizerImpl = new (std::nothrow) _QrCodeRecognizerImpl;
+ SysTryReturnResult(NID_UIX, __pQrCodeRecognizerImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
+
+ 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.");
+
+ SysTryReturn(NID_UIX, width > 0 && height > 0, false, E_INVALID_ARG,
+ "raw pointer must not be null. [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 float array[4] = {0.f};
+ 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.");
+
+ SysTryReturn(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
--- /dev/null
+//
+// 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);
+
+ //Code for using in next arengine version
+ /*
+ char* tempBuffer = new char[bufWidth * bufHeight * 4];
+ bool res = __imageFeatureDatabaseInfo.getThumbnailImage(tempBuffer, bufWidth, bufHeight, fit);
+
+ if(!res)
+ {
+ delete[] tempBuffer;
+ return false;
+ }
+
+ Tizen::Media::ImageBuffer imBuf;
+ result r = imBuf.Construct(bufWidth, bufHeight, Tizen::Media::MEDIA_PIXEL_FORMAT_BGRA8888, (byte*)tempBuffer, bufWidth * bufHeight * 4);
+ delete[] tempBuffer;
+ if(IsFailed(r))
+ {
+ return false;
+ }
+
+ Tizen::Base::ByteBuffer* yuvBuf = imBuf.GetByteBufferN(Tizen::Media::MEDIA_PIXEL_FORMAT_YUV420P);
+ if(yuvBuf == null)
+ {
+ return false;
+ }
+
+ memcpy(outBuffer, yuvBuf->GetPointer(), bufWidth * bufHeight);
+ delete yuvBuf;
+
+ return true;
+ */
+
+}
+
+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
--- /dev/null
+//
+// 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_
--- /dev/null
+//
+// 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)
+{
+}
+
+_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::ImageBuffer imBuf;
+ result r = imBuf.Construct(filepath, null, false);
+ if(IsFailed(r))
+ {
+ 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;
+
+ Tizen::Text::Utf8Encoding utf8;
+ int index = (int) __imageFeatureManager->addImageToDB(data, width, height, (char*) utf8.GetBytesN(info)->GetPointer());
+
+ if (index > -1)
+ {
+ __indices.Add(index);
+ return __indices.GetCount() - 1;
+ }
+ return index;
+}
+
+bool
+_ImageFeatureManagerImpl::DeleteFeature(int index)
+{
+ if(!__imageFeatureManager)
+ return false;
+
+ int realIndex(0);
+ __indices.GetAt(index,realIndex);
+ if(__imageFeatureManager->deleteImageFromDB(realIndex))
+ {
+ __indices.RemoveAt(index);
+ return true;
+ }
+ return false;
+}
+
+unsigned int
+_ImageFeatureManagerImpl::GetTotalNumberOfFeatures(void)
+{
+ return __indices.GetCount();
+}
+
+result
+_ImageFeatureManagerImpl::SaveDB(bool optimizeDatabase, const Tizen::Base::String* dbPath)
+{
+ SysTryReturnResult(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)
+ {
+ SysTryReturnResult(NID_UIX, !dbPath->IsEmpty(), E_INVALID_ARG,
+ "database path must not be empty. [E_INVALID_ARG]");
+ Tizen::Text::Utf8Encoding utf8;
+ result = __imageFeatureManager->saveDB(optimizeDatabase, (const char*) utf8.GetBytesN(*dbPath)->GetPointer()) ? E_SUCCESS : E_FAILURE;
+ }
+ else
+ {
+ if(!__path.IsEmpty())
+ {
+ Tizen::Text::Utf8Encoding utf8;
+ result = __imageFeatureManager->saveDB(optimizeDatabase, (const char*) utf8.GetBytesN(__path)->GetPointer()) ? E_SUCCESS : E_FAILURE;
+ }
+ }
+
+ 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();
+
+ if(!Tizen::Io::File::IsFileExist(dbpath))
+ {
+ result r;
+ Tizen::Io::File featureFile;
+ r = featureFile.Construct(dbpath, "w+");
+ //r = featureFile.Flush();
+
+ if (IsFailed(r))
+ {
+ __path = L"";
+ return false;
+ }
+ __path = dbpath;
+ __indices.RemoveAll();
+
+ }
+ else
+ {
+ Tizen::Text::Utf8Encoding utf8;
+ if(!__imageFeatureManager->openDB((const char*) utf8.GetBytesN(dbpath)->GetPointer()))
+ {
+ __path = L"";
+ __indices.RemoveAll();
+ return false;
+ }
+ else
+ {
+ __path = dbpath;
+ UpdateFeatureIndices();
+ }
+ }
+
+ 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;
+
+ Tizen::Uix::Vision::ImageFeatureInfo* di = _ImageFeatureInfoImpl::CreateImageFeatureInfoN();
+ int realIndex(0);
+ __indices.GetAt(index, realIndex);
+ _ImageFeatureInfoImpl::GetInstance(di)->SetSariPointer(sari2::ImageFeatureInfo(__imageFeatureManager, realIndex));
+ return di;
+}
+
+void
+_ImageFeatureManagerImpl::UpdateFeatureIndices(void)
+{
+ __indices.RemoveAll();
+
+ if(!__imageFeatureManager)
+ return;
+
+ int total = __imageFeatureManager->totalNumberOfImages();
+ for(int i = 0; i < total; i++)
+ {
+ if(0 != sari2::ImageFeatureInfo(__imageFeatureManager, i).imageWidth())
+ {
+ __indices.Add(i);
+ }
+ }
+}
+
+} } } //Tizen::Uix::Vision
--- /dev/null
+//
+// 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;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_INTERNAL_IMAGE_FEATURE_MANAGER_IMPL_H_
--- /dev/null
+//
+// 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
+{
+ 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
--- /dev/null
+//
+// 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_
--- /dev/null
+//
+// 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
--- /dev/null
+//
+// 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_
--- /dev/null
+//
+// 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 = 0;
+ int height = 0;
+
+ if(!GetSize(width, height))
+ {
+ return false;
+ }
+
+ unsigned char* grayBuffer = new unsigned char[(width * height * 3) >> 1];
+ if(!SaveToBuffer(grayBuffer))
+ {
+ 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))
+ {
+ return false;
+ }
+
+ r = imBuf.EncodeToFile(imagepath, imageFormat, true);
+ if(IsFailed(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
--- /dev/null
+//
+// 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 imageFormat = Tizen::Media::IMG_FORMAT_BMP);
+ 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_
--- /dev/null
+//
+// 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
+{
+ 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;
+}
+
+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
--- /dev/null
+//
+// 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 _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_
--- /dev/null
+//
+// 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)
+{
+}
+
+bool
+_QrCodeRecognizerImpl::SetFrameSize(unsigned int width, unsigned int height)
+{
+ return __qrCodeRecognizer.setFrameSize(width, height);
+}
+
+bool
+_QrCodeRecognizerImpl::ProcessFrame(const unsigned char* raw)
+{
+ return __qrCodeRecognizer.processFrame(raw);
+}
+
+bool
+_QrCodeRecognizerImpl::GetROI(float* roi)
+{
+ return __qrCodeRecognizer.getROI(roi);
+}
+
+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 0;
+ }
+}
+
+_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
--- /dev/null
+//
+// 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(unsigned int width, unsigned int height);
+ bool ProcessFrame(const unsigned char* raw);
+ bool GetROI(float* 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;
+ sari2::QRCodeRecognizer __qrCodeRecognizer;
+};
+
+} } } //Tizen::Uix::Vision
+
+#endif //_FUIX_VISION_INTERNAL_QR_CODE_RECOGNIZER_IMPL_H_
--- /dev/null
+/**
+ * Copyright (c) 2011~2012 Samsung Electronics, Inc.
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information
+ * of Samsung Electronics, Inc. ("Confidential Information"). You
+ * shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement
+ * you entered into with Samsung Electronics.
+ *
+ * @file ImageFeatureDatabaseInfo.h
+ * @author Fedir Zubach (f.zubach@samsung.com)
+ * @author Samsung Ukraine Research Center / Interactive Lab
+ * @date 9 November 2012
+ */
+
+#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 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_
--- /dev/null
+/**
+ * ImageFeatureManager.h
+ *
+ * Created on: Oct 8, 2012
+ * Author: ikhwancho
+ */
+
+#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 'true' on success.
+ bool 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_
--- /dev/null
+/**
+ * Copyright (c) 2011~2012 Samsung Electronics, Inc.
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information
+ * of Samsung Electronics, Inc. ("Confidential Information"). You
+ * shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement
+ * you entered into with Samsung Electronics.
+ *
+ * @file ReferenceImageInfo.h
+ * @author Fedir Zubach (f.zubach@samsung.com)
+ * @author Samsung Ukraine Research Center / Interactive Lab
+ * @date 9 November 2012
+ */
+
+#ifndef IMAGERECOGNITIONINFO_H_
+#define IMAGERECOGNITIONINFO_H_
+
+namespace sari2
+{
+
+class ImageFeatureManager;
+
+/// 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 {return mAspect; }
+
+ /// \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.
+ float mAspect; ///< Object's aspect ratio.
+ const float *mLeft, *mRight;
+};
+
+}
+
+#endif // IMAGERECOGNITIONINFO_H_
--- /dev/null
+/**
+ * ImageRecognizer.h
+ *
+ * Created on: Oct 8, 2012
+ * Author: ikhwancho
+ */
+
+#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_
--- /dev/null
+/**
+ * Copyright (c) 2011 Samsung Electronics, Inc.
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information
+ * of Samsung Electronics, Inc. ("Confidential Information"). You
+ * shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement
+ * you entered into with Samsung Electronics.
+ *
+ * @file QRCodeGenerator.h
+ * @author Samsung Ukraine R&D, Kyiv, Ukraine, 2011.
+ * @date 15 October 2012
+ * @brief Interface to QR Coder reader.
+ */
+
+#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
--- /dev/null
+#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
--- /dev/null
+#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
--- /dev/null
+#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