OniCAPI.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * *
3 * OpenNI 2.x Alpha *
4 * Copyright (C) 2012 PrimeSense Ltd. *
5 * *
6 * This file is part of OpenNI. *
7 * *
8 * Licensed under the Apache License, Version 2.0 (the "License"); *
9 * you may not use this file except in compliance with the License. *
10 * You may obtain a copy of the License at *
11 * *
12 * http://www.apache.org/licenses/LICENSE-2.0 *
13 * *
14 * Unless required by applicable law or agreed to in writing, software *
15 * distributed under the License is distributed on an "AS IS" BASIS, *
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
17 * See the License for the specific language governing permissions and *
18 * limitations under the License. *
19 * *
20 *****************************************************************************/
21 #ifndef ONICAPI_H
22 #define ONICAPI_H
23 
24 #include "OniPlatform.h"
25 #include "OniCTypes.h"
26 #include "OniCProperties.h"
27 #include "OniVersion.h"
28 
29 /******************************************** General APIs */
30 
32 ONI_C_API OniStatus oniInitialize(int apiVersion);
34 ONI_C_API void oniShutdown();
35 
41 ONI_C_API OniStatus oniGetDeviceList(OniDeviceInfo** pDevices, int* pNumDevices);
44 
47 
49 ONI_C_API OniStatus oniWaitForAnyStream(OniStreamHandle* pStreams, int numStreams, int* pStreamIndex, int timeout);
50 
53 
56 
58 ONI_C_API const char* oniGetExtendedError();
59 
60 /******************************************** Device APIs */
61 
63 ONI_C_API OniStatus oniDeviceOpen(const char* uri, OniDeviceHandle* pDevice);
66 
69 
72 
75 
79 
81 ONI_C_API OniStatus oniDeviceSetProperty(OniDeviceHandle device, int propertyId, const void* data, int dataSize);
83 ONI_C_API OniStatus oniDeviceGetProperty(OniDeviceHandle device, int propertyId, void* data, int* pDataSize);
87 ONI_C_API OniStatus oniDeviceInvoke(OniDeviceHandle device, int commandId, void* data, int dataSize);
90 
92 
94 ONI_C_API OniStatus oniDeviceOpenEx(const char* uri, const char* mode, OniDeviceHandle* pDevice);
95 
96 /******************************************** Stream APIs */
97 
100 
103 
108 
111 
116 
118 ONI_C_API OniStatus oniStreamSetProperty(OniStreamHandle stream, int propertyId, const void* data, int dataSize);
120 ONI_C_API OniStatus oniStreamGetProperty(OniStreamHandle stream, int propertyId, void* data, int* pDataSize);
124 ONI_C_API OniStatus oniStreamInvoke(OniStreamHandle stream, int commandId, void* data, int dataSize);
129 
131 
132 ONI_C_API void oniFrameAddRef(OniFrame* pFrame);
134 ONI_C_API void oniFrameRelease(OniFrame* pFrame);
135 
136 /*add by xlj*/
137 ONI_C_API void oniStreamfilter(OniStreamHandle stream, void* buf, int newVal, int maxSpeckleSize, int maxDiff);
138 
139 // ONI_C_API OniStatus oniConvertRealWorldToProjective(OniStreamHandle stream, OniFloatPoint3D* pRealWorldPoint, OniFloatPoint3D* pProjectivePoint);
140 // ONI_C_API OniStatus oniConvertProjectiveToRealWorld(OniStreamHandle stream, OniFloatPoint3D* pProjectivePoint, OniFloatPoint3D* pRealWorldPoint);
141 
149 ONI_C_API OniStatus oniCreateRecorder(const char* fileName, OniRecorderHandle* pRecorder);
150 
162  OniRecorderHandle recorder,
163  OniStreamHandle stream,
164  OniBool allowLossyCompression);
165 
174 
182 
191 
192 ONI_C_API OniStatus oniCoordinateConverterDepthToWorld(OniStreamHandle depthStream, float depthX, float depthY, float depthZ, float* pWorldX, float* pWorldY, float* pWorldZ);
193 
194 ONI_C_API OniStatus oniCoordinateConverterWorldToDepth(OniStreamHandle depthStream, float worldX, float worldY, float worldZ, float* pDepthX, float* pDepthY, float* pDepthZ);
195 
196 ONI_C_API OniStatus oniCoordinateConverterDepthToColor(OniStreamHandle depthStream, OniStreamHandle colorStream, int depthX, int depthY, OniDepthPixel depthZ, int* pColorX, int* pColorY);
197 
198 ONI_C_API OniStatus oniCoordinateConverterC2D(OniStreamHandle depthStream, int colorX, int colorY, OniDepthPixel depthZ, int* pDepthX, int* pDepthY);
199 ONI_C_API OniStatus oniCoordinateConverterD2C(OniStreamHandle depthStream, int colorX, int colorY, OniDepthPixel depthZ, int* pDepthX, int* pDepthY);
200 /******************************************** Log APIs */
201 
210 ONI_C_API OniStatus oniSetLogOutputFolder(const char* strOutputFolder);
211 
221 ONI_C_API OniStatus oniGetLogFileName(char* strFileName, int nBufferSize);
222 
231 ONI_C_API OniStatus oniSetLogMinSeverity(int nMinSeverity);
232 
242 
252 
253 #if ONI_PLATFORM == ONI_PLATFORM_ANDROID_ARM
254 
262 ONI_C_API OniStatus oniSetLogAndroidOutput(OniBool bAndroidOutput);
263 #endif
264 #endif // ONICAPI_H
ONI_C_API const char * oniGetExtendedError()
ONI_C_API OniStatus oniCoordinateConverterWorldToDepth(OniStreamHandle depthStream, float worldX, float worldY, float worldZ, float *pDepthX, float *pDepthY, float *pDepthZ)
ONI_C_API OniStatus oniDeviceGetInfo(OniDeviceHandle device, OniDeviceInfo *pInfo)
struct OniCallbackHandleImpl * OniCallbackHandle
Definition: OniCTypes.h:41
OniImageRegistrationMode
Definition: OniCEnums.h:72
ONI_C_API void oniStreamStop(OniStreamHandle stream)
ONI_C_API OniStatus oniRecorderStart(OniRecorderHandle recorder)
ONI_C_API OniStatus oniCoordinateConverterD2C(OniStreamHandle depthStream, int colorX, int colorY, OniDepthPixel depthZ, int *pDepthX, int *pDepthY)
ONI_C_API OniStatus oniStreamReadFrame(OniStreamHandle stream, OniFrame **pFrame)
ONI_C_API const OniSensorInfo * oniStreamGetSensorInfo(OniStreamHandle stream)
ONI_C_API OniStatus oniDeviceOpen(const char *uri, OniDeviceHandle *pDevice)
ONI_C_API OniStatus oniDeviceOpenEx(const char *uri, const char *mode, OniDeviceHandle *pDevice)
void *(ONI_CALLBACK_TYPE * OniFrameAllocBufferCallback)(int size, void *pCookie)
Definition: OniCTypes.h:131
ONI_C_API OniStatus oniStreamGetProperty(OniStreamHandle stream, int propertyId, void *data, int *pDataSize)
ONI_C_API OniStatus oniDeviceCreateStream(OniDeviceHandle device, OniSensorType sensorType, OniStreamHandle *pStream)
ONI_C_API OniStatus oniDeviceInvoke(OniDeviceHandle device, int commandId, void *data, int dataSize)
ONI_C_API OniStatus oniStreamInvoke(OniStreamHandle stream, int commandId, void *data, int dataSize)
struct _OniRecorder * OniRecorderHandle
Definition: OniCTypes.h:103
ONI_C_API OniStatus oniStreamRegisterNewFrameCallback(OniStreamHandle stream, OniNewFrameCallback handler, void *pCookie, OniCallbackHandle *pHandle)
ONI_C_API OniBool oniDeviceIsCommandSupported(OniDeviceHandle device, int commandId)
ONI_C_API OniBool oniDeviceGetDepthColorSyncEnabled(OniDeviceHandle device)
int OniBool
Definition: OniCTypes.h:28
ONI_C_API OniStatus oniDeviceEnableDepthColorSync(OniDeviceHandle device)
ONI_C_API OniStatus oniSetLogConsoleOutput(OniBool bConsoleOutput)
void(ONI_CALLBACK_TYPE * OniFrameFreeBufferCallback)(void *data, void *pCookie)
Definition: OniCTypes.h:132
ONI_C_API OniStatus oniDeviceGetProperty(OniDeviceHandle device, int propertyId, void *data, int *pDataSize)
ONI_C_API OniStatus oniGetLogFileName(char *strFileName, int nBufferSize)
ONI_C_API OniStatus oniStreamStart(OniStreamHandle stream)
ONI_C_API void oniShutdown()
ONI_C_API OniStatus oniCreateRecorder(const char *fileName, OniRecorderHandle *pRecorder)
ONI_C_API OniStatus oniDeviceClose(OniDeviceHandle device)
ONI_C_API void oniUnregisterDeviceCallbacks(OniCallbackHandle handle)
ONI_C_API OniStatus oniStreamSetProperty(OniStreamHandle stream, int propertyId, const void *data, int dataSize)
ONI_C_API void oniStreamDestroy(OniStreamHandle stream)
#define ONI_C_API
Definition: OniPlatform.h:67
ONI_C_API OniBool oniStreamIsPropertySupported(OniStreamHandle stream, int propertyId)
ONI_C_API OniBool oniDeviceIsPropertySupported(OniDeviceHandle device, int propertyId)
ONI_C_API OniVersion oniGetVersion()
OniSensorType
Definition: OniCEnums.h:38
ONI_C_API OniStatus oniDeviceSetProperty(OniDeviceHandle device, int propertyId, const void *data, int dataSize)
ONI_C_API void oniStreamUnregisterNewFrameCallback(OniStreamHandle stream, OniCallbackHandle handle)
ONI_C_API OniStatus oniReleaseDeviceList(OniDeviceInfo *pDevices)
ONI_C_API OniStatus oniRecorderAttachStream(OniRecorderHandle recorder, OniStreamHandle stream, OniBool allowLossyCompression)
ONI_C_API OniStatus oniCoordinateConverterDepthToWorld(OniStreamHandle depthStream, float depthX, float depthY, float depthZ, float *pWorldX, float *pWorldY, float *pWorldZ)
ONI_C_API OniBool oniStreamIsCommandSupported(OniStreamHandle stream, int commandId)
ONI_C_API const OniSensorInfo * oniDeviceGetSensorInfo(OniDeviceHandle device, OniSensorType sensorType)
ONI_C_API OniBool oniDeviceIsImageRegistrationModeSupported(OniDeviceHandle device, OniImageRegistrationMode mode)
ONI_C_API OniStatus oniRegisterDeviceCallbacks(OniDeviceCallbacks *pCallbacks, void *pCookie, OniCallbackHandle *pHandle)
ONI_C_API OniStatus oniInitialize(int apiVersion)
ONI_C_API OniStatus oniCoordinateConverterC2D(OniStreamHandle depthStream, int colorX, int colorY, OniDepthPixel depthZ, int *pDepthX, int *pDepthY)
ONI_C_API void oniStreamfilter(OniStreamHandle stream, void *buf, int newVal, int maxSpeckleSize, int maxDiff)
ONI_C_API void oniRecorderStop(OniRecorderHandle recorder)
void(ONI_CALLBACK_TYPE * OniNewFrameCallback)(OniStreamHandle stream, void *pCookie)
Definition: OniCTypes.h:126
ONI_C_API OniStatus oniGetDeviceList(OniDeviceInfo **pDevices, int *pNumDevices)
ONI_C_API OniStatus oniRecorderDestroy(OniRecorderHandle *pRecorder)
ONI_C_API OniStatus oniSetLogOutputFolder(const char *strOutputFolder)
uint16_t OniDepthPixel
Definition: OniCTypes.h:154
ONI_C_API void oniFrameAddRef(OniFrame *pFrame)
ONI_C_API OniStatus oniWaitForAnyStream(OniStreamHandle *pStreams, int numStreams, int *pStreamIndex, int timeout)
OniPixelFormat
Definition: OniCEnums.h:47
ONI_C_API OniStatus oniStreamSetFrameBuffersAllocator(OniStreamHandle stream, OniFrameAllocBufferCallback alloc, OniFrameFreeBufferCallback free, void *pCookie)
ONI_C_API OniStatus oniCoordinateConverterDepthToColor(OniStreamHandle depthStream, OniStreamHandle colorStream, int depthX, int depthY, OniDepthPixel depthZ, int *pColorX, int *pColorY)
struct _OniDevice * OniDeviceHandle
Definition: OniCTypes.h:97
OniStatus
Definition: OniCEnums.h:25
ONI_C_API int oniFormatBytesPerPixel(OniPixelFormat format)
void * pCookie
Definition: OniDriverAPI.h:35
ONI_C_API OniStatus oniSetLogFileOutput(OniBool bFileOutput)
ONI_C_API OniStatus oniSetLogMinSeverity(int nMinSeverity)
ONI_C_API void oniDeviceDisableDepthColorSync(OniDeviceHandle device)
struct _OniStream * OniStreamHandle
Definition: OniCTypes.h:100
ONI_C_API void oniFrameRelease(OniFrame *pFrame)


astra_camera
Author(s): Tim Liu
autogenerated on Wed Dec 16 2020 03:54:34