添加项目文件。

This commit is contained in:
CaiXiang
2025-06-09 09:09:25 +08:00
parent 75b909652e
commit 88acb23465
1054 changed files with 615623 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,594 @@
/*************************************************************************
* GLFW 3.3 - www.glfw.org
* A library for OpenGL, window and input
*------------------------------------------------------------------------
* Copyright (c) 2002-2006 Marcus Geelnard
* Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw.org>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*
*************************************************************************/
#ifndef _glfw3_native_h_
#define _glfw3_native_h_
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************
* Doxygen documentation
*************************************************************************/
/*! @file glfw3native.h
* @brief The header of the native access functions.
*
* This is the header file of the native access functions. See @ref native for
* more information.
*/
/*! @defgroup native Native access
* @brief Functions related to accessing native handles.
*
* **By using the native access functions you assert that you know what you're
* doing and how to fix problems caused by using them. If you don't, you
* shouldn't be using them.**
*
* Before the inclusion of @ref glfw3native.h, you may define zero or more
* window system API macro and zero or more context creation API macros.
*
* The chosen backends must match those the library was compiled for. Failure
* to do this will cause a link-time error.
*
* The available window API macros are:
* * `GLFW_EXPOSE_NATIVE_WIN32`
* * `GLFW_EXPOSE_NATIVE_COCOA`
* * `GLFW_EXPOSE_NATIVE_X11`
* * `GLFW_EXPOSE_NATIVE_WAYLAND`
*
* The available context API macros are:
* * `GLFW_EXPOSE_NATIVE_WGL`
* * `GLFW_EXPOSE_NATIVE_NSGL`
* * `GLFW_EXPOSE_NATIVE_GLX`
* * `GLFW_EXPOSE_NATIVE_EGL`
* * `GLFW_EXPOSE_NATIVE_OSMESA`
*
* These macros select which of the native access functions that are declared
* and which platform-specific headers to include. It is then up your (by
* definition platform-specific) code to handle which of these should be
* defined.
*/
/*************************************************************************
* System headers and types
*************************************************************************/
#if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)
// This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
// example to allow applications to correctly declare a GL_KHR_debug callback)
// but windows.h assumes no one will define APIENTRY before it does
#if defined(GLFW_APIENTRY_DEFINED)
#undef APIENTRY
#undef GLFW_APIENTRY_DEFINED
#endif
#include <windows.h>
#elif defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)
#if defined(__OBJC__)
#import <Cocoa/Cocoa.h>
#else
#include <ApplicationServices/ApplicationServices.h>
typedef void* id;
#endif
#elif defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#elif defined(GLFW_EXPOSE_NATIVE_WAYLAND)
#include <wayland-client.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_WGL)
/* WGL is declared by windows.h */
#endif
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
/* NSGL is declared by Cocoa.h */
#endif
#if defined(GLFW_EXPOSE_NATIVE_GLX)
#include <GL/glx.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_EGL)
#include <EGL/egl.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
#include <GL/osmesa.h>
#endif
/*************************************************************************
* Functions
*************************************************************************/
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
/*! @brief Returns the adapter device name of the specified monitor.
*
* @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`)
* of the specified monitor, or `NULL` if an [error](@ref error_handling)
* occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor);
/*! @brief Returns the display device name of the specified monitor.
*
* @return The UTF-8 encoded display device name (for example
* `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
/*! @brief Returns the `HWND` of the specified window.
*
* @return The `HWND` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @remark The `HDC` associated with the window can be queried with the
* [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
* function.
* @code
* HDC dc = GetDC(glfwGetWin32Window(window));
* @endcode
* This DC is private and does not need to be released.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WGL)
/*! @brief Returns the `HGLRC` of the specified window.
*
* @return The `HGLRC` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @remark The `HDC` associated with the window can be queried with the
* [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
* function.
* @code
* HDC dc = GetDC(glfwGetWin32Window(window));
* @endcode
* This DC is private and does not need to be released.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
/*! @brief Returns the `CGDirectDisplayID` of the specified monitor.
*
* @return The `CGDirectDisplayID` of the specified monitor, or
* `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
/*! @brief Returns the `NSWindow` of the specified window.
*
* @return The `NSWindow` of the specified window, or `nil` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
/*! @brief Returns the `NSOpenGLContext` of the specified window.
*
* @return The `NSOpenGLContext` of the specified window, or `nil` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_X11)
/*! @brief Returns the `Display` used by GLFW.
*
* @return The `Display` used by GLFW, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI Display* glfwGetX11Display(void);
/*! @brief Returns the `RRCrtc` of the specified monitor.
*
* @return The `RRCrtc` of the specified monitor, or `None` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
/*! @brief Returns the `RROutput` of the specified monitor.
*
* @return The `RROutput` of the specified monitor, or `None` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
/*! @brief Returns the `Window` of the specified window.
*
* @return The `Window` of the specified window, or `None` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
/*! @brief Sets the current primary selection to the specified string.
*
* @param[in] string A UTF-8 encoded string.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The specified string is copied before this function
* returns.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref clipboard
* @sa glfwGetX11SelectionString
* @sa glfwSetClipboardString
*
* @since Added in version 3.3.
*
* @ingroup native
*/
GLFWAPI void glfwSetX11SelectionString(const char* string);
/*! @brief Returns the contents of the current primary selection as a string.
*
* If the selection is empty or if its contents cannot be converted, `NULL`
* is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated.
*
* @return The contents of the selection as a UTF-8 encoded string, or `NULL`
* if an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the next call to @ref
* glfwGetX11SelectionString or @ref glfwSetX11SelectionString, or until the
* library is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref clipboard
* @sa glfwSetX11SelectionString
* @sa glfwGetClipboardString
*
* @since Added in version 3.3.
*
* @ingroup native
*/
GLFWAPI const char* glfwGetX11SelectionString(void);
#endif
#if defined(GLFW_EXPOSE_NATIVE_GLX)
/*! @brief Returns the `GLXContext` of the specified window.
*
* @return The `GLXContext` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
/*! @brief Returns the `GLXWindow` of the specified window.
*
* @return The `GLXWindow` of the specified window, or `None` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.2.
*
* @ingroup native
*/
GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
/*! @brief Returns the `struct wl_display*` used by GLFW.
*
* @return The `struct wl_display*` used by GLFW, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.2.
*
* @ingroup native
*/
GLFWAPI struct wl_display* glfwGetWaylandDisplay(void);
/*! @brief Returns the `struct wl_output*` of the specified monitor.
*
* @return The `struct wl_output*` of the specified monitor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.2.
*
* @ingroup native
*/
GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
/*! @brief Returns the main `struct wl_surface*` of the specified window.
*
* @return The main `struct wl_surface*` of the specified window, or `NULL` if
* an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.2.
*
* @ingroup native
*/
GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_EGL)
/*! @brief Returns the `EGLDisplay` used by GLFW.
*
* @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
/*! @brief Returns the `EGLContext` of the specified window.
*
* @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
/*! @brief Returns the `EGLSurface` of the specified window.
*
* @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
/*! @brief Retrieves the color buffer associated with the specified window.
*
* @param[in] window The window whose color buffer to retrieve.
* @param[out] width Where to store the width of the color buffer, or `NULL`.
* @param[out] height Where to store the height of the color buffer, or `NULL`.
* @param[out] format Where to store the OSMesa pixel format of the color
* buffer, or `NULL`.
* @param[out] buffer Where to store the address of the color buffer, or
* `NULL`.
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.3.
*
* @ingroup native
*/
GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer);
/*! @brief Retrieves the depth buffer associated with the specified window.
*
* @param[in] window The window whose depth buffer to retrieve.
* @param[out] width Where to store the width of the depth buffer, or `NULL`.
* @param[out] height Where to store the height of the depth buffer, or `NULL`.
* @param[out] bytesPerValue Where to store the number of bytes per depth
* buffer element, or `NULL`.
* @param[out] buffer Where to store the address of the depth buffer, or
* `NULL`.
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.3.
*
* @ingroup native
*/
GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer);
/*! @brief Returns the `OSMesaContext` of the specified window.
*
* @return The `OSMesaContext` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.3.
*
* @ingroup native
*/
GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _glfw3_native_h_ */

View File

@@ -0,0 +1,311 @@
#ifndef __khrplatform_h_
#define __khrplatform_h_
/*
** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* The master copy of khrplatform.h is maintained in the Khronos EGL
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
* The last semantic modification to khrplatform.h was at commit ID:
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by filing pull requests or issues on
* the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
# define KHRONOS_STATIC 1
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(KHRONOS_STATIC)
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
* header compatible with static linking. */
# define KHRONOS_APICALL
#elif defined(_WIN32)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#elif defined(__ANDROID__)
# define KHRONOS_APICALL __attribute__((visibility("default")))
#else
# define KHRONOS_APICALL
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
/* Win32 but not WinCE */
# define KHRONOS_APIENTRY __stdcall
#else
# define KHRONOS_APIENTRY
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
#if defined (__ARMCC_2__)
#define KHRONOS_APIATTRIBUTES __softfp
#else
#define KHRONOS_APIATTRIBUTES
#endif
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
/*
* Using <stdint.h>
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
/*
* To support platform where unsigned long cannot be used interchangeably with
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
* unsigned long long or similar (this results in different C++ name mangling).
* To avoid changes for existing platforms, we restrict usage of intptr_t to
* platforms where the size of a pointer is larger than the size of long.
*/
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
#define KHRONOS_USE_INTPTR_T
#endif
#endif
#elif defined(__VMS ) || defined(__sgi)
/*
* Using <inttypes.h>
*/
#include <inttypes.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
/*
* Win32
*/
typedef __int32 khronos_int32_t;
typedef unsigned __int32 khronos_uint32_t;
typedef __int64 khronos_int64_t;
typedef unsigned __int64 khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__sun__) || defined(__digital__)
/*
* Sun or Digital
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#if defined(__arch64__) || defined(_LP64)
typedef long int khronos_int64_t;
typedef unsigned long int khronos_uint64_t;
#else
typedef long long int khronos_int64_t;
typedef unsigned long long int khronos_uint64_t;
#endif /* __arch64__ */
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif 0
/*
* Hypothetical platform with no float or int64 support
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#define KHRONOS_SUPPORT_INT64 0
#define KHRONOS_SUPPORT_FLOAT 0
#else
/*
* Generic fallback
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#endif
/*
* Types that are (so far) the same on all platforms
*/
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
/*
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
#ifdef KHRONOS_USE_INTPTR_T
typedef intptr_t khronos_intptr_t;
typedef uintptr_t khronos_uintptr_t;
#elif defined(_WIN64)
typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t;
#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
#endif
#if defined(_WIN64)
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#endif
#if KHRONOS_SUPPORT_FLOAT
/*
* Float type
*/
typedef float khronos_float_t;
#endif
#if KHRONOS_SUPPORT_INT64
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
typedef khronos_int64_t khronos_stime_nanoseconds_t;
#endif
/*
* Dummy value used to pad enum types to 32 bits.
*/
#ifndef KHRONOS_MAX_ENUM
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
#endif
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
typedef enum {
KHRONOS_FALSE = 0,
KHRONOS_TRUE = 1,
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
} khronos_boolean_enum_t;
#endif /* __khrplatform_h_ */

View File

@@ -0,0 +1,489 @@
#ifndef _MV3D_RGBD_API_H_
#define _MV3D_RGBD_API_H_
#include "Mv3dRgbdDefine.h"
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************
* @~chinese
* @brief 获取SDK版本号
* @param pstVersion [OUT] 版本信息
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief Get SDK Version
* @param pstVersion [OUT] version info
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetSDKVersion(MV3D_RGBD_VERSION_INFO* pstVersion);
/************************************************************************
* @~chinese
* @brief SDK运行环境初始化
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief SDK run environment initialization
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_Initialize();
/************************************************************************
* @~chinese
* @brief SDK运行环境释放
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief SDK run environment release
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_Release();
/************************************************************************
* @~chinese
* @brief 获取当前环境中设备数量
* @param nDeviceType [IN] 设备类型,见Mv3dRgbdDeviceType,可全部获取(DeviceType_Ethernet | DeviceType_USB | DeviceType_Ethernet_Vir | DeviceType_USB_Vir)
* @param pDeviceNumber [OUT] 设备数量
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief gets the number of devices in the current environment
* @param nDeviceType [IN] device typerefer to Mv3dRgbdDeviceTypeget all(DeviceType_Ethernet | DeviceType_USB | DeviceType_Ethernet_Vir | DeviceType_USB_Vir)
* @param pDeviceNumber [OUT] device number
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetDeviceNumber(uint32_t nDeviceType, uint32_t* pDeviceNumber);
/************************************************************************
* @~chinese
* @brief 获取设备列表
* @param nDeviceType [IN] 设备类型,见Mv3dRgbdDeviceType,可全部获取(DeviceType_Ethernet | DeviceType_USB | DeviceType_Ethernet_Vir | DeviceType_USB_Vir)
* @param pstDeviceInfos [IN OUT] 设备列表
* @param nMaxDeviceCount [IN] 设备列表缓存最大个数
* @param pDeviceCount [OUT] 填充列表中设备个数
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief gets 3D cameras list
* @param nDeviceType [IN] device typerefer to Mv3dRgbdDeviceTypeget all(DeviceType_Ethernet | DeviceType_USB | DeviceType_Ethernet_Vir | DeviceType_USB_Vir)
* @param pstDeviceInfos [IN OUT] devices list
* @param nMaxDeviceCount [IN] max number of device list caches
* @param pDeviceCount [OUT] number of devices in the fill list
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetDeviceList(uint32_t nDeviceType, MV3D_RGBD_DEVICE_INFO* pstDeviceInfos, uint32_t nMaxDeviceCount, uint32_t* pDeviceCount);
/************************************************************************
* @~chinese
* @brief 打开设备
* @param handle [IN OUT] 相机句柄
* @param pstDeviceInfo [IN] 枚举的设备信息,默认为空,打开第一个相机
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @remark 设置工作模式为深度图模式图片模式为深度图并打开RGB Chunk
* @~english
* @brief open device
* @param handle [IN OUT] camera handle
* @param pstDeviceInfo [IN] enum camera info. the default is null, open first camera
* @return Success, return MV3D_RGBD_OK. Failure, return error code
* @remark Set working mode to depth, image mode to depth, and open RGB Chunk
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_OpenDevice(HANDLE *handle, MV3D_RGBD_DEVICE_INFO* pstDeviceInfo = NULL);
/************************************************************************
* @~chinese
* @brief 通过设备自定义名称打开设备
* @param handle [IN OUT] 相机句柄
* @param chDeviceName [IN] 设备用户自定义名称
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @remark 设置工作模式为深度图模式图片模式为深度图并打开RGB Chunk
* @~english
* @brief open device by device user defined name
* @param handle [IN OUT] camera handle
* @param chDeviceName [IN] device user defined name
* @return Success, return MV3D_RGBD_OK. Failure, return error code
* @remark Set working mode to depth, image mode to depth, and open RGB Chunk
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_OpenDeviceByName(HANDLE *handle, const char* chDeviceName);
/************************************************************************
* @~chinese
* @brief 通过序列号打开设备
* @param handle [IN OUT] 相机句柄
* @param chSerialNumber [IN] 序列号
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @remark 设置工作模式为深度图模式图片模式为深度图并打开RGB Chunk
* @~english
* @brief open device by serial number
* @param handle [IN OUT] camera handle
* @param chSerialNumber [IN] serial number
* @return Success, return MV3D_RGBD_OK. Failure, return error code
* @remark Set working mode to depth, image mode to depth, and open RGB Chunk
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_OpenDeviceBySerialNumber(HANDLE *handle, const char* chSerialNumber);
/************************************************************************
* @~chinese
* @brief 通过IP打开设备,仅网口设备有效
* @param handle [IN OUT] 相机句柄
* @param chIP [IN] IP地址
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @remark 设置工作模式为深度图模式图片模式为深度图并打开RGB Chunk
* @~english
* @brief open device by iponly network device is valid
* @param handle [IN OUT] camera handle
* @param chIP [IN] IP
* @return Success, return MV3D_RGBD_OK. Failure, return error code
* @remark Set working mode to depth, image mode to depth, and open RGB Chunk
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_OpenDeviceByIp(HANDLE *handle, const char* chIP);
/************************************************************************
* @~chinese
* @brief 关闭设备
* @param handle [IN] 相机句柄
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief close Device
* @param handle [IN] camera handle
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_CloseDevice(HANDLE *handle);
/************************************************************************
* @~chinese
* @brief 获取当前设备的详细信息
* @param handle [IN] 相机句柄
* @param pstDevInfo [IN][OUT] 返回给调用者有关相机设备信息结构体指针
* @return 成功,MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief get current device information
* @param handle [IN] camera handle
* @param pstDevInfo [IN][OUT] structure pointer of device information
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetDeviceInfo(HANDLE handle, MV3D_RGBD_DEVICE_INFO* pstDevInfo);
/************************************************************************
* @~chinese
* @brief 配置IP,仅网口设备有效
* @param chSerialNumber [IN] 序列号
* @param pstIPConfig [IN] IP配置静态IPDHCP等
* @return 成功,MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief ip configurationonly network device is valid
* @param chSerialNumber [IN] serial number
* @param pstIPConfig [IN] IP Config, Static IPDHCP
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_SetIpConfig(const char* chSerialNumber, MV3D_RGBD_IP_CONFIG* pstIPConfig);
/***********************************************************************
* @~chinese
* @brief 注册图像数据回调
* @param handle [IN] 相机句柄
* @param cbOutput [IN] 回调函数指针
* @param pUser [IN] 用户自定义变量
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @remark 当传入的用户自定义变量为NULL时,取消回调注册
* @~english
* @brief register image data callback
* @param handle [IN] camera handle
* @param cbOutput [IN] callback function pointer
* @param pUser [IN] user defined variable
* @return Success, return MV3D_RGBD_OK. Failure, return error code
* @remark Cancel callback registration when pUser is NULL
***********************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_RegisterFrameCallBack(HANDLE handle, MV3D_RGBD_FrameDataCallBack cbOutput, void* pUser);
/************************************************************************
* @~chinese
* @brief 注册异常消息回调
* @param handle [IN] 相机句柄
* @param cbException [IN] 异常回调函数指针
* @param pUser [IN] 用户自定义变量
* @return 见返回错误码
* @~english
* @brief register exception message callBack
* @param handle: [IN] camera handle
* @param cbException [IN] exception message callback function pointer
* @param pUser [IN] user defined variable
* @return Refer to error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_RegisterExceptionCallBack(HANDLE handle, MV3D_RGBD_ExceptionCallBack cbException, void* pUser);
/************************************************************************
* @~chinese
* @brief 开始取流前获取数据流配置列表
* @param handle [IN] 相机句柄
* @param pstStreamCfgList [IN][OUT] 返回给调用者数据流配置列表指针
* @return 成功,MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief get stream cfg list before start working
* @param handle [IN] camera handle
* @param pstStreamCfgList [IN][OUT] structure pointer of stream cfg list
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetStreamCfgList(HANDLE handle, MV3D_RGBD_STREAM_CFG_LIST* pstStreamCfgList);
/***********************************************************************
* @~chinese
* @brief 开始工作
* @param handle [IN] 相机句柄
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief start working
* @param handle [IN] camera handle
* @return Success, return MV3D_RGBD_OK. Failure, return error code
***********************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_Start(HANDLE handle);
/***********************************************************************
* @~chinese
* @brief 停止工作
* @param handle [IN] 相机句柄
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief stop working
* @param handle [IN] camera handle
* @return Success, return MV3D_RGBD_OK. Failure, return error code
***********************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_Stop(HANDLE handle);
/************************************************************************
* @~chinese
* @brief 轮询方式获取帧数据
* @param handle [IN] 相机句柄
* @param pstFrameData [IN][OUT] 数据指针
* @param nTimeOut [IN] 超时时间(ms)
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief fetch frame data
* @param handle [IN] camera handle
* @param pstFrameData [IN] data set pointer
* @param nTimeOut [IN] timevalue(ms)
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_FetchFrame(HANDLE handle, MV3D_RGBD_FRAME_DATA* pstFrameData, uint32_t nTimeOut);
/************************************************************************
* @~chinese
* @brief 执行设备软触发
* @param handle [IN] 相机句柄
* @return 成功,返回MV3D_RGBD_OK,失败,返回错误码
* @remark 设置触发模式为打开,设置触发源为软触发并执行
* @~english
* @brief execute camera soft trigger
* @param handle [IN] camera handle
* @return Success, return MV3D_RGBD_OK. Failure, return error code
* @remark Set trigger mode to open, trigger source to software, and excute soft trigger
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_SoftTrigger(HANDLE handle);
/************************************************************************
* @~chinese
* @brief 执行设备Command命令
* @param handle [IN] 相机句柄
* @param strKey [IN] 属性键值
* @return 成功,返回MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief execute camera command
* @param handle [IN] camera handle
* @param strKey [IN] key value
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_Execute(HANDLE handle, const char* strKey);
/************************************************************************
* @~chinese
* @brief 获取相机当前标定信息
* @param handle [IN] 相机句柄
* @param nCoordinateType [IN] 坐标系类型见Mv3dRgbdCoordinateType
* @param pstCalibInfo [IN][OUT] 输出标定信息
* @return 成功,返回MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief get camera current calibration info
* @param handle [IN] camera handle
* @param nCoordinateType [IN] coordinate type, refer to Mv3dRgbdCoordinateType
* @param pstCalibInfo [IN][OUT] calibration info
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetCalibInfo(HANDLE handle, uint32_t nCoordinateType, MV3D_RGBD_CALIB_INFO* pstCalibInfo);
/************************************************************************
* @~chinese
* @brief 获取相机内外参信息
* @param handle [IN] 相机句柄
* @param pstCameraParam [IN][OUT] 输出相机内外参数信息
* @return 成功,返回MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief get camera intrinsic and extrinsic information
* @param handle [IN] camera handle
* @param pstCameraParam [IN][OUT] camera intrinsic and extrinsic Info
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetCameraParam(HANDLE handle, MV3D_RGBD_CAMERA_PARAM* pstCameraParam);
/************************************************************************
* @~chinese
* @brief 设备升级
* @param handle [IN] 相机句柄
* @param pFilePathName [IN] 文件名
* @return 成功,返回MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief device upgrade
* @param handle [IN] camera handle
* @param pFilePathName [IN] file name
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_LocalUpgrade(HANDLE handle, const char* pFilePathName);
/************************************************************************
* @~chinese
* @brief 获取升级进度
* @param handle [IN] 相机句柄
* @param pProcess [OUT] 进度接收地址
* @return 成功,返回MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief get upgrade progress
* @param handle [IN] camera handle
* @param pProcess [OUT] progress receiving address
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetUpgradeProcess(HANDLE handle, uint32_t* pProcess);
/************************************************************************
* @~chinese
* @brief 获取相机参数值
* @param handle [IN] 相机句柄
* @param strKey [IN] 属性键值
* @param pstParam [IN] 返回的相机参数结构体指针
* @return 成功,返回MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief get camera param value
* @param handle [IN] camera handle
* @param strKey [IN] key value
* @param pstParam [IN] structure pointer of camera param
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetParam(HANDLE handle, const char* strKey, MV3D_RGBD_PARAM* pstParam);
/************************************************************************
* @~chinese
* @brief 设置相机参数值
* @param handle [IN] 相机句柄
* @param strKey [IN] 属性键值
* @param pstParam [IN] 输入的相机参数结构体指针
* @return 成功,返回MV3D_RGBD_OK,失败,返回错误码
* @~english
* @brief set camera param value
* @param handle [IN] camera handle
* @param strKey [IN] key value
* @param pstParam [IN] structure pointer of camera param
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_SetParam(HANDLE handle, const char* strKey, MV3D_RGBD_PARAM* pstParam);
/************************************************************************
* @~chinese
* @brief 导出相机参数
* @param handle [IN] 相机句柄
* @param pOutFileName [IN] 导出文件名称
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief export camera param
* @param handle [IN] camera handle
* @param pOutFileName [IN] export file name
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_ExportAllParam(HANDLE handle, const char* pOutFileName);
/************************************************************************
* @~chinese
* @brief 导入相机参数
* @param handle [IN] 相机句柄
* @param pInFileName [IN] 导入文件名称
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief import camera param
* @param handle [IN] camera handle
* @param pInFileName [IN] import file name
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_ImportAllParam(HANDLE handle, const char* pInFileName);
/************************************************************************
* @~chinese
* @brief 从相机读取文件
* @param handle [IN] 句柄地址
* @param pstFileAccess [IN] 文件存取结构体
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief read the file from the camera
* @param handle [IN] camera handle
* @param pstFileAccess [IN] file access structure
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_FileAccessRead(void* handle, MV3D_RGBD_FILE_ACCESS* pstFileAccess);
/************************************************************************
* @~chinese
* @brief 将文件写入相机
* @param handle [IN] 句柄地址
* @param pstFileAccess [IN] 文件存取结构体
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief write the file to camera
* @param handle [IN] camera handle
* @param pstFileAccess [IN] file access structure
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_FileAccessWrite(void* handle, MV3D_RGBD_FILE_ACCESS* pstFileAccess);
/************************************************************************
* @~chinese
* @brief 获取文件存取的进度
* @param handle [IN] 句柄地址
* @param pstFileAccessProgress [IN] 文件存取进度结构体
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief get file access progress
* @param handle [IN] camera handle
* @param pstFileAccessProgress [IN] file access progress structure
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_GetFileAccessProgress(void* handle, MV3D_RGBD_FILE_ACCESS_PROGRESS* pstFileAccessProgress);
#ifdef __cplusplus
}
#endif
#endif // _MV3D_RGBD_API_H_

View File

@@ -0,0 +1,512 @@
#ifndef _MV3D_RGBD_DEFINE_H_
#define _MV3D_RGBD_DEFINE_H_
#ifndef MV3D_RGBD_API
#if (defined (_WIN32) || defined(WIN64))
#if defined(MV3D_RGBD_EXPORTS)
#define MV3D_RGBD_API __declspec(dllexport)
#else
#define MV3D_RGBD_API __declspec(dllimport)
#endif
#else
#ifndef __stdcall
#define __stdcall
#endif
#ifndef MV3D_RGBD_API
#define MV3D_RGBD_API
#endif
#endif
#endif
/****************************** ch: 摘要 | en: Instructions **********************************************/
/**
* @~chinese
* 该头文件主要包含6部分
* 1.跨平台定义
* 2.状态码
* 3.常量定义
* 4.枚举
* 5.数据结构体
* 6.回调接口定义
*
* @~english
* The document mainly consists of six parts:
* 1.Cross Platform Definition
* 2.Status Code
* 3.Macro Definition
* 4.Enumeration
* 5.Data Structure
* 6.Callback Interface Definition
**/
/***************************************** Part1 ch: 跨平台定义 | en: Cross Platform Definition **************************************************/
#ifdef WIN32
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
#define MV3D_RGBD_UNDEFINED 0xFFFFFFFF
#else
#include <stdint.h>
#define MV3D_RGBD_UNDEFINED -1
#endif
/***************************************** Part2 ch: 状态码 | en: Status Code **************************************************/
/// \~chinese
/// \name 正确码定义
/// @{
/// \~english
/// \name Definition of correct code
/// @{
#define MV3D_RGBD_OK 0x00000000 ///< \~chinese 成功,无错误 \~english Successed, no error
/// @}
///
/// \~chinese
/// \name 通用错误码定义:范围0x80060000-0x800600FF
/// @{
/// \~english
/// \name Definition of General Error Code (from 0x80060000 to 0x800600FF)
/// @{
#define MV3D_RGBD_E_HANDLE 0x80060000 ///< \~chinese 错误或无效的句柄 \~english Incorrect or invalid handle
#define MV3D_RGBD_E_SUPPORT 0x80060001 ///< \~chinese 不支持的功能 \~english The function is not supported
#define MV3D_RGBD_E_BUFOVER 0x80060002 ///< \~chinese 缓存已满 \~english The buffer is full
#define MV3D_RGBD_E_CALLORDER 0x80060003 ///< \~chinese 函数调用顺序错误 \~english Incorrect calling sequence
#define MV3D_RGBD_E_PARAMETER 0x80060004 ///< \~chinese 错误的参数 \~english Incorrect parameter
#define MV3D_RGBD_E_RESOURCE 0x80060005 ///< \~chinese 资源申请失败 \~english Resource request failed
#define MV3D_RGBD_E_NODATA 0x80060006 ///< \~chinese 无数据 \~english No data
#define MV3D_RGBD_E_PRECONDITION 0x80060007 ///< \~chinese 前置条件有误,或运行环境已发生变化 \~english Incorrect precondition, or running environment has changed
#define MV3D_RGBD_E_VERSION 0x80060008 ///< \~chinese 版本不匹配 \~english The version mismatched
#define MV3D_RGBD_E_NOENOUGH_BUF 0x80060009 ///< \~chinese 传入的内存空间不足 \~english Insufficient memory
#define MV3D_RGBD_E_ABNORMAL_IMAGE 0x8006000A ///< \~chinese 异常图像,可能是丢包导致图像不完整 \~english Abnormal image. Incomplete image caused by packet loss
#define MV3D_RGBD_E_LOAD_LIBRARY 0x8006000B ///< \~chinese 动态导入DLL失败 \~english Failed to load the dynamic link library dynamically
#define MV3D_RGBD_E_ALGORITHM 0x8006000C ///< \~chinese 算法错误 \~english Algorithm error
#define MV3D_RGBD_E_DEVICE_OFFLINE 0x8006000D ///< \~chinese 设备离线 \~english The device is offline
#define MV3D_RGBD_E_ACCESS_DENIED 0x8006000E ///< \~chinese 设备无访问权限 \~english No device access permission
#define MV3D_RGBD_E_OUTOFRANGE 0x8006000F ///< \~chinese 值超出范围 \~english The value is out of range
#define MV3D_RGBD_E_UPG_FILE_MISMATCH 0x80060010 ///< \~chinese 升级固件不匹配 \~english The upgraded firmware does not match
#define MV3D_RGBD_E_UPG_CONFLICT 0x80060012 ///< \~chinese 升级冲突 \~english The upgraded firmware conflict
#define MV3D_RGBD_E_UPG_INNER_ERR 0x80060013 ///< \~chinese 升级时相机内部出现错误 \~english An error occurred inside the camera during the upgrade
#define MV3D_RGBD_E_INDUSTRY 0x80060020 ///< \~chinese 行业属性不匹配 \~english The industry attributes does not match
#define MV3D_RGBD_E_NETWORK 0x80060021 ///< \~chinese 网络相关错误 \~english Network related error
#define MV3D_RGBD_E_UNKNOW 0x800600FF ///< \~chinese 未知的错误 \~english Unknown error
/// @}
/***************************************** Part3 ch: 常量定义 | en: Macro Definition **************************************************/
///< \~chinese 常量 \~english Constant
#define MV3D_RGBD_MAX_IMAGE_COUNT 10 ///< \~chinese 最大图片个数 \~english The maximum number of images
#define MV3D_RGBD_MAX_STRING_LENGTH 256 ///< \~chinese 最大字符串长度 \~english The maximum length of string
#define MV3D_RGBD_MAX_PATH_LENGTH 256 ///< \~chinese 最大路径长度 \~english The maximum length of path
#define MV3D_RGBD_MAX_ENUM_COUNT 16 ///< \~chinese 最大枚举数量 \~english The maximum number of enumerations
///< \~chinese 像素类型 \~english Pixel Type
#define MV3D_RGBD_PIXEL_MONO 0x01000000 ///< \~chinese Mono像素格式 \~english Mono pixel format
#define MV3D_RGBD_PIXEL_COLOR 0x02000000 ///< \~chinese Color像素格式 \~english Color pixel format
#define MV3D_RGBD_PIXEL_CUSTOM 0x80000000 ///< \~chinese 自定义像素格式 \~english Custom pixel format
#define MV3D_RGBD_PIXEL_BIT_COUNT(n) ((n) << 16) ///< \~chinese 像素格式 \~english Pixel format
///< \~chinese 属性常量定义 \~english Attribute Key Value Definition
#define MV3D_RGBD_INT_WIDTH "Width" ///< \~chinese 图像宽 \~english Image width
#define MV3D_RGBD_INT_HEIGHT "Height" ///< \~chinese 图像高 \~english Image height
#define MV3D_RGBD_ENUM_WORKINGMODE "CameraWorkingMode" ///< \~chinese 工作模式 \~english The camera working mode
#define MV3D_RGBD_ENUM_PIXELFORMAT "PixelFormat" ///< \~chinese 像素格式 \~english Pixel format
#define MV3D_RGBD_ENUM_IMAGEMODE "ImageMode" ///< \~chinese 图像模式 \~english Image mode
#define MV3D_RGBD_FLOAT_GAIN "Gain" ///< \~chinese 增益 \~english Gain
#define MV3D_RGBD_FLOAT_EXPOSURETIME "ExposureTime" ///< \~chinese 曝光时间 \~english Exposure time
#define MV3D_RGBD_FLOAT_FRAMERATE "AcquisitionFrameRate" ///< \~chinese 采集帧率 \~english Acquired frame rate
#define MV3D_RGBD_ENUM_TRIGGERSELECTOR "TriggerSelector" ///< \~chinese 触发选择器 \~english Trigger selector
#define MV3D_RGBD_ENUM_TRIGGERMODE "TriggerMode" ///< \~chinese 触发模式 \~english Trigger mode
#define MV3D_RGBD_ENUM_TRIGGERSOURCE "TriggerSource" ///< \~chinese 触发源 \~english Trigger source
#define MV3D_RGBD_FLOAT_TRIGGERDELAY "TriggerDelay" ///< \~chinese 触发延迟时间 \~english Trigger delay
#define MV3D_RGBD_INT_IMAGEALIGN "ImageAlign" ///< \~chinese 深度图对齐到RGB坐标系默认值1对齐0不对齐重启程序后恢复默认值
///< \~english Whether to align the depth image with RGB image: 1 (align, default value), 0 (not align). The default value will be restored after rebooting
#define MV3D_RGBD_BOOL_LASERENABLE "LaserEnable" ///< \~chinese 投射器使能 \~english Open or close laser control
#define Mv3D_RGBD_FLOAT_BASEDISTANCE "BaseDistance" ///< \~chinese 左右目基线距 \~english Left and right eyes base distance
#define MV3D_RGBD_ENUM_RESOLUTION "BinningSelector" ///< \~chinese 采集分辨率 \~english Acquisition resolution
#define MV3D_RGBD_INT_OUTPUT_RGBD "OutputRgbd" ///< \~chinese RGBD图像输出默认值0不输出1输出重启程序后恢复默认值
///< \~english Whether to output rgbd image: 1 (not output, default value), 0 (output). The default value will be restored after rebooting
#define MV3D_RGBD_INT_DEVICE_TIMEOUT "DeviceTimeout" ///< \~chinese 设备控制超时时间(ms) \~english Timeout period of device control (unit: ms)
#define MV3D_RGBD_INT_IMAGE_NODE_NUM "ImageNodeNum" ///< \~chinese 图像缓存节点个数 \~english The number of image buffer node
#define MV3D_RGBD_FLOAT_Z_UNIT "ZUnit" ///< \~chinese 深度图量纲(mm) \~english The dimension of depth image (unit: mm)
///< \~chinese 设备文件枚举常量定义 \~english File Constant Definition
#define MV3D_RGBD_SENSOR_CALI "RGBDSensorCali" ///< \~chinese 相机传感器标定文件 \~english The calibration file of camera sensor
#define MV3D_RGBD_HANDEYE_CALI "RGBDHandEyeCali" ///< \~chinese 相机手眼标定文件 \~english The camera hand-eye calibration file
///< \~chinese 类型定义 \~english Typedef Documentation
typedef int32_t MV3D_RGBD_STATUS; ///< \~chinese 返回值类型 \~english Return value type
typedef void* HANDLE; ///< \~chinese 句柄类型 \~english Handle type
typedef int32_t BOOL; ///< \~chinese BOOL类型 \~english Boolean type
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL 0
#endif
/***************************************** Part4 ch: 枚举 | en: Enumeration **************************************************/
///< \~chinese 设备类型 \~english Device Type
typedef enum Mv3dRgbdDeviceType
{
DeviceType_Ethernet = 1 << 0, ///< \~chinese 网口设备 \~english Network type camera
DeviceType_USB = 1 << 1, ///< \~chinese USB设备 \~english USB type camera
DeviceType_Ethernet_Vir = 1 << 2, ///< \~chinese 虚拟网口设备 \~english Virtual network type camera
DeviceType_USB_Vir = 1 << 3 ///< \~chinese 虚拟USB设备 \~english Virtual USB type camera
} Mv3dRgbdDeviceType;
///< \~chinese ip类型 \~english IP Address Mode
typedef enum Mv3dRgbdIpCfgMode
{
IpCfgMode_Static = 1, ///< \~chinese 静态IP \~english Static IP mode
IpCfgMode_DHCP = 2, ///< \~chinese 自动分配IP(DHCP) \~english Automatically assigned IP address (DHCP)
IpCfgMode_LLA = 4 ///< \~chinese 自动分配IP(LLA) \~english Automatically assigned IP address (LLA)
} Mv3dRgbdIpCfgMode;
///< \~chinese USB协议类型 \~english Supported USB Protocol Type
typedef enum Mv3dRgbdUsbProtocol
{
UsbProtocol_USB2 = 1, ///< \~chinese USB 2.0 \~english USB 2.0
UsbProtocol_USB3 = 2 ///< \~chinese USB 3.0 \~english USB 3.0
} Mv3dRgbdUsbProtocol;
///< \~chinese 图像格式 \~english Image Format
typedef enum Mv3dRgbdImageType
{
ImageType_Undefined = MV3D_RGBD_UNDEFINED, ///< \~chinese 未定义的图像类型 \~english Undefined image type
ImageType_Mono8 = (MV3D_RGBD_PIXEL_MONO | MV3D_RGBD_PIXEL_BIT_COUNT(8) | 0x0001), //0x01080001,(Mono8)
ImageType_Mono16 = (MV3D_RGBD_PIXEL_MONO | MV3D_RGBD_PIXEL_BIT_COUNT(16) | 0x0007), //0x01100007,(Mono16)
ImageType_Depth = (MV3D_RGBD_PIXEL_MONO | MV3D_RGBD_PIXEL_BIT_COUNT(16) | 0x00B8), //0x011000B8,(C16)
ImageType_YUV422 = (MV3D_RGBD_PIXEL_COLOR | MV3D_RGBD_PIXEL_BIT_COUNT(16) | 0x0032), //0x02100032
ImageType_YUV420SP_NV12 = (MV3D_RGBD_PIXEL_COLOR | MV3D_RGBD_PIXEL_BIT_COUNT(12) | 0x8001), //0x020C8001
ImageType_YUV420SP_NV21 = (MV3D_RGBD_PIXEL_COLOR | MV3D_RGBD_PIXEL_BIT_COUNT(12) | 0x8002), //0x020C8002
ImageType_RGB8_Planar = (MV3D_RGBD_PIXEL_COLOR | MV3D_RGBD_PIXEL_BIT_COUNT(24) | 0x0021), //0x02180021
ImageType_PointCloud = (MV3D_RGBD_PIXEL_COLOR | MV3D_RGBD_PIXEL_BIT_COUNT(96) | 0x00C0), //0x026000C0,(ABC32f)
ImageType_Jpeg = (MV3D_RGBD_PIXEL_CUSTOM| MV3D_RGBD_PIXEL_BIT_COUNT(24) | 0x0001), //0x80180001, ///< \~chinese 自定义的图片格式 \~english The custom image format
ImageType_Rgbd = (MV3D_RGBD_PIXEL_CUSTOM| MV3D_RGBD_PIXEL_COLOR| MV3D_RGBD_PIXEL_BIT_COUNT(40) | 0x3007), //0x82283007
} Mv3dRgbdImageType;
///< \~chinese 数据流类型 \~english Data Stream Type
typedef enum Mv3dRgbdStreamType
{
StreamType_Undefined = 0,
StreamType_Depth = 1, ///< \~chinese 深度图数据流 \~english Depth image data stream
StreamType_Color = 2, ///< \~chinese 彩色图数据流 \~english Color image data stream
StreamType_Ir_Left = 3, ///< \~chinese 矫正后的左目图数据流 \~english Corrected left-eye image data stream
StreamType_Ir_Right = 4, ///< \~chinese 矫正后的右目图数据流 \~english Corrected right-eye image data stream
StreamType_Imu = 5, ///< \~chinese IMU数据流 \~english IMU data stream
StreamType_LeftMono = 6, ///< \~chinese 左目泛光图数据流 \~english Illuminated left-eye image data stream
StreamType_Mask = 7, ///< \~chinese 掩膜图数据流 \~english Mask image data stream
StreamType_Mono = 8, ///< \~chinese 未矫正的左右目融合图数据流 \~english Uncorrected left and right eyes fusion image data stream
StreamType_Phase = 9, ///< \~chinese 相位图数据流 \~english Phase image data stream
StreamType_Rgbd = 10 ///< \~chinese RGB-D图数据流 \~english RGB-D image data stream
}Mv3dRgbdStreamType;
///< \~chinese 坐标系类型 \~english Coordinates Type
typedef enum Mv3dRgbdCoordinateType
{
CoordinateType_Undefined = 0, ///< \~chinese 未定义的坐标系 \~english Undefined coordinates
CoordinateType_Depth = 1, ///< \~chinese 深度图坐标系 \~english Depth image coordinates
CoordinateType_RGB = 2 ///< \~chinese RGB图坐标系 \~english RGB image coordinates
} Mv3dRgbdCoordinateType;
///< \~chinese 异常信息 \~english Exception Information
typedef enum Mv3dRgbdDevException
{
DevException_Disconnect = 1 ///< \~chinese 设备断开连接 \~english The device is disconnected
} Mv3dRgbdDevException;
///< \~chinese 参数类型 \~english Parameter Data Type
typedef enum Mv3dRgbdParamType
{
ParamType_Bool = 1, ///< \~chinese Bool类型参数 \~english Boolean
ParamType_Int = 2, ///< \~chinese Int类型参数 \~english Int
ParamType_Float = 3, ///< \~chinese Float类型参数 \~english Float
ParamType_Enum = 4, ///< \~chinese Enum类型参数 \~english Enumeration
ParamType_String = 5 ///< \~chinese String类型参数 \~english String
} Mv3dRgbdParamType;
///< \~chinese 深度图与rgb图存图格式 \~english Format of Saving Depth Images and RGB Images
typedef enum Mv3dRgbdFileType
{
FileType_BMP = 1, ///< \~chinese BMP格式 \~english BMP
FileType_JPG = 2, ///< \~chinese JPG格式 \~english JPG
FileType_TIFF = 3 ///< \~chinese TIFF格式 \~english TIFF
}Mv3dRgbdFileType;
///< \~chinese 点云图存图格式 \~english Formats of Saving Point Cloud Images
typedef enum Mv3dRgbdPointCloudFileType
{
PointCloudFileType_PLY = 1, ///< \~chinese PLY_ASCII格式 \~english PLY(ascii)
PointCloudFileType_CSV = 2, ///< \~chinese CSV格式 \~english CSV
PointCloudFileType_OBJ = 3, ///< \~chinese OBJ格式 \~english OBJ
PointCloudFileType_PLY_Binary = 4 ///< \~chinese PLY_BINARY格式 \~english PLY(binary)
}Mv3dRgbdPointCloudFileType;
/***************************************** Part5 ch: 数据结构体 | en: Data Structure **************************************************/
///< \~chinese 版本信息 \~english SDK Version Information
typedef struct _MV3D_RGBD_VERSION_INFO_
{
uint32_t nMajor; ///< \~chinese 主版本 \~english The main version
uint32_t nMinor; ///< \~chinese 次版本 \~english The minor version
uint32_t nRevision; ///< \~chinese 修正版本 \~english The revision version
} MV3D_RGBD_VERSION_INFO;
///< \~chinese 网口设备信息 \~english Network Type Device Information
typedef struct _MV3D_RGBD_DEVICE_NET_INFO_
{
unsigned char chMacAddress[8]; ///< \~chinese Mac地址 \~english MAC address
Mv3dRgbdIpCfgMode enIPCfgMode; ///< \~chinese 当前IP类型 \~english Current IP type
char chCurrentIp[16]; ///< \~chinese 设备当前IP \~english Devices IP address
char chCurrentSubNetMask[16]; ///< \~chinese 设备当前子网掩码 \~english Devices subnet mask
char chDefultGateWay[16]; ///< \~chinese 设备默认网关 \~english Devices default gateway
char chNetExport[16]; ///< \~chinese 网口IP地址 \~english Network interface IP address
uint8_t nReserved[16]; ///< \~chinese 保留字节 \~english Reserved
} MV3D_RGBD_DEVICE_NET_INFO;
///< \~chinese USB设备信息 \~english USB Type Device Information
typedef struct _MV3D_RGBD_DEVICE_USB_INFO_
{
uint32_t nVendorId; ///< \~chinese 供应商ID号 \~english Manufacturer/vendor ID
uint32_t nProductId; ///< \~chinese 产品ID号 \~english Product ID
Mv3dRgbdUsbProtocol enUsbProtocol; ///< \~chinese 支持的USB协议 \~english Supported USB protocol types
char chDeviceGUID[64]; ///< \~chinese 设备GUID号 \~english Device GUID
uint8_t nReserved[16]; ///< \~chinese 保留字节 \~english Reserved
} MV3D_RGBD_DEVICE_USB_INFO;
///< \~chinese 枚举相关设备信息 \~english Device Information
typedef struct _MV3D_RGBD_DEVICE_INFO_
{
char chManufacturerName[32]; ///< \~chinese 设备厂商 \~english Manufacturer
char chModelName[32]; ///< \~chinese 设备型号 \~english Device model
char chDeviceVersion[32]; ///< \~chinese 设备版本 \~english Device version
char chManufacturerSpecificInfo[44]; ///< \~chinese 设备厂商特殊信息 \~english The specific information about manufacturer
uint32_t nDevTypeInfo; ///< \~chinese 设备类型信息 \~english Device type info
char chSerialNumber[16]; ///< \~chinese 设备序列号 \~english Device serial number
char chUserDefinedName[16]; ///< \~chinese 设备用户自定义名称 \~english User-defined name of device
Mv3dRgbdDeviceType enDeviceType; ///< \~chinese 设备类型网口、USB、虚拟网口设备、虚拟USB设备
///< \~english Device type(network / USB / virtual network / virtual USB)
union
{
MV3D_RGBD_DEVICE_NET_INFO stNetInfo; ///< \~chinese 网口设备特有 \~english Network type device
MV3D_RGBD_DEVICE_USB_INFO stUsbInfo; ///< \~chinese USB设备特有 \~english USB type device information
} SpecialInfo; ///< \~chinese 不同设备特有信息 \~english Particular information of different types devices
} MV3D_RGBD_DEVICE_INFO;
///< \~chinese IP配置 \~english IP Configuration Parameters
typedef struct _MV3D_RGBD_IP_CONFIG_
{
Mv3dRgbdIpCfgMode enIPCfgMode; ///< \~chinese IP配置模式 \~english IP configuration mode
char chDestIp[16]; ///< \~chinese 设置的目标IP,仅静态IP模式下有效 \~english The IP address which is to be attributed to the target device. It is valid in the static IP mode only
char chDestNetMask[16]; ///< \~chinese 设置的目标子网掩码,仅静态IP模式下有效 \~english The subnet mask of target device. It is valid in the static IP mode only
char chDestGateWay[16]; ///< \~chinese 设置的目标网关,仅静态IP模式下有效 \~english The gateway of target device. It is valid in the static IP mode only
uint8_t nReserved[16]; ///< \~chinese 保留字节 \~english Reserved
} MV3D_RGBD_IP_CONFIG;
///< \~chinese 相机图像 \~english Camera Image Parameters
typedef struct _MV3D_RGBD_IMAGE_DATA_
{
Mv3dRgbdImageType enImageType; ///< \~chinese 图像格式 \~english Image format
uint32_t nWidth; ///< \~chinese 图像宽 \~english Image width
uint32_t nHeight; ///< \~chinese 图像高 \~english Image height
uint8_t* pData; ///< \~chinese 相机输出的图像数据 \~english Image data, which is outputted by the camera
uint32_t nDataLen; ///< \~chinese 图像数据长度(字节) \~english Image data length (bytes)
uint32_t nFrameNum; ///< \~chinese 帧号,代表第几帧图像 \~english Frame number, which indicates the frame sequence
int64_t nTimeStamp; ///< \~chinese 设备上报的时间戳 设备上电从0开始规则详见设备手册
///< \~english Timestamp uploaded by the device. It starts from 0 when the device is powered on. Refer to the device user manual for detailed rules
BOOL bIsRectified; ///< \~chinese 是否校正 \~english Correction flag
Mv3dRgbdStreamType enStreamType; ///< \~chinese 流类型,用于区分图像(图像格式相同时) \~english Data stream type, used to distinguish data in the same image format
Mv3dRgbdCoordinateType enCoordinateType; ///< \~chinese 坐标系类型 \~english Coordinates type
uint8_t nReserved[4]; ///< \~chinese 保留字节 \~english Reserved
} MV3D_RGBD_IMAGE_DATA;
///< \~chinese 图像帧数据 \~english Frame Data
typedef struct _MV3D_RGBD_FRAME_DATA_
{
uint32_t nImageCount; ///< \~chinese 图像个数表示stImage数组的有效个数 \~english The number of images. It indicates the number of valid stImage arrays
MV3D_RGBD_IMAGE_DATA stImageData[MV3D_RGBD_MAX_IMAGE_COUNT]; ///< \~chinese 图像数组,每一个代表一种类型的图像 \~english Image array, each one represents one type of images
uint32_t nValidInfo; ///< \~chinese 帧有效信息0帧有效1 << 0丢包1 << 1触发标识符无效
///< \~english Frame valid info: 0 (Frame is valid), 1 << 0 (lost package), 1 << 1 (trigger is not valid)
uint8_t nReserved[12]; ///< \~chinese 保留字节 \~english Reserved
} MV3D_RGBD_FRAME_DATA;
///< \~chinese 固件输出的图像附加信息 \~english Image Additional Information Output by Firmware
typedef struct _MV3D_RGBD_STREAM_CFG_
{
Mv3dRgbdImageType enImageType; ///< \~chinese 图像格式 \~english Image format
uint32_t nWidth; ///< \~chinese 图像宽 \~english Image width
uint32_t nHeight; ///< \~chinese 图像高 \~english Image height
uint8_t nReserved[32]; ///< \~chinese 保留字节 \~english Reserved
}MV3D_RGBD_STREAM_CFG;
///< \~chinese 固件输出的图像帧附加信息 \~english Frame Additional Information Output by Firmware
typedef struct _MV3D_RGBD_STREAM_CFG_LIST_
{
uint32_t nStreamCfgCount; ///< \~chinese 图像信息数量 \~english The number of image information
MV3D_RGBD_STREAM_CFG stStreamCfg[MV3D_RGBD_MAX_IMAGE_COUNT]; ///< \~chinese 图像附加信息 \~english Image additional information
uint8_t nReserved[16]; ///< \~chinese 保留字节 \~english Reserved
}MV3D_RGBD_STREAM_CFG_LIST;
///< \~chinese 相机内参 \~english Camera Internal Parameters
///< | fx| 0| cx|
///< | 0| fy| cy|
///< | 0| 0| 1|
typedef struct _MV3D_RGBD_CAMERA_INTRINSIC_
{
float fData[3*3]; ///< \~chinese 内参参数fx,0,cx,0,fy,cy,0,0,1 \~english Internal parameters: fx,0,cx,0,fy,cy,0,0,1
} MV3D_RGBD_CAMERA_INTRINSIC;
///< \~chinese 相机畸变系数 \~english Camera Distortion Coefficient
typedef struct _MV3D_RGBD_CAMERA_DISTORTION_
{
float fData[12]; ///< \~chinese 畸变系数k1,k2,p1,p2,k3,k4,k5,k6,s1,s2,s3,s4 \~english Distortion coefficient: k1,k2,p1,p2,k3,k4,k5,k6,s1,s2,s3,s4
} MV3D_RGBD_CAMERA_DISTORTION;
///< \~chinese 相机的内参,畸变系数,分辨率信息 \~english Structure About Camera Internal Parameters, Distortion Coefficient and Resolution Information
typedef struct _MV3D_RGBD_CALIB_INFO_
{
MV3D_RGBD_CAMERA_INTRINSIC stIntrinsic; ///< \~chinese 相机内参 \~english Camera internal parameters
MV3D_RGBD_CAMERA_DISTORTION stDistortion; ///< \~chinese 畸变系数 \~english Camera distortion coefficient
uint32_t nWidth; ///< \~chinese 图像宽 \~english Image width
uint32_t nHeight; ///< \~chinese 图像高 \~english Image height
uint8_t nReserved[8]; ///< \~chinese 保留字节 \~english Reserved
} MV3D_RGBD_CALIB_INFO;
///< \~chinese 相机深度图转Rgb的外参 \~english Camera Extrinsic Parameters of Depth Image to Rgb Image
///< | r00| r01| r02| t0|
///< | r10| r11| r12| t1|
///< | r20| r21| r22| t2|
///< | 0| 0| 0| 1|
typedef struct _MV3D_RGBD_CAMERA_EXTRINSIC_
{
float fData[4*4]; ///< \~chinese 深度图转Rgb外参参数r00,r01,r02,t0,r10,r11,r12,t1,r20,r21,r22,t2,0,0,0,1
///< \~english Extrinsic parameters of depth image to rgb image: r00,r01,r02,t0,r10,r11,r12,t1,r20,r21,r22,t2,0,0,0,1
}MV3D_RGBD_CAMERA_EXTRINSIC;
///< \~chinese 相机参数信息 \~english Camera Parameters Information
typedef struct _MV3D_RGBD_CAMERA_PARAM_
{
MV3D_RGBD_CALIB_INFO stDepthCalibInfo; ///< \~chinese 深度图内参和畸变矩阵信息 \~english Depth image intrinsic information and distortion coefficient
MV3D_RGBD_CALIB_INFO stRgbCalibInfo; ///< \~chinese rgb内参和畸变矩阵信息 \~english Rgb image intrinsic information and distortion coefficient
MV3D_RGBD_CAMERA_EXTRINSIC stDepth2RgbExtrinsic; ///< \~chinese 相机深度图转RGB的外参 \~english Camera extrinsic parameters of depth image to rgb image
uint8_t nReserved[32]; ///< \~chinese 保留字节 \~english Reserved
}MV3D_RGBD_CAMERA_PARAM;
///< \~chinese Int类型值 \~english Int Type Value
typedef struct _MV3D_RGBD_INTPARAM_
{
int64_t nCurValue; ///< \~chinese 当前值 \~english Current value
int64_t nMax; ///< \~chinese 最大值 \~english The maximum value
int64_t nMin; ///< \~chinese 最小值 \~english The minimum value
int64_t nInc; ///< \~chinese 增量值 \~english The increment value
} MV3D_RGBD_INTPARAM;
///< \~chinese Enum类型值 \~english Enumeration Type Value
typedef struct _MV3D_RGBD_ENUMPARAM_
{
uint32_t nCurValue; ///< \~chinese 当前值 \~english Current value
uint32_t nSupportedNum; ///< \~chinese 有效数据个数 \~english The number of valid data
uint32_t nSupportValue[MV3D_RGBD_MAX_ENUM_COUNT]; ///< \~chinese 支持的枚举类型 \~english The type of supported enumerations
} MV3D_RGBD_ENUMPARAM;
///< \~chinese Float类型值 \~english Float Type Value
typedef struct _MV3D_RGBD_FLOATPARAM_
{
float fCurValue; ///< \~chinese 当前值 \~english Current value
float fMax; ///< \~chinese 最大值 \~english The maximum value
float fMin; ///< \~chinese 最小值 \~english The minimum value
} MV3D_RGBD_FLOATPARAM;
///< \~chinese String类型值 \~english String Type Value
typedef struct _MV3D_RGBD_STRINGPARAM_
{
char chCurValue[MV3D_RGBD_MAX_STRING_LENGTH]; ///< \~chinese 当前值 \~english Current value
uint32_t nMaxLength; ///< \~chinese 属性节点能设置字符的最大长度 \~english The maximum length of string
} MV3D_RGBD_STRINGPARAM;
///< \~chinese 设备参数 \~english Device Parameters
typedef struct _MV3D_RGBD_PARAM_
{
Mv3dRgbdParamType enParamType; ///< \~chinese 设置属性值类型 \~english Parameter data type
union
{
BOOL bBoolParam; ///< \~chinese Bool类型参数 \~english Boolean type parameter
MV3D_RGBD_INTPARAM stIntParam; ///< \~chinese Int类型参数 \~english Int type parameter
MV3D_RGBD_FLOATPARAM stFloatParam; ///< \~chinese Float类型参数 \~english Float type parameter
MV3D_RGBD_ENUMPARAM stEnumParam; ///< \~chinese Enum类型参数 \~english Enum type parameter
MV3D_RGBD_STRINGPARAM stStringParam; ///< \~chinese String类型参数 \~english String type parameter
} ParamInfo;
uint8_t nReserved[16]; ///< \~chinese 保留字节 \~english Reserved
} MV3D_RGBD_PARAM;
///< \~chinese 异常信息 \~english Exception Information
typedef struct _MV3D_RGBD_EXCEPTION_INFO_
{
Mv3dRgbdDevException enExceptionId; ///< \~chinese 异常ID \~english Exception ID
char chExceptionDes[MV3D_RGBD_MAX_STRING_LENGTH]; ///< \~chinese 异常描述 \~english Exception description
uint8_t nReserved[4]; ///< \~chinese 保留字节 \~english Reserved
} MV3D_RGBD_EXCEPTION_INFO;
///< \~chinese 文件存取 \~english File Access
typedef struct _MV3D_RGBD_FILE_ACCESS_
{
const char* pUserFileName; ///< \~chinese 用户文件名 \~english User file name
const char* pDevFileName; ///< \~chinese 设备文件名 \~english Device file name
uint8_t nReserved[32]; ///< \~chinese 保留字节 \~english Reserved
}MV3D_RGBD_FILE_ACCESS;
///< \~chinese 文件存取进度 \~english File Access Progress
typedef struct _MV3D_RGBD_FILE_ACCESS_PROGRESS_
{
int64_t nCompleted; ///< \~chinese 已完成的长度 \~english Completed length
int64_t nTotal; ///< \~chinese 总长度 \~english Total length
uint8_t nReserved[32]; ///< \~chinese 保留字节 \~english Reserved
}MV3D_RGBD_FILE_ACCESS_PROGRESS;
/***************************************** Part6 ch: 回调接口定义 | en: Callback Interface Definition **************************************************/
///< \~chinese 帧数据回调 \~english Frame Data Callback
typedef void(__stdcall* MV3D_RGBD_FrameDataCallBack) (MV3D_RGBD_FRAME_DATA* pstFrameData, void* pUser);
///< \~chinese 异常回调 \~english Exception Callback
typedef void(__stdcall* MV3D_RGBD_ExceptionCallBack) (MV3D_RGBD_EXCEPTION_INFO* pstExceptInfo, void* pUser);
#endif // _MV3D_RGBD_DEFINE_H_

View File

@@ -0,0 +1,159 @@
#ifndef _MV3D_RGBD_IMG_PROC_H_
#define _MV3D_RGBD_IMG_PROC_H_
#include "Mv3dRgbdDefine.h"
#ifdef __cplusplus
extern "C" {
#endif
/************************************************************************
* @~chinese
* @brief RGBD相机深度图像转换点云图像
* @param handle [IN] 相机句柄
* @param pstDepthImage [IN] 深度图数据
* @param pstPointCloudImage [OUT] 点云图数据
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief depth image convert to pointcloud image
* @param handle [IN] camera handle
* @param pstDepthImage [IN] depth data
* @param pstPointCloudImage [OUT] point cloud data
* @return Success, return MV3D_RGBD_OK. Failure,return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_MapDepthToPointCloud(void* handle, MV3D_RGBD_IMAGE_DATA* pstDepthImage, MV3D_RGBD_IMAGE_DATA* pstPointCloudImage);
/************************************************************************
* @~chinese
* @brief RGBD相机深度图像转换点云图像无句柄
* @param pstDepthImage [IN] 深度图数据
* @param pstCalibInfo [IN] 标定信息
* @param fZunit [IN] 深度图量纲(mm)
* @param pstPointCloudImage [OUT] 点云图数据
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief depth image convert to pointcloud image without handle
* @param pstDepthImage [IN] depth data
* @param pstCalibInfo [IN] calib info
* @param fZunit [IN] dimension(mm)
* @param pstPointCloudImage [OUT] point cloud data
* @return Success, return MV3D_RGBD_OK. Failure,return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_MapDepthToPointCloudEx(MV3D_RGBD_IMAGE_DATA* pstDepthImage, MV3D_RGBD_CALIB_INFO* pstCalibInfo, float fZunit, MV3D_RGBD_IMAGE_DATA* pstPointCloudImage);
/************************************************************************
* @~chinese
* @brief 图像坐标系转换
* @param pstInImage [IN] 输入图像数据
* @param fZunit [IN] 深度图量纲(mm)
* @param pstOutImage [OUT] 输出图像数据
* @param pstCameraParam [IN][OUT] 相机参数
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief image convert coordinate to rgb coordinate
* @param pstInImage [IN] input image data
* @param fZunit [IN] dimension(mm)
* @param pstOutImage [OUT] output image data
* @param pstCameraParam [IN][OUT] camera param
* @return Success, return MV3D_RGBD_OK. Failure,return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_ImageCoordinateTrans(MV3D_RGBD_IMAGE_DATA* pstInImage, float fZunit, MV3D_RGBD_IMAGE_DATA* pstOutImage, MV3D_RGBD_CAMERA_PARAM* pstCameraParam);
/************************************************************************
* @~chinese
* @brief 深度图,RGB图和原始图存图接口
* 深度图格式:C16
* RGB图格式:RGB8_Planar/YUV422/YUV420SP_NV12/YUV420SP_NV21
* 原始图格式:Mono8(仅支持bmp格式)
* @param handle [IN] 相机句柄
* @param pstImage [IN] 图像数据
* @param enFileType [IN] 文件类型
* @param chFileName [IN] 文件名称
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief depth and rgb image save image to file
* depth image format: C16
* rgb image format: RGB8_Planar/YUV422/YUV420SP_NV12/YUV420SP_NV21
* mono image format: Mono8(only support bmp file type)
* @param handle [IN] camera handle
* @param pstImage [IN] image data
* @param enFileType [IN] file type
* @param chFileName [IN] file name
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_SaveImage(void* handle, MV3D_RGBD_IMAGE_DATA* pstImage, Mv3dRgbdFileType enFileType, const char* chFileName);
/************************************************************************
* @~chinese
* @brief 点云图存图接口
* @param handle [IN] 相机句柄
* @param pstImage [IN] 图像数据
* @param enPointCloudFileType [IN] 点云图文件类型
* @param chFileName [IN] 文件名称
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief pointcloud image save image to file
* @param handle [IN] camera handle
* @param pstImage [IN] image data
* @param enPointCloudFileType [IN] pointcloud image file type
* @param chFileName [IN] file name
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_SavePointCloudImage(void* handle, MV3D_RGBD_IMAGE_DATA* pstImage, Mv3dRgbdPointCloudFileType enPointCloudFileType, const char* chFileName);
/************************************************************************
* @~chinese
* @brief 纹理点云存图接口
* 纹理图格式:RGB8_Planar/YUV422/YUV420SP_NV12/YUV420SP_NV21
* 保存的点云图格式:PLY_ASCII
* @param handle [IN] 相机句柄
* @param pstPointCloudImage [IN] 点云图像数据
* @param pstTexture [IN] 图像纹理数据
* @param enPointCloudFileType [IN] 点云图文件类型
* @param chFileName [IN] 文件名称
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief textured pointcloud image save image to file
* textured image format: RGB8_Planar/YUV422/YUV420SP_NV12/YUV420SP_NV21
* saved pointcloud image format: PLY_ASCII
* @param handle [IN] camera handle
* @param pstPointCloudImage [IN] pointcloude image data
* @param pstTexture [IN] image texture data
* @param enPointCloudFileType [IN] pointcloud image file type
* @param chFileName [IN] file name
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_SaveTexturedPointCloudImage(void* handle, MV3D_RGBD_IMAGE_DATA* pstPointCloudImage, MV3D_RGBD_IMAGE_DATA* pstTexture, Mv3dRgbdPointCloudFileType enPointCloudFileType, const char* chFileName);
/************************************************************************
* @~chinese
* @brief 显示深度和RGB图像接口
* 深度图格式:C16
* RGB图格式:RGB8_Planar/YUV422/YUV420SP_NV12/YUV420SP_NV21
* @param handle [IN] 相机句柄
* @param pstImage [IN] 图像数据
* @param hWnd [IN] 窗口句柄
* @return 成功返回MV3D_RGBD_OK错误返回错误码
* @~english
* @brief display depth and rgb image
* depth image format: C16
* rgb image format: RGB8_Planar/YUV422/YUV420SP_NV12/YUV420SP_NV21
* @param handle [IN] camera handle
* @param pstImage [IN] image data
* @param hWnd [IN] windows handle
* @return Success, return MV3D_RGBD_OK. Failure, return error code
************************************************************************/
MV3D_RGBD_API MV3D_RGBD_STATUS MV3D_RGBD_DisplayImage(void* handle, MV3D_RGBD_IMAGE_DATA* pstImage, void* hWnd);
#ifdef __cplusplus
}
#endif
#endif // _MV3D_RGBD_IMG_PROC_H_

View File

@@ -0,0 +1,159 @@
#ifndef SAMPLE_COMMON_RENDERIMAGE_HPP_
#define SAMPLE_COMMON_RENDERIMAGE_HPP_
#include "RenderWindow.hpp"
using namespace RenderImage;
static int CoverYuv422_T_RGB_Pixel(int y, int u, int v)
{
unsigned int pixel32 = 0;
unsigned char *pixel = (unsigned char *)&pixel32;
int r, g, b;
r = y + (1.370705 * (v - 128));
g = y - (0.698001 * (v - 128)) - (0.337633 * (u - 128));
b = y + (1.732446 * (u - 128));
if (r > 255)
{
r = 255;
}
if (g > 255)
{
g = 255;
}
if (b > 255)
{
b = 255;
}
if (r < 0)
{
r = 0;
}
if (g < 0)
{
g = 0;
}
if (b < 0)
{
b = 0;
}
pixel[0] = r;
pixel[1] = g;
pixel[2] = b;
return pixel32;
}
static void YUV422_T_RGB(unsigned int nWidth, unsigned int nHeight,const unsigned char *pYUVSrc, unsigned char *pRGBDst)
{
unsigned int in, out = 0;
unsigned int pixel_16;
unsigned char pixel_24[3];
unsigned int pixel32;
int y0, u, y1, v;
if ((pYUVSrc == NULL) || (pRGBDst == NULL))
{
return;
}
for (in = 0; in < nWidth * nHeight * 2; in += 4)
{
pixel_16 =
pYUVSrc[in + 3] << 24 |
pYUVSrc[in + 2] << 16 |
pYUVSrc[in + 1] << 8 |
pYUVSrc[in + 0];
y0 = (pixel_16 & 0x000000ff);
u = (pixel_16 & 0x0000ff00) >> 8;
y1 = (pixel_16 & 0x00ff0000) >> 16;
v = (pixel_16 & 0xff000000) >> 24;
pixel32 = CoverYuv422_T_RGB_Pixel(y0, u, v);
pixel_24[0] = (pixel32 & 0x000000ff);
pixel_24[1] = (pixel32 & 0x0000ff00) >> 8;
pixel_24[2] = (pixel32 & 0x00ff0000) >> 16;
pRGBDst[out++] = pixel_24[0];
pRGBDst[out++] = pixel_24[1];
pRGBDst[out++] = pixel_24[2];
pixel32 = CoverYuv422_T_RGB_Pixel(y1, u, v);
pixel_24[0] = (pixel32 & 0x000000ff);
pixel_24[1] = (pixel32 & 0x0000ff00) >> 8;
pixel_24[2] = (pixel32 & 0x00ff0000) >> 16;
pRGBDst[out++] = pixel_24[0];
pRGBDst[out++] = pixel_24[1];
pRGBDst[out++] = pixel_24[2];
}
return;
}
static int parseFrame(MV3D_RGBD_FRAME_DATA* pstFrameData, RIFrameInfo* pDepth
, RIFrameInfo* pRgb, RIFrameInfo* pRgbd)
{
for (unsigned int i = 0; i < pstFrameData->nImageCount; i++)
{
//LOGD("parseFrame : framenum (%d) height(%d) width(%d) len (%d)!", pstFrameData->stImageData[i].nFrameNum,
// pstFrameData->stImageData[i].nHeight, pstFrameData->stImageData[i].nWidth, pstFrameData->stImageData[i].nDataLen);
if (ImageType_Depth == pstFrameData->stImageData[i].enImageType)
{
pDepth->enPixelType = RIPixelType_Coord3D_C16;
pDepth->nFrameNum = pstFrameData->stImageData[i].nFrameNum;
pDepth->nHeight = pstFrameData->stImageData[i].nHeight;
pDepth->nWidth = pstFrameData->stImageData[i].nWidth;
pDepth->nFrameLength= pstFrameData->stImageData[i].nDataLen;
pDepth->pData = pstFrameData->stImageData[i].pData;
}
if (ImageType_RGB8_Planar == pstFrameData->stImageData[i].enImageType)
{
pRgb->enPixelType = RIPixelType_RGB8_Planar;
pRgb->nFrameNum = pstFrameData->stImageData[i].nFrameNum;
pRgb->nHeight = pstFrameData->stImageData[i].nHeight;
pRgb->nWidth = pstFrameData->stImageData[i].nWidth;
pRgb->nFrameLength = pstFrameData->stImageData[i].nDataLen;
pRgb->pData = pstFrameData->stImageData[i].pData;
}
if (ImageType_YUV422 == pstFrameData->stImageData[i].enImageType)
{
int nDstImageLen = pstFrameData->stImageData[i].nWidth * pstFrameData->stImageData[i].nHeight * 3;
static unsigned char* pRGBBuffer = NULL;
static unsigned int nImageLen = nDstImageLen;
if (pRGBBuffer == NULL || nImageLen != nDstImageLen)
{
nImageLen = nDstImageLen;
pRGBBuffer = (unsigned char *)malloc(nImageLen * sizeof(unsigned char));
if (pRGBBuffer == NULL)
{
// LOGD("YUV422 buffer malloc fail!");
return -1;
}
memset(pRGBBuffer, 0x00, nImageLen * sizeof(unsigned char));
// LOGD("YUV422 buffer malloc success!");
}
YUV422_T_RGB(pstFrameData->stImageData[i].nWidth, pstFrameData->stImageData[i].nHeight, pstFrameData->stImageData[i].pData, pRGBBuffer);
pRgb->enPixelType = RIPixelType_RGB8_Packed;
pRgb->nFrameNum = pstFrameData->stImageData[i].nFrameNum;
pRgb->nHeight = pstFrameData->stImageData[i].nHeight;
pRgb->nWidth = pstFrameData->stImageData[i].nWidth;
pRgb->nFrameLength = nDstImageLen;
pRgb->pData = pRGBBuffer;
}
if (ImageType_Rgbd == pstFrameData->stImageData[i].enImageType)
{
pRgbd->enPixelType = RIPixelType_RGBD_C16;
pRgbd->nFrameNum = pstFrameData->stImageData[i].nFrameNum;
pRgbd->nHeight = pstFrameData->stImageData[i].nHeight;
pRgbd->nWidth = pstFrameData->stImageData[i].nWidth;
pRgbd->nFrameLength = pstFrameData->stImageData[i].nDataLen;
pRgbd->pData = pstFrameData->stImageData[i].pData;
}
}
return 0;
}
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff