PSLink.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002 *                                                                            *
00003 *  OpenNI 2.x Alpha                                                          *
00004 *  Copyright (C) 2012 PrimeSense Ltd.                                        *
00005 *                                                                            *
00006 *  This file is part of OpenNI.                                              *
00007 *                                                                            *
00008 *  Licensed under the Apache License, Version 2.0 (the "License");           *
00009 *  you may not use this file except in compliance with the License.          *
00010 *  You may obtain a copy of the License at                                   *
00011 *                                                                            *
00012 *      http://www.apache.org/licenses/LICENSE-2.0                            *
00013 *                                                                            *
00014 *  Unless required by applicable law or agreed to in writing, software       *
00015 *  distributed under the License is distributed on an "AS IS" BASIS,         *
00016 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *
00017 *  See the License for the specific language governing permissions and       *
00018 *  limitations under the License.                                            *
00019 *                                                                            *
00020 *****************************************************************************/
00021 #ifndef PSLINK_H
00022 #define PSLINK_H
00023 
00024 #include <PrimeSense.h>
00025 
00026 enum
00027 {
00028         /**** Device properties ****/
00029 
00030         /* XnDetailedVersion, get only */
00031         LINK_PROP_FW_VERSION = 0x12000001, // "FWVersion"
00032         /* Int, get only */
00033         LINK_PROP_VERSIONS_INFO_COUNT = 0x12000002, // "VersionsInfoCount"
00034         /* General - array - XnComponentVersion * count elements, get only */
00035         LINK_PROP_VERSIONS_INFO = 0x12000003, // "VersionsInfo"
00036         /* Int - 0 means off, 1 means on. */
00037         LINK_PROP_PROJECTOR_ACTIVE = 0x12000008, // "ProjectorActive"
00038         /* String. Set only */
00039         LINK_PROP_PRESET_FILE = 0x1200000a, // "PresetFile"
00040         /* Get only */
00041         LINK_PROP_BOOT_STATUS = 0x1200000b,
00042         /* Int - system specific units */
00043     LINK_PROP_PROJECTOR_POWER = 0x1200000c,
00044     /* SetAccActive*/   
00045     LINK_PROP_ACC_ENABLED = 0x1200000d, 
00046     /* SetAccActive*/   
00047     LINK_PROP_VDD_ENABLED = 0x1200000e, 
00048     /* SetAccActive*/   
00049     LINK_PROP_PERIODIC_BIST_ENABLED = 0x1200000f, 
00050 
00051 
00052         /**** Device commands ****/
00053         /* XnCommandGetFwStreams */
00054         LINK_COMMAND_GET_FW_STREAM_LIST = 0x1200F001,
00055         /* XnCommandCreateStream */
00056         LINK_COMMAND_CREATE_FW_STREAM = 0x1200F002,
00057         /* XnCommandDestroyStream */
00058         LINK_COMMAND_DESTROY_FW_STREAM = 0x1200F003,
00059         /* XnCommandStartStream */
00060         LINK_COMMAND_START_FW_STREAM = 0x1200F004,
00061         /* XnCommandStopStream */
00062         LINK_COMMAND_STOP_FW_STREAM = 0x1200F005,
00063         /* XnCommandGetFwStreamVideoModeList */
00064         LINK_COMMAND_GET_FW_STREAM_VIDEO_MODE_LIST = 0x1200F006,
00065         /* XnCommandSetFwStreamVideoMode */
00066         LINK_COMMAND_SET_FW_STREAM_VIDEO_MODE = 0x1200F007,
00067         /* XnCommandGetFwStreamVideoMode */
00068         LINK_COMMAND_GET_FW_STREAM_VIDEO_MODE = 0x1200F008,
00069         /* XnCommandSetProjectorPulse */
00070         LINK_COMMAND_SET_PROJECTOR_PULSE = 0x1200F009,
00071         /* No args */
00072     LINK_COMMAND_DISABLE_PROJECTOR_PULSE = 0x1200F00a,
00073 
00074         /**** Stream properties ****/
00075         /* Int. 1 - Shifts 9.3, 2 - Grayscale16, 3 - YUV422, 4 - Bayer8 */
00076         LINK_PROP_PIXEL_FORMAT = 0x12001001, // "PixelFormat"
00077         /* Int. 0 - None, 1 - 8z, 2 - 16z, 3 - 24z, 4 - 6-bit, 5 - 10-bit, 6 - 11-bit, 7 - 12-bit */
00078         LINK_PROP_COMPRESSION = 0x12001002, // "Compression"
00079 
00080         /**** Depth Stream properties ****/
00081         /* Real, get only */
00082         LINK_PROP_DEPTH_SCALE = 0x1200000b, // "DepthScale"
00083         /* Int, get only */
00084         LINK_PROP_MAX_SHIFT = 0x12002001, // "MaxShift"
00085         /* Int, get only */
00086         LINK_PROP_ZERO_PLANE_DISTANCE = 0x12002002, // "ZPD"
00087         /* Int, get only */
00088         LINK_PROP_CONST_SHIFT = 0x12002003, // "ConstShift"
00089         /* Int, get only */
00090         LINK_PROP_PARAM_COEFF = 0x12002004, // "ParamCoeff"
00091         /* Int, get only */
00092         LINK_PROP_SHIFT_SCALE = 0x12002005, // "ShiftScale"
00093         /* Real, get only */
00094         LINK_PROP_ZERO_PLANE_PIXEL_SIZE = 0x12002006, // "ZPPS"
00095         /* Real, get only */
00096         LINK_PROP_ZERO_PLANE_OUTPUT_PIXEL_SIZE = 0x12002007, // "ZPOPS"
00097         /* Real, get only */
00098         LINK_PROP_EMITTER_DEPTH_CMOS_DISTANCE = 0x12002008, // "LDDIS"
00099         /*  General - array - MaxShift * XnDepthPixel elements, get only */
00100         LINK_PROP_SHIFT_TO_DEPTH_TABLE = 0x12002009, // "S2D"
00101         /* General - array - MaxDepth * uint16_t elements, get only */
00102         LINK_PROP_DEPTH_TO_SHIFT_TABLE = 0x1200200a, // "D2S"
00103 };
00104 
00105 typedef enum XnFileZone
00106 {
00107         XN_ZONE_FACTORY                 = 0x0000,
00108         XN_ZONE_UPDATE                  = 0x0001,
00109 } XnFileZone;
00110 
00111 typedef enum XnBootErrorCode
00112 {
00113         XN_BOOT_OK                      = 0x0000,
00114         XN_BOOT_BAD_CRC                 = 0x0001,
00115         XN_BOOT_UPLOAD_IN_PROGRESS      = 0x0002,
00116         XN_BOOT_FW_LOAD_FAILED          = 0x0003,
00117 } XnBootErrorCode;
00118 
00119 typedef enum XnFwStreamType
00120 {
00121         XN_FW_STREAM_TYPE_COLOR                 = 0x0001,
00122         XN_FW_STREAM_TYPE_IR                    = 0x0002,
00123         XN_FW_STREAM_TYPE_SHIFTS                = 0x0003,
00124         XN_FW_STREAM_TYPE_AUDIO                 = 0x0004,
00125         XN_FW_STREAM_TYPE_DY                    = 0x0005,
00126         XN_FW_STREAM_TYPE_LOG                   = 0x0008,
00127 } XnFwStreamType;
00128 
00129 typedef enum XnFwPixelFormat
00130 {
00131         XN_FW_PIXEL_FORMAT_NONE                 = 0x0000,
00132         XN_FW_PIXEL_FORMAT_SHIFTS_9_3   = 0x0001,
00133         XN_FW_PIXEL_FORMAT_GRAYSCALE16  = 0x0002,
00134         XN_FW_PIXEL_FORMAT_YUV422               = 0x0003,
00135         XN_FW_PIXEL_FORMAT_BAYER8               = 0x0004,
00136 } XnFwPixelFormat;
00137 
00138 typedef enum XnFwCompressionType
00139 {
00140         XN_FW_COMPRESSION_NONE                  = 0x0000,
00141         XN_FW_COMPRESSION_8Z                    = 0x0001,
00142         XN_FW_COMPRESSION_16Z                   = 0x0002,
00143         XN_FW_COMPRESSION_24Z                   = 0x0003,
00144         XN_FW_COMPRESSION_6_BIT_PACKED  = 0x0004,
00145         XN_FW_COMPRESSION_10_BIT_PACKED = 0x0005,
00146         XN_FW_COMPRESSION_11_BIT_PACKED = 0x0006,
00147         XN_FW_COMPRESSION_12_BIT_PACKED = 0x0007,
00148 } XnFwCompressionType;
00149 
00150 #pragma pack (push, 1)
00151 
00152 #define XN_MAX_VERSION_MODIFIER_LENGTH 16
00153 typedef struct XnDetailedVersion
00154 {
00155         uint8_t m_nMajor;
00156         uint8_t m_nMinor;
00157         uint16_t m_nMaintenance;
00158         uint32_t m_nBuild;
00159         char m_strModifier[XN_MAX_VERSION_MODIFIER_LENGTH];
00160 } XnDetailedVersion;
00161 
00162 typedef struct XnBootStatus
00163 {
00164         XnFileZone zone;
00165         XnBootErrorCode errorCode;
00166 } XnBootStatus;
00167 
00168 typedef struct XnFwStreamInfo
00169 {
00170         XnFwStreamType type;
00171         char creationInfo[80];
00172 } XnFwStreamInfo;
00173 
00174 typedef struct XnFwStreamVideoMode
00175 {
00176         uint32_t m_nXRes;
00177         uint32_t m_nYRes;
00178         uint32_t m_nFPS;
00179         XnFwPixelFormat m_nPixelFormat;
00180         XnFwCompressionType m_nCompression;
00181 } XnFwStreamVideoMode;
00182 
00183 typedef struct XnCommandGetFwStreamList
00184 {
00185         uint32_t count; // in: number of allocated elements in streams array. out: number of written elements in the array
00186         XnFwStreamInfo* streams;
00187 } XnCommandGetFwStreamList;
00188 
00189 typedef struct XnCommandCreateStream
00190 {
00191         XnFwStreamType type;
00192         const char* creationInfo;
00193         uint32_t id; // out
00194 } XnCommandCreateStream;
00195 
00196 typedef struct XnCommandDestroyStream
00197 {
00198         uint32_t id;
00199 } XnCommandDestroyStream;
00200 
00201 typedef struct XnCommandStartStream
00202 {
00203         uint32_t id;
00204 } XnCommandStartStream;
00205 
00206 typedef struct XnCommandStopStream
00207 {
00208         uint32_t id;
00209 } XnCommandStopStream;
00210 
00211 typedef struct XnCommandGetFwStreamVideoModeList
00212 {
00213         int streamId;
00214         uint32_t count; // in: number of allocated elements in videoModes array. out: number of written elements in the array
00215         XnFwStreamVideoMode* videoModes;
00216 } XnCommandGetFwStreamVideoModeList;
00217 
00218 typedef struct XnCommandSetFwStreamVideoMode
00219 {
00220         int streamId;
00221         XnFwStreamVideoMode videoMode;
00222 } XnCommandSetFwStreamVideoMode;
00223 
00224 typedef struct XnCommandGetFwStreamVideoMode
00225 {
00226         int streamId;
00227         XnFwStreamVideoMode videoMode; // out
00228 } XnCommandGetFwStreamVideoMode;
00229 
00230 typedef struct XnCommandSetProjectorPulse
00231 {
00232         float delay; //start delay - delay time before start pulse
00233         float width; //DC - duty cycle - the percentage of the pulse out of total cycle
00234         float cycle;
00235 } XnCommandSetProjectorPulse;
00236 
00237 #pragma pack (pop)
00238 
00239 #endif // PSLINK_H


astra_camera
Author(s): Tim Liu
autogenerated on Wed Jul 10 2019 03:18:55