From: howon kim Date: Mon, 9 Dec 2013 09:28:53 +0000 (+0900) Subject: Merge commits Tizen 2.2 to Tizen 2.2.1 X-Git-Tag: accepted/tizen/mobile/20131216.220431^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F45%2F13545%2F1;p=platform%2Fframework%2Fnative%2Fvision.git Merge commits Tizen 2.2 to Tizen 2.2.1 Change-Id: Ie6b70e64d23b1f3285900f740e17850877bbb053 Signed-off-by: howon kim --- diff --git a/inc/FUixVisionImageFeatureInfo.h b/inc/FUixVisionImageFeatureInfo.h index d4119e7..e891570 100644 --- a/inc/FUixVisionImageFeatureInfo.h +++ b/inc/FUixVisionImageFeatureInfo.h @@ -33,11 +33,11 @@ namespace Tizen { namespace Uix { namespace Vision { /** * @class ImageFeatureInfo - * @brief This class holds information of individual image feature data in an image feature set. + * @brief This class holds information on the individual image feature data that is present in an image feature set. * * @since 2.1 * - * The %ImageFeatureInfo class holds information of individual image feature data in an image feature set. + * The %ImageFeatureInfo class holds information on the individual image feature data that is present in an image feature set. * * @see Tizen::Uix::Vision::ImageFeatureManager */ @@ -47,58 +47,58 @@ class _OSP_EXPORT_ ImageFeatureInfo public: /** - * Gets detail description for feature set. + * Gets the detailed description of the feature set. * * @since 2.1 * - * @return Detail description for feature set + * @return The detailed description of the feature set * */ Tizen::Base::String GetDescription(void) const; /** - * Gets width of thumbnail image. + * Gets the width of the thumbnail image. * * @since 2.1 * - * @return Thumbnail image width. + * @return The thumbnail image width * */ int GetThumbnailWidth(void) const; /** - * Gets height of thumbnail image. + * Gets the height of the thumbnail image. * * @since 2.1 * - * @return Thumbnail image height. + * @return The thumbnail image height * - * @exception E_SUCCESS The method is successful. + * @exception E_SUCCESS The method is successful. */ int GetThumbnailHeight(void) const; /** - * Gets the thumbnail image by extracting it. + * Gets the thumbnail image through extraction. * * @since 2.1 * - * @return A pointer to the Tizen::Base::ByteBuffer instance containing the thumbnail image + * @return A pointer to the Tizen::Base::ByteBuffer instance that contains the thumbnail image */ Tizen::Base::ByteBuffer* GetThumbnailN(void) const; /** - * Compares the calling instance with a specified instance. + * Compares the specified instance with the current instance. * * @since 2.1 * - * @return @c true if the specified instance of Tizen::Base::Object is equal to the calling %ImageFeatureInfo instance, @n + * @return @c true if the specified instance of Tizen::Base::Object is equal to the current %ImageFeatureInfo instance, @n * else @c false * @param[in] obj The object to compare */ virtual bool Equals(const Tizen::Base::Object& obj) const; /** - * Gets the hash value of a current instance. + * Gets the hash value of the current instance. * * @since 2.1 * diff --git a/inc/FUixVisionImageFeatureManager.h b/inc/FUixVisionImageFeatureManager.h index 4f0e2a6..42cceea 100644 --- a/inc/FUixVisionImageFeatureManager.h +++ b/inc/FUixVisionImageFeatureManager.h @@ -36,11 +36,12 @@ namespace Tizen { namespace Uix { namespace Vision /** * @class ImageFeatureManager - * @brief This class provides methods to generate individual feature data from an individual image data and collect to feature set file. + * @brief This class provides methods to generate individual feature data from an individual image data, and load it into a feature set file. * * @since 2.1 * - * The %ImageFeatureManager class provides methods to generate individual feature data from an individual image data. This class also provides methods to manage image feature set which is a collection of individual feature data. + * The %ImageFeatureManager class provides methods to generate individual feature data from an individual image data. + * This class also provides methods to manage the image feature set which is a collection of individual feature data. * * The following example demonstrates how to use the %ImageFeatureManager class. * @@ -124,8 +125,8 @@ public: ~ImageFeatureManager(void); /** - * Initializes this instance of %ImageFeatureManager and create image feature set. @n - * Every application must call %Construct() before calling any other methods of %ImageFeatureManager. + * Initializes this instance of %ImageFeatureManager and creates an image feature set. @n + * Every application must call the %Construct() method before calling any other method of %ImageFeatureManager. * * @since 2.1 * @@ -133,49 +134,49 @@ public: * * @return An error code * - * @exception E_SUCCESS The method is successful. + * @exception E_SUCCESS The method is successful. * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. - * For more information, see Application Filtering. - * @remarks Before calling this method, check whether the feature is supported by - * Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). + * For more information, see Application Filtering. + * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). */ result Construct(void); /** - * Loads a feature set file. + * Loads the feature set file. * * @since 2.1 * * @return An error code * - * @param[in] featureSetFilePath The feature set file path + * @param[in] featureSetFilePath The feature set file path at which to load the file * * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified feature set file path is invalid. + * @exception E_INVALID_ARG The specified @c featureSetFilePath is invalid. * @exception E_OUT_OF_MEMORY The memory is insufficient. * * @remarks * - If a feature set file exists, it is updated. * - If a feature set file does not exist, it is newly created. - * - It is not mandatory to call this method to create new feature set file, but Flush() must be called with valid feature set file path. + * - It is not mandatory to call this method to create a new feature set file, but the Flush() method must be called with a valid feature set file path. */ result Load(const Tizen::Base::String& featureSetFilePath); /** - * Gets a list of supported image file formats for adding a feature. + * Gets the list of supported image file formats used to add the feature. * * @since 2.1 * - * @return A list of supported image file formats + * @return The list of supported image file formats */ static Tizen::Base::Collection::IListT* GetSupportedImageFileFormatsListN(void); /** - * Adds a feature to a feature set. + * Adds a feature to the feature set. * * @since 2.1 * - * @return A feature index of newly and successfully created feature, otherwise returns -1. + * @return The feature index of the newly and successfully created feature, @n + * else @c -1 is returned * * @param[in] imagePath The input image file path * @@ -183,22 +184,22 @@ public: * * @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 a feature set file after calling Flush(). + * - The input image file must have one of the supported image file formats. + * - Calling this method actually means 'Mark As Add Feature' + * and the marked feature data is added to the feature set file after calling the Flush() method. * @see GetSupportedImageFileFormatsListN() - * Flush(const Tizen::Base::String*) */ int AddFeature(const Tizen::Base::String& imagePath); /** - * Adds a feature to a feature set. + * Adds a feature to the feature set. * * @since 2.1 * - * @return A feature index of newly and successfully created feature, otherwise returns -1. + * @return The feature index of the newly and successfully created feature, @n + * else @c -1 is returned * - * @param[in] imageBuffer The image buffer of grayscale image data of specified width and height + * @param[in] imageBuffer The image buffer of the grayscale image data with the specified @c width and @c height * @param[in] width The width of the input image * @param[in] height The height of the input image * @param[in] description The description of the feature @@ -208,41 +209,41 @@ public: * @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 a feature set file after calling Flush(). + * and the marked feature data is added to the feature set file after calling the Flush() method. * @see Flush(const Tizen::Base::String*) */ int AddFeature(const Tizen::Base::ByteBuffer& imageBuffer, int width, int height, const Tizen::Base::String& description); /** - * Gets the total number of features in a feature set. + * Gets the total number of features in the feature set. * * @since 2.1 * - * @return The total number of features in a feature set + * @return The total number of features in the feature set */ int GetTotalNumberOfFeatures(void); /** - * Deletes a feature with a specified index in a feature set. + * Deletes the feature at the specified index in the feature set. * * @since 2.1 * * @return An error code * - * @param[in] featureIndex The feature index in a feature set + * @param[in] featureIndex The feature index in the feature set * * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The specified input parameter is invalid. * @exception E_OUT_OF_MEMORY The memory is insufficient. * * @remarks Calling this method actually means 'Mark As Delete Feature'. - * And the marked feature data is deleted after calling Flush(). - * @see Flush(const Tizen::Base::String*) + * and the marked feature data is deleted after calling the Flush() method. + * @see Flush(const Tizen::Base::String*) */ result DeleteFeature(int featureIndex); /** - * Deletes all features in a feature set. + * Deletes all the features in the feature set. * * @since 2.1 * @@ -252,13 +253,13 @@ public: * @exception E_OUT_OF_MEMORY The memory is insufficient. * * @remarks Calling this method actually means 'Mark As Delete All Features'. - * And all feature data is deleted after calling Flush(). + * and all the feature data is deleted after calling the Flush() method. * @see Flush(const Tizen::Base::String*) */ result DeleteAllFeatures(void); /** - * Flushes features into a feature set file and updates all changes as marked. + * Flushes features from the feature set file and updates all the changes as marked. * * * @since 2.1 @@ -267,27 +268,27 @@ public: * * @param[in] featureSetFilePath The feature set file path * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified feature set path is invalid. + * @exception E_INVALID_ARG The specified @c featureSetFilePath is invalid. * * @remarks - * - All changes in the feature set file by AddFeature() or DeleteFeature() or DeleteAllFeatures() are updated by calling this method. - * - If @c featureSetFilePath is not decided or is same as the file path used in Load(), the loaded feature set file is updated. - * - If @c featureSetFilePath is not same as the file path used in %Load(), the loaded feature set file remains as is and new feature set file is created. - * - If @c featureSetFilePath is @c null, the feature set file loaded by %Load() is overwritten. - * - If @c featureSetFilePath is not decided or is same to file path used in %Load() and the loaded feature set file is read-only @c E_INVALID_ARG exception will be returned. - * - If %Load() is not called to create new feature set file, this method must be called with valid @c featureSetFilePath. + * - All the changes in the feature set file used by the AddFeature(), DeleteFeature(), or DeleteAllFeatures() method are updated by calling this method. + * - If the @c featureSetFilePath is not decided or is same as the file path used in the Load() method, the loaded feature set file is updated. + * - If the @c featureSetFilePath is not same as the file path used by the %Load() method, the loaded feature set file is retained and a new feature set file is created. + * - If the @c featureSetFilePath is @c null, the feature set file loaded by the %Load() method is overwritten. + * - If the @c featureSetFilePath is not decided or is same as the file path used by the %Load() method, and the loaded feature set file is a read-only file, then @c E_INVALID_ARG exception is returned. + * - If the %Load() method is not called to create a new feature set file, this method must be called with a valid @c featureSetFilePath. * */ result Flush(const Tizen::Base::String* featureSetFilePath = null); /** - * Gets information of the individual feature. + * Gets the information of the specified feature. * * @since 2.1 * - * @return A pointer to ImageFeatureInfo + * @return A pointer to the ImageFeatureInfo instance * - * @param[in] featureIndex The feature index in a feature set + * @param[in] featureIndex The feature index in the feature set */ const Tizen::Uix::Vision::ImageFeatureInfo* GetImageFeatureInfo(int featureIndex) const; diff --git a/inc/FUixVisionImageObject.h b/inc/FUixVisionImageObject.h index e735ac1..21f4109 100644 --- a/inc/FUixVisionImageObject.h +++ b/inc/FUixVisionImageObject.h @@ -33,11 +33,11 @@ namespace Tizen { namespace Uix { namespace Vision { /** * @class ImageObject - * @brief This class represents a single image object recognized by ImageRecognizer and provides methods to access information of a recognized image object. + * @brief This class represents a single image object recognized by the %ImageRecognizer class and provides methods to access the information of a recognized image object. * * @since 2.1 * - * The %ImageObject class represents a single image object recognized by ImageRecognizer and provides methods to access information of a recognized image object. + * The %ImageObject class represents a single image object recognized by the ImageRecognizer class and provides methods to access the information of a recognized image object. * */ class _OSP_EXPORT_ ImageObject @@ -45,54 +45,54 @@ class _OSP_EXPORT_ ImageObject { public: /** - * Gets a unique identifier of the recognized image object in a scene. + * Gets the unique identifier of the recognized image object in the scene. * * @since 2.1 * - * @return A unique identifier of the recognized image object in a scene + * @return The unique identifier of the recognized image object in the scene */ int GetId(void) const; /** - * Gets a feature index of the recognized image object in feature set. + * Gets the feature index of the recognized image object in the feature set. * * @since 2.1 * - * @return A feature index of the recognized image object in feature set + * @return The feature index of the recognized image object in the feature set */ int GetFeatureId(void) const; /** - * Gets a transformation matrix 4x4 for 3D pose of the recognized image object. + * Gets the transformation matrix 4x4 for the 3D pose of the recognized image object. * * @since 2.1 * - * @return A pointer to transformation matrix 4x4 for object position + * @return A pointer to the transformation matrix 4x4 that contains the object position */ const Tizen::Graphics::FloatMatrix4* GetTransformMatrix(void) const; /** - * Gets a transformed quadrilateral of the recognized image object. + * Gets 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 + * @return The array list that contains the 4 points of the quadrilateral of the recognized image object */ const Tizen::Base::Collection::IListT* GetRectangle(void) const; /** - * Compares the calling instance with a specified instance. + * Compares the specified instance with the current instance. * * @since 2.1 * - * @return @c true if the specified instance of Tizen::Base::Object is equal to the calling %ImageObject instance, @n + * @return @c true if the specified instance of Tizen::Base::Object is equal to the current %ImageObject instance, @n * else @c false * @param[in] obj The object to compare */ virtual bool Equals(const Tizen::Base::Object& obj) const; /** - * Gets the hash value of a current instance. + * Gets the hash value of the current instance. * * @since 2.1 * diff --git a/inc/FUixVisionImageRecognizer.h b/inc/FUixVisionImageRecognizer.h index 29f97fd..c9af6a8 100644 --- a/inc/FUixVisionImageRecognizer.h +++ b/inc/FUixVisionImageRecognizer.h @@ -34,12 +34,12 @@ 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 that stores features of the reference images. + * @brief This class provides methods to find similar image objects that are used as the input images to the feature set that stores the features of the reference images. * * @since 2.1 * - * The %ImageRecognizer class provides methods to find same image objects to input image in the feature set that stores features of the reference images. - * This class also provide methods to calculate the 2D position and 3D pose transform matrix of the recognized image objects. + * The %ImageRecognizer class provides methods to find similar image objects that are used as the input images to the feature set that stores the features of the reference images. + * This class also provides methods to calculate the 2D position and 3D pose transform matrix of the recognized image objects. * * The following example demonstrates how to use the %ImageRecognizer class. * @@ -147,35 +147,35 @@ public: /** * Initializes this instance of %ImageRecognizer. @n - * Every application must call %Construct() before calling any other methods of %ImageRecognizer. + * Every application must call the %Construct() method before calling any other method of %ImageRecognizer. * * @since 2.1 * * @feature %http://tizen.org/feature/vision.image_recognition * - * @exception E_SUCCESS The method is successful. + * @exception E_SUCCESS The method is successful. * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. - * For more information, see Application Filtering. - * @remarks Before calling this method, check whether the feature is supported by - * Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). + * For more information, see Application Filtering. + * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). */ result Construct(void); /** - * Enables single or multiple tracking mode. + * Enables or disables the single or multiple tracking mode. * * @since 2.1 * - * @param[in] enable Enable multiple tracking mode on @c true, default is single tracking mode + * @param[in] enable The boolean value that enables or disables the multiple tracking mode @n + * The default mode is the single tracking mode. * * @remarks - * - In single tracking mode, only one image is recognized in the screen at once. - * - In multiple tracking mode, multiple images (maximum 3) can be recognized and tracked simultaneously. + * - In the single tracking mode, only one image is recognized at a time on the screen. + * - In the multiple tracking mode, multiple images (maximum 3) can be recognized and tracked simultaneously. */ void SetMultiTrackingEnabled(bool enable); /** - * Sets the width and height of an input image. + * Sets the width and the height of the input image. * * @since 2.1 * @@ -193,37 +193,37 @@ public: * Sets the ImageFeatureManager instance for initialization. * * @since 2.1 - * @pre ImageFeatureManager should be initialized by loading a feature set file using the ImageFeatureManager::Load() method. + * @pre The ImageFeatureManager should be initialized by loading the feature set file using the ImageFeatureManager::Load() method. * * @return An error code - * @param[in] imageFeatureManager The ImageFeatureManager instance managing image feature set to use for recognition + * @param[in] imageFeatureManager The ImageFeatureManager instance that manages the image feature set to use for recognition * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG An input ImageFeatureManager is invalid. + * @exception E_INVALID_ARG The ImageFeatureManager is invalid. * - * @remarks ImageFeatureManager should be initialized by loading a feature set file. + * @remarks The ImageFeatureManager should be initialized by loading the feature set file. */ result SetFeatureManager(ImageFeatureManager& imageFeatureManager); /** - * Gets a count of the recognized image object. + * Gets the count of the recognized image object. * * @since 2.1 * - * @return A count of the recognized image object + * @return The count of the recognized image object * - * @remarks The recognized object has index value from @c 0 to (count of the recognized image objects - 1) - * @see GetRecognizedObject(int) + * @remarks The recognized object has an index value that ranges from @c 0 to (count of the recognized image objects) @c - 1. + * @see GetRecognizedObject() */ int GetRecognizedObjectCount(void); /** - * Gets the recognized image object to get information. + * Gets the recognized image object that contains the information. * * @since 2.1 * - * @return A pointer to ImageObject that includes all information about the recognized image object + * @return A pointer to the ImageObject instance that includes all the information about the recognized image object * @param[in] index The index of the recognized image object @n - * Valid range of this parameter is @c 0 to (count of the recognized image objects - 1). + * The valid range for this parameter is @c 0 to (count of the recognized image objects) @c - 1. * @exception E_SUCCESS The method is successful. * * @see GetRecognizedObjectCount() @@ -231,16 +231,18 @@ public: const ImageObject* GetRecognizedObject(int index) const; /** - * Processes an input image for recognition. + * Processes the input image for recognition. * * @since 2.1 * * @return An error code * * @param[in] imageBuffer The input image buffer @n - * It must be allocated outside and have size of (width*height) set by SetImageSize(). + * It must be allocated externally and have a size of (width*height) set by SetImageSize(). * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c imageBuffer is not allocated or the size of @c imageBuffer is not equal to the input image size set by SetImageSize(). + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified @c imageBuffer is not allocated. + * - The size of the specified @c imageBuffer is not equal to the input image size set by SetImageSize(). * @exception E_OUT_OF_MEMORY The memory is insufficient. * @see SetImageSize(int, int) */ diff --git a/inc/FUixVisionQrCodeGenerator.h b/inc/FUixVisionQrCodeGenerator.h index fe705dc..1559cb1 100644 --- a/inc/FUixVisionQrCodeGenerator.h +++ b/inc/FUixVisionQrCodeGenerator.h @@ -111,39 +111,38 @@ public: /** * Initializes this instance of %QRCodeGenerator. @n - * Every application must call %Construct() before calling any other methods of %QRCodeGenerator. + * Every application must call the %Construct() method before calling any other method of %QRCodeGenerator. * * @since 2.1 * * @feature %http://tizen.org/feature/vision.qrcode_generation * - * @exception E_SUCCESS The method is successful. + * @exception E_SUCCESS The method is successful. * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. - * For more information, see Application Filtering. - * @remarks Before calling this method, check whether the feature is supported by - * Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). + * For more information, see Application Filtering. + * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). */ result Construct(void); /** - * Gets a list of supported image file formats. + * Gets the list of supported image file formats. * * @since 2.1 * - * @return A list of supported image file formats + * @return The list of supported image file formats */ static Tizen::Base::Collection::IListT* GetSupportedImageFileFormatsListN(void); /** - * Encodes a QR code into a file. + * Encodes the QR code into the file. * * @since 2.1 * * @return An error code - * @param[in] message The text to encode to QR code image - * @param[in] mode The input text encoding format (QR_CODE_MODE_ALPHANUMERIC, QR_CODE_MODE_BYTE, QR_CODE_MODE_UTF8) + * @param[in] message The text used to encode the QR code image + * @param[in] mode The input text encoding format (@c QR_CODE_MODE_ALPHANUMERIC, @c QR_CODE_MODE_BYTE, or @c QR_CODE_MODE_UTF8) * @param[in] errorCorrectionLevel The QR code error correction level - * @param[in] compatibility The compatibility mode with zxing library for UTF-8 codes mode when mode is selected with QR_MODE_UTF8 + * @param[in] compatibility The compatibility mode with the zxing library for the UTF-8 codes mode, which is activated when the mode selected is @c QR_MODE_UTF8 * @param[in] imageFilePath The file path of the generated QR code image * @param[in] imageFormat The image file format of the generated QR code image * @param[out] width The width of the generated QR code image @@ -152,28 +151,28 @@ public: * @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 as yet. - * So we support UTF-8 encoding/decoding compatibility to zxing(http://code.google.com/p/zxing/) library. + * @remarks The QR code encoding for the UTF-8 codes mode is not standardized as yet, + * so the UTF-8 encoding/decoding compatibility with the zxing(http://code.google.com/p/zxing/) library is currently supported. */ result EncodeToFile(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel errorCorrectionLevel, bool compatibility, const Tizen::Base::String& imageFilePath, Tizen::Media::ImageFormat imageFormat, int& width, int& height); /** - * Encodes a QR code into a byte buffer. + * Encodes the QR code into the byte buffer. * * @since 2.1 * - * @return A pointer to the Tizen::Base::ByteBuffer instance containing the generated QR code image - * @param[in] message The text to encode to QR code image - * @param[in] mode The input text encoding format (QR_CODE_MODE_ALPHANUMERIC, QR_CODE_MODE_BYTE, QR_CODE_MODE_UTF8) + * @return A pointer to the Tizen::Base::ByteBuffer instance that contains the generated QR code image + * @param[in] message The text used to encode the QR code image + * @param[in] mode The input text encoding format (@c QR_CODE_MODE_ALPHANUMERIC, @c QR_CODE_MODE_BYTE, or @c QR_CODE_MODE_UTF8) * @param[in] error_level The QR code error correction level - * @param[in] compatibility The compatibility mode with zxing library for UTF-8 codes mode when mode is selected with QR_CODE_MODE_UTF8 + * @param[in] compatibility The compatibility mode with the zxing library for the UTF-8 codes mode, which is activated when the mode selected is @c QR_CODE_MODE_UTF8 * @param[out] width The width of the generated QR code image * @param[out] height The height of the generated QR code image * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG A specified input parameter is invalid. * - * @remarks QR code encoding for UTF-8 is not standardized as yet. - * So we support UTF-8 encoding/decoding compatibility to zxing(http://code.google.com/p/zxing/) library. + * @remarks The QR code encoding for the UTF-8 codes mode is not standardized as yet, + * so the UTF-8 encoding/decoding compatibility with the zxing(http://code.google.com/p/zxing/) library is currently supported. */ Tizen::Base::ByteBuffer* EncodeToBufferN(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel error_level, bool compatibility, int& width, int& height); diff --git a/inc/FUixVisionQrCodeObject.h b/inc/FUixVisionQrCodeObject.h index 653ba62..f4b7702 100644 --- a/inc/FUixVisionQrCodeObject.h +++ b/inc/FUixVisionQrCodeObject.h @@ -36,11 +36,11 @@ namespace Tizen { namespace Uix { namespace Vision /** * @class QrCodeObject - * @brief This class represents a single QR code object recognized by QrCodeRecognizer and provides the method to access information of the recognized QR code object. + * @brief This class represents a single QR code object recognized by the %QrCodeRecognizer class and provides methods to access the information of a recognized QR code object. * * @since 2.1 * - * The %QrCodeObject class represents a single QR code object recognized by QrCodeRecognizer and provides the method to access information of the recognized QR code object. + * The %QrCodeObject class represents a single QR code object recognized by the QrCodeRecognizer class and provides methods to access the information of a recognized QR code object. */ class _OSP_EXPORT_ QrCodeObject @@ -50,72 +50,72 @@ class _OSP_EXPORT_ QrCodeObject public: /** - * Gets a unique identifier of the recognized QR code object in a scene. + * Gets the unique identifier of the recognized QR code object in the scene. * * @since 2.1 * - * @return A unique identifier of the recognized QR code object in a scene + * @return The unique identifier of the recognized QR code object in the scene */ int GetId(void) const; /** - * Gets a version of the recognized QR code object. + * Gets the version of the recognized QR code object. * * @since 2.1 * - * @return A version of the recognized QR code object + * @return The version of the recognized QR code object */ int GetVersion(void) const; /** - * Gets an error correction level of the recognized QR code object. + * Gets the error correction level of the recognized QR code object. * * @since 2.1 * - * @return An error correction level of the recognized QR code object + * @return The error correction level of the recognized QR code object */ Tizen::Uix::Vision::QrCodeErrorCorrectionLevel GetErrorCorrectionLevel(void) const; /** - * Gets a text of the QR code object. + * Gets the text of the QR code object. * * @since 2.1 * - * @return A text of the QR code object + * @return The text of the QR code object */ Tizen::Base::String GetText(void) const; /** - * Gets a transformation matrix 4x4 for 3D pose of the recognized QR code object. + * Gets the transformation matrix 4x4 for the 3D pose of the recognized QR code object. * * @since 2.1 * - * @return A pointer to transformation matrix 4x4 for object position + * @return A pointer to the transformation matrix 4x4 that contains the object position */ const Tizen::Graphics::FloatMatrix4* GetTransformMatrix(void) const; /** - * Gets a transformed quadrilateral of the recognized QR code object. + * Gets 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 + * @return The array list that contains the 4 points of the quadrilateral of the recognized QR code object */ const Tizen::Base::Collection::IListT* GetRectangle(void) const; /** - * Compares the calling instance with a specified instance. + * Compares the specified instance with the current instance. * * @since 2.1 * - * @return @c true if the specified instance of Tizen::Base::Object is equal to the calling %QrCodeObject instance, @n + * @return @c true if the specified instance of Tizen::Base::Object is equal to the current %QrCodeObject instance, @n * else @c false * @param[in] obj The object to compare */ virtual bool Equals(const Tizen::Base::Object& obj) const; /** - * Gets the hash value of a current instance. + * Gets the hash value of the current instance. * * @since 2.1 * diff --git a/inc/FUixVisionQrCodeRecognizer.h b/inc/FUixVisionQrCodeRecognizer.h index 8d3d562..f0545ea 100644 --- a/inc/FUixVisionQrCodeRecognizer.h +++ b/inc/FUixVisionQrCodeRecognizer.h @@ -37,7 +37,7 @@ namespace Tizen { namespace Uix { namespace Vision * * @since 2.1 * - * The %QrCodeRecognizer class provides methods to generate a QR code image. + * The %QrCodeRecognizer class provides methods to recognize a QR code image. * * The following example demonstrates how to use the %QrCodeRecognizer class. * @@ -132,22 +132,21 @@ public: /** * Initializes this instance of %QrCodeRecognizer. @n - * Every application must call %Construct() before calling any other methods of %QrCodeRecognizer. + * Every application must call the %Construct() method before calling any other method of %QrCodeRecognizer. * * @since 2.1 * * @feature %http://tizen.org/feature/vision.qrcode_recognition * - * @exception E_SUCCESS The method is successful. + * @exception E_SUCCESS The method is successful. * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. - * For more information, see Application Filtering. - * @remarks Before calling this method, check whether the feature is supported by - * Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). + * For more information, see Application Filtering. + * @remarks Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). */ result Construct(void); /** - * Sets the width and height of an input image. + * Sets the width and the height of the input image. * * @since 2.1 * @@ -157,23 +156,24 @@ public: * @param[in] height The height of the frame in pixels * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG A specified input parameter is invalid. - * @remarks This method must be called once before calling ProcessImage(). + * @remarks This method must be called once before calling the ProcessImage() method. */ result SetImageSize(int width, int height); /** - * Processes an input image for recognition. + * Processes the input image for recognition. * * @since 2.1 * * @return An error code * * @param[in] imageBuffer The input image buffer @n - * It must be allocated outside and have size of (width*height) set by SetImageSize(). + * It must be allocated externally and have a size of (width*height) set by SetImageSize(). * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c imageBuffer is not allocated or the size of @c imageBuffer is not equal to the input image size set by SetImageSize(). + * @exception E_INVALID_ARG Either of the following conditions has occurred; + * - The specified @c imageBuffer is not allocated + * - The size of the specified @c imageBuffer is not equal to the input image size set by SetImageSize(). * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @see SetImageSize(int, int) */ result ProcessImage(const Tizen::Base::ByteBuffer& imageBuffer); @@ -187,30 +187,30 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The specified input parameter is invalid. * - * @remarks The ROI is used to reset camera focus to get better image and it can be obtained after calling ProcessImage() at least once. + * @remarks The ROI is used to reset the camera focus to get a better image and it can be obtained after calling the ProcessImage() method at least once. */ result GetFocusRoi(Tizen::Graphics::Rectangle& roi); /** - * Gets a count of the recognized QR code object. + * Gets the count of the recognized QR code object. * * @since 2.1 * - * @return A count of the recognized QR code object + * @return The count of the recognized QR code object * - * @remarks The recognized QR code object has index value from @c 0 to (count of the recognized QR code objects - 1) - * @see GetRecognizedObject(int) + * @remarks The recognized QR code object has an index value that ranges from @c 0 to (count of the recognized QR code objects) @c - 1. + * @see GetRecognizedObject() */ int GetRecognizedObjectCount(void); /** - * Gets the recognized QR code object to get information. + * Gets the recognized QR code object that contains the information. * * @since 2.1 * - * @return A pointer to QrCodeObject that includes all information about the recognized QR code object + * @return A pointer to the QrCodeObject that includes all the information about the recognized QR code object * @param[in] index The index of the recognized QR code object @n - * Valid range of this parameter is @c 0 to (count of the recognized QR code objects - 1). + * The valid range for this parameter is @c 0 to (count of the recognized QR code objects) @c - 1. * @exception E_SUCCESS The method is successful. * * @see GetRecognizedObjectCount() diff --git a/inc/FUixVisionQrCodeTypes.h b/inc/FUixVisionQrCodeTypes.h index 3fe26fb..7bc2474 100644 --- a/inc/FUixVisionQrCodeTypes.h +++ b/inc/FUixVisionQrCodeTypes.h @@ -32,30 +32,30 @@ namespace Tizen { namespace Uix { namespace Vision /** * @enum QrCodeErrorCorrectionLevel * - * Defines possible error correction levels for QR code. + * Defines the possible error correction levels for the QR code. * * @since 2.1 */ enum QrCodeErrorCorrectionLevel { - QR_CODE_ERROR_CORRECTION_LEVEL_L = 1, /** < Low */ - QR_CODE_ERROR_CORRECTION_LEVEL_M = 2, /** < Medium */ - QR_CODE_ERROR_CORRECTION_LEVEL_Q = 3, /** < Quartile */ - QR_CODE_ERROR_CORRECTION_LEVEL_H = 4 /** < High */ + 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. + * Defines the possible encoding modes of the QR code. * * @since 2.1 */ enum QrCodeMode { - QR_CODE_MODE_ALPHANUMERIC = 0, /** < Alphanumeric */ - QR_CODE_MODE_BYTE = 1, /** < Byte */ - QR_CODE_MODE_UTF8 = 2 /** < UTF8 */ + QR_CODE_MODE_ALPHANUMERIC = 0, /**< Alphanumeric */ + QR_CODE_MODE_BYTE = 1, /**< Byte */ + QR_CODE_MODE_UTF8 = 2 /**< UTF8 */ }; } } } //Tizen::Uix::Vision diff --git a/packaging/osp-vision.spec b/packaging/osp-vision.spec index 6bc6868..46befd0 100644 --- a/packaging/osp-vision.spec +++ b/packaging/osp-vision.spec @@ -1,8 +1,8 @@ %define __strip /bin/true Name: osp-vision -Summary: Osp vision library -Version: 1.2.1.0 +Summary: osp vision library +Version: 1.2.2.0 Release: 2 Group: Graphics & UI Framework/API License: Apache-2.0 diff --git a/src/FUixVisionQrCodeGenerator.cpp b/src/FUixVisionQrCodeGenerator.cpp index 1c3b8ba..54d55b5 100644 --- a/src/FUixVisionQrCodeGenerator.cpp +++ b/src/FUixVisionQrCodeGenerator.cpp @@ -59,7 +59,8 @@ QrCodeGenerator::EncodeToBufferN(const Tizen::Base::String& message, QrCodeMode "message must not be empty. [E_INVALID_ARG]"); Tizen::Text::Utf8Encoding utf8; - __pQrCodeGeneratorImpl->Encode((char*) utf8.GetBytesN(message)->GetPointer(), mode, error_level, compatibility); + std::unique_ptr pMessageBuffer(utf8.GetBytesN(message)); + __pQrCodeGeneratorImpl->Encode((char*) pMessageBuffer->GetPointer(), mode, error_level, compatibility); __pQrCodeGeneratorImpl->GetSize(width, height); std::unique_ptr pBuffer(new (std::nothrow) Tizen::Base::ByteBuffer()); @@ -81,21 +82,41 @@ QrCodeGenerator::EncodeToBufferN(const Tizen::Base::String& message, QrCodeMode result QrCodeGenerator::EncodeToFile(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel errorCorrectionLevel, bool compatibility, const Tizen::Base::String& imageFilePath, Tizen::Media::ImageFormat imageFormat, int& width, int& height) { + result r = E_SUCCESS; SysAssertf(__pQrCodeGeneratorImpl != null, "Not yet constructed! Consruct() should be called before use."); - SysSecureTryReturnResult(NID_UIX, !message.IsEmpty(), E_INVALID_ARG, - "message must not be empty. [E_INVALID_ARG]"); + SysSecureTryReturnResult(NID_UIX, !message.IsEmpty(), E_INVALID_ARG, + "message must not be empty. [E_INVALID_ARG]"); + + SysSecureTryReturnResult(NID_UIX, !imageFilePath.IsEmpty(), E_INVALID_ARG, + "image path must not be empty. [E_INVALID_ARG]"); + + Tizen::Text::Utf8Encoding utf8; + std::unique_ptr pBuffer(utf8.GetBytesN(message)); + if (!__pQrCodeGeneratorImpl->Encode((char*) pBuffer->GetPointer(), mode, errorCorrectionLevel, compatibility)) + { + return E_FAILURE; + } - SysSecureTryReturnResult(NID_UIX, !imageFilePath.IsEmpty(), E_INVALID_ARG, - "image path must not be empty. [E_INVALID_ARG]"); + if(!__pQrCodeGeneratorImpl->SaveToFile(imageFilePath, imageFormat,width, height)) + { + r = GetLastResult(); + if( r == E_ILLEGAL_ACCESS || r == E_OUT_OF_RANGE) + { + r = E_FILE_NOT_FOUND; + } + else if (r == E_UNSUPPORTED_FORMAT) + { + r = E_INVALID_ARG; + } + else + { + r = E_FAILURE; + } - Tizen::Text::Utf8Encoding utf8; - if (!__pQrCodeGeneratorImpl->Encode((char*) utf8.GetBytesN(message)->GetPointer(), mode, errorCorrectionLevel, compatibility)) - { - return E_FAILURE; - } + } - return __pQrCodeGeneratorImpl->SaveToFile(imageFilePath, imageFormat, width, height) ? E_SUCCESS : E_FAILURE; + return r; } Tizen::Base::Collection::IListT* diff --git a/src/FUixVision_ImageFeatureManagerImpl.cpp b/src/FUixVision_ImageFeatureManagerImpl.cpp index 856ffad..79318f9 100644 --- a/src/FUixVision_ImageFeatureManagerImpl.cpp +++ b/src/FUixVision_ImageFeatureManagerImpl.cpp @@ -28,6 +28,8 @@ namespace Tizen { namespace Uix { namespace Vision _ImageFeatureManagerImpl::_ImageFeatureManagerImpl(void) : __imageFeatureManager(0) , __readOnly(false) + , __minSupportedSize(100) + , __maxSupportedResolution(16000000) { } @@ -66,10 +68,28 @@ _ImageFeatureManagerImpl::InitDB(void) int _ImageFeatureManagerImpl::AddFeature(const Tizen::Base::String& filepath) { - Tizen::Media::ImageBuffer imBuf; - result r = imBuf.Construct(filepath, null, false); + Tizen::Media::ImageFormat imgFormat; + int imgWidth = 0, imgHeight = 0; + result r = Tizen::Media::ImageBuffer::GetImageInfo(filepath, imgFormat, imgWidth, imgHeight); + if (IsFailed(r)) { + SetLastResult(E_INVALID_ARG); + return -1; + } + + if ((imgWidth < __minSupportedSize || imgHeight < __minSupportedSize) || (imgWidth * imgHeight > __maxSupportedResolution)) + { + SetLastResult(E_INVALID_ARG); + return -1; + } + + Tizen::Media::ImageBuffer imBuf; + r = imBuf.Construct(filepath, null, false); + + if(IsFailed(r)) + { + SetLastResult(E_INVALID_ARG); return -1; } @@ -92,8 +112,16 @@ _ImageFeatureManagerImpl::AddFeature(const unsigned char* data, int width, int h { return -1; } + + if ((width < __minSupportedSize || height < __minSupportedSize) || (width * height > __maxSupportedResolution)) + { + SetLastResult(E_INVALID_ARG); + return -1; + } + Tizen::Text::Utf8Encoding utf8; - int index = (int) __imageFeatureManager->addImageToDB(data, width, height, (char*) utf8.GetBytesN(info)->GetPointer()); + std::unique_ptr pBuffer(utf8.GetBytesN(info)); + int index = (int) __imageFeatureManager->addImageToDB(data, width, height, (char*) pBuffer->GetPointer()); if (index > -1) { @@ -125,7 +153,7 @@ _ImageFeatureManagerImpl::DeleteFeature(int index) { SetLastResult(E_INVALID_ARG); } - + return false; } @@ -157,14 +185,16 @@ _ImageFeatureManagerImpl::SaveDB(bool optimizeDatabase, const Tizen::Base::Strin SysSecureTryReturnResult(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; + std::unique_ptr pBuffer(utf8.GetBytesN(*dbPath)); + result = __imageFeatureManager->saveDB(optimizeDatabase, (const char*) pBuffer->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; + std::unique_ptr pBuffer(utf8.GetBytesN(__path)); + result = __imageFeatureManager->saveDB(optimizeDatabase, (const char*) pBuffer->GetPointer()) ? E_SUCCESS : E_FAILURE; if (E_FAILURE == result && __readOnly) { result = E_INVALID_ARG; @@ -202,7 +232,8 @@ _ImageFeatureManagerImpl::OpenDB(const Tizen::Base::String& dbpath) __imageFeatureManager->initDB(); Tizen::Text::Utf8Encoding utf8; - switch (__imageFeatureManager->openDB((const char*) utf8.GetBytesN(dbpath)->GetPointer())) + std::unique_ptr pBuffer(utf8.GetBytesN(dbpath)); + switch (__imageFeatureManager->openDB((const char*) pBuffer->GetPointer())) { case 0: //ok __path = dbpath; diff --git a/src/FUixVision_ImageFeatureManagerImpl.h b/src/FUixVision_ImageFeatureManagerImpl.h index 42c905f..f2e9b65 100644 --- a/src/FUixVision_ImageFeatureManagerImpl.h +++ b/src/FUixVision_ImageFeatureManagerImpl.h @@ -61,6 +61,8 @@ private: Tizen::Base::String __path; Tizen::Base::Collection::ArrayListT __indices; bool __readOnly; + int __minSupportedSize; + int __maxSupportedResolution; }; } } } //Tizen::Uix::Vision diff --git a/src/FUixVision_QrCodeGeneratorImpl.cpp b/src/FUixVision_QrCodeGeneratorImpl.cpp index 3ef1435..0c07d69 100644 --- a/src/FUixVision_QrCodeGeneratorImpl.cpp +++ b/src/FUixVision_QrCodeGeneratorImpl.cpp @@ -75,12 +75,14 @@ _QrCodeGeneratorImpl::SaveToFile(const Tizen::Base::String& imagepath, Tizen::Me { if(!GetSize(width, height)) { + SetLastResult(E_INVALID_ARG); return false; } unsigned char* grayBuffer = new unsigned char[(width * height * 3) >> 1]; if(!SaveToBuffer(grayBuffer)) { + SetLastResult(E_OPERATION_FAILED); //No proper error returned from SaveToBuffer() Api. return false; } @@ -90,13 +92,15 @@ _QrCodeGeneratorImpl::SaveToFile(const Tizen::Base::String& imagepath, Tizen::Me delete[] grayBuffer; if(IsFailed(r)) { - return false; + SetLastResult(r); + return false; } r = imBuf.EncodeToFile(imagepath, imageFormat, true); if(IsFailed(r)) { - return false; + SetLastResult(r); + return false; } return true;