Skip to content

Commit

Permalink
Ported VAS OT into OpenCV G-API
Browse files Browse the repository at this point in the history
  • Loading branch information
AsyaPronina committed Nov 16, 2023
1 parent 83d70b0 commit 53baf8f
Show file tree
Hide file tree
Showing 29 changed files with 4,017 additions and 1 deletion.
33 changes: 33 additions & 0 deletions modules/gapi/3rdparty/vasot/CMakeLists.txt
@@ -0,0 +1,33 @@
project(gapi.3rdparty.vasot)

set(TARGET_NAME gapi.3rdparty.vasot)

file(GLOB_RECURSE lib_srcs *.cpp)
file(GLOB_RECURSE lib_hdrs *.hpp)

add_library(${TARGET_NAME} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${lib_srcs} ${lib_hdrs})

target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)

target_link_libraries(${TARGET_NAME} PRIVATE opencv_core)
ocv_target_include_modules(${TARGET_NAME} opencv_core)

set_target_properties(${TARGET_NAME}
PROPERTIES OUTPUT_NAME ${TARGET_NAME}
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
COMPILE_PDB_NAME ${TARGET_NAME}
COMPILE_PDB_NAME_DEBUG "${TARGET_NAME}${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
)

if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "3rdparty")
endif()

if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
83 changes: 83 additions & 0 deletions modules/gapi/3rdparty/vasot/include/vas/common.hpp
@@ -0,0 +1,83 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2023 Intel Corporation

#ifndef VAS_COMMON_HPP
#define VAS_COMMON_HPP

#include <cstdint>

#define OT_VERSION_MAJOR 1
#define OT_VERSION_MINOR 0
#define OT_VERSION_PATCH 0

#define VAS_EXPORT //__attribute__((visibility("default")))

namespace vas {

/**
* @class Version
*
* Contains version information.
*/
class Version {
public:
/**
* Constructor.
*
* @param[in] major Major version.
* @param[in] minor Minor version.
* @param[in] patch Patch version.
*/
explicit Version(uint32_t major, uint32_t minor, uint32_t patch) : major_(major), minor_(minor), patch_(patch) {
}

/**
* Returns major version.
*/
uint32_t GetMajor() const noexcept {
return major_;
}

/**
* Returns minor version.
*/
uint32_t GetMinor() const noexcept {
return minor_;
}

/**
* Returns patch version.
*/
uint32_t GetPatch() const noexcept {
return patch_;
}

private:
uint32_t major_;
uint32_t minor_;
uint32_t patch_;
};

/**
* @enum BackendType
*
* Represents HW backend types.
*/
enum class BackendType {
CPU, /**< CPU */
GPU /**< GPU */
};

/**
* @enum ColorFormat
*
* Represents Color formats.
*/
enum class ColorFormat { BGR, NV12, BGRX, GRAY, I420 };

}; // namespace vas

#endif // VAS_COMMON_HPP

0 comments on commit 53baf8f

Please sign in to comment.