diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 00000000..0ab2ddcf
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,32 @@
+name: Build and Test
+
+on:
+ push:
+ branches: [ master, develop ]
+ pull_request:
+ branches: [ master, develop ]
+
+jobs:
+ build-and-test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Show current Git branch
+ run: git branch --show-current
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y gcc g++ cmake golang uuid-dev
+
+ - name: Run pre-build script
+ run: |
+ chmod +x ./build_clean_linux64.sh
+ ./build_clean_linux64.sh
+ shell: bash
+
+ - name: Run unit tests
+ run: ./build_linux64/Output/amc_unittest
diff --git a/.gitmodules b/.gitmodules
index 3bcbe0bf..7ab5f7fd 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -43,3 +43,9 @@
[submodule "submodules/libjpeg-turbo"]
path = submodules/libjpeg-turbo
url = https://github.com/libjpeg-turbo/libjpeg-turbo.git
+[submodule "submodules/TinyJPEG"]
+ path = submodules/TinyJPEG
+ url = https://github.com/serge-rgb/TinyJPEG.git
+[submodule "submodules/stb"]
+ path = submodules/stb
+ url = https://github.com/nothings/stb.git
diff --git a/ACT/LibMC.xml b/ACT/LibMC.xml
index cfe38f76..34c3d9a0 100644
--- a/ACT/LibMC.xml
+++ b/ACT/LibMC.xml
@@ -658,10 +658,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
@@ -682,6 +712,10 @@
+
+
+
+
@@ -712,6 +746,10 @@
+
+
+
+
diff --git a/ACT/LibMCData.xml b/ACT/LibMCData.xml
index 29fce77e..9a55720b 100644
--- a/ACT/LibMCData.xml
+++ b/ACT/LibMCData.xml
@@ -435,6 +435,8 @@
+
+
@@ -880,6 +882,10 @@
+
+
+
+
@@ -1497,7 +1503,6 @@
-
@@ -1741,6 +1746,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1834,6 +1989,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ACT/LibMCEnv.xml b/ACT/LibMCEnv.xml
index 260f0cc8..ff61d0d2 100644
--- a/ACT/LibMCEnv.xml
+++ b/ACT/LibMCEnv.xml
@@ -250,7 +250,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -274,11 +318,12 @@
-
-
-
-
-
+
+
+
+
+
+
@@ -313,7 +358,6 @@
-
@@ -338,9 +382,18 @@
+
+
-
+
+
+
+
+
+
+
+
@@ -355,6 +408,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -384,6 +448,7 @@
+
@@ -399,6 +464,10 @@
+
+
+
+
@@ -415,12 +484,12 @@
-
-
-
-
-
+
+
+
+
+
@@ -437,6 +506,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -938,7 +1020,42 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -986,9 +1103,11 @@
+
+
+
-
-
+
@@ -1477,6 +1596,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1501,10 +1686,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1554,6 +1753,10 @@
+
+
+
+
@@ -1690,7 +1893,7 @@
-
+
@@ -1715,11 +1918,6 @@
-
-
-
-
-
@@ -1767,9 +1965,9 @@
-
+
-
+
@@ -1789,6 +1987,14 @@
+
+
+
+
+
+
+
+
@@ -1863,6 +2069,12 @@
+
+
+
+
+
+
@@ -1874,44 +2086,41 @@
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
@@ -2006,6 +2215,7 @@
+
@@ -2058,18 +2268,40 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2299,6 +2531,9 @@
+
+
+
@@ -2472,15 +2707,62 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2495,12 +2777,16 @@
+
+
+
+
-
-
+
+
@@ -2525,6 +2811,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2533,6 +2867,12 @@
+
+
+
+
+
+
@@ -2555,6 +2895,12 @@
+
+
+
+
+
+
@@ -2573,6 +2919,12 @@
+
+
+
+
+
+
@@ -2582,6 +2934,11 @@
+
+
+
+
+
@@ -2598,6 +2955,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2696,7 +3065,7 @@
-
+
@@ -2704,7 +3073,12 @@
-
+
+
+
+
+
+
@@ -2745,17 +3119,17 @@
-
+
-
+
-
+
@@ -2768,6 +3142,10 @@
+
+
+
+
@@ -2787,6 +3165,11 @@
+
+
+
+
+
@@ -2821,15 +3204,15 @@
-
+
-
+
-
+
@@ -2840,6 +3223,10 @@
+
+
+
+
@@ -3434,6 +3821,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3641,18 +4042,55 @@
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3717,18 +4155,25 @@
-
+
+
+
+
+
-
-
+
-
-
+
+
+
+
+
+
-
+
@@ -3746,7 +4191,6 @@
-
@@ -4246,6 +4690,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4270,12 +4818,16 @@
-
+
-
+
+
+
+
+
@@ -4448,6 +5000,10 @@
+
+
+
+
@@ -4539,6 +5095,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4892,6 +5463,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -5091,7 +5676,7 @@
-
+
diff --git a/Artifacts/clientdist/_githash_client.txt b/Artifacts/clientdist/_githash_client.txt
index b6af76d2..55ed4599 100644
--- a/Artifacts/clientdist/_githash_client.txt
+++ b/Artifacts/clientdist/_githash_client.txt
@@ -1 +1 @@
-b87eef71c8eb6444db7b7a9c8eb8e29abf3c072a
+ef9d6cb029269bc52dfcda095667ef2ef332c2af
diff --git a/Artifacts/clientdist/clientpackage.zip b/Artifacts/clientdist/clientpackage.zip
index 5a06aad9..84c9e0cc 100644
Binary files a/Artifacts/clientdist/clientpackage.zip and b/Artifacts/clientdist/clientpackage.zip differ
diff --git a/Artifacts/clientdist/clientsourcepackage.zip b/Artifacts/clientdist/clientsourcepackage.zip
index 1c043402..b9d2a160 100644
Binary files a/Artifacts/clientdist/clientsourcepackage.zip and b/Artifacts/clientdist/clientsourcepackage.zip differ
diff --git a/Artifacts/lib3mf/_githash_lib3mf.txt b/Artifacts/lib3mf/_githash_lib3mf.txt
index 5465ce8b..455725df 100644
--- a/Artifacts/lib3mf/_githash_lib3mf.txt
+++ b/Artifacts/lib3mf/_githash_lib3mf.txt
@@ -1 +1 @@
-717f24167abc0e495ed4798eb463fcbed0678e2c
+8a6f982499820f8a04b7771ea4f1db34760ec8d3
diff --git a/Artifacts/lib3mf/lib3mf_win64.dll b/Artifacts/lib3mf/lib3mf_win64.dll
index b2848398..7d00f0f5 100644
Binary files a/Artifacts/lib3mf/lib3mf_win64.dll and b/Artifacts/lib3mf/lib3mf_win64.dll differ
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34ba0cc1..1ca7bf2a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
project(LibMC)
@@ -183,6 +183,19 @@ foreach(framework_file_plugincpp ${framework_files_plugincpp})
endforeach()
+#[[++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++ LibUUID for Unix targets
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+]]
+if(UNIX)
+ find_library(LIBUUID_PATH uuid)
+ if(NOT LIBUUID_PATH)
+ message(FATAL_ERROR "libuuid not found")
+ endif()
+endif()
#[[++
@@ -287,10 +300,13 @@ target_include_directories(libmc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementat
target_include_directories(libmc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/PugiXML)
target_include_directories(libmc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/PicoSHA2)
target_include_directories(libmc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/libzip)
-target_include_directories(libmc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/libjpeg-turbo)
target_include_directories(libmc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries)
target_include_directories(libmc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/)
+if(UNIX)
+ target_link_libraries(libmc ${LIBUUID_PATH})
+endif()
+
if(WIN32)
@@ -298,7 +314,6 @@ if(WIN32)
target_link_libraries(libmc Winmm.lib)
target_link_libraries(libmc Shlwapi.lib)
target_link_libraries(libmc ws2_32.lib)
- target_link_libraries(libmc ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/libjpeg-turbo/turbojpeg-static.lib)
else()
target_link_libraries(libmc winmm.lib)
target_link_libraries(libmc shlwapi.lib)
@@ -395,14 +410,10 @@ target_compile_options(libmcdata PRIVATE "-D__LIBMCDATA_EXPORTS")
target_compile_options(libmcdata PRIVATE "-D__GITHASH=${GLOBALGITHASH}")
if(UNIX)
- find_library(LIBUUID_PATH uuid)
- if(NOT LIBUUID_PATH)
- message(FATAL_ERROR "libuuid not found")
- endif()
- target_link_libraries(libmc ${LIBUUID_PATH})
target_link_libraries(libmcdata ${LIBUUID_PATH})
endif()
+
target_include_directories(libmcdata PRIVATE ${CMAKE_CURRENT_AUTOGENERATED_DIR})
target_include_directories(libmcdata PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/SQLite)
target_include_directories(libmcdata PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/zlib)
@@ -651,6 +662,110 @@ endif(MSVC)
endif(WIN32)
+#[[++
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++ AMC UnitTest Target
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+]]
+
+
+file(GLOB UNITTEST_SRC
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/UnitTest/amc_unittest_framework.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/UnitTest/amc_unittest_group.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/UnitTest/amc_unittest_console.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/UnitTest/amc_unittest_io.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/UnitTest/amc_unittests.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/PugiXML/pugixml.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/zlib/*.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/Common/common_utils.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/Common/common_chrono.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/Common/common_importstream_native.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/Common/common_exportstream_native.cpp
+ ${LIBMC_SRC_CORE}
+ ${LIBMC_SRC_COMMON}
+ ${LIBMC_SRC_API}
+ ${LIBMC_SRC_UI}
+ ${LIBMC_SRC_LIBMC}
+ ${LIBMC_SRC_LIBMCENV}
+ ${LIBMC_SRC_DEP_ZIP}
+ ${LIBMC_SRC_DEP_ZLIB}
+ ${LIBMC_SRC_DEP_PUGIXML}
+ ${LIBMC_SRC_DEP_CROSSGUID}
+ ${LIBMC_SRC_DEP_LODEPNG}
+)
+
+add_executable(amc_unittest ${UNITTEST_SRC})
+
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_HEADERS_CORE_DIR})
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/PugiXML)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/zlib)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/Common)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/)
+
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_AUTOGENERATED_DIR})
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_HEADERS_CORE_DIR})
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_HEADERS_DEV_DIR})
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementation)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/API)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/Core)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/Common)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/UI)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/LibMC)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Implementation/LibMCEnv)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/PugiXML)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/PicoSHA2)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/libzip)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries)
+target_include_directories(amc_unittest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/)
+target_compile_options(amc_unittest PRIVATE "-D__GITHASH=${GLOBALGITHASH}")
+
+if(WIN32)
+
+ if (MSVC)
+ target_link_libraries(amc_unittest Winmm.lib)
+ target_link_libraries(amc_unittest Shlwapi.lib)
+ target_link_libraries(amc_unittest ws2_32.lib)
+ else()
+ target_link_libraries(amc_unittest winmm.lib)
+ target_link_libraries(amc_unittest shlwapi.lib)
+ target_link_libraries(amc_unittest ws2_32.lib)
+ target_link_options(amc_unittest PRIVATE -static-libgcc -static-libstdc++ --static )
+ endif (MSVC)
+else()
+
+ find_package(Threads REQUIRED)
+ if(THREADS_HAVE_PTHREAD_ARG)
+ target_compile_options(amc_unittest PUBLIC "-pthread")
+ endif()
+ if(CMAKE_THREAD_LIBS_INIT)
+ target_link_libraries(amc_unittest "${CMAKE_THREAD_LIBS_INIT}")
+ endif()
+
+ target_link_libraries(amc_unittest dl)
+
+endif(WIN32)
+
+if(UNIX)
+ target_link_libraries(amc_unittest ${LIBUUID_PATH})
+endif()
+
+
+set_target_properties(amc_unittest
+ PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Output"
+ RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/Output"
+ RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/Output"
+ LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Output"
+
+ OUTPUT_NAME "amc_unittest"
+
+ VS_DEBUGGER_WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/Output"
+
+)
+
#[[++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/Client/src/common/AMCApplication.js b/Client/src/common/AMCApplication.js
index 95531cc8..7945915e 100644
--- a/Client/src/common/AMCApplication.js
+++ b/Client/src/common/AMCApplication.js
@@ -1026,6 +1026,10 @@ export default class AMCApplication extends Common.AMCObject {
pageIsActive (page)
{
if (page) {
+
+ if (page.isAlwaysActive)
+ return true;
+
return page.name === this.AppState.activePage;
}
diff --git a/Client/src/common/AMCCustomPage.js b/Client/src/common/AMCCustomPage.js
index 2bed1e2f..4ac4af7b 100644
--- a/Client/src/common/AMCCustomPage.js
+++ b/Client/src/common/AMCCustomPage.js
@@ -51,6 +51,8 @@ export default class AMCApplicationCustomPage extends AMCApplicationPage {
this.modules = [];
this.moduleMap = new Map ();
this.customModule = null;
+
+ this.isAlwaysActive = false;
for (let moduleDefinitionJSON of pageJSON.modules) {
@@ -123,5 +125,19 @@ export default class AMCApplicationCustomPage extends AMCApplicationPage {
}
+
+ setAlwaysActive (value)
+ {
+ if (value) {
+
+ this.isAlwaysActive = true;
+
+ } else {
+
+ this.isAlwaysActive = false;
+
+ }
+
+ }
}
diff --git a/Client/src/common/AMCImplementation_LayerView.js b/Client/src/common/AMCImplementation_LayerView.js
index fddbf187..8653ef5e 100644
--- a/Client/src/common/AMCImplementation_LayerView.js
+++ b/Client/src/common/AMCImplementation_LayerView.js
@@ -287,6 +287,7 @@ class LayerViewImpl {
} else {
this.layerPointsVelocities = null;
this.layerPointsMaxVelocity = LAYERVIEW_MINVELOCITYRANGE;
+ this.layerPointsMinVelocity = LAYERVIEW_MINVELOCITYRANGE;
}
}
@@ -324,6 +325,31 @@ class LayerViewImpl {
}
}
+
+ makeLaserOnColors ()
+ {
+ this.laserOnPointsColorArray = null;
+
+ if (this.laser && this.laser.laseron && this.layerPointsArray) {
+
+ let pointCount = this.layerPointsArray.length / 2;
+ let colors = [];
+
+ for (let pointIndex = 0; pointIndex < pointCount; pointIndex++) {
+
+ let laseron = this.laser.laseron[pointIndex];
+
+ // laseron = 0 => Blue
+ // laseron = 1 => Red
+ const hue = laseron * 240 / 360;
+
+ colors.push (this.hslToRgb (hue, 1.0, 0.5));
+ }
+
+ this.layerPointsColorArray = colors;
+ }
+
+ }
hslToRgb(h, s, l) {
// Ensure h, s, l are in the range [0, 1]
@@ -389,12 +415,45 @@ class LayerViewImpl {
this.layerPointsColorArray = null;
this.layerPointsVelocities = null;
this.layerPointsMaxVelocity = LAYERVIEW_MINVELOCITYRANGE;
+ this.layerPointsMinVelocity = LAYERVIEW_MINVELOCITYRANGE;
+
+ this.computeVelocities ();
+ }
+
+ loadPointsChannelData(pointsChannelName, pointsColumnName, pointsChannelDataArray) {
+
+ // Ensure the channel-level object exists
+ if (!Object.prototype.hasOwnProperty.call(this, pointsChannelName)) {
+ this[pointsChannelName] = {};
+ }
+
+ // Assign the data array to the corresponding column
+ this[pointsChannelName][pointsColumnName] = pointsChannelDataArray;
+ }
+
+ clearPoints ()
+ {
+ this.layerPointsArray = null;
+ this.layerPointsColorArray = null;
+ this.layerPointsVelocities = null;
+ this.layerPointsMaxVelocity = LAYERVIEW_MINVELOCITYRANGE;
+ this.layerPointsMinVelocity = LAYERVIEW_MINVELOCITYRANGE;
this.computeVelocities ();
this.updateColors ();
this.updateLayerPoints ();
}
+ clearPointsChannelData (pointsChannelName)
+ {
+ // Ensure the channel-level object exists
+ if (Object.prototype.hasOwnProperty.call(this, pointsChannelName)) {
+ this[pointsChannelName] = {};
+ }
+
+ this.layerPointsColorArray = null;
+ }
+
updateColors ()
{
this.layerPointsColorArray = null;
@@ -407,6 +466,9 @@ class LayerViewImpl {
this.makeVelocityColors ();
}
+ if (this.layerPointsMode == "laseron") {
+ this.makeLaserOnColors ();
+ }
}
setColorMode (newColorMode) {
diff --git a/Client/src/modules/AMCModule_LayerView.vue b/Client/src/modules/AMCModule_LayerView.vue
index faebbed4..7ebdc34f 100644
--- a/Client/src/modules/AMCModule_LayerView.vue
+++ b/Client/src/modules/AMCModule_LayerView.vue
@@ -154,11 +154,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
this.LayerViewerInstance.setColorMode ("velocity");
}
else if (this.LayerViewerInstance.layerPointsMode == "velocity") {
- this.LayerViewerInstance.setColorMode ("uniform");
+ this.LayerViewerInstance.setColorMode ("laseron");
+ }
+ else if (this.LayerViewerInstance.layerPointsMode == "laseron") {
+ this.LayerViewerInstance.setColorMode ("uniform");
} else {
this.LayerViewerInstance.setColorMode ("time");
- }
-
+ }
},
onToggleToolpathClick: function () {
@@ -233,6 +235,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (this.LayerViewerInstance.layerPointsMode == "velocity") {
return "Color: Velocity";
}
+
+ if (this.LayerViewerInstance.layerPointsMode == "laseron") {
+ return "Color: LaserOn";
+ }
return "Color: Uniform";
},
@@ -297,6 +303,86 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
}
},
+
+ queryPoints: function (scatterplotuuid)
+ {
+ this.LayerViewerInstance.clearPoints ();
+
+ return this.Application.axiosGetArrayBufferRequest("/ui/pointcloud/" + scatterplotuuid)
+ .then(responseData => {
+ let pointcoordinates = new Float32Array(responseData.data);
+
+ if (this.LayerViewerInstance) {
+ this.LayerViewerInstance.loadPoints (pointcoordinates);
+ }
+ })
+ .catch(err => {
+ if (err.response) {
+ console.log (err.response);
+ } else {
+ console.log ("fatal error while retrieving point cloud ");
+ }
+ if (this.LayerViewerInstance) {
+ this.LayerViewerInstance.RenderScene (true);
+ }
+ });
+ },
+
+ queryPointsChannelData: function (scatterplotuuid, pointsChannelName)
+ {
+ this.LayerViewerInstance.clearPointsChannelData (pointsChannelName);
+
+ return this.Application.axiosGetArrayBufferRequest("/ui/pointchanneldata/" + scatterplotuuid + "/" + pointsChannelName)
+ .then(responseData => {
+
+ const contentType = responseData.headers['content-type'];
+
+ if (contentType && contentType.includes("application/json")) {
+
+ try {
+ const jsonText = new TextDecoder().decode(responseData.data);
+
+ const parsed = JSON.parse(jsonText);
+
+ if (parsed && typeof parsed === 'object') {
+
+ for (const [key, value] of Object.entries(parsed)) {
+
+ if (Array.isArray(value)) {
+ const floatArray = new Float32Array(value);
+ console.log(`Key "${key}" contains Float32Array with length: ${floatArray.length}`);
+ if (key.toLowerCase() === 'laseron') {
+ if (this.LayerViewerInstance) {
+ this.LayerViewerInstance.loadPointsChannelData ("laser", key.toLowerCase(), floatArray);
+ } else {
+ console.log(`${key}: ${floatArray.length}`);
+ }
+ }
+ } else {
+ console.warn(`Key "${key}" is not an array and will be ignored.`);
+ }
+ }
+ } else {
+ console.warn("Parsed JSON is not an object.");
+ }
+ } catch (e) {
+ console.error("Error while parsing JSON response:", e);
+ }
+ } else {
+ console.error("Error while parsing response: not a JSON");
+ }
+ })
+ .catch(err => {
+ if (err.response) {
+ console.log (err.response);
+ } else {
+ console.log ("fatal error while retrieving point cloud ");
+ }
+ if (this.LayerViewerInstance) {
+ this.LayerViewerInstance.RenderScene (true);
+ }
+ });
+ },
onLayerChanged: function (sender) {
@@ -333,43 +419,32 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
});
-
if (platform.scatterplotuuid != "00000000-0000-0000-0000-000000000000") {
- this.loadingScatterplot = true;
- this.LayerViewerInstance.glInstance.removeElement("layerdata_points");
-
- this.Application.axiosGetArrayBufferRequest("/ui/pointcloud/" + platform.scatterplotuuid)
- .then(responseData => {
- let pointcoordinates = new Float32Array(responseData.data);
-
- if (this.LayerViewerInstance) {
- this.LayerViewerInstance.loadPoints (pointcoordinates);
- }
-
- this.loadingScatterplot = false;
-
- })
- .catch(err => {
- if (err.response) {
- console.log (err.response);
- } else {
- console.log ("fatal error while retrieving point cloud ");
- }
- if (this.LayerViewerInstance) {
- this.LayerViewerInstance.RenderScene (true);
- }
-
- this.loadingScatterplot = false;
- });
+ this.loadingScatterplot = true;
+ this.LayerViewerInstance.glInstance.removeElement("layerdata_points");
+
+ Promise.all([
+ this.queryPoints(platform.scatterplotuuid),
+ this.queryPointsChannelData(platform.scatterplotuuid, "laser")
+ ]).then(() => {
+ if (this.LayerViewerInstance && this.LayerViewerInstance.updateLayerPoints) {
+ this.LayerViewerInstance.updateColors ();
+ this.LayerViewerInstance.updateLayerPoints();
+ }
+ });
+
+ this.loadingScatterplot = false;
+
} else {
this.loadingScatterplot = false;
this.LayerViewerInstance.glInstance.removeElement("layerdata_points");
-
-
- }
-
+
+ this.LayerViewerInstance.clearPoints ();
+ this.LayerViewerInstance.clearPointsChannelData ("laser")
+
+ }
}
}
}
diff --git a/DevTools/CMakeLists_Distrib.txt b/DevTools/CMakeLists_Distrib.txt
index b7174787..07fbc660 100644
--- a/DevTools/CMakeLists_Distrib.txt
+++ b/DevTools/CMakeLists_Distrib.txt
@@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")
diff --git a/DevTools/createClientDist.exe b/DevTools/createClientDist.exe
new file mode 100644
index 00000000..bf514885
Binary files /dev/null and b/DevTools/createClientDist.exe differ
diff --git a/Drivers/BK9xxx/Implementation/libmcdriver_bk9xxx_driver_bk9xxx.cpp b/Drivers/BK9xxx/Implementation/libmcdriver_bk9xxx_driver_bk9xxx.cpp
index afbe376d..8a67f912 100644
--- a/Drivers/BK9xxx/Implementation/libmcdriver_bk9xxx_driver_bk9xxx.cpp
+++ b/Drivers/BK9xxx/Implementation/libmcdriver_bk9xxx_driver_bk9xxx.cpp
@@ -34,7 +34,7 @@ Abstract: This is a stub class definition of CDriver_BK9xxx
#include "libmcdriver_bk9xxx_driver_bk9xxx.hpp"
#include "libmcdriver_bk9xxx_interfaceexception.hpp"
#include
-
+#include
// Include custom headers here.
#define __STRINGIZE(x) #x
diff --git a/Drivers/CMakeDriverCommon.txt b/Drivers/CMakeDriverCommon.txt
index cd2fce3b..dfbd48f9 100644
--- a/Drivers/CMakeDriverCommon.txt
+++ b/Drivers/CMakeDriverCommon.txt
@@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
##########################################################################################
### generic CMake boilerplate code
diff --git a/Drivers/CMakeLists.txt b/Drivers/CMakeLists.txt
index 210681b2..d620c989 100644
--- a/Drivers/CMakeLists.txt
+++ b/Drivers/CMakeLists.txt
@@ -27,6 +27,7 @@ add_subdirectory(Camera)
add_subdirectory(LibOAPC)
add_subdirectory(Marlin)
add_subdirectory(OPCUA)
+add_subdirectory(OpenCV)
add_subdirectory(FrameBuffer)
add_subdirectory(UART)
add_subdirectory(Rasterizer)
@@ -37,6 +38,4 @@ add_subdirectory(ScanLabOIE)
add_subdirectory(ScanLabSMC)
add_subdirectory(TCPIP)
add_subdirectory(Ximc)
-add_subdirectory(TML)
-add_subdirectory(ASL)
diff --git a/Drivers/Camera/ACT/LibMCDriver_Camera.xml b/Drivers/Camera/ACT/LibMCDriver_Camera.xml
index cf53b314..94bf5097 100644
--- a/Drivers/Camera/ACT/LibMCDriver_Camera.xml
+++ b/Drivers/Camera/ACT/LibMCDriver_Camera.xml
@@ -89,9 +89,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Drivers/OpenCV/ACT/LibOpenCV.xml b/Drivers/OpenCV/ACT/LibOpenCV.xml
new file mode 100644
index 00000000..434e0f63
--- /dev/null
+++ b/Drivers/OpenCV/ACT/LibOpenCV.xml
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Drivers/OpenCV/ACT/generateInterfaces.bat b/Drivers/OpenCV/ACT/generateInterfaces.bat
new file mode 100644
index 00000000..33b53c2c
--- /dev/null
+++ b/Drivers/OpenCV/ACT/generateInterfaces.bat
@@ -0,0 +1,5 @@
+..\..\..\ACT\act.exe LibMCDriver_OpenCV.xml -bindings ..\Headers -interfaces ..\Interfaces -suppresssubcomponents -suppresslicense -suppressstub -suppressexamples
+..\..\..\ACT\act.exe LibOpenCV.xml -bindings ..\LibOpenCV\Headers -interfaces ..\LibOpenCV\Interfaces -suppresssubcomponents -suppresslicense -suppressstub -suppressexamples
+
+
+pause
\ No newline at end of file
diff --git a/Drivers/OpenCV/CMakeLists.txt b/Drivers/OpenCV/CMakeLists.txt
new file mode 100644
index 00000000..877af0ea
--- /dev/null
+++ b/Drivers/OpenCV/CMakeLists.txt
@@ -0,0 +1,50 @@
+#[[++
+
+Copyright (C) 2020 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+]]
+
+
+cmake_minimum_required(VERSION 3.5)
+
+##########################################################################################
+### Change the next line for making a new driver
+##########################################################################################
+
+set (DRIVERPROJECT OpenCV)
+
+include (../CMakeDriverCommon.txt)
+
+##########################################################################################
+### Add custom code below
+##########################################################################################
+
+target_include_directories(${DRIVERNAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/LibOpenCV/Headers/CppDynamic)
+
+
+
+
diff --git a/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_dynamic.h b/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_dynamic.h
new file mode 100644
index 00000000..0321dada
--- /dev/null
+++ b/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_dynamic.h
@@ -0,0 +1,359 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++-Header file in order to allow an easy
+ use of MC Driver for OpenCV Computer Vision Library
+
+Interface version: 2.0.0
+
+*/
+
+#ifndef __LIBMCDRIVER_OPENCV_DYNAMICHEADER_CPPTYPES
+#define __LIBMCDRIVER_OPENCV_DYNAMICHEADER_CPPTYPES
+
+#include "libmcdriver_opencv_types.hpp"
+
+#include "libmcenv_types.hpp"
+
+
+/*************************************************************************************************************************
+ Class definition for Base
+**************************************************************************************************************************/
+
+/*************************************************************************************************************************
+ Class definition for Driver
+**************************************************************************************************************************/
+
+/**
+* Configures a driver with its specific configuration data.
+*
+* @param[in] pDriver - Driver instance.
+* @param[in] pConfigurationString - Configuration data of driver.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_ConfigurePtr) (LibMCDriver_OpenCV_Driver pDriver, const char * pConfigurationString);
+
+/**
+* returns the name identifier of the driver
+*
+* @param[in] pDriver - Driver instance.
+* @param[in] nNameBufferSize - size of the buffer (including trailing 0)
+* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size.
+* @param[out] pNameBuffer - buffer of Name of the driver., may be NULL
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_GetNamePtr) (LibMCDriver_OpenCV_Driver pDriver, const LibMCDriver_OpenCV_uint32 nNameBufferSize, LibMCDriver_OpenCV_uint32* pNameNeededChars, char * pNameBuffer);
+
+/**
+* returns the type identifier of the driver
+*
+* @param[in] pDriver - Driver instance.
+* @param[in] nTypeBufferSize - size of the buffer (including trailing 0)
+* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size.
+* @param[out] pTypeBuffer - buffer of Type of the driver., may be NULL
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_GetTypePtr) (LibMCDriver_OpenCV_Driver pDriver, const LibMCDriver_OpenCV_uint32 nTypeBufferSize, LibMCDriver_OpenCV_uint32* pTypeNeededChars, char * pTypeBuffer);
+
+/**
+* returns the version identifiers of the driver
+*
+* @param[in] pDriver - Driver instance.
+* @param[out] pMajor - Major version.
+* @param[out] pMinor - Minor version.
+* @param[out] pMicro - Micro version.
+* @param[in] nBuildBufferSize - size of the buffer (including trailing 0)
+* @param[out] pBuildNeededChars - will be filled with the count of the written bytes, or needed buffer size.
+* @param[out] pBuildBuffer - buffer of Build identifier., may be NULL
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_GetVersionPtr) (LibMCDriver_OpenCV_Driver pDriver, LibMCDriver_OpenCV_uint32 * pMajor, LibMCDriver_OpenCV_uint32 * pMinor, LibMCDriver_OpenCV_uint32 * pMicro, const LibMCDriver_OpenCV_uint32 nBuildBufferSize, LibMCDriver_OpenCV_uint32* pBuildNeededChars, char * pBuildBuffer);
+
+/**
+* Updates the driver parameters in the driver environment. Should only be called in the driver thread.
+*
+* @param[in] pDriver - Driver instance.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_QueryParametersPtr) (LibMCDriver_OpenCV_Driver pDriver);
+
+/**
+* Updates the driver parameters in the driver environment. Might be called out of thread. Implementation MUST be able to handle parallel calls.
+*
+* @param[in] pDriver - Driver instance.
+* @param[in] pDriverUpdateInstance - Status update instance.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_QueryParametersExPtr) (LibMCDriver_OpenCV_Driver pDriver, LibMCEnv_DriverStatusUpdateSession pDriverUpdateInstance);
+
+/*************************************************************************************************************************
+ Class definition for ImageSaveParameters
+**************************************************************************************************************************/
+
+/*************************************************************************************************************************
+ Class definition for ImageBuffer
+**************************************************************************************************************************/
+
+/**
+* Retrieves the image format of the encoded buffer.
+*
+* @param[in] pImageBuffer - ImageBuffer instance.
+* @param[out] pImageFormat - Format to write to.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVImageBuffer_GetImageFormatPtr) (LibMCDriver_OpenCV_ImageBuffer pImageBuffer, LibMCDriver_OpenCV::eImageWriteFormat * pImageFormat);
+
+/**
+* Retrieves the size of the encoded buffer.
+*
+* @param[in] pImageBuffer - ImageBuffer instance.
+* @param[out] pBufferSize - Size of the buffer.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVImageBuffer_GetSizePtr) (LibMCDriver_OpenCV_ImageBuffer pImageBuffer, LibMCDriver_OpenCV_uint64 * pBufferSize);
+
+/**
+* Retrieves the data of the encoded buffer.
+*
+* @param[in] pImageBuffer - ImageBuffer instance.
+* @param[in] nMemoryArrayBufferSize - Number of elements in buffer
+* @param[out] pMemoryArrayNeededCount - will be filled with the count of the written elements, or needed buffer size.
+* @param[out] pMemoryArrayBuffer - uint8 buffer of Array to write into.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVImageBuffer_GetDataPtr) (LibMCDriver_OpenCV_ImageBuffer pImageBuffer, const LibMCDriver_OpenCV_uint64 nMemoryArrayBufferSize, LibMCDriver_OpenCV_uint64* pMemoryArrayNeededCount, LibMCDriver_OpenCV_uint8 * pMemoryArrayBuffer);
+
+/**
+* Stores the data in a temporary file stream.
+*
+* @param[in] pImageBuffer - ImageBuffer instance.
+* @param[in] pStream - Stream to store the data to.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVImageBuffer_StoreToStreamPtr) (LibMCDriver_OpenCV_ImageBuffer pImageBuffer, LibMCEnv_TempStreamWriter pStream);
+
+/*************************************************************************************************************************
+ Class definition for Mat
+**************************************************************************************************************************/
+
+/**
+* Returns if the Mat instance is empty.
+*
+* @param[in] pMat - Mat instance.
+* @param[out] pIsEmpty - Returns true if the Mat instance is empty. False otherwise.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVMat_EmptyPtr) (LibMCDriver_OpenCV_Mat pMat, bool * pIsEmpty);
+
+/**
+* Returns the number of columns.
+*
+* @param[in] pMat - Mat instance.
+* @param[out] pNumberOfColumns - Returns the number of columns of the matrix.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVMat_ColsPtr) (LibMCDriver_OpenCV_Mat pMat, LibMCDriver_OpenCV_uint32 * pNumberOfColumns);
+
+/**
+* Returns the number of rows.
+*
+* @param[in] pMat - Mat instance.
+* @param[out] pNumberOfRows - Returns the number of rows of the matrix.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVMat_RowsPtr) (LibMCDriver_OpenCV_Mat pMat, LibMCDriver_OpenCV_uint32 * pNumberOfRows);
+
+/**
+* Writes a matrix as image buffer.
+*
+* @param[in] pMat - Mat instance.
+* @param[in] eWriteFormat - Format to write to.
+* @param[in] pSaveParameters - Optional parameters for writing the image file.
+* @param[out] pOutputBuffer - Returns an image buffer object.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVMat_EncodeImagePtr) (LibMCDriver_OpenCV_Mat pMat, LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, LibMCDriver_OpenCV_ImageSaveParameters pSaveParameters, LibMCDriver_OpenCV_ImageBuffer * pOutputBuffer);
+
+/**
+* Writes a matrix into a temporary file stream.
+*
+* @param[in] pMat - Mat instance.
+* @param[in] eWriteFormat - Format to write to.
+* @param[in] pSaveParameters - Optional parameters for writing the image file.
+* @param[in] pStream - Stream to store the data to.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVMat_EncodeImageToStreamPtr) (LibMCDriver_OpenCV_Mat pMat, LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, LibMCDriver_OpenCV_ImageSaveParameters pSaveParameters, LibMCEnv_TempStreamWriter pStream);
+
+/*************************************************************************************************************************
+ Class definition for Driver_OpenCV
+**************************************************************************************************************************/
+
+/**
+* Loads an image from a memory buffer.
+*
+* @param[in] pDriver_OpenCV - Driver_OpenCV instance.
+* @param[in] nBufferBufferSize - Number of elements in buffer
+* @param[in] pBufferBuffer - uint8 buffer of Image data to read from.
+* @param[in] eReadFormat - Image format to output.
+* @param[out] pMatInstance - Mat instance of the image that has been loaded.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_OpenCV_LoadImageFromBufferPtr) (LibMCDriver_OpenCV_Driver_OpenCV pDriver_OpenCV, LibMCDriver_OpenCV_uint64 nBufferBufferSize, const LibMCDriver_OpenCV_uint8 * pBufferBuffer, LibMCDriver_OpenCV::eImageReadFormat eReadFormat, LibMCDriver_OpenCV_Mat * pMatInstance);
+
+/**
+* Loads an image from a resource identifier.
+*
+* @param[in] pDriver_OpenCV - Driver_OpenCV instance.
+* @param[in] pResourceIdentifier - Image resource to read from.
+* @param[in] eReadFormat - Image format to output.
+* @param[out] pMatInstance - Mat instance of the image that has been loaded.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_OpenCV_LoadImageFromResourcePtr) (LibMCDriver_OpenCV_Driver_OpenCV pDriver_OpenCV, const char * pResourceIdentifier, LibMCDriver_OpenCV::eImageReadFormat eReadFormat, LibMCDriver_OpenCV_Mat * pMatInstance);
+
+/**
+* Creates an empty image.
+*
+* @param[in] pDriver_OpenCV - Driver_OpenCV instance.
+* @param[in] nColumnCount - Number of Column of the new image.
+* @param[in] nRowCount - Number of Rows of the new image.
+* @param[in] eReadFormat - Image format to output.
+* @param[out] pMatInstance - Mat instance of the image that has been loaded.
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVDriver_OpenCV_CreateEmptyImagePtr) (LibMCDriver_OpenCV_Driver_OpenCV pDriver_OpenCV, LibMCDriver_OpenCV_uint32 nColumnCount, LibMCDriver_OpenCV_uint32 nRowCount, LibMCDriver_OpenCV::eImageReadFormat eReadFormat, LibMCDriver_OpenCV_Mat * pMatInstance);
+
+/*************************************************************************************************************************
+ Global functions
+**************************************************************************************************************************/
+
+/**
+* retrieves the binary version of this library.
+*
+* @param[out] pMajor - returns the major version of this library
+* @param[out] pMinor - returns the minor version of this library
+* @param[out] pMicro - returns the micro version of this library
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVGetVersionPtr) (LibMCDriver_OpenCV_uint32 * pMajor, LibMCDriver_OpenCV_uint32 * pMinor, LibMCDriver_OpenCV_uint32 * pMicro);
+
+/**
+* Returns the last error recorded on this object
+*
+* @param[in] pInstance - Instance Handle
+* @param[in] nErrorMessageBufferSize - size of the buffer (including trailing 0)
+* @param[out] pErrorMessageNeededChars - will be filled with the count of the written bytes, or needed buffer size.
+* @param[out] pErrorMessageBuffer - buffer of Message of the last error, may be NULL
+* @param[out] pHasError - Is there a last error to query
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVGetLastErrorPtr) (LibMCDriver_OpenCV_Base pInstance, const LibMCDriver_OpenCV_uint32 nErrorMessageBufferSize, LibMCDriver_OpenCV_uint32* pErrorMessageNeededChars, char * pErrorMessageBuffer, bool * pHasError);
+
+/**
+* Releases shared ownership of an Instance
+*
+* @param[in] pInstance - Instance Handle
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVReleaseInstancePtr) (LibMCDriver_OpenCV_Base pInstance);
+
+/**
+* Acquires shared ownership of an Instance
+*
+* @param[in] pInstance - Instance Handle
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVAcquireInstancePtr) (LibMCDriver_OpenCV_Base pInstance);
+
+/**
+* Injects an imported component for usage within this component
+*
+* @param[in] pNameSpace - NameSpace of the injected component
+* @param[in] pSymbolAddressMethod - Address of the SymbolAddressMethod of the injected component
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVInjectComponentPtr) (const char * pNameSpace, LibMCDriver_OpenCV_pvoid pSymbolAddressMethod);
+
+/**
+* Returns the address of the SymbolLookupMethod
+*
+* @param[out] pSymbolLookupMethod - Address of the SymbolAddressMethod
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVGetSymbolLookupMethodPtr) (LibMCDriver_OpenCV_pvoid * pSymbolLookupMethod);
+
+/**
+* Creates a driver instance with a specific name.
+*
+* @param[in] pName - Name of driver to be created.
+* @param[in] pType - Type of driver to be created.
+* @param[in] pDriverEnvironment - Environment of this driver.
+* @param[out] pInstance - New Driver instance
+* @return error code or 0 (success)
+*/
+typedef LibMCDriver_OpenCVResult (*PLibMCDriver_OpenCVCreateDriverPtr) (const char * pName, const char * pType, LibMCEnv_DriverEnvironment pDriverEnvironment, LibMCDriver_OpenCV_Driver * pInstance);
+
+/*************************************************************************************************************************
+ Function Table Structure
+**************************************************************************************************************************/
+
+typedef struct {
+ void * m_LibraryHandle;
+ PLibMCDriver_OpenCVDriver_ConfigurePtr m_Driver_Configure;
+ PLibMCDriver_OpenCVDriver_GetNamePtr m_Driver_GetName;
+ PLibMCDriver_OpenCVDriver_GetTypePtr m_Driver_GetType;
+ PLibMCDriver_OpenCVDriver_GetVersionPtr m_Driver_GetVersion;
+ PLibMCDriver_OpenCVDriver_QueryParametersPtr m_Driver_QueryParameters;
+ PLibMCDriver_OpenCVDriver_QueryParametersExPtr m_Driver_QueryParametersEx;
+ PLibMCDriver_OpenCVImageBuffer_GetImageFormatPtr m_ImageBuffer_GetImageFormat;
+ PLibMCDriver_OpenCVImageBuffer_GetSizePtr m_ImageBuffer_GetSize;
+ PLibMCDriver_OpenCVImageBuffer_GetDataPtr m_ImageBuffer_GetData;
+ PLibMCDriver_OpenCVImageBuffer_StoreToStreamPtr m_ImageBuffer_StoreToStream;
+ PLibMCDriver_OpenCVMat_EmptyPtr m_Mat_Empty;
+ PLibMCDriver_OpenCVMat_ColsPtr m_Mat_Cols;
+ PLibMCDriver_OpenCVMat_RowsPtr m_Mat_Rows;
+ PLibMCDriver_OpenCVMat_EncodeImagePtr m_Mat_EncodeImage;
+ PLibMCDriver_OpenCVMat_EncodeImageToStreamPtr m_Mat_EncodeImageToStream;
+ PLibMCDriver_OpenCVDriver_OpenCV_LoadImageFromBufferPtr m_Driver_OpenCV_LoadImageFromBuffer;
+ PLibMCDriver_OpenCVDriver_OpenCV_LoadImageFromResourcePtr m_Driver_OpenCV_LoadImageFromResource;
+ PLibMCDriver_OpenCVDriver_OpenCV_CreateEmptyImagePtr m_Driver_OpenCV_CreateEmptyImage;
+ PLibMCDriver_OpenCVGetVersionPtr m_GetVersion;
+ PLibMCDriver_OpenCVGetLastErrorPtr m_GetLastError;
+ PLibMCDriver_OpenCVReleaseInstancePtr m_ReleaseInstance;
+ PLibMCDriver_OpenCVAcquireInstancePtr m_AcquireInstance;
+ PLibMCDriver_OpenCVInjectComponentPtr m_InjectComponent;
+ PLibMCDriver_OpenCVGetSymbolLookupMethodPtr m_GetSymbolLookupMethod;
+ PLibMCDriver_OpenCVCreateDriverPtr m_CreateDriver;
+} sLibMCDriver_OpenCVDynamicWrapperTable;
+
+#endif // __LIBMCDRIVER_OPENCV_DYNAMICHEADER_CPPTYPES
+
diff --git a/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_dynamic.hpp b/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_dynamic.hpp
new file mode 100644
index 00000000..e07688b0
--- /dev/null
+++ b/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_dynamic.hpp
@@ -0,0 +1,1312 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++-Header file in order to allow an easy
+ use of MC Driver for OpenCV Computer Vision Library
+
+Interface version: 2.0.0
+
+*/
+
+#ifndef __LIBMCDRIVER_OPENCV_CPPHEADER_DYNAMIC_CPP
+#define __LIBMCDRIVER_OPENCV_CPPHEADER_DYNAMIC_CPP
+
+#include "libmcdriver_opencv_types.hpp"
+#include "libmcdriver_opencv_dynamic.h"
+
+#include "libmcenv_dynamic.hpp"
+
+#ifdef _WIN32
+#include
+#else // _WIN32
+#include
+#endif // _WIN32
+#include
+#include
+#include
+#include
+
+namespace LibMCDriver_OpenCV {
+
+/*************************************************************************************************************************
+ Forward Declaration of all classes
+**************************************************************************************************************************/
+class CWrapper;
+class CBase;
+class CDriver;
+class CImageSaveParameters;
+class CImageBuffer;
+class CMat;
+class CDriver_OpenCV;
+
+/*************************************************************************************************************************
+ Declaration of deprecated class types
+**************************************************************************************************************************/
+typedef CWrapper CLibMCDriver_OpenCVWrapper;
+typedef CBase CLibMCDriver_OpenCVBase;
+typedef CDriver CLibMCDriver_OpenCVDriver;
+typedef CImageSaveParameters CLibMCDriver_OpenCVImageSaveParameters;
+typedef CImageBuffer CLibMCDriver_OpenCVImageBuffer;
+typedef CMat CLibMCDriver_OpenCVMat;
+typedef CDriver_OpenCV CLibMCDriver_OpenCVDriver_OpenCV;
+
+/*************************************************************************************************************************
+ Declaration of shared pointer types
+**************************************************************************************************************************/
+typedef std::shared_ptr PWrapper;
+typedef std::shared_ptr PBase;
+typedef std::shared_ptr PDriver;
+typedef std::shared_ptr PImageSaveParameters;
+typedef std::shared_ptr PImageBuffer;
+typedef std::shared_ptr PMat;
+typedef std::shared_ptr PDriver_OpenCV;
+
+/*************************************************************************************************************************
+ Declaration of deprecated shared pointer types
+**************************************************************************************************************************/
+typedef PWrapper PLibMCDriver_OpenCVWrapper;
+typedef PBase PLibMCDriver_OpenCVBase;
+typedef PDriver PLibMCDriver_OpenCVDriver;
+typedef PImageSaveParameters PLibMCDriver_OpenCVImageSaveParameters;
+typedef PImageBuffer PLibMCDriver_OpenCVImageBuffer;
+typedef PMat PLibMCDriver_OpenCVMat;
+typedef PDriver_OpenCV PLibMCDriver_OpenCVDriver_OpenCV;
+
+
+/*************************************************************************************************************************
+ classParam Definition
+**************************************************************************************************************************/
+
+template class classParam {
+private:
+ const T* m_ptr;
+
+public:
+ classParam(const T* ptr)
+ : m_ptr (ptr)
+ {
+ }
+
+ classParam(std::shared_ptr sharedPtr)
+ : m_ptr (sharedPtr.get())
+ {
+ }
+
+ LibMCDriver_OpenCVHandle GetHandle()
+ {
+ if (m_ptr != nullptr)
+ return m_ptr->handle();
+ return nullptr;
+ }
+};
+
+/*************************************************************************************************************************
+ Class ELibMCDriver_OpenCVException
+**************************************************************************************************************************/
+class ELibMCDriver_OpenCVException : public std::exception {
+protected:
+ /**
+ * Error code for the Exception.
+ */
+ LibMCDriver_OpenCVResult m_errorCode;
+ /**
+ * Error message for the Exception.
+ */
+ std::string m_errorMessage;
+ std::string m_originalErrorMessage;
+
+public:
+ /**
+ * Exception Constructor.
+ */
+ ELibMCDriver_OpenCVException(LibMCDriver_OpenCVResult errorCode, const std::string & sErrorMessage)
+ : m_errorCode(errorCode), m_originalErrorMessage(sErrorMessage)
+ {
+ m_errorMessage = buildErrorMessage();
+ }
+
+ /**
+ * Returns error code
+ */
+ LibMCDriver_OpenCVResult getErrorCode() const noexcept
+ {
+ return m_errorCode;
+ }
+
+ /**
+ * Returns error message
+ */
+ const char* what() const noexcept
+ {
+ return m_errorMessage.c_str();
+ }
+
+ const char* getErrorMessage() const noexcept
+ {
+ return m_originalErrorMessage.c_str();
+ }
+
+ const char* getErrorName() const noexcept
+ {
+ switch(getErrorCode()) {
+ case LIBMCDRIVER_OPENCV_SUCCESS: return "SUCCESS";
+ case LIBMCDRIVER_OPENCV_ERROR_NOTIMPLEMENTED: return "NOTIMPLEMENTED";
+ case LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM: return "INVALIDPARAM";
+ case LIBMCDRIVER_OPENCV_ERROR_INVALIDCAST: return "INVALIDCAST";
+ case LIBMCDRIVER_OPENCV_ERROR_BUFFERTOOSMALL: return "BUFFERTOOSMALL";
+ case LIBMCDRIVER_OPENCV_ERROR_GENERICEXCEPTION: return "GENERICEXCEPTION";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY: return "COULDNOTLOADLIBRARY";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT: return "COULDNOTFINDLIBRARYEXPORT";
+ case LIBMCDRIVER_OPENCV_ERROR_INCOMPATIBLEBINARYVERSION: return "INCOMPATIBLEBINARYVERSION";
+ case LIBMCDRIVER_OPENCV_ERROR_UNKNOWNIMAGEWRITEFORMAT: return "UNKNOWNIMAGEWRITEFORMAT";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTWRITEIMAGETODISK: return "COULDNOTWRITEIMAGETODISK";
+ case LIBMCDRIVER_OPENCV_ERROR_EMPTYFILENAME: return "EMPTYFILENAME";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTFILENAME: return "COULDNOTCONVERTFILENAME";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTGETSHORTPATHNAME: return "COULDNOTGETSHORTPATHNAME";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTSHORTFILENAME: return "COULDNOTCONVERTSHORTFILENAME";
+ }
+ return "UNKNOWN";
+ }
+
+ const char* getErrorDescription() const noexcept
+ {
+ switch(getErrorCode()) {
+ case LIBMCDRIVER_OPENCV_SUCCESS: return "success";
+ case LIBMCDRIVER_OPENCV_ERROR_NOTIMPLEMENTED: return "functionality not implemented";
+ case LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM: return "an invalid parameter was passed";
+ case LIBMCDRIVER_OPENCV_ERROR_INVALIDCAST: return "a type cast failed";
+ case LIBMCDRIVER_OPENCV_ERROR_BUFFERTOOSMALL: return "a provided buffer is too small";
+ case LIBMCDRIVER_OPENCV_ERROR_GENERICEXCEPTION: return "a generic exception occurred";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY: return "the library could not be loaded";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT: return "a required exported symbol could not be found in the library";
+ case LIBMCDRIVER_OPENCV_ERROR_INCOMPATIBLEBINARYVERSION: return "the version of the binary interface does not match the bindings interface";
+ case LIBMCDRIVER_OPENCV_ERROR_UNKNOWNIMAGEWRITEFORMAT: return "unknown image write format";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTWRITEIMAGETODISK: return "could not write image to disk";
+ case LIBMCDRIVER_OPENCV_ERROR_EMPTYFILENAME: return "empty file name";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTFILENAME: return "could not convert filename";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTGETSHORTPATHNAME: return "could not get short path name";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTSHORTFILENAME: return "could not convert short path name";
+ }
+ return "unknown error";
+ }
+
+private:
+
+ std::string buildErrorMessage() const noexcept
+ {
+ std::string msg = m_originalErrorMessage;
+ if (msg.empty()) {
+ msg = getErrorDescription();
+ }
+ return std::string("Error: ") + getErrorName() + ": " + msg;
+ }
+};
+
+/*************************************************************************************************************************
+ Class CInputVector
+**************************************************************************************************************************/
+template
+class CInputVector {
+private:
+
+ const T* m_data;
+ size_t m_size;
+
+public:
+
+ CInputVector(const std::vector& vec)
+ : m_data( vec.data() ), m_size( vec.size() )
+ {
+ }
+
+ CInputVector(const T* in_data, size_t in_size)
+ : m_data( in_data ), m_size(in_size )
+ {
+ }
+
+ const T* data() const
+ {
+ return m_data;
+ }
+
+ size_t size() const
+ {
+ return m_size;
+ }
+
+};
+
+// declare deprecated class name
+template
+using CLibMCDriver_OpenCVInputVector = CInputVector;
+
+/*************************************************************************************************************************
+ Class CWrapper
+**************************************************************************************************************************/
+class CWrapper {
+public:
+
+ explicit CWrapper(void* pSymbolLookupMethod)
+ {
+ CheckError(nullptr, initWrapperTable(&m_WrapperTable));
+ CheckError(nullptr, loadWrapperTableFromSymbolLookupMethod(&m_WrapperTable, pSymbolLookupMethod));
+
+ CheckError(nullptr, checkBinaryVersion());
+ }
+
+ explicit CWrapper(const std::string &sFileName)
+ {
+ CheckError(nullptr, initWrapperTable(&m_WrapperTable));
+ CheckError(nullptr, loadWrapperTable(&m_WrapperTable, sFileName.c_str()));
+
+ CheckError(nullptr, checkBinaryVersion());
+ }
+
+ static PWrapper loadLibrary(const std::string &sFileName)
+ {
+ return std::make_shared(sFileName);
+ }
+
+ static PWrapper loadLibraryFromSymbolLookupMethod(void* pSymbolLookupMethod)
+ {
+ return std::make_shared(pSymbolLookupMethod);
+ }
+
+ ~CWrapper()
+ {
+ releaseWrapperTable(&m_WrapperTable);
+ }
+
+ inline void CheckError(CBase * pBaseClass, LibMCDriver_OpenCVResult nResult);
+
+ inline void GetVersion(LibMCDriver_OpenCV_uint32 & nMajor, LibMCDriver_OpenCV_uint32 & nMinor, LibMCDriver_OpenCV_uint32 & nMicro);
+ inline bool GetLastError(classParam pInstance, std::string & sErrorMessage);
+ inline void ReleaseInstance(classParam pInstance);
+ inline void AcquireInstance(classParam pInstance);
+ inline void InjectComponent(const std::string & sNameSpace, const LibMCDriver_OpenCV_pvoid pSymbolAddressMethod);
+ inline LibMCDriver_OpenCV_pvoid GetSymbolLookupMethod();
+ inline PDriver CreateDriver(const std::string & sName, const std::string & sType, classParam pDriverEnvironment);
+
+private:
+ sLibMCDriver_OpenCVDynamicWrapperTable m_WrapperTable;
+ // Injected Components
+ LibMCEnv::PWrapper m_pLibMCEnvWrapper;
+
+
+ LibMCDriver_OpenCVResult checkBinaryVersion()
+ {
+ LibMCDriver_OpenCV_uint32 nMajor, nMinor, nMicro;
+ GetVersion(nMajor, nMinor, nMicro);
+ if (nMajor != LIBMCDRIVER_OPENCV_VERSION_MAJOR) {
+ return LIBMCDRIVER_OPENCV_ERROR_INCOMPATIBLEBINARYVERSION;
+ }
+ return LIBMCDRIVER_OPENCV_SUCCESS;
+ }
+ LibMCDriver_OpenCVResult initWrapperTable(sLibMCDriver_OpenCVDynamicWrapperTable * pWrapperTable);
+ LibMCDriver_OpenCVResult releaseWrapperTable(sLibMCDriver_OpenCVDynamicWrapperTable * pWrapperTable);
+ LibMCDriver_OpenCVResult loadWrapperTable(sLibMCDriver_OpenCVDynamicWrapperTable * pWrapperTable, const char * pLibraryFileName);
+ LibMCDriver_OpenCVResult loadWrapperTableFromSymbolLookupMethod(sLibMCDriver_OpenCVDynamicWrapperTable * pWrapperTable, void* pSymbolLookupMethod);
+
+ friend class CBase;
+ friend class CDriver;
+ friend class CImageSaveParameters;
+ friend class CImageBuffer;
+ friend class CMat;
+ friend class CDriver_OpenCV;
+
+};
+
+
+/*************************************************************************************************************************
+ Class CBase
+**************************************************************************************************************************/
+class CBase {
+public:
+
+protected:
+ /* Wrapper Object that created the class. */
+ CWrapper * m_pWrapper;
+ /* Handle to Instance in library*/
+ LibMCDriver_OpenCVHandle m_pHandle;
+
+ /* Checks for an Error code and raises Exceptions */
+ void CheckError(LibMCDriver_OpenCVResult nResult)
+ {
+ if (m_pWrapper != nullptr)
+ m_pWrapper->CheckError(this, nResult);
+ }
+public:
+ /**
+ * CBase::CBase - Constructor for Base class.
+ */
+ CBase(CWrapper * pWrapper, LibMCDriver_OpenCVHandle pHandle)
+ : m_pWrapper(pWrapper), m_pHandle(pHandle)
+ {
+ }
+
+ /**
+ * CBase::~CBase - Destructor for Base class.
+ */
+ virtual ~CBase()
+ {
+ if (m_pWrapper != nullptr)
+ m_pWrapper->ReleaseInstance(this);
+ m_pWrapper = nullptr;
+ }
+
+ /**
+ * CBase::handle - Returns handle to instance.
+ */
+ LibMCDriver_OpenCVHandle handle() const
+ {
+ return m_pHandle;
+ }
+
+ /**
+ * CBase::wrapper - Returns wrapper instance.
+ */
+ CWrapper * wrapper() const
+ {
+ return m_pWrapper;
+ }
+
+ friend class CWrapper;
+};
+
+/*************************************************************************************************************************
+ Class CDriver
+**************************************************************************************************************************/
+class CDriver : public CBase {
+public:
+
+ /**
+ * CDriver::CDriver - Constructor for Driver class.
+ */
+ CDriver(CWrapper* pWrapper, LibMCDriver_OpenCVHandle pHandle)
+ : CBase(pWrapper, pHandle)
+ {
+ }
+
+ inline void Configure(const std::string & sConfigurationString);
+ inline std::string GetName();
+ inline std::string GetType();
+ inline void GetVersion(LibMCDriver_OpenCV_uint32 & nMajor, LibMCDriver_OpenCV_uint32 & nMinor, LibMCDriver_OpenCV_uint32 & nMicro, std::string & sBuild);
+ inline void QueryParameters();
+ inline void QueryParametersEx(classParam pDriverUpdateInstance);
+};
+
+/*************************************************************************************************************************
+ Class CImageSaveParameters
+**************************************************************************************************************************/
+class CImageSaveParameters : public CBase {
+public:
+
+ /**
+ * CImageSaveParameters::CImageSaveParameters - Constructor for ImageSaveParameters class.
+ */
+ CImageSaveParameters(CWrapper* pWrapper, LibMCDriver_OpenCVHandle pHandle)
+ : CBase(pWrapper, pHandle)
+ {
+ }
+
+};
+
+/*************************************************************************************************************************
+ Class CImageBuffer
+**************************************************************************************************************************/
+class CImageBuffer : public CBase {
+public:
+
+ /**
+ * CImageBuffer::CImageBuffer - Constructor for ImageBuffer class.
+ */
+ CImageBuffer(CWrapper* pWrapper, LibMCDriver_OpenCVHandle pHandle)
+ : CBase(pWrapper, pHandle)
+ {
+ }
+
+ inline eImageWriteFormat GetImageFormat();
+ inline LibMCDriver_OpenCV_uint64 GetSize();
+ inline void GetData(std::vector & MemoryArrayBuffer);
+ inline void StoreToStream(classParam pStream);
+};
+
+/*************************************************************************************************************************
+ Class CMat
+**************************************************************************************************************************/
+class CMat : public CBase {
+public:
+
+ /**
+ * CMat::CMat - Constructor for Mat class.
+ */
+ CMat(CWrapper* pWrapper, LibMCDriver_OpenCVHandle pHandle)
+ : CBase(pWrapper, pHandle)
+ {
+ }
+
+ inline bool Empty();
+ inline LibMCDriver_OpenCV_uint32 Cols();
+ inline LibMCDriver_OpenCV_uint32 Rows();
+ inline PImageBuffer EncodeImage(const eImageWriteFormat eWriteFormat, classParam pSaveParameters);
+ inline void EncodeImageToStream(const eImageWriteFormat eWriteFormat, classParam pSaveParameters, classParam pStream);
+};
+
+/*************************************************************************************************************************
+ Class CDriver_OpenCV
+**************************************************************************************************************************/
+class CDriver_OpenCV : public CDriver {
+public:
+
+ /**
+ * CDriver_OpenCV::CDriver_OpenCV - Constructor for Driver_OpenCV class.
+ */
+ CDriver_OpenCV(CWrapper* pWrapper, LibMCDriver_OpenCVHandle pHandle)
+ : CDriver(pWrapper, pHandle)
+ {
+ }
+
+ inline PMat LoadImageFromBuffer(const CInputVector & BufferBuffer, const eImageReadFormat eReadFormat);
+ inline PMat LoadImageFromResource(const std::string & sResourceIdentifier, const eImageReadFormat eReadFormat);
+ inline PMat CreateEmptyImage(const LibMCDriver_OpenCV_uint32 nColumnCount, const LibMCDriver_OpenCV_uint32 nRowCount, const eImageReadFormat eReadFormat);
+};
+
+ /**
+ * CWrapper::GetVersion - retrieves the binary version of this library.
+ * @param[out] nMajor - returns the major version of this library
+ * @param[out] nMinor - returns the minor version of this library
+ * @param[out] nMicro - returns the micro version of this library
+ */
+ inline void CWrapper::GetVersion(LibMCDriver_OpenCV_uint32 & nMajor, LibMCDriver_OpenCV_uint32 & nMinor, LibMCDriver_OpenCV_uint32 & nMicro)
+ {
+ CheckError(nullptr,m_WrapperTable.m_GetVersion(&nMajor, &nMinor, &nMicro));
+ }
+
+ /**
+ * CWrapper::GetLastError - Returns the last error recorded on this object
+ * @param[in] pInstance - Instance Handle
+ * @param[out] sErrorMessage - Message of the last error
+ * @return Is there a last error to query
+ */
+ inline bool CWrapper::GetLastError(classParam pInstance, std::string & sErrorMessage)
+ {
+ LibMCDriver_OpenCVHandle hInstance = pInstance.GetHandle();
+ LibMCDriver_OpenCV_uint32 bytesNeededErrorMessage = 0;
+ LibMCDriver_OpenCV_uint32 bytesWrittenErrorMessage = 0;
+ bool resultHasError = 0;
+ CheckError(nullptr,m_WrapperTable.m_GetLastError(hInstance, 0, &bytesNeededErrorMessage, nullptr, &resultHasError));
+ std::vector bufferErrorMessage(bytesNeededErrorMessage);
+ CheckError(nullptr,m_WrapperTable.m_GetLastError(hInstance, bytesNeededErrorMessage, &bytesWrittenErrorMessage, &bufferErrorMessage[0], &resultHasError));
+ sErrorMessage = std::string(&bufferErrorMessage[0]);
+
+ return resultHasError;
+ }
+
+ /**
+ * CWrapper::ReleaseInstance - Releases shared ownership of an Instance
+ * @param[in] pInstance - Instance Handle
+ */
+ inline void CWrapper::ReleaseInstance(classParam pInstance)
+ {
+ LibMCDriver_OpenCVHandle hInstance = pInstance.GetHandle();
+ CheckError(nullptr,m_WrapperTable.m_ReleaseInstance(hInstance));
+ }
+
+ /**
+ * CWrapper::AcquireInstance - Acquires shared ownership of an Instance
+ * @param[in] pInstance - Instance Handle
+ */
+ inline void CWrapper::AcquireInstance(classParam pInstance)
+ {
+ LibMCDriver_OpenCVHandle hInstance = pInstance.GetHandle();
+ CheckError(nullptr,m_WrapperTable.m_AcquireInstance(hInstance));
+ }
+
+ /**
+ * CWrapper::InjectComponent - Injects an imported component for usage within this component
+ * @param[in] sNameSpace - NameSpace of the injected component
+ * @param[in] pSymbolAddressMethod - Address of the SymbolAddressMethod of the injected component
+ */
+ inline void CWrapper::InjectComponent(const std::string & sNameSpace, const LibMCDriver_OpenCV_pvoid pSymbolAddressMethod)
+ {
+ CheckError(nullptr,m_WrapperTable.m_InjectComponent(sNameSpace.c_str(), pSymbolAddressMethod));
+
+ bool bNameSpaceFound = false;
+ if (sNameSpace == "LibMCEnv") {
+ if (m_pLibMCEnvWrapper != nullptr) {
+ throw ELibMCDriver_OpenCVException(LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY, "Library with namespace " + sNameSpace + " is already registered.");
+ }
+ m_pLibMCEnvWrapper = LibMCEnv::CWrapper::loadLibraryFromSymbolLookupMethod(pSymbolAddressMethod);
+ bNameSpaceFound = true;
+ }
+ if (!bNameSpaceFound)
+ throw ELibMCDriver_OpenCVException(LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY, "Unknown namespace " + sNameSpace);
+ }
+
+ /**
+ * CWrapper::GetSymbolLookupMethod - Returns the address of the SymbolLookupMethod
+ * @return Address of the SymbolAddressMethod
+ */
+ inline LibMCDriver_OpenCV_pvoid CWrapper::GetSymbolLookupMethod()
+ {
+ LibMCDriver_OpenCV_pvoid resultSymbolLookupMethod = 0;
+ CheckError(nullptr,m_WrapperTable.m_GetSymbolLookupMethod(&resultSymbolLookupMethod));
+
+ return resultSymbolLookupMethod;
+ }
+
+ /**
+ * CWrapper::CreateDriver - Creates a driver instance with a specific name.
+ * @param[in] sName - Name of driver to be created.
+ * @param[in] sType - Type of driver to be created.
+ * @param[in] pDriverEnvironment - Environment of this driver.
+ * @return New Driver instance
+ */
+ inline PDriver CWrapper::CreateDriver(const std::string & sName, const std::string & sType, classParam pDriverEnvironment)
+ {
+ LibMCEnvHandle hDriverEnvironment = pDriverEnvironment.GetHandle();
+ LibMCDriver_OpenCVHandle hInstance = nullptr;
+ CheckError(nullptr,m_WrapperTable.m_CreateDriver(sName.c_str(), sType.c_str(), hDriverEnvironment, &hInstance));
+
+ if (hInstance) {
+ return std::make_shared(this, hInstance);
+ } else {
+ return nullptr;
+ }
+ }
+
+ inline void CWrapper::CheckError(CBase * pBaseClass, LibMCDriver_OpenCVResult nResult)
+ {
+ if (nResult != 0) {
+ std::string sErrorMessage;
+ if (pBaseClass != nullptr) {
+ GetLastError(pBaseClass, sErrorMessage);
+ }
+ throw ELibMCDriver_OpenCVException(nResult, sErrorMessage);
+ }
+ }
+
+
+ inline LibMCDriver_OpenCVResult CWrapper::initWrapperTable(sLibMCDriver_OpenCVDynamicWrapperTable * pWrapperTable)
+ {
+ if (pWrapperTable == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM;
+
+ pWrapperTable->m_LibraryHandle = nullptr;
+ pWrapperTable->m_Driver_Configure = nullptr;
+ pWrapperTable->m_Driver_GetName = nullptr;
+ pWrapperTable->m_Driver_GetType = nullptr;
+ pWrapperTable->m_Driver_GetVersion = nullptr;
+ pWrapperTable->m_Driver_QueryParameters = nullptr;
+ pWrapperTable->m_Driver_QueryParametersEx = nullptr;
+ pWrapperTable->m_ImageBuffer_GetImageFormat = nullptr;
+ pWrapperTable->m_ImageBuffer_GetSize = nullptr;
+ pWrapperTable->m_ImageBuffer_GetData = nullptr;
+ pWrapperTable->m_ImageBuffer_StoreToStream = nullptr;
+ pWrapperTable->m_Mat_Empty = nullptr;
+ pWrapperTable->m_Mat_Cols = nullptr;
+ pWrapperTable->m_Mat_Rows = nullptr;
+ pWrapperTable->m_Mat_EncodeImage = nullptr;
+ pWrapperTable->m_Mat_EncodeImageToStream = nullptr;
+ pWrapperTable->m_Driver_OpenCV_LoadImageFromBuffer = nullptr;
+ pWrapperTable->m_Driver_OpenCV_LoadImageFromResource = nullptr;
+ pWrapperTable->m_Driver_OpenCV_CreateEmptyImage = nullptr;
+ pWrapperTable->m_GetVersion = nullptr;
+ pWrapperTable->m_GetLastError = nullptr;
+ pWrapperTable->m_ReleaseInstance = nullptr;
+ pWrapperTable->m_AcquireInstance = nullptr;
+ pWrapperTable->m_InjectComponent = nullptr;
+ pWrapperTable->m_GetSymbolLookupMethod = nullptr;
+ pWrapperTable->m_CreateDriver = nullptr;
+
+ return LIBMCDRIVER_OPENCV_SUCCESS;
+ }
+
+ inline LibMCDriver_OpenCVResult CWrapper::releaseWrapperTable(sLibMCDriver_OpenCVDynamicWrapperTable * pWrapperTable)
+ {
+ if (pWrapperTable == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM;
+
+ if (pWrapperTable->m_LibraryHandle != nullptr) {
+ #ifdef _WIN32
+ HMODULE hModule = (HMODULE) pWrapperTable->m_LibraryHandle;
+ FreeLibrary(hModule);
+ #else // _WIN32
+ dlclose(pWrapperTable->m_LibraryHandle);
+ #endif // _WIN32
+ return initWrapperTable(pWrapperTable);
+ }
+
+ return LIBMCDRIVER_OPENCV_SUCCESS;
+ }
+
+ inline LibMCDriver_OpenCVResult CWrapper::loadWrapperTable(sLibMCDriver_OpenCVDynamicWrapperTable * pWrapperTable, const char * pLibraryFileName)
+ {
+ if (pWrapperTable == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM;
+ if (pLibraryFileName == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM;
+
+ #ifdef _WIN32
+ // Convert filename to UTF16-string
+ int nLength = 0;
+ while ((pLibraryFileName[nLength] != 0) && (nLength < MAX_PATH))
+ nLength++;
+ int nBufferSize = nLength * 2 + 2;
+ std::vector wsLibraryFileName(nBufferSize);
+ int nResult = MultiByteToWideChar(CP_UTF8, 0, pLibraryFileName, nLength, &wsLibraryFileName[0], nBufferSize);
+ if (nResult == 0)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY;
+
+ HMODULE hLibrary = LoadLibraryW(wsLibraryFileName.data());
+ if (hLibrary == 0)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY;
+ #else // _WIN32
+ void* hLibrary = dlopen(pLibraryFileName, RTLD_LAZY);
+ if (hLibrary == 0)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY;
+ dlerror();
+ #endif // _WIN32
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_Configure = (PLibMCDriver_OpenCVDriver_ConfigurePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_configure");
+ #else // _WIN32
+ pWrapperTable->m_Driver_Configure = (PLibMCDriver_OpenCVDriver_ConfigurePtr) dlsym(hLibrary, "libmcdriver_opencv_driver_configure");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_Configure == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_GetName = (PLibMCDriver_OpenCVDriver_GetNamePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_getname");
+ #else // _WIN32
+ pWrapperTable->m_Driver_GetName = (PLibMCDriver_OpenCVDriver_GetNamePtr) dlsym(hLibrary, "libmcdriver_opencv_driver_getname");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_GetName == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_GetType = (PLibMCDriver_OpenCVDriver_GetTypePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_gettype");
+ #else // _WIN32
+ pWrapperTable->m_Driver_GetType = (PLibMCDriver_OpenCVDriver_GetTypePtr) dlsym(hLibrary, "libmcdriver_opencv_driver_gettype");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_GetType == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_GetVersion = (PLibMCDriver_OpenCVDriver_GetVersionPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_getversion");
+ #else // _WIN32
+ pWrapperTable->m_Driver_GetVersion = (PLibMCDriver_OpenCVDriver_GetVersionPtr) dlsym(hLibrary, "libmcdriver_opencv_driver_getversion");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_GetVersion == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_QueryParameters = (PLibMCDriver_OpenCVDriver_QueryParametersPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_queryparameters");
+ #else // _WIN32
+ pWrapperTable->m_Driver_QueryParameters = (PLibMCDriver_OpenCVDriver_QueryParametersPtr) dlsym(hLibrary, "libmcdriver_opencv_driver_queryparameters");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_QueryParameters == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_QueryParametersEx = (PLibMCDriver_OpenCVDriver_QueryParametersExPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_queryparametersex");
+ #else // _WIN32
+ pWrapperTable->m_Driver_QueryParametersEx = (PLibMCDriver_OpenCVDriver_QueryParametersExPtr) dlsym(hLibrary, "libmcdriver_opencv_driver_queryparametersex");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_QueryParametersEx == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_ImageBuffer_GetImageFormat = (PLibMCDriver_OpenCVImageBuffer_GetImageFormatPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_imagebuffer_getimageformat");
+ #else // _WIN32
+ pWrapperTable->m_ImageBuffer_GetImageFormat = (PLibMCDriver_OpenCVImageBuffer_GetImageFormatPtr) dlsym(hLibrary, "libmcdriver_opencv_imagebuffer_getimageformat");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_ImageBuffer_GetImageFormat == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_ImageBuffer_GetSize = (PLibMCDriver_OpenCVImageBuffer_GetSizePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_imagebuffer_getsize");
+ #else // _WIN32
+ pWrapperTable->m_ImageBuffer_GetSize = (PLibMCDriver_OpenCVImageBuffer_GetSizePtr) dlsym(hLibrary, "libmcdriver_opencv_imagebuffer_getsize");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_ImageBuffer_GetSize == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_ImageBuffer_GetData = (PLibMCDriver_OpenCVImageBuffer_GetDataPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_imagebuffer_getdata");
+ #else // _WIN32
+ pWrapperTable->m_ImageBuffer_GetData = (PLibMCDriver_OpenCVImageBuffer_GetDataPtr) dlsym(hLibrary, "libmcdriver_opencv_imagebuffer_getdata");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_ImageBuffer_GetData == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_ImageBuffer_StoreToStream = (PLibMCDriver_OpenCVImageBuffer_StoreToStreamPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_imagebuffer_storetostream");
+ #else // _WIN32
+ pWrapperTable->m_ImageBuffer_StoreToStream = (PLibMCDriver_OpenCVImageBuffer_StoreToStreamPtr) dlsym(hLibrary, "libmcdriver_opencv_imagebuffer_storetostream");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_ImageBuffer_StoreToStream == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Mat_Empty = (PLibMCDriver_OpenCVMat_EmptyPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_mat_empty");
+ #else // _WIN32
+ pWrapperTable->m_Mat_Empty = (PLibMCDriver_OpenCVMat_EmptyPtr) dlsym(hLibrary, "libmcdriver_opencv_mat_empty");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Mat_Empty == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Mat_Cols = (PLibMCDriver_OpenCVMat_ColsPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_mat_cols");
+ #else // _WIN32
+ pWrapperTable->m_Mat_Cols = (PLibMCDriver_OpenCVMat_ColsPtr) dlsym(hLibrary, "libmcdriver_opencv_mat_cols");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Mat_Cols == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Mat_Rows = (PLibMCDriver_OpenCVMat_RowsPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_mat_rows");
+ #else // _WIN32
+ pWrapperTable->m_Mat_Rows = (PLibMCDriver_OpenCVMat_RowsPtr) dlsym(hLibrary, "libmcdriver_opencv_mat_rows");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Mat_Rows == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Mat_EncodeImage = (PLibMCDriver_OpenCVMat_EncodeImagePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_mat_encodeimage");
+ #else // _WIN32
+ pWrapperTable->m_Mat_EncodeImage = (PLibMCDriver_OpenCVMat_EncodeImagePtr) dlsym(hLibrary, "libmcdriver_opencv_mat_encodeimage");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Mat_EncodeImage == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Mat_EncodeImageToStream = (PLibMCDriver_OpenCVMat_EncodeImageToStreamPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_mat_encodeimagetostream");
+ #else // _WIN32
+ pWrapperTable->m_Mat_EncodeImageToStream = (PLibMCDriver_OpenCVMat_EncodeImageToStreamPtr) dlsym(hLibrary, "libmcdriver_opencv_mat_encodeimagetostream");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Mat_EncodeImageToStream == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_OpenCV_LoadImageFromBuffer = (PLibMCDriver_OpenCVDriver_OpenCV_LoadImageFromBufferPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_opencv_loadimagefrombuffer");
+ #else // _WIN32
+ pWrapperTable->m_Driver_OpenCV_LoadImageFromBuffer = (PLibMCDriver_OpenCVDriver_OpenCV_LoadImageFromBufferPtr) dlsym(hLibrary, "libmcdriver_opencv_driver_opencv_loadimagefrombuffer");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_OpenCV_LoadImageFromBuffer == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_OpenCV_LoadImageFromResource = (PLibMCDriver_OpenCVDriver_OpenCV_LoadImageFromResourcePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_opencv_loadimagefromresource");
+ #else // _WIN32
+ pWrapperTable->m_Driver_OpenCV_LoadImageFromResource = (PLibMCDriver_OpenCVDriver_OpenCV_LoadImageFromResourcePtr) dlsym(hLibrary, "libmcdriver_opencv_driver_opencv_loadimagefromresource");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_OpenCV_LoadImageFromResource == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_Driver_OpenCV_CreateEmptyImage = (PLibMCDriver_OpenCVDriver_OpenCV_CreateEmptyImagePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_driver_opencv_createemptyimage");
+ #else // _WIN32
+ pWrapperTable->m_Driver_OpenCV_CreateEmptyImage = (PLibMCDriver_OpenCVDriver_OpenCV_CreateEmptyImagePtr) dlsym(hLibrary, "libmcdriver_opencv_driver_opencv_createemptyimage");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_Driver_OpenCV_CreateEmptyImage == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_GetVersion = (PLibMCDriver_OpenCVGetVersionPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_getversion");
+ #else // _WIN32
+ pWrapperTable->m_GetVersion = (PLibMCDriver_OpenCVGetVersionPtr) dlsym(hLibrary, "libmcdriver_opencv_getversion");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_GetVersion == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_GetLastError = (PLibMCDriver_OpenCVGetLastErrorPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_getlasterror");
+ #else // _WIN32
+ pWrapperTable->m_GetLastError = (PLibMCDriver_OpenCVGetLastErrorPtr) dlsym(hLibrary, "libmcdriver_opencv_getlasterror");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_GetLastError == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_ReleaseInstance = (PLibMCDriver_OpenCVReleaseInstancePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_releaseinstance");
+ #else // _WIN32
+ pWrapperTable->m_ReleaseInstance = (PLibMCDriver_OpenCVReleaseInstancePtr) dlsym(hLibrary, "libmcdriver_opencv_releaseinstance");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_ReleaseInstance == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_AcquireInstance = (PLibMCDriver_OpenCVAcquireInstancePtr) GetProcAddress(hLibrary, "libmcdriver_opencv_acquireinstance");
+ #else // _WIN32
+ pWrapperTable->m_AcquireInstance = (PLibMCDriver_OpenCVAcquireInstancePtr) dlsym(hLibrary, "libmcdriver_opencv_acquireinstance");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_AcquireInstance == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_InjectComponent = (PLibMCDriver_OpenCVInjectComponentPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_injectcomponent");
+ #else // _WIN32
+ pWrapperTable->m_InjectComponent = (PLibMCDriver_OpenCVInjectComponentPtr) dlsym(hLibrary, "libmcdriver_opencv_injectcomponent");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_InjectComponent == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_GetSymbolLookupMethod = (PLibMCDriver_OpenCVGetSymbolLookupMethodPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_getsymbollookupmethod");
+ #else // _WIN32
+ pWrapperTable->m_GetSymbolLookupMethod = (PLibMCDriver_OpenCVGetSymbolLookupMethodPtr) dlsym(hLibrary, "libmcdriver_opencv_getsymbollookupmethod");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_GetSymbolLookupMethod == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ #ifdef _WIN32
+ pWrapperTable->m_CreateDriver = (PLibMCDriver_OpenCVCreateDriverPtr) GetProcAddress(hLibrary, "libmcdriver_opencv_createdriver");
+ #else // _WIN32
+ pWrapperTable->m_CreateDriver = (PLibMCDriver_OpenCVCreateDriverPtr) dlsym(hLibrary, "libmcdriver_opencv_createdriver");
+ dlerror();
+ #endif // _WIN32
+ if (pWrapperTable->m_CreateDriver == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ pWrapperTable->m_LibraryHandle = hLibrary;
+ return LIBMCDRIVER_OPENCV_SUCCESS;
+ }
+
+ inline LibMCDriver_OpenCVResult CWrapper::loadWrapperTableFromSymbolLookupMethod(sLibMCDriver_OpenCVDynamicWrapperTable * pWrapperTable, void* pSymbolLookupMethod)
+{
+ if (pWrapperTable == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM;
+ if (pSymbolLookupMethod == nullptr)
+ return LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM;
+
+ typedef LibMCDriver_OpenCVResult(*SymbolLookupType)(const char*, void**);
+
+ SymbolLookupType pLookup = (SymbolLookupType)pSymbolLookupMethod;
+
+ LibMCDriver_OpenCVResult eLookupError = LIBMCDRIVER_OPENCV_SUCCESS;
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_configure", (void**)&(pWrapperTable->m_Driver_Configure));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_Configure == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_getname", (void**)&(pWrapperTable->m_Driver_GetName));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_GetName == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_gettype", (void**)&(pWrapperTable->m_Driver_GetType));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_GetType == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_getversion", (void**)&(pWrapperTable->m_Driver_GetVersion));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_GetVersion == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_queryparameters", (void**)&(pWrapperTable->m_Driver_QueryParameters));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_QueryParameters == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_queryparametersex", (void**)&(pWrapperTable->m_Driver_QueryParametersEx));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_QueryParametersEx == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_imagebuffer_getimageformat", (void**)&(pWrapperTable->m_ImageBuffer_GetImageFormat));
+ if ( (eLookupError != 0) || (pWrapperTable->m_ImageBuffer_GetImageFormat == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_imagebuffer_getsize", (void**)&(pWrapperTable->m_ImageBuffer_GetSize));
+ if ( (eLookupError != 0) || (pWrapperTable->m_ImageBuffer_GetSize == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_imagebuffer_getdata", (void**)&(pWrapperTable->m_ImageBuffer_GetData));
+ if ( (eLookupError != 0) || (pWrapperTable->m_ImageBuffer_GetData == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_imagebuffer_storetostream", (void**)&(pWrapperTable->m_ImageBuffer_StoreToStream));
+ if ( (eLookupError != 0) || (pWrapperTable->m_ImageBuffer_StoreToStream == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_mat_empty", (void**)&(pWrapperTable->m_Mat_Empty));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Mat_Empty == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_mat_cols", (void**)&(pWrapperTable->m_Mat_Cols));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Mat_Cols == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_mat_rows", (void**)&(pWrapperTable->m_Mat_Rows));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Mat_Rows == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_mat_encodeimage", (void**)&(pWrapperTable->m_Mat_EncodeImage));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Mat_EncodeImage == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_mat_encodeimagetostream", (void**)&(pWrapperTable->m_Mat_EncodeImageToStream));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Mat_EncodeImageToStream == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_opencv_loadimagefrombuffer", (void**)&(pWrapperTable->m_Driver_OpenCV_LoadImageFromBuffer));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_OpenCV_LoadImageFromBuffer == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_opencv_loadimagefromresource", (void**)&(pWrapperTable->m_Driver_OpenCV_LoadImageFromResource));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_OpenCV_LoadImageFromResource == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_driver_opencv_createemptyimage", (void**)&(pWrapperTable->m_Driver_OpenCV_CreateEmptyImage));
+ if ( (eLookupError != 0) || (pWrapperTable->m_Driver_OpenCV_CreateEmptyImage == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_getversion", (void**)&(pWrapperTable->m_GetVersion));
+ if ( (eLookupError != 0) || (pWrapperTable->m_GetVersion == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_getlasterror", (void**)&(pWrapperTable->m_GetLastError));
+ if ( (eLookupError != 0) || (pWrapperTable->m_GetLastError == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_releaseinstance", (void**)&(pWrapperTable->m_ReleaseInstance));
+ if ( (eLookupError != 0) || (pWrapperTable->m_ReleaseInstance == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_acquireinstance", (void**)&(pWrapperTable->m_AcquireInstance));
+ if ( (eLookupError != 0) || (pWrapperTable->m_AcquireInstance == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_injectcomponent", (void**)&(pWrapperTable->m_InjectComponent));
+ if ( (eLookupError != 0) || (pWrapperTable->m_InjectComponent == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_getsymbollookupmethod", (void**)&(pWrapperTable->m_GetSymbolLookupMethod));
+ if ( (eLookupError != 0) || (pWrapperTable->m_GetSymbolLookupMethod == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ eLookupError = (*pLookup)("libmcdriver_opencv_createdriver", (void**)&(pWrapperTable->m_CreateDriver));
+ if ( (eLookupError != 0) || (pWrapperTable->m_CreateDriver == nullptr) )
+ return LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT;
+
+ return LIBMCDRIVER_OPENCV_SUCCESS;
+}
+
+
+
+ /**
+ * Method definitions for class CBase
+ */
+
+ /**
+ * Method definitions for class CDriver
+ */
+
+ /**
+ * CDriver::Configure - Configures a driver with its specific configuration data.
+ * @param[in] sConfigurationString - Configuration data of driver.
+ */
+ void CDriver::Configure(const std::string & sConfigurationString)
+ {
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_Configure(m_pHandle, sConfigurationString.c_str()));
+ }
+
+ /**
+ * CDriver::GetName - returns the name identifier of the driver
+ * @return Name of the driver.
+ */
+ std::string CDriver::GetName()
+ {
+ LibMCDriver_OpenCV_uint32 bytesNeededName = 0;
+ LibMCDriver_OpenCV_uint32 bytesWrittenName = 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_GetName(m_pHandle, 0, &bytesNeededName, nullptr));
+ std::vector bufferName(bytesNeededName);
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]));
+
+ return std::string(&bufferName[0]);
+ }
+
+ /**
+ * CDriver::GetType - returns the type identifier of the driver
+ * @return Type of the driver.
+ */
+ std::string CDriver::GetType()
+ {
+ LibMCDriver_OpenCV_uint32 bytesNeededType = 0;
+ LibMCDriver_OpenCV_uint32 bytesWrittenType = 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_GetType(m_pHandle, 0, &bytesNeededType, nullptr));
+ std::vector bufferType(bytesNeededType);
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_GetType(m_pHandle, bytesNeededType, &bytesWrittenType, &bufferType[0]));
+
+ return std::string(&bufferType[0]);
+ }
+
+ /**
+ * CDriver::GetVersion - returns the version identifiers of the driver
+ * @param[out] nMajor - Major version.
+ * @param[out] nMinor - Minor version.
+ * @param[out] nMicro - Micro version.
+ * @param[out] sBuild - Build identifier.
+ */
+ void CDriver::GetVersion(LibMCDriver_OpenCV_uint32 & nMajor, LibMCDriver_OpenCV_uint32 & nMinor, LibMCDriver_OpenCV_uint32 & nMicro, std::string & sBuild)
+ {
+ LibMCDriver_OpenCV_uint32 bytesNeededBuild = 0;
+ LibMCDriver_OpenCV_uint32 bytesWrittenBuild = 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_GetVersion(m_pHandle, &nMajor, &nMinor, &nMicro, 0, &bytesNeededBuild, nullptr));
+ std::vector bufferBuild(bytesNeededBuild);
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_GetVersion(m_pHandle, &nMajor, &nMinor, &nMicro, bytesNeededBuild, &bytesWrittenBuild, &bufferBuild[0]));
+ sBuild = std::string(&bufferBuild[0]);
+ }
+
+ /**
+ * CDriver::QueryParameters - Updates the driver parameters in the driver environment. Should only be called in the driver thread.
+ */
+ void CDriver::QueryParameters()
+ {
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_QueryParameters(m_pHandle));
+ }
+
+ /**
+ * CDriver::QueryParametersEx - Updates the driver parameters in the driver environment. Might be called out of thread. Implementation MUST be able to handle parallel calls.
+ * @param[in] pDriverUpdateInstance - Status update instance.
+ */
+ void CDriver::QueryParametersEx(classParam pDriverUpdateInstance)
+ {
+ LibMCEnvHandle hDriverUpdateInstance = pDriverUpdateInstance.GetHandle();
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_QueryParametersEx(m_pHandle, hDriverUpdateInstance));
+ }
+
+ /**
+ * Method definitions for class CImageSaveParameters
+ */
+
+ /**
+ * Method definitions for class CImageBuffer
+ */
+
+ /**
+ * CImageBuffer::GetImageFormat - Retrieves the image format of the encoded buffer.
+ * @return Format to write to.
+ */
+ eImageWriteFormat CImageBuffer::GetImageFormat()
+ {
+ eImageWriteFormat resultImageFormat = (eImageWriteFormat) 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_ImageBuffer_GetImageFormat(m_pHandle, &resultImageFormat));
+
+ return resultImageFormat;
+ }
+
+ /**
+ * CImageBuffer::GetSize - Retrieves the size of the encoded buffer.
+ * @return Size of the buffer.
+ */
+ LibMCDriver_OpenCV_uint64 CImageBuffer::GetSize()
+ {
+ LibMCDriver_OpenCV_uint64 resultBufferSize = 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_ImageBuffer_GetSize(m_pHandle, &resultBufferSize));
+
+ return resultBufferSize;
+ }
+
+ /**
+ * CImageBuffer::GetData - Retrieves the data of the encoded buffer.
+ * @param[out] MemoryArrayBuffer - Array to write into.
+ */
+ void CImageBuffer::GetData(std::vector & MemoryArrayBuffer)
+ {
+ LibMCDriver_OpenCV_uint64 elementsNeededMemoryArray = 0;
+ LibMCDriver_OpenCV_uint64 elementsWrittenMemoryArray = 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_ImageBuffer_GetData(m_pHandle, 0, &elementsNeededMemoryArray, nullptr));
+ MemoryArrayBuffer.resize((size_t) elementsNeededMemoryArray);
+ CheckError(m_pWrapper->m_WrapperTable.m_ImageBuffer_GetData(m_pHandle, elementsNeededMemoryArray, &elementsWrittenMemoryArray, MemoryArrayBuffer.data()));
+ }
+
+ /**
+ * CImageBuffer::StoreToStream - Stores the data in a temporary file stream.
+ * @param[in] pStream - Stream to store the data to.
+ */
+ void CImageBuffer::StoreToStream(classParam pStream)
+ {
+ LibMCEnvHandle hStream = pStream.GetHandle();
+ CheckError(m_pWrapper->m_WrapperTable.m_ImageBuffer_StoreToStream(m_pHandle, hStream));
+ }
+
+ /**
+ * Method definitions for class CMat
+ */
+
+ /**
+ * CMat::Empty - Returns if the Mat instance is empty.
+ * @return Returns true if the Mat instance is empty. False otherwise.
+ */
+ bool CMat::Empty()
+ {
+ bool resultIsEmpty = 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_Mat_Empty(m_pHandle, &resultIsEmpty));
+
+ return resultIsEmpty;
+ }
+
+ /**
+ * CMat::Cols - Returns the number of columns.
+ * @return Returns the number of columns of the matrix.
+ */
+ LibMCDriver_OpenCV_uint32 CMat::Cols()
+ {
+ LibMCDriver_OpenCV_uint32 resultNumberOfColumns = 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_Mat_Cols(m_pHandle, &resultNumberOfColumns));
+
+ return resultNumberOfColumns;
+ }
+
+ /**
+ * CMat::Rows - Returns the number of rows.
+ * @return Returns the number of rows of the matrix.
+ */
+ LibMCDriver_OpenCV_uint32 CMat::Rows()
+ {
+ LibMCDriver_OpenCV_uint32 resultNumberOfRows = 0;
+ CheckError(m_pWrapper->m_WrapperTable.m_Mat_Rows(m_pHandle, &resultNumberOfRows));
+
+ return resultNumberOfRows;
+ }
+
+ /**
+ * CMat::EncodeImage - Writes a matrix as image buffer.
+ * @param[in] eWriteFormat - Format to write to.
+ * @param[in] pSaveParameters - Optional parameters for writing the image file.
+ * @return Returns an image buffer object.
+ */
+ PImageBuffer CMat::EncodeImage(const eImageWriteFormat eWriteFormat, classParam pSaveParameters)
+ {
+ LibMCDriver_OpenCVHandle hSaveParameters = pSaveParameters.GetHandle();
+ LibMCDriver_OpenCVHandle hOutputBuffer = nullptr;
+ CheckError(m_pWrapper->m_WrapperTable.m_Mat_EncodeImage(m_pHandle, eWriteFormat, hSaveParameters, &hOutputBuffer));
+
+ if (!hOutputBuffer) {
+ CheckError(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+ }
+ return std::make_shared(m_pWrapper, hOutputBuffer);
+ }
+
+ /**
+ * CMat::EncodeImageToStream - Writes a matrix into a temporary file stream.
+ * @param[in] eWriteFormat - Format to write to.
+ * @param[in] pSaveParameters - Optional parameters for writing the image file.
+ * @param[in] pStream - Stream to store the data to.
+ */
+ void CMat::EncodeImageToStream(const eImageWriteFormat eWriteFormat, classParam pSaveParameters, classParam pStream)
+ {
+ LibMCDriver_OpenCVHandle hSaveParameters = pSaveParameters.GetHandle();
+ LibMCEnvHandle hStream = pStream.GetHandle();
+ CheckError(m_pWrapper->m_WrapperTable.m_Mat_EncodeImageToStream(m_pHandle, eWriteFormat, hSaveParameters, hStream));
+ }
+
+ /**
+ * Method definitions for class CDriver_OpenCV
+ */
+
+ /**
+ * CDriver_OpenCV::LoadImageFromBuffer - Loads an image from a memory buffer.
+ * @param[in] BufferBuffer - Image data to read from.
+ * @param[in] eReadFormat - Image format to output.
+ * @return Mat instance of the image that has been loaded.
+ */
+ PMat CDriver_OpenCV::LoadImageFromBuffer(const CInputVector & BufferBuffer, const eImageReadFormat eReadFormat)
+ {
+ LibMCDriver_OpenCVHandle hMatInstance = nullptr;
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_OpenCV_LoadImageFromBuffer(m_pHandle, (LibMCDriver_OpenCV_uint64)BufferBuffer.size(), BufferBuffer.data(), eReadFormat, &hMatInstance));
+
+ if (!hMatInstance) {
+ CheckError(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+ }
+ return std::make_shared(m_pWrapper, hMatInstance);
+ }
+
+ /**
+ * CDriver_OpenCV::LoadImageFromResource - Loads an image from a resource identifier.
+ * @param[in] sResourceIdentifier - Image resource to read from.
+ * @param[in] eReadFormat - Image format to output.
+ * @return Mat instance of the image that has been loaded.
+ */
+ PMat CDriver_OpenCV::LoadImageFromResource(const std::string & sResourceIdentifier, const eImageReadFormat eReadFormat)
+ {
+ LibMCDriver_OpenCVHandle hMatInstance = nullptr;
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_OpenCV_LoadImageFromResource(m_pHandle, sResourceIdentifier.c_str(), eReadFormat, &hMatInstance));
+
+ if (!hMatInstance) {
+ CheckError(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+ }
+ return std::make_shared(m_pWrapper, hMatInstance);
+ }
+
+ /**
+ * CDriver_OpenCV::CreateEmptyImage - Creates an empty image.
+ * @param[in] nColumnCount - Number of Column of the new image.
+ * @param[in] nRowCount - Number of Rows of the new image.
+ * @param[in] eReadFormat - Image format to output.
+ * @return Mat instance of the image that has been loaded.
+ */
+ PMat CDriver_OpenCV::CreateEmptyImage(const LibMCDriver_OpenCV_uint32 nColumnCount, const LibMCDriver_OpenCV_uint32 nRowCount, const eImageReadFormat eReadFormat)
+ {
+ LibMCDriver_OpenCVHandle hMatInstance = nullptr;
+ CheckError(m_pWrapper->m_WrapperTable.m_Driver_OpenCV_CreateEmptyImage(m_pHandle, nColumnCount, nRowCount, eReadFormat, &hMatInstance));
+
+ if (!hMatInstance) {
+ CheckError(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+ }
+ return std::make_shared(m_pWrapper, hMatInstance);
+ }
+
+} // namespace LibMCDriver_OpenCV
+
+#endif // __LIBMCDRIVER_OPENCV_CPPHEADER_DYNAMIC_CPP
+
diff --git a/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_types.hpp b/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_types.hpp
new file mode 100644
index 00000000..188aacd2
--- /dev/null
+++ b/Drivers/OpenCV/Headers/CppDynamic/libmcdriver_opencv_types.hpp
@@ -0,0 +1,175 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++-Header file with basic types in
+order to allow an easy use of MC Driver for OpenCV Computer Vision Library
+
+Interface version: 2.0.0
+
+*/
+
+#ifndef __LIBMCDRIVER_OPENCV_TYPES_HEADER_CPP
+#define __LIBMCDRIVER_OPENCV_TYPES_HEADER_CPP
+
+
+/*************************************************************************************************************************
+ Scalar types definition
+**************************************************************************************************************************/
+
+#ifdef LIBMCDRIVER_OPENCV_USELEGACYINTEGERTYPES
+
+typedef unsigned char LibMCDriver_OpenCV_uint8;
+typedef unsigned short LibMCDriver_OpenCV_uint16 ;
+typedef unsigned int LibMCDriver_OpenCV_uint32;
+typedef unsigned long long LibMCDriver_OpenCV_uint64;
+typedef char LibMCDriver_OpenCV_int8;
+typedef short LibMCDriver_OpenCV_int16;
+typedef int LibMCDriver_OpenCV_int32;
+typedef long long LibMCDriver_OpenCV_int64;
+
+#else // LIBMCDRIVER_OPENCV_USELEGACYINTEGERTYPES
+
+#include
+
+typedef uint8_t LibMCDriver_OpenCV_uint8;
+typedef uint16_t LibMCDriver_OpenCV_uint16;
+typedef uint32_t LibMCDriver_OpenCV_uint32;
+typedef uint64_t LibMCDriver_OpenCV_uint64;
+typedef int8_t LibMCDriver_OpenCV_int8;
+typedef int16_t LibMCDriver_OpenCV_int16;
+typedef int32_t LibMCDriver_OpenCV_int32;
+typedef int64_t LibMCDriver_OpenCV_int64 ;
+
+#endif // LIBMCDRIVER_OPENCV_USELEGACYINTEGERTYPES
+
+typedef float LibMCDriver_OpenCV_single;
+typedef double LibMCDriver_OpenCV_double;
+
+/*************************************************************************************************************************
+ General type definitions
+**************************************************************************************************************************/
+
+typedef LibMCDriver_OpenCV_int32 LibMCDriver_OpenCVResult;
+typedef void * LibMCDriver_OpenCVHandle;
+typedef void * LibMCDriver_OpenCV_pvoid;
+
+/*************************************************************************************************************************
+ Version for LibMCDriver_OpenCV
+**************************************************************************************************************************/
+
+#define LIBMCDRIVER_OPENCV_VERSION_MAJOR 2
+#define LIBMCDRIVER_OPENCV_VERSION_MINOR 0
+#define LIBMCDRIVER_OPENCV_VERSION_MICRO 0
+#define LIBMCDRIVER_OPENCV_VERSION_PRERELEASEINFO ""
+#define LIBMCDRIVER_OPENCV_VERSION_BUILDINFO ""
+
+/*************************************************************************************************************************
+ Error constants for LibMCDriver_OpenCV
+**************************************************************************************************************************/
+
+#define LIBMCDRIVER_OPENCV_SUCCESS 0
+#define LIBMCDRIVER_OPENCV_ERROR_NOTIMPLEMENTED 1 /** functionality not implemented */
+#define LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM 2 /** an invalid parameter was passed */
+#define LIBMCDRIVER_OPENCV_ERROR_INVALIDCAST 3 /** a type cast failed */
+#define LIBMCDRIVER_OPENCV_ERROR_BUFFERTOOSMALL 4 /** a provided buffer is too small */
+#define LIBMCDRIVER_OPENCV_ERROR_GENERICEXCEPTION 5 /** a generic exception occurred */
+#define LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY 6 /** the library could not be loaded */
+#define LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT 7 /** a required exported symbol could not be found in the library */
+#define LIBMCDRIVER_OPENCV_ERROR_INCOMPATIBLEBINARYVERSION 8 /** the version of the binary interface does not match the bindings interface */
+#define LIBMCDRIVER_OPENCV_ERROR_UNKNOWNIMAGEWRITEFORMAT 9 /** unknown image write format */
+#define LIBMCDRIVER_OPENCV_ERROR_COULDNOTWRITEIMAGETODISK 10 /** could not write image to disk */
+#define LIBMCDRIVER_OPENCV_ERROR_EMPTYFILENAME 11 /** empty file name */
+#define LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTFILENAME 12 /** could not convert filename */
+#define LIBMCDRIVER_OPENCV_ERROR_COULDNOTGETSHORTPATHNAME 13 /** could not get short path name */
+#define LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTSHORTFILENAME 14 /** could not convert short path name */
+
+/*************************************************************************************************************************
+ Error strings for LibMCDriver_OpenCV
+**************************************************************************************************************************/
+
+inline const char * LIBMCDRIVER_OPENCV_GETERRORSTRING (LibMCDriver_OpenCVResult nErrorCode) {
+ switch (nErrorCode) {
+ case LIBMCDRIVER_OPENCV_SUCCESS: return "no error";
+ case LIBMCDRIVER_OPENCV_ERROR_NOTIMPLEMENTED: return "functionality not implemented";
+ case LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM: return "an invalid parameter was passed";
+ case LIBMCDRIVER_OPENCV_ERROR_INVALIDCAST: return "a type cast failed";
+ case LIBMCDRIVER_OPENCV_ERROR_BUFFERTOOSMALL: return "a provided buffer is too small";
+ case LIBMCDRIVER_OPENCV_ERROR_GENERICEXCEPTION: return "a generic exception occurred";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY: return "the library could not be loaded";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTFINDLIBRARYEXPORT: return "a required exported symbol could not be found in the library";
+ case LIBMCDRIVER_OPENCV_ERROR_INCOMPATIBLEBINARYVERSION: return "the version of the binary interface does not match the bindings interface";
+ case LIBMCDRIVER_OPENCV_ERROR_UNKNOWNIMAGEWRITEFORMAT: return "unknown image write format";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTWRITEIMAGETODISK: return "could not write image to disk";
+ case LIBMCDRIVER_OPENCV_ERROR_EMPTYFILENAME: return "empty file name";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTFILENAME: return "could not convert filename";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTGETSHORTPATHNAME: return "could not get short path name";
+ case LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTSHORTFILENAME: return "could not convert short path name";
+ default: return "unknown error";
+ }
+}
+
+/*************************************************************************************************************************
+ Declaration of handle classes
+**************************************************************************************************************************/
+
+typedef LibMCDriver_OpenCVHandle LibMCDriver_OpenCV_Base;
+typedef LibMCDriver_OpenCVHandle LibMCDriver_OpenCV_Driver;
+typedef LibMCDriver_OpenCVHandle LibMCDriver_OpenCV_ImageSaveParameters;
+typedef LibMCDriver_OpenCVHandle LibMCDriver_OpenCV_ImageBuffer;
+typedef LibMCDriver_OpenCVHandle LibMCDriver_OpenCV_Mat;
+typedef LibMCDriver_OpenCVHandle LibMCDriver_OpenCV_Driver_OpenCV;
+
+namespace LibMCDriver_OpenCV {
+
+ /*************************************************************************************************************************
+ Declaration of enums
+ **************************************************************************************************************************/
+
+ enum class eImageReadFormat : LibMCDriver_OpenCV_int32 {
+ Unknown = 0,
+ GrayScale = 1,
+ BGR = 2,
+ RGB = 3
+ };
+
+ enum class eImageWriteFormat : LibMCDriver_OpenCV_int32 {
+ Unknown = 0,
+ PNG = 1,
+ JPEG = 2
+ };
+
+} // namespace LibMCDriver_OpenCV;
+
+// define legacy C-names for enums, structs and function types
+typedef LibMCDriver_OpenCV::eImageReadFormat eLibMCDriver_OpenCVImageReadFormat;
+typedef LibMCDriver_OpenCV::eImageWriteFormat eLibMCDriver_OpenCVImageWriteFormat;
+
+#endif // __LIBMCDRIVER_OPENCV_TYPES_HEADER_CPP
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv.cpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv.cpp
new file mode 100644
index 00000000..aff075b1
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv.cpp
@@ -0,0 +1,84 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++ implementation file in order to allow easy
+development of MC Driver for OpenCV Computer Vision Library. It needs to be generated only once.
+
+Interface version: 2.0.0
+
+*/
+
+#include "libmcdriver_opencv_abi.hpp"
+#include "libmcdriver_opencv_interfaces.hpp"
+#include "libmcdriver_opencv_interfaceexception.hpp"
+#include "libmcdriver_opencv_driver_opencv.hpp"
+
+using namespace LibMCDriver_OpenCV;
+using namespace LibMCDriver_OpenCV::Impl;
+
+// Injected Components
+LibMCEnv::PWrapper CWrapper::sPLibMCEnvWrapper;
+
+void CWrapper::GetVersion(LibMCDriver_OpenCV_uint32 & nMajor, LibMCDriver_OpenCV_uint32 & nMinor, LibMCDriver_OpenCV_uint32 & nMicro)
+{
+ nMajor = LIBMCDRIVER_OPENCV_VERSION_MAJOR;
+ nMinor = LIBMCDRIVER_OPENCV_VERSION_MINOR;
+ nMicro = LIBMCDRIVER_OPENCV_VERSION_MICRO;
+}
+
+bool CWrapper::GetLastError(IBase* pInstance, std::string & sErrorMessage)
+{
+ if (pInstance) {
+ return pInstance->GetLastErrorMessage (sErrorMessage);
+ } else {
+ return false;
+ }
+}
+
+void CWrapper::ReleaseInstance(IBase* pInstance)
+{
+ IBase::ReleaseBaseClassInterface(pInstance);
+}
+
+void CWrapper::AcquireInstance(IBase* pInstance)
+{
+ IBase::AcquireBaseClassInterface(pInstance);
+}
+
+IDriver * CWrapper::CreateDriver(const std::string & sName, const std::string & sType, LibMCEnv::PDriverEnvironment pDriverEnvironment)
+{
+ if (sType == "opencv")
+ return new CDriver_OpenCV(pDriverEnvironment);
+
+ return nullptr;
+}
+
+
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_base.cpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_base.cpp
new file mode 100644
index 00000000..d057852a
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_base.cpp
@@ -0,0 +1,84 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is a stub class definition of CBase
+
+*/
+
+#include "libmcdriver_opencv_base.hpp"
+#include "libmcdriver_opencv_interfaceexception.hpp"
+
+// Include custom headers here.
+
+
+using namespace LibMCDriver_OpenCV::Impl;
+
+/*************************************************************************************************************************
+ Class definition of CBase
+**************************************************************************************************************************/
+
+bool CBase::GetLastErrorMessage(std::string & sErrorMessage)
+{
+ if (m_pLastError.get() != nullptr) {
+ sErrorMessage = *m_pLastError;
+ return true;
+ } else {
+ sErrorMessage = "";
+ return false;
+ }
+}
+
+void CBase::ClearErrorMessages()
+{
+ m_pLastError.reset();
+}
+
+void CBase::RegisterErrorMessage(const std::string & sErrorMessage)
+{
+ if (m_pLastError.get() == nullptr) {
+ m_pLastError.reset(new std::string());
+ }
+ *m_pLastError = sErrorMessage;
+}
+
+void CBase::IncRefCount()
+{
+ ++m_nReferenceCount;
+}
+
+bool CBase::DecRefCount()
+{
+ m_nReferenceCount--;
+ if (!m_nReferenceCount) {
+ delete this;
+ return true;
+ }
+ return false;
+}
+
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_base.hpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_base.hpp
new file mode 100644
index 00000000..8782fad2
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_base.hpp
@@ -0,0 +1,97 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is the class declaration of CBase
+
+*/
+
+
+#ifndef __LIBMCDRIVER_OPENCV_BASE
+#define __LIBMCDRIVER_OPENCV_BASE
+
+#include "libmcdriver_opencv_interfaces.hpp"
+#include
+#include
+#include
+
+
+// Include custom headers here.
+
+
+namespace LibMCDriver_OpenCV {
+namespace Impl {
+
+
+/*************************************************************************************************************************
+ Class declaration of CBase
+**************************************************************************************************************************/
+
+class CBase : public virtual IBase {
+private:
+
+ std::unique_ptr m_pLastError;
+ uint32_t m_nReferenceCount = 1;
+
+ /**
+ * Put private members here.
+ */
+
+protected:
+
+ /**
+ * Put protected members here.
+ */
+
+public:
+
+ /**
+ * Put additional public members here. They will not be visible in the external API.
+ */
+
+ bool GetLastErrorMessage(std::string & sErrorMessage) override;
+
+ void ClearErrorMessages() override;
+
+ void RegisterErrorMessage(const std::string & sErrorMessage) override;
+
+ void IncRefCount() override;
+
+ bool DecRefCount() override;
+
+
+ /**
+ * Public member functions to implement.
+ */
+
+};
+
+} // namespace Impl
+} // namespace LibMCDriver_OpenCV
+
+#endif // __LIBMCDRIVER_OPENCV_BASE
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver.cpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver.cpp
new file mode 100644
index 00000000..0938f236
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver.cpp
@@ -0,0 +1,46 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is a stub class definition of CDriver
+
+*/
+
+#include "libmcdriver_opencv_driver.hpp"
+#include "libmcdriver_opencv_interfaceexception.hpp"
+
+// Include custom headers here.
+
+
+using namespace LibMCDriver_OpenCV::Impl;
+
+/*************************************************************************************************************************
+ Class definition of CDriver
+**************************************************************************************************************************/
+
+
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver.hpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver.hpp
new file mode 100644
index 00000000..b0907975
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver.hpp
@@ -0,0 +1,74 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is the class declaration of CDriver
+
+*/
+
+
+#ifndef __LIBMCDRIVER_OPENCV_DRIVER
+#define __LIBMCDRIVER_OPENCV_DRIVER
+
+#include "libmcdriver_opencv_interfaces.hpp"
+
+// Parent classes
+#include "libmcdriver_opencv_base.hpp"
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4250)
+#endif
+
+// Include custom headers here.
+
+
+namespace LibMCDriver_OpenCV {
+namespace Impl {
+
+
+/*************************************************************************************************************************
+ Class declaration of CDriver
+**************************************************************************************************************************/
+
+class CDriver : public virtual IDriver, public virtual CBase {
+private:
+
+
+public:
+
+
+
+};
+
+} // namespace Impl
+} // namespace LibMCDriver_OpenCV
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif // __LIBMCDRIVER_OPENCV_DRIVER
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver_opencv.cpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver_opencv.cpp
new file mode 100644
index 00000000..2ef5697f
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver_opencv.cpp
@@ -0,0 +1,220 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is a stub class definition of CDriver_OpenCV
+
+*/
+
+#include "libmcdriver_opencv_driver_opencv.hpp"
+#include "libmcdriver_opencv_interfaceexception.hpp"
+#include "libmcdriver_opencv_mat.hpp"
+
+// Include custom headers here.
+#define __STRINGIZE(x) #x
+#define __STRINGIZE_VALUE_OF(x) __STRINGIZE(x)
+
+using namespace LibMCDriver_OpenCV::Impl;
+
+
+class COpenCV_DLLDirectoryCache {
+private:
+#ifdef _WIN32
+ std::wstring m_sCachedDLLDirectoryW;
+#endif // _WIN32
+
+public:
+ COpenCV_DLLDirectoryCache();
+ virtual ~COpenCV_DLLDirectoryCache();
+
+};
+
+typedef std::shared_ptr POpenCV_DLLDirectoryCache;
+
+
+COpenCV_DLLDirectoryCache::COpenCV_DLLDirectoryCache()
+{
+#ifdef _WIN32
+ std::vector buffer;
+ buffer.resize(MAX_PATH + 1);
+ GetDllDirectoryW(MAX_PATH, buffer.data());
+
+ buffer.at(MAX_PATH) = 0;
+ m_sCachedDLLDirectoryW = std::wstring(buffer.data());
+#endif // _WIN32
+}
+
+COpenCV_DLLDirectoryCache::~COpenCV_DLLDirectoryCache()
+{
+#ifdef _WIN32
+ if (!m_sCachedDLLDirectoryW.empty()) {
+ SetDllDirectoryW(m_sCachedDLLDirectoryW.c_str());
+ }
+#endif // _WIN32
+}
+
+/*************************************************************************************************************************
+ Class definition of CDriver_OpenCV
+**************************************************************************************************************************/
+
+CDriver_OpenCV::CDriver_OpenCV(LibMCEnv::PDriverEnvironment pDriverEnvironment)
+ : m_pDriverEnvironment (pDriverEnvironment)
+{
+ if (pDriverEnvironment.get() == nullptr)
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+
+
+
+}
+
+CDriver_OpenCV::~CDriver_OpenCV()
+{
+ releaseOpenCV();
+}
+
+void CDriver_OpenCV::initOpenCV()
+{
+ if (m_pOpenCVContext.get() == nullptr) {
+
+ try {
+
+
+ m_pWorkingDirectory = m_pDriverEnvironment->CreateWorkingDirectory();
+ m_pLibOpenCVDLL = m_pWorkingDirectory->StoreDriverData("libopencv_x64.dll", "libopencv_x64");
+ m_pOpenCVWorldDLL = m_pWorkingDirectory->StoreDriverData("opencv_world4110.dll", "opencv_world4110");
+ m_pOpenCVMSMFDLL = m_pWorkingDirectory->StoreDriverData("opencv_videoio_msmf4110_64.dll", "opencv_videoio_msmf4110_64");
+ m_pOpenCVFFMPEGDLL = m_pWorkingDirectory->StoreDriverData("opencv_videoio_ffmpeg4110_64.dll", "opencv_videoio_ffmpeg4110_64");
+
+ auto pDLLDirectoryCache = std::make_shared();
+
+#ifdef _WIN32
+ std::string sDLLDirectoryUTF8 = m_pWorkingDirectory->GetAbsoluteFilePath();
+
+ int nPathLength = (int)sDLLDirectoryUTF8.length();
+ int nPathBufferSize = nPathLength * 2 + 2;
+ std::vector wsDLLPath(nPathBufferSize);
+ int nPathResult = MultiByteToWideChar(CP_UTF8, 0, sDLLDirectoryUTF8.c_str(), nPathLength, &wsDLLPath[0], nPathBufferSize);
+ if (nPathResult == 0)
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_COULDNOTLOADLIBRARY);
+ SetDllDirectoryW(wsDLLPath.data());
+#endif
+
+ m_pOpenCVWrapper = LibOpenCV::CWrapper::loadLibrary(m_pLibOpenCVDLL->GetAbsoluteFileName());
+ m_pOpenCVContext = m_pOpenCVWrapper->CreateContext();
+
+ }
+ catch (...) {
+
+ releaseOpenCV();
+ throw;
+ }
+ }
+}
+
+void CDriver_OpenCV::releaseOpenCV()
+{
+ m_pOpenCVContext = nullptr;
+ m_pOpenCVWrapper = nullptr;
+
+ m_pOpenCVFFMPEGDLL = nullptr;
+ m_pLibOpenCVDLL = nullptr;
+ m_pOpenCVMSMFDLL = nullptr;
+ m_pOpenCVFFMPEGDLL = nullptr;
+
+ m_pWorkingDirectory = nullptr;
+
+}
+
+
+void CDriver_OpenCV::Configure(const std::string& sConfigurationString)
+{
+}
+
+std::string CDriver_OpenCV::GetName()
+{
+ return "opencv";
+}
+
+std::string CDriver_OpenCV::GetType()
+{
+ return "opencv";
+}
+
+void CDriver_OpenCV::GetVersion(LibMCDriver_OpenCV_uint32& nMajor, LibMCDriver_OpenCV_uint32& nMinor, LibMCDriver_OpenCV_uint32& nMicro, std::string& sBuild)
+{
+ nMajor = LIBMCDRIVER_OPENCV_VERSION_MAJOR;
+ nMinor = LIBMCDRIVER_OPENCV_VERSION_MINOR;
+ nMicro = LIBMCDRIVER_OPENCV_VERSION_MICRO;
+ sBuild = __STRINGIZE_VALUE_OF(__GITHASH);
+}
+
+void CDriver_OpenCV::QueryParameters()
+{
+}
+
+void CDriver_OpenCV::QueryParametersEx(LibMCEnv::PDriverStatusUpdateSession pDriverUpdateInstance)
+{
+}
+
+IMat * CDriver_OpenCV::LoadImageFromBuffer(const LibMCDriver_OpenCV_uint64 nBufferBufferSize, const LibMCDriver_OpenCV_uint8 * pBufferBuffer, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat)
+{
+ initOpenCV();
+
+ auto pImageFile = m_pWorkingDirectory->StoreCustomDataInTempFile("dat", LibMCEnv::CInputVector(pBufferBuffer, nBufferBufferSize));
+ std::string sFileNameToRead = COpenCVUtils::convertUTF8FileNameToOSName(pImageFile->GetAbsoluteFileName());
+
+ auto pImageInstance = m_pOpenCVContext->LoadImageFromFile(sFileNameToRead, (LibOpenCV::eImageReadFormat)eReadFormat);
+ pImageFile = nullptr;
+
+ return new CMat(pImageInstance, m_pWorkingDirectory);
+
+}
+
+IMat * CDriver_OpenCV::LoadImageFromResource(const std::string & sResourceIdentifier, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat)
+{
+ initOpenCV();
+
+ auto pImageFile = m_pWorkingDirectory->StoreMachineResourceDataInTempFile("dat", sResourceIdentifier);
+ std::string sFileNameToRead = COpenCVUtils::convertUTF8FileNameToOSName(pImageFile->GetAbsoluteFileName());
+
+ auto pImageInstance = m_pOpenCVContext->LoadImageFromFile(sFileNameToRead, (LibOpenCV::eImageReadFormat)eReadFormat);
+ pImageFile = nullptr;
+
+ return new CMat(pImageInstance, m_pWorkingDirectory);
+}
+
+IMat* CDriver_OpenCV::CreateEmptyImage(const LibMCDriver_OpenCV_uint32 nColumnCount, const LibMCDriver_OpenCV_uint32 nRowCount, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat)
+{
+ initOpenCV();
+
+ auto pImageInstance = m_pOpenCVContext->CreateEmptyImage (nColumnCount, nRowCount, (LibOpenCV::eImageReadFormat) eReadFormat);
+
+ return new CMat(pImageInstance, m_pWorkingDirectory);
+}
+
+
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver_opencv.hpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver_opencv.hpp
new file mode 100644
index 00000000..01c9bec2
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_driver_opencv.hpp
@@ -0,0 +1,110 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is the class declaration of CDriver_OpenCV
+
+*/
+
+
+#ifndef __LIBMCDRIVER_OPENCV_DRIVER_OPENCV
+#define __LIBMCDRIVER_OPENCV_DRIVER_OPENCV
+
+#include "libmcdriver_opencv_interfaces.hpp"
+#include "libopencv_dynamic.hpp"
+
+// Parent classes
+#include "libmcdriver_opencv_driver.hpp"
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4250)
+#endif
+
+// Include custom headers here.
+
+namespace LibMCDriver_OpenCV {
+namespace Impl {
+
+
+/*************************************************************************************************************************
+ Class declaration of CDriver_OpenCV
+**************************************************************************************************************************/
+
+class CDriver_OpenCV : public virtual IDriver_OpenCV, public virtual CDriver {
+private:
+
+ LibMCEnv::PDriverEnvironment m_pDriverEnvironment;
+ LibMCEnv::PWorkingDirectory m_pWorkingDirectory;
+
+ LibMCEnv::PWorkingFile m_pLibOpenCVDLL;
+ LibMCEnv::PWorkingFile m_pOpenCVWorldDLL;
+ LibMCEnv::PWorkingFile m_pOpenCVMSMFDLL;
+ LibMCEnv::PWorkingFile m_pOpenCVFFMPEGDLL;
+
+ LibOpenCV::PWrapper m_pOpenCVWrapper;
+ LibOpenCV::POpenCVContext m_pOpenCVContext;
+
+ // Initializes OpenCV if it is not initialized already
+ void initOpenCV();
+
+ // Releases all OpenCV DLLs and resources
+ void releaseOpenCV();
+
+public:
+
+ CDriver_OpenCV(LibMCEnv::PDriverEnvironment pDriverEnvironment);
+
+ virtual ~CDriver_OpenCV();
+
+ void Configure(const std::string & sConfigurationString) override;
+
+ std::string GetName() override;
+
+ std::string GetType() override;
+
+ void GetVersion(LibMCDriver_OpenCV_uint32 & nMajor, LibMCDriver_OpenCV_uint32 & nMinor, LibMCDriver_OpenCV_uint32 & nMicro, std::string & sBuild) override;
+
+ void QueryParameters() override;
+
+ void QueryParametersEx(LibMCEnv::PDriverStatusUpdateSession pDriverUpdateInstance) override;
+
+
+ IMat * LoadImageFromBuffer(const LibMCDriver_OpenCV_uint64 nBufferBufferSize, const LibMCDriver_OpenCV_uint8 * pBufferBuffer, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat) override;
+
+ IMat * LoadImageFromResource(const std::string & sResourceIdentifier, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat) override;
+
+ IMat* CreateEmptyImage(const LibMCDriver_OpenCV_uint32 nColumnCount, const LibMCDriver_OpenCV_uint32 nRowCount, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat) override;
+};
+
+} // namespace Impl
+} // namespace LibMCDriver_OpenCV
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif // __LIBMCDRIVER_OPENCV_DRIVER_OPENCV
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagebuffer.cpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagebuffer.cpp
new file mode 100644
index 00000000..86afc0e7
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagebuffer.cpp
@@ -0,0 +1,94 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is a stub class definition of CImageBuffer
+
+*/
+
+#include "libmcdriver_opencv_imagebuffer.hpp"
+#include "libmcdriver_opencv_interfaceexception.hpp"
+
+// Include custom headers here.
+#include
+
+using namespace LibMCDriver_OpenCV::Impl;
+
+/*************************************************************************************************************************
+ Class definition of CImageBuffer
+**************************************************************************************************************************/
+
+CImageBuffer::CImageBuffer(LibMCEnv::PWorkingFile pWorkingFile, LibMCDriver_OpenCV::eImageWriteFormat imageFormat)
+ : m_ImageFormat (imageFormat)
+{
+ if (pWorkingFile.get() == nullptr)
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+
+ //pWorkingFile->RetrieveContent(m_Buffer);
+}
+
+CImageBuffer::~CImageBuffer()
+{
+
+}
+
+
+LibMCDriver_OpenCV::eImageWriteFormat CImageBuffer::GetImageFormat()
+{
+ return m_ImageFormat;
+}
+
+LibMCDriver_OpenCV_uint64 CImageBuffer::GetSize()
+{
+ return m_Buffer.size();
+}
+
+void CImageBuffer::GetData(LibMCDriver_OpenCV_uint64 nMemoryArrayBufferSize, LibMCDriver_OpenCV_uint64* pMemoryArrayNeededCount, LibMCDriver_OpenCV_uint8 * pMemoryArrayBuffer)
+{
+ uint64_t nNeededCount = m_Buffer.size();
+
+ if (pMemoryArrayNeededCount != nullptr)
+ *pMemoryArrayNeededCount = nNeededCount;
+
+ if (pMemoryArrayBuffer != nullptr) {
+ if (nMemoryArrayBufferSize < nNeededCount)
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_BUFFERTOOSMALL);
+
+ memcpy(pMemoryArrayBuffer, m_Buffer.data(), nNeededCount);
+ }
+
+}
+
+void CImageBuffer::StoreToStream(LibMCEnv::PTempStreamWriter pStream)
+{
+ if (pStream.get () == nullptr)
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+
+ pStream->WriteData(m_Buffer);
+}
+
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagebuffer.hpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagebuffer.hpp
new file mode 100644
index 00000000..ea3e61d0
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagebuffer.hpp
@@ -0,0 +1,87 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is the class declaration of CImageBuffer
+
+*/
+
+
+#ifndef __LIBMCDRIVER_OPENCV_IMAGEBUFFER
+#define __LIBMCDRIVER_OPENCV_IMAGEBUFFER
+
+#include "libmcdriver_opencv_interfaces.hpp"
+
+// Parent classes
+#include "libmcdriver_opencv_base.hpp"
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4250)
+#endif
+
+// Include custom headers here.
+
+
+namespace LibMCDriver_OpenCV {
+namespace Impl {
+
+
+/*************************************************************************************************************************
+ Class declaration of CImageBuffer
+**************************************************************************************************************************/
+
+class CImageBuffer : public virtual IImageBuffer, public virtual CBase {
+private:
+
+ LibMCDriver_OpenCV::eImageWriteFormat m_ImageFormat;
+
+ std::vector m_Buffer;
+
+public:
+
+ CImageBuffer(LibMCEnv::PWorkingFile pWorkingFile, LibMCDriver_OpenCV::eImageWriteFormat imageFormat);
+
+ virtual ~CImageBuffer();
+
+ LibMCDriver_OpenCV::eImageWriteFormat GetImageFormat() override;
+
+ LibMCDriver_OpenCV_uint64 GetSize() override;
+
+ void GetData(LibMCDriver_OpenCV_uint64 nMemoryArrayBufferSize, LibMCDriver_OpenCV_uint64* pMemoryArrayNeededCount, LibMCDriver_OpenCV_uint8 * pMemoryArrayBuffer) override;
+
+ void StoreToStream(LibMCEnv::PTempStreamWriter pStream) override;
+
+};
+
+} // namespace Impl
+} // namespace LibMCDriver_OpenCV
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif // __LIBMCDRIVER_OPENCV_IMAGEBUFFER
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagesaveparameters.cpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagesaveparameters.cpp
new file mode 100644
index 00000000..0600120a
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagesaveparameters.cpp
@@ -0,0 +1,45 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is a stub class definition of CImageSaveParameters
+
+*/
+
+#include "libmcdriver_opencv_imagesaveparameters.hpp"
+#include "libmcdriver_opencv_interfaceexception.hpp"
+
+// Include custom headers here.
+
+
+using namespace LibMCDriver_OpenCV::Impl;
+
+/*************************************************************************************************************************
+ Class definition of CImageSaveParameters
+**************************************************************************************************************************/
+
diff --git a/Implementation/LibMCEnv/libmcenv_workingfileexecution.hpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagesaveparameters.hpp
similarity index 80%
rename from Implementation/LibMCEnv/libmcenv_workingfileexecution.hpp
rename to Drivers/OpenCV/Implementation/libmcdriver_opencv_imagesaveparameters.hpp
index 210b8d35..3128c2e0 100644
--- a/Implementation/LibMCEnv/libmcenv_workingfileexecution.hpp
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_imagesaveparameters.hpp
@@ -1,6 +1,6 @@
/*++
-Copyright (C) 2020 Autodesk Inc.
+Copyright (C) 2025 Autodesk Inc.
All rights reserved.
@@ -27,18 +27,18 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-Abstract: This is the class declaration of CWorkingFileExecution
+Abstract: This is the class declaration of CImageSaveParameters
*/
-#ifndef __LIBMCENV_WORKINGFILEEXECUTION
-#define __LIBMCENV_WORKINGFILEEXECUTION
+#ifndef __LIBMCDRIVER_OPENCV_IMAGESAVEPARAMETERS
+#define __LIBMCDRIVER_OPENCV_IMAGESAVEPARAMETERS
-#include "libmcenv_interfaces.hpp"
+#include "libmcdriver_opencv_interfaces.hpp"
// Parent classes
-#include "libmcenv_base.hpp"
+#include "libmcdriver_opencv_base.hpp"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4250)
@@ -47,15 +47,15 @@ Abstract: This is the class declaration of CWorkingFileExecution
// Include custom headers here.
-namespace LibMCEnv {
+namespace LibMCDriver_OpenCV {
namespace Impl {
/*************************************************************************************************************************
- Class declaration of CWorkingFileExecution
+ Class declaration of CImageSaveParameters
**************************************************************************************************************************/
-class CWorkingFileExecution : public virtual IWorkingFileExecution, public virtual CBase {
+class CImageSaveParameters : public virtual IImageSaveParameters, public virtual CBase {
private:
/**
@@ -79,16 +79,12 @@ class CWorkingFileExecution : public virtual IWorkingFileExecution, public virtu
* Public member functions to implement.
*/
- void GetStatus() override;
-
- std::string ReturnStdOut() override;
-
};
} // namespace Impl
-} // namespace LibMCEnv
+} // namespace LibMCDriver_OpenCV
#ifdef _MSC_VER
#pragma warning(pop)
#endif
-#endif // __LIBMCENV_WORKINGFILEEXECUTION
+#endif // __LIBMCDRIVER_OPENCV_IMAGESAVEPARAMETERS
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_mat.cpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_mat.cpp
new file mode 100644
index 00000000..0018b5b9
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_mat.cpp
@@ -0,0 +1,155 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is a stub class definition of CMat
+
+*/
+
+#include "libmcdriver_opencv_mat.hpp"
+#include "libmcdriver_opencv_interfaceexception.hpp"
+#include "libmcdriver_opencv_imagebuffer.hpp"
+
+// Include custom headers here.
+
+
+using namespace LibMCDriver_OpenCV::Impl;
+
+
+std::string COpenCVUtils::convertUTF8FileNameToOSName(const std::string& sFileName)
+{
+#ifdef _WIN32
+
+ // Convert filename to UTF16-string
+ int nLength = (int)sFileName.length();
+ if (nLength == 0)
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_EMPTYFILENAME);
+
+ int nBufferSize = nLength * 4 + 4;
+ std::vector wsWideFileName(nBufferSize);
+ int nResultLength = MultiByteToWideChar(CP_UTF8, 0, sFileName.c_str(), nLength, &wsWideFileName[0], nBufferSize);
+ if ((nResultLength == 0) || (nResultLength + 1 >= nBufferSize))
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTFILENAME, sFileName);
+
+ std::vector wsWideShortFileName(nBufferSize);
+
+ DWORD nShortFileNameLength = GetShortPathNameW(wsWideFileName.data(), wsWideShortFileName.data(), nBufferSize);
+ if ((nShortFileNameLength == 0) || (((int64_t)nShortFileNameLength + 1) >= (int64_t)nBufferSize))
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_COULDNOTGETSHORTPATHNAME, sFileName);
+
+ // Add terminating character
+ wsWideShortFileName.at(nShortFileNameLength) = 0;
+
+ std::vector sShortFileName(nBufferSize);
+ nResultLength = WideCharToMultiByte(CP_UTF8, 0, wsWideShortFileName.data(), nShortFileNameLength, sShortFileName.data(), nBufferSize, nullptr, nullptr);
+ if ((nResultLength == 0) || (nResultLength + 1 >= nBufferSize))
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_COULDNOTCONVERTSHORTFILENAME, sFileName);
+
+ // Add terminating character
+ sShortFileName.at(nResultLength) = 0;
+
+ // Return string
+ return std::string (sShortFileName.data ());
+
+#else
+ return sFileName;
+#endif
+}
+
+/*************************************************************************************************************************
+ Class definition of CMat
+**************************************************************************************************************************/
+CMat::CMat(LibOpenCV::PMat pMat, LibMCEnv::PWorkingDirectory pWorkingDirectory)
+ : m_pMat (pMat), m_pWorkingDirectory (pWorkingDirectory)
+{
+ if (pMat.get () == nullptr)
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+ if (pWorkingDirectory.get() == nullptr)
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_INVALIDPARAM);
+
+}
+
+CMat::~CMat()
+{
+
+}
+
+bool CMat::Empty()
+{
+ return m_pMat->Empty();
+}
+
+LibMCDriver_OpenCV_uint32 CMat::Cols()
+{
+ return m_pMat->Cols();
+}
+
+LibMCDriver_OpenCV_uint32 CMat::Rows()
+{
+ return m_pMat->Rows();
+}
+
+IImageBuffer* CMat::EncodeImage(const LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, IImageSaveParameters* pSaveParameters)
+{
+ std::string sExtension;
+ switch (eWriteFormat) {
+ case LibMCDriver_OpenCV::eImageWriteFormat::PNG:
+ sExtension = "png";
+ break;
+ case LibMCDriver_OpenCV::eImageWriteFormat::JPEG:
+ sExtension = "jpg";
+ break;
+ default:
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_UNKNOWNIMAGEWRITEFORMAT, std::to_string ((int64_t)eWriteFormat));
+ }
+
+ auto pWorkingFile = m_pWorkingDirectory->AddManagedTempFile(sExtension);
+
+ std::string sAbsoluteFileNameUTF8 = pWorkingFile->GetAbsoluteFileName();
+
+ std::string sFileNameToWrite = COpenCVUtils::convertUTF8FileNameToOSName ( sAbsoluteFileNameUTF8 );
+
+ m_pMat->WriteToFile(sFileNameToWrite, nullptr);
+
+ if (pWorkingFile->FileExists()) {
+ return new CImageBuffer (pWorkingFile, eWriteFormat);
+
+ }
+ else {
+
+ throw ELibMCDriver_OpenCVInterfaceException(LIBMCDRIVER_OPENCV_ERROR_COULDNOTWRITEIMAGETODISK, sAbsoluteFileNameUTF8);
+ }
+
+
+}
+
+void CMat::EncodeImageToStream(const LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, IImageSaveParameters* pSaveParameters, LibMCEnv::PTempStreamWriter pStream)
+{
+ std::unique_ptr pImageBuffer (EncodeImage (eWriteFormat, pSaveParameters));
+ pImageBuffer->StoreToStream (pStream);
+}
diff --git a/Drivers/OpenCV/Implementation/libmcdriver_opencv_mat.hpp b/Drivers/OpenCV/Implementation/libmcdriver_opencv_mat.hpp
new file mode 100644
index 00000000..d86369c7
--- /dev/null
+++ b/Drivers/OpenCV/Implementation/libmcdriver_opencv_mat.hpp
@@ -0,0 +1,96 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Abstract: This is the class declaration of CMat
+
+*/
+
+
+#ifndef __LIBMCDRIVER_OPENCV_MAT
+#define __LIBMCDRIVER_OPENCV_MAT
+
+#include "libmcdriver_opencv_interfaces.hpp"
+
+// Parent classes
+#include "libmcdriver_opencv_base.hpp"
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4250)
+#endif
+
+// Include custom headers here.
+#include "libopencv_dynamic.hpp"
+
+
+namespace LibMCDriver_OpenCV {
+namespace Impl {
+
+
+/*************************************************************************************************************************
+ Class declaration of CMat
+**************************************************************************************************************************/
+
+class COpenCVUtils {
+
+public:
+ static std::string convertUTF8FileNameToOSName(const std::string& sFileName);
+
+};
+
+class CMat : public virtual IMat, public virtual CBase {
+private:
+
+ LibOpenCV::PMat m_pMat;
+ LibMCEnv::PWorkingDirectory m_pWorkingDirectory;
+
+public:
+
+ CMat(LibOpenCV::PMat pMat, LibMCEnv::PWorkingDirectory pWorkingDirectory);
+
+ virtual ~CMat();
+
+ bool Empty() override;
+
+ LibMCDriver_OpenCV_uint32 Cols() override;
+
+ LibMCDriver_OpenCV_uint32 Rows() override;
+
+ IImageBuffer* EncodeImage(const LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, IImageSaveParameters* pSaveParameters) override;
+
+ void EncodeImageToStream(const LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, IImageSaveParameters* pSaveParameters, LibMCEnv::PTempStreamWriter pStream) override;
+
+};
+
+} // namespace Impl
+} // namespace LibMCDriver_OpenCV
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif // __LIBMCDRIVER_OPENCV_MAT
diff --git a/Drivers/OpenCV/Interfaces/libmcdriver_interfacewrapper.cpp b/Drivers/OpenCV/Interfaces/libmcdriver_interfacewrapper.cpp
new file mode 100644
index 00000000..34d66f49
--- /dev/null
+++ b/Drivers/OpenCV/Interfaces/libmcdriver_interfacewrapper.cpp
@@ -0,0 +1,97 @@
+/*++
+
+Copyright (C) 2020 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*/
+
+
+#include "libmcdriver_abi.hpp"
+#include "libmcdriver_opencv_abi.hpp"
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_driver_configure(LibMCDriver_Driver pDriver, const char* pConfigurationString)
+{
+ return libmcdriver_opencv_driver_configure(pDriver, pConfigurationString);
+}
+
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_driver_getname(LibMCDriver_Driver pDriver, const LibMCDriver_uint32 nNameBufferSize, LibMCDriver_uint32* pNameNeededChars, char * pNameBuffer)
+{
+ return libmcdriver_opencv_driver_getname (pDriver, nNameBufferSize, pNameNeededChars, pNameBuffer);
+}
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_driver_gettype(LibMCDriver_Driver pDriver, const LibMCDriver_uint32 nTypeBufferSize, LibMCDriver_uint32* pTypeNeededChars, char * pTypeBuffer)
+{
+ return libmcdriver_opencv_driver_gettype(pDriver, nTypeBufferSize, pTypeNeededChars, pTypeBuffer);
+}
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_driver_getversion(LibMCDriver_Driver pDriver, LibMCDriver_uint32 * pMajor, LibMCDriver_uint32 * pMinor, LibMCDriver_uint32 * pMicro, const LibMCDriver_uint32 nBuildBufferSize, LibMCDriver_uint32* pBuildNeededChars, char * pBuildBuffer)
+{
+ return libmcdriver_opencv_driver_getversion(pDriver, pMajor, pMinor, pMicro, nBuildBufferSize, pBuildNeededChars, pBuildBuffer);
+}
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_driver_queryparametersex(LibMCDriver_Driver pDriver, LibMCEnv_DriverStatusUpdateSession pDriverUpdateInstance)
+{
+ return libmcdriver_opencv_driver_queryparametersex(pDriver, pDriverUpdateInstance);
+}
+
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_getversion(LibMCDriver_uint32 * pMajor, LibMCDriver_uint32 * pMinor, LibMCDriver_uint32 * pMicro)
+{
+ return libmcdriver_opencv_getversion(pMajor, pMinor, pMicro);
+}
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_getlasterror(LibMCDriver_Base pInstance, const LibMCDriver_uint32 nErrorMessageBufferSize, LibMCDriver_uint32* pErrorMessageNeededChars, char * pErrorMessageBuffer, bool * pHasError)
+{
+ return libmcdriver_opencv_getlasterror(pInstance, nErrorMessageBufferSize, pErrorMessageNeededChars, pErrorMessageBuffer, pHasError);
+}
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_releaseinstance(LibMCDriver_Base pInstance)
+{
+ return libmcdriver_opencv_releaseinstance(pInstance);
+}
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_acquireinstance(LibMCDriver_Base pInstance)
+{
+ return libmcdriver_opencv_acquireinstance(pInstance);
+}
+
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_injectcomponent(const char * pNameSpace, LibMCDriver_pvoid pSymbolAddressMethod)
+{
+ return libmcdriver_opencv_injectcomponent(pNameSpace, pSymbolAddressMethod);
+}
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_createdriver(const char * pName, const char * pType, LibMCEnv_DriverEnvironment pDriverEnvironment, LibMCDriver_Driver * pInstance)
+{
+ return libmcdriver_opencv_createdriver(pName, pType, pDriverEnvironment, pInstance);
+}
+
+
+LIBMCDRIVER_DECLSPEC LibMCDriverResult libmcdriver_getsymbollookupmethod(LibMCDriver_pvoid* pSymbolLookupMethod)
+{
+ return libmcdriver_opencv_getsymbollookupmethod(pSymbolLookupMethod);
+}
diff --git a/Drivers/OpenCV/Interfaces/libmcdriver_opencv_abi.hpp b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_abi.hpp
new file mode 100644
index 00000000..cd44950e
--- /dev/null
+++ b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_abi.hpp
@@ -0,0 +1,343 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++-Header file in order to allow an easy
+ use of MC Driver for OpenCV Computer Vision Library
+
+Interface version: 2.0.0
+
+*/
+
+#ifndef __LIBMCDRIVER_OPENCV_HEADER_CPP
+#define __LIBMCDRIVER_OPENCV_HEADER_CPP
+
+#ifdef __LIBMCDRIVER_OPENCV_EXPORTS
+#ifdef _WIN32
+#define LIBMCDRIVER_OPENCV_DECLSPEC __declspec (dllexport)
+#else // _WIN32
+#define LIBMCDRIVER_OPENCV_DECLSPEC __attribute__((visibility("default")))
+#endif // _WIN32
+#else // __LIBMCDRIVER_OPENCV_EXPORTS
+#define LIBMCDRIVER_OPENCV_DECLSPEC
+#endif // __LIBMCDRIVER_OPENCV_EXPORTS
+
+#include "libmcdriver_opencv_types.hpp"
+
+#include "libmcenv_dynamic.hpp"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*************************************************************************************************************************
+ Class definition for Base
+**************************************************************************************************************************/
+
+/*************************************************************************************************************************
+ Class definition for Driver
+**************************************************************************************************************************/
+
+/**
+* Configures a driver with its specific configuration data.
+*
+* @param[in] pDriver - Driver instance.
+* @param[in] pConfigurationString - Configuration data of driver.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_configure(LibMCDriver_OpenCV_Driver pDriver, const char * pConfigurationString);
+
+/**
+* returns the name identifier of the driver
+*
+* @param[in] pDriver - Driver instance.
+* @param[in] nNameBufferSize - size of the buffer (including trailing 0)
+* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size.
+* @param[out] pNameBuffer - buffer of Name of the driver., may be NULL
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_getname(LibMCDriver_OpenCV_Driver pDriver, const LibMCDriver_OpenCV_uint32 nNameBufferSize, LibMCDriver_OpenCV_uint32* pNameNeededChars, char * pNameBuffer);
+
+/**
+* returns the type identifier of the driver
+*
+* @param[in] pDriver - Driver instance.
+* @param[in] nTypeBufferSize - size of the buffer (including trailing 0)
+* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size.
+* @param[out] pTypeBuffer - buffer of Type of the driver., may be NULL
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_gettype(LibMCDriver_OpenCV_Driver pDriver, const LibMCDriver_OpenCV_uint32 nTypeBufferSize, LibMCDriver_OpenCV_uint32* pTypeNeededChars, char * pTypeBuffer);
+
+/**
+* returns the version identifiers of the driver
+*
+* @param[in] pDriver - Driver instance.
+* @param[out] pMajor - Major version.
+* @param[out] pMinor - Minor version.
+* @param[out] pMicro - Micro version.
+* @param[in] nBuildBufferSize - size of the buffer (including trailing 0)
+* @param[out] pBuildNeededChars - will be filled with the count of the written bytes, or needed buffer size.
+* @param[out] pBuildBuffer - buffer of Build identifier., may be NULL
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_getversion(LibMCDriver_OpenCV_Driver pDriver, LibMCDriver_OpenCV_uint32 * pMajor, LibMCDriver_OpenCV_uint32 * pMinor, LibMCDriver_OpenCV_uint32 * pMicro, const LibMCDriver_OpenCV_uint32 nBuildBufferSize, LibMCDriver_OpenCV_uint32* pBuildNeededChars, char * pBuildBuffer);
+
+/**
+* Updates the driver parameters in the driver environment. Should only be called in the driver thread.
+*
+* @param[in] pDriver - Driver instance.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_queryparameters(LibMCDriver_OpenCV_Driver pDriver);
+
+/**
+* Updates the driver parameters in the driver environment. Might be called out of thread. Implementation MUST be able to handle parallel calls.
+*
+* @param[in] pDriver - Driver instance.
+* @param[in] pDriverUpdateInstance - Status update instance.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_queryparametersex(LibMCDriver_OpenCV_Driver pDriver, LibMCEnv_DriverStatusUpdateSession pDriverUpdateInstance);
+
+/*************************************************************************************************************************
+ Class definition for ImageSaveParameters
+**************************************************************************************************************************/
+
+/*************************************************************************************************************************
+ Class definition for ImageBuffer
+**************************************************************************************************************************/
+
+/**
+* Retrieves the image format of the encoded buffer.
+*
+* @param[in] pImageBuffer - ImageBuffer instance.
+* @param[out] pImageFormat - Format to write to.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_imagebuffer_getimageformat(LibMCDriver_OpenCV_ImageBuffer pImageBuffer, LibMCDriver_OpenCV::eImageWriteFormat * pImageFormat);
+
+/**
+* Retrieves the size of the encoded buffer.
+*
+* @param[in] pImageBuffer - ImageBuffer instance.
+* @param[out] pBufferSize - Size of the buffer.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_imagebuffer_getsize(LibMCDriver_OpenCV_ImageBuffer pImageBuffer, LibMCDriver_OpenCV_uint64 * pBufferSize);
+
+/**
+* Retrieves the data of the encoded buffer.
+*
+* @param[in] pImageBuffer - ImageBuffer instance.
+* @param[in] nMemoryArrayBufferSize - Number of elements in buffer
+* @param[out] pMemoryArrayNeededCount - will be filled with the count of the written elements, or needed buffer size.
+* @param[out] pMemoryArrayBuffer - uint8 buffer of Array to write into.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_imagebuffer_getdata(LibMCDriver_OpenCV_ImageBuffer pImageBuffer, const LibMCDriver_OpenCV_uint64 nMemoryArrayBufferSize, LibMCDriver_OpenCV_uint64* pMemoryArrayNeededCount, LibMCDriver_OpenCV_uint8 * pMemoryArrayBuffer);
+
+/**
+* Stores the data in a temporary file stream.
+*
+* @param[in] pImageBuffer - ImageBuffer instance.
+* @param[in] pStream - Stream to store the data to.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_imagebuffer_storetostream(LibMCDriver_OpenCV_ImageBuffer pImageBuffer, LibMCEnv_TempStreamWriter pStream);
+
+/*************************************************************************************************************************
+ Class definition for Mat
+**************************************************************************************************************************/
+
+/**
+* Returns if the Mat instance is empty.
+*
+* @param[in] pMat - Mat instance.
+* @param[out] pIsEmpty - Returns true if the Mat instance is empty. False otherwise.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_mat_empty(LibMCDriver_OpenCV_Mat pMat, bool * pIsEmpty);
+
+/**
+* Returns the number of columns.
+*
+* @param[in] pMat - Mat instance.
+* @param[out] pNumberOfColumns - Returns the number of columns of the matrix.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_mat_cols(LibMCDriver_OpenCV_Mat pMat, LibMCDriver_OpenCV_uint32 * pNumberOfColumns);
+
+/**
+* Returns the number of rows.
+*
+* @param[in] pMat - Mat instance.
+* @param[out] pNumberOfRows - Returns the number of rows of the matrix.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_mat_rows(LibMCDriver_OpenCV_Mat pMat, LibMCDriver_OpenCV_uint32 * pNumberOfRows);
+
+/**
+* Writes a matrix as image buffer.
+*
+* @param[in] pMat - Mat instance.
+* @param[in] eWriteFormat - Format to write to.
+* @param[in] pSaveParameters - Optional parameters for writing the image file.
+* @param[out] pOutputBuffer - Returns an image buffer object.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_mat_encodeimage(LibMCDriver_OpenCV_Mat pMat, LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, LibMCDriver_OpenCV_ImageSaveParameters pSaveParameters, LibMCDriver_OpenCV_ImageBuffer * pOutputBuffer);
+
+/**
+* Writes a matrix into a temporary file stream.
+*
+* @param[in] pMat - Mat instance.
+* @param[in] eWriteFormat - Format to write to.
+* @param[in] pSaveParameters - Optional parameters for writing the image file.
+* @param[in] pStream - Stream to store the data to.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_mat_encodeimagetostream(LibMCDriver_OpenCV_Mat pMat, LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, LibMCDriver_OpenCV_ImageSaveParameters pSaveParameters, LibMCEnv_TempStreamWriter pStream);
+
+/*************************************************************************************************************************
+ Class definition for Driver_OpenCV
+**************************************************************************************************************************/
+
+/**
+* Loads an image from a memory buffer.
+*
+* @param[in] pDriver_OpenCV - Driver_OpenCV instance.
+* @param[in] nBufferBufferSize - Number of elements in buffer
+* @param[in] pBufferBuffer - uint8 buffer of Image data to read from.
+* @param[in] eReadFormat - Image format to output.
+* @param[out] pMatInstance - Mat instance of the image that has been loaded.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_opencv_loadimagefrombuffer(LibMCDriver_OpenCV_Driver_OpenCV pDriver_OpenCV, LibMCDriver_OpenCV_uint64 nBufferBufferSize, const LibMCDriver_OpenCV_uint8 * pBufferBuffer, LibMCDriver_OpenCV::eImageReadFormat eReadFormat, LibMCDriver_OpenCV_Mat * pMatInstance);
+
+/**
+* Loads an image from a resource identifier.
+*
+* @param[in] pDriver_OpenCV - Driver_OpenCV instance.
+* @param[in] pResourceIdentifier - Image resource to read from.
+* @param[in] eReadFormat - Image format to output.
+* @param[out] pMatInstance - Mat instance of the image that has been loaded.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_opencv_loadimagefromresource(LibMCDriver_OpenCV_Driver_OpenCV pDriver_OpenCV, const char * pResourceIdentifier, LibMCDriver_OpenCV::eImageReadFormat eReadFormat, LibMCDriver_OpenCV_Mat * pMatInstance);
+
+/**
+* Creates an empty image.
+*
+* @param[in] pDriver_OpenCV - Driver_OpenCV instance.
+* @param[in] nColumnCount - Number of Column of the new image.
+* @param[in] nRowCount - Number of Rows of the new image.
+* @param[in] eReadFormat - Image format to output.
+* @param[out] pMatInstance - Mat instance of the image that has been loaded.
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_driver_opencv_createemptyimage(LibMCDriver_OpenCV_Driver_OpenCV pDriver_OpenCV, LibMCDriver_OpenCV_uint32 nColumnCount, LibMCDriver_OpenCV_uint32 nRowCount, LibMCDriver_OpenCV::eImageReadFormat eReadFormat, LibMCDriver_OpenCV_Mat * pMatInstance);
+
+/*************************************************************************************************************************
+ Global functions
+**************************************************************************************************************************/
+
+/**
+* retrieves the binary version of this library.
+*
+* @param[out] pMajor - returns the major version of this library
+* @param[out] pMinor - returns the minor version of this library
+* @param[out] pMicro - returns the micro version of this library
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_getversion(LibMCDriver_OpenCV_uint32 * pMajor, LibMCDriver_OpenCV_uint32 * pMinor, LibMCDriver_OpenCV_uint32 * pMicro);
+
+/**
+* Returns the last error recorded on this object
+*
+* @param[in] pInstance - Instance Handle
+* @param[in] nErrorMessageBufferSize - size of the buffer (including trailing 0)
+* @param[out] pErrorMessageNeededChars - will be filled with the count of the written bytes, or needed buffer size.
+* @param[out] pErrorMessageBuffer - buffer of Message of the last error, may be NULL
+* @param[out] pHasError - Is there a last error to query
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_getlasterror(LibMCDriver_OpenCV_Base pInstance, const LibMCDriver_OpenCV_uint32 nErrorMessageBufferSize, LibMCDriver_OpenCV_uint32* pErrorMessageNeededChars, char * pErrorMessageBuffer, bool * pHasError);
+
+/**
+* Releases shared ownership of an Instance
+*
+* @param[in] pInstance - Instance Handle
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_releaseinstance(LibMCDriver_OpenCV_Base pInstance);
+
+/**
+* Acquires shared ownership of an Instance
+*
+* @param[in] pInstance - Instance Handle
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_acquireinstance(LibMCDriver_OpenCV_Base pInstance);
+
+/**
+* Injects an imported component for usage within this component
+*
+* @param[in] pNameSpace - NameSpace of the injected component
+* @param[in] pSymbolAddressMethod - Address of the SymbolAddressMethod of the injected component
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_injectcomponent(const char * pNameSpace, LibMCDriver_OpenCV_pvoid pSymbolAddressMethod);
+
+/**
+* Returns the address of the SymbolLookupMethod
+*
+* @param[out] pSymbolLookupMethod - Address of the SymbolAddressMethod
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_getsymbollookupmethod(LibMCDriver_OpenCV_pvoid * pSymbolLookupMethod);
+
+/**
+* Creates a driver instance with a specific name.
+*
+* @param[in] pName - Name of driver to be created.
+* @param[in] pType - Type of driver to be created.
+* @param[in] pDriverEnvironment - Environment of this driver.
+* @param[out] pInstance - New Driver instance
+* @return error code or 0 (success)
+*/
+LIBMCDRIVER_OPENCV_DECLSPEC LibMCDriver_OpenCVResult libmcdriver_opencv_createdriver(const char * pName, const char * pType, LibMCEnv_DriverEnvironment pDriverEnvironment, LibMCDriver_OpenCV_Driver * pInstance);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __LIBMCDRIVER_OPENCV_HEADER_CPP
+
diff --git a/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaceexception.cpp b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaceexception.cpp
new file mode 100644
index 00000000..debbebb2
--- /dev/null
+++ b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaceexception.cpp
@@ -0,0 +1,68 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++ Implementation file with the basic internal
+ exception type in order to allow an easy use of MC Driver for OpenCV Computer Vision Library
+
+Interface version: 2.0.0
+
+*/
+
+
+#include
+
+#include "libmcdriver_opencv_interfaceexception.hpp"
+
+/*************************************************************************************************************************
+ Class ELibMCDriver_OpenCVInterfaceException
+**************************************************************************************************************************/
+ELibMCDriver_OpenCVInterfaceException::ELibMCDriver_OpenCVInterfaceException(LibMCDriver_OpenCVResult errorCode)
+ : m_errorMessage(LIBMCDRIVER_OPENCV_GETERRORSTRING (errorCode))
+{
+ m_errorCode = errorCode;
+}
+
+ELibMCDriver_OpenCVInterfaceException::ELibMCDriver_OpenCVInterfaceException(LibMCDriver_OpenCVResult errorCode, std::string errorMessage)
+ : m_errorMessage(errorMessage + " (" + std::to_string (errorCode) + ")")
+{
+ m_errorCode = errorCode;
+}
+
+LibMCDriver_OpenCVResult ELibMCDriver_OpenCVInterfaceException::getErrorCode ()
+{
+ return m_errorCode;
+}
+
+const char * ELibMCDriver_OpenCVInterfaceException::what () const noexcept
+{
+ return m_errorMessage.c_str();
+}
+
diff --git a/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaceexception.hpp b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaceexception.hpp
new file mode 100644
index 00000000..685a44b6
--- /dev/null
+++ b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaceexception.hpp
@@ -0,0 +1,83 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++ Header file with the basic internal
+ exception type in order to allow an easy use of MC Driver for OpenCV Computer Vision Library
+
+Interface version: 2.0.0
+
+*/
+
+#ifndef __LIBMCDRIVER_OPENCV_INTERFACEEXCEPTION_HEADER
+#define __LIBMCDRIVER_OPENCV_INTERFACEEXCEPTION_HEADER
+
+#include
+#include
+#include "libmcdriver_opencv_types.hpp"
+
+/*************************************************************************************************************************
+ Class ELibMCDriver_OpenCVInterfaceException
+**************************************************************************************************************************/
+
+
+class ELibMCDriver_OpenCVInterfaceException : public std::exception {
+protected:
+ /**
+ * Error code for the Exception.
+ */
+ LibMCDriver_OpenCVResult m_errorCode;
+ /**
+ * Error message for the Exception.
+ */
+ std::string m_errorMessage;
+
+public:
+ /**
+ * Exception Constructor.
+ */
+ ELibMCDriver_OpenCVInterfaceException(LibMCDriver_OpenCVResult errorCode);
+
+ /**
+ * Custom Exception Constructor.
+ */
+ ELibMCDriver_OpenCVInterfaceException(LibMCDriver_OpenCVResult errorCode, std::string errorMessage);
+
+ /**
+ * Returns error code
+ */
+ LibMCDriver_OpenCVResult getErrorCode();
+ /**
+ * Returns error message
+ */
+ const char* what() const noexcept override;
+};
+
+#endif // __LIBMCDRIVER_OPENCV_INTERFACEEXCEPTION_HEADER
diff --git a/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaces.hpp b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaces.hpp
new file mode 100644
index 00000000..1120e9f9
--- /dev/null
+++ b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfaces.hpp
@@ -0,0 +1,496 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++ header file in order to allow easy
+development of MC Driver for OpenCV Computer Vision Library. The implementer of MC Driver for OpenCV Computer Vision Library needs to
+derive concrete classes from the abstract classes in this header.
+
+Interface version: 2.0.0
+
+*/
+
+
+#ifndef __LIBMCDRIVER_OPENCV_CPPINTERFACES
+#define __LIBMCDRIVER_OPENCV_CPPINTERFACES
+
+#include
+#include
+
+#include "libmcdriver_opencv_types.hpp"
+
+
+#include "libmcenv_dynamic.hpp"
+
+namespace LibMCDriver_OpenCV {
+namespace Impl {
+
+/**
+ Forward declarations of class interfaces
+*/
+class IBase;
+class IDriver;
+class IImageSaveParameters;
+class IImageBuffer;
+class IMat;
+class IDriver_OpenCV;
+
+
+
+/*************************************************************************************************************************
+ Parameter Cache definitions
+**************************************************************************************************************************/
+
+class ParameterCache {
+ public:
+ virtual ~ParameterCache() {}
+};
+
+template class ParameterCache_1 : public ParameterCache {
+ private:
+ T1 m_param1;
+ public:
+ ParameterCache_1 (const T1 & param1)
+ : m_param1 (param1)
+ {
+ }
+
+ void retrieveData (T1 & param1)
+ {
+ param1 = m_param1;
+ }
+};
+
+template class ParameterCache_2 : public ParameterCache {
+ private:
+ T1 m_param1;
+ T2 m_param2;
+ public:
+ ParameterCache_2 (const T1 & param1, const T2 & param2)
+ : m_param1 (param1), m_param2 (param2)
+ {
+ }
+
+ void retrieveData (T1 & param1, T2 & param2)
+ {
+ param1 = m_param1;
+ param2 = m_param2;
+ }
+};
+
+template class ParameterCache_3 : public ParameterCache {
+ private:
+ T1 m_param1;
+ T2 m_param2;
+ T3 m_param3;
+ public:
+ ParameterCache_3 (const T1 & param1, const T2 & param2, const T3 & param3)
+ : m_param1 (param1), m_param2 (param2), m_param3 (param3)
+ {
+ }
+
+ void retrieveData (T1 & param1, T2 & param2, T3 & param3)
+ {
+ param1 = m_param1;
+ param2 = m_param2;
+ param3 = m_param3;
+ }
+};
+
+template class ParameterCache_4 : public ParameterCache {
+ private:
+ T1 m_param1;
+ T2 m_param2;
+ T3 m_param3;
+ T4 m_param4;
+ public:
+ ParameterCache_4 (const T1 & param1, const T2 & param2, const T3 & param3, const T4 & param4)
+ : m_param1 (param1), m_param2 (param2), m_param3 (param3), m_param4 (param4)
+ {
+ }
+
+ void retrieveData (T1 & param1, T2 & param2, T3 & param3, T4 & param4)
+ {
+ param1 = m_param1;
+ param2 = m_param2;
+ param3 = m_param3;
+ param4 = m_param4;
+ }
+};
+
+
+/*************************************************************************************************************************
+ Class interface for Base
+**************************************************************************************************************************/
+
+class IBase {
+private:
+ std::unique_ptr m_ParameterCache;
+public:
+ /**
+ * IBase::~IBase - virtual destructor of IBase
+ */
+ virtual ~IBase() {};
+
+ /**
+ * IBase::ReleaseBaseClassInterface - Releases ownership of a base class interface. Deletes the reference, if necessary.
+ * @param[in] pIBase - The base class instance to release
+ */
+ static void ReleaseBaseClassInterface(IBase* pIBase)
+ {
+ if (pIBase) {
+ pIBase->DecRefCount();
+ }
+ };
+
+ /**
+ * IBase::AcquireBaseClassInterface - Acquires shared ownership of a base class interface.
+ * @param[in] pIBase - The base class instance to acquire
+ */
+ static void AcquireBaseClassInterface(IBase* pIBase)
+ {
+ if (pIBase) {
+ pIBase->IncRefCount();
+ }
+ };
+
+
+ /**
+ * IBase::GetLastErrorMessage - Returns the last error registered of this class instance
+ * @param[out] sErrorMessage - Message of the last error registered
+ * @return Has an error been registered already
+ */
+ virtual bool GetLastErrorMessage(std::string & sErrorMessage) = 0;
+
+ /**
+ * IBase::ClearErrorMessages - Clears all registered messages of this class instance
+ */
+ virtual void ClearErrorMessages() = 0;
+
+ /**
+ * IBase::RegisterErrorMessage - Registers an error message with this class instance
+ * @param[in] sErrorMessage - Error message to register
+ */
+ virtual void RegisterErrorMessage(const std::string & sErrorMessage) = 0;
+
+ /**
+ * IBase::IncRefCount - Increases the reference count of a class instance
+ */
+ virtual void IncRefCount() = 0;
+
+ /**
+ * IBase::DecRefCount - Decreases the reference count of a class instance and free releases it, if the last reference has been removed
+ * @return Has the object been released
+ */
+ virtual bool DecRefCount() = 0;
+
+ /**
+ * IBase::_setCache - set parameter cache of object
+ */
+ void _setCache(ParameterCache * pCache)
+ {
+ m_ParameterCache.reset(pCache);
+ }
+
+ /**
+ * IBase::_getCache - returns parameter cache of object
+ */
+ ParameterCache* _getCache()
+ {
+ return m_ParameterCache.get();
+ }
+
+};
+
+
+/**
+ Definition of a shared pointer class for IBase
+*/
+template
+class IBaseSharedPtr : public std::shared_ptr
+{
+public:
+ explicit IBaseSharedPtr(T* t = nullptr)
+ : std::shared_ptr(t, IBase::ReleaseBaseClassInterface)
+ {
+ t->IncRefCount();
+ }
+
+ // Reset function, as it also needs to properly set the deleter.
+ void reset(T* t = nullptr)
+ {
+ std::shared_ptr::reset(t, IBase::ReleaseBaseClassInterface);
+ }
+
+ // Get-function that increases the Base class's reference count
+ T* getCoOwningPtr()
+ {
+ T* t = this->get();
+ t->IncRefCount();
+ return t;
+ }
+};
+
+
+typedef IBaseSharedPtr PIBase;
+
+
+/*************************************************************************************************************************
+ Class interface for Driver
+**************************************************************************************************************************/
+
+class IDriver : public virtual IBase {
+public:
+ /**
+ * IDriver::Configure - Configures a driver with its specific configuration data.
+ * @param[in] sConfigurationString - Configuration data of driver.
+ */
+ virtual void Configure(const std::string & sConfigurationString) = 0;
+
+ /**
+ * IDriver::GetName - returns the name identifier of the driver
+ * @return Name of the driver.
+ */
+ virtual std::string GetName() = 0;
+
+ /**
+ * IDriver::GetType - returns the type identifier of the driver
+ * @return Type of the driver.
+ */
+ virtual std::string GetType() = 0;
+
+ /**
+ * IDriver::GetVersion - returns the version identifiers of the driver
+ * @param[out] nMajor - Major version.
+ * @param[out] nMinor - Minor version.
+ * @param[out] nMicro - Micro version.
+ * @param[out] sBuild - Build identifier.
+ */
+ virtual void GetVersion(LibMCDriver_OpenCV_uint32 & nMajor, LibMCDriver_OpenCV_uint32 & nMinor, LibMCDriver_OpenCV_uint32 & nMicro, std::string & sBuild) = 0;
+
+ /**
+ * IDriver::QueryParameters - Updates the driver parameters in the driver environment. Should only be called in the driver thread.
+ */
+ virtual void QueryParameters() = 0;
+
+ /**
+ * IDriver::QueryParametersEx - Updates the driver parameters in the driver environment. Might be called out of thread. Implementation MUST be able to handle parallel calls.
+ * @param[in] pDriverUpdateInstance - Status update instance.
+ */
+ virtual void QueryParametersEx(LibMCEnv::PDriverStatusUpdateSession pDriverUpdateInstance) = 0;
+
+};
+
+typedef IBaseSharedPtr PIDriver;
+
+
+/*************************************************************************************************************************
+ Class interface for ImageSaveParameters
+**************************************************************************************************************************/
+
+class IImageSaveParameters : public virtual IBase {
+public:
+};
+
+typedef IBaseSharedPtr PIImageSaveParameters;
+
+
+/*************************************************************************************************************************
+ Class interface for ImageBuffer
+**************************************************************************************************************************/
+
+class IImageBuffer : public virtual IBase {
+public:
+ /**
+ * IImageBuffer::GetImageFormat - Retrieves the image format of the encoded buffer.
+ * @return Format to write to.
+ */
+ virtual LibMCDriver_OpenCV::eImageWriteFormat GetImageFormat() = 0;
+
+ /**
+ * IImageBuffer::GetSize - Retrieves the size of the encoded buffer.
+ * @return Size of the buffer.
+ */
+ virtual LibMCDriver_OpenCV_uint64 GetSize() = 0;
+
+ /**
+ * IImageBuffer::GetData - Retrieves the data of the encoded buffer.
+ * @param[in] nMemoryArrayBufferSize - Number of elements in buffer
+ * @param[out] pMemoryArrayNeededCount - will be filled with the count of the written structs, or needed buffer size.
+ * @param[out] pMemoryArrayBuffer - uint8 buffer of Array to write into.
+ */
+ virtual void GetData(LibMCDriver_OpenCV_uint64 nMemoryArrayBufferSize, LibMCDriver_OpenCV_uint64* pMemoryArrayNeededCount, LibMCDriver_OpenCV_uint8 * pMemoryArrayBuffer) = 0;
+
+ /**
+ * IImageBuffer::StoreToStream - Stores the data in a temporary file stream.
+ * @param[in] pStream - Stream to store the data to.
+ */
+ virtual void StoreToStream(LibMCEnv::PTempStreamWriter pStream) = 0;
+
+};
+
+typedef IBaseSharedPtr PIImageBuffer;
+
+
+/*************************************************************************************************************************
+ Class interface for Mat
+**************************************************************************************************************************/
+
+class IMat : public virtual IBase {
+public:
+ /**
+ * IMat::Empty - Returns if the Mat instance is empty.
+ * @return Returns true if the Mat instance is empty. False otherwise.
+ */
+ virtual bool Empty() = 0;
+
+ /**
+ * IMat::Cols - Returns the number of columns.
+ * @return Returns the number of columns of the matrix.
+ */
+ virtual LibMCDriver_OpenCV_uint32 Cols() = 0;
+
+ /**
+ * IMat::Rows - Returns the number of rows.
+ * @return Returns the number of rows of the matrix.
+ */
+ virtual LibMCDriver_OpenCV_uint32 Rows() = 0;
+
+ /**
+ * IMat::EncodeImage - Writes a matrix as image buffer.
+ * @param[in] eWriteFormat - Format to write to.
+ * @param[in] pSaveParameters - Optional parameters for writing the image file.
+ * @return Returns an image buffer object.
+ */
+ virtual IImageBuffer * EncodeImage(const LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, IImageSaveParameters* pSaveParameters) = 0;
+
+ /**
+ * IMat::EncodeImageToStream - Writes a matrix into a temporary file stream.
+ * @param[in] eWriteFormat - Format to write to.
+ * @param[in] pSaveParameters - Optional parameters for writing the image file.
+ * @param[in] pStream - Stream to store the data to.
+ */
+ virtual void EncodeImageToStream(const LibMCDriver_OpenCV::eImageWriteFormat eWriteFormat, IImageSaveParameters* pSaveParameters, LibMCEnv::PTempStreamWriter pStream) = 0;
+
+};
+
+typedef IBaseSharedPtr PIMat;
+
+
+/*************************************************************************************************************************
+ Class interface for Driver_OpenCV
+**************************************************************************************************************************/
+
+class IDriver_OpenCV : public virtual IDriver {
+public:
+ /**
+ * IDriver_OpenCV::LoadImageFromBuffer - Loads an image from a memory buffer.
+ * @param[in] nBufferBufferSize - Number of elements in buffer
+ * @param[in] pBufferBuffer - Image data to read from.
+ * @param[in] eReadFormat - Image format to output.
+ * @return Mat instance of the image that has been loaded.
+ */
+ virtual IMat * LoadImageFromBuffer(const LibMCDriver_OpenCV_uint64 nBufferBufferSize, const LibMCDriver_OpenCV_uint8 * pBufferBuffer, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat) = 0;
+
+ /**
+ * IDriver_OpenCV::LoadImageFromResource - Loads an image from a resource identifier.
+ * @param[in] sResourceIdentifier - Image resource to read from.
+ * @param[in] eReadFormat - Image format to output.
+ * @return Mat instance of the image that has been loaded.
+ */
+ virtual IMat * LoadImageFromResource(const std::string & sResourceIdentifier, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat) = 0;
+
+ /**
+ * IDriver_OpenCV::CreateEmptyImage - Creates an empty image.
+ * @param[in] nColumnCount - Number of Column of the new image.
+ * @param[in] nRowCount - Number of Rows of the new image.
+ * @param[in] eReadFormat - Image format to output.
+ * @return Mat instance of the image that has been loaded.
+ */
+ virtual IMat * CreateEmptyImage(const LibMCDriver_OpenCV_uint32 nColumnCount, const LibMCDriver_OpenCV_uint32 nRowCount, const LibMCDriver_OpenCV::eImageReadFormat eReadFormat) = 0;
+
+};
+
+typedef IBaseSharedPtr PIDriver_OpenCV;
+
+
+/*************************************************************************************************************************
+ Global functions declarations
+**************************************************************************************************************************/
+class CWrapper {
+public:
+ // Injected Components
+ static LibMCEnv::PWrapper sPLibMCEnvWrapper;
+
+ /**
+ * Ilibmcdriver_opencv::GetVersion - retrieves the binary version of this library.
+ * @param[out] nMajor - returns the major version of this library
+ * @param[out] nMinor - returns the minor version of this library
+ * @param[out] nMicro - returns the micro version of this library
+ */
+ static void GetVersion(LibMCDriver_OpenCV_uint32 & nMajor, LibMCDriver_OpenCV_uint32 & nMinor, LibMCDriver_OpenCV_uint32 & nMicro);
+
+ /**
+ * Ilibmcdriver_opencv::GetLastError - Returns the last error recorded on this object
+ * @param[in] pInstance - Instance Handle
+ * @param[out] sErrorMessage - Message of the last error
+ * @return Is there a last error to query
+ */
+ static bool GetLastError(IBase* pInstance, std::string & sErrorMessage);
+
+ /**
+ * Ilibmcdriver_opencv::ReleaseInstance - Releases shared ownership of an Instance
+ * @param[in] pInstance - Instance Handle
+ */
+ static void ReleaseInstance(IBase* pInstance);
+
+ /**
+ * Ilibmcdriver_opencv::AcquireInstance - Acquires shared ownership of an Instance
+ * @param[in] pInstance - Instance Handle
+ */
+ static void AcquireInstance(IBase* pInstance);
+
+ /**
+ * Ilibmcdriver_opencv::CreateDriver - Creates a driver instance with a specific name.
+ * @param[in] sName - Name of driver to be created.
+ * @param[in] sType - Type of driver to be created.
+ * @param[in] pDriverEnvironment - Environment of this driver.
+ * @return New Driver instance
+ */
+ static IDriver * CreateDriver(const std::string & sName, const std::string & sType, LibMCEnv::PDriverEnvironment pDriverEnvironment);
+
+};
+
+LibMCDriver_OpenCVResult LibMCDriver_OpenCV_GetProcAddress (const char * pProcName, void ** ppProcAddress);
+
+} // namespace Impl
+} // namespace LibMCDriver_OpenCV
+
+#endif // __LIBMCDRIVER_OPENCV_CPPINTERFACES
diff --git a/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfacewrapper.cpp b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfacewrapper.cpp
new file mode 100644
index 00000000..3600222c
--- /dev/null
+++ b/Drivers/OpenCV/Interfaces/libmcdriver_opencv_interfacewrapper.cpp
@@ -0,0 +1,947 @@
+/*++
+
+Copyright (C) 2025 Autodesk Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Autodesk Inc. nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This file has been generated by the Automatic Component Toolkit (ACT) version 1.8.0-develop.
+
+Abstract: This is an autogenerated C++ implementation file in order to allow easy
+development of MC Driver for OpenCV Computer Vision Library. The functions in this file need to be implemented. It needs to be generated only once.
+
+Interface version: 2.0.0
+
+*/
+
+#include "libmcdriver_opencv_abi.hpp"
+#include "libmcdriver_opencv_interfaces.hpp"
+#include "libmcdriver_opencv_interfaceexception.hpp"
+
+#include