diff options
author | Tae-Young Chung <ty83.chung@samsung.com> | 2021-12-08 14:26:54 +0900 |
---|---|---|
committer | Tae-Young Chung <ty83.chung@samsung.com> | 2021-12-09 16:36:39 +0900 |
commit | 25193b01dd27de69f7615d9555c2efe3cd20bbbb (patch) | |
tree | f774fc78f531e6d8b64d463a998959f0ae8b87e6 /mv_depth/depth | |
parent | 41b495752d22211d3b69b1fda41a3610eeddb11c (diff) | |
download | mediavision-25193b01dd27de69f7615d9555c2efe3cd20bbbb.tar.gz mediavision-25193b01dd27de69f7615d9555c2efe3cd20bbbb.tar.bz2 mediavision-25193b01dd27de69f7615d9555c2efe3cd20bbbb.zip |
depth: add Depth class and mvDepth apis to run it
[Version] 0.8.17
[Issue type] Update
In Depth class and mvDepth apis, create/destroy functions are initially
implemented.
Change-Id: I1d47d1aad19cff2af036bc380714b6a6d73bc66d
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Diffstat (limited to 'mv_depth/depth')
-rw-r--r-- | mv_depth/depth/include/Depth.h | 53 | ||||
-rw-r--r-- | mv_depth/depth/include/mvDepth.h | 46 | ||||
-rw-r--r-- | mv_depth/depth/src/Depth.cpp | 47 | ||||
-rw-r--r-- | mv_depth/depth/src/mvDepth.cpp | 56 |
4 files changed, 202 insertions, 0 deletions
diff --git a/mv_depth/depth/include/Depth.h b/mv_depth/depth/include/Depth.h new file mode 100644 index 00000000..f479ffb0 --- /dev/null +++ b/mv_depth/depth/include/Depth.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ + +#ifndef __MEDIA_VISION_DEPTH_H__ +#define __MEDIA_VISION_DEPTH_H__ + +#include <cstddef> +#include "dfs_parameter.h" +#include "dfs_adaptation_impl.h" + +/** + * @file Depth.h + * @brief This file contains the depth class definition + * which supports depth-from-stereo (DFS). + */ +using namespace DfsAdaptation; + +namespace mediavision +{ +namespace depth +{ + class Depth + { + private: + DfsParameter mDfsParameter; + DfsAdaptor *mDfsAdaptor; + int mMode; + + size_t mWidth; + size_t mHeight; + size_t mMinDisp; + size_t mMaxDisp; + + public: + Depth(); + ~Depth(); + }; +} +} +#endif /* __MEDIA_VISION_DEPTH_H__ */
\ No newline at end of file diff --git a/mv_depth/depth/include/mvDepth.h b/mv_depth/depth/include/mvDepth.h new file mode 100644 index 00000000..6a8e89e2 --- /dev/null +++ b/mv_depth/depth/include/mvDepth.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ + +#ifndef __MEDIA_VISION_MVDEPTH_H__ +#define __MEDIA_VISION_MVDEPTH_H__ + +#include <mv_common.h> +#include <mv_depth_type_internal.h> +#include <mv_depth_internal.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @brief Creates depth handle. + * @since_tizen 6.5 + */ +int mvDepthCreate(mv_depth_h *depth); + +/** + * @brief Destroys depth handle and release all its resources. + * @since_tizen 6.5 + */ +int mvDepthDestroy(mv_depth_h depth); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __MEDIA_VISION_MVDEPTH_H__ */ + + diff --git a/mv_depth/depth/src/Depth.cpp b/mv_depth/depth/src/Depth.cpp new file mode 100644 index 00000000..309bf82f --- /dev/null +++ b/mv_depth/depth/src/Depth.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 "mv_private.h" +#include <mv_common.h> +#include "Depth.h" +#include <mv_depth_type_internal.h> + +namespace mediavision +{ +namespace depth +{ + + Depth::Depth() : + mDfsParameter(), + mDfsAdaptor(nullptr), + mMode(MV_DEPTH_MODE_NONE), + mWidth(0), + mHeight(0), + mMinDisp(0), + mMaxDisp(0) + { + LOGI("ENTER"); + LOGI("LEAVE"); + } + + Depth::~Depth() + { + LOGI("ENTER"); + + LOGI("LEAVE"); + } +} +}
\ No newline at end of file diff --git a/mv_depth/depth/src/mvDepth.cpp b/mv_depth/depth/src/mvDepth.cpp new file mode 100644 index 00000000..b393da3e --- /dev/null +++ b/mv_depth/depth/src/mvDepth.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 <new> +#include <exception> +#include <cstddef> + +#include "mv_private.h" +#include "mv_common.h" +#include "mvDepth.h" +#include "Depth.h" +#include <mv_depth_internal.h> + +using namespace mediavision::depth; + +int mvDepthCreate(mv_depth_h *depth) +{ + if (!depth) { + LOGE("Handle pointer is NULL"); + return MEDIA_VISION_ERROR_INVALID_PARAMETER; + } + + try { + (*depth) = static_cast<mv_depth_h>(new Depth()); + } catch (const std::exception &e) { + LOGE("Failed to create depth handle with %s", e.what()); + return MEDIA_VISION_ERROR_OUT_OF_MEMORY; + } + + return MEDIA_VISION_ERROR_NONE; +} + +int mvDepthDestroy(mv_depth_h depth) +{ + if (!depth) { + LOGE("Handle is NULL"); + return MEDIA_VISION_ERROR_INVALID_PARAMETER; + } + + delete static_cast<Depth *>(depth); + + return MEDIA_VISION_ERROR_NONE; +}
\ No newline at end of file |