Use DfsInputData and DfsOutputData instead of DfsData and 76/279576/3
authorTae-Young Chung <ty83.chung@samsung.com>
Fri, 12 Aug 2022 01:08:05 +0000 (10:08 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Wed, 17 Aug 2022 05:26:06 +0000 (14:26 +0900)
Define new DFS_DATA_INPUT_FORMAT enumeration

[Version] 1.0.6-0
[Issue type] update

DfsData is separated to DfsInputData and DfsOutputData
which inherit from DfsData.
DfsInputData can have an additional
data pointer for separated left and right stereo images.
DfsOutputData can have additional information for PointCloud data.

Newly defined enumeration is for coupled or decoupled side-by-side
stereo images.
coupled: one image includes left and right.
decoupled: two images are for left and right, respectively.

Change-Id: I063235cd4c272b5f68979673cdfd54904c0be9dd
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
include/dfs_adaptation.h
include/dfs_adaptation_impl.h
include/dfs_parameter.h
packaging/dfs-adaptation.spec
src/dfs_adaptation_impl.cpp

index c637c94e2e7b07e382120ae3cb49a0fe242c200e..6e045bdf6b9c069f8c7dcfa9ceb9824aa998d742 100644 (file)
@@ -45,13 +45,13 @@ namespace DfsAdaptation
                 * @brief Run dfs adaptor.
                 * @since_tizen 7.0
                 */
-               virtual void Run(DfsData& base, DfsData& extra) = 0;
+               virtual void Run(DfsInputData& data) = 0;
 
                /**
                 * @brief Run dfs adaptor.
                 * @since_tizen 7.0
                 */
-               virtual DfsData& GetDepthData() = 0;
+               virtual DfsOutputData& GetDepthData() = 0;
        };
 
        typedef void destroy_t(IDfsAdaptation *);
index 020634bf9d5f118227c8c57890fd427b7c0c31d4..7a1b1a8bc788297ef3415896119bfd523a8f9dca 100644 (file)
@@ -37,8 +37,8 @@ namespace DfsAdaptation
 
                void Initialize(DfsParameter& param, size_t width, size_t height,
                                                size_t minDisp, size_t maxDisp, std::string stereoConfigPath);
-               void Run(DfsData& base, DfsData& extra);
-               DfsData& GetDepthData();
+               void Run(DfsInputData& data);
+               DfsOutputData& GetDepthData();
        };
 
 } /* DfsAdaptation */
index 775998c1275930198fcec2ce0f2986bf630c09e0..c4d0ddeb92f6198cd9ac79116a6bc3baef3eb478 100644 (file)
 namespace DfsAdaptation
 {
        struct DfsParameter {
-               double textureThreshold;
-               size_t aggregationWindowWidth;
-               size_t aggregationWindowHeight;
-               size_t maxSpeckleSize;
-
-               DfsParameter()
-               {
-                       textureThreshold = 1;
-                       aggregationWindowWidth = 10;
-                       aggregationWindowHeight = 10;
-                       maxSpeckleSize = 10;
-               }
+               double textureThreshold { 1.0 };
+               size_t aggregationWindowWidth { 10 };
+               size_t aggregationWindowHeight { 10 };
+               size_t maxSpeckleSize { 10 };
        };
 
     struct DfsData {
-        void *data;
-        int type;
-        size_t width;
-        size_t height;
-        size_t stride;
+        void *data { nullptr };
+        int type { 0 };
+        size_t width { 0 };
+        size_t height { 0 };
+        size_t stride { 0 };
+    };
 
-        std::vector<std::vector<double>> pointCloud;
-        double *pointCloudData;
-        size_t pointCloudSize;
+    struct DfsInputData : public DfsData {
+        void *extraData { nullptr };
+        int inputFormat { 0 };
+    };
 
-        DfsData()
-        {
-            data = pointCloudData = nullptr;
-            type = 0;
-            width = height = stride = 0;
-        }
+    struct DfsOutputData : public DfsData {
+        std::vector<std::vector<double>> pointCloud;
+        double *pointCloudData { nullptr };
+        size_t pointCloudSize { 0 };
     };
 
     enum
@@ -68,5 +60,11 @@ namespace DfsAdaptation
         DFS_DATA_TYPE_UINT16C1 = 4
     };
 
+    enum
+    {
+        DFS_DATA_INPUT_FORMAT_COUPLED_SBS = 1,
+        DFS_DATA_INPUT_FORMAT_DECOUPLED_SBS = 2
+    };
+
 }
 #endif /* __DFS_PARAMETER_H__ */
index c95ce32932081f83691ca6e4866eb41f82334392..b43cd3cd4500e2952b4d43feb8efd7adbf703fcc 100644 (file)
@@ -1,6 +1,6 @@
 Name:        dfs-adaptation
 Summary:     Adaptation of depth-from-stereo
-Version:     1.0.5
+Version:     1.0.6
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0
index 6dc82d1a542bcc38717dd004cde142b86f876109..5b9a05aef74577c2fc9a483294f24dfdf99f75cd 100644 (file)
@@ -128,18 +128,18 @@ namespace DfsAdaptation
                LOGI("LEAVE");
        }
 
-       void DfsAdaptor::Run(DfsData& base, DfsData& extra)
+       void DfsAdaptor::Run(DfsInputData& data)
        {
                LOGI("ENTER");
 
                CHECK_INSTANCE(mDfsAdaptorHandle);
 
-               mDfsAdaptorHandle->Run(base, extra);
+               mDfsAdaptorHandle->Run(data);
 
                LOGI("LEAVE");
        }
 
-       DfsData& DfsAdaptor::GetDepthData()
+       DfsOutputData& DfsAdaptor::GetDepthData()
        {
                LOGI("ENTER");
 
@@ -149,4 +149,4 @@ namespace DfsAdaptation
 
                LOGI("LEAVE");
        }
-}
\ No newline at end of file
+}