Merge commits Tizen 2.2 to Tizen 2.2.1
[platform/framework/native/vision.git] / inc / FUixVisionImageFeatureManager.h
index 6c92083..42cceea 100644 (file)
@@ -18,7 +18,9 @@
 
 /**
  * @file     FUixVisionImageFeatureManager.h
- * @brief    This is the header file for the %Tizen::Uix::Vision::ImageFeatureManager class.
+ * @brief    This is the header file for the %ImageFeatureManager class.
+ *
+ * This header file contains the declarations of the %ImageFeatureManager class.
  */
 
 #ifndef _FUIX_VISION_IMAGE_FEATURE_MANAGER_H_
@@ -34,25 +36,68 @@ 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.
+ * @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 the ability to generate individual image feature data and manage image feature set.
+ * The %ImageFeatureManager class provides methods to generate individual feature data from an individual image data. 
+ * This class also provides methods to manage the image feature set which is a collection of individual feature data.
  *
  * The following example demonstrates how to use the %ImageFeatureManager class.
  *
  * @code
- * void GenerateImageFeatureSet()
+ * 
+ * #include <FBase.h>
+ * #include <FUix.h>
+ * #include <FGraphics.h>
+ * #include <FIo.h>
+ * #include <FMedia.h>
+ *
+ * using namespace Tizen::Base;
+ * using namespace Tizen::Media;
+ * using namespace Tizen::Graphics;
+ * using namespace Tizen::Io;
+ * using namespace Tizen::Uix::Vision;
+ *
+ * class MyClass
+ * {
+ *
+ * public:
+ *     MyClass();
+ *     ~MyClass();
+ *     result GenerateFeatureSet(void);
+ *     result AddImageFeatureSet(void);
+ * };
+ *
+ * result
+ * MyClass::GenerateFeatureSet(void)
+ * {
+ *     result r;
+ *     ImageFeatureManager imageFeatureManager;
+ *     r = imageFeatureManager.Construct();
+ *
+ *     //Creates new feature sets
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image1.jpg");
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image2.jpg");
+ *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image3.jpg");
+ *     r = imageFeatureManager.Flush(new String("/opt/usr/media/Images/testFeatureSet.xdb"));
+ *
+ *     return r;
+ * }
+ *
+ * result
+ * MyClass::AddImageFeatureSet()
  * {
- *     Tizen::Uix::Vision::ImageFeatureManager imageFeatureManager;
+ *     result r;
+ *     ImageFeatureManager imageFeatureManager;
  *     imageFeatureManager.Construct();
  *     imageFeatureManager.Load("/opt/usr/media/Images/testFeatureSet.xdb");
  *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image1.jpg");
  *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image2.jpg");
  *     imageFeatureManager.AddFeature("/opt/usr/media/Images/image3.jpg");
- *     imageFeatureManager.Flush();
+ *     r = imageFeatureManager.Flush();
+ *
+ *     return r;
  * }
  * @endcode
  */
@@ -62,8 +107,8 @@ class _OSP_EXPORT_ ImageFeatureManager
 public:
 
     /**
-     * This is the default constructor for this class.
-     * The object is not fully constructed after this constructor is called.
+     * This is the default constructor for this class. @n
+     * The object is not fully constructed after this constructor is called. @n
      * For full construction, the Construct() method must be called right after calling this constructor.
      *
      * @since    2.1
@@ -80,169 +125,170 @@ public:
     ~ImageFeatureManager(void);
 
     /**
-     * Initialize this instance of ImageFeatureManager and create image feature set.
-     * Every application must call Construct() before calling any other method 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
      *
      * @feature     %http://tizen.org/feature/vision.image_recognition
      *
-     * @return      An error code.
+     * @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 <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
-     * @remarks     Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
-     * @see
+     *                                                                                   For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
+     * @remarks     Before calling this method, check whether the feature is supported by Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
      */
     result Construct(void);
 
     /**
-     * Loads feature set file
+     * Loads the feature set file.
      *
      * @since       2.1
      *
-     * @return      An error code.
+     * @return      An error code
      *
-     * @param[in]   featureSetFilePath       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            A 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 feature set file exists, it will be updated.
-     *              if feature set file does not exist, it will return E_INVALID_ARG exception.
-     * @see
+     * @remarks     
+     *              - If a feature set file exists, it is updated.
+     *              - If a feature set file does not exist, it is newly created.
+     *              - It is not mandatory to call this method to create a new feature set file, but the Flush() method must be called with a valid feature set file path.
      */
     result Load(const Tizen::Base::String& featureSetFilePath);
 
     /**
-     * Returns list of supported image file formats for adding feature.
+     * Gets the list of supported image file formats used to add the feature.
      *
      * @since       2.1
-     * @return      list of supported image file formats
-     *
-     * @see
+        *
+     * @return      The list of supported image file formats
      */
     static Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>* GetSupportedImageFileFormatsListN(void);
 
     /**
-     * Adds a feature to feature set
+     * Adds a feature to the feature set.
      *
      * @since       2.1
      *
-     * @return      Feature index of newly created feature on success, otherwise returns -1.
+     * @return      The feature index of the newly and successfully created feature, @n
+        *                              else @c -1 is returned
      *
-     * @param[in]   imagePath            Input image file path
+     * @param[in]   imagePath            The input image file path
      *
-     * @exception   E_INVALID_ARG        A specified input parameter is invalid.
+     * @exception   E_INVALID_ARG        The 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);
+     * @remarks     
+     *              - The specific error code can be accessed using the GetLastResult() method.
+     *              - The input image file must have one of the supported image file formats.
+     *              - Calling this method actually means 'Mark As Add Feature' 
+        *                                and the marked feature data is added to the feature set file after calling the Flush() method.
+     * @see         GetSupportedImageFileFormatsListN()
      */
     int AddFeature(const Tizen::Base::String& imagePath);
 
     /**
-     * Adds a feature to feature set
+     * Adds a feature to the feature set.
      *
      * @since       2.1
      *
-     * @return      Feature index of newly created feature on success, otherwise returns -1.
+     * @return      The feature index of the newly and successfully created feature, @n
+        *                              else @c -1 is returned
      *
-     * @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
+     * @param[in]   imageBuffer              The image buffer of the grayscale image data with the specified @c width and @c height
+     * @param[in]   width                    The width of the input image
+     * @param[in]   height                   The height of the input image
+     * @param[in]   description              The description of the feature
      *
      * @exception   E_INVALID_ARG            A specified input parameter is invalid.
      *
-     * @remarks     The specific error code can be accessed using the GetLastResult() method.
-     *              Calling this method actually means 'Mark As Add Feature'.
-     *              And the marked feature data will be added to feature set file after calling Flush();
-     * @see         Flush(const Tizen::Base::String* featureSetFilePath = 0);
+     * @remarks     
+     *              - The specific error code can be accessed using the GetLastResult() method.
+     *              - Calling this method actually means 'Mark As Add Feature'.
+     *                and the marked feature data is added to the feature set file after calling the Flush() method.
+     * @see         Flush(const Tizen::Base::String*)
      */
     int AddFeature(const Tizen::Base::ByteBuffer& imageBuffer, int width, int height, const Tizen::Base::String& description);
 
     /**
-     * Gets total number of features in feature set.
+     * Gets the total number of features in the feature set.
      *
      * @since       2.1
      *
-     * @return      Total number of features in the feature set.
-     * @see
+     * @return      The total number of features in the feature set
      */
     int GetTotalNumberOfFeatures(void);
 
     /**
-     * Deletes a feature of specified index in the feature set
+     * Deletes the feature at the specified index in the feature set.
      *
      * @since       2.1
      *
-     * @return      An error code.
+     * @return      An error code
      *
-     * @param[in]   featureIndex             Feature index in feature set
+     * @param[in]   featureIndex             The feature index in the feature set
      *
      * @exception   E_SUCCESS                The method is successful.
-     * @exception   E_INVALID_ARG            A specified input parameter is invalid.
+     * @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 will be deleted after calling Flush();
-     * @see         Flush(const Tizen::Base::String* featureSetFilePath = 0);
+     *              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 feature set
+     * Deletes all the features in the feature set.
      *
      * @since       2.1
      *
-     * @return      An error code.
+     * @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);
+     *              and all the feature data is deleted after calling the Flush() method.
+     * @see         Flush(const Tizen::Base::String*)
      */
     result DeleteAllFeatures(void);
 
     /**
-     * Saves features into feature set file and update all changes as marked.
+     * Flushes features from the feature set file and updates all the changes as marked.
      *
      *
      * @since       2.1
      *
-     * @return      An error code.
+     * @return      An error code
      *
-     * @param[in]   featureSetFilePath   Feature set file path
+     * @param[in]   featureSetFilePath   The feature set file path
      * @exception   E_SUCCESS            The method is successful.
-     * @exception   E_INVALID_ARG        A specified Feature set path is invalid.
+     * @exception   E_INVALID_ARG        The specified @c featureSetFilePath 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.
-     *              If featureSetFilePath is null, the feature set file loaded by Load() method will be overwritten.
-        *                      If featureSetFilePath is not decided or is same to file path used in Load() and the loaded feature set file is read-only E_INVALID_ARG exception will be  returned.
+     * @remarks     
+     *              - All the changes in the feature set file used by the AddFeature(), DeleteFeature(), or DeleteAllFeatures() method are updated by calling this method.
+     *              - If the @c featureSetFilePath is not decided or is same as the file path used in the Load() method, the loaded feature set file is updated.
+     *              - If the @c featureSetFilePath is not same as the file path used by the %Load() method, the loaded feature set file is retained and a new feature set file is created.
+     *              - If the @c featureSetFilePath is @c null, the feature set file loaded by the %Load() method is overwritten.
+     *                                 - If the @c featureSetFilePath is not decided or is same as the file path used by the %Load() method, and the loaded feature set file is a read-only file, then @c E_INVALID_ARG exception is returned.
+     *                                 - If the %Load() method is not called to create a new feature set file, this method must be called with a valid @c featureSetFilePath.
      *
-     * @see
      */
     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      pointer to ImageFeatureInfo
+     * @return      A pointer to the ImageFeatureInfo instance
      *
-     * @param[in]   featureIndex       Feature index in feature set.
-     * @see
+     * @param[in]   featureIndex       The feature index in the feature set
      */
     const Tizen::Uix::Vision::ImageFeatureInfo* GetImageFeatureInfo(int featureIndex) const;
 
@@ -259,7 +305,7 @@ private:
     ImageFeatureManager& operator=(const ImageFeatureManager&);
 
 private:
-    class  _ImageFeatureManagerImpl* __pImageFeatureManagerImpl;
+    class _ImageFeatureManagerImpl* __pImageFeatureManagerImpl;
     friend class _ImageFeatureManagerImpl;
   };