Académique Documents
Professionnel Documents
Culture Documents
NET Wrapper
Generated by Doxygen 1.5.9
Wed Sep 19 12:02:08 2012
Contents
1
1.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3
Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Module Index
2.1
143
File Index
4.1
Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Class Index
3.1
141
145
Module Documentation
147
5.1
5.2
5.2.2
5.2.3
5.2.2.1
EFactoryError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.2.2.2
EFactoryInfoType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.2.2.3
ECameraInfoType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
GetFactoryErrorString . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.2.3.2
J_Factory_Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.2.3.3
J_Factory_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.2.3.4
J_Factory_GetInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.2.3.5
J_Factory_UpdateCameraList . . . . . . . . . . . . . . . . . . . . . . . 153
5.2.3.6
J_Factory_GetNumOfCameras . . . . . . . . . . . . . . . . . . . . . . 154
5.2.3.7
J_Factory_GetCameraIDByIndex . . . . . . . . . . . . . . . . . . . . . 155
ii
CONTENTS
5.2.3.8
J_Factory_GetCameraInfo . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.2.3.9
J_Factory_EnableForceIp . . . . . . . . . . . . . . . . . . . . . . . . . 156
5.3.2
5.4
5.5
5.6
5.7
J_Factory_SendActionCommand . . . . . . . . . . . . . . . . . . . . . 158
5.4.2
EDeviceAccessFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
5.4.2.2
EConfInfoType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
5.4.2.3
EConfVisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
5.4.2.4
EConfNodeType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
5.4.2.5
EConfAccessMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.4.2.6
EConfNameSpace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.4.2.7
EConfCachingMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.4.2.8
EConfRepresentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.4.2.9
EDisplayNotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
5.5.2
J_Camera_Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5.5.2.2
J_Camera_OpenMc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.5.2.3
J_Camera_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.6.2
J_Camera_GetValueInt64 . . . . . . . . . . . . . . . . . . . . . . . . . 167
5.6.2.2
J_Camera_GetValueDouble . . . . . . . . . . . . . . . . . . . . . . . . 168
5.6.2.3
J_Camera_GetValueString . . . . . . . . . . . . . . . . . . . . . . . . 168
5.6.2.4
J_Camera_SetValueInt64 . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.6.2.5
J_Camera_SetValueDouble . . . . . . . . . . . . . . . . . . . . . . . . 169
5.6.2.6
J_Camera_SetValueString . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.6.2.7
J_Camera_ExecuteCommand . . . . . . . . . . . . . . . . . . . . . . . 170
CONTENTS
iii
5.7.1
5.7.2
5.8
5.7.2.1
J_Camera_ReadData . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.7.2.2
J_Camera_WriteData . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.7.2.3
J_Camera_WriteData . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.8.2
5.9
J_Camera_GetConfigInfo . . . . . . . . . . . . . . . . . . . . . . . . . 174
5.9.2
J_Camera_GetNumOfNodes . . . . . . . . . . . . . . . . . . . . . . . 175
5.9.2.2
J_Camera_GetNodeByIndex . . . . . . . . . . . . . . . . . . . . . . . 176
5.9.2.3
J_Camera_GetNodeByName . . . . . . . . . . . . . . . . . . . . . . . 177
5.9.2.4
J_Camera_GetNumOfSubFeatures . . . . . . . . . . . . . . . . . . . . 178
5.9.2.5
J_Camera_GetSubFeatureByIndex . . . . . . . . . . . . . . . . . . . . 178
5.9.2.6
J_Camera_GetFeatureByName . . . . . . . . . . . . . . . . . . . . . . 179
5.9.2.7
J_Camera_InvalidateNodes . . . . . . . . . . . . . . . . . . . . . . . . 180
iv
CONTENTS
5.11.3.2 J_Camera_LoadSettings . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.11.3.3 J_Camera_GetSettingsValidationErrorInfo . . . . . . . . . . . . . . . . 187
5.12 Data Stream specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
5.12.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.12.2.1 EAcqQueueType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.12.2.2 EAcqStartFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.12.2.3 EAcqStopFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
5.12.2.4 EBufferInfoCmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.12.2.5 EStreamInfoCmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.12.2.6 EDataStreamParamCmd . . . . . . . . . . . . . . . . . . . . . . . . . . 193
5.12.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
5.12.3.1 J_DataStream_AnnounceBuffer . . . . . . . . . . . . . . . . . . . . . . 193
5.12.3.2 J_DataStream_FlushQueue . . . . . . . . . . . . . . . . . . . . . . . . 194
5.12.3.3 J_DataStream_StartAcquisition . . . . . . . . . . . . . . . . . . . . . . 195
5.12.3.4 J_DataStream_StopAcquisition . . . . . . . . . . . . . . . . . . . . . . 196
5.12.3.5 J_DataStream_GetStreamInfo . . . . . . . . . . . . . . . . . . . . . . . 197
5.12.3.6 J_DataStream_GetBufferID . . . . . . . . . . . . . . . . . . . . . . . . 197
5.12.3.7 J_DataStream_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
5.12.3.8 J_DataStream_RevokeBuffer . . . . . . . . . . . . . . . . . . . . . . . 198
5.12.3.9 J_DataStream_QueueBuffer . . . . . . . . . . . . . . . . . . . . . . . . 199
5.12.3.10 J_DataStream_GetBufferInfo . . . . . . . . . . . . . . . . . . . . . . . 200
5.12.3.11 J_DataStream_GetParam . . . . . . . . . . . . . . . . . . . . . . . . . 204
5.12.3.12 J_DataStream_SetParam . . . . . . . . . . . . . . . . . . . . . . . . . 205
5.13 Event Interface functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
5.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.13.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.13.2.1 EEventInfoID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.13.2.2 EDeviceEventType . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
5.13.2.3 EDeviceConnectionType . . . . . . . . . . . . . . . . . . . . . . . . . 208
5.13.2.4 ECondWaitResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
5.13.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
5.13.3.1 J_Event_GetData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
5.13.3.2 J_Event_GetInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
5.13.3.3 J_Event_Flush . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
5.13.3.4 J_Event_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
CONTENTS
vi
CONTENTS
5.17.2.12 J_Node_GetEventID . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
5.17.2.13 J_Node_GetIsStreamable . . . . . . . . . . . . . . . . . . . . . . . . . 242
5.17.2.14 J_Node_GetNumOfProperties . . . . . . . . . . . . . . . . . . . . . . . 242
5.17.2.15 J_Node_GetPropertyNameByIndex . . . . . . . . . . . . . . . . . . . . 242
5.17.2.16 J_Node_GetPropertyByName . . . . . . . . . . . . . . . . . . . . . . . 242
5.17.2.17 J_Node_ImposeAccessMode . . . . . . . . . . . . . . . . . . . . . . . 243
5.17.2.18 J_Node_ImposeVisibility . . . . . . . . . . . . . . . . . . . . . . . . . 243
5.17.2.19 J_Node_GetAlias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
5.17.2.20 NodeChangeDelegate . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
5.17.2.21 J_Node_RegisterCallback . . . . . . . . . . . . . . . . . . . . . . . . . 244
5.17.2.22 J_Node_GetType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
5.17.2.23 J_Node_GetIsSelector . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
5.17.2.24 J_Node_GetNumOfSelectedFeatures . . . . . . . . . . . . . . . . . . . 245
5.17.2.25 J_Node_GetSelectedFeatureByIndex . . . . . . . . . . . . . . . . . . . 245
5.17.2.26 J_Node_GetNumOfSelectingFeatures . . . . . . . . . . . . . . . . . . 245
5.17.2.27 J_Node_GetSelectingFeatureByIndex . . . . . . . . . . . . . . . . . . . 246
5.17.2.28 J_Node_GetRepresentation . . . . . . . . . . . . . . . . . . . . . . . . 246
5.17.2.29 J_Node_GetUnit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
5.17.2.30 J_Node_GetDocuURL . . . . . . . . . . . . . . . . . . . . . . . . . . 247
5.17.2.31 J_Node_GetIsDeprecated . . . . . . . . . . . . . . . . . . . . . . . . . 247
5.18 IInteger GenICam node specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . 248
5.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
5.18.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
5.18.2.1 J_Node_GetMinInt64 . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
5.18.2.2 J_Node_GetMaxInt64 . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
5.18.2.3 J_Node_GetInc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
5.18.2.4 J_Node_SetValueInt64 . . . . . . . . . . . . . . . . . . . . . . . . . . 250
5.18.2.5 J_Node_GetValueInt64 . . . . . . . . . . . . . . . . . . . . . . . . . . 250
5.18.2.6 J_Node_GetFloatAlias . . . . . . . . . . . . . . . . . . . . . . . . . . 251
5.19 IFloat GenICam node specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
5.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.19.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.19.2.1 J_Node_GetMinDouble . . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.19.2.2 J_Node_GetMaxDouble . . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.19.2.3 J_Node_SetValueDouble . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.19.2.4 J_Node_GetValueDouble . . . . . . . . . . . . . . . . . . . . . . . . . 254
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
CONTENTS
vii
5.19.2.5 J_Node_GetDisplayNotation . . . . . . . . . . . . . . . . . . . . . . . 254
5.19.2.6 J_Node_GetDisplayPrecision . . . . . . . . . . . . . . . . . . . . . . . 255
5.19.2.7 J_Node_GetFloatHasInc . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.19.2.8 J_Node_GetFloatInc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.19.2.9 J_Node_GetIntAlias . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.19.2.10 J_Node_GetEnumAlias . . . . . . . . . . . . . . . . . . . . . . . . . . 256
viii
CONTENTS
5.24.3.2 GetPixelTypeMemorySize . . . . . . . . . . . . . . . . . . . . . . . . . 270
5.25 View window specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
5.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
5.25.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 273
5.25.2.1 EIVWWindowType . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
5.25.2.2 EIVWOptionType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
5.25.2.3 EIVWCallbackType . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
5.25.2.4 EColorInterpolationAlgorithm . . . . . . . . . . . . . . . . . . . . . . 275
5.25.2.5 EColorConversionPixelFormat . . . . . . . . . . . . . . . . . . . . . . 275
5.25.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
5.25.3.1 J_Image_OpenViewWindow . . . . . . . . . . . . . . . . . . . . . . . 276
5.25.3.2 J_Image_OpenViewWindowEx . . . . . . . . . . . . . . . . . . . . . . 277
5.25.3.3 J_Image_CloseViewWindow . . . . . . . . . . . . . . . . . . . . . . . 277
5.25.3.4 J_Image_ShowImage . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
5.25.3.5 J_Image_ShowImage . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
5.25.3.6 J_Image_SetImageOffset . . . . . . . . . . . . . . . . . . . . . . . . . 278
5.25.3.7 J_Image_SetImageOffsetEx . . . . . . . . . . . . . . . . . . . . . . . . 279
5.25.3.8 J_Image_GetImageOffsetEx . . . . . . . . . . . . . . . . . . . . . . . 279
5.25.3.9 J_Image_MoveViewWindow . . . . . . . . . . . . . . . . . . . . . . . 280
5.25.3.10 J_Image_ResizeChildWindow . . . . . . . . . . . . . . . . . . . . . . 280
5.25.3.11 J_Image_GetViewWindowRect . . . . . . . . . . . . . . . . . . . . . . 280
5.25.3.12 J_Image_GetFrameWindowRect . . . . . . . . . . . . . . . . . . . . . 281
5.25.3.13 J_Image_SetViewWindowTitle . . . . . . . . . . . . . . . . . . . . . . 281
5.25.3.14 J_Image_SetViewWindowOption . . . . . . . . . . . . . . . . . . . . . 281
5.25.3.15 J_Image_GetViewWindowOption . . . . . . . . . . . . . . . . . . . . . 282
5.25.3.16 ImageViewWindowCallBack . . . . . . . . . . . . . . . . . . . . . . . 282
5.25.3.17 J_Image_SetViewWindowCallback . . . . . . . . . . . . . . . . . . . . 283
5.26 Stream channel specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
5.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
5.26.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
5.26.2.1 J_Image_OpenStream . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
5.26.2.2 J_Image_OpenStreamLight . . . . . . . . . . . . . . . . . . . . . . . . 285
5.26.2.3 J_Image_CloseStream . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
5.26.2.4 J_Image_GetStreamInfo . . . . . . . . . . . . . . . . . . . . . . . . . . 286
5.26.2.5 J_Image_GetStreamHandle . . . . . . . . . . . . . . . . . . . . . . . . 287
5.27 Image manipulation functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
CONTENTS
ix
CONTENTS
5.31.2.1 J_Image_MallocHDR . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
5.31.2.2 J_Image_AnalyzeHDR . . . . . . . . . . . . . . . . . . . . . . . . . . 305
5.31.2.3 J_Image_FuseHDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
5.32 Lookup-Table functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
5.32.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
5.32.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
5.32.2.1 J_Image_MallocLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
5.32.2.2 J_Image_FreeLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
5.32.2.3 J_Image_ConvertLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
5.32.2.4 J_Image_LUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
5.32.2.5 J_Image_CreateGammaLUT . . . . . . . . . . . . . . . . . . . . . . . 309
5.32.2.6 J_Image_ApplyGammaToLUT . . . . . . . . . . . . . . . . . . . . . . 310
5.32.2.7 J_Image_CreateLinearLUT . . . . . . . . . . . . . . . . . . . . . . . . 310
5.32.2.8 J_Image_CreateKneeLUT . . . . . . . . . . . . . . . . . . . . . . . . . 311
5.32.2.9 J_Image_GetLUTValue . . . . . . . . . . . . . . . . . . . . . . . . . . 312
5.32.2.10 J_Image_SetLUTValue . . . . . . . . . . . . . . . . . . . . . . . . . . 312
5.32.2.11 J_Image_SaveLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
5.32.2.12 J_Image_LoadLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
5.33 Histogram functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
5.33.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
5.33.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
5.33.2.1 J_Image_MallocHistogram . . . . . . . . . . . . . . . . . . . . . . . . 314
5.33.2.2 J_Image_FreeHistogram . . . . . . . . . . . . . . . . . . . . . . . . . . 315
5.33.2.3 J_Image_ClearHistogram . . . . . . . . . . . . . . . . . . . . . . . . . 315
5.33.2.4 J_Image_CreateHistogram . . . . . . . . . . . . . . . . . . . . . . . . 315
5.33.2.5 J_Image_GetHistogramValue . . . . . . . . . . . . . . . . . . . . . . . 316
5.34 Transformation functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
5.34.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
5.34.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 317
5.34.2.1 EFlipType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
5.34.2.2 ERotateType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
5.34.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
5.34.3.1 J_Image_Flip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
5.34.3.2 J_Image_Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
5.35 Image Processing functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
5.35.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
CONTENTS
xi
xii
CONTENTS
5.41.3.1 AcquisitionCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
5.41.3.2 EnablePacketResend . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
5.41.3.3 PassCorruptFrames . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
5.41.3.4 IsGrabbing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
5.41.3.5 NumFramesDelivered . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
5.41.3.6 NumFramesLost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
5.41.3.7 NumBuffersAnnounced . . . . . . . . . . . . . . . . . . . . . . . . . . 340
5.41.3.8 NumFramesQueued . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
5.41.3.9 NumFramesAwaitingDelivery . . . . . . . . . . . . . . . . . . . . . . . 341
5.41.3.10 NumFramesCorruptOnDelivery . . . . . . . . . . . . . . . . . . . . . . 341
5.42 White-Balance control methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
5.42.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
5.42.1.1 SetGain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
5.42.1.2 GetGain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
5.42.1.3 ExecuteWhiteBalance . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
5.43 Camera Connection Status delegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
5.43.1 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
5.43.1.1 NewConnectionStatusDelegate . . . . . . . . . . . . . . . . . . . . . . 344
5.44 GigE Vision Event delegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
5.44.1 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
5.44.1.1 GEVEventDelegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
5.45 Node Event delegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
5.45.1 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
5.45.1.1 NodeEventDelegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
5.46 Scripting methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
5.46.1 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 347
5.46.1.1 RunScriptResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
5.46.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
5.46.2.1 GetScriptErrorString . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
5.46.2.2 ValidateScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
5.46.2.3 GetScriptProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
5.46.2.4 GetScriptLastCommand . . . . . . . . . . . . . . . . . . . . . . . . . . 348
5.46.2.5 RunScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
5.46.2.6 RunScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
5.46.2.7 CreateSettingsScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
5.47 Direct Register Access methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
CONTENTS
xiii
xiv
CONTENTS
5.50.1.17 NavigateRight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
5.50.1.18 NavigateLeftDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
5.50.1.19 NavigateLeftDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
5.50.1.20 NavigateDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
5.50.1.21 NavigateDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
5.50.1.22 NavigateRightDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
5.50.1.23 NavigateRightDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
5.51 Inter-packet Delay calculation methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
5.51.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
5.51.1.1 EstimatedInterPacketDelay . . . . . . . . . . . . . . . . . . . . . . . . 366
5.51.1.2 EstimatedInterPacketDelay . . . . . . . . . . . . . . . . . . . . . . . . 366
5.52 Asynchronous image recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
5.52.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
5.52.1.1 StartAsyncImageRecording . . . . . . . . . . . . . . . . . . . . . . . . 369
5.52.1.2 StopAsyncImageRecording . . . . . . . . . . . . . . . . . . . . . . . . 369
5.52.1.3 AsyncImageRecordingDoneHandler . . . . . . . . . . . . . . . . . . . 369
5.52.1.4 GetAsyncRecordedImage . . . . . . . . . . . . . . . . . . . . . . . . . 369
5.52.1.5 GetAsyncRecordedImages . . . . . . . . . . . . . . . . . . . . . . . . 370
5.52.1.6 FreeAsyncRecordedImages . . . . . . . . . . . . . . . . . . . . . . . . 370
5.52.2 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
5.52.2.1 AsyncImageRecordingDoneEvent . . . . . . . . . . . . . . . . . . . . 370
5.52.3 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
5.52.3.1 AsyncImageRecordingSkipCount . . . . . . . . . . . . . . . . . . . . . 370
5.52.3.2 AsyncImageRecordingCount . . . . . . . . . . . . . . . . . . . . . . . 370
5.52.3.3 TotalAsyncImagesRecordedCount . . . . . . . . . . . . . . . . . . . . 370
5.52.3.4 IsAsyncImageRecordingRunning . . . . . . . . . . . . . . . . . . . . . 371
5.52.3.5 GetAsyncImageRecordingMode . . . . . . . . . . . . . . . . . . . . . 371
5.53 The CNode Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
5.54 The Managed JAI SDK Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
5.54.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Class Documentation
6.1
375
6.1.2
Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
6.1.2.2
Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
CONTENTS
6.2
xv
6.1.2.3
Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
6.1.2.4
ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
6.1.2.5
IPAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
6.2.2
Base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
6.2.2.2
Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
6.2.2.3
UserPointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
6.2.2.4
TimeStamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
6.2.2.5
BufferNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
6.2.2.6
NewData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
6.2.2.7
IsQueued . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
6.2.2.8
PayloadType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
6.2.2.9
PixelFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
6.3.2
6.3.3
6.3.2.1
AsyncImageRecordingMode . . . . . . . . . . . . . . . . . . . . . . . 392
6.3.2.2
EDeviceClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
6.3.4
6.3.5
CCamera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
6.3.4.2
Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
6.3.4.3
Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
xvi
CONTENTS
6.3.6
6.3.5.1
FactoryHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
6.3.5.2
CameraHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
6.3.5.3
StreamHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
6.3.5.4
WindowHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
6.3.6.2
FramesPerSecond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
6.3.6.3
FramesDisplayedPerSecond . . . . . . . . . . . . . . . . . . . . . . . . 395
6.3.6.4
ImageSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
6.3.6.5
SizeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
6.3.6.6
SizeY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
6.3.6.7
OffsetX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
6.3.6.8
OffsetY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
6.3.6.9
TimeStamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
CONTENTS
xvii
6.3.6.32 IsLastFrameAvailable . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
6.3.6.33 LastFrameCopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
6.3.6.34 LastRawFrameCopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
6.3.6.35 IsBayerCamera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
6.3.6.36 AcquisitionStartFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
6.3.6.37 CameraID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
6.3.6.38 Manufacturer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.39 ModelName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.40 DeviceClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.41 IPAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.42 MACAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.43 UserName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.44 SerialNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.45 InterfaceID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.46 DriverType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.47 NumOfDataStreams . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
6.3.6.48 ConfigModelName . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.49 ConfigVendorName . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.50 ConfigToolTip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.51 ConfigStandardNameSpace . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.52 ConfigGenApiVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.53 ConfigSchemaVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.54 ConfigDeviceVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.55 ConfigProductGuid . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.56 ConfigVersionGuid . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.57 EnableColorInterpolation . . . . . . . . . . . . . . . . . . . . . . . . . 400
6.3.6.58 ColorInterpolationAlgorithm . . . . . . . . . . . . . . . . . . . . . . . 401
6.4
6.4.2
6.4.3
6.4.4
EDriverType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
CFactory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Dispose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
6.4.4.2
Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
xviii
CONTENTS
6.4.5
6.4.6
6.5
6.4.4.3
Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
6.4.4.4
Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
6.4.4.5
UpdateCameraList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
6.4.4.6
SendActionCommand . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
6.4.4.7
SendActionCommand . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
CameraList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
6.4.5.2
FactoryHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
PreferredDriverType . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
6.4.6.2
EnableAutoForceIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
6.4.6.3
Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
6.4.6.4
BuildDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
6.4.6.5
BuildTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
6.4.6.6
Manufacturer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
6.4.6.7
NumOfCameras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
6.5.2
6.5.3
6.5.4
CNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
FindEnumValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
6.5.3.2
ImposeAccessMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
6.5.3.3
ImposeVisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
6.5.3.4
ExecuteCommand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
6.5.3.5
Invalidate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.2
DisplayName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.3
ToolTip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.4
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.5
NameSpace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.6
Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.7
DisplayNotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.8
DisplayPrecision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.9
Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
CONTENTS
xix
6.5.4.10 DocuURL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
6.5.4.11 IsCachable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.12 CachingMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.13 PollingTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.14 EventID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.15 IsStreamable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.16 IsDeprecated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.17 IsSelector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.18 SelectedNodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.19 SelectingNodeNames . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.20 AliasNodeHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.21 FloatAliasNodeHandle . . . . . . . . . . . . . . . . . . . . . . . . . . 417
6.5.4.22 IntegerAliasNodeHandle . . . . . . . . . . . . . . . . . . . . . . . . . 418
6.5.4.23 EnumAliasNodeHandle . . . . . . . . . . . . . . . . . . . . . . . . . . 418
6.5.4.24 NodeType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
6.5.4.25 EnumValues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
6.5.4.26 Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
6.5.4.27 NodeHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
6.5.4.28 AccessMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
6.5.4.29 Visibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
6.5.4.30 Min . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
6.5.4.31 Max . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
6.5.4.32 Inc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
6.5.4.33 Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
6.5.4.34 Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
6.5.4.35 IsReadable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
6.5.4.36 IsWritable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
6.5.4.37 IsImplemented . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
6.5.4.38 IsAvailable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
6.5.4.39 NodeValueType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
6.5.4.40 Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
6.6
6.6.2
RectOfROI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
6.6.2.2
BThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
xx
CONTENTS
6.7
6.9
GThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
6.6.2.4
RThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
6.6.2.5
BGain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
6.6.2.6
GGain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
6.6.2.7
RGain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
6.7.2
6.7.3
6.8
6.6.2.3
6.7.2.1
Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
6.7.2.2
Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
FeatureName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
6.7.3.2
FeatureValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
6.8.2
GEV_EVENT_CMD_EventID . . . . . . . . . . . . . . . . . . . . . . 425
6.8.2.2
GEV_EVENT_CMD_StreamChannelIndex . . . . . . . . . . . . . . . 425
6.8.2.3
GEV_EVENT_CMD_BlockID . . . . . . . . . . . . . . . . . . . . . . 425
6.8.2.4
GEV_EVENT_CMD_Timestamp . . . . . . . . . . . . . . . . . . . . . 426
6.8.2.5
GEV_EVENT_CMD_EventDataLength . . . . . . . . . . . . . . . . . 426
6.8.2.6
GEV_EVENT_CMD_EventData . . . . . . . . . . . . . . . . . . . . . 426
6.8.2.7
NEW_BUFFER_BufferHandle . . . . . . . . . . . . . . . . . . . . . . 426
6.8.2.8
CONNECTION_Status . . . . . . . . . . . . . . . . . . . . . . . . . . 426
6.9.2
NumEntriesInQueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
CONTENTS
xxi
xxii
CONTENTS
6.15.2.1 PixelFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.2 SizeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.3 SizeY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.4 ImageSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.5 ImageBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.6 TimeStamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.7 MissingPackets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.8 AnnouncedBuffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.9 QueuedBuffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.10 OffsetX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.11 OffsetY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
6.15.2.12 AwaitDelivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
6.15.2.13 BlockID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
CONTENTS
xxiii
6.19.2.6 LutB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
xxiv
CONTENTS
6.22.3.1 ToRectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
6.22.3.2 FromRectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
6.22.3.3 GetHashCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.22.3.4 operator Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.22.3.5 operator RECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.22.4 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.22.4.1 Left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.22.4.2 Top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.22.4.3 Right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.22.4.4 Bottom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
6.22.5 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
6.22.5.1 Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
6.22.5.2 Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
6.22.5.3 Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
6.22.5.4 Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
CONTENTS
xxv
6.25.3.1 cx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
6.25.3.2 cy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
xxvi
CONTENTS
6.29.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
6.29.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
6.29.2.1 hDeviceContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
6.29.2.2 Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
6.29.2.3 Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
File Documentation
7.1
7.2
7.4
7.3
493
Example Documentation
499
8.1
ActionCommandSample/ActionCommandForm.cs . . . . . . . . . . . . . . . . . . . . . 499
8.2
AsyncImageRecordingSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
8.3
AVISample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
8.4
ChildWindowSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
8.5
ConnectionDelegateSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
8.6
ConsoleApplication/Program.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
8.7
CSAutoExposureSample/AutoExposureSampleForm.cs . . . . . . . . . . . . . . . . . . . 526
8.8
CSharpSampleMulticastMaster/CSharpSampleMulticastMaster/Form1.cs . . . . . . . . . 536
8.9
CSharpSampleMulticastSlave/CSharpSampleMulticastSlave/Form1.cs . . . . . . . . . . . 539
CONTENTS
xxvii
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Chapter 1
Date:
September 2012
Introduction
Software
Samples
1.1
Introduction
The JAI Software Development Kit (SDK) .NET Wrapper is designed to make it possible to call the "real"
JAI SDK dll Jai_Factory.dll directly from within managed code. But it also makes it possible to
use the Managed classes The CFactory Class, The CCamera Class and The CNode Class instead for the
basic functionality of the SDK. These classes encapsulates the most of the SDK functionality into objects
and makes it much easier to use the SDK from within the .NET environment (C#, VB.NET and Managed
C++...). The JAI SDK .NET Wrapper has been developed for .NET Framework 2.0.
The JAI SDK is structured into a series of modules where the naming of each API-function indicates which
module it belongs to. The basic structure can be seen in the picture below:
The top-most module is called the Factory module and this is the main entry-point for the rest of the
SDK functionality. All applications will always have to start by creating and open a single instance of the
Factory in order to gain access to the rest of the API functions. A unique handle will be returned if the
Factory is opened sucessfully using the J_Factory_Open() function. This handle will later be used as the
first parameter to the rest of the factory module functions.
When the Factory is sucessfully opened then the application can search for GigE Vision compliant devices on the network by performing a Device Discovery using the factory module function J_Factory_UpdateCameraList(). The Device Discovery will run through all the network interfaces and create a
complete list of all the GigE Vision devices found on the network. In the JAI SDK all module enumerations are done in a similar way: first we have to get the number of items in the collection in question
and after that we run through the collection using an zero-based index. To enumerate through the GigE
Vision devices (typically cameras) the function J_Factory_GetNumOfCameras() will return the device
count and the function J_Factory_GetCameraIDByIndex() will return an unique identifier for the devices
- later to be used for opening the actual camera communication. It is possible to get detailed information
about all the cameras found during Device Discovery without having to connect to the cameras. To get
detailed information please use J_Factory_GetCameraInfo().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.1 Introduction
After successfully opening cameras using the Camera Module functions J_Camera_Open() or J_Camera_OpenMc() we now will have access to the camera features via a collection of GenICam feature
nodes as well as control of the image acquisition via the Data Stream functions.
The JAI SDK has got two major ways of handling the image acquisition: 1) Automatic Image Acquisition
using the J_Image_OpenStream() related functions where the images are returned via callback functions.
See Stream channel specific functions for more information! 2) Manual Data Stream handling using the
J_Camera_CreateDataStream() and J_Camera_CreateDataStreamMc() related functions where the
application will have full control of the memory allocation and will have to create an acquisition thread.
The JAI SDK contains example programs in both C++ and C#. The samples demonstrates the basic usage
of the SDK such as:
How to open the Factory
How to search and find cameras (Device Discovery)
How to enumerate and open cameras
How to get a list of features using GenICam nodes
How to control named features using GenICam
How to open a window and display video from a camera
How to set up multicast connections
All samples are written for Visual Studio 2005. See Samples for more details on the sample applications.
The basic usage of the .NET Wrapper is exactly the same as for the standard JAI SDK:
To open the factory and search for camera the following code has to be called:
// Handle to the Factory
IntPtr factoryHandle;
EFactoryError error = EFactoryError.Success;
// Open the Factory
error = J_Factory_Open(RegistryFileName, out factoryHandle);
if (error == EFactoryError.Success)
{
bool hasChanged = false;
// Search for cameras on all the networks
if (factoryHandle != null)
{
error = J_Factory_UpdateCameraList(factoryHandle, ref hasChanged);
if (hasChanged)
{
// Run through the list of found cameras
uint newCameraCount = 0;
// Get the number of cameras. This number can be larger than the actual cam
era
// count because the cameras can be detected through different driver types
!
// This mean that we might need to filter the cameras in order to avoid dub
licate
// references.
error = J_Factory_GetNumOfCameras(factoryHandle, ref newCameraCount);
StringBuilder sb = new StringBuilder(512);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
if (error == EFactoryError.Success)
{
IntPtr cameraHandle;
String name = sb.ToString();
// Open the camera
error = J_Camera_Open(factoryHandle, name, out cameraHandle);
... do something
// Close the camera again
error = J_Camera_Close(factoryHandle);
}
}
}
}
// Close the factory
error = J_Factory_Close(cameraHandle);
}
To do the same as above using the CFactory class the code look like this:
// Create CFactory object
CFactory myFactory = new Factory();
if (myFactory.Open("") == EFactoryError.Success)
{
// Search for the cameras and filter the found cameras with the Filter Driver a
s
// preferred driver
myFactory.UpdateCameraList(CFactory.EDriverType.FilterDriver);
foreach (CCamera c in myFactory.CameraList)
{
c.Open();
//... do something
}
// Finally close the Factory again. This will automatically close cameras
myFactory.Close();
}
One important thing to notice is that the managed classes handles the cleanup of both the nodes and the
cameras. Another important detail is that it is still possible to use the Wrapper functions at the same time
as using the managed classes. The CFactory class contains a public handle to the underlying factory, the
CCamera class contains a public handle to the underlying camera, and the CNode class contains a public
handle to the underlying GenICam node. This makes it easy to do things like this:
// Create CFactory object
CFactory myFactory = new Factory();
if (myFactory.Open("") == EFactoryError.Success)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.1 Introduction
// Search for the cameras and filter the found cameras with the Filter Driver a
s
// preferred driver
myFactory.UpdateCameraList(CFactory.EDriverType.FilterDriver);
foreach (CCamera c in factory.CameraList)
{
c.Open();
byte[] data = new data[4];
J_Camera_ReadData(c.CameraHandle, 0xa000, out data, 4);
}
}
In the above sample the Wrapper class is called directly in order to read data data from the camera memory.
If the user wants to print out a complete list of names of all the GenICam nodes from the camera it could
look like this:
EFactoryError error = EFactoryError.Success;
UInt32 NumOfNodes = 0;
// Get the number of nodes
error = J_Camera_GetNumOfNodes(cameraHandle, ref NumOfNodes);
if (NumOfNodes > 0)
{
// Run through the list of nodes and print out the names
for (int index = 0; index <NumOfNodes; index++)
{
IntPtr nodeHandle;
error = J_Camera_GetNodeByIndex(cameraHandle, index, out nodeHandle);
if (error == EFactoryError.Success)
{
StringBuilder stringBuilder = new StringBuilder(512);
uint Size = (uint)stringBuilder.Capacity;
error = J_Node_GetName(nodeHandle, stringBuilder, Size, 0);
if (error == EFactoryError.Success)
{
// Print out the name
Console.Out.WriteLine(stringBuilder.ToString());
}
}
}
}
The above sample code list ALL GenICam nodes from the camera. It is though more likely that the user
wants only to list all Feature Nodes - nodes that are representing the controllable feature. Then it would
look more like this:
EFactoryError error = EFactoryError.Success;
UInt32 NumOfSubFeatureNodes = 0;
// Get the number of nodes
error = J_Camera_GetNumOfSubFeatures(cameraHandle, "Root", ref NumOfSubFeatureNod
es);
if (NumOfSubFeatureNodes > 0)
{
// Run through the list of sub feature nodes and print out the names
for (int index = 0; index <NumOfSubFeatureNodes; index++)
{
IntPtr nodeHandle;
error = J_Camera_GetSubFeatureByIndex(cameraHandle, "Root", index, out nodeHa
ndle);
if (error == EFactoryError.Success)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
To open the factory, search for cameras, open all cameras and set the raw gain to 100 the following code
could be used:
// Handle to the Factory
IntPtr factoryHandle;
EFactoryError error = EFactoryError.Success;
// Open the Factory
error = J_Factory_Open(RegistryFileName, out factoryHandle);
if (error == EFactoryError.Success)
{
bool hasChanged = false;
// Search for cameras on all the networks
if (factoryHandle != null)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.1 Introduction
error = J_Factory_UpdateCameraList(factoryHandle, ref hasChanged);
if (hasChanged)
{
// Run through the list of found cameras
uint newCameraCount = 0;
// Get the number of cameras. This number can be larger than the actual cam
era
// count because the cameras can be detected through different driver types
!
// This mean that we might need to filter the cameras in order to avoid dub
licate
// references.
error = J_Factory_GetNumOfCameras(factoryHandle, ref newCameraCount);
StringBuilder sb = new StringBuilder(512);
uint Size = (uint)sb.Capacity;
for (int index = 0; index <newCameraCount; index++)
{
Size = (uint)sb.Capacity;
// Get CameraID
error = J_Factory_GetCameraIDByIndex(factoryHandle, index, sb, out Size);
if (error == EFactoryError.Success)
{
IntPtr cameraHandle;
String name = sb.ToString();
// Open the camera
error = J_Camera_Open(factoryHandle, name, out cameraHandle);
IntPtr nodeHandle;
error = J_Camera_GetNodeByName(cameraHandle, "GainRaw", out nodeHandle)
;
if (error == EFactoryError.Success)
{
error = J_Node_SetValueInt64(nodeHandle, false, 100);
}
// Close the camera again
error = J_Camera_Close(factoryHandle);
}
}
}
}
// Close the factory
error = J_Factory_Close(cameraHandle);
}
To do the same as above using the CFactory, CCamera and CNode classes the code look like this:
// Create CFactory object
CFactory myFactory = new Factory();
if (myFactory.Open("") == EFactoryError.Success)
{
// Search for the cameras and filter the found cameras with the Filter Driver a
s
// preferred driver
myFactory.UpdateCameraList(CFactory.EDriverType.FilterDriver);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Finally if we want to open a view window and display video from the first camera we can do like this:
// Create CFactory object
CFactory myFactory = new Factory();
if (myFactory.Open("") == EFactoryError.Success)
{
// Search for the cameras and filter the found cameras with the Filter Driver a
s
// preferred driver
myFactory.UpdateCameraList(CFactory.EDriverType.FilterDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the first camera in the list
myFactory.CameraList[0].Open();
// Open a view window and start image streaming
myFactory.CameraList[0].StartImageAcquisition(true, 10);
//... do something
// Stop image streaming and close the view window again
myFactory.CameraList[0].StopImageAcquisition();
}
}
Continue to Software
1.2
Software
1.3 Samples
compiling with Microsoft Visual Studio, then the user must "add" Jai_Factory.lib (3rd item) to the "project"
in order to have successful "linking".
The last file is the .NET Wrapper to the Jai_Factory.dll. To use the JAI SDK from managed code the
user simply have to add the Jai_FactoryDotNet.dll as a reference. Then all of the functionality of both the
wrapper and the Managed classes will be available.
Legal issues: This software is based in part on the work of the Independent JPEG Group.
1.3
Samples
The JAI SDK software package contains the following sample applications:
Visual C++
.\sample\CPP\ActionCommandSample covers the following items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first two cameras found
How to control named features using GenICam
How to use callback functions to handle new image data from multiple cameras
How to open a window and display video from two cameras using image library functions
How to send out a Action Command broadcast telegram and handle the acknowledges
.\sample\CPP\AutoExposureSample covers the following items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam
How to use callback function to handle new image data (display the image)
How to open a window and display video from a camera using Image Library functions
How to automatically control the Gain and Exposuretime inside the camera based on the image
contents
.\sample\CPP\ChildWindowSample covers the following items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam
How to display video in a user-defined window using DataStream functions
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
10
1.3 Samples
11
12
1.3 Samples
13
14
1.3 Samples
How to open a window and display video from a camera using DataStream functions
How to use Conditions for event handling
.\sample\CPP\TransformSample covers the following items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam
How to use callback function to handle new image data (display the image)
How to open a window and display video from a camera using Image Library functions
How to Flip and Rotate images
.\sample\CPP\VCAVISample covers the following items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam
How to save images from camera as AVI files
.\sample\CPP\VCSampleLIntensity covers the following items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam
How to calculate light intensity and save the result to file
.\sample\CPP\VCSampleMissingFrames covers the following items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam
How to check for lost frames, corrupted frames and missing packets inside corrupted frames
.\sample\CPP\VCSampleMulticastMaster covers the following items:
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
15
16
1.3 Samples
17
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace ActionCommandSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Action Command Dialog
ActionCommandForm myActionCommandForm;
// Action command constants
const UInt32 DEVICE_KEY = 0x00000001;
const UInt32 GROUP_KEY_ACTION_1 = 0x00000001;
const UInt32 GROUP_KEY_ACTION_2 = 0x00000002;
const UInt32 GROUP_MASK_ACTION_1 = 0x00000001;
const UInt32 GROUP_MASK_ACTION_2 = 0x00000002;
const UInt32 GROUP_MASK_ALL_ACTIONS = 0xFFFFFFFF;
// Timestamp from last image
UInt64 myTimestampTickFrequency = 0;
double myTimestampMs1 = 0.0;
double myTimestampMs2 = 0.0;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void StartButton_Click(object sender, EventArgs e)
{
if ((myFactory.CameraList.Count > 0) && (myFactory.CameraList[0] != n
ull))
{
myFactory.CameraList[0].NewImageDelegate += new Jai_FactoryWrappe
r.ImageCallBack(HandleImage1);
myFactory.CameraList[0].StartImageAcquisition(true, 5);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
18
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
19
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
// Did we find any cameras?
if (myFactory.CameraList.Count > 0)
{
CameraIDTextBox.Text = "";
// Open the cameras
foreach (CCamera cam in myFactory.CameraList)
{
CameraIDTextBox.Text += cam.CameraID + Environment.NewLine;
error = cam.Open();
// Is the camera already opened by another application?
if (error == Jai_FactoryWrapper.EFactoryError.AccessDenied)
{
MessageBox.Show(this, "Access denied for camera " + cam.
CameraID + "!\nThe camera is most likely opened by another application!?\n\nThe
Action Commands can still be sent!", "Camera Open Error");
}
else if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
StartButton.Enabled = true;
StopButton.Enabled = true;
// Set up actions inside the camera
if (!SetupActions())
MessageBox.Show(this, "Unable to set up Actions for c
amera " + cam.CameraID + "!\nThe camera is most likely not a GigE Vision 1.1 de
vice!?\n\nThe Action Commands can still be sent!", "Camera Open Error");
// Get the Timestamp Tick Frequency in order to be able t
o convert the timestamps into milliseconds
myTimestampTickFrequency = Convert.ToUInt64(cam.GetNode("
GevTimestampTickFrequency").Value);
}
// Enable the controls
actionCommandGroupBox.Enabled = true;
StopButton.Enabled = false;
action1Button.Enabled = false;
if (cam != null && cam.IsOpen && !cam.IsReadOnly)
{
StartButton.Enabled = true;
}
else
{
openManualActionCommandButton_Click(null, null);
}
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
actionCommandGroupBox.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
private bool SetupActions()
{
CNode node;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
20
// TriggerSelector=FrameStart
node = cam.GetNode("TriggerSelector");
if (node == null)
{
MessageBox.Show("Unable to get TriggerSelector node!");
return false;
}
node.Value = "FrameStart";
// TriggerMode=On
node = cam.GetNode("TriggerMode");
if (node == null)
{
MessageBox.Show("Unable to get TriggerMode node!");
return false;
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
21
node.Value = "On";
// TriggerSource=Action1
node = cam.GetNode("TriggerSource");
if (node == null)
{
MessageBox.Show("Unable to get TriggerSource node!");
return false;
}
node.Value = "Action1";
//
//
//
//
//
Set up Action 2:
ActionDeviceKey=DEVICE_KEY (already set)
ActionSelector=2
ActionGroupKey[ActionSelector]=GROUP_KEY_ACTION_2
ActionGroupMask[ActionSelector]=GROUP_MASK_ACTION_2
// ActionSelector=2
node = cam.GetNode("ActionSelector");
if (node == null)
{
MessageBox.Show("Unable to get ActionSelector node!");
return false;
}
node.Value = 2;
// ActionGroupKey[ActionSelector]=GROUP_KEY_ACTION_2
node = cam.GetNode("ActionGroupKey");
if (node == null)
{
MessageBox.Show("Unable to get ActionGroupKey node!");
return false;
}
node.Value = GROUP_KEY_ACTION_2;
// ActionGroupMask[ActionSelector]=GROUP_MASK_ACTION_2
node = cam.GetNode("ActionGroupMask");
if (node == null)
{
MessageBox.Show("Unable to get ActionGroupMask node!");
return false;
}
node.Value = GROUP_MASK_ACTION_2;
//
//
//
//
// LineSelector=TimeStampReset
node = cam.GetNode("LineSelector");
if (node == null)
{
MessageBox.Show("Unable to get LineSelector node!");
return false;
}
node.Value = "TimeStampReset";
// LineSource=Action2
node = cam.GetNode("LineSource");
if (node == null)
{
MessageBox.Show("Unable to get LineSource node!");
return false;
}
node.Value = "Action2";
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
22
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
23
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
namespace SimpleImageDisplaySample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
24
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
25
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.To
String());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.To
String());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToStrin
g());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.
ToString());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.
ToString());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToStri
ng());
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
26
ProgressBarStyle.Blocks;
= 0;
= myCamera.AsyncImageRecordingCount;
myCamera.TotalAsyncImagesRecordedCount;
= false;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
27
}
private void replayButton_Click(object sender, EventArgs e)
{
// Here we have access to the stored images! Lets show them in an ima
ge window!!
//Create a replay window
if (myCamera != null && !myCamera.IsAsyncImageRecordingRunning && (my
Camera.TotalAsyncImagesRecordedCount > 0))
{
IntPtr WindowHandle = IntPtr.Zero;
// Try to read get the maximum width and height by looking for "S
ensorWidth" and "SensorHeight"
Int32 Width = 0;
Int32 Height = 0;
CNode WidthNode = myCamera.GetNode("Width");
CNode HeightNode = myCamera.GetNode("Height");
Width = Convert.ToInt32(WidthNode.Max);
Height = Convert.ToInt32(HeightNode.Max);
IntPtr nodeHandle;
uint BytesPerPixel = 4;
if (Jai_FactoryWrapper.J_Camera_GetNodeByName(myCamera.CameraHand
le, "PixelFormat", out nodeHandle) == Jai_FactoryWrapper.EFactoryError.Success)
{
Int64 value = 0;
if (Jai_FactoryWrapper.J_Node_GetValueInt64(nodeHandle, false
, ref value) == Jai_FactoryWrapper.EFactoryError.Success)
{
Jai_FactoryWrapper.EPixelFormatType pixeltype = (Jai_Fact
oryWrapper.EPixelFormatType)value;
BytesPerPixel = Jai_FactoryWrapper.GetPixelTypeMemorySize
(pixeltype);
}
}
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Calculate the size of the window rect to display the images
int RectWidth = 0;
int RectHeight = 0;
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, 100, 100); ;
// Does the image fit in width?
if ((Width + 2 * System.Windows.Forms.SystemInformation.Border3DS
ize.Width) > System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width)
RectWidth = System.Windows.Forms.Screen.PrimaryScreen.Working
Area.Width - 2 * System.Windows.Forms.SystemInformation.Border3DSize.Width;
else
RectWidth = Width;
// Does the image fit in Height?
if ((Height + System.Windows.Forms.SystemInformation.Border3DSize
.Height + System.Windows.Forms.SystemInformation.CaptionHeight) > System.Windows.
Forms.Screen.PrimaryScreen.WorkingArea.Height)
RectHeight = System.Windows.Forms.Screen.PrimaryScreen.Workin
gArea.Height - System.Windows.Forms.SystemInformation.Border3DSize.Height - Syste
m.Windows.Forms.SystemInformation.CaptionHeight;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
28
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
29
progressBar1.Minimum = 0;
progressBar1.Maximum = myCamera.AsyncImageRecordingCount;
progressBar1.Value = myCamera.TotalAsyncImagesRecordedCou
nt;
}
else
{
if (myCamera.TotalAsyncImagesRecordedCount < myCamera.Asy
ncImageRecordingCount)
{
recordingStatusLabel.Text = "Recorded " + myCamera.To
talAsyncImagesRecordedCount.ToString() + " images out of " + myCamera.AsyncImageR
ecordingCount.ToString();
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myCamera.AsyncImageRecordingCo
unt;
progressBar1.Value = myCamera.TotalAsyncImagesRecorde
dCount;
}
else
{
recordingStatusLabel.Text = "Recording frames Cyclica
lly " + GetProgressChar();
progressBar1.Style = ProgressBarStyle.Marquee;
}
}
}
StartButton.Enabled = !myCamera.IsAcquisitionRunning;
StopButton.Enabled = myCamera.IsAcquisitionRunning;
SearchButton.Enabled = !myCamera.IsAcquisitionRunning;
}
else
{
startCaptureButton.Enabled = false;
stopCaptureButton.Enabled = false;
replayButton.Enabled = false;
saveButton.Enabled = false;
SearchButton.Enabled = true;
}
}
private string GetProgressChar()
{
_progressCharIndex++;
if (_progressCharIndex > 3)
_progressCharIndex = 0;
switch (_progressCharIndex)
{
case 0:
return "/";
case 1:
return "--";
case 2:
return "\\";
case 3:
return "|";
}
return "";
}
private void saveButton_Click(object sender, EventArgs e)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
30
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
31
}
Application.DoEvents();
}
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
System.Drawing.Imaging;
System.Diagnostics;
AviFile;
namespace AVISample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
String myAVIFileName = "";
AviManager myAviManager;
VideoStream aviStream;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
32
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
33
if (pfNode != null)
pixelFormatType = (Jai_FactoryWrapper.EPixelFormatTyp
e)((Jai_FactoryDotNET.CNode.IEnumValue)pfNode.Value).Value;
if (optimizeForMono8CheckBox.Checked)
{
if (pixelFormatType == Jai_FactoryWrapper.EPixelForma
tType.GVSP_PIX_MONO8)
{
pixelFormat = PixelFormat.Format8bppIndexed;
ImageSize = Width * Height;
}
}
// Add the video stream to the AVI file
aviStream = myAviManager.AddVideoStream(selectCodecCheckB
ox.Checked, Convert.ToDouble(frameRateNumericUpDown.Value), ImageSize, Width, Hei
ght, pixelFormat);
myAVIFileName = saveFileDialog1.FileName;
}
else
{
MessageBox.Show(this, "Unable to create AVI Writer!", "AV
I Error");
}
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCall
Back(HandleImage);
myCamera.SkipImageDisplayWhenBusy = false;
myCamera.StartImageAcquisition(true, 5);
}
else
{
myAVIFileName = "";
}
}
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Stop the acquisition
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
// Close the AVI writer
if (myAviManager != null)
{
myAviManager.Close();
myAviManager = null;
}
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
34
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
35
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
// Local callback function used for handle new images
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
if ((ImageInfo.PixelFormat == Jai_FactoryWrapper.EPixelFormatType.GVS
P_PIX_MONO8) && optimizeForMono8CheckBox.Checked)
{
// Now we have to create a Bitmap object that we later on can add
to the AVI file
Bitmap newImageBitmap = new Bitmap((int)ImageInfo.SizeX, (int)Ima
geInfo.SizeY, (int)ImageInfo.SizeX, System.Drawing.Imaging.PixelFormat.Format8bpp
Indexed, ImageInfo.ImageBuffer);
// Create a Monochrome palette (only once)
if (myMonoColorPalette == null)
{
Bitmap monoBitmap = new Bitmap(1, 1, PixelFormat.Format8bppIn
dexed);
myMonoColorPalette = monoBitmap.Palette;
for (int i = 0; i < 256; i++)
myMonoColorPalette.Entries[i] = Color.FromArgb(i, i, i);
}
// Set the Monochrome Color Palette
newImageBitmap.Palette = myMonoColorPalette;
// If the bitmap got created OK then simply add it to the AVI fil
e
if (newImageBitmap != null && aviStream != null)
{
aviStream.AddFrame(newImageBitmap);
}
}
else
{
// We have to allocate the conversion buffer - but we only want t
o do it once!
if (myDIBImageInfo.ImageBuffer == IntPtr.Zero)
{
error = Jai_FactoryWrapper.J_Image_MallocDIB(ref ImageInfo, r
ef myDIBImageInfo);
}
// OK - lets check if we have the DIB ImageInfo allocated
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
36
1.3 Samples
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam (Width, Height and GainRaw)
How to display video from a camera inside a Child Window (PictureBox)
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace SimpleImageDisplaySample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
37
38
WidthNumericUpDown.Enabled = true;
}
else
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
39
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainTrackBar.TickFrequency = (GainTrackBar.Maximum - GainTrackBar.
Minimum) / 10;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = false;
StopButton.Enabled = false;
stretchCheckBox.Enabled = false;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = false;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
myCamera.Close();
}
private void Form1_Resize(object sender, EventArgs e)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
40
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace ConnectionDelegateSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
41
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
// Update connection status label with current connection status
ConnectionStatusLabel.Text = myCamera.ConnectionStatus.ToString();
// Attach to NewConnectionStatusDelegate in order to get notified ev
ery time the connection status changes
myCamera.NewConnectionStatusDelegate += new Jai_FactoryWrapper.Connec
tionStatusCallBack(myCamera_NewConnectionStatusDelegate);
}
else
{
MessageBox.Show("No Cameras Found!");
}
}
void myCamera_NewConnectionStatusDelegate(CCamera camera, Jai_FactoryWrappe
r.EDeviceConnectionType connectionStatus)
{
// Is this called from the UI thread?
if (!ConnectionStatusLabel.InvokeRequired)
{
// Simply update the label with the new connection status
ConnectionStatusLabel.Text = connectionStatus.ToString();
}
else
{
// Since this delegate is not called from the UI thread then we need
to Invoke another delegate that will update the label
object[] myArray = new object[1];
myArray[0] = connectionStatus;
BeginInvoke(new UpdateConnectionStatusDelegate(UpdateConnectionStatus
Label), myArray);
}
}
public delegate void UpdateConnectionStatusDelegate(Jai_FactoryWrapper.EDev
iceConnectionType newConnectionStatus);
void UpdateConnectionStatusLabel(Jai_FactoryWrapper.EDeviceConnectionType n
ewConnectionStatus)
{
ConnectionStatusLabel.Text = myCamera.ConnectionStatus.ToString();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myFactory != null)
myFactory.Close();
}
}
}
42
using
using
using
using
using
System;
System.Collections.Generic;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace ConsoleApplication
{
class Program
{
static Jai_FactoryDotNET.CFactory factory;
static void Main(string[] args)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
factory = new Jai_FactoryDotNET.CFactory();
error = factory.Open("");
CFactory.EDriverType myPreferredDriverType = CFactory.EDriverType.Filter
Driver;
Console.Out.WriteLine("Factory version = " + factory.Version);
Console.Out.WriteLine("Build Date =
" + factory.BuildDate);
Console.Out.WriteLine("Build Time =
" + factory.BuildTime);
Console.Out.WriteLine("Manufacturer =
" + factory.Manufacturer);
bool AnyChanges = factory.UpdateCameraList(myPreferredDriverType);
if (factory.NumOfCameras > 0)
{
int index = 1;
foreach (CCamera c in factory.CameraList)
{
Console.Out.WriteLine(index.ToString() + ") " + c.ModelName);
index++;
}
Console.Out.WriteLine("Starting Live Video from a camera!\nSelect cam
era number and press Return to continue.");
int CameraChar = Console.In.Read();
int CameraIndex = 0;
// Did the user press 1-9
if ((CameraChar >= 0x31) && (CameraChar <= 0x39))
CameraIndex = CameraChar - 0x31;
factory.CameraList[CameraIndex].Open();
factory.CameraList[CameraIndex].StartImageAcquisition(true, 5);
Console.Out.WriteLine("Press any key to exit");
while (!Console.KeyAvailable)
{
Application.DoEvents();
}
factory.CameraList[CameraIndex].StopImageAcquisition();
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
43
else
{
Console.Out.WriteLine("No Cameras found!\nPress Return to continue.")
;
Console.In.ReadLine();
}
factory.Close();
}
}
}
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace CSAutoExposureSample
{
public partial class AutoExposureSampleForm : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
CNode myExposureNode;
bool m_bAutoExposure = true;
FF
bool m_bUseAverage = true;
used, false if Peak is used
int m_Width = 0;
int m_Height = 0;
Jai_FactoryWrapper.RECT m_MeasureRect;
erage in
bool m_UpdateUI = false;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
// True if Average is
// Width of image
// Height of image
// Area to measure Av
// Flag used for sign
44
updated
// Cached value for t
image
// Cached value for t
image
// Cached value for t
image
// The Cl
// Buffer used for co
public AutoExposureSampleForm()
{
// Initialize the ALC controller
m_ALCController.SetALCType(ALC.EALCType.MinGainPriority);
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
m_ALCController.SetThreshold(0.02);
// Threshold of +-0.01 re
lative error
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
ALCTypeComboBox.SelectedIndex = 0;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
enableALCcheckBox.Checked = m_bAutoExposure;
EnableControls();
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
if (myCamera.ModelName.Contains("030GE"))
{
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
}
else if (myCamera.ModelName.Contains("040GE"))
{
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
}
else if (myCamera.ModelName.Contains("080GE"))
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
45
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
}
else if (myCamera.ModelName.Contains("140GE"))
{
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
}
else if (myCamera.ModelName.Contains("200GE"))
{
m_ALCController.SetKGain(35.0);
m_ALCController.SetKExposure(4.0);
}
else if (myCamera.ModelName.Contains("500GE"))
{
m_ALCController.SetKGain(15.0);
m_ALCController.SetKExposure(3.0);
}
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
m_Width = int.Parse(myWidthNode.Value.ToString());
widthTrackBar.Minimum = Convert.ToInt32(myWidthNode.Min);
widthTrackBar.Maximum = Convert.ToInt32(myWidthNode.Max);
widthTrackBar.Value = Convert.ToInt32(myWidthNode.Value);
widthTrackBar.TickFrequency = (widthTrackBar.Maximum - widthT
rackBar.Minimum) / 20;
widthTextBox.Text = myWidthNode.Value.ToString();
}
else
m_Width = 0;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
m_Height = int.Parse(myHeightNode.Value.ToString());
heightTrackBar.Minimum = Convert.ToInt32(myHeightNode.Min);
heightTrackBar.Maximum = Convert.ToInt32(myHeightNode.Max);
heightTrackBar.Value = Convert.ToInt32(myHeightNode.Value);
heightTrackBar.TickFrequency = (heightTrackBar.Maximum - heig
htTrackBar.Minimum) / 20;
heightTextBox.Text = myHeightNode.Value.ToString();
}
else
m_Height = 0;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
// Update the values inside the ALC controller
m_ALCController.SetMinGain(Convert.ToInt32(myGainNode.Min));
m_ALCController.SetMaxGain(Convert.ToInt32(myGainNode.Max));
m_ALCController.SetCurrentGain(Convert.ToInt32(myGainNode.Val
ue));
gainTrackBar.Minimum = Convert.ToInt32(myGainNode.Min);
gainTrackBar.Maximum = Convert.ToInt32(myGainNode.Max);
gainTrackBar.Value = Convert.ToInt32(myGainNode.Value);
gainTrackBar.TickFrequency = (gainTrackBar.Maximum - gainTrac
kBar.Minimum) / 20;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
46
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
47
setpointTrackBar.TickFrequency = 255 / 20;
}
else
{
m_ALCController.SetSetPoint(32768);
setpointTrackBar.Minimum = 0;
setpointTrackBar.Maximum = 65535;
setpointTrackBar.Value = m_ALCController.GetSetPoint();
setpointTextBox.Text = setpointTrackBar.Value.ToString();
setpointTrackBar.TickFrequency = 65535 / 20;
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
48
//
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
49
if ((int)Average.BGR48_R != m_OldRAverage)
{
m_OldRAverage = (int)Average.BGR48_R;
m_UpdateUI = true;
}
if ((int)Average.BGR48_G != m_OldGAverage)
{
m_OldGAverage = (int)Average.BGR48_G;
m_UpdateUI = true;
}
if ((int)Average.BGR48_B != m_OldBAverage)
{
m_OldBAverage = (int)Average.BGR48_B;
m_UpdateUI = true;
}
// Update the last measured peak
int peak = average;
int peak = (int)Peak.G16;
//
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
50
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
51
gainTrackBar.Value = currentGain;
gainTextBox.Text = currentGain.ToString();
}
}
private void maxGainNumericUpDown_ValueChanged(object sender, EventArgs e
)
{
int maxGain = Convert.ToInt32(maxGainNumericUpDown.Value);
// When we adjust the Min gain then we should adjust the current gain
accordingly in case the
// current gain is outside the new boundries
if (m_ALCController.SetMaxGain(maxGain))
{
int currentGain = m_ALCController.GetCurrentGain();
myGainNode.Value = currentGain;
gainTrackBar.Value = currentGain;
gainTextBox.Text = currentGain.ToString();
}
}
private void minExposureNumericUpDown_ValueChanged(object sender, EventAr
gs e)
{
int minExposure = Convert.ToInt32(minExposureNumericUpDown.Value);
// When we adjust the Min gain then we should adjust the current gain
accordingly in case the
// current gain is outside the new boundries
if (m_ALCController.SetMinExposure(minExposure))
{
int currentExposure = m_ALCController.GetCurrentExposure();
myExposureNode.Value = currentExposure;
exposureTrackBar.Value = currentExposure;
exposureTextBox.Text = currentExposure.ToString();
}
}
private void maxExposureNumericUpDown_ValueChanged(object sender, EventAr
gs e)
{
int maxExposure = Convert.ToInt32(maxExposureNumericUpDown.Value);
// When we adjust the Min gain then we should adjust the current gain
accordingly in case the
// current gain is outside the new boundries
if (m_ALCController.SetMaxExposure(maxExposure))
{
int currentExposure = m_ALCController.GetCurrentExposure();
myExposureNode.Value = currentExposure;
exposureTrackBar.Value = currentExposure;
exposureTextBox.Text = currentExposure.ToString();
}
}
private void xposNumericUpDown_ValueChanged(object sender, EventArgs e)
{
m_MeasureRect.Left = Convert.ToInt32(xposNumericUpDown.Value);
m_MeasureRect.Right = m_MeasureRect.Left + Convert.ToInt32(roiwidthNu
mericUpDown.Value);
}
private void yposNumericUpDown_ValueChanged(object sender, EventArgs e)
{
m_MeasureRect.Top = Convert.ToInt32(yposNumericUpDown.Value);
m_MeasureRect.Bottom = m_MeasureRect.Top + Convert.ToInt32(roiheightN
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
52
1.3 Samples
using
using
using
using
using
using
using
using
using
using
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
rj2_cs.Forms;
System.Net;
System.Runtime.InteropServices;
namespace CSharpSampleMulticastMaster
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// Default multicast IP address
// Must be from 224.0.1.0 to 239.255.255.255 for muticasting
UInt32 m_McIpAddress = 0xef000001;
//------------------------------------------------------------------------// Form1
//------------------------------------------------------------------------public Form1()
{
InitializeComponent();
// Indicate default IP address
textIpAddress.Notation = IPAddressTextBox.IPNotation.IPv4Decimal;
IPAddress ipaddr = new IPAddress((Int32)IPAddress.HostToNetworkOrder((In
t32)m_McIpAddress));
textIpAddress.Text = ipaddr.ToString();
// Open the factory with the default Registry database
Jai_FactoryWrapper.EFactoryError error = myFactory.Open("");
// Search cameras
buttonSearchCameras_Click(null, null);
}
//------------------------------------------------------------------------// Form1_FormClosing
//------------------------------------------------------------------------private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
// Close the camera
buttonCloseCamera_Click(null, null);
// Close the factory
myFactory.Close();
}
//------------------------------------------------------------------------// buttonSearchCameras_Click
//------------------------------------------------------------------------private void buttonSearchCameras_Click(object sender, EventArgs e)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
53
54
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
55
56
using
using
using
using
using
using
using
using
using
using
namespace CSharpSampleMulticastSlave
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
//------------------------------------------------------------------------// Form1
//------------------------------------------------------------------------public Form1()
{
InitializeComponent();
// Open the factory with the default Registry database
Jai_FactoryWrapper.EFactoryError error = myFactory.Open("");
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Get the camera found first
myCamera = myFactory.CameraList[0];
// Open the camera with slave mode
myCamera.Open(Jai_FactoryWrapper.EDeviceAccessFlags.ReadOnly, 0);
// Get and indicate the camera ID
label1.Text = myCamera.CameraID;
// Read and indicate IP address from the camera
ReadIPaddress();
buttonStart.Enabled = true;
buttonStop.Enabled = false;
}
else
{
label1.Text = "No camera was found!";
buttonStart.Enabled = false;
buttonStop.Enabled = false;
}
}
//------------------------------------------------------------------------// Form1_FormClosing
//-------------------------------------------------------------------------
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
57
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
58
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace CSharpSwTrigger
{
public partial class Form1 : Form
{
CFactory myFactory = new CFactory();
CCamera myCamera = null;
public int iOldSelectedIndex; // Selected camera entry in the ListBox
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the Factory
error = myFactory.Open("");
statusBarLabel.Text = "Searching for cameras...";
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
camListComboBox.Items.Clear(); // delete camera list from combo b
ox
// Device discovery using filter driver
myFactory.UpdateCameraList(CFactory.EDriverType.Undefined);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
59
if (myFactory.CameraList.Count > 0)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
string sList = myFactory.CameraList[i].ModelName;
if (myFactory.CameraList[i].CameraID.Contains("INT=>FD"))
sList += " (Filter Driver)";
else if (myFactory.CameraList[i].CameraID.Contains("INT=>
SD"))
sList += " (Socket Driver)";
camListComboBox.Items.Add(sList);
}
}
else
{
MessageBox.Show("No camera found");
}
statusBarLabel.Text = "Found " + myFactory.CameraList.Count.ToStr
ing() + " camera(s). Select camera from the ListBox to open it.";
}
else
{
showErrorMsg(error);
//error handling?
}
}
private void Form1_Load(object sender, EventArgs e)
{
// Bind the value member of the trackbar to the textbox.
widthTextBox.DataBindings.Add("Text", widthTrackBar, "Value");
heightTextBox.DataBindings.Add("Text", heightTrackBar, "Value");
gainTextBox.DataBindings.Add("Text", gainTrackBar, "Value");
}
private void showErrorMsg(Jai_FactoryWrapper.EFactoryError error)
{
String sErrorMsg = "Error = " + error.ToString();
MessageBox.Show(sErrorMsg);
}
private void camListComboBox_SelectedIndexChanged(object sender, EventArg
s e)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// do nothing if the selected camera is the same as the previous one
if (myCamera != null && iOldSelectedIndex != camListComboBox.Selected
Index)
{
// Close any other opened camera so we can open a new one...
myCamera.Close();
myCamera = null;
}
if (myCamera == null)
{
// open the selected camera from the list
myCamera = myFactory.CameraList[camListComboBox.SelectedIndex];
cameraIdTextBox.Text = myCamera.CameraID;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
60
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
61
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
myCamera.GetNode("TriggerMode").Value = "Off";
// Does this camera have a "Software Trigger" feature ava
ilable?
myNode = myCamera.GetNode("TriggerSoftware");
if (myNode == null)
{
swTrigRadio.Enabled = false;
swTriggerButton.Enabled = false;
MessageBox.Show("No GenICam SFNC Software Trigger fou
nd!");
return;
}
else
{
swTrigRadio.Enabled = true;
}
}
else
{
// Here we assume that this is the JAI of setting up the
trigger
// To switch to Continuous the following is required:
// ExposureMode=Continuous
myCamera.GetNode("ExposureMode").Value = "Continuous";
// Does this camera have a "Software Trigger" feature ava
ilable?
myNode = myCamera.GetNode("SoftwareTrigger0");
if (myNode == null)
{
swTrigRadio.Enabled = false;
swTriggerButton.Enabled = false;
MessageBox.Show("No Software Trigger found!");
return;
}
else
{
swTrigRadio.Enabled = true;
}
}
startButton.Enabled = true;
stopButton.Enabled = false;
// Enable the WhiteBalance button if it is a Bayer color came
ra
wBalanceButton.Enabled = myCamera.IsBayerCamera;
}
}
}
private void freeRunRadio_Click(object sender, EventArgs e)
{
// But we have 2 ways of setting up triggers: JAI and GenICam SNC
// The GenICam SFNC trigger setup is available if a node called
// TriggerSelector is available
if (myCamera.GetNode("TriggerSelector") != null)
{
// Here we assume that this is the GenICam SFNC way of setting up
the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// TriggerMode[TriggerSelector]=Off
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
62
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
63
{
myCamera.GetNode("GainRaw").Value = int.Parse(gainTrackBar.Value.ToSt
ring());
}
private void startButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Start the Image Acquisition with 5 buffers
myCamera.StartImageAcquisition(true, 5);
stopButton.Enabled = true;
if (swTrigRadio.Checked)
swTriggerButton.Enabled = true;
startButton.Enabled = false;
widthTrackBar.Enabled = false;
heightTrackBar.Enabled = false;
freeRunRadio.Enabled = false;
swTrigRadio.Enabled = false;
camListComboBox.Enabled = false;
wBalanceButton.Enabled = myCamera.IsBayerCamera;
}
}
private void stopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.StopImageAcquisition();
startButton.Enabled = true;
widthTrackBar.Enabled = true;
heightTrackBar.Enabled = true;
freeRunRadio.Enabled = true;
if (myCamera.GetNode("SoftwareTrigger0") != null)
swTrigRadio.Enabled = true;
stopButton.Enabled = false;
swTriggerButton.Enabled = false;
wBalanceButton.Enabled = false;
camListComboBox.Enabled = true;
}
private void wBalanceButton_Click(object sender, EventArgs e)
{
int iWidth, iHeight;
iWidth = int.Parse(myCamera.GetNode("Width").Value.ToString());
iHeight = int.Parse(myCamera.GetNode("Height").Value.ToString());
myCamera.ExecuteWhiteBalance(0, 0, iWidth, iHeight);
}
private void swTriggerButton_Click(object sender, EventArgs e)
{
// But we have 2 ways of sending a software trigger: JAI and GenICam
SNC
// The GenICam SFNC software trigger is available if a node called
// TriggerSoftware is available
if (myCamera.GetNode("TriggerSoftware") != null)
{
// Here we assume that this is the GenICam SFNC way of setting up
the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// Execute TriggerSoftware[TriggerSelector] command
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
64
feature in order to tr
= 0;
= 1;
= 0;
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace FeatureBrowserSample
{
public partial class Form1 : Form
{
CFactory myFactory = new CFactory();
public Form1()
{
InitializeComponent();
// Open the factory
if (myFactory.Open("") == Jai_FactoryWrapper.EFactoryError.Success)
{
// Find all the connected cameras
myFactory.UpdateCameraList(CFactory.EDriverType.FilterDriver);
if (myFactory.CameraList.Count > 0)
{
// OK - we managed to open the Factory. Now we need to display all
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
the cameras we have found (if any)
PopulateTreeView();
}
else
{
// Show a message telling about the problems
MessageBox.Show(this, "No cameras found!", "Error", MessageBoxButt
ons.OK, MessageBoxIcon.Error);
}
}
else
{
// Show a message telling about the problems
MessageBox.Show("Unable to open factory!", "Error", MessageBoxButtons
.OK, MessageBoxIcon.Error);
}
}
private void PopulateTreeView()
{
// Clear the tree
NodeTreeView.Nodes.Clear();
if (myFactory.CameraList.Count > 0)
{
foreach (CCamera c in myFactory.CameraList)
{
// Open camera
if (c.Open() == Jai_FactoryWrapper.EFactoryError.Success)
{
// Add the camera to the Root of the tree
TreeNode cameraNode = new TreeNode(c.ModelName, CreateNodeTree(
c, "Root"));
cameraNode.Tag = c;
NodeTreeView.Nodes.Add(cameraNode);
}
}
}
}
private TreeNode[] CreateNodeTree(CCamera c, string p)
{
List<CNode> features = c.GetSubFeatures(p);
TreeNode[] childNodes = new TreeNode[features.Count];
int index = 0;
foreach (CNode n in features)
{
if (n.NodeType == Jai_FactoryWrapper.EConfNodeType.ICategory)
childNodes[index] = new TreeNode(n.DisplayName, CreateNodeTree(c,
n.Name));
else
childNodes[index] = new TreeNode(n.DisplayName);
childNodes[index].Tag = n;
index++;
}
return childNodes;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void NodeTreeView_AfterSelect(object sender, TreeViewEventArgs e)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
65
66
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.IO;
namespace GigECameraValidationTool
{
public partial class Form1 : Form
{
private CFactory myFactory = new CFactory();
private CCamera myCamera;
private
private
private
private
List<IntegerTypeNode> IntList
List<FloatTypeNode> FloatList
List<EnumTypeNode> EnumList =
List<Node> NullNodeList = new
= new List<IntegerTypeNode>();
= new List<FloatTypeNode>();
new List<EnumTypeNode>();
List<Node>();
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
67
#region VALIDATION_CODE
private void ValidateNodeValues()
{
List<CNode> features = myCamera.GetSubFeatures("Root");
// configure progress bar
featureProgressCount = 0;
progressBar1.Minimum = 0;
progressBar1.Maximum = features.Count;
progressBar1.Value = 0;
t.Interval = 100;
t.Tick += new EventHandler(t_Tick);
t.Start();
foreach (CNode node in features)
{
List<CNode> child = myCamera.GetSubFeatures(node.Name);
foreach (CNode childNode in child)
{
if (childNode.IsAvailable && childNode.IsReadable)
{
ValidationReturnCode result;
if (childNode.NodeType == Jai_FactoryWrapper.EConfNodeTyp
e.IInteger)
{
result = ValidateIntegerNode(childNode);
switch (result)
{
case ValidationReturnCode.NotPassed:
IntList.Add(new IntegerTypeNode(node.DisplayN
ame, childNode.DisplayName, childNode.Name, Int64.Parse(childNode.Min.ToString())
, Int64.Parse(childNode.Max.ToString()), Int64.Parse(childNode.Value.ToString()))
);
break;
case ValidationReturnCode.NullValue:
NullNodeList.Add(new Node(node.DisplayName, c
hildNode.DisplayName, childNode.Name));
break;
}
}
else if (childNode.NodeType == Jai_FactoryWrapper.EConfNo
deType.IFloat)
{
result = ValidateFloatNode(childNode);
switch (result)
{
case ValidationReturnCode.NotPassed:
FloatList.Add(new FloatTypeNode(node.DisplayN
ame, childNode.DisplayName, childNode.Name, double.Parse(childNode.Min.ToString()
), double.Parse(childNode.Max.ToString()), double.Parse(childNode.Value.ToString(
))));
break;
case ValidationReturnCode.NullValue:
NullNodeList.Add(new Node(node.DisplayName, c
hildNode.DisplayName, childNode.Name));
break;
}
}
else if (childNode.NodeType == Jai_FactoryWrapper.EConfNo
deType.IEnumeration)
{
result = ValidateEnumNode(childNode);
switch (result)
{
case ValidationReturnCode.NotPassed:
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
68
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
69
double min = double.Parse(node.Min.ToString());
if (nodeValue > max || nodeValue < min)
return ValidationReturnCode.NotPassed;
else
return ValidationReturnCode.Passed;
}
else
{
return ValidationReturnCode.NullValue;
}
}
catch (Jai_FactoryWrapper.FactoryErrorException ex)
{
MessageBox.Show("Error reading node value!" + ex.Message);
return ValidationReturnCode.Unknown;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return ValidationReturnCode.Unknown;
}
}
private ValidationReturnCode ValidateEnumNode(CNode node)
{
CNode.IEnumValue[] values = node.EnumValues;
try
{
foreach (CNode.IEnumValue value in values)
{
if (value.DisplayName == node.Value.ToString())
return ValidationReturnCode.Passed;
}
return ValidationReturnCode.NotPassed;
}
catch (Jai_FactoryWrapper.FactoryErrorException ex)
{
MessageBox.Show("Error reading node value!" + ex.Message);
return ValidationReturnCode.Unknown;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return ValidationReturnCode.Unknown;
}
}
#endregion
private void DiscoverCameras()
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the Factory
error = myFactory.Open("");
statusBarLabel.Text = "Searching for cameras...";
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
camListComboBox.Items.Clear(); // delete camera list from combo b
ox
// Device discovery using filter driver
myFactory.UpdateCameraList(CFactory.EDriverType.Undefined);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
70
if (myFactory.CameraList.Count > 0)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
string sList = myFactory.CameraList[i].ModelName;
if (myFactory.CameraList[i].CameraID.Contains("INT=>FD"))
sList += " (Filter Driver)";
else if (myFactory.CameraList[i].CameraID.Contains("INT=>
SD"))
sList += " (Socket Driver)";
camListComboBox.Items.Add(sList);
}
}
else
{
MessageBox.Show("No camera found");
}
statusBarLabel.Text = "Found " + myFactory.CameraList.Count.ToStr
ing() + " camera(s). Select camera from the ListBox to open it.";
}
else
showErrorMsg(error);
}
private void showErrorMsg(Jai_FactoryWrapper.EFactoryError error)
{
String sErrorMsg = "Error = " + error.ToString();
MessageBox.Show(sErrorMsg);
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
myFactory.Close();
}
private void fileWriter()
{
using (StreamWriter sw = new StreamWriter("log.txt"))
{
// write the current date
sw.WriteLine("Test Date:" + DateTime.Now.ToString("MMMM dd, yyyy
H:mm:ss zzz"));
sw.WriteLine();
sw.WriteLine("========== Camera Information ==========");
sw.WriteLine("Model Name: " + myCamera.ModelName);
sw.WriteLine("Serial Number: " + myCamera.SerialNumber);
sw.WriteLine("Device Version: " + myCamera.GetNodeValue("DeviceVe
rsion"));
sw.WriteLine("Device Firmware Version: " + myCamera.GetNodeValue(
"DeviceFirmwareVersion"));
sw.WriteLine("Device FPGA Version: " + myCamera.GetNodeValue("Dev
iceFPGAVersion"));
sw.WriteLine("XML File Information: " + myCamera.GetNodeValue("Ge
vFirstURL"));
sw.WriteLine();
sw.WriteLine("========== Test Summary ==========");
if (IntList.Count != 0)
sw.WriteLine("Number of errors in IInteger type: " + IntList.
Count);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
71
if (FloatList.Count != 0)
sw.WriteLine("Number of error in IFolat type: " + FloatList.C
ount);
if (EnumList.Count != 0)
sw.WriteLine("Number of error in IEnumeration type: " + EnumL
ist.Count);
if (IntList.Count == 0 && FloatList.Count == 0 && EnumList.Count
== 0)
sw.WriteLine("No Error found");
if (NullNodeList.Count > 0)
sw.WriteLine("Number of nodes that have null values: " + Null
NodeList.Count);
sw.WriteLine();
if (IntList.Count > 0)
{
sw.WriteLine("========== IInteger Nodes ==========");
sw.WriteLine("Number of errors = " + IntList.Count);
sw.WriteLine("");
foreach (IntegerTypeNode i in IntList)
{
sw.WriteLine("Parent DisplayName: " + i.ParentDisplayName
);
sw.WriteLine("DisplayName: " + i.DisplayName);
sw.WriteLine("GenICam Name: " + i.GenIcamName);
sw.WriteLine("Minimum value: " + i.MinValue.ToString());
sw.WriteLine("Maximum value: " + i.MaxValue.ToString());
sw.WriteLine("Actual Node Value: " + i.ActualValue.ToStri
ng());
sw.WriteLine();
sw.WriteLine();
}
}
if (FloatList.Count > 0)
{
sw.WriteLine("========== IFloat Nodes==========");
sw.WriteLine("Number of errors = " + FloatList.Count);
sw.WriteLine("");
foreach (FloatTypeNode f in FloatList)
{
sw.WriteLine("Parent DisplayName: " + f.ParentDisplayName
);
sw.WriteLine("DisplayName: " + f.DisplayName);
sw.WriteLine("GenICam Name: " + f.GenIcamName);
sw.WriteLine("Minimum value: " + f.MinValue.ToString());
sw.WriteLine("Maximum value: " + f.MaxValue.ToString());
sw.WriteLine("Actual Node Value: " + f.ActualValue);
sw.WriteLine();
sw.WriteLine();
}
}
if (EnumList.Count > 0)
{
sw.WriteLine("========== IEnumeration Nodes ==========");
sw.WriteLine("Number of errors = " + EnumList.Count);
sw.WriteLine("");
foreach (EnumTypeNode e in EnumList)
{
sw.WriteLine("Parent DisplayName: " + e.ParentDisplayName
);
sw.WriteLine("DisplayName: " + e.DisplayName);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
72
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
73
iOldSelectedIndex = camListComboBox.SelectedIndex;
}
catch (Exception ex)
{
MessageBox.Show("Error:" + ex.Message);
}
}
}
}
private void btnDisplayResult_Click(object sender, EventArgs e)
{
if (File.Exists("log.txt"))
System.Diagnostics.Process.Start("notepad.exe", "log.txt");
}
private void t_Tick(object sender, EventArgs e)
{
lock (thisLock)
{
progressBar1.Value = featureProgressCount;
if (progressBar1.Value >= progressBar1.Maximum)
t.Stop();
}
}
private void btnGenICamXMLTest_Click(object sender, EventArgs e)
{
ValidateNodeValues();
}
}
}
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace GreenCompensationSample
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
74
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
75
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Get gain values from the camera object
myCamera.GetGain(ref myRGain, ref myGGain, ref myBGain);
Int32
Int32
CNode
CNode
Width = 0;
Height = 0;
WidthNode = myCamera.GetNode("Width");
HeightNode = myCamera.GetNode("Height");
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
76
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
77
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
// Local callback function used for handle new images
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
Jai_FactoryWrapper.EFactoryError retsta;
// Allocate tha conversion buffer only once
if (myConversionBuffer.ImageBuffer == IntPtr.Zero)
retsta = Jai_FactoryWrapper.J_Image_Malloc(ref ImageInfo, ref myC
onversionBuffer);
// Convert to internal Image format in order to be able to call the J
_Image_Processing() function later
retsta = Jai_FactoryWrapper.J_Image_FromRawToImage(ref ImageInfo, ref
myConversionBuffer, myRGain, myGGain, myBGain);
// Set up the Green-compensation parameter structure
Jai_FactoryWrapper.GreenCompensationStruct myGreenCompensationParamet
ers = new Jai_FactoryWrapper.GreenCompensationStruct();
// Remember to allocate the 10 Red-compensation ROI structures
myGreenCompensationParameters.ColorCompensationROI = new Jai_FactoryW
rapper.ColorCompensationROIStruct[10];
if (fullImageCheckBox.Checked)
{
myGreenCompensationParameters.NumOfROI = 1;
myGreenCompensationParameters.ColorCompensationROI[0].RectOfROI.L
eft = 0;
myGreenCompensationParameters.ColorCompensationROI[0].RectOfROI.R
ight = (int)ImageInfo.SizeX - 1;
myGreenCompensationParameters.ColorCompensationROI[0].RectOfROI.T
op = 0;
myGreenCompensationParameters.ColorCompensationROI[0].RectOfROI.B
ottom = (int)ImageInfo.SizeY - 1;
myGreenCompensationParameters.ColorCompensationROI[0].RThreshold
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
78
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
79
{
myCamera.Close();
return;
}
}
private void redThresholdNumericUpDown_ValueChanged(object sender, EventA
rgs e)
{
myRedThreshold = Convert.ToUInt32(redThresholdNumericUpDown.Value);
}
private void greenThresholdNumericUpDown_ValueChanged(object sender, Even
tArgs e)
{
myGreenThreshold = Convert.ToUInt32(greenThresholdNumericUpDown.Value
);
}
private void blueThresholdNumericUpDown_ValueChanged(object sender, Event
Args e)
{
myBlueThreshold = Convert.ToUInt32(blueThresholdNumericUpDown.Value);
}
private void redGainNumericUpDown_ValueChanged(object sender, EventArgs e
)
{
myRedGain = Convert.ToUInt32(redGainNumericUpDown.Value);
}
private void greenGainNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
myGreenGain = Convert.ToUInt32(greenGainNumericUpDown.Value);
}
private void blueGainNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
myBlueGain = Convert.ToUInt32(blueGainNumericUpDown.Value);
}
}
}
80
using
using
using
using
using
namespace HDRSequenceSample
{
public partial class Form1 : Form
{
CFactory myFactory = new CFactory();
// Main CFactory obje
ct that gives us access to the cameras
CCamera myCamera = null;
// Main CCamera objec
t to be used for this sample. The first camera detected will be opened
IntPtr myImage1ViewWindowHandle = IntPtr.Zero;
// View Window handle
used for displaying the first image in the sequence
IntPtr myImage2ViewWindowHandle = IntPtr.Zero;
// View Window handle
used for displaying the second image in the sequence
IntPtr myImageHDRViewWindowHandle = IntPtr.Zero;
// View Window handle
used for displaying the reulting HDR image
int myAcquisitionState = 0;
ence acquisition. This help us assure that we always
// Flag to activate a
// Result of the anal
// Number of retries
public Form1()
{
InitializeComponent();
// Open the factory and search for cameras
myFactory.Open();
// Simulate press of the Search button
SearchButton_Click(null, null);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
81
timer1.Enabled = true;
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Check if a camera has already been opened!
if (myCamera != null)
{
// Close the camera again in order to release any allocated resou
rces
myCamera.Close();
myCamera = null;
}
// Search for all cameras on all NIC adapters and pick the Filter Dri
ver (if it is available)
myFactory.UpdateCameraList(CFactory.EDriverType.FilterDriver);
// Did we finc any camera?
if (myFactory.CameraList.Count > 0)
{
// Pick the first camera from the list of cameras
myCamera = myFactory.CameraList[0];
// Write the camera ID to the text box
CameraIDTextBox.Text = myCamera.CameraID;
// ... and finally open up the camera connection
myCamera.Open();
// Check if the camera supports the Sequence and Software Trigger
if (CheckCameraFeatures())
{
// Enable the Start and Stop buttons
StartButton.Enabled = true;
StopButton.Enabled = true;
// Update the camera settings GUI with values from the camera
UpdateCameraSettings();
}
else
{
// Disable the Start and Stop buttons
StartButton.Enabled = false;
StopButton.Enabled = false;
// Write error information in the text box
CameraIDTextBox.Text = "The camera " + myCamera.ModelName +
" does not support Sequences and/or Software Trigger mode required for this Samp
le!";
}
}
else
{
// Disable the Start and Stop buttons
StartButton.Enabled = false;
StopButton.Enabled = false;
// Write error information in the text box
CameraIDTextBox.Text = "Error! No cameras found.";
}
}
private void StartButton_Click(object sender, EventArgs e)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
82
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
83
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
84
ing
myAnalysisIsOk = true;
// Update the Info and Settings tab value with th
e result from the analysis.
UpdateInfo();
// Reset retry counter to 0
myAnalysisRetries = 0;
}
else
{
// We cannot continue analyzing if the images are
too far off
myAnalysisRetries++;
// .. so we only try 10 times in a row
if (myAnalysisRetries >= 10)
{
MessageBox.Show(this, "The automatic HDR anal
ysis failed!", "HDR Analysis Error", MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1);
myAnalyzeImageRequired = false;
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
85
// Is the analysis result OK?
if (myAnalysisIsOk)
{
// Have we already allocated the output image buffer?
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
86
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
87
ExposureTime2TrackBar.Enabled = false;
}
// Set up Gain Raw slider
node = myCamera.GetNode("SequenceMasterGain");
if (node != null)
{
Gain2TextBox.Text = node.Value.ToString();
Gain2TrackBar.Minimum = Convert.ToInt32(node.Min);
Gain2TrackBar.Maximum = Convert.ToInt32(node.Max);
Gain2TrackBar.Value = Convert.ToInt32(node.Value);
Gain2TextBox.Enabled = true;
Gain2TrackBar.Enabled = true;
}
else
{
Gain2TextBox.Text = "-";
Gain2TrackBar.Minimum = 0;
Gain2TrackBar.Maximum = 1;
Gain2TrackBar.Value = 0;
Gain2TextBox.Enabled = false;
Gain2TrackBar.Enabled = false;
}
// Update the Pixel Format Conbo Box
PixelFormatComboBox.Items.Clear();
node = myCamera.GetNode("PixelFormat");
foreach (CNode.IEnumValue enumval in node.EnumValues)
{
PixelFormatComboBox.Items.Add(enumval.DisplayName);
}
PixelFormatComboBox.SelectedIndex = PixelFormatComboBox.FindStrin
gExact(node.Value.ToString());
}
}
private void SetupTriggerMode()
{
if ((myCamera != null) && myCamera.IsOpen)
{
// Prepare for software trigger:
// But we have 2 ways of setting up triggers: JAI and GenICam SNC
// The GenICam SFNC trigger setup is available if a node called
// TriggerSelector is available
if (myCamera.GetNode("TriggerSelector") != null)
{
// Here we assume that this is the GenICam SFNC way of settin
g up the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// TriggerMode[TriggerSelector]=On
// TriggerSource[TriggerSelector]=Software
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
myCamera.GetNode("TriggerMode").Value = "On";
myCamera.GetNode("TriggerSource").Value = "Software";
}
else
{
// Select triggered mode (not continuous mode)
// Here we assume that this is the JAI of setting up the trig
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
88
0;
= 0;
= 0;
myCamera.GetNode("Se
myCamera.GetNode("Se
1;
= 0;
= 0;
myCamera.GetNode("Se
myCamera.GetNode("Se
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
89
void localUpdateInfo()
{
DarkGainNumericUpDown.Value = Convert.ToDecimal(myDarkGain);
BlackLevel1NumericUpDown.Value = Convert.ToDecimal(myBlackLevelImage1
);
BlackLevel2NumericUpDown.Value = Convert.ToDecimal(myBlackLevelImage2
);
UpdateResolution();
}
private void UpdateInfo()
{
// Is this function called from a different thread than the UI thread
?
if (DarkGainNumericUpDown.InvokeRequired)
{
// .. then use Invoke
Invoke(new UpdateInfoDelegate(localUpdateInfo));
}
else
{
// .. or else we just update directly
localUpdateInfo();
}
}
private void TriggerCamera()
{
// We trigger the camera by "pulsing" the SoftwareTrigger0 value betw
een 0 and 1
if ((myCamera != null) && myCamera.IsOpen)
{
// But we have 2 ways of sending a software trigger: JAI and GenI
Cam SNC
// The GenICam SFNC software trigger is available if a node calle
d
// TriggerSoftware is available
if (myCamera.GetNode("TriggerSoftware") != null)
{
// Here we assume that this is the GenICam SFNC way of settin
g up the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// Execute TriggerSoftware[TriggerSelector] command
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
myCamera.GetNode("TriggerSoftware").ExecuteCommand();
}
else
{
// We need to "pulse" the Software Trigger feature in order t
o trigger the camera!
myCamera.GetNode("SoftwareTrigger0").Value = 0;
myCamera.GetNode("SoftwareTrigger0").Value = 1;
myCamera.GetNode("SoftwareTrigger0").Value = 0;
}
}
}
private bool CheckCameraFeatures()
{
if ((myCamera != null) && myCamera.IsOpen)
{
bool found = false;
CNode node = null;
// We have 2 ways of setting up triggers: JAI and GenICam SNC
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
90
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
91
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
92
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
private void DualSlopeTrackBar_Scroll(object sender, EventArgs e)
{
myDualSlopeGain = Convert.ToSingle(DualSlopeTrackBar.Value)/1000.0f;
DualSlopeTextBox.Text = myDualSlopeGain.ToString("0.000");
}
private void ForceAnalysisButton_Click(object sender, EventArgs e)
{
lock (myLockObject)
{
myAnalysisIsOk = false;
myAnalyzeImageRequired = true;
myAnalysisRetries = 0;
myAcquisitionState = 0;
}
}
private void Image1PictureBox_Resize(object sender, EventArgs e)
{
if ((myCamera != null) && myCamera.IsOpen && myCamera.IsAcquisitionRu
nning && (myImage1ViewWindowHandle != IntPtr.Zero))
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Calculate the size of the window rect to display the images
System.Windows.Forms.Control ctrl = System.Windows.Forms.Control.
FromChildHandle(Image1PictureBox.Handle);
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, ctrl.Width, ctrl.Height);
// Resize the Child Window
error = Jai_FactoryWrapper.J_Image_ResizeChildWindow(myImage1View
WindowHandle, ref frameRect);
}
}
private void Image2PictureBox_Resize(object sender, EventArgs e)
{
if ((myCamera != null) && myCamera.IsOpen && myCamera.IsAcquisitionRu
nning && (myImage2ViewWindowHandle != IntPtr.Zero))
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Calculate the size of the window rect to display the images
System.Windows.Forms.Control ctrl = System.Windows.Forms.Control.
FromChildHandle(Image2PictureBox.Handle);
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, ctrl.Width, ctrl.Height);
// Resize the Child Window
error = Jai_FactoryWrapper.J_Image_ResizeChildWindow(myImage2View
WindowHandle, ref frameRect);
}
}
private void HDRImagePictureBox_Resize(object sender, EventArgs e)
{
if ((myCamera != null) && myCamera.IsOpen && myCamera.IsAcquisitionRu
nning && (myImageHDRViewWindowHandle != IntPtr.Zero))
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
93
94
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
95
Gain1TextBox.Text = Gain2TrackBar.Value.ToString();
}
private void ExposureTime2TrackBar_MouseUp(object sender, MouseEventArgs
e)
{
ForceAnalysisButton_Click(null, null);
}
private void Gain2TrackBar_MouseUp(object sender, MouseEventArgs e)
{
ForceAnalysisButton_Click(null, null);
}
private void PixelFormatComboBox_SelectedIndexChanged(object sender, Even
tArgs e)
{
if ((myCamera != null) && myCamera.IsOpen)
{
if (PixelFormatComboBox.SelectedItem != null)
{
CNode node = myCamera.GetNode("PixelFormat");
// We need to find the correct enum for the possible ones
foreach (CNode.IEnumValue enumval in node.EnumValues)
{
if (enumval.DisplayName.Equals(PixelFormatComboBox.Select
edItem.ToString()))
{
node.Value = enumval;
break;
}
}
// We need this information in order to determine the "resolu
tion"
if (PixelFormatComboBox.SelectedItem.ToString().Contains("8")
)
myPixelDepth = 8;
else if (PixelFormatComboBox.SelectedItem.ToString().Contains
("10"))
myPixelDepth = 10;
UpdateResolution();
ForceAnalysisButton_Click(null, null);
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if ((myCamera != null) && myCamera.IsOpen && myCamera.IsAcquisitionRu
nning)
{
FrameRateTextBox.Text = (myCamera.FramesPerSecond/2.0).ToString("
0.0") + " fps";
}
else
{
FrameRateTextBox.Text = "0.0 fps";
}
}
}
}
96
using
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace ImageDelegateSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
97
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
98
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
// We have the access to the buffer directly via the ImageInfo.ImageBuff
er variable
//
// We can access the raw frame buffer bytes if we use "unsafe" code and
pointer
// To do this we need to set the "Allow unsafe code" in the project prop
erties and then access the data like:
//
// unsafe
// {
//
// Cast IntPtr to pointer to byte
//
byte* pArray = (byte*)ImageInfo.ImageBuffer;
//
// Do something with the data
//
// Read values
//
byte value = pArray[10];
//
// Write values
//
for (int i = 0; i < 1000; i++)
//
pArray[i] = (byte)(i % 255);
// }
//
// // If we want to copy the data instead we can do like this without Un
safe code:
// byte[] array = null;
//
// if (ImageInfo.ImageBuffer != IntPtr.Zero)
// {
//
// Allocate byte array that can contain the copy of data
//
array = new byte[ImageInfo.ImageSize];
//
// Do the copying
//
Marshal.Copy(ImageInfo.ImageBuffer, array, 0, (int)ImageInfo.Imag
eSize);
//
//
// Do something with the raw data
//
byte val = array[10];
//}
unsafe
{
// Cast IntPtr to pointer to byte
byte* pArray = (byte*)ImageInfo.ImageBuffer;
// Do something with the data
// Read values
byte value = pArray[10];
// Write values
for (int i = 0; i < 1000; i++)
pArray[i] = (byte)(i % 255);
}
return;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
{
myCamera.Close();
return;
}
}
}
}
99
100
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace InterPacketDelayCalculator
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void SearchButton_Click(object sender, EventArgs e)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
error = myCamera.Open();
if (error == Jai_FactoryWrapper.EFactoryError.Success)
openWizardButton.Enabled = true;
else
{
openWizardButton.Enabled = false;
if (error == Jai_FactoryWrapper.EFactoryError.AccessDenied)
{
// Someone already opened the camera
MessageBox.Show(this, "The camera is already open by anot
her application!", "Camera open error", MessageBoxButtons.YesNo, MessageBoxIcon.Q
uestion, MessageBoxDefaultButton.Button1);
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
101
}
}
else
{
openWizardButton.Enabled = true;
MessageBox.Show("No Cameras Found!");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
myCamera.Close();
}
private void openWizardButton_Click(object sender, EventArgs e)
{
// Create the Inter-Packet Delay form
InterPacketDelayForm myInterPacketDelayForm = new InterPacketDelayFor
m(myCamera);
// .. and show it
if (myInterPacketDelayForm.ShowDialog(this) == DialogResult.OK)
{
Int32 currentInterPacketDelayValue = Convert.ToInt32(myCamera.Get
NodeValue("GevSCPD"));
// We can now get the value from the form and use it to set the v
alue inside the camera
// Befor that we might want to check if it has changed!?
if (currentInterPacketDelayValue != myInterPacketDelayForm.InterP
acketDelay)
{
if (MessageBox.Show(this, "The new Inter-Packet Delay (" + my
InterPacketDelayForm.InterPacketDelay.ToString() + ") is different from the curre
nt value (" + currentInterPacketDelayValue.ToString() + ").\nDo you want to chang
e to the new value?", "Inter-Packer Delay Changed", MessageBoxButtons.YesNo, Mess
ageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
{
myCamera.GetNode("GevSCPD").Value = myInterPacketDelayFor
m.InterPacketDelay;
}
}
}
}
}
}
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Runtime.InteropServices;
System.Net;
System.Globalization;
namespace InterPacketDelayCalculator
{
public partial class InterPacketDelayForm : Form
{
private int _InterPacketDelay = 0;
private CCamera myCamera;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
102
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
103
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
104
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
105
PacketCount++;
PacketCountTextBox.Text = PacketCount.ToString();
// Get the Tick Frequency
// If not defined then we need to read it manually from register
// Allocate the managed buffer to hold the data:
byte[] buffer2 = new byte[8];
MaxErrorTextBox.Text = ExpectedBandwidthUsage.ToString("0.00");
MaxErrorUpDown.Value = Convert.ToDecimal(ExpectedBandwidthUsage);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
106
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
107
string fpsstring = split[0].Replace(., ,);
MaxFps = double.Parse(fpsstring, nfi);
MaxFpsTextBox.Text = MaxFps.ToString("0.00");
}
else
{
// Ok - this might be because we have characters righ
t after the number :-(
string lowercharstring = split[0].ToLower();
string numbers = lowercharstring.TrimEnd(new char[] {
, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
p, q, r, s, t, u, v, w, x, y, z });
string fpsstring = numbers.Replace(., ,);
MaxFps = double.Parse(fpsstring, nfi);
MaxFpsTextBox.Text = MaxFps.ToString("0.00");
}
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
}
else
{
// It might be an IEnumeration with the FrameRate value??
obj = myCamera.GetNodeValue("AcquisitionFrameRate");
if (obj != null)
{
try
{
string[] split = obj.ToString().Split(new char[] {
});
if (split.Length > 1)
{
string fpsstring = split[0].Replace(., ,);
MaxFps = double.Parse(fpsstring,nfi);
MaxFpsTextBox.Text = MaxFps.ToString("0.00");
}
else
{
// Ok - this might be because we have characters
right after the number :-(
string lowercharstring = split[0].ToLower();
string numbers = lowercharstring.TrimEnd(new char
[] { , a, b, c, d, e, f, g, h, i, j, k, l, m, n,
o, p, q, r, s, t, u, v, w, x, y, z });
string fpsstring = numbers.Replace(., ,);
MaxFps = double.Parse(fpsstring,nfi);
MaxFpsTextBox.Text = MaxFps.ToString("0.00");
}
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
}
}
CalculateButton_Click(null, null);
}
Initialized = true;
}
private void label23_Click(object sender, EventArgs e)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
108
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace LensDistortionCorrectionSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
uint myRedGain = 4096;
uint myGreenGain = 4096;
uint myBlueGain = 4096;
IntPtr WindowHandle;
Jai_FactoryWrapper.ImageInfo myConversionBuffer = new Jai_FactoryWrapper.
ImageInfo();
Jai_FactoryWrapper.ImageInfo myImageProcessingBuffer = new Jai_FactoryWra
pper.ImageInfo();
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
109
myUndistortParameters.OpticalCenterX = Width / 2;
myUndistortParameters.OpticalCenterY = Height / 2;
myUndistortParameters.FocalLengthX = Width;
myUndistortParameters.FocalLengthY = Width;
myUndistortParameters.CoeffK1 = -0.194;
myUndistortParameters.CoeffK2 = 0.115;
myUndistortParameters.CoeffK3 = 0.0; // Only used if it is a fish
-eye lens
myUndistortParameters.CoeffP1 = -0.000619;
myUndistortParameters.CoeffP2 = 0.00115;
myUndistortParameters.InterpolationType = Jai_FactoryWrapper.EInt
erpolationType.InterpolationBiLinear;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
110
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
111
if (myImageProcessingBuffer.ImageBuffer != IntPtr.Zero)
Jai_FactoryWrapper.J_Image_Free(ref myImageProcessingBuffer);
myImageProcessingBuffer.ImageBuffer = IntPtr.Zero;
if (myConversionBuffer.ImageBuffer != IntPtr.Zero)
Jai_FactoryWrapper.J_Image_Free(ref myConversionBuffer);
myConversionBuffer.ImageBuffer = IntPtr.Zero;
if (WindowHandle != IntPtr.Zero)
{
// Close view window
Jai_FactoryWrapper.J_Image_CloseViewWindow(WindowHandle);
WindowHandle = IntPtr.Zero;
}
StartButton.Enabled = true;
StopButton.Enabled = false;
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
myCamera.GetGain(ref myRedGain, ref myGreenGain, ref myBlueGain);
StartButton.Enabled = true;
StopButton.Enabled = false;
undistortParamGroupBox.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.To
String());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.To
String());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToStrin
g());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
112
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
113
k2NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffK2);
k3NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffK3);
p1NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffP1);
p2NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffP2);
if (myUndistortParameters.InterpolationType == Jai_FactoryWrapper
.EInterpolationType.InterpolationBiLinear)
biLinearCheckBox.Checked = true;
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
// Local callback function used for handle new images
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
if (myImageProcessingBuffer.ImageBuffer == IntPtr.Zero)
{
if (!mybMonochrome)
{
// Allocate buffer to convert to "Image" format or "DIB" form
at
// To allocate for Image format we use J_Image_Malloc() and l
ater on call
// J_Image_FromRawToImage()
// error = Jai_FactoryWrapper.J_Image_Malloc(ref ImageInfo, r
ef myImageProcessingBuffer);
// To allocate for DIB format we use J_Image_MallocDIB() and
later on call
// J_Image_FromRawToDIB()
error = Jai_FactoryWrapper.J_Image_MallocDIB(ref ImageInfo, r
ef myConversionBuffer);
// Allocate the Lens Distortion Correction buffer
error = Jai_FactoryWrapper.J_Image_Malloc(ref myConversionBuf
fer, ref myImageProcessingBuffer, Jai_FactoryWrapper.EColorConversionPixelFormat.
PixelFormatNone);
}
else
{
// Allocate the Lens Distortion Correction buffer
error = Jai_FactoryWrapper.J_Image_Malloc(ref ImageInfo, ref
myImageProcessingBuffer, Jai_FactoryWrapper.EColorConversionPixelFormat.PixelForm
atNone);
}
// Initialize the internal undistortion map to improve processing
speed
lock (myUndistortParametersLock)
{
error = Jai_FactoryWrapper.J_Image_ProcessingInit(ref ImageIn
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
114
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
115
if (mybInitialized)
applyButton.Enabled = true;
}
private void focalLengthXNumericUpDown_ValueChanged(object sender, EventA
rgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void focalLengthYNumericUpDown_ValueChanged(object sender, EventA
rgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void k1NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void k2NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void k3NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void p1NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void p2NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void applyButton_Click(object sender, EventArgs e)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
lock (myUndistortParametersLock)
{
myUndistortParameters.OpticalCenterX = Convert.ToDouble(opticalCe
nterXNumericUpDown.Value);
myUndistortParameters.OpticalCenterY = Convert.ToDouble(opticalCe
nterYNumericUpDown.Value);
myUndistortParameters.FocalLengthX = Convert.ToDouble(focalLength
XNumericUpDown.Value);
myUndistortParameters.FocalLengthY = Convert.ToDouble(focalLength
YNumericUpDown.Value);
myUndistortParameters.CoeffK1 = Convert.ToDouble(k1NumericUpDown.
Value);
myUndistortParameters.CoeffK2 = Convert.ToDouble(k2NumericUpDown.
Value);
myUndistortParameters.CoeffK3 = Convert.ToDouble(k3NumericUpDown.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
116
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.IO;
namespace MultiCamsAsyncImageRecording
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
private int _progressCharIndex = 0;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
117
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras, and open
SearchButton_Click(null, null);
// Select List recoding mode as default
recordingModeComboBox.SelectedIndex = 0;
}
private void startCaptureButton_Click(object sender, EventArgs e)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
if (myFactory.CameraList[i].IsAsyncImageRecordingRunning || (myFa
ctory.CameraList[i].TotalAsyncImagesRecordedCount > 0))
{
DialogResult res = MessageBox.Show(this, "The Asychynchronuou
s Image Recording is already active or the internal buffer is not empty! Do you w
ant to restart the image recording and discard recorded images?", "Asynchronous I
mage Capture", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaul
tButton.Button2);
if (res == DialogResult.Yes)
{
myFactory.CameraList[i].StopAsyncImageRecording();
myFactory.CameraList[i].FreeAsyncRecordedImages();
myFactory.CameraList[i].StartAsyncImageRecording(Convert.
ToInt32(captureCountNumericUpDown.Value), (CCamera.AsyncImageRecordingMode)record
ingModeComboBox.SelectedIndex, Convert.ToInt32(skipCountNumericUpDown.Value));
}
}
else
{
myFactory.CameraList[i].StartAsyncImageRecording(Convert.ToIn
t32(captureCountNumericUpDown.Value), (CCamera.AsyncImageRecordingMode)recordingM
odeComboBox.SelectedIndex, Convert.ToInt32(skipCountNumericUpDown.Value));
}
}
}
private void stopRecordingButton_Click(object sender, EventArgs e)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
myFactory.CameraList[i].StopAsyncImageRecording();
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myFactory.CameraList[i].AsyncImageRecordin
gCount;
progressBar1.Value = myFactory.CameraList[i].TotalAsyncImagesReco
rdedCount;
progressBar1.Enabled = false;
}
}
private void replayButton_Click(object sender, EventArgs e)
{
// Here we have access to the stored images! Lets show them in an ima
ge window!!
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
118
Width = Convert.ToInt32(WidthNode.Max);
Height = Convert.ToInt32(HeightNode.Max);
IntPtr nodeHandle;
uint BytesPerPixel = 4;
if (Jai_FactoryWrapper.J_Camera_GetNodeByName(myFactory.Camer
aList[i].CameraHandle, "PixelFormat", out nodeHandle) == Jai_FactoryWrapper.EFact
oryError.Success)
{
Int64 value = 0;
if (Jai_FactoryWrapper.J_Node_GetValueInt64(nodeHandle, f
alse, ref value) == Jai_FactoryWrapper.EFactoryError.Success)
{
Jai_FactoryWrapper.EPixelFormatType pixeltype = (Jai_
FactoryWrapper.EPixelFormatType)value;
BytesPerPixel = Jai_FactoryWrapper.GetPixelTypeMemory
Size(pixeltype);
}
}
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE
(Width, Height);
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.E
FactoryError.Success;
// Calculate the size of the window rect to display the image
s
int RectWidth = 0;
int RectHeight = 0;
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RE
CT(0, 0, 100, 100); ;
// Does the image fit in width?
if ((Width + 2 * System.Windows.Forms.SystemInformation.Borde
r3DSize.Width) > System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width)
RectWidth = System.Windows.Forms.Screen.PrimaryScreen.Wor
kingArea.Width - 2 * System.Windows.Forms.SystemInformation.Border3DSize.Width;
else
RectWidth = Width;
// Does the image fit in Height?
if ((Height + System.Windows.Forms.SystemInformation.Border3D
Size.Height + System.Windows.Forms.SystemInformation.CaptionHeight) > System.Wind
ows.Forms.Screen.PrimaryScreen.WorkingArea.Height)
RectHeight = System.Windows.Forms.Screen.PrimaryScreen.Wo
rkingArea.Height - System.Windows.Forms.SystemInformation.Border3DSize.Height - S
ystem.Windows.Forms.SystemInformation.CaptionHeight;
else
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
119
RectHeight = Height;
frameRect = new Jai_FactoryWrapper.RECT(0, 0, RectWidth, Rect
Height);
string sDisplayName = myFactory.CameraList[i].ModelName;
// Open the replay view
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_Facto
ryWrapper.EIVWWindowType.OverlappedStretch, "Replay " + sDisplayName , ref frameR
ect, ref maxSize, IntPtr.Zero, out WindowHandle);
if (WindowHandle != IntPtr.Zero)
{
string sMoedlName = myFactory.CameraList[i].ModelName;
List<Jai_FactoryWrapper.ImageInfo> imageList = myFactory.
CameraList[i].GetAsyncRecordedImages();
if (imageList != null && (imageList.Count > 0))
{
for (int index = 0; index < myFactory.CameraList[i].T
otalAsyncImagesRecordedCount; index++)
{
Jai_FactoryWrapper.ImageInfo ii = imageList[index
];
Jai_FactoryWrapper.J_Image_SetViewWindowTitle(Win
dowHandle, "Replay " + sMoedlName + " " + ii.TimeStamp.ToString() + " (" + index.
ToString() + "/" + myFactory.CameraList[i].TotalAsyncImagesRecordedCount.ToString
() + ")");
Jai_FactoryWrapper.J_Image_ShowImage(WindowHandle
, ref ii, 4096, 4096, 4096);
Application.DoEvents();
Thread.Sleep(10);
}
}
Jai_FactoryWrapper.J_Image_CloseViewWindow(WindowHandle);
}
}
}
}
private void saveButton_Click(object sender, EventArgs e)
{
Directory.CreateDirectory(".\\Images");
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
string sModelName = myFactory.CameraList[i].ModelName;
string sSubDirName = ".\\Images\\Device" + i.ToString();
Directory.CreateDirectory(sSubDirName);
// Have we got any images to save to disk?
if (! myFactory.CameraList[i].IsAsyncImageRecordingRunning && ( m
yFactory.CameraList[i].TotalAsyncImagesRecordedCount > 0))
{
// Prompt the user if he wants to continue or not with the im
age save
if (MessageBox.Show(this, "Image save might take long time!\n
Are you sure you want to continue?", "Image Save", MessageBoxButtons.OKCancel, Me
ssageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.OK)
{
// Disable the Image Recording buttons as long as we are
saving the images
asynchImageRecordingGroupBox.Enabled = false;
// Get the recorded images as a list
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
120
myFactory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
121
}
// Re-enable the Image Recording buttons
asynchImageRecordingGroupBox.Enabled = true;
}
private void StartButton_Click(object sender, EventArgs e)
{
// Set Acquisition count to: stop the aquisition inside the camera af
ter first image
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
myFactory.CameraList[i].AcquisitionCount = 1;
}
// Acquisition will stop after first image
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
myFactory.CameraList[i].StartImageAcquisition(true, 5);
}
// Set Acquisition count to 0: do not stop image acqusition
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
myFactory.CameraList[i].AcquisitionCount = 0;
}
// Start Image Acqusition: This is to reduce image transmission delay
between cameras
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
myFactory.CameraList[i].StartImageAcquisition(true, 5);
}
}
private void StopButton_Click(object sender, EventArgs e)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
myFactory.CameraList[i].StopImageAcquisition();
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// enable Force IP
myFactory.EnableAutoForceIP = true;
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
string sList = myFactory.CameraList[i].ModelName;
camListBox.Items.Add(sList);
error = myFactory.CameraList[i].Open();
}
StartButton.Enabled = true;
StopButton.Enabled = true;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
122
}
else
{
MessageBox.Show("No Camera Found!");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
myFactory.CameraList[i].Close();
}
myFactory.Close();
}
private void timer1_Tick(object sender, EventArgs e)
{
int iLastCamera = myFactory.CameraList.Count - 1;
if (myFactory.CameraList[iLastCamera] != null)
{
startCaptureButton.Enabled = !myFactory.CameraList[iLastCamera].I
sAsyncImageRecordingRunning;
stopCaptureButton.Enabled = myFactory.CameraList[iLastCamera].IsA
syncImageRecordingRunning;
replayButton.Enabled = !myFactory.CameraList[iLastCamera].IsAsync
ImageRecordingRunning
&& (myFactory.CameraList[iLastCamera].TotalAsyncImagesRecorde
dCount > 0);
saveButton.Enabled = !myFactory.CameraList[iLastCamera].IsAsyncIm
ageRecordingRunning && (myFactory.CameraList[iLastCamera].TotalAsyncImagesRecorde
dCount > 0);
if (!myFactory.CameraList[iLastCamera].IsAsyncImageRecordingRunni
ng)
{
recordingStatusLabel.Text = "Recording Stopped.";
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myFactory.CameraList[iLastCamera].Asyn
cImageRecordingCount;
progressBar1.Value = myFactory.CameraList[iLastCamera].TotalA
syncImagesRecordedCount;
progressBar1.Enabled = false;
}
else
{
if (myFactory.CameraList[iLastCamera].GetAsyncImageRecordingM
ode == CCamera.AsyncImageRecordingMode.List)
{
recordingStatusLabel.Text = "Recorded " + myFactory.Camer
aList[iLastCamera].TotalAsyncImagesRecordedCount.ToString() + " images out of " +
myFactory.CameraList[iLastCamera].AsyncImageRecordingCount.ToString();
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myFactory.CameraList[iLastCamera].
AsyncImageRecordingCount;
progressBar1.Value = myFactory.CameraList[iLastCamera].To
talAsyncImagesRecordedCount;
}
else
{
if (myFactory.CameraList[iLastCamera].TotalAsyncImagesRec
ordedCount < myFactory.CameraList[iLastCamera].AsyncImageRecordingCount)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
123
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
124
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace NodeEventSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myPayloadSizeNode;
Jai_FactoryWrapper.NodeChangeDelegate myPayloadSizeNodeChangeDelegate;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void SearchButton_Click(object sender, EventArgs e)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
125
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myPayloadSizeNode = myCamera.GetNode("PayloadSize");
if (myPayloadSizeNode != null)
{
currentValue = int.Parse(myPayloadSizeNode.Value.ToString());
PayloadSizeLabel.Text = myPayloadSizeNode.Value.ToString() + " byt
es";
PayloadSizeLabel.Enabled = true;
PayloadSizeLabel2.Enabled = true;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
126
1.3 Samples
127
How to open a window and display video from a camera using Image Library functions
How to use J_Image_Processing() function to perform Red-Compensation
using
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace RedCompensationSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
// Handle to the Display Window to output the Red-compensated output imag
e
IntPtr myViewWindow;
// Conversion buffer to convert the image before image processing
Jai_FactoryWrapper.ImageInfo myConversionBuffer;
// Gain values used by the color interpolation during image conversion an
d display
uint myRGain;
uint myGGain;
uint myBGain;
// Red-Compensation parameters
uint myRedThreshold = 250;
uint myGreenThreshold = 240;
uint myBlueThreshold = 220;
uint myRedGain = 100;
uint myGreenGain = 50;
uint myBlueGain = 50;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
128
Width = 0;
Height = 0;
WidthNode = myCamera.GetNode("Width");
HeightNode = myCamera.GetNode("Height");
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
129
Jai_FactoryWrapper.EFactoryError retsta;
if (myCamera != null)
{
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
}
if (myViewWindow != IntPtr.Zero)
{
Jai_FactoryWrapper.J_Image_CloseViewWindow(myViewWindow);
myViewWindow = IntPtr.Zero;
}
// Free the conversion buffer again if it has been allocated
if (myConversionBuffer.ImageBuffer != IntPtr.Zero)
{
retsta = Jai_FactoryWrapper.J_Image_Free(ref myConversionBuffer);
myConversionBuffer.ImageBuffer = IntPtr.Zero;
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.To
String());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.To
String());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToStrin
g());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
130
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
131
= new Jai_FactoryWrapper.RedCompensationStruct();
// Remember to allocate the 10 Red-compensation ROI structures
myRedCompensationParameters.ColorCompensationROI = new Jai_FactoryWra
pper.ColorCompensationROIStruct[10];
if (fullImageCheckBox.Checked)
{
myRedCompensationParameters.NumOfROI = 1;
myRedCompensationParameters.ColorCompensationROI[0].RectOfROI.Lef
t = 0;
myRedCompensationParameters.ColorCompensationROI[0].RectOfROI.Rig
ht = (int)ImageInfo.SizeX - 1;
myRedCompensationParameters.ColorCompensationROI[0].RectOfROI.Top
= 0;
myRedCompensationParameters.ColorCompensationROI[0].RectOfROI.Bot
tom = (int)ImageInfo.SizeY - 1;
myRedCompensationParameters.ColorCompensationROI[0].RThreshold =
myRedThreshold;
myRedCompensationParameters.ColorCompensationROI[0].GThreshold =
myGreenThreshold;
myRedCompensationParameters.ColorCompensationROI[0].BThreshold =
myBlueThreshold;
myRedCompensationParameters.ColorCompensationROI[0].RGain = 4096
* myRedGain / 100;
myRedCompensationParameters.ColorCompensationROI[0].GGain = 4096
* myGreenGain / 100;
myRedCompensationParameters.ColorCompensationROI[0].BGain = 4096
* myBlueGain / 100;
}
else
{
myRedCompensationParameters.NumOfROI = 3;
for (int i = 0; i < 3; i++)
{
myRedCompensationParameters.ColorCompensationROI[i].RectOfROI
.Left = (int)ImageInfo.SizeX * i * 2 / 5;
myRedCompensationParameters.ColorCompensationROI[i].RectOfROI
.Right = (int)ImageInfo.SizeX * (i * 2 + 1) / 5 - 1;
myRedCompensationParameters.ColorCompensationROI[i].RectOfROI
.Top = (int)ImageInfo.SizeY * 2 / 5;
myRedCompensationParameters.ColorCompensationROI[i].RectOfROI
.Bottom = (int)ImageInfo.SizeY * 3 / 5 - 1;
myRedCompensationParameters.ColorCompensationROI[i].RThreshol
d = myRedThreshold;
myRedCompensationParameters.ColorCompensationROI[i].GThreshol
d = myGreenThreshold;
myRedCompensationParameters.ColorCompensationROI[i].BThreshol
d = myBlueThreshold;
myRedCompensationParameters.ColorCompensationROI[i].RGain = 4
096 * myRedGain / 100;
myRedCompensationParameters.ColorCompensationROI[i].GGain = 4
096 * myGreenGain / 100;
myRedCompensationParameters.ColorCompensationROI[i].BGain = 4
096 * myBlueGain / 100;
}
}
if (enableCheckBox.Checked)
{
retsta = Jai_FactoryWrapper.J_Image_Processing(ref myConversionBu
ffer, myRedCompensationParameters, true);
}
if (myViewWindow != IntPtr.Zero)
Jai_FactoryWrapper.J_Image_ShowImage(myViewWindow, ref myConversi
onBuffer, myRGain, myGGain, myBGain);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
132
return;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Jai_FactoryWrapper.EFactoryError retsta;
// Free the conversion buffer again if it has been allocated
if (myConversionBuffer.ImageBuffer != IntPtr.Zero)
{
retsta = Jai_FactoryWrapper.J_Image_Free(ref myConversionBuffer);
myConversionBuffer.ImageBuffer = IntPtr.Zero;
}
if (myCamera != null)
{
myCamera.Close();
return;
}
}
private void redThresholdNumericUpDown_ValueChanged(object sender, EventA
rgs e)
{
myRedThreshold = Convert.ToUInt32(redThresholdNumericUpDown.Value);
}
private void greenThresholdNumericUpDown_ValueChanged(object sender, Even
tArgs e)
{
myGreenThreshold = Convert.ToUInt32(greenThresholdNumericUpDown.Value
);
}
private void blueThresholdNumericUpDown_ValueChanged(object sender, Event
Args e)
{
myBlueThreshold = Convert.ToUInt32(blueThresholdNumericUpDown.Value);
}
private void redGainNumericUpDown_ValueChanged(object sender, EventArgs e
)
{
myRedGain = Convert.ToUInt32(redGainNumericUpDown.Value);
}
private void greenGainNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
myGreenGain = Convert.ToUInt32(greenGainNumericUpDown.Value);
}
private void blueGainNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
myBlueGain = Convert.ToUInt32(blueGainNumericUpDown.Value);
}
}
}
1.3 Samples
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam (Width, Height and GainRaw)
How to open a window and display video from a camera
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace SimpleImageDisplaySample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
133
134
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
135
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
myCamera.Close();
}
}
}
136
using
using
using
using
using
namespace ZoomImageDisplaySample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.StartImageAcquisition(true, 5);
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.StopImageAcquisition();
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
137
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
138
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
1.3 Samples
139
{
if (myCamera != null)
myCamera.NavigateRight();
}
private void LeftDownButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.NavigateLeftDown();
}
private void DownButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.NavigateDown();
}
private void RightDownButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.NavigateRightDown();
}
private void ZoomInbutton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.ZoomIn();
}
private void ZoomResetbutton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.ZoomReset();
}
private void ZoomOutbutton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.ZoomOut();
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
140
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Chapter 2
Module Index
2.1
Modules
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
147
149
157
159
165
167
171
174
175
181
185
188
206
212
217
225
235
248
252
257
259
260
262
265
271
284
288
296
300
302
304
307
314
142
Module Index
Transformation functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Image Processing functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Color-Compensation Image Processing algorithms . . . . . . . . . . . . . . . . . . .
Lens Distortion Correction Image Processing algorithms . . . . . . . . . . . . . . .
The Managed JAI SDK Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The CFactory Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The CCamera Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Image Acquisition Control methods . . . . . . . . . . . . . . . . . . . . . . . . . . . .
White-Balance control methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Zoom and Navigation methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Asynchronous image recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Camera Connection Status delegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GigE Vision Event delegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Node Event delegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Scripting methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Scripting and Command Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Direct Register Access methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GenICam Node Access methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Image Save methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inter-packet Delay calculation methods . . . . . . . . . . . . . . . . . . . . . . . . . . .
The CNode Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
317
319
324
327
373
330
331
333
342
357
368
344
345
346
347
332
350
351
353
366
372
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Chapter 3
Class Index
3.1
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
ActionCommandAck (Action Command Acknowledge structure ) . . . . . . . . . . . . . . . .
BufferInfoStruct (This structure is used for reading buffer information with J_DataStream_GetBufferInfo() ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CCamera (Camera object class used by the Managed Factory ) . . . . . . . . . . . . . . . . . .
CFactory (Factory object class ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CNode (GenICam Node object class used by the Managed Factory ) . . . . . . . . . . . . . . .
ColorCompensationROIStruct (Structure containing Color-Compensation parameters. This is
used for both Red-Compensation and Green-Compensation ) . . . . . . . . . . . . . .
Command (Command class used for scripting feature settings ) . . . . . . . . . . . . . . . . . .
DeviceEventData (Struct containing the information provided by a GigE Event to pass it on to
the GenAPI ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
EventInfoData (Struct containing the information provided by a GigE Event to pass it on to the
GenAPI ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FactoryErrorException (JAI SDK Factory Exceptions ) . . . . . . . . . . . . . . . . . . . . . .
GenICamErrorInfo (GenICam Error Info ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GreenCompensationStruct (Structure containing Green-Compensation parameters ) . . . . . . .
HistogramInfo (Structure containing Histogram data ) . . . . . . . . . . . . . . . . . . . . . . .
IEnumValue (This class contains information about a single enumeration entry node inside an
IEnumeration node ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ImageInfo (Image information structure used in callback and image conversion functions ) . . .
IVWCallbackValue (Type of value passed on by the Image View Window callback delegate. The
value to use depends on the Callback Type ) . . . . . . . . . . . . . . . . . . . . . . .
IVWOptionValue (Option type used in J_Image_SetViewWindowOption() and J_Image_GetViewWindowOption() ) . . . . . . . . . . . . . . . . . . . . . . . .
Jai_FactoryWrapper (Wrapper class for the JAI SDK Jai_Factory.dll functions ) . . . . .
LUTInfo (Structure containing LUT data ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PixelValue (Pixel value structure that will hold Mono8, Mono10, Mono12, Mono16, DIB24,
RGB24, DIB32 and BGR48 pixels ) . . . . . . . . . . . . . . . . . . . . . . . . . . .
POINT (Windows POINT implementation for pInvoke ) . . . . . . . . . . . . . . . . . . . . .
RECT (Windows RECT implementation for pInvoke ) . . . . . . . . . . . . . . . . . . . . . . .
RedCompensationStruct (Structure containing Red-Compensation parameters ) . . . . . . . . .
Script (Script class used for feature value scripting ) . . . . . . . . . . . . . . . . . . . . . . . .
SIZE (Windows SIZE implementation for pInvoke ) . . . . . . . . . . . . . . . . . . . . . . .
375
377
381
402
411
421
423
425
427
428
429
430
431
433
436
439
441
442
466
468
472
474
478
479
482
144
Class Index
StreamInfoStruct (This structure is used for reading buffer information with J_DataStream_GetStreamInfo() or J_Image_GetStreamInfo() ) . . . . . . . . . . . . .
StreamParameterStruct (This structure is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam() ) . . . . . . . .
UndistortStruct (Structure containing Lens Distortion Correction parameters ) . . . . . . . . . .
UserDrawInfo (User-Draw value structure. This is used by the J_IVW_CB_USER_DRAW_IMAGE and J_IVW_CB_USER_DRAW_VIEW_WINDOW Image View Window event
) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ZoomPos (Zoom Position value structure. This is used by the J_IVW_CB_ZOOM_POS Image
View Window event ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
483
485
487
490
491
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Chapter 4
File Index
4.1
File List
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
493
494
495
497
146
File Index
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Chapter 5
Module Documentation
5.1
Classes
class Jai_FactoryWrapper
Wrapper class for the JAI SDK Jai_Factory.dll functions.
Modules
Factory specific functions
The Factory is the entity that contains the whole JAI SDK functionality and in order to access any of the
SDK functions the Factory will have to be opened first using the J_Factory_Open() function. This will
return a handle to the Factory itself. This handle will be used later on in searcing for and accessing the
GigE Vision devices. All the Factory specific functions are named J_Factory_...().
148
Module Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.2
149
The Factory is the entity that contains the whole JAI SDK functionality and in order to access any of the
SDK functions the Factory will have to be opened first using the J_Factory_Open() function. This
will return a handle to the Factory itself. This handle will be used later on in searcing for and accessing the
GigE Vision devices. All the Factory specific functions are named J_Factory_...().
Classes
class FactoryErrorException
JAI SDK Factory Exceptions.
struct GenICamErrorInfo
GenICam Error Info.
Modules
Action Command function
Triggering an action in multiple devices at roughly the same time can be accomplished through the optional
Action command introduced in GigE Vision 1.1. Using a distinct command (instead of a Write Register
Command) has the advantage that it does not rely on a specific register map. Therefor, different type of
devices can be targeted with the same message. Note that due to the nature of Ethernet, this is not as synchronous as a hardware trigger since different network segments can have different latencies. Nevertheless
in a swithced network, the resulting jitter is acceptable for a broad range of applications and this scheme
provides a convenient way to synchronize devices by means of a software command. The most typical scenario is when an application desires to trigger a simultaneous action on multiple devices. This could for
instance be triggering the device or resetting the internal timestamp counter.
Enumerations
enum EFactoryError {
Success = 0, InvalidBufferSize = -1, InvalidHandle = -2, InvalidID = -3,
AccessDenied = -4, NoData = -5, Error = -6, InvalidParameter = -7,
Timeout = -8, InvalidFilename = -9, InvalidAddress = -10, FileIO = -11,
GenICamError = -12, ValidationError = -13, ValidationWarning = -14 }
Error return code enumeration.
enum ECameraInfoType {
Manufacturer = 0, ModelName, IPAddress, MACAddress,
SerialNumber, UserName, InterfaceID = 100 }
Camera information type enumeration.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
150
Module Documentation
Functions
static string GetFactoryErrorString (Jai_FactoryWrapper.EFactoryError error)
Return a string that gives more explanation about the Factory Error code.
static Jai_FactoryWrapper.EFactoryError
FACTORY_HANDLE FactoryHandle)
J_Factory_Open
(String
RegistryFileName,
out
static Jai_FactoryWrapper.EFactoryError J_Factory_GetInfo (EFactoryInfoType InfoType, StringBuilder InfoString, ref int BufferSize)
Get information about the Jai_Factory.dll.
static Jai_FactoryWrapper.EFactoryError J_Factory_GetCameraInfo (FACTORY_HANDLE FactoryHandle, String CameraID, ECameraInfoType InfoType, StringBuilder InfoString, ref UInt32
Size)
Get detailed information about a camera.
5.2.1
Detailed Description
The Factory is the entity that contains the whole JAI SDK functionality and in order to access any of the
SDK functions the Factory will have to be opened first using the J_Factory_Open() function. This
will return a handle to the Factory itself. This handle will be used later on in searcing for and accessing the
GigE Vision devices. All the Factory specific functions are named J_Factory_...().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.2.2
5.2.2.1
151
5.2.2.2
5.2.2.3
152
Module Documentation
See also:
J_Factory_GetCameraInfo(FACTORY_HANDLE, String, ECameraInfoType, StringBuilder, ref
UInt32)
Enumerator:
Manufacturer Manufacturer Name.
ModelName Model Name.
IPAddress IP Address.
MACAddress MAC Address.
SerialNumber Serial Number.
UserName User defined Name.
InterfaceID Interface ID.
5.2.3
Function Documentation
5.2.3.1
Return a string that gives more explanation about the Factory Error code.
Parameters:
error Error code returned from one of the fectory methods
Returns:
String representation of the Factory Error Code
5.2.3.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
153
5.2.3.4
Parameters:
InfoType The type of information from the factory that is requested
InfoString A Stringbuilder with space for the requested information
BufferSize The capacity of the StringBuilder. The size of the information string will be returned
Returns:
Jai_FactoryWrapper.EFactoryError
5.2.3.5
Perform a Device Discovery and update the internal list of available cameras.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
154
Module Documentation
// C# Sample that perform Device Discovery and opens all cameras foun
d
EFactoryError error = EFactoryError.Success;
StringBuilder stringBuilder = new StringBuilder(512);
uint Size = (uint)stringBuilder.Capacity;
bool HasChanged;
// Perform Device Discovery
error = J_Factory_UpdateCameraList(factoryHandle, ref HasChanged);
if ((error == EFactoryError.Success) && HasChanged)
{
// Get the number of cameras found
error = J_Factory_GetNumOfCameras(factoryHandle, ref NumberOfCamera
s);
if (NumberOfCameras > 0)
{
// Run through the list of cameras found and get the unique camer
a IDs
for (int index = 0; index <newCameraCount; index++)
{
Size = (uint)stringBuilder.Capacity;
error = J_Factory_GetCameraIDByIndex(factoryHandle, index, stri
ngBuilder, out Size);
if (error == EFactoryError.Success)
{
IntPtr cameraHandle;
// And open it
J_Camera_Open(factoryHandle, stringBuilder.ToString(), camera
Handle);
}
}
}
}
Parameters:
FactoryHandle Valid factory handle
HasChanged Returns True if there is found one or more new devices
Returns:
Jai_FactoryWrapper.EFactoryError
5.2.3.6
Get the number of cameras found during Device Discovery with J_Factory_UpdateCameraList().
It is important to note that the same physical camera might show up multiple times if more than one
driver is installed and active. Normally both the SocketDriver and the FilterDriver will be installed and if
for instance a single camera is present on the network then the J_Factory_UpdateCameraList()
function will find it twice - once via the SocketDriver and once via the FilterDriver and J_Factory_GetNumOfCameras() will return the number 2. It is then possible for the application to select which
driver to use for the connection by opening the camera via a specific camera ID returned by J_Factory_GetCameraIDByIndex() using either index 0 or index 1. In order to determine the driver type used
the application has to parse the camera ID string and search for INT=>SD if it is the SocketDriver and
INT=>FD if it is the FilterDriver.
Parameters:
FactoryHandle Valid factory handle
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
155
NumOfCameras Returns the number of cameras in the camera list create by the J_Factory_UpdateCameraList()
Returns:
Jai_FactoryWrapper.EFactoryError
5.2.3.7
Get a string that uniquely identifies the camera, interface and the transport layer.
This string will be used to open the camera later on with J_Camera_Open() ex: "TL GevTL::INT
FD::MAC::...::DEV CV-A10GE"
It is important to note that the same physical camera might show up multiple times if more than one
driver is installed and active. Normally both the SocketDriver and the FilterDriver will be installed and if
for instance a single camera is present on the network then the J_Factory_UpdateCameraList()
function will find it twice - once via the SocketDriver and once via the FilterDriver and J_Factory_GetNumOfCameras() will return the number 2. It is then possible for the application to select which
driver to use for the connection by opening the camera via a specific camera ID returned by J_Factory_GetCameraIDByIndex() using either index 0 or index 1. In order to determine the driver type used
the application has to parse the camera ID string and search for INT=>SD if it is the SocketDriver and
INT=>FD if it is the FilterDriver.
Parameters:
FactoryHandle Valid factory handle
Index The index of the camera into the camera list generated by J_Factory_UpdateCameraList()
CameraID Reference to a StringBuilder to put the string
Size The capacity of the StringBuilder. The length of the CameraID will be returned
Returns:
Jai_FactoryWrapper.EFactoryError
5.2.3.8
156
Module Documentation
ECameraInfoType.Manufacturer, stringBuilder, ref Size);
if (error == EFactoryError.Success)
Manufacturer = stringBuilder.ToString();
Parameters:
FactoryHandle Valid factory handle
CameraID Unique camera ID. This is retrieved using J_Factory_GetCameraIDByIndex()
InfoType The information type that is requested
InfoString Reference to a StringBuilder to put the requested information into
Size The capacity of the StringBuilder. The length of the information string will be returned
Returns:
Jai_FactoryWrapper.EFactoryError
5.2.3.9
5.2.3.10
Parameters:
genICamErrorInfo Reference to a GenICamErrorInfo structure to put the requested information into
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.3
157
Triggering an action in multiple devices at roughly the same time can be accomplished through the optional
Action command introduced in GigE Vision 1.1. Using a distinct command (instead of a Write Register
Command) has the advantage that it does not rely on a specific register map. Therefor, different type of
devices can be targeted with the same message. Note that due to the nature of Ethernet, this is not as synchronous as a hardware trigger since different network segments can have different latencies. Nevertheless
in a swithced network, the resulting jitter is acceptable for a broad range of applications and this scheme
provides a convenient way to synchronize devices by means of a software command. The most typical
scenario is when an application desires to trigger a simultaneous action on multiple devices. This could for
instance be triggering the device or resetting the internal timestamp counter.
Classes
struct ActionCommandAck
Action Command Acknowledge structure.
Functions
static Jai_FactoryWrapper.EFactoryError J_Factory_SendActionCommand (FACTORY_HANDLE
FactoryHandle, UInt32 DeviceKey, UInt32 GroupKey, UInt32 GroupMask, IntPtr pAckBufferArray,
ref UInt32 NumOfAck)
This function broadcasts a GigE Vision Action Command telegram on all network interfaces.
5.3.1
Detailed Description
Triggering an action in multiple devices at roughly the same time can be accomplished through the optional
Action command introduced in GigE Vision 1.1. Using a distinct command (instead of a Write Register
Command) has the advantage that it does not rely on a specific register map. Therefor, different type of
devices can be targeted with the same message. Note that due to the nature of Ethernet, this is not as synchronous as a hardware trigger since different network segments can have different latencies. Nevertheless
in a swithced network, the resulting jitter is acceptable for a broad range of applications and this scheme
provides a convenient way to synchronize devices by means of a software command. The most typical
scenario is when an application desires to trigger a simultaneous action on multiple devices. This could for
instance be triggering the device or resetting the internal timestamp counter.
The following four conditions must be met for an action signal to be asserted by the device:
1) The device has an open primary control channel.
2) The iDeviceKey in the Action Command packet and the ActionDeviceKey configured in the
boostrap register must be equal.
3) The iGroupKey in the Action Command packet and the ActionGroupKey of the corresponding
device action must be equal.
4) The logical AND-wise operation of the iGroupMask in the Action Command packet and the
ActionGroupMask of the corresponding device action must be non-zero. That is, that they must
have at least one common bit set at the same position in the 32-bit register.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
158
Module Documentation
Note:
Actions are not available in GigE Vision version 1.0 devices. It is optional for GigE Vision 1.1 (and
newer) compliant devices to implement Actions.
5.3.2
Function Documentation
5.3.2.1
This function broadcasts a GigE Vision Action Command telegram on all network interfaces.
// Prepare buffer to hold the maximum number of acknowledge structure
s requested
uint numOfAcks = NumOfAcksExpected;
int bufferSize = (int)NumOfAcksExpected*Marshal.SizeOf(typeof(ActionC
ommandAck));
byte[] localBuffer = new byte[bufferSize];
GCHandle gch = GCHandle.Alloc(localBuffer, GCHandleType.Pinned);
EFactoryError retsta = J_Factory_SendActionCommand(FactoryHandle, Dev
iceKey, GroupKey, GroupMask, gch.AddrOfPinnedObject(), ref numOfAcks);
if (retsta == EFactoryError.Success)
{
AckBufferArray = new ActionCommandAck[numOfAcks];
// Copy the contents of the acknowledges into the structure to retu
rn
for (int i = 0; i < numOfAcks; i++)
{
IntPtr ptr = (IntPtr)((int)gch.AddrOfPinnedObject() + Marshal.Siz
eOf(typeof(ActionCommandAck))*i);
AckBufferArray[i] = (ActionCommandAck)Marshal.PtrToStructure(ptr,
typeof(ActionCommandAck));
}
}
gch.Free();
See also:
J_Camera_Close(CAMERA_HANDLE)
Parameters:
FactoryHandle Valid factory handle
DeviceKey Device-key that authorize the action on the target devices.
GroupKey Group-key that extend the range of separate device groups.
GroupMask Group-mask that trigger action in multiple groups of devices separately.
pAckBufferArray Pointer to a buffer to receive acknowledge information of Action-command.
NumOfAck The maximum number of acknowledgement information to be received (number of structures ActionCommandAck allocated and pointed to by pAckBufferArray). This value
will be updated with the actual number of received acknowledge telegrams.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.4
159
The Camera specific functions are all used for accessing the GigE Vision devices. In order to access all
the camera functions a camera connection will need to be established by "opening" the camera connection
using the J_Camera_Open() or J_Camera_OpenMc() functions. When the camera connection is no
longer needed then the J_Camera_Close() needs to be called in order to release the resources allocated
for the device. All the camera specific functions are named J_Camera_...().
Modules
Camera connection functions
The following functions are used for connection to cameras and disconnection from cameras.
Enumerations
enum EDeviceAccessFlags { None = 0, ReadOnly = 1, Control = 2, Exclusive = 4 }
Camera access mode flag enumeration.
enum EConfInfoType {
ModelName = 0, VendorName, ToolTip, StandardNameSpace,
GenApiVersion, SchemaVersion, DeviceVersion, ProductGuid,
VersionGuid }
XML-file configuration information type enumeration.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
160
Module Documentation
enum EConfVisibility {
Beginner = 0, Expert = 1, Guru = 2, Invisible = 3,
_UndefinedVisibility = 99 }
Recommended visibility of an GenICam node.
enum EConfNodeType {
UnknowNodeType = 1, INode = 100, ICategory, IInteger,
IEnumeration, IEnumEntry, IMaskedIntReg, IRegister,
IIntReg, IFloat, IFloatReg, ISwissKnife,
IIntSwissKnife, IIntKey, ITextDesc, IPort,
IConfRom, IAdvFeatureLock, ISmartFeature, IStringReg,
IBoolean, ICommand, IConverter, IIntConverter,
IChunkPort, INodeMap, INodeMapDyn, IDeviceInfo,
ISelector, IPortConstruct }
The GenICam interface node type of a specific node.
enum EConfAccessMode {
NI, NA, WO, RO,
RW, _UndefinedAccesMode }
Access mode of a GenICam node.
enum EConfRepresentation {
Linear, Logarithmic, Boolean, PureNumber,
HexNumber, IPV4Address, MACAddress, _UndefinedRepresentation }
Defines the node representaion in the GUI.
5.4.1
Detailed Description
The Camera specific functions are all used for accessing the GigE Vision devices. In order to access all
the camera functions a camera connection will need to be established by "opening" the camera connection
using the J_Camera_Open() or J_Camera_OpenMc() functions. When the camera connection is no
longer needed then the J_Camera_Close() needs to be called in order to release the resources allocated
for the device. All the camera specific functions are named J_Camera_...().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.4.2
5.4.2.1
161
5.4.2.2
5.4.2.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
162
Module Documentation
5.4.2.4
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.4.2.6
5.4.2.7
5.4.2.8
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
163
164
Module Documentation
5.4.2.9
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.5
165
The following functions are used for connection to cameras and disconnection from cameras.
Functions
static Jai_FactoryWrapper.EFactoryError J_Camera_Open (FACTORY_HANDLE FactoryHandle,
String CameraID, out CAMERA_HANDLE CameraHandle)
Open a camera from a camera ID and return valid camera handle.
static Jai_FactoryWrapper.EFactoryError J_Camera_OpenMc (FACTORY_HANDLE FactoryHandle, String CameraID, out CAMERA_HANDLE CameraHandle, EDeviceAccessFlags OpenFlags,
UInt32 McIP)
Open a camera with multicasting from a camera ID and return valid camera handle.
5.5.1
Detailed Description
The following functions are used for connection to cameras and disconnection from cameras.
5.5.2
Function Documentation
5.5.2.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
166
Module Documentation
5.5.2.2
Open a camera with multicasting from a camera ID and return valid camera handle.
The ID can be camera ID returned from the J_Factory_GetCameraID() or a user defined name
See also:
J_Camera_Close(CAMERA_HANDLE)
Parameters:
FactoryHandle Valid factory handle
CameraID A string that holds the unique id of the camera.
CameraHandle A reference to where the valid camera handle should be returned.
OpenFlags Device access Flags
McIP Multicast IP address
Returns:
Jai_FactoryWrapper.EFactoryError
5.5.2.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.6
167
The following functions are used for directly reading and writing GenICam feature node valued inside
cameras without having to explicitly get the node handles. This is the easiest way to get and set the values
of the GenICam features.
Functions
static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueInt64 (CAMERA_HANDLE CameraHandle, String NodeName, ref Int64 Value)
Get the value of a GenICam feature node as Int64 type.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueDouble (CAMERA_HANDLE CameraHandle, String NodeName, ref double Value)
Get the value of a GenICam feature node as double type.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueString (CAMERA_HANDLE CameraHandle, String NodeName, StringBuilder ValueStr, ref UInt32 SizeValueStr)
Get the value of a GenICam feature node as String type.
5.6.1
Detailed Description
The following functions are used for directly reading and writing GenICam feature node valued inside
cameras without having to explicitly get the node handles. This is the easiest way to get and set the values
of the GenICam features.
5.6.2
Function Documentation
5.6.2.1
168
Module Documentation
5.6.2.2
5.6.2.3
169
5.6.2.4
5.6.2.5
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
170
Module Documentation
5.6.2.6
5.6.2.7
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.7
171
The following functions are used for reading and writing registers valued inside cameras without using the
GenICam feature nodes.
Functions
static Jai_FactoryWrapper.EFactoryError J_Camera_ReadData (CAMERA_HANDLE CameraHandle, Int64 Address, IntPtr Data, ref UInt32 Size)
Read data directly from the camera.
static Jai_FactoryWrapper.EFactoryError J_Camera_WriteData (CAMERA_HANDLE CameraHandle, Int64 Address, byte[ ] Data, ref UInt32 Size)
Write data directly to the camera.
static Jai_FactoryWrapper.EFactoryError J_Camera_WriteData (CAMERA_HANDLE CameraHandle, Int64 Address, IntPtr Data, ref UInt32 Size)
Write data directly to the camera.
5.7.1
Detailed Description
The following functions are used for reading and writing registers valued inside cameras without using the
GenICam feature nodes.
5.7.2
Function Documentation
5.7.2.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
172
Module Documentation
if (error == EFactoryError.Success)
{
... do something with the data
}
Parameters:
CameraHandle A valid camera handle
Address The address to be read from
Data A pointer to a buffer to put the read data into
Size The size of data that is read from the device
Returns:
Jai_FactoryWrapper.EFactoryError
5.7.2.2
5.7.2.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
173
174
Module Documentation
5.8
The following function is used for accessing the XML-file configuration information about a camera.
Functions
static Jai_FactoryWrapper.EFactoryError J_Camera_GetConfigInfo (CAMERA_HANDLE CameraHandle, EConfInfoType InfoType, StringBuilder InfoString, ref UInt32 Size)
Retrieve information about the GenICam XML-file configuration loaded for the device.
5.8.1
Detailed Description
The following function is used for accessing the XML-file configuration information about a camera.
5.8.2
Function Documentation
5.8.2.1
Retrieve information about the GenICam XML-file configuration loaded for the device.
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
Parameters:
CameraHandle A handle to a camera device obtained using J_Camera_Open()
InfoType The type of information requested
InfoString StringBuilder to return the information into
Size The capacity of the StringBuilder. The length of the information string will be returned
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.9
175
The following functions are used for accessing the GenICam feature nodes from the XML-file loaded from
the camera.
Functions
static Jai_FactoryWrapper.EFactoryError J_Camera_GetNumOfNodes (CAMERA_HANDLE
CameraHandle, ref UInt32 NumOfNodes)
Get the number of nodes in the entire GenICam node map for the camera.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetNodeByIndex (CAMERA_HANDLE CameraHandle, UInt32 Index, out NODE_HANDLE NodeHandle)
Get the node by the node map index. Valid indices will be between 0 and the value returned using J_Camera_GetNumOfNodes().
5.9.1
Detailed Description
The following functions are used for accessing the GenICam feature nodes from the XML-file loaded from
the camera.
5.9.2
Function Documentation
5.9.2.1
Get the number of nodes in the entire GenICam node map for the camera.
The camera needs to be opened using J_Camera_Open() before the number of nodes can be read
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
176
Module Documentation
// C# Sample enumerates all GenICam nodes in a camera and prints out
node names
EFactoryError error = EFactoryError.Success;
UInt32 NumOfNodes = 0;
// Get the number of nodes
error = J_Camera_GetNumOfNodes(cameraHandle, ref NumOfNodes);
if (NumOfNodes > 0)
{
// Run through the list of nodes and print out the names
for (int index = 0; index <NumOfNodes; index++)
{
IntPtr nodeHandle;
error = J_Camera_GetNodeByIndex(cameraHandle, index, out nodeHand
le);
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
StringBuilder stringBuilder = new StringBuilder(512);
uint Size = (uint)stringBuilder.Capacity;
error = J_Node_GetName(nodeHandle, stringBuilder, Size, 0);
if (error == EFactoryError.Success)
{
// Print out the name
Console.Out.WriteLine(stringBuilder.ToString());
}
}
}
}
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE), J_Node_GetName()
Parameters:
CameraHandle A valid handle to a camera
NumOfNodes The number of GenICam nodes in the node map
Returns:
Jai_FactoryWrapper.EFactoryError
5.9.2.2
Get the node by the node map index. Valid indices will be between 0 and the value returned using J_Camera_GetNumOfNodes().
The camera needs to be opened using J_Camera_Open() before the nodes can be opened
// C# Sample enumerates all GenICam nodes in a camera and prints out
node names
EFactoryError error = EFactoryError.Success;
UInt32 NumOfNodes = 0;
// Get the number of nodes
error = J_Camera_GetNumOfNodes(cameraHandle, ref NumOfNodes);
if (NumOfNodes > 0)
{
// Run through the list of nodes and print out the names
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
177
See also:
J_Camera_Open(FACTORY_HANDLE,
GetNumOfNodes()
String,
out
CAMERA_HANDLE),
J_Camera_-
Parameters:
CameraHandle A valid handle to a camera
Index The index of the node requested
NodeHandle The handle to the node
Returns:
Jai_FactoryWrapper.EFactoryError
5.9.2.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
178
Module Documentation
5.9.2.4
Get the number of sub feature nodes in the given node map tree specified by a parent node name.
The camera needs to be opened using J_Camera_Open() before the number of sub feature nodes can
be read
// C# Sample enumerates all GenICam sub feature nodes in the root tre
e of a camera and prints out the node names
EFactoryError error = EFactoryError.Success;
UInt32 NumOfSubFeatureNodes = 0;
// Get the number of nodes
error = J_Camera_GetNumOfSubFeatures(cameraHandle, "Root", ref NumOfS
ubFeatureNodes);
if (NumOfSubFeatureNodes > 0)
{
// Run through the list of sub feature nodes and print out the name
s
for (int index = 0; index <NumOfSubFeatureNodes; index++)
{
IntPtr nodeHandle;
error = J_Camera_GetSubFeatureByIndex(cameraHandle, "Root", index
, out nodeHandle);
if (error == EFactoryError.Success)
{
StringBuilder stringBuilder = new StringBuilder(512);
uint Size = (uint)stringBuilder.Capacity;
error = J_Node_GetName(nodeHandle, stringBuilder, Size, 0);
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
// Print out the name
Console.Out.WriteLine(stringBuilder.ToString());
}
}
}
}
See also:
J_Camera_Open(), J_Node_GetName()
Parameters:
CameraHandle A valid handle to a camera
ParentNodeName Name of the parent node name in the node map tree
NumOfSubFeatures The number of sub feature nodes
Returns:
Jai_FactoryWrapper.EFactoryError
5.9.2.5
179
// C# Sample enumerates all GenICam sub feature nodes in the root tre
e of a camera and prints out the node names
EFactoryError error = EFactoryError.Success;
UInt32 NumOfSubFeatureNodes = 0;
// Get the number of nodes
error = J_Camera_GetNumOfSubFeatures(cameraHandle, "Root", ref NumOfS
ubFeatureNodes);
if (NumOfSubFeatureNodes > 0)
{
// Run through the list of sub feature nodes and print out the name
s
for (int index = 0; index <NumOfSubFeatureNodes; index++)
{
IntPtr nodeHandle;
error = J_Camera_GetSubFeatureByIndex(cameraHandle, "Root", index
, out nodeHandle);
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
StringBuilder stringBuilder = new StringBuilder(512);
uint Size = (uint)stringBuilder.Capacity;
error = J_Node_GetName(nodeHandle, stringBuilder, Size, 0);
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
// Print out the name
Console.Out.WriteLine(stringBuilder.ToString());
}
}
}
}
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE), J_Node_GetName()
Parameters:
CameraHandle A valid handle to a camera
ParentNodeName The name of the parent node
Index The index of the node requested
NodeHandle Reference to where the handle to the node will be returned
Returns:
Jai_FactoryWrapper.EFactoryError
5.9.2.6
J_Node_-
180
Module Documentation
Parameters:
CameraHandle A valid handle to a camera
FeatureNodeName The name of the node requested
NodeHandle The handle to the node
Returns:
Jai_FactoryWrapper.EFactoryError
5.9.2.7
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.10
181
The following functions are used for accesing the Image Data Streams for a camera.
Functions
static Jai_FactoryWrapper.EFactoryError J_Camera_GetNumOfDataStreams
HANDLE CameraHandle, ref UInt32 NumOfDataStreams)
(CAMERA_-
delegate
void
ConnectionStatusCallBack
(CCamera
FactoryWrapper.EDeviceConnectionType connectionStatus)
camera,
Jai_-
Delegate to be called as callback function when a new image has been received.
5.10.1
Detailed Description
The following functions are used for accesing the Image Data Streams for a camera.
5.10.2
Function Documentation
5.10.2.1
182
Module Documentation
Parameters:
CameraHandle Handle to a valid camera object, obtained by J_Camera_Open() function
NumOfDataStreams Reference to a variable in which the number of data streams is stored.
Returns:
Jai_FactoryWrapper.EFactoryError
5.10.2.2
183
{
m_streamThread.Start();
}
else
{
J_DataStream_Close(StreamHandle);
return false;
}
return true;
}
Parameters:
CameraHandle Handle to a valid camera object, obtained by J_Camera_Open() function.
Channel Data stream channel number. Must be within 0 and the value returned by J_Camera_GetNumOfDataStreams()
DSHandle Variable in which the data streams handle is stored
Returns:
Jai_FactoryWrapper.EFactoryError
5.10.2.3
5.10.2.4
Delegate to be called as callback function when a new image has been received.
Parameters:
ImageInfo Image information to be used in the image function
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
184
Module Documentation
5.10.2.5
Delegate to be called as callback function when a new image has been received.
Parameters:
camera Camera object
connectionStatus New connection status value reported by the Transport Layer
5.10.2.6
Delegate to be called as callback function when a new GigE Vision Event has been received.
Parameters:
camera Camera object
EventID GigE Vision EVENT ID received from the camera
StreamChannelIndex Stream Channel index if the GigE Vision EVENT is related to the stream channel. (0xFFFF for no channel)
BlockID Data block ID (0 for no block).
Timestamp Event timestamp (0 if not supported). The unit is device specific ticks
EventData Event specific data associated with the event
5.10.2.7
Delegate to be called as callback function when a new Node Event has been received.
Parameters:
node GenICam Node object
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.11
185
It is possible to save camera settings to disk and later on load them into the camera. It is possible to control
the way the load and save functions works.
Enumerations
enum ESaveSettingsFlag { Auto, StreamableOnly, ForceAll }
Defines the Save Settings flags used in J_Camera_SaveSettings().
Functions
static Jai_FactoryWrapper.EFactoryError J_Camera_SaveSettings (CAMERA_HANDLE CameraHandle, String SettingsFileName, ESaveSettingsFlag SaveFlag)
Save camera settings to disk. The format of the settings file is XML so it is possible to edit it using a normal
text editor.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetSettingsValidationErrorInfo (CAMERA_HANDLE CameraHandle, StringBuilder ErrorInfoBuffer, ref UInt32 Size)
Get Camera Settings Validation error information.
5.11.1
Detailed Description
It is possible to save camera settings to disk and later on load them into the camera. It is possible to control
the way the load and save functions works.
5.11.2
5.11.2.1
186
Module Documentation
5.11.2.2
5.11.3
Function Documentation
5.11.3.1
Save camera settings to disk. The format of the settings file is XML so it is possible to edit it using a normal
text editor.
Parameters:
CameraHandle Handle to a valid camera object, obtained by J_Camera_Open() function.
SettingsFileName String containing the file name for the settings file.
SaveFlag Enumeration value that selects the behaviour of the Save function.
ESaveSettingsFlag for more information.
See
Returns:
Jai_FactoryWrapper.EFactoryError
5.11.3.2
Load camera settings from disk and either validate or send the the settings to the connected camera.
Parameters:
CameraHandle Handle to a valid camera object, obtained by J_Camera_Open() function.
SettingsFileName String containing the file name for the settings file.
LoadFlag Enumeration value that selects the behaviour of the Load function.
ELoadSettingsFlag for more information.
See
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
187
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
188
Module Documentation
5.12
The Data Stream specific functions are used for controlling the Image Acquisition manually from the user
application.
Classes
struct BufferInfoStruct
This structure is used for reading buffer information with J_DataStream_GetBufferInfo().
struct StreamInfoStruct
This structure is used for reading buffer information with J_DataStream_GetStreamInfo() or J_Image_GetStreamInfo().
struct StreamParameterStruct
This structure is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam().
Enumerations
enum EAcqQueueType { INPUT_TO_OUTPUT = 0, OUTPUT_DISCARD = 1 }
The EAcqQueueType is used to select queue type to be flushed using J_DataStream_FlushQueue().
enum EBufferInfoCmd {
BASE, SIZE, USER_PTR, TIMESTAMP,
NUMBER, NEW_DATA, ISQUEUED, PAYLOADTYPE,
PIXELTYPE, WIDTH, HEIGHT, XOFFSET,
YOFFSET, XPADDING, YPADDING, NUM_PACKETS_MISSING,
BLOCK_ID }
The EBufferInfoCmd is used to get buffer information using J_DataStream_GetBufferInfo().
enum EStreamInfoCmd {
NONE = 0, ISGRABBING = 1, NUMBER_OF_FRAMES_DELIVERED = 2, NUMBER_OF_FRAMES_LOST_QUEUE_UNDERRUN = 3,
NUMBER_OF_FRAMES_ANNOUNCED = 4, NUMBER_OF_FRAMES_QUEUED = 5,
NUMBER_OF_FRAMES_AWAIT_DELIVERY = 6, NUMBER_OF_FRAMES_CORRUPT_ON_DELIEVRY = 7,
CUSTOM_INFO = 1000 }
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
189
enum EDataStreamParamCmd {
CanResend = 1, NumberOfBytesPerFrame = 2, PassCorruptFrames = 3, MaxFramesInNotCompletedList = 4,
RxTimeoutsBeforeListFlush = 5, OutOfOrderPacketsBeforeResend = 6, RxTimeout = 7 }
The EDataStreamParamCmd is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam().
Functions
static Jai_FactoryWrapper.EFactoryError J_DataStream_AnnounceBuffer (DATASTREAM_HANDLE DSHandle, IntPtr Buffer, UInt32 BufferSize, IntPtr PrivateData, out BUFFER_HANDLE
BufferHandle)
Announce buffer pointer for the acquisition engine.
(DATASTREAM_-
(DATASTREAM_-
static Jai_FactoryWrapper.EFactoryError J_DataStream_GetStreamInfo (DATASTREAM_HANDLE DSHandle, EStreamInfoCmd Cmd, ref StreamInfoStruct Info, ref UInt32 Size)
Get detailed information about a data stream.
static Jai_FactoryWrapper.EFactoryError
DSHandle)
J_DataStream_Close
(DATASTREAM_HANDLE
static Jai_FactoryWrapper.EFactoryError J_DataStream_RevokeBuffer (DATASTREAM_HANDLE DSHandle, BUFFER_HANDLE BufferHandle, ref IntPtr BufferPtr, ref IntPtr PrivateDataPtr)
Remove the frame buffer from the Acquisition engine.
190
Module Documentation
static Jai_FactoryWrapper.EFactoryError J_DataStream_GetBufferInfo (DATASTREAM_HANDLE DSHandle, BUFFER_HANDLE BufferHandle, EBufferInfoCmd Cmd, ref BufferInfoStruct BufferInfo, ref UInt32 Size)
Get detailed information about a buffer.
5.12.1
Detailed Description
The Data Stream specific functions are used for controlling the Image Acquisition manually from the user
application.
The JAI SDK has got two major ways of handling the Image Acqusition:
1) Automatic Image Acquisition handling via the J_Image_OpenStream(), J_Image_OpenStreamLight(), J_Image_CloseStream() and J_Image_GetStreamInfo()
functions. The JAI SDK will automatically take care of image buffer allocation as well as creating
an Image acquisition thread and all the images will be accessible via callback routines.
2) Manual Image Acquisition handling via the J_DataStream_...() function described in this section. This requires that the user application take care of all necessary memory allocation as well as
creating an image acquisition thread the wait for "new image" events from the underlying drivers. The
biggest advantage is that this will give the application full control but this also increases the complexity
of the application.
The basic flow for using the Data Stream specific functions is:
1) Allocate memory for image buffers (using standard Malloc or similar)
2) Hand over the allocated buffers to the acquisition engine inside the driver using the J_DataStream_AnnounceBuffer()
3) Make the announced buffers available for image acquisition using the J_DataStream_QueueBuffer()
4) Create an acquisition thread that will handle all image events from the drivers. The acquisition
thread will initially create a condition object using J_Event_CreateCondition() and register
this new condition by the driver using J_DataStream_RegisterEvent(). After that it start
the acquisition engine inside the driver and create the stream thread connection to the camera using
J_DataStream_StartAcquisition(). Afterward it will wait for signals on the condition using J_Event_WaitForCondition(). For each new event the thread calls J_DataStream_GetBufferInfo() and when it is done with the event then it returns the buffer back to the acquisition queue using J_DataStream_QueueBuffer()
5) When the image acquisition thread is stopped then the application have to clean up everything. The image acquisition thread inside the driver is stopped using the J_DataStream_StopAcquisition(). 6) The image buffers are returned from the driver by initially calling J_Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
191
Please refer to the Stream Thread Sample application for more details!
5.12.2
5.12.2.1
5.12.2.2
The EAcqStartFlags are used to control the start of image acquisition using J_DataStream_StartAcquisition().
Enumerator:
NONE No flags.
NEXT_IMAGE Deliver the image acquired after the image delivered last.
Missed images only happen if the acquisiton queue is empty and therefore no buffers available
LAST_IMAGE Deliver the last complete image acquired.
This means that between the image deliverd last and the image delivered next can be a number
of missed images Missed images happen if one processing cycle takes to long The positive effect
is that the acquired image is not out of the loop but max one image behind
NEW_IMAGE Deliver the new image acquired while the wait for buffer function is called.
The positive effect is that the acquired image is not out of the loop
5.12.2.3
The EAcqStopFlags are used to control the stop of image acquisition using J_DataStream_StopAcquisition().
Enumerator:
NONE No stop flags.
KILL Kill ongoing acquisition instead of waiting for the next image.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
192
Module Documentation
5.12.2.4
5.12.2.5
using
J_DataStream_-
Enumerator:
NONE
ISGRABBING Inquire if the acquisition engine is running or not.
NUMBER_OF_FRAMES_DELIVERED This command inquire the number of acquired frames
since the last acquisition start.
NUMBER_OF_FRAMES_LOST_QUEUE_UNDERRUN This command inquire the number of
lost frames due to a queue under-run. If the application is not emptying the acquisition queue as
fast as the queue gets filled then the newly acquired frames will be dropped and this value will
be increased by 1.
NUMBER_OF_FRAMES_ANNOUNCED This command inquire the number of frame buffers that
have been announced to the acquisition engine using J_DataStream_AnnounceBuffer().
This will be the maximum number of frame buffers in the system at any point in time.
NUMBER_OF_FRAMES_QUEUED This command inquire the number of frame buffers available
and ready for image acquisition. When a new frame is acquired then it will be moved from this
queue into the delivery queue and this value will be decreased by 1. The application can return
the frame buffer to this queue using J_DataStream_QueueBuffer() after handling the
new image delivery.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
193
5.12.2.6
The EDataStreamParamCmd is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam().
Enumerator:
CanResend Get / Set Flag indicating if the source can handle resends. !=0: Enable resends(default),
=0: Disable resends.
NumberOfBytesPerFrame Get / Set Total Number of bytes per frame.
PassCorruptFrames Get / Set Flag indicating if corrupt frames are passed to the layer above. !=0:
Enable, =0: Disable.
MaxFramesInNotCompletedList Get / Set Max number of frames in not complete list.
RxTimeoutsBeforeListFlush Get / Set Number of recieve timeouts before incomplete list is flushed
/ delivered.
OutOfOrderPacketsBeforeResend Get / Set Out of order Packets before resend is issued.
RxTimeout Get / Set Timeout in ms for receive.
5.12.3
Function Documentation
5.12.3.1
// Bu
// Ha
//==============================================================////
// Prepare frame buffers for the data stream
//==============================================================////
uint32_t CStreamThread::PrepareBuffers(int bufferCount, int BufferSiz
e, IntPtr PrivateData)
{
J_STATUS_TYPE
iResult = J_ST_SUCCESS;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
194
Module Documentation
int
i;
m_iValidBuffers = 0;
for(i = 0 ; i < bufferCount ; i++)
{
// Make the buffer for one frame.
byte[] buffer = new byte[BufferSize];
GCHandle gch = GCHandle.Alloc(buffer, GCHandleType.Pinned);
IntPtr bufferPtr = gch.AddrOfPinnedObject();
IntPtr BufferHandle = IntPtr.Zero;
// Announce the buffer pointer to the Acquisition engine.
if (EFactoryError.Success != J_DataStream_AnnounceBuffer(StreamHa
ndle, bufferPtr, BufferSize, PrivateData, out BufferHandle))
{
gch.Free();
break;
}
// Queueing it.
if(EFactoryError.Success != J_DataStream_QueueBuffer(StreamHandle
, BufferHandle))
{
gch.Free();
break;
}
AquBufferList.Add(gch);
AquBufferIDList.Add(BufferHandle);
m_iValidBuffers++;
}
return m_iValidBuffers;
}
Parameters:
DSHandle Handle to a valid data stream, obtained by J_Camera_CreateDataStream() function.
Buffer Allocated memory buffer to hold image data
BufferSize Size of the allocated memory buffer
PrivateData Private user data to be attached to the image buffer
BufferHandle Variable in which the buffer handle is stored
Returns:
Jai_FactoryWrapper.EFactoryError
5.12.3.2
Flush Queues.
The data stream needs to be created using J_Camera_CreateDataStream() before queues can be
flushed.
See also:
J_Camera_CreateDataStream()
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
195
// Bu
// Ha
//==============================================================////
// Unprepare buffers
//==============================================================////
bool UnPrepareBuffers()
{
IntPtr pBuffer = IntPtr.Zero;
IntPtr pPrivate = IntPtr.Zero;
// Flush Queues
J_DataStream_FlushQueue(StreamHandle, EAcqQueueType.INPUT_TO_OUTPUT
);
J_DataStream_FlushQueue(StreamHandle, EAcqQueueType.OUTPUT_DISCARD)
;
for(int i = 0 ; i < m_iValidBuffers ; i++)
{
// Remove the frame buffer from the Acquisition engine.
J_DataStream_RevokeBuffer(StreamHandle, AquBufferIDList[i], ref p
Buffer, ref pPrivate);
AquBufferList[i].Free();
}
AquBufferList.Clear();
AquBufferIDList.Clear();
m_iValidBuffers = 0;
}
Parameters:
DSHandle Handle to a valid data stream, obtained by J_Camera_CreateDataStream() function.
QueueType Queue type to Flush
Returns:
Jai_FactoryWrapper.EFactoryError
5.12.3.3
196
Module Documentation
Flags Aquisition start control flag. This parameter is currently not used in the drivers!!
NumImages Number of images to acquire. The value UInt64.MaxValue indicates unlimited. This
parameter is currently not used in the drivers!!
Returns:
Jai_FactoryWrapper.EFactoryError
5.12.3.4
See also:
J_Camera_CreateDataStream(CAMERA_HANDLE, UInt32, out DATASTREAM_HANDLE)
Parameters:
DSHandle Handle to a valid data stream, obtained by J_Camera_CreateDataStream() function.
Flags Aquisition stop control flag. This parameter is currently not used in the Filter Driver. In the
Socket Driver it is necessary to use EAcqStopFlags.KILL!!
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
197
Returns:
Jai_FactoryWrapper.EFactoryError
5.12.3.5
5.12.3.6
5.12.3.7
198
Module Documentation
Parameters:
DSHandle Handle to a valid data stream, obtained by J_Camera_CreateDataStream() function.
Returns:
Jai_FactoryWrapper.EFactoryError
5.12.3.8
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
199
delete m_pAquBuffer[i];
m_pAquBuffer[i] = NULL;
m_pAquBufferID[i] = 0;
}
m_iValidBuffers = 0;
return TRUE;
}
Parameters:
DSHandle Handle to a valid data stream, obtained by J_Camera_CreateDataStream() function.
BufferHandle Handle to the buffer to be revoked
BufferPtr Pointer to the buffer to remove from the acquisition engine
PrivateDataPtr Pointer to the private data to remove from the acquisition engine
Returns:
Jai_FactoryWrapper.EFactoryError
5.12.3.9
200
Module Documentation
{
gch.Free();
break;
}
AquBufferList.Add(gch);
AquBufferIDList.Add(BufferHandle);
m_iValidBuffers++;
}
return m_iValidBuffers;
}
Parameters:
DSHandle Handle to a valid data stream, obtained by J_Camera_CreateDataStream() function.
BufferHandle Handle of the
AnnounceBuffer().
buffer
to
be
queued,
obtained
by
J_DataStream_-
Returns:
Jai_FactoryWrapper.EFactoryError
5.12.3.10
201
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
202
Module Documentation
ref iSize);
ImageInfo.TimeStamp = BufferInfo.TimeStamp;
// Get Missing Packets.
iSize = (uint)Marshal.SizeOf(BufferInfo.MissingPackets);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.NUM_PA
CKETS_MISSING,
ref BufferInfo,
ref iSize);
ImageInfo.MissingPackets = BufferInfo.MissingPackets;
// Get the effective data size.
iSize = (uint)Marshal.SizeOf(BufferInfo.Size);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.SIZE,
ref BufferInfo,
ref iSize);
ImageInfo.ImageSize = BufferInfo.Size;
// Get Pixel Format Type.
iSize = (uint)4; // Enum of type UInt32
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.PIXELT
YPE,
ref BufferInfo,
ref iSize);
ImageInfo.PixelFormat = BufferInfo.PixelFormat;
// Get Frame Width.
iSize = (uint)Marshal.SizeOf(BufferInfo.Width);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.WIDTH,
ref BufferInfo,
ref iSize);
ImageInfo.SizeX = BufferInfo.Width;
// Get Frame Height.
iSize = (uint)Marshal.SizeOf(BufferInfo.Height);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.HEIGHT
,
ref BufferInfo,
ref iSize);
ImageInfo.SizeY = BufferInfo.Height;
ImageInfo.AnnouncedBuffers = (uint)camera.m_iValidBuffers
;
ImageInfo.QueuedBuffers = (uint)camera.NumFramesQueued;
// Get X-offset.
iSize = (uint)Marshal.SizeOf(BufferInfo.XOffset);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
203
EBufferInfoCmd.XOFFSE
T,
ref BufferInfo,
ref iSize);
ImageInfo.OffsetX = BufferInfo.XOffset;
// Get Y-offset
iSize = (uint)Marshal.SizeOf(BufferInfo.YOffset);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.YOFFSE
T,
ref BufferInfo,
ref iSize);
ImageInfo.OffsetY = BufferInfo.YOffset;
if (EnableThread)
{
if ((AcquisitionCount == 0) || (iFrameCounter <= Acquis
itionCount))
{
if (camera != null)
camera.HandleImage(ref ImageInfo);
}
}
// Queue This Buffer Again for reuse in acquisition engin
e
retsta = J_DataStream_QueueBuffer(DataStreamHandle,
EventData.NEW_BUFFER_Bu
fferHandle);
if (camera.NumFramesAwaitingDelivery > 0)
J_Event_SignalCondition(NewImageCondition);
}
}
else
{
switch (WaitResult)
{
// Kill event
case ECondWaitResult.WaitExit:
break;
// Timeout
case ECondWaitResult.WaitTimeout:
break;
case ECondWaitResult.WaitError:
break;
// Unknown?
default:
break;
}
}
}
}
}
retsta = J_DataStream_FlushQueue(DataStreamHandle, EAcqQueueType.
OUTPUT_DISCARD);
// Unregister new buffer event with acquisition engine
retsta = J_DataStream_UnRegisterEvent(DataStreamHandle,
EDeviceEventType.NEW_BUFFER);
// Free the event object
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
204
Module Documentation
if (hDeviceEvent != null)
{
retsta = J_Event_Close(hDeviceEvent);
hDeviceEvent = IntPtr.Zero;
}
// Signal that we terminatet the thread.
camera.StreamEvent.Set();
}
}
Parameters:
DSHandle Handle to a valid data stream object, obtained by J_Camera_CreateDataStream()
function.
BufferHandle Handle of the buffer to be queued, obtained by J_DataStream_AnnounceBuffer().
Cmd The information type that is requested
BufferInfo Reference to a BufferInfo structure in which the information is stored.
Size The size of the buffer. The function sets the actual size of data stored into the buffer.
Returns:
Jai_FactoryWrapper.EFactoryError
5.12.3.11
See also:
J_Camera_CreateDataStream(CAMERA_HANDLE, UInt32, out DATASTREAM_HANDLE)
Parameters:
DSHandle Handle to a valid data stream object, obtained by J_Camera_CreateDataStream()
function.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
205
5.12.3.12
See also:
J_Camera_CreateDataStream(CAMERA_HANDLE, UInt32, out DATASTREAM_HANDLE)
Parameters:
DSHandle Handle to a valid data stream object, obtained by J_Camera_CreateDataStream()
function.
Cmd The parameter type which is requested
StreamParameter Reference to a buffer in which the information is stored.
Size The size of the buffer. The function sets the actual size of data stored into the buffer.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
206
Module Documentation
5.13
The communication from the Transport Layer and to the user application is normally handled via events.
This could for instance be events from the acquisition engine in the driver whenever a new image has been
acquired. It could also be camera specific event when for instance the connection state for the camera
changes or when the camera sends a GigE Vision Event telegram.
Events are generally associated with condition objects that will be used for the actual signaling of the
event between the Transport Layer and the event handling threads. The conditions are operating system
independent objects used for the wait and signal operations needed for the event handling. This will make
it possible to keep the same basic event thread implementation both in Windows applications as well in
Linux applications. This is a unified way of create wait and signaling code.
Classes
struct EventInfoData
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
struct DeviceEventData
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
Modules
Camera event specific functions
The camera specific events are primarily used for supervising the connection state for the cameras and
for handling GigE Vision Event telegrams sent from the cameras using the GigE Vision Message Channel
communication.
Enumerations
enum EEventInfoID { NUM_ENTRYS_IN_QUEUE }
The EEventInfoID is used to obtain information about the number of entries in the queue using J_Event_GetInfo().
enum EDeviceEventType {
NEW_BUFFER, GEV_EVENT_CMD, GEV_EVENTDATA_CMD, ERROR,
CONNECTION, MAX_ID }
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
207
The EDeviceEventType is used to specify which type of event to register with the Transport Layer.
enum ECondWaitResult {
WaitTimeout, WaitSignal, WaitExit, WaitSignal1,
WaitExit1, WaitSignal2, WaitExit2, WaitSignal3,
WaitExit3, WaitSignal4, WaitExit5, WaitSignal6,
WaitExit6, WaitSignal7, WaitExit7, WaitSignal8,
WaitExit8, WaitSignal9, WaitExit9, WaitError }
The ECondWaitResult is wait result type returned in J_Event_WaitForCondition().
Functions
static Jai_FactoryWrapper.EFactoryError J_Event_GetData (EVT_HANDLE EventHandle, out DeviceEventData EventData, ref UInt32 Size)
Retrieve the event data associated with the event.
EventHandle,
5.13.1
Detailed Description
The communication from the Transport Layer and to the user application is normally handled via events.
This could for instance be events from the acquisition engine in the driver whenever a new image has been
acquired. It could also be camera specific event when for instance the connection state for the camera
changes or when the camera sends a GigE Vision Event telegram.
Events are generally associated with condition objects that will be used for the actual signaling of the
event between the Transport Layer and the event handling threads. The conditions are operating system
independent objects used for the wait and signal operations needed for the event handling. This will make
it possible to keep the same basic event thread implementation both in Windows applications as well in
Linux applications. This is a unified way of create wait and signaling code.
5.13.2
5.13.2.1
The EEventInfoID is used to obtain information about the number of entries in the queue using J_Event_GetInfo().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
208
Module Documentation
Enumerator:
NUM_ENTRYS_IN_QUEUE Number of entries in queue.
5.13.2.2
The EDeviceEventType is used to specify which type of event to register with the Transport Layer.
Enumerator:
NEW_BUFFER New buffer ready. NEW_BUFFER_BufferHandle will hold Buffer Handle.
GEV_EVENT_CMD Event command received.
GEV_EVENTDATA_CMD Event data command received.
ERROR Error.
CONNECTION Camera Connection status.
MAX_ID
5.13.2.3
5.13.2.4
209
5.13.3
Function Documentation
5.13.3.1
210
Module Documentation
EventData Reference to a DeviceEventData structure in which the information is stored.
Size The size of the structure. The function sets the actual size of data stored into the buffer.
Returns:
Jai_FactoryWrapper.EFactoryError.
EFactoryError.NoData will be returned.
5.13.3.2
5.13.3.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
211
Close Event.
See also:
J_Camera_RegisterEvent(CAMERA_HANDLE, EDeviceEventType, SafeWaitHandle, out EVT_HANDLE)
Parameters:
EventHandle Internal event handle obtained by the J_Camera_RegisterEvent() or J_DataStream_RegisterEvent() functions.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
212
Module Documentation
5.14
The camera specific events are primarily used for supervising the connection state for the cameras and
for handling GigE Vision Event telegrams sent from the cameras using the GigE Vision Message Channel
communication.
Functions
static Jai_FactoryWrapper.EFactoryError J_Camera_RegisterEvent (CAMERA_HANDLE CameraHandle, EDeviceEventType EventType, SafeWaitHandle WaitHandle, out EVT_HANDLE EventHandle)
Register an event for a device with the Transport Layer interface using Windows events.
static Jai_FactoryWrapper.EFactoryError J_Camera_RegisterEvent (CAMERA_HANDLE CameraHandle, EDeviceEventType EventType, COND_HANDLE ConditionHandle, out EVT_HANDLE
EventHandle)
Register an event for a device with the Transport Layer interface using JAI SDK Conditions instead of
events.
5.14.1
Detailed Description
The camera specific events are primarily used for supervising the connection state for the cameras and
for handling GigE Vision Event telegrams sent from the cameras using the GigE Vision Message Channel
communication.
5.14.2
Function Documentation
5.14.2.1
Register an event for a device with the Transport Layer interface using Windows events.
// This small piece of code demonstrate the basics used in getting co
nnection status for a camera. It is not
// intended to be used directly since it has no error handling built
in but merely to show the API functions needed.
class Work
{
public AutoResetEvent KillEvent = new AutoResetEvent(false);
Event used to stop Thread faster
public Boolean EnableThread = true;
Flag used to control thread run
public CCamera camera = null;
//
//
Parameters:
CameraHandle Handle to a valid camera object, obtained by J_Camera_Open() function.
EventType Event type to register
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
213
214
Module Documentation
WaitHandle Native OS handle to be used for signalling the event. This can be created as using
AutoResetEvent.SafeWaitHandle
EventHandle Variable in which the internal event handle is stored. This handle is used in J_Event_GetData() and J_Event_GetInfo()
Returns:
Jai_FactoryWrapper.EFactoryError
5.14.2.2
Register an event for a device with the Transport Layer interface using JAI SDK Conditions instead of
events.
// This small piece of code demonstrate the basics used in getting co
nnection status for a camera. It is not
// intended to be used directly since it has no error handling built
in but merely to show the API functions needed.
class ConnectionStatusWork
{
public IntPtr ConnectionCondition = IntPtr.Zero;
public IntPtr CameraHandle = IntPtr.Zero;
public Boolean EnableThread = true;
public CCamera camera = null;
public void ConnectionStatusThread()
{
UInt32 iSize;
EFactoryError retsta;
ECondWaitResult WaitResult = ECondWaitResult.WaitError;
DeviceEventData EventData = new DeviceEventData();
if (ConnectionCondition == IntPtr.Zero)
retsta = J_Event_CreateCondition(ref ConnectionCondition);
IntPtr hDeviceEvent; // Buffer event handle
// Register the event with the Transport Layer
retsta = J_Camera_RegisterEvent(camera.CameraHandle,
EDeviceEventType.CONNECTION,
ConnectionCondition,
out hDeviceEvent);
while (EnableThread)
{
// Wait for connection event
retsta = J_Event_WaitForCondition(ConnectionCondition, 1000, re
f WaitResult);
if (retsta == EFactoryError.Success)
{
// Did we get a new buffer event?
if (WaitResult == ECondWaitResult.WaitSignal)
{
// Get the Buffer Handle from the event
iSize = (uint)Marshal.SizeOf(typeof(DeviceEventData));
retsta = J_Event_GetData(hDeviceEvent, out EventData, ref i
Size);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
215
if (retsta == EFactoryError.Success)
{
if (EnableThread)
{
if (camera != null)
camera.HandleConnectionStatus(camera, EventData.CONNE
CTION_Status);
}
}
}
else
{
switch (WaitResult)
{
// Kill event
case ECondWaitResult.WaitExit:
break;
// Timeout
case ECondWaitResult.WaitTimeout:
break;
case ECondWaitResult.WaitError:
break;
// Unknown?
default:
break;
}
}
}
}
// Unregister connection event with Transport Layer
retsta = J_Camera_UnRegisterEvent(camera.CameraHandle,
EDeviceEventType.CONNECTION);
// Free the event object
if (hDeviceEvent != null)
{
J_Event_Close(hDeviceEvent);
hDeviceEvent = IntPtr.Zero;
}
// Close the condition again
if (ConnectionCondition != IntPtr.Zero)
retsta = J_Event_CloseCondition(ConnectionCondition);
// Signal that we terminatet the thread.
camera.ConnectionEvent.Set();
}
}
Parameters:
CameraHandle Handle to a valid camera object, obtained by J_Camera_Open() function.
EventType Event type to register
ConditionHandle Condition handle to be used for signalling the event. This can be created as using
J_Event_CreateCondition()
EventHandle Variable in which the internal event handle is stored. This handle is used in J_Event_GetData() and J_Event_GetInfo()
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
216
Module Documentation
5.14.2.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.15
217
These functions are specific to the Data Stream event handling. If the automatic image acquisition functionality of the JAI SDK is used then these functions should not be used! The automatic image acquisition
functionality is enabled using the J_Image_OpenStream() or J_Image_OpenStreamLight().
Functions
static Jai_FactoryWrapper.EFactoryError J_DataStream_RegisterEvent (DATASTREAM_HANDLE DSHandle, EDeviceEventType EventType, SafeWaitHandle WaitHandle, out EVT_HANDLE EventHandle)
Register an event with the Transport Layer interface.
(DATASTREAM_-
5.15.1
Detailed Description
These functions are specific to the Data Stream event handling. If the automatic image acquisition functionality of the JAI SDK is used then these functions should not be used! The automatic image acquisition
functionality is enabled using the J_Image_OpenStream() or J_Image_OpenStreamLight().
5.15.2
Function Documentation
5.15.2.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
218
Module Documentation
// Data stream thread
public void StreamThread()
{
UInt32 iSize;
bool FirstTime = true;
EFactoryError retsta;
// Create structure to be used for image display
ImageInfo ImageInfo = new ImageInfo();
BufferInfoStruct BufferInfo = new BufferInfoStruct();
int iWaitResult;
DeviceEventData EventData = new DeviceEventData();
// Create event to be used by acquisition engine to signal that a
new image has been acquired
AutoResetEvent NewImageEvent = new AutoResetEvent(false);
// Make a WaitHandle list
WaitHandle[] waitHandles = { NewImageEvent, KillEvent };
IntPtr hDeviceEvent; // Buffer event handle
// Register the event with the acquisition engine
retsta = J_DataStream_RegisterEvent(DataStreamHandle,
EDeviceEventType.NEW_BUFFER,
NewImageEvent.SafeWaitHandle,
out hDeviceEvent);
// Start image acquisition
retsta = J_DataStream_StartAcquisition(DataStreamHandle,
EAcqStartFlags.NEXT_IMAGE, 0);
while (EnableThread)
{
// Wait for Buffer event (or kill event)
iWaitResult = WaitHandle.WaitAny(waitHandles, 1000, false);
// Did we get a new buffer event?
if (iWaitResult == 0)
{
// Get the Buffer Handle from the event
iSize = (uint)Marshal.SizeOf(typeof(DeviceEventData));
retsta = J_Event_GetData(hDeviceEvent, out EventData, ref iSi
ze);
if (retsta == EFactoryError.Success)
{
// Fill in structure for image display
// Get the pointer to the frame buffer.
iSize = (uint)Marshal.SizeOf(typeof(BufferInfoStruct));
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_Bu
fferHandle,
EBufferInfoCmd.BASE,
ref BufferInfo,
ref iSize);
ImageInfo.ImageBuffer = BufferInfo.Base;
// Get Timestamp.
iSize = (uint)Marshal.SizeOf(typeof(BufferInfoStruct));
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_Bu
fferHandle,
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
219
EBufferInfoCmd.TIMESTAM
P,
ref BufferInfo,
ref iSize);
ImageInfo.TimeStamp = BufferInfo.TimeStamp;
// Get the effective data size.
iSize = (uint)Marshal.SizeOf(typeof(BufferInfoStruct));
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_Bu
fferHandle,
EBufferInfoCmd.SIZE,
ref BufferInfo,
ref iSize);
ImageInfo.ImageSize = BufferInfo.Size;
// Get Pixel Format Type.
iSize = (uint)Marshal.SizeOf(typeof(BufferInfoStruct));
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_Bu
fferHandle,
EBufferInfoCmd.PIXELTYP
E,
ref BufferInfo,
ref iSize);
ImageInfo.PixelFormat = BufferInfo.PixelFormat;
// Get Frame Width.
iSize = (uint)Marshal.SizeOf(typeof(BufferInfoStruct));
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_Bu
fferHandle,
EBufferInfoCmd.WIDTH,
ref BufferInfo,
ref iSize);
ImageInfo.SizeX = BufferInfo.Width;
// Get Frame Height.
iSize = (uint)Marshal.SizeOf(typeof(BufferInfoStruct));
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_Bu
fferHandle,
JEBufferInfoCmd.HEIGHT,
ref BufferInfo,
ref iSize);
ImageInfo.SizeY = BufferInfo.Height;
if (EnableThread)
{
if (camera != null)
camera.HandleImage(ref ImageInfo);
}
// Queue This Buffer Again for reuse in acquisition engine
retsta = J_DataStream_QueueBuffer(DataStreamHandle, EventDa
ta.NEW_BUFFER_BufferHandle);
if (camera.NumFramesAwaitingDelivery > 0)
NewImageEvent.Set();
}
}
}
retsta = J_DataStream_FlushQueue(DataStreamHandle, EAcqQueueType.
OUTPUT_DISCARD);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
220
Module Documentation
// Unregister new buffer event with acquisition engine
retsta = J_DataStream_UnRegisterEvent(DataStreamHandle,
EDeviceEventType.NEW_BUFFER);
// Free the event object
if (hDeviceEvent != null)
{
retsta = J_Event_Close(hDeviceEvent);
hDeviceEvent = IntPtr.Zero;
}
// Signal that we terminatet the thread.
camera.StreamEvent.Set();
}
}
Parameters:
DSHandle Handle to a valid data stream object, obtained by J_Camera_CreateDataStream()
function.
EventType Event type to register
WaitHandle Native OS handle to be used for signalling the event. This can be created as using
AutoResetEvent.SafeWaitHandle
EventHandle Variable in which the internal event handle is stored. This handle is used in J_Event_GetData() and J_Event_GetInfo()
Returns:
Jai_FactoryWrapper.EFactoryError
5.15.2.2
Register an event with the Transport Layer interface. This is an overloaded version that uses Conditions
instead of directly using Windows Events.
// This small piece of code demonstrate the basics used in the image
aquisition thread for a camera. It is not
// intended to be used directly since it has no error handling built
in but merely to show the API functions needed.
class StreamWork
{
public IntPtr NewImageCondition = IntPtr.Zero;
public IntPtr DataStreamHandle = IntPtr.Zero;
public Boolean EnableThread = true;
public CCamera camera = null;
public UInt32 AcquisitionCount = 0;
public UInt32 iFrameCounter = 0;
public bool AcquisitionStarted = false;
public void StreamThread()
{
UInt32 iSize;
EFactoryError retsta;
// Create structure to be used for image display
ImageInfo ImageInfo = new ImageInfo();
BufferInfoStruct BufferInfo = new BufferInfoStruct();
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
221
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
222
Module Documentation
iSize = (uint)Marshal.SizeOf(BufferInfo.TimeStamp);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.TIMEST
AMP,
ref BufferInfo,
ref iSize);
ImageInfo.TimeStamp = BufferInfo.TimeStamp;
// Get Missing Packets.
iSize = (uint)Marshal.SizeOf(BufferInfo.MissingPackets);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.NUM_PA
CKETS_MISSING,
ref BufferInfo,
ref iSize);
ImageInfo.MissingPackets = BufferInfo.MissingPackets;
// Get the effective data size.
iSize = (uint)Marshal.SizeOf(BufferInfo.Size);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.SIZE,
ref BufferInfo,
ref iSize);
ImageInfo.ImageSize = BufferInfo.Size;
// Get Pixel Format Type.
iSize = (uint)4; // Enum of type UInt32
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.PIXELT
YPE,
ref BufferInfo,
ref iSize);
ImageInfo.PixelFormat = BufferInfo.PixelFormat;
// Get Frame Width.
iSize = (uint)Marshal.SizeOf(BufferInfo.Width);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.WIDTH,
ref BufferInfo,
ref iSize);
ImageInfo.SizeX = BufferInfo.Width;
// Get Frame Height.
iSize = (uint)Marshal.SizeOf(BufferInfo.Height);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.HEIGHT
,
ref BufferInfo,
ref iSize);
ImageInfo.SizeY = BufferInfo.Height;
ImageInfo.AnnouncedBuffers = (uint)camera.m_iValidBuffers
;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
223
ImageInfo.QueuedBuffers = (uint)camera.NumFramesQueued;
// Get X-offset.
iSize = (uint)Marshal.SizeOf(BufferInfo.XOffset);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.XOFFSE
T,
ref BufferInfo,
ref iSize);
ImageInfo.OffsetX = BufferInfo.XOffset;
// Get Y-offset
iSize = (uint)Marshal.SizeOf(BufferInfo.YOffset);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.YOFFSE
T,
ref BufferInfo,
ref iSize);
ImageInfo.OffsetY = BufferInfo.YOffset;
if (EnableThread)
{
if ((AcquisitionCount == 0) || (iFrameCounter <= Acquis
itionCount))
{
if (camera != null)
camera.HandleImage(ref ImageInfo);
}
}
// Queue This Buffer Again for reuse in acquisition engin
e
retsta = J_DataStream_QueueBuffer(DataStreamHandle,
EventData.NEW_BUFFER_Bu
fferHandle);
if (camera.NumFramesAwaitingDelivery > 0)
J_Event_SignalCondition(NewImageCondition);
}
}
else
{
switch (WaitResult)
{
// Kill event
case ECondWaitResult.WaitExit:
break;
// Timeout
case ECondWaitResult.WaitTimeout:
break;
case ECondWaitResult.WaitError:
break;
// Unknown?
default:
break;
}
}
}
}
retsta = J_DataStream_FlushQueue(DataStreamHandle, EAcqQueueType.
OUTPUT_DISCARD);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
224
Module Documentation
Parameters:
DSHandle Handle to a valid data stream object, obtained by J_Camera_CreateDataStream()
function.
EventType Event type to register
ConditionHandle Condition handle to be used for signalling the event. This can be created as using
J_Event_CreateCondition()
EventHandle Variable in which the internal event handle is stored. This handle is used in J_Event_GetData() and J_Event_GetInfo()
Returns:
Jai_FactoryWrapper.EFactoryError
5.15.2.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.16
225
The following functions are used for creating and controlling the condition objects. The conditions are
operating system independent objects used for the wait and signal operations needed for the event handling.
This will make it possible to keep the same basic event thread implementation both in Windows applications
as well in Linux applications. This is a unified way of create wait and signaling code.
Functions
static Jai_FactoryWrapper.EFactoryError J_Event_CreateCondition (ref COND_HANDLE ConditionHandle)
Create new Condition object to be used for event handling.
static Jai_FactoryWrapper.EFactoryError J_Event_WaitForCondition (COND_HANDLE ConditionHandle, UInt32 timeout, ref ECondWaitResult WaitResult)
Wait for the Condition object to be signaled.
5.16.1
Detailed Description
The following functions are used for creating and controlling the condition objects. The conditions are
operating system independent objects used for the wait and signal operations needed for the event handling.
This will make it possible to keep the same basic event thread implementation both in Windows applications
as well in Linux applications. This is a unified way of create wait and signaling code.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
226
Module Documentation
5.16.2
Function Documentation
5.16.2.1
227
switch (WaitResult)
{
// Kill event
case ECondWaitResult.WaitExit:
break;
// Timeout
case ECondWaitResult.WaitTimeout:
break;
case ECondWaitResult.WaitError:
break;
// Unknown?
default:
break;
}
}
}
}
// Unregister connection event with Transport Layer
retsta = J_Camera_UnRegisterEvent(camera.CameraHandle,
EDeviceEventType.CONNECTION);
// Free the event object
if (hDeviceEvent != null)
{
retsta = J_Event_Close(hDeviceEvent);
hDeviceEvent = IntPtr.Zero;
}
// Close the condition again
if (ConnectionCondition != IntPtr.Zero)
retsta = J_Event_CloseCondition(ConnectionCondition);
// Signal that we terminatet the thread.
camera.ConnectionEvent.Set();
}
}
<param name="ConditionHandle"Reference to a COND_HANDLE that will be the handle to the Condition that is created
Returns:
Jai_FactoryWrapper.EFactoryError
5.16.2.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
228
Module Documentation
5.16.2.3
Send an EXIT Signal to the Condition object. J_Event_WaitForCondition() will return ECondWaitResult.WaitExit if this is called.
Parameters:
ConditionHandle Internal Condition handle obtained by the J_Event_CreateCondition()
function.
Returns:
Jai_FactoryWrapper.EFactoryError
5.16.2.4
5.16.2.5
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
229
230
Module Documentation
// Close the condition again
if (ConnectionCondition != IntPtr.Zero)
retsta = J_Event_CloseCondition(ConnectionCondition);
// Signal that we terminatet the thread.
camera.ConnectionEvent.Set();
}
}
Parameters:
ConditionHandle Internal Condition handle obtained by the J_Event_CreateCondition()
function.
timeout Timeout for the Wait operation. If timeout is set to 0 then it will wait forever
WaitResult Result for the Wait operation. This can either be ECondWaitResult.WaitTimeout, ECondWaitResult.WaitSignal, ECondWaitResult.WaitExit or ECondWaitResult.WaitError
Returns:
Jai_FactoryWrapper.EFactoryError
5.16.2.6
231
retsta = J_Camera_RegisterEvent(camera.CameraHandle,
EDeviceEventType.GEV_EVENT_CMD,
GevEventCondition,
out hGevEvent);
IntPtr hDeviceEvent; // Camera Connection handle
// Register the event with the Transport Layer
retsta = J_Camera_RegisterEvent(camera.CameraHandle,
EDeviceEventType.CONNECTION,
ConnectionCondition,
out hDeviceEvent);
while (EnableThread)
{
// Wait for connection event
retsta = J_Event_WaitForMultipleConditions(2, ConditionList, 10
00, ref WaitResult);
if (retsta == EFactoryError.Success)
{
// Did we get a GigE Vision event?
if (WaitResult == ECondWaitResult.WaitSignal)
{
// Get the Buffer Handle from the event
iSize = (uint)Marshal.SizeOf(typeof(DeviceEventData));
retsta = J_Event_GetData(hDeviceEvent, out EventData, ref i
Size);
if (retsta == EFactoryError.Success)
{
// Do something with the event
byte[] eventData = new byte[EventData.GEV_EVENT_CMD_Event
DataLength];
Array.Copy(EventData.GEV_EVENT_CMD_EventData, eventData,
EventData.GEV_EVENT_CMD_EventDataLength);
HandleGEVEvent(EventData.GEV_EVENT_CMD_EventID, EventData
.GEV_EVENT_CMD_StreamChannelIndex, EventData.GEV_EVENT_CMD_BlockID, EventData.GEV
_EVENT_CMD_Timestamp, eventData);
...
}
}
else
if (WaitResult == ECondWaitResult.WaitSignal1)
{
// Get the Buffer Handle from the event
iSize = (uint)Marshal.SizeOf(typeof(DeviceEventData));
retsta = J_Event_GetData(hDeviceEvent, out EventData, ref i
Size);
if (retsta == EFactoryError.Success)
{
// Do something with the event
HandleConnectionStatus(camera, EventData.CONNECTION_Statu
s);
...
}
}
else
{
switch (WaitResult)
{
// Kill event
case ECondWaitResult.WaitExit:
case ECondWaitResult.WaitExit1:
break;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
232
Module Documentation
// Timeout
case ECondWaitResult.WaitTimeout:
break;
case ECondWaitResult.WaitError:
break;
// Unknown?
default:
break;
}
}
}
}
// Unregister GigE Vision event with Transport Layer
retsta = J_Camera_UnRegisterEvent(camera.CameraHandle,
EDeviceEventType.GEV_EVENT_CMD);
// Free the event object
if (hGevEvent != null)
{
retsta = J_Event_Close(hGevEvent);
hGevEvent = IntPtr.Zero;
}
// Close the condition again
if (GevEventCondition != IntPtr.Zero)
retsta = J_Event_CloseCondition(GevEventCondition);
// Unregister connection event with Transport Layer
retsta = J_Camera_UnRegisterEvent(camera.CameraHandle,
EDeviceEventType.CONNECTION);
// Free the event object
if (hDeviceEvent != null)
{
retsta = J_Event_Close(hDeviceEvent);
hDeviceEvent = IntPtr.Zero;
}
// Close the condition again
if (ConnectionCondition != IntPtr.Zero)
retsta = J_Event_CloseCondition(ConnectionCondition);
}
}
Parameters:
nCount Number of condition handles to handle. This have to be between 1 and 10
ConditionHandles Internal Condition handle obtained by the J_Event_CreateCondition()
function.
timeout Timeout for the Wait operation. If timeout is set to 0 then it will wait forever
WaitResult Result for the Wait operation. This can either be ECondWaitResult.WaitTimeout, ECondWaitResult.WaitSignal, ECondWaitResult.WaitExit or ECondWaitResult.WaitError
Returns:
Jai_FactoryWrapper.EFactoryError
5.16.2.7
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
233
234
Module Documentation
case ECondWaitResult.WaitError:
break;
// Unknown?
default:
break;
}
}
}
}
// Unregister connection event with Transport Layer
retsta = J_Camera_UnRegisterEvent(camera.CameraHandle,
EDeviceEventType.CONNECTION);
// Free the event object
if (hDeviceEvent != null)
{
retsta = J_Event_Close(hDeviceEvent);
hDeviceEvent = IntPtr.Zero;
}
// Close the condition again
if (ConnectionCondition != IntPtr.Zero)
retsta = J_Event_CloseCondition(ConnectionCondition);
// Signal that we terminatet the thread.
camera.ConnectionEvent.Set();
}
}
Parameters:
ConditionHandle Internal Condition handle obtained by the J_Event_CreateCondition()
function.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.17
235
The JAI SDK is able to control camera settings using the GenICam standard. When a camera connection
is opened then the camera will provide the JAI SDK with a XML-file that contains a complete list of all
the controllable features inside the camera. Each of these features are accessibles as nodes in a tree-like
structure where the top-most level is named "Root". The following code shows how to traverse the node
tree with all the controllable features.
Modules
IInteger GenICam node specific functions
The Integer nodes have got the following special 64-bit integer attributes: Minimum, Maximum and an
Increment. To read and write the node values you need to use the J_Node_GetValueInt64() and
J_Node_SetValueInt64() functions.
Functions
static Jai_FactoryWrapper.EFactoryError J_Node_GetAccessMode (NODE_HANDLE NodeHandle, ref EConfAccessMode AccessMode)
Get the access mode for a GenICam node.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
236
Module Documentation
static Jai_FactoryWrapper.EFactoryError J_Node_GetName (NODE_HANDLE NodeHandle,
StringBuilder Buffer, ref UInt32 Size, UInt32 FullQualified)
Get the GenICam name for a node.
static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayName (NODE_HANDLE NodeHandle, StringBuilder DisplayName, ref UInt32 Size)
Get the display name for a node.
237
static Jai_FactoryWrapper.EFactoryError J_Node_GetPropertyByName (NODE_HANDLE NodeHandle, String PropertyName, StringBuilder ValueStr, ref UInt32 SizeValueStr, StringBuilder AttributeStr, ref UInt32 SizeAttributeStr)
Get the property value and attribute string by property name.
238
Module Documentation
Get the selecting feature node by index.
static Jai_FactoryWrapper.EFactoryError J_Node_GetUnit (NODE_HANDLE NodeHandle, StringBuilder Unit, ref UInt32 Size)
Get the Unit string specified for the node.
5.17.1
Detailed Description
The JAI SDK is able to control camera settings using the GenICam standard. When a camera connection
is opened then the camera will provide the JAI SDK with a XML-file that contains a complete list of all
the controllable features inside the camera. Each of these features are accessibles as nodes in a tree-like
structure where the top-most level is named "Root". The following code shows how to traverse the node
tree with all the controllable features.
5.17.2
Function Documentation
5.17.2.1
5.17.2.2
239
5.17.2.3
5.17.2.4
5.17.2.5
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
240
Module Documentation
5.17.2.6
Get if the GenICam node is cachable. If the node is not cachable it will need to be read periodically. The
recommended polling time can be read using J_Node_GetPollingTime().
Parameters:
NodeHandle A valid handle to a GenICam node
IsCachable Is the node cachable
Returns:
Jai_FactoryWrapper.EFactoryError
5.17.2.7
5.17.2.8
Get the recommended polling time for the GenICam node. This is only necessary if the node is not
cachable.
Parameters:
NodeHandle A valid handle to a GenICam node
PollingTime Recommended polling time (in milliseconds) of the node
Returns:
Jai_FactoryWrapper.EFactoryError
5.17.2.9
241
5.17.2.10
5.17.2.11
5.17.2.12
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
242
Module Documentation
5.17.2.13
5.17.2.14
5.17.2.15
5.17.2.16
243
Parameters:
NodeHandle A valid handle to a GenICam node
PropertyName Name of the property retrieved using J_Node_GetPropertyNameByIndex()
ValueStr StringBuilder to put the value string
SizeValueStr Capacity of the StringBuilder. The length of the value string will be returned
AttributeStr StringBuilder to put the attribute string
SizeAttributeStr Capacity of the StringBuilder. The length of the attribute string will be returned
Returns:
Jai_FactoryWrapper.EFactoryError
5.17.2.17
5.17.2.18
5.17.2.19
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
244
Module Documentation
5.17.2.20
Delegate to be called whenever the value or any of the node properties changes.
Parameters:
NodeHandle A handle to the GenICam node that has changed value or changed property values
Returns:
bool
5.17.2.21
Register a delegate for a specific node. The delegate will be called when the node changes state or value.
Parameters:
NodeHandle A valid handle to a GenICam node
NodeChangeDelegateFunction A delegate of type NodeChangeDelegate
Returns:
5.17.2.22
5.17.2.23
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
245
5.17.2.25
5.17.2.26
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
246
Module Documentation
5.17.2.27
5.17.2.28
5.17.2.29
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
247
5.17.2.31
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
248
Module Documentation
5.18
The Integer nodes have got the following special 64-bit integer attributes: Minimum, Maximum and an
Increment. To read and write the node values you need to use the J_Node_GetValueInt64() and
J_Node_SetValueInt64() functions.
Functions
static Jai_FactoryWrapper.EFactoryError J_Node_GetMinInt64 (NODE_HANDLE NodeHandle,
ref Int64 Min)
Get minimum value allowed for the node.
5.18.1
Detailed Description
The Integer nodes have got the following special 64-bit integer attributes: Minimum, Maximum and an
Increment. To read and write the node values you need to use the J_Node_GetValueInt64() and
J_Node_SetValueInt64() functions.
5.18.2
Function Documentation
5.18.2.1
249
EConfNodeType.IInteger
EConfNodeType.IMaskedIntReg
EConfNodeType.IIntReg
EConfNodeType.IIntSwissKnife
EConfNodeType.IIntKey
EConfNodeType.IIntConverter
Parameters:
NodeHandle A valid handle to a GenICam node
Min Reference to a Int64 variable to receive the minimum value for the node
Returns:
Jai_FactoryWrapper.EFactoryError
5.18.2.2
5.18.2.3
250
Module Documentation
Parameters:
NodeHandle A valid handle to a GenICam node
Inc Reference to a Int64 variable to receive the increment value for the node
Returns:
Jai_FactoryWrapper.EFactoryError
5.18.2.4
5.18.2.5
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
251
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
252
Module Documentation
5.19
The Floating Point nodes have got the following special double precision attributes: Minimum, Maximum
and an Increment. To read and write the node values you need to use the J_Node_GetValueDouble()
and J_Node_SetValueDouble() functions.
Functions
static Jai_FactoryWrapper.EFactoryError J_Node_GetMinDouble (NODE_HANDLE NodeHandle,
ref double Min)
Get minimum value allowed for the node.
static Jai_FactoryWrapper.EFactoryError J_Node_GetValueDouble (NODE_HANDLE NodeHandle, bool Verify, ref double Value)
Get the node value.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.19.1
253
Detailed Description
The Floating Point nodes have got the following special double precision attributes: Minimum, Maximum
and an Increment. To read and write the node values you need to use the J_Node_GetValueDouble()
and J_Node_SetValueDouble() functions.
5.19.2
Function Documentation
5.19.2.1
5.19.2.2
5.19.2.3
254
Module Documentation
5.19.2.4
5.19.2.5
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
255
5.19.2.7
5.19.2.8
Get the constant increment value as double type from the IFloat node.
Parameters:
NodeHandle A valid handle to a IFloat GenICam node
Value Reference to a double variable where the constant increment will be placed
Returns:
Jai_FactoryWrapper.EFactoryError
5.19.2.9
256
Module Documentation
IntegerNodeHandle Reference to a NODE_HANDLE variable to receive the handle of the Integer Alias
node
Returns:
Jai_FactoryWrapper.EFactoryError
5.19.2.10
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.20
257
Some of the camera features are represented as a list of possible values that can be selected via a name
from a list. These features are normally refered to as enumerations. If the node type retyrned by J_Node_GetType() is J_IEnumeration then the following functions are used for getting the list of
enumeration entries that can be used for setting the feature and possible values returned from the feature.
To read and write the value of an enumeration you will need to use one of these funtions: J_Node_GetValueInt64(), J_Node_GetValueString(), J_Node_SetValueInt64() or
J_Node_SetValueString().
Functions
static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfEnumEntries (NODE_HANDLE
NodeHandle, ref UInt32 NumOfEnumEntries)
Get the number of enumeration entries on a EConfNodeType.IEnumeration node.
5.20.1
Detailed Description
Some of the camera features are represented as a list of possible values that can be selected via a name
from a list. These features are normally refered to as enumerations. If the node type retyrned by J_Node_GetType() is J_IEnumeration then the following functions are used for getting the list of
enumeration entries that can be used for setting the feature and possible values returned from the feature.
To read and write the value of an enumeration you will need to use one of these funtions: J_Node_GetValueInt64(), J_Node_GetValueString(), J_Node_SetValueInt64() or
J_Node_SetValueString().
5.20.2
Function Documentation
5.20.2.1
258
Module Documentation
Returns:
Jai_FactoryWrapper.EFactoryError
5.20.2.2
Get the enumeration entry on a EConfNodeType.IEnumeration node. The node type returned will
be EConfNodeType.IEnumEntry.
Parameters:
NodeHandle A valid handle to a GenICam node
Index Index of the enumeration entry
EnumNodeHandle Handle to a EConfNodeType.IEnumEntry node
Returns:
Jai_FactoryWrapper.EFactoryError
5.20.2.3
will
receive
the
integer
value
of
the
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.21
259
Some features are defined as commands. These command features cannot be read or written to but instead
the command can be executed using the J_Node_ExecuteCommand() function.
Functions
static Jai_FactoryWrapper.EFactoryError J_Node_ExecuteCommand (NODE_HANDLE NodeHandle)
Execute the GenICam command.
5.21.1
Detailed Description
Some features are defined as commands. These command features cannot be read or written to but instead
the command can be executed using the J_Node_ExecuteCommand() function.
5.21.2
Function Documentation
5.21.2.1
5.21.2.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
260
Module Documentation
5.22
Some registers inside the cameras are defined as either string registers or string features. These are only accessible using the J_Node_GetString() and J_Node_SetString() functions. It is also possible
to use these two function to read and write the values of integer, floating point, boolean and enumeration
features!
Functions
static Jai_FactoryWrapper.EFactoryError J_Node_SetValueString (NODE_HANDLE NodeHandle,
bool Verify, String ValueStr)
Set node value as a String.
5.22.1
Detailed Description
Some registers inside the cameras are defined as either string registers or string features. These are only accessible using the J_Node_GetString() and J_Node_SetString() functions. It is also possible
to use these two function to read and write the values of integer, floating point, boolean and enumeration
features!
5.22.2
Function Documentation
5.22.2.1
5.22.2.2
261
The camera needs to be opened using J_Camera_Open() before the value can be read The node type
can be any type. The value will automatically be converted internally in the factory
Parameters:
NodeHandle A valid handle to a GenICam node
Verify Verify the value
ValueStr StringBuilder to place the current value of the node
SizeValueStr Capacity of the StringBuilder. The length of the value string will be returned
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
262
Module Documentation
5.23
Some of the camera features might be specified as register types. The functions below makes it possible to
read and write these registers directly as binary data without interpreting this data as for instance integers
and floating point values. This is typically used for accessing LUT data as a binary chunk of data instead
of direct access using LUT index selectors that would be much slower than the direct register access.
Functions
static Jai_FactoryWrapper.EFactoryError J_Node_SetValueRegister (NODE_HANDLE NodeHandle, IntPtr pBuffer, UInt64 Length)
Writes register values to nodes of type EConfNodeType.IRegister, IIntReg, IStringReg or IFloatReg.
5.23.1
Detailed Description
Some of the camera features might be specified as register types. The functions below makes it possible to
read and write these registers directly as binary data without interpreting this data as for instance integers
and floating point values. This is typically used for accessing LUT data as a binary chunk of data instead
of direct access using LUT index selectors that would be much slower than the direct register access.
5.23.2
Function Documentation
5.23.2.1
263
Returns:
Jai_FactoryWrapper.EFactoryError
5.23.2.2
5.23.2.3
5.23.2.4
264
Module Documentation
pAddress Reference to a UInt64 variable to receive the address for the register node
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.24
265
The JAI SDK contains a number of functions to handle automatic image acquisition via callback functions,
image manipulation and image display.
Classes
struct POINT
Windows POINT implementation for pInvoke.
struct SIZE
Windows SIZE implementation for pInvoke.
struct RECT
Windows RECT implementation for pInvoke.
struct ImageInfo
Image information structure used in callback and image conversion functions.
struct PixelValue
Pixel value structure that will hold Mono8, Mono10, Mono12, Mono16, DIB24, RGB24, DIB32 and BGR48
pixels.
Modules
View window specific functions
In order to diplay the acquired images the View Window specific functions need to be used for creating a
display window. Many View Windows can be created for a single application and these View Windows can
either be created as new windows or it can reuse child windows already created by the application.
266
Module Documentation
Lookup-Table functions
The Lookup-Table functions makes it possible for the user to process the camera images through userconfigurable lookup-tables.
Histogram functions
The Histogram functions makes it possible to create a Histogram from an image.
Transformation functions
The Transformation functions makes it possible for the user to flip and rotate images.
Enumerations
enum EPixelTypeColorInfo { Monochrome = 0x01000000, RGB = 0x02000000, Custom =
0x80000000 }
Color information for the EPixelType enumeration.
GetPixelTypeColorInfo().
enum EPixelFormatType {
GVSP_PIX_MONO8 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x0001), GVSP_PIX_MONO8_SIGNED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x0002), GVSP_PIX_MONO10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0003), GVSP_PIX_MONO10_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x0004),
GVSP_PIX_MONO12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0005), GVSP_PIX_MONO12_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x0006),
GVSP_PIX_MONO14 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0025), GVSP_PIX_MONO16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0007),
GVSP_PIX_BAYGR8 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x0008), GVSP_PIX_BAYRG8 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x0009), GVSP_PIX_BAYGB8 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x000A), GVSP_PIX_BAYBG8
= (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x000B),
GVSP_PIX_BAYGR10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x000C), GVSP_PIX_BAYRG10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x000D), GVSP_PIX_BAYGB10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x000E), GVSP_PIX_BAYBG10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x000F),
GVSP_PIX_BAYGR12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0010), GVSP_PIX_BAYRG12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0011), GVSP_PIX_BAYGB12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0012), GVSP_PIX_BAYBG12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0013),
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
267
Functions
static Jai_FactoryWrapper.EPixelTypeColorInfo GetPixelTypeColorInfo (EPixelFormatType pixelType)
Get Color Information based on Pixel type.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
268
Module Documentation
5.24.1
Detailed Description
The JAI SDK contains a number of functions to handle automatic image acquisition via callback functions,
image manipulation and image display.
5.24.2
5.24.2.1
Enumerator:
Monochrome Monochrome pixel value format.
RGB RGB color pixel value format.
Custom Custom pixel value format.
5.24.2.2
Pixel Types used by the camera and in the buffer information structure ImageInfo.
Enumerator:
GVSP_PIX_MONO8 Mono 8 bit (Mono8=0x01080001).
GVSP_PIX_MONO8_SIGNED Mono 8 bit signed (Mono8Signed=0x01080002).
GVSP_PIX_MONO10 Mono 10 bit (Mono10=0x01100003).
GVSP_PIX_MONO10_PACKED Mono 10 bit packed (Mono10Packed=0x010C0004).
GVSP_PIX_MONO12 Mono 12 bit (Mono12=0x01100005).
GVSP_PIX_MONO12_PACKED Mono 12 bit packed (Mono12Packed=0x010C0006).
GVSP_PIX_MONO14 Mono 14 bit packed (Mono14=0x01100025).
GVSP_PIX_MONO16 Mono 16 bit (Mono16=0x01100007).
GVSP_PIX_BAYGR8 Bayer GR 8 bit (BayerGR8=0x01080008).
GVSP_PIX_BAYRG8 Bayer RG 8 bit (BayerRG8=0x01080009).
GVSP_PIX_BAYGB8 Bayer GB 8 bit (BayerGB8=0x0108000A).
GVSP_PIX_BAYBG8 Bayer BG 8 bit (BayerBG8=0x0108000B).
GVSP_PIX_BAYGR10 Bayer GR 10 bit (BayerGR10=0x0110000C).
GVSP_PIX_BAYRG10 Bayer RG 10 bit (BayerRG10=0x0110000D).
GVSP_PIX_BAYGB10 Bayer GB 10 bit (BayerGB10=0x0110000E).
GVSP_PIX_BAYBG10 Bayer BG 10 bit (BayerBG10=0x0110000F).
GVSP_PIX_BAYGR12 Bayer GR 12 bit (BayerGR12=0x01100010).
GVSP_PIX_BAYRG12 Bayer RG 12 bit (BayerRG12=0x01100011).
GVSP_PIX_BAYGB12 Bayer GB 12 bit (BayerGB12=0x01100012).
GVSP_PIX_BAYBG12 Bayer BG 12 bit (BayerBG12=0x01100013).
GVSP_PIX_BAYGR10_PACKED Bayer GR 10 bit packed (BayerGR10Packed=0x010C0026).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
269
5.24.3
Function Documentation
5.24.3.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
270
Module Documentation
5.24.3.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.25
271
In order to diplay the acquired images the View Window specific functions need to be used for creating a
display window. Many View Windows can be created for a single application and these View Windows
can either be created as new windows or it can reuse child windows already created by the application.
Classes
struct IVWOptionValue
Option
type
used
in
GetViewWindowOption().
J_Image_SetViewWindowOption()
and
J_Image_-
struct IVWCallbackValue
Type of value passed on by the Image View Window callback delegate. The value to use depends on the
Callback Type.
struct ZoomPos
Zoom Position value structure. This is used by the J_IVW_CB_ZOOM_POS Image View Window event.
struct UserDrawInfo
User-Draw value structure. This is used by the J_IVW_CB_USER_DRAW_IMAGE and J_IVW_CB_USER_DRAW_VIEW_WINDOW Image View Window event.
Enumerations
enum EIVWWindowType { Overlapped = 0, Child = 1, ChildStretch = 2, OverlappedStretch = 3 }
Window type used in J_Image_OpenViewWindowEx().
enum EIVWCallbackType {
J_IVW_CB_WINDOW_MOVE = 0x0001, J_IVW_CB_WINDOW_SIZE = 0x0002, J_IVW_CB_MOUSE_MOVE = 0x0004, J_IVW_CB_MOUSE_LBUTTON_DOWN = 0x0008,
J_IVW_CB_MOUSE_LBUTTON_UP = 0x0010, J_IVW_CB_MOUSE_RBUTTON_DOWN =
0x0020, J_IVW_CB_MOUSE_RBUTTON_UP = 0x0040, J_IVW_CB_ZOOM_POS = 0x0080,
J_IVW_CB_AREA_SELECT = 0x0100, J_IVW_CB_USER_DRAW_IMAGE = 0x0200, J_IVW_CB_USER_DRAW_VIEW_WINDOW = 0x0400 }
Image View Window Callback type. This type determines how to interprete the data passed in by the callback
value parameter. It is also used when the callback mask is set as a View Window option.
enum EColorInterpolationAlgorithm {
BayerStandard = 0, BayerStandardMultiprocessor = 1, BayerExtended = 2, BayerExtendedMultiprocessor = 3,
BayerSimple = 4, BayerSimpleMultiprocessor = 5, BayerFast = 6, BayerFastMultiprocessor = 7 }
Bayer color interpolation algorithm.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
272
Module Documentation
enum EColorConversionPixelFormat {
PixelFormatNone = 0, PixelFormat24BitSwapRB = 1, PixelFormat8BitY = 2, PixelFormat24BitUYV = 3,
PixelFormat24BitYCBCR = 4, PixelFormat48BitSwapRB = 5, PixelFormat16BitY = 6, PixelFormatSwapRB = 7,
PixelFormatY = 8, PixelFormat3YH = 9, PixelFormat3YV = 10 }
Image conversion pixelformat options used in J_Image_ConvertImage() and J_Image_Malloc().
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_OpenViewWindow (String WindowName, ref
POINT Point, ref SIZE MaxSize, out VW_HANDLE WindowHandle)
Open image view window.
static Jai_FactoryWrapper.EFactoryError J_Image_OpenViewWindowEx (EIVWWindowType WindowType, String WindowName, ref RECT FrameRect, ref SIZE MaxSize, HWND hParent, out
VW_HANDLE WindowHandle)
Open image view window.
static Jai_FactoryWrapper.EFactoryError J_Image_SetImageOffset (VW_HANDLE WindowHandle, ref POINT Offset, Int32 ZoomRatio)
Set image offset and zoom ratio.
static Jai_FactoryWrapper.EFactoryError J_Image_SetImageOffsetEx (VW_HANDLE WindowHandle, ref POINT Offset, double ZoomRatioX, double ZoomRatioY)
Set image offset and zoom ratio (individually in both X and Y direction).
static Jai_FactoryWrapper.EFactoryError J_Image_GetImageOffsetEx (VW_HANDLE WindowHandle, ref POINT Offset, ref double ZoomRatioX, ref double ZoomRatioY)
Get image offset and zoom ratio (individually in both X and Y direction).
273
static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowOption (VW_HANDLE WindowHandle, EIVWOptionType Option, ref IVWOptionValue OptionValue)
Set the value for a View Window option.
static Jai_FactoryWrapper.EFactoryError J_Image_GetViewWindowOption (VW_HANDLE WindowHandle, EIVWOptionType Option, ref IVWOptionValue OptionValue)
Get the current View Window option value.
5.25.1
Detailed Description
In order to diplay the acquired images the View Window specific functions need to be used for creating a
display window. Many View Windows can be created for a single application and these View Windows
can either be created as new windows or it can reuse child windows already created by the application.
5.25.2
5.25.2.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
274
Module Documentation
5.25.2.2
5.25.2.3
Image View Window Callback type. This type determines how to interprete the data passed in by the
callback value parameter. It is also used when the callback mask is set as a View Window option.
Enumerator:
J_IVW_CB_WINDOW_MOVE The View Window has been moved. The Value pointer in the callback function points to a POINT structure.
J_IVW_CB_WINDOW_SIZE The View Window has been resized. The Value pointer in the callback function points to a SIZE structure.
J_IVW_CB_MOUSE_MOVE The mouse has been moved inside the View Window. The Value
pointer in the callback function points to a POINT structure. The location is in image pixel
coordinates.
J_IVW_CB_MOUSE_LBUTTON_DOWN The left mouse button has been clicked inside the View
Window. The Value pointer in the callback function points to a POINT structure. The location is
in image pixel coordinates.
J_IVW_CB_MOUSE_LBUTTON_UP The left mouse button has been released inside the View
Window. The Value pointer in the callback function points to a POINT structure. The location is
in image pixel coordinates.
J_IVW_CB_MOUSE_RBUTTON_DOWN The right mouse button has been clicked inside the View
Window. The Value pointer in the callback function points to a POINT structure. The location is
in image pixel coordinates.
J_IVW_CB_MOUSE_RBUTTON_UP The right mouse button has been released inside the View
Window. The Value pointer in the callback function points to a POINT structure. The location is
in image pixel coordinates.
J_IVW_CB_ZOOM_POS The Zoom or view location has changed the View Window. The pValue
pointer returns the new view position and zoom values in a J_IVW_ZOOM_POS structure.
J_IVW_CB_AREA_SELECT The user has dragged a selection rectangle using the mouse. The
Value pointer returns the selected rectangle in a RECT structure. The location is in image pixel
coordinates.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
275
J_IVW_CB_USER_DRAW_IMAGE The Image View Window is done drawing the image so the
user will now be able to draw an image overlay onto the image. Be aware the the coordinates
used by the drawing methods will be in "image coordinates" so the overlay will be scaled like the
rest of the image.
J_IVW_CB_USER_DRAW_VIEW_WINDOW The Image View Window is done drawing the image into the View Window so the user will now be able to draw an image overlay onto View Window output. Be aware the the coordinates used by the drawing methods will be in "View Window
coordinates" so the overlay will NOT be scaled even if the image is stretched or shrinked into the
View Window.
5.25.2.4
5.25.2.5
276
Module Documentation
PixelFormat8BitY Converts from RGB(24/48bit) to Y(8bit).
PixelFormat24BitUYV Converts from RGB(24/48bit) to UYV. Not supported yet.
PixelFormat24BitYCBCR Converts from RGB(24/48bit) to YCBCR. Not supported yet.
PixelFormat48BitSwapRB Swaps the data of R and B. (48bit).
PixelFormat16BitY Converts from RGB(24/48bit) to Y(16bit).
PixelFormatSwapRB Swaps the data of R and B. Selects the bit-length automatically. (24bit->24bit,
48bit->48bit).
PixelFormatY Converts from RGB(24/48bit) to Y(8bit). Selects the bit-length automatically. (24bit>24bit, 48bit->48bit).
PixelFormat3YH Convert RGB (24-bit RGB/24-bit BGR/30-bit RGB Packed V1/30-bit RGB
Packed V2) into 3xY images stitched together horizontally (3-head camera special feature!).
PixelFormat3YV Convert RGB (24-bit RGB/24-bit BGR/30-bit RGB Packed V1/30-bit RGB
Packed V2) into 3xY images stitched together vertically (3-head camera special feature!).
5.25.3
Function Documentation
5.25.3.1
See also:
J_Camera_GetNodeByName(CAMERA_HANDLE, String,
ExecuteCommand(NODE_HANDLE), EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
277
Parameters:
WindowName Name to be displayed in the view window caption
Point Point of the upper left corner of the view window
MaxSize Maximum size of the view window
WindowHandle The handle of the created window (window object) is returned
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.25.3.2
5.25.3.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
or
J_Image_-
278
Module Documentation
5.25.3.4
using
J_Image_-
5.25.3.5
Display an image in a view window using a specific Bayer Color Interpolation algorithm.
This function automatically converts the RAW image specified with AqImageInfo into DIB, and
display it in the view window in the window of handle WindowHandle created with J_Image_OpenViewWindow().
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx().
using
J_Image_-
5.25.3.6
279
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx().
using
J_Image_-
Offset POINT structure pointer with the horizontal and vertical offset (number of pixels).
ZoomRatio Zoom ratio: 100=The original image is reduced to the window size. 1=1/100 of the
original images is expanded to the window size.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.25.3.7
Set image offset and zoom ratio (individually in both X and Y direction).
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx().
using
J_Image_-
Offset POINT structure pointer with the horizontal and vertical offset (number of pixels).
ZoomRatioX Zoom ratio in X-direction: 100.0=The original image is reduced to the window size.
1=1/100 of the original images is expanded to the window size.
ZoomRatioY Zoom ratio in Y-direction: 100.0=The original image is reduced to the window size.
1=1/100 of the original images is expanded to the window size.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.25.3.8
Get image offset and zoom ratio (individually in both X and Y direction).
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx().
using
J_Image_-
Offset POINT structure pointer with the horizontal and vertical offset (number of pixels).
ZoomRatioX Zoom ratio in X-direction: 100.0=The original image is reduced to the window size.
1=1/100 of the original images is expanded to the window size.
ZoomRatioY Zoom ratio in Y-direction: 100.0=The original image is reduced to the window size.
1=1/100 of the original images is expanded to the window size.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
280
Module Documentation
5.25.3.9
using
J_Image_-
5.25.3.10
Resize child(view) window. Resize the child view window to new rectangle specified by RECT.
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx().
using
J_Image_-
5.25.3.11
using
J_Image_-
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
281
Get position and size of the view window including the windows frame.
The current position and size of the frame of the view window is read into a RECT structure.
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx()
using
J_Image_-
5.25.3.13
using
J_Image_-
5.25.3.14
282
Module Documentation
if (error == EFactoryError.Success)
{
// Set the View Window option so that Mouse cursor zoom will be ena
bled
OptionValue.BooleanValue = true;
error = J_Image_SetViewWindowOption(WindowHandle, EIVWOptionType.Mo
useZoom, ref OptionValue);
if (error == EFactoryError.Success)
{
error = J_Image_OpenStreamLight(CameraHandle, 0, out StreamHandle
);
if (error == EFactoryError.Success)
{
IntPtr nodeHandle;
error = J_Camera_GetNodeByName(CameraHandle, "AcquisitionStart"
, out nodeHandle);
if (error == EFactoryError.Success)
error = J_Node_ExecuteCommand(nodeHandle);
}
}
}
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx()
Option Option type to set
OptionValue Reference to the value to assign to the option
using
J_Image_-
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.25.3.15
5.25.3.16
Delegate to be called as callback function when a View Window event has been detected.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
283
Parameters:
WindowHandle Image information to be used in the image function
Type Type of View Window Event
CallbackValue View Window Event value
5.25.3.17
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx()
using
CBObject Pointer to a callback class object that contains a dynamic callback function
CallbackDelegate Pointer to a static or dynamic callback delegate
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
J_Image_-
284
Module Documentation
5.26
The Stream Channel specific functions are used for utilizing the automatic Image Acquisition via callback
functions.
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_OpenStream (CAMERA_HANDLE CameraHandle, UInt32 Channel, IntPtr CBObject, IntPtr CallbackDelegate, out SP_HANDLE StreamHandle, UInt32 BufferSize, UInt32 McIP)
Open image stream channel.
static Jai_FactoryWrapper.EFactoryError J_Image_OpenStreamLight (CAMERA_HANDLE CameraHandle, UInt32 Channel, out SP_HANDLE StreamHandle)
Open image stream channel and let the factory automatically create all callback delegates and automatically
display live images.
5.26.1
Detailed Description
The Stream Channel specific functions are used for utilizing the automatic Image Acquisition via callback
functions.
The JAI SDK has got two major ways of handling the Image Acqusition:
1) Automatic Image Acquisition handling via the J_Image_OpenStream(), J_Image_OpenStreamLight(), J_Image_CloseStream() and J_Image_GetStreamInfo()
functions. The JAI SDK will automatically take care of image buffer allocation as well as creating
an Image acquisition thread and all the images will be accessible via callback routines.
2) Manual Image Acquisition handling via the J_DataStream_...() function described in this section. This requires that the user application take care of all necessary memory allocation as well as
creating an image acquisition thread the wait for "new image" events from the underlying drivers. The
biggest advantage is that this will give the application full control but this also increases the complexity
of the application.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
285
5.26.2
Function Documentation
5.26.2.1
5.26.2.2
Open image stream channel and let the factory automatically create all callback delegates and automatically
display live images.
This is the easiest way to create a view window that will display live video from the cameras. After opening the stream channel the acquisition has to be started using the standard GenICam command
AcquisitionStart.
// C# Sample that opens a live view window and starts acquisition
...
Jai_FactoryWrapper.POINT pnt = new Jai_FactoryWrapper.POINT(10, 10);
Int32 Width = Convert.ToInt32(GetValue("Width"));
Int32 Height = Convert.ToInt32(GetValue("Height"));
SIZE maxSize = new SIZE(Width, Height);
// Open the live view
EFactoryError error = EFactoryError.Success;
error = J_Image_OpenViewWindow("Live view!", ref pnt, ref maxSize, ou
t WindowHandle);
if (error == EFactoryError.Success)
{
error = J_Image_OpenStreamLight(CameraHandle, 0, out StreamHandle);
if (error == EFactoryError.Success)
{
IntPtr nodeHandle;
error = J_Camera_GetNodeByName(CameraHandle, "AcquisitionStart",
out nodeHandle);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
286
Module Documentation
if (error == EFactoryError.Success)
error = J_Node_ExecuteCommand(nodeHandle);
}
}
Parameters:
CameraHandle Handle to the camera
Channel Stream channel index. This index is zero-based
StreamHandle The handle of the created stream channel is returned.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.26.2.3
Close a stream channel that has previously been opened using J_Image_OpenStream() or J_Image_OpenStreamLight().
Parameters:
StreamHandle Handle to the stream channel
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.26.2.4
Get detailed information about the underlying data stream via stream handle.
Parameters:
StreamHandle Handle to a valid stream channel, obtained by J_Image_OpenStream() function
or J_Image_OpenStreamLight().
Cmd The information type that is requested
Info Reference to a structure where the information is stored.
Size The size of the structure. The function sets the actual size of data stored into the structure.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
287
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
288
Module Documentation
5.27
The JAI SDK contains a number of functions that are used for manipulating the raw images acquired from
the cameras.
Enumerations
enum ESaveFileFormat {
Tiff = 1, Jpeg = 2, Bmp = 3, Jai = 4,
RAW = 5 }
File type used in J_Image_SaveFileEx().
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToDIB (ref ImageInfo AqImageInfo,
ref ImageInfo BufferInfo, UInt32 RGain, UInt32 GGain, UInt32 BGain)
Convert image from RAW to DIB.
static Jai_FactoryWrapper.EFactoryError J_Image_Malloc (ref ImageInfo AqImageInfo, ref ImageInfo BufferInfo, EColorConversionPixelFormat ConversionPixelFormat)
Allocate the buffer memory for the image to use J_Image_ConvertImage().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
289
5.27.1
Detailed Description
The JAI SDK contains a number of functions that are used for manipulating the raw images acquired from
the cameras.
5.27.2
5.27.2.1
5.27.3
Function Documentation
5.27.3.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
290
Module Documentation
5.27.3.2
5.27.3.3
BufferInfo PixelFormat
8bpp Grayscale
16bpp Grayscale (Shifted to MSB)
24bpp BGR
48bpp BGR (Shifted to MSB)
24bpp BGR
48bpp BGR (Shifted to MSB)
// C# Sample that converts a raw image and saved the result to a file
...
EFactoryError error = EFactoryError.Success;
// Create Image info structure
ImageInfo ConvertedImageInfo = new ImageInfo();
// Allocate the buffer to hold converted the image
error = J_Image_Malloc(ref ImageInfo, ref ConvertedImageInfo);
if (error == EFactoryError.Success)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
291
{
// Convert the raw image to image format
error = J_Image_FromRawToImage(ref ImageInfo, ref ConvertedImageInf
o, RedGain, GreenGain, BlueGain);
if (error == EFactoryError.Success)
{
// Save the image to disk in TIFF format
error = J_Image_SaveFile(ref ConvertedImageInfo, FileName);
}
// Free up the image buffer again
error = J_Image_Free(ref ConvertedImageInfo);
}
Parameters:
AqImageInfo Reference to ImageInfo structure with information on RAW data.
BufferInfo Reference to ImageInfo structure in which the converted image is written.
RGain Gain for the red color channel for Bayer conversion (0x01000(4096) = 1.00)
GGain Gain for the green color channel for Bayer conversion (0x01000(4096) = 1.00)
BGain Gain for the blue color channel for Bayer conversion (0x01000(4096) = 1.00)
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.27.3.4
BufferInfo PixelFormat
8bpp Grayscale
16bpp Grayscale (Shifted to MSB)
24bpp BGR
48bpp BGR (Shifted to MSB)
24bpp BGR
48bpp BGR (Shifted to MSB)
If the BayerFast or the BayerFastMultiprocessor algorithms are used then the output buffer
will only have the half vertical and horizontal resolution of the input image!
// C# Sample that converts a raw image and saved the result to a file
...
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Create Image info structure
ImageInfo ConvertedImageInfo = new ImageInfo();
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
292
Module Documentation
// Allocate the buffer to hold converted the image
error = J_Image_Malloc(ref ImageInfo, ref ConvertedImageInfo);
if (error == EFactoryError.Success)
{
// Convert the raw image to image format
error = J_Image_FromRawToImage(ref ImageInfo, ref ConvertedImageInf
o, RedGain, GreenGain, BlueGain);
if (error == EFactoryError.Success)
{
// Save the image to disk in TIFF format
error = J_Image_SaveFile(ref ConvertedImageInfo, FileName);
}
// Free up the image buffer again
error = J_Image_Free(ref ConvertedImageInfo);
}
Parameters:
AqImageInfo Reference to ImageInfo structure with information on RAW data.
BufferInfo Reference to ImageInfo structure in which the converted image is written.
BayerAlgorithm Color interpolation algorithm.
RGain Gain for the red color channel for Bayer conversion (0x01000(4096) = 1.00)
GGain Gain for the green color channel for Bayer conversion (0x01000(4096) = 1.00)
BGain Gain for the blue color channel for Bayer conversion (0x01000(4096) = 1.00)
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.27.3.5
Convert an image to a new image with some other format such as Color to Monochrome conversion.
Convert an image, which has been previously converted with J_Image_FromRawToImage()
or J_Image_FromRawToImageEx(), to an image with a format specified with
ConversionPixelFormat.
Parameters:
InputImageInfo Reference to ImageInfo structure which had been previously converted with J_Image_FromRawToImage() or J_Image_FromRawToImageEx().
OutputImageInfo Reference to ImageInfo structure in which the converted image will be stored.
ConversionPixelFormat Pixel format to which the image will be converted
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.27.3.6
293
Allocate the buffer to store the converted image. Information on the allocated buffer is returned in BufferInfo structure.
// C# Sample that allocated an image buffer and frees it again
...
EFactoryError error = EFactoryError.Success;
// Create Image info structure
ImageInfo ConvertedImageInfo = new ImageInfo();
// Allocate the buffer to hold converted the image
error = J_Image_Malloc(ref ImageInfo, ref ConvertedImageInfo);
if (error == EFactoryError.Success)
{
... Do something with the image buffer
// Free up the image buffer again
error = J_Image_Free(ref ConvertedImageInfo);
}
Parameters:
AqImageInfo Reference to ImageInfo structure with information on RAW data.
BufferInfo Reference to ImageInfo structure in which the information about the allocated buffer will
be stored.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.27.3.7
Parameters:
AqImageInfo Reference to ImageInfo structure with information on RAW data.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
294
Module Documentation
BufferInfo Reference to ImageInfo structure in which the information about the allocated buffer will
be stored.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.27.3.8
Parameters:
AqImageInfo Reference to ImageInfo structure with information on RAW data.
BufferInfo Reference to ImageInfo structure in which the information about the allocated buffer will
be stored.
ConversionPixelFormat Image conversion pixelformat option to be used in J_Image_ConvertImage()
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.27.3.9
295
Parameters:
BufferInfo Reference to ImageInfo structure with a buffer previously allocated with J_Image_Malloc()
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
296
Module Documentation
5.28
These functions are used for saving the acquired images to disk as well as loading previously saved images.
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_SaveFile (ref ImageInfo BufferInfo, String FileName)
Save an image to disk as TIFF file.
5.28.1
Detailed Description
These functions are used for saving the acquired images to disk as well as loading previously saved images.
The J_Image_SaveFileRaw() function will save the contents of the acquired image without
any image file header information - just the RAW data received from the camera.
The J_Image_LoadFileRaw() function will be able to load a RAW image file that has been
saved with either J_Image_SaveFileEx() in JAI format or an image saved using J_Image_SaveFileRaw().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
297
5.28.2
Function Documentation
5.28.2.1
Parameters:
BufferInfo Reference to ImageInfo structure in which the information about the allocated buffer will
be read.
FileName Full file name and path of the tiff file to be stored to disk.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.28.2.2
Save an image to disk using various file formats such as TIFF, JPEG, BMP or JAI.
Saves an image to disk using different file formats. A raw image needs to be converted using J_Image_FromRawToImage() before it can be saved unless the JAI RAW format is being used!
// C# Sample that converts a raw image and saves the result to a file
...
EFactoryError error = EFactoryError.Success;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
298
Module Documentation
// Create Image info structure
ImageInfo ConvertedImageInfo = new ImageInfo();
// Allocate the buffer to hold converted the image
error = J_Image_Malloc(ref ImageInfo, ref ConvertedImageInfo);
if (error == EFactoryError.Success)
{
// Convert the raw image to image format
error = J_Image_FromRawToImage(ref ImageInfo, ref ConvertedImageInf
o, RedGain, GreenGain, BlueGain);
if (error == EFactoryError.Success)
{
// Save the image to disk in Jpeg format with quality factor 75
error = J_Image_SaveFileEx(ref ConvertedImageInfo, FileName,
ESaveFileFormat.Jpeg, 75);
}
// Free up the image buffer again
error = J_Image_Free(ref ConvertedImageInfo);
}
Parameters:
BufferInfo Reference to ImageInfo structure in which the information about the allocated buffer will
be read.
FileName Full file name and path of the tiff file to be stored to disk.
FileFormat File format to be used when saving the image.
EncoderParameter Encoder parameter. The meaning of the value depends on which File format that
is selected. If Jpeg file format is selected this parameter specifies the Quality level for the jpeg
file. Acceptable value range is 1 to 100, default is 75, 5-95 is useful range. Larger number goes
toward higher quality and larger file size.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.28.2.3
5.28.2.4
299
If the file was saved using J_Image_SaveFileEx() in JAI file format then the BufferInfo structure parameter will automatically be initialized with the proper values from the original image that was
saved. If the file was saved using J_Image_SaveFileRaw() then the BufferInfo structure parameter will need to be initialized with the proper values by the application!.
This function will automaticall allocated the correct amount of memory needed to hold the image data.
Please remember to call J_Image_Free(pBufferInfo) when the image is not needed any more!
Parameters:
BufferInfo Reference to ImageInfo structure in which the information about the image buffer will be
written.
FileName Full file name and path of the raw binary file to be loaded from disk.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
300
Module Documentation
5.29
These functions are used for accessing pixels directly inside an image. A raw image needs to be converted
using J_Image_FromRawToImage() before pixels can be read or written.
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_GetPixel (ref ImageInfo BufferInfo, ref POINT
Point, ref PixelValue Pixel)
Get the pixel at a specified position.
5.29.1
Detailed Description
These functions are used for accessing pixels directly inside an image. A raw image needs to be converted
using J_Image_FromRawToImage() before pixels can be read or written.
5.29.2
Function Documentation
5.29.2.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
301
5.29.2.3
5.29.2.4
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
302
Module Documentation
5.30
The JAI SDK has the possibility to estimate the gain values needed in order to get a correct White-balance
for color cameras with a Bayer Color Filter Array. The White-balancing is later done on the host PC side
during the color-interpolation.
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_SetGain (SP_HANDLE StreamHandle, UInt32
RGain, UInt32 GGain, UInt32 BGain)
Set RGB software gain.
static
Jai_FactoryWrapper.EFactoryError
StreamHandle)
J_Image_ExecuteWhiteBalance
(SP_HANDLE
5.30.1
Detailed Description
The JAI SDK has the possibility to estimate the gain values needed in order to get a correct White-balance
for color cameras with a Bayer Color Filter Array. The White-balancing is later done on the host PC side
during the color-interpolation.
5.30.2
Function Documentation
5.30.2.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
303
5.30.2.3
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
304
Module Documentation
5.31
The JAI SDK support creating High Dynamic Range images from multiple exposures of the same scene
where the exposure time and/or gain is different during the two exposures. This is very usefull for the 2CCD monochrome cameras as well as the JAI cameras that has got built-in support for multiple sequences.
But basically these functions will work with any camera as well where the exposure is controlled by an
application and where High Dynamic Range output is required.
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_MallocHDR (ref ImageInfo ImageInfo1, ref ImageInfo ImageInfo2, ref ImageInfo BufferInfo)
Allocate the buffer memory for the HDR output image.
5.31.1
Detailed Description
The JAI SDK support creating High Dynamic Range images from multiple exposures of the same scene
where the exposure time and/or gain is different during the two exposures. This is very usefull for the 2CCD monochrome cameras as well as the JAI cameras that has got built-in support for multiple sequences.
But basically these functions will work with any camera as well where the exposure is controlled by an
application and where High Dynamic Range output is required.
5.31.2
Function Documentation
5.31.2.1
305
ImageInfo2 Reference to ImageInfo structure with information on RAW data for second image.
BufferInfo Reference to ImageInfo structure in which the information about the allocated buffer will
be stored.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.31.2.2
Analyzes two images and try to determine the exposure difference (called Dark Gain) later to be used as a
parameter to the HDR fusing function J_Image_FuseHDR().
This function runs through the image data from the two input images and try to determine the exposure
difference between the two images by looking at the pixels with the highest values that are not saturated. It
will break out the analyzis when the gain start to become "unlinear" (when for instance the darkest image
values gets close to the black level).
It will return ERROR if it didnt find any pixels where there is an "overlap" so it couldnt calculate the gain.
The function also updates a flag that indicates wheter Image 1 is brighter than Image 2.
The minimun values inside Image 1 and Image 2 are returned as recommended Black Level values. If none
of the pixel values in any of the input images are as low as the black level then the estimeted black level
will be wrong. This means that the black level values used in J_Image_FuseHDR() need to be set to a
more correct value. A way to identify that this is the case is to compare the black level returned for the two
input images. If the black level value for the brightest image is more than twice the black levels of the dark
image then the recommended black level for the bright image might very well be wrong.
The input images needs to be Mono8, Mono10, Mono12, Mono14 or Mono16 pixel format for monochrome
images or Bayer8, Bayer10 Bayer12 or Bayer16 for CFA color images or RGB8Packed, RGB10Packed,
RGB12Packed or RGB16Packed for RGB color images. It is also required that the two images has got
identical pixel format
Parameters:
ImageInfo1 Reference to ImageInfo structure with information on RAW data for first image.
ImageInfo2 Reference to ImageInfo structure with information on RAW data for second image.
Image1IsBrighter Reference to flag that will be set to 1 if Image 1 is brighter than Image 2
BlackLevelImage1 Reference to an int value that will be updated with the recommended Black Level
for Image 1 to be subtracted from the image data during HDR merging.
BlackLevelImage2 Reference to an int value that will be updated with the recommended Black Level
for Image 2 to be subtracted from the image data during HDR merging.
DarkGain Reference to a float value that will contain the gain between the two images.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
306
Module Documentation
5.31.2.3
Fuses two input images into a "High Dynamic Range" output image.
This function will combine two input images into a HDR image by picking the unsaturated pixels from the
brightest image and wherever the brightest image is saturated it will instead use the pixel values from the
darkest of the two input images to create a replacement value for the saturated value.
The input images needs to be Mono8, Mono10, Mono12, Mono14 or Mono16 pixel format for monochrome
images or Bayer8, Bayer10 Bayer12 or Bayer16 for CFA color images or RGB8Packed, RGB10Packed,
RGB12Packed or RGB16Packed for RGB color images. It is also required that the two images has got
identical pixel format
Parameters:
BrighterImageInfo Reference to ImageInfo structure with information on the brighter of the two input
images.
DarkerImageInfo Reference to ImageInfo structure with information on the darker of the two input
images.
OutputImage Reference to ImageInfo structure that will receive the 16-bit HDR output image.
BrighterBlackLevel Black Level to be subtracted from the Brighter Image during calculation.
DarkerBlackLevel Black Level to be subtracted from the Brighter Image during calculation.
DarkGain Gain value to be multiplied with the Darker Image pixel values when the Brighter Image
pixels are saturated.
DualSlopeGain Value to be multiplied with fDarkGain to produce "Dual Slope" effect.
LogarithmicOutput Flag that will select if the HDR Output Image will be tranformed using log2()
before it is converted into 16-bit unsigned integer values.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.32
307
Lookup-Table functions
The Lookup-Table functions makes it possible for the user to process the camera images through userconfigurable lookup-tables.
Classes
struct LUTInfo
Structure containing LUT data.
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_MallocLUT (ref ImageInfo ImageInfo, ref
LUTInfo LUTInfo)
Allocate the buffer memory for the LUT based on the pixel format read from the image buffer.
308
Module Documentation
This function directly reads a value from the LUT.
5.32.1
Detailed Description
The Lookup-Table functions makes it possible for the user to process the camera images through userconfigurable lookup-tables.
5.32.2
Function Documentation
5.32.2.1
Allocate the buffer memory for the LUT based on the pixel format read from the image buffer.
The LUT will be initialized and the LUT memory will be allocated based on the pixel format read from the
image. The allocated LUT will need to be freed up using J_Image_FreeLUT()
Parameters:
ImageInfo Reference to ImageInfo structure with information on the image data.
LUTInfo Reference to LUTInfo structure with information on LUT.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.32.2.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
309
Convert an existing LUT into a different size and copy the data.
Parameters:
SourceLUTInfo Reference to LUTInfo structure with information on Source LUT.
DestinationLUTInfo Reference to LUTInfo structure with information on Destination LUT.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.32.2.4
5.32.2.5
This function creates a user-defined Gamma LUT and fills in the values to a LUT that has previously been
allocated using J_Image_MallocLUT().
The LUT has to be created using J_Image_MallocLUT() before this function can be called.
Parameters:
LUTInfo Reference to LUTInfo structure with information on LUT.
ColorIndex Select the LUT color index to use. 0=Monochrome or Red, 1=Green, 2=Blue
gamma Gamma value to be used
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
310
Module Documentation
5.32.2.6
This function applies a user-defined Gamma LUT to a LUT that has already been initialized with values.
The LUT has to be created using J_Image_MallocLUT() before this function can be called.
Parameters:
LUTInfo Reference to LUTInfo structure with information on LUT.
ColorIndex Select the LUT color index to use. 0=Monochrome or Red, 1=Green, 2=Blue
gamma Gamma value to be applied to the exisiting LUT contents
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.32.2.7
This function initializes a LUT with linear values between an user defined input and output range. Any
existing LUT values will be overwritten.
The output values for input values between X1 and X2 will be linear between Y1 and Y2.
The output values for input values between 0 and iMix will be min(Y1,Y2) and the output values for inputs
between X2 and the maximum input value will be max(Y1,Y2).
The LUT has to be created using J_Image_MallocLUT() before this function can be called.
// This pseudo code illustrates how the LUT values are created:
slope = (Y2 - Y1)/(X2 - X1);
offset = Y1 - (slope * X1);
for (val=0; val<numLUTEntries; val++)
{
if ((val>=0) && (val<X1))
{
LUT[val] = min(Y1,Y2);
}
else if ((val>=X1) && (val<X2))
{
LUT[val] = offset + slope*val;
}
else if (val>=X2))
{
LUT[val] = max(Y1,Y2);
}
}
// If Y1 < Y2 then it leads to a slope like this:
Output
^
Y2 |
|
|
|
___
/
/
/
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
311
|
/
Y1 |__/
|
-----------> Input
^
^
X1
X2
// If Y1 > Y2 then it leads to a slope like this:
Output
^
Y1 |__
| \
|
\
|
\
|
\
Y2 |
\___
|
-----------> Input
^
^
X1
X2
Parameters:
LUTInfo Reference to LUTInfo structure with information on LUT.
ColorIndex Select the LUT color index to use. 0=Monochrome or Red, 1=Green, 2=Blue
X1 Minimum input value to be used for the creation of the LUT entries.
X2 Maximum input value to be used for the creation of the LUT entries.
Y1 Minimum output value to be used for the creation of the LUT entries.
Y2 Maximum output value to be used for the creation of the LUT entries.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.32.2.8
This function initializes a LUT with linear values between two user defined knee-points. The first linear
segment will be between (0,0) and Knee1. Second linear segment will bee between Knee1 and Knee2 and
the last linear segment will be between Knee2 and (Input Max,Output Max). Any existing LUT values will
be overwritten.
The LUT has to be created using J_Image_MallocLUT() before this function can be called.
// This pseudo code illustrates how the LUT values are created:
slope1 = Y2/X2;
for (val=0; val<Knee1.X; val++)
{
LUT[val] = offset1 + slope1*val;
}
slope2 = (Knee2.Y - Knee1.Y)/(Knee2.X - Knee1.X);
offset2 = Knee1.Y - (slope2 * Knee1.X);
for (val=Knee1.X; val<Knee2.X; val++)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
312
Module Documentation
LUT[val] = offset2 + slope2*val;
}
slope3 = (Output Max - Knee2.Y)/(Input Max - Knee2.X);
offset3 = Knee2.Y - (slope3 * Knee2.X);
for (val=Knee2.X; val<Input Max; val++)
{
LUT[val] = offset3 + slope3*val;
}
Parameters:
LUTInfo Reference to LUTInfo structure with information on LUT.
ColorIndex Select the LUT color index to use. 0=Monochrome or Red, 1=Green, 2=Blue
knee1 First Knee-point to be used for the creation of the LUT entries.
knee2 Second Knee-point to be used for the creation of the LUT entries.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.32.2.9
5.32.2.10
313
5.32.2.11
5.32.2.12
This function loads a LUT from disk. If the LUT already contains data then it will be overwritten.
This function will automatically free any memory allocated for the existing LUT and allocate new memory
that will be large enough to hold the LUT that is read from disk.
Parameters:
LUTInfo Reference to LUTInfo structure with information on LUT.
FileName Filename and path to the LUT file to be read.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
314
Module Documentation
5.33
Histogram functions
Classes
struct HistogramInfo
Structure containing Histogram data.
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_MallocHistogram (ref ImageInfo ImageInfo, ref
HistogramInfo HistogramInfo)
Allocate the buffer memory for the Histogram based on the pixel format read from the image buffer.
the
Histogram
memory
previously
allocated
using
J_Image_-
static Jai_FactoryWrapper.EFactoryError J_Image_GetHistogramValue (ref HistogramInfo HistogramInfo, UInt32 ColorIndex, UInt32 HistogramIndex, ref UInt32 pHistogramValue)
This function directly reads a value from the Histogram.
5.33.1
Detailed Description
5.33.2
Function Documentation
5.33.2.1
Allocate the buffer memory for the Histogram based on the pixel format read from the image buffer.
The Histogram will be initialized and the memory will be allocated based on the pixel format read from
the image. The allocated Histogram will need to be freed up using J_Image_FreeHistogram()
Parameters:
ImageInfo Reference to ImageInfo structure with information on the image data.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
315
5.33.2.2
5.33.2.3
the
Histogram
memory
previously
allocated
using
J_Image_-
Parameters:
HistogramInfo Reference to HistogramInfo structure with information on Histogram.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.33.2.4
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
316
Module Documentation
5.33.2.5
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.34
317
Transformation functions
The Transformation functions makes it possible for the user to flip and rotate images.
Enumerations
enum EFlipType { FlipHorizontally = 0, FlipVertically = 1 }
Flip type used in J_Image_Flip().
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_Flip (ref ImageInfo ImageInfo, EFlipType flipType)
Flip the image contents in the image buffer.
5.34.1
Detailed Description
The Transformation functions makes it possible for the user to flip and rotate images.
5.34.2
5.34.2.1
5.34.2.2
318
Module Documentation
5.34.3
Function Documentation
5.34.3.1
5.34.3.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.35
319
The Image Processing functions makes it possible for the user to apply a number of different image processing algorithms to an image buffer.
Modules
Color-Compensation Image Processing algorithms
The Color-Compensation Image Processing algorithms makes it possible artificially enhance the red and/or
green colors near saturation. This is typically used in ITS applications where the cameras are looking at
traffic lights at night time. This will help remove dis-coloration caused by saturation of the colors. The
color compensation can be applied in up to 10 seperate Regions-of-Interests specified in the RectOfROI
parameter structures.
Enumerations
enum EProcessFunctionType {
RedCompensation = 0, RedCompensationMulti = 1, GreenCompensation = 2, GreenCompensationMulti = 3,
LensDistortion = 10, LensDistortionMulti = 11, LensDistortionMapInit = 12, LensDistortionMapFree = 13 }
Image Processing algorithm type used in J_Image_Processing().
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo ImageInfo, EProcessFunctionType ProcessingFunction, IntPtr Parameters)
This function processes the image by the function specified by the parameter.
5.35.1
Detailed Description
The Image Processing functions makes it possible for the user to apply a number of different image processing algorithms to an image buffer.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
320
Module Documentation
5.35.2
5.35.2.1
5.35.3
Function Documentation
5.35.3.1
This function processes the image by the function specified by the parameter.
// C# Sample that perform Red-Compensation on a color image received
from a camera.
// This sample calls the "native" J_Image_Processing() instead of usi
ng the overloaded version in order to
// illustrate the marshalling needed
...
EFactoryError error = EFactoryError.Success;
// Create Image info structure to be used for the conversion between
RAW and Image format
ImageInfo ConvImageInfo = new ImageInfo();
// Allocate the buffer to hold converted the image
error = J_Image_Malloc(ref ImageInfo, ref ConvImageInfo);
if (error == EFactoryError.Success)
{
// Convert the raw image to image format
error = J_Image_FromRawToImage(ref ImageInfo, ref ConvImageInfo, Re
dGain, GreenGain, BlueGain);
if (error == EFactoryError.Success)
{
// Perform the Red-Compensation on the full image:
// Start by setting up the Red-compensation parameter structure
Jai_FactoryWrapper.RedCompensationStruct myRedCompParam = new Jai
_FactoryWrapper.RedCompensationStruct();
// Remember to allocate the 10 Red-compensation ROI structures
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Parameters:
ImageInfo Reference to ImageInfo structure with information on the image data.
ProcessingFunction Type of image processing to be performed
Parameters Pointer to an unmanaged structure containing the image processing parameters
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
321
322
Module Documentation
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.35.3.2
This function processes the image by the function specified by the parameter. The output is written to an
image that is different from the input image.
// C# Sample that perform Red-Compensation on a color image received
from a camera.
// This sample calls the "native" J_Image_ProcessingEx() instead of u
sing the overloaded version in order to
// illustrate the marshalling needed
...
EFactoryError error = EFactoryError.Success;
// Create Image info structure to be used for the conversion between
RAW and Image format
ImageInfo ConvImageInfo = new ImageInfo();
// Allocate the buffer to hold converted the image
error = J_Image_Malloc(ref ImageInfo, ref ConvImageInfo);
if (error == EFactoryError.Success)
{
// Convert the raw image to image format
error = J_Image_FromRawToImage(ref ImageInfo, ref ConvImageInfo, Re
dGain, GreenGain, BlueGain);
if (error == EFactoryError.Success)
{
// Perform the Red-Compensation on the full image:
// Start by setting up the Red-compensation parameter structure
Jai_FactoryWrapper.RedCompensationStruct myRedCompParam = new Jai
_FactoryWrapper.RedCompensationStruct();
// Remember to allocate the 10 Red-compensation ROI structures
myRedCompParam.ColorCompensationROI = new Jai_FactoryWrapper.Colo
rCompensationROIStruct[10];
// We are going to use the full image as a ROI for the Red-Compen
sation
myRedCompParam.NumOfROI = 1;
myRedCompParam.ColorCompensationROI[0].RectOfROI.Left = 0;
myRedCompParam.ColorCompensationROI[0].RectOfROI.Right = (int)Ima
geInfo.SizeX - 1;
myRedCompParam.ColorCompensationROI[0].RectOfROI.Top = 0;
myRedCompParam.ColorCompensationROI[0].RectOfROI.Bottom = (int)Im
ageInfo.SizeY - 1;
myRedCompParam.ColorCompensationROI[0].RThreshold = myRedThreshol
d;
myRedCompParam.ColorCompensationROI[0].GThreshold = myGreenThresh
old;
myRedCompParam.ColorCompensationROI[0].BThreshold = myBlueThresho
ld;
myRedCompParam.ColorCompensationROI[0].RGain = 4096 * myRedGainPe
rcentage / 100;
myRedCompParam.ColorCompensationROI[0].GGain = 4096 * myGreenGain
Percentage / 100;
myRedCompParam.ColorCompensationROI[0].BGain = 4096 * myBlueGainP
ercentage / 100;
// At this point we could call the overloaded J_Image_Processing(
) for Red-Compensation but
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Parameters:
InputImageInfo Reference to ImageInfo structure with information on the input image data.
OutputImageInfo Reference to ImageInfo structure with information on the output image data.
ProcessingFunction Type of image processing to be performed
Parameters Pointer to an unmanaged structure containing the image processing parameters
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
323
324
Module Documentation
5.36
The Color-Compensation Image Processing algorithms makes it possible artificially enhance the red and/or
green colors near saturation. This is typically used in ITS applications where the cameras are looking at
traffic lights at night time. This will help remove dis-coloration caused by saturation of the colors. The
color compensation can be applied in up to 10 seperate Regions-of-Interests specified in the RectOfROI
parameter structures.
Classes
struct ColorCompensationROIStruct
Structure containing Color-Compensation parameters. This is used for both Red-Compensation and GreenCompensation.
struct RedCompensationStruct
Structure containing Red-Compensation parameters.
struct GreenCompensationStruct
Structure containing Green-Compensation parameters.
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo ImageInfoRef, RedCompensationStruct RedCompensationParameters, bool UseMultiProcessor)
This function performs a Red-Compensation on the image.
static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo ImageInfoRef, GreenCompensationStruct GreenCompensationParameters, bool UseMultiProcessor)
This function performs a Green-Compensation on the image.
5.36.1
Detailed Description
The Color-Compensation Image Processing algorithms makes it possible artificially enhance the red and/or
green colors near saturation. This is typically used in ITS applications where the cameras are looking at
traffic lights at night time. This will help remove dis-coloration caused by saturation of the colors. The
color compensation can be applied in up to 10 seperate Regions-of-Interests specified in the RectOfROI
parameter structures.
5.36.2
Function Documentation
5.36.2.1
Parameters:
ImageInfoRef Reference to ImageInfo structure with information on the image data.
RedCompensationParameters Red-Compensation processing parameters
UseMultiProcessor use multi-processor aware algorithm
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
325
326
Module Documentation
5.36.2.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.37
327
The Lens Distortion Image Processing algorithms makes it possible to correct for Radial Distortion as well
as Tangential Distortion caused by the lens. This is typically used to correct for distortion caused by using
wide-angle lenses. The lens distortion correction parameters are specified in the UndistortStruct
structure and it is only to do lens distortion correction using J_Image_ProcessingEx() since it requires an output image!
Classes
struct UndistortStruct
Structure containing Lens Distortion Correction parameters.
Enumerations
enum EInterpolationType { InterpolationNone = 0, InterpolationBiLinear = 1 }
Functions
static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo InputImageInfoRef,
ref ImageInfo OutputImageInfoRef, UndistortStruct UndistortParameters, bool UseMultiProcessor)
This function performs a Lens Distortion Correction on the image.
5.37.1
Detailed Description
The Lens Distortion Image Processing algorithms makes it possible to correct for Radial Distortion as well
as Tangential Distortion caused by the lens. This is typically used to correct for distortion caused by using
wide-angle lenses. The lens distortion correction parameters are specified in the UndistortStruct
structure and it is only to do lens distortion correction using J_Image_ProcessingEx() since it requires an output image!
5.37.2
5.37.2.1
328
Module Documentation
Enumerator:
InterpolationNone No interpolation. Closest pixel is used instead.
InterpolationBiLinear Bi-linear interpolation is used.
5.37.3
Function Documentation
5.37.3.1
329
myUndistortParam, true);
}
// Free up the image conversion buffer again
error = J_Image_Free(ref ConvImageInfo);
}
...
// When the Lens Distortion Correction is no longer needed then the i
nternal undistort map needs to be release
// by calling Jai_FactoryWrapper.J_Image_ProcessingFree(myUndistortPa
ram);
Parameters:
InputImageInfoRef Reference to ImageInfo structure with information on the input image data.
OutputImageInfoRef Reference to ImageInfo structure with information on the output image data.
UndistortParameters Lens Distortion Correction parameters
UseMultiProcessor use multi-processor aware algorithm
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.37.3.2
This function allocates and initializes an internal undistort map so the following Lens Distortion Correction
calls will be speeded up considerably.
This has to be called once before starting the Lens Distortion Correction and it will have to be called if any
of the correction parameters are changed!
Parameters:
InputImageInfoRef Reference to ImageInfo structure with information on the input image data.
UndistortParameters Lens Distortion Correction parameters
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory
5.37.3.3
This function releases the memory allocated to the internal undistort map.
Parameters:
InputImageInfoRef Reference to ImageInfo structure with information on the input image data.
UndistortParameters Lens Distortion Correction parameters
Returns:
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
330
Module Documentation
5.38
Classes
class CFactory
Factory object class.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.39
Classes
class CCamera
Camera object class used by the Managed Factory.
Modules
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
331
332
Module Documentation
5.40
Classes
class Command
Command class used for scripting feature settings.
class Script
Script class used for feature value scripting.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.41
333
Modules
White-Balance control methods
Zoom and Navigation methods
Asynchronous image recording
Functions
delegate
void
ImageViewWindowDelegate
(CCamera
camera,
Jai_FactoryWrapper.EIVWCallbackType Type, ref Jai_FactoryWrapper.IVWCallbackValue CallbackValue)
Delegate that will be called whenever a View Window event has been detected.
Jai_FactoryWrapper.EFactoryError StartAcquisition ()
Start image transfer inside camera using the GigE Vision stream protocol. This is done using the standard
GigE Vision command AcquisitionStart via GenICam.
Jai_FactoryWrapper.EFactoryError StopAcquisition ()
Stop image transfer inside camera using the GigE Vision stream protocol. This is done using the standard
GigE Vision command AcquisitionStop via GenICam.
Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow, UInt32 BufferCount, UInt32 McIP, IntPtr ChildWindowHandle)
Start image aquisition from the camera using Multi Cast and optionally display the images in a Child
Window.
void StopImageAcquisition ()
Stop image acquisition and close the live view window (if it has been opened).
Jai_FactoryWrapper.EFactoryError StopImageAcquisitionEx ()
Stop image acquisition and close the live view window (if it has been opened).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
334
Module Documentation
Events
Jai_FactoryWrapper.ImageCallBack NewImageDelegate
This delegate will be called for every image captured.
ImageViewWindowDelegate ViewWindowEventDelegate
This delegate will be called for every View Window event.
Properties
UInt32 AcquisitionCount [get, set]
Number of images to capture
StartImageAcquisition().
by
Image
Acquisition.
Must
be
set
before
calling
335
This is the number of frames which have been added to the delivery queue despite the fact that they are
missing one or more packets. This will only happen if the EDataStreamParamCmd.PassCorruptFrames
parameter has been set to true using J_DataStream_SetStreamParam().
5.41.1
Function Documentation
5.41.1.1
Delegate that will be called whenever a View Window event has been detected.
Parameters:
camera CCamera object where this View Window event originates
Type Type of View Window Event
CallbackValue View Window Event value
5.41.1.2
Start image transfer inside camera using the GigE Vision stream protocol. This is done using the standard
GigE Vision command AcquisitionStart via GenICam.
It does NOT set up any Data Stream
StartImageAcquisition() instead.
to
acquire
the
images.
To
do
this
use
See also:
CCamera.StopAcquisition(), CCamera.StartImageAcquisition(Boolean, UInt32)
Returns:
Jai_FactoryWrapper.EFactoryError
5.41.1.3
Stop image transfer inside camera using the GigE Vision stream protocol. This is done using the standard
GigE Vision command AcquisitionStop via GenICam.
This does not free up any Data Stream. To do so use the StopImageAcquisition()
See also:
CCamera.StartAcquisition(), CCamera.StopImageAcquisition()
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
336
Module Documentation
5.41.1.4
Start image aquisition from the camera and optionally display the images in a View Window.
This is an easy way to get images from the camera and optionally display Live Video. The new
View Window is internally create using Jai_FactoryWrapper.J_Image_OpenViewWindow()
and a GigE Vision Stream channel is created internally using Jai_FactoryWrapper.J_Camera_CreateDataStream().
See also:
CCamera.StopImageAcquisition(), CCamera.StartAcquisition(), Jai_FactoryWrapper.J_Image_OpenViewWindow(String, ref Jai_FactoryWrapper.POINT, ref Jai_FactoryWrapper.SIZE, out IntPtr),
Jai_FactoryWrapper.J_Image_OpenStream(IntPtr, UInt32, IntPtr, IntPtr, out IntPtr, UInt32, UInt32)
Parameters:
ShowWindow Display the acquired images in a window or not
BufferCount Number of buffers to be allocated for the image acquisition
Returns:
Jai_FactoryWrapper.EFactoryError
5.41.1.5
Start image aquisition from the camera and optionally display the images inside a Child Window.
This is an easy way to get images from the camera and optionally display Live Video. The Child Window
will be used for the image display. and a GigE Vision Stream channel is created internally using Jai_FactoryWrapper.J_Camera_CreateDataStream().
See also:
CCamera.StopImageAcquisition(), CCamera.StartAcquisition(), Jai_FactoryWrapper.J_Image_OpenViewWindow(String, ref Jai_FactoryWrapper.POINT, ref Jai_FactoryWrapper.SIZE, out IntPtr),
Jai_FactoryWrapper.J_Image_OpenStream(IntPtr, UInt32, IntPtr, IntPtr, out IntPtr, UInt32, UInt32)
Parameters:
ShowWindow Display the acquired images in a window or not
BufferCount Number of buffers to be allocated for the image acquisition
ChildWindowHandle Handle to the Child Window to be used for Inage Display. This Can be
IntPtr.Zero if the display is overlapped.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
337
Start image aquisition from the camera using Multi Cast and optionally display the images in a View
Window.
This is an easy way to get images from the camera and optionally display Live Video. The new
View Window is internally create using Jai_FactoryWrapper.J_Image_OpenViewWindow()
and a GigE Vision Stream channel is created internally using Jai_FactoryWrapper.J_Camera_CreateDataStream().
See also:
CCamera.StopImageAcquisition(), CCamera.StartAcquisition(), Jai_FactoryWrapper.J_Image_OpenViewWindow(String, ref Jai_FactoryWrapper.POINT, ref Jai_FactoryWrapper.SIZE, out IntPtr),
Jai_FactoryWrapper.J_Image_OpenStream(IntPtr, UInt32, IntPtr, IntPtr, out IntPtr, UInt32, UInt32)
Parameters:
ShowWindow Display the acquired images in a window
BufferCount Number of buffers to be allocated for the image acquisition
McIP Multicast IP address
Returns:
Jai_FactoryWrapper.EFactoryError
5.41.1.7
Start image aquisition from the camera using Multi Cast and optionally display the images in a Child
Window.
This is an easy way to get images from the camera and optionally display Live Video. The new
View Window is internally create using Jai_FactoryWrapper.J_Image_OpenViewWindow()
and a GigE Vision Stream channel is created internally using Jai_FactoryWrapper.J_Camera_CreateDataStream().
See also:
CCamera.StopImageAcquisition(), CCamera.StartAcquisition(), Jai_FactoryWrapper.J_Image_OpenViewWindow(String, ref Jai_FactoryWrapper.POINT, ref Jai_FactoryWrapper.SIZE, out IntPtr),
Jai_FactoryWrapper.J_Image_OpenStream(IntPtr, UInt32, IntPtr, IntPtr, out IntPtr, UInt32, UInt32)
Parameters:
ShowWindow Display the acquired images in a window
BufferCount Number of buffers to be allocated for the image acquisition
McIP Multicast IP address
ChildWindowHandle Handle to the Child Window to be used for Inage Display. This Can be
IntPtr.Zero if the display is overlapped.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
338
Module Documentation
5.41.1.8
Stop image acquisition and close the live view window (if it has been opened).
See also:
CCamera.StartImageAcquisition(Boolean, UInt32)
5.41.1.9
Stop image acquisition and close the live view window (if it has been opened).
See also:
CCamera.StartImageAcquisition(Boolean, UInt32)
Returns:
Jai_FactoryWrapper.EFactoryError
5.41.2
Events
5.41.2.1
5.41.2.2
339
5.41.3
Properties
5.41.3.1
by
Image
Acquisition.
Must
be
set
before
calling
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()
5.41.3.2
Enable Image Packet Resend in driver. Must be set before calling StartImageAcquisition().
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()
5.41.3.3
from
driver.
Must
be
set
before
calling
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()
5.41.3.4
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
340
Module Documentation
5.41.3.5
This is the number of acquired frames since the last acquisition start.
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_DataStream_GetStreamInfo() functions return an error
5.41.3.6
This is the number of lost frames due to a queue under-run. If the application is not emptying the acquisition
queue as fast as the queue gets filled then the newly acquired frames will be dropped and this value will be
increased by 1.
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_DataStream_GetStreamInfo() functions return an error
5.41.3.7
This is the number of frame buffers that have been announced to the acquisition engine using J_DataStream_AnnounceBuffer(). This will be the maximum number of frame buffers in the system at any
point in time.
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition(),
FactoryWrapper.J_DataStream_AnnounceBuffer(IntPtr, IntPtr, UInt32, IntPtr, out IntPtr)
Jai_-
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_DataStream_GetStreamInfo() functions return an error
5.41.3.8
This is the number of frame buffers available and ready for image acquisition. When a new frame is
acquired then it will be moved from this queue into the delivery queue and this value will be decreased
by 1. The application can return the frame buffer to this queue using J_DataStream_QueueBuffer() after
handling the new image delivery.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
341
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_DataStream_GetStreamInfo() functions return an error
5.41.3.9
This is the number of frames that have been put into the delivery queue and are ready to be read and
processed by the application. When the application gets the image using J_Event_GetData() then the frame
buffer will automatically be removed from this delivery queue and the application then have to manually
call J_DataStream_QueueBuffer() to return the buffer to the acquisition queue again.
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_DataStream_GetStreamInfo() functions return an error
5.41.3.10
This is the number of frames which have been added to the delivery queue despite the fact that they are
missing one or more packets. This will only happen if the EDataStreamParamCmd.PassCorruptFrames
parameter has been set to true using J_DataStream_SetStreamParam().
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_DataStream_GetStreamInfo() functions return an error
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
342
Module Documentation
5.42
Functions
void SetGain (uint redGain, uint greenGain, uint blueGain)
Set the white balance gain values used for the image acquisition and live video display.
void GetGain (ref uint redGain, ref uint greenGain, ref uint blueGain)
Get the white balance gain values used for the image acquisition and live video display.
void ExecuteWhiteBalance (int AWBXOffset, int AWBYOffset, int AWBWidth, int AWBHeight)
Execute an automatic white balance calculation and read the resulting gain values and used them for the
mage acquisition and the live video display.
5.42.1
Function Documentation
5.42.1.1
Set the white balance gain values used for the image acquisition and live video display.
These values are only used if the camera is sending Bayer images
Parameters:
redGain Gain of the red channel
greenGain Gain of the green channel
blueGain Gain of the blue channel
5.42.1.2
void GetGain (ref uint redGain, ref uint greenGain, ref uint blueGain) [inherited]
Get the white balance gain values used for the image acquisition and live video display.
These values are only used if the camera is sending Bayer images
Parameters:
redGain Gain of the red channel
greenGain Gain of the green channel
blueGain Gain of the blue channel
5.42.1.3
Execute an automatic white balance calculation and read the resulting gain values and used them for the
mage acquisition and the live video display.
The image acquisition needs to be started in advance using StartImageAcquisition()
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
343
344
Module Documentation
5.43
Events
Jai_FactoryWrapper.ConnectionStatusCallBack NewConnectionStatusDelegate
This delegate will be called for every change in Connection Status.
5.43.1
Events
5.43.1.1
Jai_FactoryWrapper.ConnectionStatusCallBack NewConnectionStatusDelegate
[inherited]
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.44
Events
Jai_FactoryWrapper.GEVEventCallBack GEVEventDelegate
This delegate will be called for every new GigE Vision event received from the camera.
5.44.1
Events
5.44.1.1
This delegate will be called for every new GigE Vision event received from the camera.
// To attach to the GEVEventDelegate you have to do like this:
myCamera.GEVEventDelegate += new GEVEventCallBack(myLocalGEVEventFunc
tion);
void myLocalGEVEventFunction(CCamera camera, UInt16 EventID, UInt16 S
treamChannelIndex, UInt16 BlockID, UInt64 Timestamp, byte[] EventData)
{
// Do something with the new GigE Vision event
}
// To remove the delegate again you have to do like this:
myCamera.GEVEventDelegate -= new GEVEventCallBack(myLocalGEVEventFunc
tion);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
345
346
Module Documentation
5.45
Events
Jai_FactoryWrapper.NodeEventCallBack NodeEventDelegate
This delegate will be called for every time a node callback has been called from GenICam node tree All
nodes with an EventID associated will automatically get a callback registered.
5.45.1
Events
5.45.1.1
This delegate will be called for every time a node callback has been called from GenICam node tree All
nodes with an EventID associated will automatically get a callback registered.
// To attach to the NodeEventDelegate you have to do like this:
myCamera.NodeEventDelegate += new NodeEventCallBack(myLocalNodeEventF
unction);
void myLocalNodeEventFunction(CNode node)
{
// Do something with the new Node event
}
// To remove the delegate again you have to do like this:
myCamera.NodeEventDelegate -= new NodeEventCallBack(myLocalNodeEventF
unction);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.46
347
Scripting methods
Modules
Scripting and Command Classes
Enumerations
enum RunScriptResult {
Success = 0, CameraNotOpen = 1, CameraReadOnly = 2, ScriptAlreadyRunning = 3,
UnableToLoadScript = 4, ValidationError = 5, ScriptCreateError = 6 }
Return value enumeration when running feature scripts.
Functions
string GetScriptErrorString ()
Returns the last error detected during load and/or validation of the script selected by RunScript() or ValidateScript().
int GetScriptProgress ()
Get the current progress (between 0 and 100) of the running script. It will return -1 if no script is running.
Command GetScriptLastCommand ()
Get the Last Executed command of the running script. It will return null if no script is running.
Script CreateSettingsScript ()
Create a script that contains the complete camera settings that can be saved and later restored.
5.46.1
5.46.1.1
348
Module Documentation
Enumerator:
Success Success - everything OK.
CameraNotOpen Camera not open error.
CameraReadOnly Camera is opened as Read Only.
ScriptAlreadyRunning Script already running.
UnableToLoadScript Unable to load the Script from file.
ValidationError Error during validation of the script contents.
ScriptCreateError Unable to create the Script Thread.
5.46.2
Function Documentation
5.46.2.1
Returns the last error detected during load and/or validation of the script selected by RunScript() or ValidateScript().
Returns:
Error string if an error occcured. Else it returns an empty string.
5.46.2.2
This validates the contents of a Script file (checks if the features exists and that the values are within
legal range). If an error is detected an error description string will be created. It can be retrieved using
GetScriptErrorString().
Parameters:
script Script to be validated
Returns:
True if the script is valid. False if a validation error is detected. Use GetScriptErrorString() to get any
warning messages.
5.46.2.3
Get the current progress (between 0 and 100) of the running script. It will return -1 if no script is running.
Returns:
-1 if script is nut running. Otherwise [0-100]
5.46.2.4
Get the Last Executed command of the running script. It will return null if no script is running.
Returns:
null if script is nut running. Otherwise last command object
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
349
Run feature value script and update values in the camera. If an error is returned then a description of the
error can be retrieved using GetScriptErrorString().
Parameters:
filename Filename of the script to be run
Returns:
5.46.2.6
Run feature value script and update values in the camera. If an error is returned then a description of the
error can be retrieved using GetScriptErrorString().
Parameters:
script Script to be run
Returns:
5.46.2.7
Create a script that contains the complete camera settings that can be saved and later restored.
Returns:
Script with all camera settings
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
350
Module Documentation
5.47
Functions
Jai_FactoryWrapper.EFactoryError WriteRegister (Int64 address, UInt32 value)
Write a DWORD register value directly to the camera. This does not involve GenICam.
5.47.1
Function Documentation
5.47.1.1
Write a DWORD register value directly to the camera. This does not involve GenICam.
Parameters:
address Register address
value Value to be written
Returns:
Jai_FactoryWrapper.EFactoryError
5.47.1.2
Read a DWORD register directly from the camera. This does not involve GenICam.
Parameters:
address Register address
value Reference to a variable where the register value will be written
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.48
351
Functions
object GetNodeValue (string nodeName)
Get the current value of a named GenICam node.
5.48.1
Function Documentation
5.48.1.1
5.48.1.2
5.48.1.3
352
Module Documentation
Parameters:
ParentFeatureName Name of the parent feature
Returns:
A List of CNode-type object
// C# Sample that runs throug the node tree
EFactoryError error = EFactoryError.Success;
// Build a list of features
List<CNode> rootNodeList = Camera.GetSubFeatures("Root");
foreach (CNode n in rootNodeList)
{
if (n.NodeType == Jai_FactoryWrapper.EConfNodeType.ICategory)
{
List<Node> childNodeList = Camera.GetSubFeatures(n.Name);
foreach (CNode cn in childNodeList)
{
... do something with the node
}
}
else
{
... do something with the node
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.49
353
Functions
Jai_FactoryWrapper.EFactoryError SaveNextFrame (string FileName)
Save the next frame from the camera to disk as a tiff image.
Jai_FactoryWrapper.EFactoryError
SaveNextFrame
(string
FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
FileName,
Jai_-
Jai_FactoryWrapper.EFactoryError
SaveLastFrame
(string
FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
FileName,
Jai_-
Save the last frame received from the camera to disk. This image might have transformations and a LUT
applied!
Jai_FactoryWrapper.EFactoryError
SaveLastRawFrame
(string
FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
FileName,
Jai_-
5.49.1
Function Documentation
5.49.1.1
Save the next frame from the camera to disk as a tiff image.
Parameters:
FileName File name and path of the image to be saved.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
354
Module Documentation
5.49.1.2
5.49.1.3
Save the last frame received from the camera to disk as a tiff image. This image might have transformations
and a LUT applied!
Parameters:
FileName File name and path of the image to be saved.
Returns:
Jai_FactoryWrapper.EFactoryError
5.49.1.4
Save the last frame received from the camera to disk as a tiff image.
Parameters:
FileName File name and path of the image to be saved.
Returns:
Jai_FactoryWrapper.EFactoryError
5.49.1.5
Save the last frame received from the camera to disk. This image might have transformations and a LUT
applied!
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
355
Parameters:
FileName File name and path of the image to be saved.
FileFormat File format to be used.
EncoderParameter File format specific encoder parameter. If Jpeg file format is selected this parameter specifies the Quality level for the jpeg file. Acceptable value range is 1 to 100, default is 75,
5-95 is useful range. Larger number goes toward higher quality and larger file size.
Returns:
Jai_FactoryWrapper.EFactoryError
5.49.1.6
5.49.1.7
Save the last frame received from the camera to disk as a raw binary file. This image might have transformations and a LUT applied!
Parameters:
FileName File name and path of the image to be saved.
Returns:
Jai_FactoryWrapper.EFactoryError
5.49.1.8
Save the last frame received from the camera to disk as a raw binary file.
Parameters:
FileName File name and path of the image to be saved.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
356
Module Documentation
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.50
357
Functions
Jai_FactoryWrapper.EFactoryError ZoomIn ()
Zoom in on the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true. This will zoom in using
the minimal step size.
Jai_FactoryWrapper.EFactoryError ZoomOut ()
Zoom out on the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true. This will zoom out using
the minimal step size.
Jai_FactoryWrapper.EFactoryError ZoomReset ()
Remove the zoom of the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true.
Jai_FactoryWrapper.EFactoryError NavigateLeftUp ()
Navigate Left and Up using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateUp ()
Navigate Up using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateRightUp ()
Navigate Right and Up using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateLeft ()
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
358
Module Documentation
Navigate Left using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateCenter ()
Navigate back to the center of the image.
Jai_FactoryWrapper.EFactoryError NavigateRight ()
Navigate Right using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateLeftDown ()
Navigate Left and Down using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateDown ()
Navigate Down using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateRightDown ()
Navigate Right and Down using minimum step size (a single pixel).
5.50.1
Function Documentation
5.50.1.1
Zoom in on the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true. This will zoom in using
the minimal step size.
This is only possible if the StretchLiveVideo property is enabled.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
359
Zoom in on the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true. This will zoom in using
the specified step size.
This is only possible if the StretchLiveVideo property is enabled.
Parameters:
zoomSpeed Zoom step size. Zoom range is between 1 and 100
Returns:
Jai_FactoryWrapper.EFactoryError
5.50.1.3
Zoom out on the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true. This will zoom out
using the minimal step size.
This is only possible if the StretchLiveVideo property is enabled.
Returns:
Jai_FactoryWrapper.EFactoryError
5.50.1.4
Zoom out on the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true. This will zoom out
using the specified step size.
This is only possible if the StretchLiveVideo property is enabled.
Parameters:
zoomSpeed Zoom step size. Zoom range is between 1 and 100
Returns:
Jai_FactoryWrapper.EFactoryError
5.50.1.5
Remove the zoom of the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true.
This is only possible if the StretchLiveVideo property is enabled.
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
360
Module Documentation
5.50.1.6
Zoom the Live Video Window display to an absolute zoom position. The Live Video Window display is
opened using StartImageAcquisition() with the ShowWindow parameter set to true.
This is only possible if the StretchLiveVideo property is enabled.
Parameters:
zoomPosition Absolut zoom position. Zoom range is between 1 and 100
Returns:
Jai_FactoryWrapper.EFactoryError
5.50.1.7
5.50.1.8
5.50.1.9
361
Returns:
Jai_FactoryWrapper.EFactoryError
5.50.1.10
5.50.1.11
5.50.1.12
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
362
Module Documentation
5.50.1.13
5.50.1.14
5.50.1.15
5.50.1.16
363
Returns:
Jai_FactoryWrapper.EFactoryError
5.50.1.17
5.50.1.18
Navigate Left and Down using minimum step size (a single pixel).
This will change the Live Video Window display position when the Video has been zoomed in. The
Live Video Window display is opened using StartImageAcquisition() with the ShowWindow
parameter set to true.
This is only possible if the StretchLiveVideo property is enabled.
Returns:
Jai_FactoryWrapper.EFactoryError
5.50.1.19
Navigate Left and Down using specified step size (in pixels).
This will change the Live Video Window display position when the Video has been zoomed in. The
Live Video Window display is opened using StartImageAcquisition() with the ShowWindow
parameter set to true.
This is only possible if the StretchLiveVideo property is enabled.
Parameters:
stepSize
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
364
Module Documentation
5.50.1.20
5.50.1.21
5.50.1.22
Navigate Right and Down using minimum step size (a single pixel).
This will change the Live Video Window display position when the Video has been zoomed in. The
Live Video Window display is opened using StartImageAcquisition() with the ShowWindow
parameter set to true.
This is only possible if the StretchLiveVideo property is enabled.
Returns:
Jai_FactoryWrapper.EFactoryError
5.50.1.23
Navigate Right and Down using specified step size (in pixels).
This will change the Live Video Window display position when the Video has been zoomed in. The
Live Video Window display is opened using StartImageAcquisition() with the ShowWindow
parameter set to true.
This is only possible if the StretchLiveVideo property is enabled.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
365
366
Module Documentation
5.51
Functions
int EstimatedInterPacketDelay (double maxFramesPerSecond)
This function estimate an initial Inter-Packet Delay value to be used with this camera. This value has to be
thought of as a starting point for finding the optimal Inter-Packet Delay value for a multi-camera system.
The calculation is based on the assumption that if the stream channel communication is spread over time
as much as possible using the Inter-Packet Delay - but only so much that the maximum specified frame rate
still can be achieved, then the camera will have the minimal impact on the communication from the other
cameras connected on the same Gigabit Ethernet network.
int EstimatedInterPacketDelay
WidthUsagePercentage)
(double
maxFramesPerSecond,
double
expectedBand-
This function estimate an initial Inter-Packet Delay value to be used with this camera. This value has to be
thought of as a starting point for finding the optimal Inter-Packet Delay value for a multi-camera system.
The calculation is based on the assumption that if the stream channel communication is spread over time
as much as possible using the Inter-Packet Delay - but only so much that the maximum specified frame rate
still can be achieved, then the camera will have the minimal impact on the communication from the other
cameras connected on the same Gigabit Ethernet network.
5.51.1
Function Documentation
5.51.1.1
This function estimate an initial Inter-Packet Delay value to be used with this camera. This value has to be
thought of as a starting point for finding the optimal Inter-Packet Delay value for a multi-camera system.
The calculation is based on the assumption that if the stream channel communication is spread over time as
much as possible using the Inter-Packet Delay - but only so much that the maximum specified frame rate
still can be achieved, then the camera will have the minimal impact on the communication from the other
cameras connected on the same Gigabit Ethernet network.
A little overhead should always be reserved for retransmissions for the image stream so it is set to the
default of 95.0%
Parameters:
maxFramesPerSecond Maximum frame-rate to be expected from the camera.
Returns:
New Inter-Packet Delay value
5.51.1.2
This function estimate an initial Inter-Packet Delay value to be used with this camera. This value has to be
thought of as a starting point for finding the optimal Inter-Packet Delay value for a multi-camera system.
The calculation is based on the assumption that if the stream channel communication is spread over time as
much as possible using the Inter-Packet Delay - but only so much that the maximum specified frame rate
still can be achieved, then the camera will have the minimal impact on the communication from the other
cameras connected on the same Gigabit Ethernet network.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
367
A little overhead should always be reserved for retransmissions for the image stream so it is not adviced to
use 100% as the Expected Bandwidth usage. A typical value would be around 95%
Parameters:
maxFramesPerSecond Maximum frame-rate to be expected from the camera.
expectedBandWidthUsagePercentage Expected bandwidth usage for this camera.
Returns:
New Inter-Packet Delay value
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
368
Module Documentation
5.52
Functions
Jai_FactoryWrapper.EFactoryError StartAsyncImageRecording (int count, AsyncImageRecordingMode mode, int skipCount)
Records multiple raw images into memory. The images will be stores and can be accessed later using
GetRecordedImage() or GetRecordedImages().
Jai_FactoryWrapper.EFactoryError StopAsyncImageRecording ()
Stop a previously started Asynchronous Image recording.
Jai_FactoryWrapper.EFactoryError
GetAsyncRecordedImage
FactoryWrapper.ImageInfo pImageInfo)
(int
index,
ref
Jai_-
Get one of the images that has been recorded asynchronously. If the index is wrong this function will return
null.
void FreeAsyncRecordedImages ()
Free up all the images that has been captured.
Events
AsyncImageRecordingDoneHandler AsyncImageRecordingDoneEvent
This event will be called when asynchronous image recording has finished.
Properties
int AsyncImageRecordingSkipCount [get]
Get the number of Images to be skipped during the recording.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.52.1
Function Documentation
5.52.1.1
369
Records multiple raw images into memory. The images will be stores and can be accessed later using
GetRecordedImage() or GetRecordedImages().
The image recording will be stopped automatically if we are unable to allocate new memory to hold the
recorded frames.
Parameters:
count Number of frames to be recorded. If this parameter is 0 the Image Recording will be cancelled
and all images will be freed.
mode Recording mode. Either List or Cyclic
skipCount Number of frames to be skipped during the Asynchronous Image Recording
Returns:
Jai_FactoryWrapper.EFactoryError
5.52.1.2
5.52.1.3
5.52.1.4
Get one of the images that has been recorded asynchronously. If the index is wrong this function will return
null.
Parameters:
index Zero-based index of the recorded image
pImageInfo Reference to an ImageInfo structure
Returns:
Jai_FactoryWrapper.EFactoryError
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
370
Module Documentation
5.52.1.5
5.52.1.6
5.52.2
Events
5.52.2.1
This event will be called when asynchronous image recording has finished.
// To attach to the AsyncImageRecordingDoneHandler you have to do lik
e this:
myCamera.AsyncImageRecordDoneEvent += new CCamera.AsyncImageRecording
DoneHandler(myLocalRecordImageDoneFunction);
void myLocalRecordImageDoneFunction(int count)
{
// Do something with the captured images
}
// To remove the event again you have to do like this:
myCamera.AsyncImageRecordDoneEvent -= new CCamera.AsyncImageRecording
DoneHandler(myLocalRecordImageDoneFunction);
5.52.3
Properties
5.52.3.1
5.52.3.2
5.52.3.3
Get total number of images already recorded using the StartAsyncImageRecording() method.
This number can be used for calculating the current Image Recording progress
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
371
372
Module Documentation
5.53
Classes
class CNode
GenICam Node object class used by the Managed Factory.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
5.54
These classes makes it possible to use the JAI SDK without accessing the Wrapper Functions directly.
Modules
The CFactory Class
The CCamera Class
The CNode Class
5.54.1
Detailed Description
These classes makes it possible to use the JAI SDK without accessing the Wrapper Functions directly.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
373
374
Module Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Chapter 6
Class Documentation
6.1
Public Attributes
UInt16 Status
GEV.STATUS of the ACK.
UInt16 Type
GEV.GVCP of the packet.
UInt16 Length
Number of bytes after the header.
UInt16 ID
ACK ID to match incomming CMD.
UInt32 IPAddress
IP address of the device that sent the Action Command Acknowledge.
6.1.1
Detailed Description
6.1.2
6.1.2.1
UInt16 Status
376
Class Documentation
6.1.2.2
UInt16 Type
UInt16 Length
UInt16 ID
UInt32 IPAddress
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.2
377
Public Attributes
IntPtr Base
Frame Data Base address read with J_DataStream_GetBufferInfo(EBufferInfoCmd.BASE).
UInt32 Size
Size in bytes read with J_DataStream_GetBufferInfo(EBufferInfoCmd.SIZE).
IntPtr UserPointer
User pointer read with J_DataStream_GetBufferInfo(EBufferInfoCmd.USER_PTR).
UInt64 TimeStamp
Timestamp read with J_DataStream_GetBufferInfo(EBufferInfoCmd.TIMESTAMP).
UInt64 BufferNumber
Buffer Number as announced read with J_DataStream_GetBufferInfo(EBufferInfoCmd.NUMBER).
Boolean NewData
Flag indicating new data in buffer since it was queued read with J_DataStream_GetBufferInfo(EBufferInfoCmd.NEW_DATA).
Boolean IsQueued
Flag
indication
if
the
buffer
is
queued
GetBufferInfo(EBufferInfoCmd.ISQUEUED).
read
with
J_DataStream_-
UInt32 PayloadType
Payload Type from GigE Vision Stream Protocol
GetBufferInfo(EBufferInfoCmd.PAYLOADTYPE).
read
with
J_DataStream_-
read
with
J_DataStream_-
EPixelFormatType PixelFormat
Pixel
Type
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.PIXELTYPE).
UInt32 Width
Width
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.WIDTH).
read
with
J_DataStream_-
read
with
J_DataStream_-
with
J_DataStream_-
UInt32 Height
Height
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.HEIGHT).
UInt32 XOffset
X
Offset
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.XOFFSET).
UInt32 YOffset
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
read
378
Class Documentation
Y
Offset
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.YOFFSET).
read
with
J_DataStream_-
read
with
J_DataStream_-
read
with
J_DataStream_-
Number
of
packets
missing
in
the
frame
read
GetBufferInfo(EBufferInfoCmd.NUM_PACKETS_MISSING).
with
J_DataStream_-
UInt32 XPadding
X
Padding
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.XPADDING).
UInt32 YPadding
Y
Padding
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.YPADDING).
UInt32 MissingPackets
UInt32 AwaitDelivery
Number of packets Awaiting Delivery from the driver.
UInt32 BlockId
Block-ID from the GigE Vision Stream Protocol.
6.2.1
Detailed Description
6.2.2
6.2.2.1
IntPtr Base
UInt32 Size
IntPtr UserPointer
UInt64 TimeStamp
UInt64 BufferNumber
379
Boolean NewData
Flag indicating new data in buffer since it was queued read with J_DataStream_GetBufferInfo(EBufferInfoCmd.NEW_DATA).
6.2.2.7
Boolean IsQueued
Flag
indication
if
the
buffer
is
queued
GetBufferInfo(EBufferInfoCmd.ISQUEUED).
6.2.2.8
read
with
J_DataStream_-
read
with
J_DataStream_-
read
with
J_DataStream_-
read
with
J_DataStream_-
read
with
J_DataStream_-
read
with
J_DataStream_-
UInt32 YOffset
Y
Offset
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.YOFFSET).
6.2.2.14
J_DataStream_-
UInt32 XOffset
X
Offset
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.XOFFSET).
6.2.2.13
with
UInt32 Height
Height
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.HEIGHT).
6.2.2.12
read
UInt32 Width
Width
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.WIDTH).
6.2.2.11
J_DataStream_-
EPixelFormatType PixelFormat
Pixel
Type
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.PIXELTYPE).
6.2.2.10
with
UInt32 PayloadType
6.2.2.9
read
UInt32 XPadding
X
Padding
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.XPADDING).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
380
Class Documentation
6.2.2.15
UInt32 YPadding
Y
Padding
from
GigE
Vision
Stream
Protocol
GetBufferInfo(EBufferInfoCmd.YPADDING).
with
J_DataStream_-
Number
of
packets
missing
in
the
frame
read
with
GetBufferInfo(EBufferInfoCmd.NUM_PACKETS_MISSING).
J_DataStream_-
6.2.2.16
6.2.2.17
read
UInt32 MissingPackets
UInt32 AwaitDelivery
UInt32 BlockId
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.3
381
Classes
class Command
Command class used for scripting feature settings.
class Script
Script class used for feature value scripting.
Public Types
enum AsyncImageRecordingMode { List = 0, CyclicBuffer = 1 }
Specify the asynchronous image recording mode.
enum RunScriptResult {
Success = 0, CameraNotOpen = 1, CameraReadOnly = 2, ScriptAlreadyRunning = 3,
UnableToLoadScript = 4, ValidationError = 5, ScriptCreateError = 6 }
Return value enumeration when running feature scripts.
Jai_FactoryWrapper.EFactoryError Open ()
Opens the connection to the camera.
Jai_FactoryWrapper.EFactoryError
Open
FactoryWrapper.EDeviceAccessFlags OpenFlags, UInt32 McIP)
(Jai_FactoryDotNET.Jai_-
Jai_FactoryWrapper.EFactoryError Close ()
Closes a previously opened connection to the camera.
delegate
void
ImageViewWindowDelegate
(CCamera
camera,
Jai_FactoryWrapper.EIVWCallbackType Type, ref Jai_FactoryWrapper.IVWCallbackValue CallbackValue)
Delegate that will be called whenever a View Window event has been detected.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
382
Class Documentation
Jai_FactoryWrapper.EFactoryError StartAcquisition ()
Start image transfer inside camera using the GigE Vision stream protocol. This is done using the standard
GigE Vision command AcquisitionStart via GenICam.
Jai_FactoryWrapper.EFactoryError StopAcquisition ()
Stop image transfer inside camera using the GigE Vision stream protocol. This is done using the standard
GigE Vision command AcquisitionStop via GenICam.
Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow, UInt32 BufferCount, UInt32 McIP, IntPtr ChildWindowHandle)
Start image aquisition from the camera using Multi Cast and optionally display the images in a Child
Window.
void StopImageAcquisition ()
Stop image acquisition and close the live view window (if it has been opened).
Jai_FactoryWrapper.EFactoryError StopImageAcquisitionEx ()
Stop image acquisition and close the live view window (if it has been opened).
void GetGain (ref uint redGain, ref uint greenGain, ref uint blueGain)
Get the white balance gain values used for the image acquisition and live video display.
void ExecuteWhiteBalance (int AWBXOffset, int AWBYOffset, int AWBWidth, int AWBHeight)
Execute an automatic white balance calculation and read the resulting gain values and used them for the
mage acquisition and the live video display.
string GetScriptErrorString ()
Returns the last error detected during load and/or validation of the script selected by RunScript() or ValidateScript().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
383
int GetScriptProgress ()
Get the current progress (between 0 and 100) of the running script. It will return -1 if no script is running.
Command GetScriptLastCommand ()
Get the Last Executed command of the running script. It will return null if no script is running.
Script CreateSettingsScript ()
Create a script that contains the complete camera settings that can be saved and later restored.
Jai_FactoryWrapper.EFactoryError
SaveNextFrame
(string
FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
FileName,
Jai_-
Jai_FactoryWrapper.EFactoryError
SaveLastFrame
(string
FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
FileName,
Jai_-
Save the last frame received from the camera to disk. This image might have transformations and a LUT
applied!
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
384
Class Documentation
Jai_FactoryWrapper.EFactoryError
SaveLastRawFrame
(string
FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
FileName,
Jai_-
Jai_FactoryWrapper.EFactoryError ZoomIn ()
Zoom in on the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true. This will zoom in using
the minimal step size.
Jai_FactoryWrapper.EFactoryError ZoomOut ()
Zoom out on the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true. This will zoom out using
the minimal step size.
Jai_FactoryWrapper.EFactoryError ZoomReset ()
Remove the zoom of the Live Video Window display. The Live Video Window display is opened using
StartImageAcquisition() with the ShowWindow parameter set to true.
Jai_FactoryWrapper.EFactoryError NavigateLeftUp ()
Navigate Left and Up using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateUp ()
Navigate Up using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateRightUp ()
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
385
Jai_FactoryWrapper.EFactoryError NavigateLeft ()
Navigate Left using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateCenter ()
Navigate back to the center of the image.
Jai_FactoryWrapper.EFactoryError NavigateRight ()
Navigate Right using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateLeftDown ()
Navigate Left and Down using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateDown ()
Navigate Down using minimum step size (a single pixel).
Jai_FactoryWrapper.EFactoryError NavigateRightDown ()
Navigate Right and Down using minimum step size (a single pixel).
int EstimatedInterPacketDelay
WidthUsagePercentage)
(double
maxFramesPerSecond,
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
double
expectedBand-
386
Class Documentation
This function estimate an initial Inter-Packet Delay value to be used with this camera. This value has to be
thought of as a starting point for finding the optimal Inter-Packet Delay value for a multi-camera system.
The calculation is based on the assumption that if the stream channel communication is spread over time
as much as possible using the Inter-Packet Delay - but only so much that the maximum specified frame rate
still can be achieved, then the camera will have the minimal impact on the communication from the other
cameras connected on the same Gigabit Ethernet network.
Jai_FactoryWrapper.EFactoryError StopAsyncImageRecording ()
Stop a previously started Asynchronous Image recording.
Jai_FactoryWrapper.EFactoryError
GetAsyncRecordedImage
FactoryWrapper.ImageInfo pImageInfo)
(int
index,
ref
Jai_-
Get one of the images that has been recorded asynchronously. If the index is wrong this function will return
null.
void FreeAsyncRecordedImages ()
Free up all the images that has been captured.
Public Attributes
IntPtr FactoryHandle = IntPtr.Zero
Factory Handle to be used in the Jai_FactoryWrapper functions (such as Jai_FactoryWrapper.J_Factory_Open(),
Jai_FactoryWrapper.J_Factory_Close()
and
Jai_FactoryWrapper.J_Factory_UpdateCameraList()).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
387
Properties
object Tag [get, set]
Camera Tag This tag can be used for storing any object related to the camera.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
388
Class Documentation
UInt32 TotalMissingPackets [get, set]
Total number of missing packets from the received images. This value can be reset by manually setting the
value to 0.
389
390
Class Documentation
Jai_FactoryWrapper.EColorInterpolationAlgorithm
set]
ColorInterpolationAlgorithm [get,
391
by
Image
Acquisition.
Must
be
set
before
calling
392
Class Documentation
Is the Asynchronous Image Recording running?
Events
Jai_FactoryWrapper.ImageCallBack NewImageDelegate
This delegate will be called for every image captured.
ImageViewWindowDelegate ViewWindowEventDelegate
This delegate will be called for every View Window event.
Jai_FactoryWrapper.ConnectionStatusCallBack NewConnectionStatusDelegate
This delegate will be called for every change in Connection Status.
Jai_FactoryWrapper.GEVEventCallBack GEVEventDelegate
This delegate will be called for every new GigE Vision event received from the camera.
Jai_FactoryWrapper.NodeEventCallBack NodeEventDelegate
This delegate will be called for every time a node callback has been called from GenICam node tree All
nodes with an EventID associated will automatically get a callback registered.
AsyncImageRecordingDoneHandler AsyncImageRecordingDoneEvent
This event will be called when asynchronous image recording has finished.
6.3.1
Detailed Description
6.3.2
6.3.2.1
enum AsyncImageRecordingMode
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
393
enum EDeviceClass
GigE Vision device class. This enumeration contains all valid Device Classes supported by GigE Vision
1.2 and higher.
Enumerator:
Transmitter Transmitter. This is the default device class that typically is a camera.
Receiver Receiver. This is a device that is capable of receiving GVSP stream data.
Transceiver Transceiver. This is a device that is capable of both transmitting and receiving GVSP
stream data. This is typically a device that is capable of doing real-time image processing on a
GVSP stream from a camera and sending out the resulting stream to another Receiver.
Peripheral Peripheral. This is the device class without any stream capability - typically a GPIO
device that for instance can be used as a strobe controller.
6.3.3
6.3.3.1
ID
string
returned
6.3.4
6.3.4.1
Jai_FactoryWrapper.EFactoryError Open ()
by
Jai_FactoryWrapper.J_Factory_-
6.3.4.2
394
Class Documentation
When the camera has been sucessfully opened all the configuration properties will be read automatically.
It will also be detected if the camera will be sending Bayer coded color images or not.
See also:
CCamera.IsBayerCamera
Parameters:
OpenFlags Device access Flags
McIP Multicast IP address
Returns:
Jai_FactoryWrapper.EFactoryError
6.3.4.3
Jai_FactoryWrapper.EFactoryError Close ()
6.3.5
6.3.5.1
6.3.5.2
6.3.5.3
395
View Window Handle to be used in the Jai_FactoryWrapper functions (such as J_Image_ShowImage(), J_Image_SetImageOffset() and J_Image_MoveViewWindow()).
Stream Handle to be used in the Jai_FactoryWrapper functions
6.3.6
Property Documentation
6.3.6.1
Camera Tag This tag can be used for storing any object related to the camera.
6.3.6.2
Average frames recieved per second. This values is automatically updated when Image Aquisition is active.
6.3.6.3
Average frames displayed in the Live Video window per second. This can be less than the number of
frames received per second if the SkipImageDisplayWhenBusy is set to True. This values is automatically
updated when Image Aquisition is active.
6.3.6.4
Image Size in bytes for the last received image. This will be overwritten when the next images is received.
6.3.6.5
Offset X for the last received image. This will be overwritten when the next images is received.
6.3.6.6
Size Y for the last received image. This will be overwritten when the next images is received.
6.3.6.7
Offset X for the last received image. This will be overwritten when the next images is received.
6.3.6.8
Offset Y for the last received image. This will be overwritten when the next images is received.
6.3.6.9
Timestamp from the last received image. This timestamp will be overwritten when the next images is
received.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
396
Class Documentation
The unit of the timestamp is "Timestamp Ticks" specific to the camera. The Timestamp tick frequency can
be read from the camera using GenICam node GevTimestampTickFrequency
6.3.6.10
Timestamp from the last received image in Milliseconds. This timestamp will be overwritten when the next
images is received.
6.3.6.11
Block ID from the GigE Vision Stream for the last received image. This Block ID will be overwritten when
the next images is received.
6.3.6.12
The unit of the TimeStamp value specific to the camera. The Timestamp tick frequency can be read from
the camera using GenICam node GevTimestampTickFrequency.
6.3.6.13
Number of missing packets from the last received frame. This value will be overwritten when the next
images is received.
6.3.6.14
Total number of images received. This value can be reset by assigning 0 to the value.
6.3.6.15
Total number of missing packets from the received images. This value can be reset by manually setting the
value to 0.
6.3.6.16
Stretch the images from the cameras in the Live Video window.
6.3.6.17
6.3.6.18
397
Automatically save and restore the Live Video Window position and size when Image Acquisition is started.
The position and size will be saved individually for each camera when Image Acquisition is stopped.
6.3.6.20
Skips the images display from the camera in the Live Video window if the image acquisition buffer in the
Stream Channel is running full. The images will then only be displayed if no buffers are awaiting delivery.
6.3.6.22
Rotate the image before displaying it. The rotation is determined by RotationType.
6.3.6.23
Select the type of rotation to be performed on the image before displaying it.
6.3.6.24
Flag showing if the camera connection has been opened as ReadOnly or not.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
398
Class Documentation
6.3.6.30
Current connection status for the camera. This status is maintained based on events from the Transport
Layer.
Notifications
on
changes
in
the
connection
CCamera.NewConnectionStatusDelegate delegate
6.3.6.31
status
is
done
by
the
6.3.6.32
Flag showing if the last received frame is stored so it can be saved later using SaveLastFrame().
6.3.6.33
Get a copy of the last received frame (after any processing such as transformations and LUT has been
applied).
6.3.6.34
Get a copy of the last received frame directly from the camera.
6.3.6.35
Flag showing if the camera is sending images in Bayer format to the PC.
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to the Jai_FactoryWrapper
functions return an error
6.3.6.36
6.3.6.37
399
Manufacturer Name obtained using the J_Factory_GetCameraInfo(). The camera connection does
not need to be opened before this information is available.
6.3.6.39
Model Name obtained using the J_Factory_GetCameraInfo(). The camera connection does not
need to be opened before this information is available.
6.3.6.40
GigE Vision Device Class. This indicated the streaming capabilities of the device introduced in GigE
Vision 1.2.
6.3.6.41
IP Address obtained using the J_Factory_GetCameraInfo(). The camera connection does not need
to be opened before this information is available.
6.3.6.42
MAC address obtained using the J_Factory_GetCameraInfo(). The camera connection does not
need to be opened before this information is available.
6.3.6.43
Used-defined Name obtained using the J_Factory_GetCameraInfo(). The camera connection does
not need to be opened before this information is available.
6.3.6.44
Serial Number obtained using the J_Factory_GetCameraInfo(). The camera connection does not
need to be opened before this information is available.
6.3.6.45
Interface ID obtained using the J_Factory_GetCameraInfo(). The camera connection does not
need to be opened before this information is available.
6.3.6.46
Drivertype derived from the CCamera.InterfaceID string (For instance SocketDriver or FilterDriver).
6.3.6.47
400
6.3.6.48
Class Documentation
string ConfigModelName [get]
Model Name read from the Configuration file (XML-file) when the camera connection has been opened.
6.3.6.49
Vendor Name read from the Configuration file (XML-file) when the camera connection has been opened.
6.3.6.50
Tooltip read from the Configuration file (XML-file) when the camera connection has been opened.
6.3.6.51
Standard Name Space read from the Configuration file (XML-file) when the camera connection has been
opened.
6.3.6.52
GenApi Version read from the Configuration file (XML-file) when the camera connection has been opened.
6.3.6.53
GenICam Schema Version read from the Configuration file (XML-file) when the camera connection has
been opened.
6.3.6.54
Camera Device Version read from the Configuration file (XML-file) when the camera connection has been
opened.
6.3.6.55
Unique Product GUID read from the Configuration file (XML-file) when the camera connection has been
opened.
This GUID string will be uniquely identifying the camera product type
6.3.6.56
Configuration File Version GUID read from the Configuration file (XML-file) when the camera connection
has been opened.
This GUID string will be uniquely identifying the Configuration File Version
6.3.6.57
Jai_FactoryWrapper.EColorInterpolationAlgorithm ColorInterpolationAlgorithm
[get, set]
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
401
402
Class Documentation
6.4
Public Types
enum EDriverType { FilterDriver, SocketDriver, Undefined }
Driver Type. This enumeration is used by the CFactory to select which type of driver interface that is
preferred during Device Discovery.
void Dispose ()
This object will be cleaned up by the Dispose method.
Jai_FactoryWrapper.EFactoryError Open ()
Open the CFactory object. This function has to be called in order call any other function in the
CFactory object!
Jai_FactoryWrapper.EFactoryError Close ()
Close the previously opened CFactory object.
403
2) The iDeviceKey in the Action Command packet and the ActionDeviceKey configured in the boostrap
register must be equal.
3) The iGroupKey in the Action Command packet and the ActionGroupKey of the corresponding device
action must be equal.
4) The logical AND-wise operation of the iGroupMask in the Action Command packet and the
ActionGroupMask of the corresponding device action must be non-zero. That is, that they must have at
least one common bit set at the same position in the 32-bit register.
Actions are not available in GigE Vision version 1.0 devices. It is optional for GigE Vision 1.1 (and newer)
compliant devices to implement Actions.
.
Public Attributes
List< CCamera > CameraList = new List<CCamera>()
List of CCamera objects found during Device Discovery. The Device Discovery is performed using the
UpdateCameraList() function
The contents of the Camera List will depend on the PreferredDriverType selected. If the PreferredDriverType is EDriverType.Undefined the Camera list will include the sum of cameras found across all driver
types. If both the Socket Driver and the Filter Driver is installed, cameras will show up twice.
FACTORY_HANDLE FactoryHandle
Handle to the Factory.
Properties
EDriverType PreferredDriverType [get, set]
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
404
Class Documentation
The preferred driver type used to filter the cameras found during Device Discovery.
6.4.1
Detailed Description
6.4.2
6.4.2.1
enum EDriverType
Driver Type. This enumeration is used by the CFactory to select which type of driver interface that is
preferred during Device Discovery.
Enumerator:
FilterDriver JAI Filter Driver.
SocketDriver Windows Socket Driver.
Undefined Undefined Driver Type.
Undefined driver type. All drivers are used for Device Discovery
6.4.3
6.4.3.1
CFactory ()
6.4.4
6.4.4.1
void Dispose ()
405
Jai_FactoryWrapper.EFactoryError Open ()
Open the CFactory object. This function has to be called in order call any other function in the
CFactory object!
Returns:
Jai_FactoryWrapper.EFactoryError
6.4.4.3
Open the CFactory object. This function has to be called in order call any other function in the
CFactory object!
Parameters:
RegistryFile File name and path for the Registry XML file
Returns:
Jai_FactoryWrapper.EFactoryError
6.4.4.4
Jai_FactoryWrapper.EFactoryError Close ()
6.4.4.5
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
406
6.4.4.6
Class Documentation
Jai_FactoryWrapper.EFactoryError SendActionCommand (UInt32 DeviceKey, UInt32
GroupKey, UInt32 GroupMask, ref Jai_FactoryWrapper.ActionCommandAck[ ]
AckBufferArray, UInt32 NumOfAcksExpected)
This function broadcasts a GigE Vision Action-command telegram on all network interfaces and waits for
acknowledges.
Triggering an action in multiple devices at roughly the same time can be accomplished through the optional
Action command introduced in GigE Vision 1.1. Using a distinct command (instead of a Write Register
Command) has the advantage that it does not rely on a specific register map. Therefor, different type of
devices can be targeted with the same message. Note that due to the nature of Ethernet, this is not as synchronous as a hardware trigger since different network segments can have different latencies. Nevertheless
in a swithced network, the resulting jitter is acceptable for a broad range of applications and this scheme
provides a convenient way to synchronize devices by means of a software command. The most typical
scenario is when an application desires to trigger a simultaneous action on multiple devices. This could for
instance be triggering the device or resetting the internal timestamp counter.
The following four conditions must be met for an action signal to be asserted by the device:
1) The device has an open primary control channel.
2) The iDeviceKey in the Action Command packet and the ActionDeviceKey configured in the boostrap register must be equal.
3) The iGroupKey in the Action Command packet and the ActionGroupKey of the corresponding device
action must be equal.
4) The logical AND-wise operation of the iGroupMask in the Action Command packet and the
ActionGroupMask of the corresponding device action must be non-zero. That is, that they must have
at least one common bit set at the same position in the 32-bit register.
Actions are not available in GigE Vision version 1.0 devices. It is optional for GigE Vision 1.1 (and newer)
compliant devices to implement Actions.
.
// Execute the Action Command
if (myRequestAcknowledge)
{
acknowledgeListBox.Items.Clear();
Jai_FactoryWrapper.ActionCommandAck[] AckBufferArray = null;
error = myFactory.SendActionCommand(myDeviceKey, myGroupKey, myGr
oupMask, ref AckBufferArray, myAckCount);
if ((AckBufferArray != null) && (AckBufferArray.Length > 0))
{
for (int i = 0; i < AckBufferArray.Length; i++)
{
IPAddress myIPAddress = new IPAddress(AckBufferArray[i].I
PAddress);
System.Diagnostics.Debug.WriteLine("Got acknowledge from
Device " + myIPAddress.ToString());
acknowledgeListBox.Items.Add((i+1).ToString() + ") " + my
IPAddress.ToString());
}
}
else
{
acknowledgeListBox.Items.Add("No acknowledge");
}
}
else
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
407
{
error = myFactory.SendActionCommand(myDeviceKey, myGroupKey, myGr
oupMask);
}
Parameters:
DeviceKey Device-key that authorize the action on the target devices.
GroupKey Group-key that extend the range of separate device groups.
GroupMask Group-mask that trigger action in multiple groups of devices separately.
AckBufferArray Reference to an array of Jai_FactoryWrapper.ActionCommandAck structures. The
structures will automatically be allocated based on the number of acknowledges received.
NumOfAcksExpected Maximum number of acknowledges expected. The AckBufferArray will never
exceed this number.
Returns:
Jai_FactoryWrapper.EFactoryError
6.4.4.7
This function broadcasts a GigE Vision Action-command telegram on all network interfaces without waiting for any acknowledges.
Triggering an action in multiple devices at roughly the same time can be accomplished through the optional
Action command introduced in GigE Vision 1.1. Using a distinct command (instead of a Write Register
Command) has the advantage that it does not rely on a specific register map. Therefor, different type of
devices can be targeted with the same message. Note that due to the nature of Ethernet, this is not as synchronous as a hardware trigger since different network segments can have different latencies. Nevertheless
in a swithced network, the resulting jitter is acceptable for a broad range of applications and this scheme
provides a convenient way to synchronize devices by means of a software command. The most typical
scenario is when an application desires to trigger a simultaneous action on multiple devices. This could for
instance be triggering the device or resetting the internal timestamp counter.
The following four conditions must be met for an action signal to be asserted by the device:
1) The device has an open primary control channel.
2) The iDeviceKey in the Action Command packet and the ActionDeviceKey configured in the boostrap register must be equal.
3) The iGroupKey in the Action Command packet and the ActionGroupKey of the corresponding device
action must be equal.
4) The logical AND-wise operation of the iGroupMask in the Action Command packet and the
ActionGroupMask of the corresponding device action must be non-zero. That is, that they must have
at least one common bit set at the same position in the 32-bit register.
Actions are not available in GigE Vision version 1.0 devices. It is optional for GigE Vision 1.1 (and newer)
compliant devices to implement Actions.
.
// Execute the Action Command
if (myRequestAcknowledge)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
408
Class Documentation
acknowledgeListBox.Items.Clear();
Jai_FactoryWrapper.ActionCommandAck[] AckBufferArray = null;
error = myFactory.SendActionCommand(myDeviceKey, myGroupKey, myGr
oupMask, ref AckBufferArray, myAckCount);
if ((AckBufferArray != null) && (AckBufferArray.Length > 0))
{
for (int i = 0; i < AckBufferArray.Length; i++)
{
IPAddress myIPAddress = new IPAddress(AckBufferArray[i].I
PAddress);
System.Diagnostics.Debug.WriteLine("Got acknowledge from
Device " + myIPAddress.ToString());
acknowledgeListBox.Items.Add((i+1).ToString() + ") " + my
IPAddress.ToString());
}
}
else
{
acknowledgeListBox.Items.Add("No acknowledge");
}
}
else
{
error = myFactory.SendActionCommand(myDeviceKey, myGroupKey, myGr
oupMask);
}
Parameters:
DeviceKey Device-key that authorize the action on the target devices.
GroupKey Group-key that extend the range of separate device groups.
GroupMask Group-mask that trigger action in multiple groups of devices separately.
Returns:
Jai_FactoryWrapper.EFactoryError
6.4.5
6.4.5.1
List of CCamera objects found during Device Discovery. The Device Discovery is performed using the
UpdateCameraList() function
The contents of the Camera List will depend on the PreferredDriverType selected. If the PreferredDriverType is EDriverType.Undefined the Camera list will include the sum of cameras found across all driver
types. If both the Socket Driver and the Filter Driver is installed, cameras will show up twice.
See also:
UpdateCameraList(EDriverType), CCamera
6.4.5.2
FACTORY_HANDLE FactoryHandle
6.4.6
Property Documentation
6.4.6.1
409
The preferred driver type used to filter the cameras found during Device Discovery.
See also:
UpdateCameraList(EDriverType)
6.4.6.2
This flag enables automatic Force IP handling for the Device Discovery. It has to be set up before calling
UpdateCameraList().
See also:
UpdateCameraList(EDriverType)
6.4.6.3
6.4.6.4
6.4.6.5
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
410
Class Documentation
6.4.6.6
Jai_Factory.dll Manufacturer
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_Factory_GetInfo() functions return an error
6.4.6.7
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.5
411
Classes
class IEnumValue
This class contains information about a single enumeration entry node inside an IEnumeration node.
void ExecuteCommand ()
Execute the command if the node is of type ICommand.
void Invalidate ()
Invalidate the node.
Properties
string Name [get]
GenICam node name.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
412
Class Documentation
string Description [get]
Full description of the node. If no Description is not found in the XML-file the Description will
contain the Tooltip value instead.
413
Is there another node that displays the same feature in a different way.
414
Class Documentation
6.5.1
Detailed Description
6.5.2
6.5.2.1
Public constructor for the CNode object. The CNode object will be created based on the Node Handle
passed to the constructor.
Parameters:
nodeHandle Valid handle to an opened node object
6.5.3
6.5.3.1
Search for an enumeration value by name. The search will try to mach the Name of the enumeration. If
that fails the Description will be searched as well.
Parameters:
enumValueName Name or description to search for in the EnumValue collection
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
415
findExact Flag to enforce searching for the exact name or to allow substring search as well
Returns:
6.5.3.2
Set the current access mode of the node. The access mode might change at runtime depending on the values
of other nodes.
Parameters:
accessMode Access mode to be imposed to this node
Returns:
Jai_FactoryWrapper.EFactoryError
6.5.3.3
6.5.3.4
void ExecuteCommand ()
6.5.3.5
void Invalidate ()
416
Class Documentation
6.5.4
Property Documentation
6.5.4.1
6.5.4.2
User friendly name for the node. If no DisplayName is not found in the XML-file the DisplayName
will contain the Name value instead.
6.5.4.3
Short description of the node. If no Tooltip is not found in the XML-file the Tooltip will contain the
DisplayName value instead.
6.5.4.4
Full description of the node. If no Description is not found in the XML-file the Description will
contain the Tooltip value instead.
6.5.4.5
6.5.4.6
6.5.4.7
6.5.4.8
6.5.4.9
6.5.4.10
Is the node cachable or do we need to read it back once in a while to get changes?
6.5.4.12
6.5.4.13
6.5.4.14
Event ID string.
6.5.4.15
6.5.4.16
6.5.4.17
6.5.4.18
6.5.4.19
Names of all Selecting nodes (only if other nodes are selectors for this node).
6.5.4.20
Is there another node that displays the same feature in a different way.
6.5.4.21
Is there an IFloat node that displays the same feature as this IInteger node?
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
417
418
Class Documentation
6.5.4.22
Is there an IInteger node that displays the same feature as this IFloat node?
6.5.4.23
Is there an IEnumeration node that displays the same feature as this IFloat node?
6.5.4.24
6.5.4.25
If the node is of type IEnumeration, then the EnumValues array will contain the different enumeration values defined for the node.
6.5.4.26
GenICam node Tag This tag can be used for storing any object related to the Node.
6.5.4.27
The handle of this node. This handle can be used for calling the Jai_FactoryWrapper.J_Node_xxx() functions.
6.5.4.28
Get/set the current access mode of the node. The access mode might change at runtime depending on the
values of other nodes.
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_Node_GetAccessMode() or Jai_FactoryWrapper.J_Node_ImposeAccessMode() functions return
an error
6.5.4.29
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
419
Get minimum value for the node. The value type depends on the node type.
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to the Jai_FactoryWrapper
functions return an error
6.5.4.31
Get maximum value for the node. The value type depends on the node type.
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to the Jai_FactoryWrapper
functions return an error
6.5.4.32
Get increment value for the node. The value type depends on the node type.
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to the Jai_FactoryWrapper
functions return an error
6.5.4.33
Get length of a Register node (in bytes). The value type depends on the node type. Only nodes of
type Jai_FactoryWrapper.EConfNodeType.IRegister, Jai_FactoryWrapper.EConfNodeType.IIntReg, Jai_FactoryWrapper.EConfNodeType.IFloatReg, Jai_FactoryWrapper.EConfNodeType.IStringReg and Jai_FactoryWrapper.EConfNodeType.IMaskedIntReg are supported.
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to the Jai_FactoryWrapper
functions return an error
6.5.4.34
Get address of a Register node. The value type depends on the node type. Only nodes of
type Jai_FactoryWrapper.EConfNodeType.IRegister, Jai_FactoryWrapper.EConfNodeType.IIntReg, Jai_FactoryWrapper.EConfNodeType.IFloatReg, Jai_FactoryWrapper.EConfNodeType.IStringReg and Jai_FactoryWrapper.EConfNodeType.IMaskedIntReg are supported.
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to the Jai_FactoryWrapper
functions return an error
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
420
Class Documentation
6.5.4.35
Is the node value readable? This is calculated based on the current access mode.
6.5.4.36
Is the node value writable? This is calculated based on the current access mode.
6.5.4.37
Is the node implemented? This is calculated based on the current access mode.
6.5.4.38
Is the node value available? This is calculated based on the current access mode.
6.5.4.39
Get the managed datatype of the internal value representation of the node value.
6.5.4.40
Get/set the current value of the node. The value return type will depend on the GenICam node type.
Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to the Jai_FactoryWrapper
functions return an error
The documentation for this class was generated from the following file:
Node.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.6
421
Structure containing Color-Compensation parameters. This is used for both Red-Compensation and GreenCompensation.
Public Attributes
RECT RectOfROI
Rectangle of a region of interest.
UInt32 BThreshold
Threshold of blue channel.
UInt32 GThreshold
Threshold of green channel.
UInt32 RThreshold
Threshold of red channel.
UInt32 BGain
Blue gain for compensation. 4096:1.00.
UInt32 GGain
Green gain for compensation. 4096:1.00.
UInt32 RGain
Red gain for compensation. 4096:1.00.
6.6.1
Detailed Description
Structure containing Color-Compensation parameters. This is used for both Red-Compensation and GreenCompensation.
6.6.2
6.6.2.1
RECT RectOfROI
UInt32 BThreshold
UInt32 GThreshold
422
Class Documentation
6.6.2.4
UInt32 RThreshold
UInt32 BGain
UInt32 GGain
UInt32 RGain
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.7
Properties
string FeatureName [get, set]
GenICam feature name.
6.7.1
Detailed Description
6.7.2
6.7.2.1
Command ()
Default constructor.
6.7.2.2
Initializing constructor.
Parameters:
feature GenICam feature name
value Feature value to be stored
6.7.3
Property Documentation
6.7.3.1
423
424
Class Documentation
6.7.3.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.8
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
Public Attributes
UInt16 GEV_EVENT_CMD_EventID
EVENT identifying reason.
UInt16 GEV_EVENT_CMD_StreamChannelIndex
Index of stream channel (0xFFFF for no channel).
UInt16 GEV_EVENT_CMD_BlockID
Data block ID (0 for no block).
UInt64 GEV_EVENT_CMD_Timestamp
Event timestamp (0 if not supported).
UInt16 GEV_EVENT_CMD_EventDataLength
Number of additional data associated with the event.
byte[ ] GEV_EVENT_CMD_EventData
The additional data associated with the event.
BUFFER_HANDLE NEW_BUFFER_BufferHandle
Buffer handle of the delivered buffer.
EDeviceConnectionType CONNECTION_Status
Current status for the camera connection.
6.8.1
Detailed Description
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
6.8.2
6.8.2.1
UInt16 GEV_EVENT_CMD_EventID
UInt16 GEV_EVENT_CMD_StreamChannelIndex
UInt16 GEV_EVENT_CMD_BlockID
425
426
Class Documentation
6.8.2.4
UInt64 GEV_EVENT_CMD_Timestamp
UInt16 GEV_EVENT_CMD_EventDataLength
byte [ ] GEV_EVENT_CMD_EventData
BUFFER_HANDLE NEW_BUFFER_BufferHandle
EDeviceConnectionType CONNECTION_Status
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.9
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
Public Attributes
UInt32 NumEntriesInQueue
Number of events in queue.
6.9.1
Detailed Description
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
6.9.2
6.9.2.1
UInt32 NumEntriesInQueue
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
427
428
Class Documentation
6.10
6.10.1
Detailed Description
6.10.2
6.10.2.1
FactoryErrorException ()
Contructor.
6.10.2.2
Constructor.
Parameters:
message Message string
6.10.2.3
Constructor.
Parameters:
message Message string
inner Inner exception
The documentation for this class was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.11
Properties
string Description [get]
Error description.
6.11.1
Detailed Description
6.11.2
Property Documentation
6.11.2.1
Error description.
6.11.2.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
429
430
Class Documentation
6.12
Public Attributes
UInt32 NumOfROI
Number of ROI for color compensation. This has to be a value between 1 and 10.
ColorCompensationROIStruct[ ] ColorCompensationROI
The 10 Green-Compensation ROIs. The NumOfROI field specified how many of these structures are initialized with data.
6.12.1
Detailed Description
6.12.2
6.12.2.1
UInt32 NumOfROI
Number of ROI for color compensation. This has to be a value between 1 and 10.
6.12.2.2
ColorCompensationROIStruct [ ] ColorCompensationROI
The 10 Green-Compensation ROIs. The NumOfROI field specified how many of these structures are
initialized with data.
The documentation for this struct was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.13
Public Attributes
UInt32 HistEntries
Number of Histogram entries allocated. This will depend on the pixel depth!
UInt32 PixelDepth
Pixel depth! This can be 8-bit, 10-bit, 12-bit, 14-bit or 16-bit.
UInt32 Colors
Number of colors. This is either 1 (monochrome) or 3 for Bayer and RGB.
IntPtr HistR
Pointer to the actual Histogram data for color 1 (Monochrome or Red channel).
IntPtr HistG
Pointer to the actual Histogram data for color 2 (Green channel).
IntPtr HistB
Pointer to the actual Histogram data for color 3 (Blue channel).
6.13.1
Detailed Description
6.13.2
6.13.2.1
UInt32 HistEntries
Number of Histogram entries allocated. This will depend on the pixel depth!
6.13.2.2
UInt32 PixelDepth
UInt32 Colors
IntPtr HistR
Pointer to the actual Histogram data for color 1 (Monochrome or Red channel).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
431
432
Class Documentation
6.13.2.5
IntPtr HistG
IntPtr HistB
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.14
433
This class contains information about a single enumeration entry node inside an IEnumeration node.
Properties
string Name [get]
Name of the IEnumEntry node.
6.14.1
Detailed Description
This class contains information about a single enumeration entry node inside an IEnumeration node.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
434
Class Documentation
6.14.2
6.14.2.1
6.14.3
6.14.3.1
6.14.4
Property Documentation
6.14.4.1
6.14.4.2
6.14.4.3
6.14.4.4
6.14.4.5
435
Is the IEnumEntry node value readable? This is calculated based on the current access mode.
6.14.4.7
Is the IEnumEntry IEnumEntry node value writable? This is calculated based on the current access mode.
6.14.4.8
Is the IEnumEntry node implemented? This is calculated based on the current access mode.
6.14.4.9
Is the IEnumEntry node value available? This is calculated based on the current access mode.
The documentation for this class was generated from the following file:
Node.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
436
Class Documentation
6.15
Public Attributes
EPixelFormatType PixelFormat
Pixel Format Type.
UInt32 SizeX
Image width.
UInt32 SizeY
Image height.
UInt32 ImageSize
Number of bytes for image.
IntPtr ImageBuffer
Buffer pointer. This is a handle to the buffer used in J_Image_GetBufferInfo().
UInt64 TimeStamp
Timestamp from camera.
UInt32 MissingPackets
Number of missing packets.
UInt32 AnnouncedBuffers
Number of announced buffers.
UInt32 QueuedBuffers
Number of queued buffers.
UInt32 OffsetX
Image X-offset (in case of ROI).
UInt32 OffsetY
Image Y-offset (in case of ROI).
UInt32 AwaitDelivery
Number of frames awaiting delivery from the driver.
UInt32 BlockID
Block-ID for the GigE Vision Stream Protocol.
6.15.1
Detailed Description
6.15.2
6.15.2.1
EPixelFormatType PixelFormat
UInt32 SizeX
Image width.
6.15.2.3
UInt32 SizeY
Image height.
6.15.2.4
UInt32 ImageSize
IntPtr ImageBuffer
UInt64 TimeStamp
UInt32 MissingPackets
UInt32 AnnouncedBuffers
UInt32 QueuedBuffers
UInt32 OffsetX
UInt32 OffsetY
437
438
Class Documentation
6.15.2.12
UInt32 AwaitDelivery
UInt32 BlockID
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.16
439
Type of value passed on by the Image View Window callback delegate. The value to use depends on the
Callback Type.
Public Attributes
POINT PointValue
The Callback value is a POINT.
SIZE SizeValue
The Callback value is a SIZE. This is used for the J_IVW_CB_WINDOW_SIZE callback type.
RECT RectValue
The Callback value is a RECT. This is used for the J_IVW_CB_AREA_SELECT callback type.
ZoomPos ZoomPosValue
The Callback value is a ZOOMPOS. This is used for the J_IVW_CB_ZOOM_POS callback type.
UserDrawInfo UserDrawInfoValue
The Callback value is a User Draw information structure. This is used for the J_IVW_CB_USER_DRAW_IMAGE and J_IVW_CB_USER_DRAW_VIEW_WINDOW callback types.
6.16.1
Detailed Description
Type of value passed on by the Image View Window callback delegate. The value to use depends on the
Callback Type.
6.16.2
6.16.2.1
POINT PointValue
6.16.2.2
SIZE SizeValue
The Callback value is a SIZE. This is used for the J_IVW_CB_WINDOW_SIZE callback type.
6.16.2.3
RECT RectValue
The Callback value is a RECT. This is used for the J_IVW_CB_AREA_SELECT callback type.
6.16.2.4
ZoomPos ZoomPosValue
The Callback value is a ZOOMPOS. This is used for the J_IVW_CB_ZOOM_POS callback type.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
440
Class Documentation
6.16.2.5
UserDrawInfo UserDrawInfoValue
The Callback value is a User Draw information structure. This is used for the J_IVW_CB_USER_DRAW_IMAGE and J_IVW_CB_USER_DRAW_VIEW_WINDOW callback types.
The documentation for this struct was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.17
441
Option
type
used
in
GetViewWindowOption().
J_Image_SetViewWindowOption()
and
J_Image_-
Public Attributes
bool BooleanValue
Image View Window Option value of type Boolean.
UInt32 UInt32Value
Image View Window Option value of
EIVWOptionType.CallbackMask option.
6.17.1
type
UInt32.
This
is
used
for
the
Detailed Description
Option
type
used
in
GetViewWindowOption().
J_Image_SetViewWindowOption()
6.17.2
6.17.2.1
bool BooleanValue
and
J_Image_-
UInt32 UInt32Value
type
UInt32.
The documentation for this struct was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
This
is
used
for
the
442
Class Documentation
6.18
Classes
struct ActionCommandAck
Action Command Acknowledge structure.
struct BufferInfoStruct
This structure is used for reading buffer information with J_DataStream_GetBufferInfo().
struct ColorCompensationROIStruct
Structure containing Color-Compensation parameters. This is used for both Red-Compensation and GreenCompensation.
struct DeviceEventData
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
struct EventInfoData
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
class FactoryErrorException
JAI SDK Factory Exceptions.
struct GenICamErrorInfo
GenICam Error Info.
struct GreenCompensationStruct
Structure containing Green-Compensation parameters.
struct HistogramInfo
Structure containing Histogram data.
struct ImageInfo
Image information structure used in callback and image conversion functions.
struct IVWCallbackValue
Type of value passed on by the Image View Window callback delegate. The value to use depends on the
Callback Type.
struct IVWOptionValue
Option
type
used
in
GetViewWindowOption().
J_Image_SetViewWindowOption()
and
J_Image_-
struct LUTInfo
Structure containing LUT data.
struct PixelValue
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
443
Pixel value structure that will hold Mono8, Mono10, Mono12, Mono16, DIB24, RGB24, DIB32 and BGR48
pixels.
struct POINT
Windows POINT implementation for pInvoke.
struct RECT
Windows RECT implementation for pInvoke.
struct RedCompensationStruct
Structure containing Red-Compensation parameters.
struct SIZE
Windows SIZE implementation for pInvoke.
struct StreamInfoStruct
This structure is used for reading buffer information with J_DataStream_GetStreamInfo() or J_Image_GetStreamInfo().
struct StreamParameterStruct
This structure is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam().
struct UndistortStruct
Structure containing Lens Distortion Correction parameters.
struct UserDrawInfo
User-Draw value structure. This is used by the J_IVW_CB_USER_DRAW_IMAGE and J_IVW_CB_USER_DRAW_VIEW_WINDOW Image View Window event.
struct ZoomPos
Zoom Position value structure. This is used by the J_IVW_CB_ZOOM_POS Image View Window event.
Public Types
enum EFactoryError {
Success = 0, InvalidBufferSize = -1, InvalidHandle = -2, InvalidID = -3,
AccessDenied = -4, NoData = -5, Error = -6, InvalidParameter = -7,
Timeout = -8, InvalidFilename = -9, InvalidAddress = -10, FileIO = -11,
GenICamError = -12, ValidationError = -13, ValidationWarning = -14 }
Error return code enumeration.
enum ECameraInfoType {
Manufacturer = 0, ModelName, IPAddress, MACAddress,
SerialNumber, UserName, InterfaceID = 100 }
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
444
Class Documentation
Camera information type enumeration.
enum EConfInfoType {
ModelName = 0, VendorName, ToolTip, StandardNameSpace,
GenApiVersion, SchemaVersion, DeviceVersion, ProductGuid,
VersionGuid }
XML-file configuration information type enumeration.
enum EConfVisibility {
Beginner = 0, Expert = 1, Guru = 2, Invisible = 3,
_UndefinedVisibility = 99 }
Recommended visibility of an GenICam node.
enum EConfNodeType {
UnknowNodeType = 1, INode = 100, ICategory, IInteger,
IEnumeration, IEnumEntry, IMaskedIntReg, IRegister,
IIntReg, IFloat, IFloatReg, ISwissKnife,
IIntSwissKnife, IIntKey, ITextDesc, IPort,
IConfRom, IAdvFeatureLock, ISmartFeature, IStringReg,
IBoolean, ICommand, IConverter, IIntConverter,
IChunkPort, INodeMap, INodeMapDyn, IDeviceInfo,
ISelector, IPortConstruct }
The GenICam interface node type of a specific node.
enum EConfAccessMode {
NI, NA, WO, RO,
RW, _UndefinedAccesMode }
Access mode of a GenICam node.
enum EConfRepresentation {
Linear, Logarithmic, Boolean, PureNumber,
HexNumber, IPV4Address, MACAddress, _UndefinedRepresentation }
Defines the node representaion in the GUI.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
445
enum EBufferInfoCmd {
BASE, SIZE, USER_PTR, TIMESTAMP,
NUMBER, NEW_DATA, ISQUEUED, PAYLOADTYPE,
PIXELTYPE, WIDTH, HEIGHT, XOFFSET,
YOFFSET, XPADDING, YPADDING, NUM_PACKETS_MISSING,
BLOCK_ID }
The EBufferInfoCmd is used to get buffer information using J_DataStream_GetBufferInfo().
enum EStreamInfoCmd {
NONE = 0, ISGRABBING = 1, NUMBER_OF_FRAMES_DELIVERED = 2, NUMBER_OF_FRAMES_LOST_QUEUE_UNDERRUN = 3,
NUMBER_OF_FRAMES_ANNOUNCED = 4, NUMBER_OF_FRAMES_QUEUED = 5,
NUMBER_OF_FRAMES_AWAIT_DELIVERY = 6, NUMBER_OF_FRAMES_CORRUPT_ON_DELIEVRY = 7,
CUSTOM_INFO = 1000 }
The EStreamInfoCmd is used to get acquisition information using J_DataStream_GetStreamInfo()
or J_Image_GetStreamInfo().
enum EDataStreamParamCmd {
CanResend = 1, NumberOfBytesPerFrame = 2, PassCorruptFrames = 3, MaxFramesInNotCompletedList = 4,
RxTimeoutsBeforeListFlush = 5, OutOfOrderPacketsBeforeResend = 6, RxTimeout = 7 }
The EDataStreamParamCmd is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
446
Class Documentation
enum EDeviceEventType {
NEW_BUFFER, GEV_EVENT_CMD, GEV_EVENTDATA_CMD, ERROR,
CONNECTION, MAX_ID }
The EDeviceEventType is used to specify which type of event to register with the Transport Layer.
enum ECondWaitResult {
WaitTimeout, WaitSignal, WaitExit, WaitSignal1,
WaitExit1, WaitSignal2, WaitExit2, WaitSignal3,
WaitExit3, WaitSignal4, WaitExit5, WaitSignal6,
WaitExit6, WaitSignal7, WaitExit7, WaitSignal8,
WaitExit8, WaitSignal9, WaitExit9, WaitError }
The ECondWaitResult is wait result type returned in J_Event_WaitForCondition().
enum EPixelFormatType {
GVSP_PIX_MONO8 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x0001), GVSP_PIX_MONO8_SIGNED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x0002), GVSP_PIX_MONO10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0003), GVSP_PIX_MONO10_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x0004),
GVSP_PIX_MONO12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0005), GVSP_PIX_MONO12_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x0006),
GVSP_PIX_MONO14 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0025), GVSP_PIX_MONO16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0007),
GVSP_PIX_BAYGR8 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x0008), GVSP_PIX_BAYRG8 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x0009), GVSP_PIX_BAYGB8 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x000A), GVSP_PIX_BAYBG8
= (GVSP_PIX_MONO | GVSP_PIX_OCCUPY8BIT | 0x000B),
GVSP_PIX_BAYGR10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x000C), GVSP_PIX_BAYRG10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x000D), GVSP_PIX_BAYGB10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x000E), GVSP_PIX_BAYBG10 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x000F),
GVSP_PIX_BAYGR12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0010), GVSP_PIX_BAYRG12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0011), GVSP_PIX_BAYGB12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0012), GVSP_PIX_BAYBG12 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0013),
GVSP_PIX_BAYGR10_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT |
0x0026), GVSP_PIX_BAYRG10_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT
| 0x0027), GVSP_PIX_BAYGB10_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x0028), GVSP_PIX_BAYBG10_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x0029),
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
447
enum EIVWCallbackType {
J_IVW_CB_WINDOW_MOVE = 0x0001, J_IVW_CB_WINDOW_SIZE = 0x0002, J_IVW_CB_MOUSE_MOVE = 0x0004, J_IVW_CB_MOUSE_LBUTTON_DOWN = 0x0008,
J_IVW_CB_MOUSE_LBUTTON_UP = 0x0010, J_IVW_CB_MOUSE_RBUTTON_DOWN =
0x0020, J_IVW_CB_MOUSE_RBUTTON_UP = 0x0040, J_IVW_CB_ZOOM_POS = 0x0080,
J_IVW_CB_AREA_SELECT = 0x0100, J_IVW_CB_USER_DRAW_IMAGE = 0x0200, J_IVW_CB_USER_DRAW_VIEW_WINDOW = 0x0400 }
Image View Window Callback type. This type determines how to interprete the data passed in by the callback
value parameter. It is also used when the callback mask is set as a View Window option.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
448
Class Documentation
enum EColorInterpolationAlgorithm {
BayerStandard = 0, BayerStandardMultiprocessor = 1, BayerExtended = 2, BayerExtendedMultiprocessor = 3,
BayerSimple = 4, BayerSimpleMultiprocessor = 5, BayerFast = 6, BayerFastMultiprocessor = 7 }
Bayer color interpolation algorithm.
enum EColorConversionPixelFormat {
PixelFormatNone = 0, PixelFormat24BitSwapRB = 1, PixelFormat8BitY = 2, PixelFormat24BitUYV = 3,
PixelFormat24BitYCBCR = 4, PixelFormat48BitSwapRB = 5, PixelFormat16BitY = 6, PixelFormatSwapRB = 7,
PixelFormatY = 8, PixelFormat3YH = 9, PixelFormat3YV = 10 }
Image conversion pixelformat options used in J_Image_ConvertImage() and J_Image_Malloc().
enum ESaveFileFormat {
Tiff = 1, Jpeg = 2, Bmp = 3, Jai = 4,
RAW = 5 }
File type used in J_Image_SaveFileEx().
enum EProcessFunctionType {
RedCompensation = 0, RedCompensationMulti = 1, GreenCompensation = 2, GreenCompensationMulti = 3,
LensDistortion = 10, LensDistortionMulti = 11, LensDistortionMapInit = 12, LensDistortionMapFree = 13 }
Image Processing algorithm type used in J_Image_Processing().
J_Factory_Open
(String
RegistryFileName,
out
static Jai_FactoryWrapper.EFactoryError J_Factory_GetInfo (EFactoryInfoType InfoType, StringBuilder InfoString, ref int BufferSize)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
449
static Jai_FactoryWrapper.EFactoryError J_Factory_GetCameraInfo (FACTORY_HANDLE FactoryHandle, String CameraID, ECameraInfoType InfoType, StringBuilder InfoString, ref UInt32
Size)
Get detailed information about a camera.
static Jai_FactoryWrapper.EFactoryError J_Camera_OpenMc (FACTORY_HANDLE FactoryHandle, String CameraID, out CAMERA_HANDLE CameraHandle, EDeviceAccessFlags OpenFlags,
UInt32 McIP)
Open a camera with multicasting from a camera ID and return valid camera handle.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueInt64 (CAMERA_HANDLE CameraHandle, String NodeName, ref Int64 Value)
Get the value of a GenICam feature node as Int64 type.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueDouble (CAMERA_HANDLE CameraHandle, String NodeName, ref double Value)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
450
Class Documentation
Get the value of a GenICam feature node as double type.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueString (CAMERA_HANDLE CameraHandle, String NodeName, StringBuilder ValueStr, ref UInt32 SizeValueStr)
Get the value of a GenICam feature node as String type.
static Jai_FactoryWrapper.EFactoryError J_Camera_ReadData (CAMERA_HANDLE CameraHandle, Int64 Address, IntPtr Data, ref UInt32 Size)
Read data directly from the camera.
static Jai_FactoryWrapper.EFactoryError J_Camera_WriteData (CAMERA_HANDLE CameraHandle, Int64 Address, byte[ ] Data, ref UInt32 Size)
Write data directly to the camera.
static Jai_FactoryWrapper.EFactoryError J_Camera_WriteData (CAMERA_HANDLE CameraHandle, Int64 Address, IntPtr Data, ref UInt32 Size)
Write data directly to the camera.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetConfigInfo (CAMERA_HANDLE CameraHandle, EConfInfoType InfoType, StringBuilder InfoString, ref UInt32 Size)
Retrieve information about the GenICam XML-file configuration loaded for the device.
static Jai_FactoryWrapper.EFactoryError J_Camera_GetNodeByIndex (CAMERA_HANDLE CameraHandle, UInt32 Index, out NODE_HANDLE NodeHandle)
Get the node by the node map index. Valid indices will be between 0 and the value returned using J_Camera_GetNumOfNodes().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
451
(CAMERA_-
delegate
void
ConnectionStatusCallBack
(CCamera
FactoryWrapper.EDeviceConnectionType connectionStatus)
camera,
Jai_-
Delegate to be called as callback function when a new image has been received.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
452
Class Documentation
static Jai_FactoryWrapper.EFactoryError J_Camera_GetSettingsValidationErrorInfo (CAMERA_HANDLE CameraHandle, StringBuilder ErrorInfoBuffer, ref UInt32 Size)
Get Camera Settings Validation error information.
static Jai_FactoryWrapper.EFactoryError J_DataStream_AnnounceBuffer (DATASTREAM_HANDLE DSHandle, IntPtr Buffer, UInt32 BufferSize, IntPtr PrivateData, out BUFFER_HANDLE
BufferHandle)
Announce buffer pointer for the acquisition engine.
(DATASTREAM_-
(DATASTREAM_-
static Jai_FactoryWrapper.EFactoryError J_DataStream_GetStreamInfo (DATASTREAM_HANDLE DSHandle, EStreamInfoCmd Cmd, ref StreamInfoStruct Info, ref UInt32 Size)
Get detailed information about a data stream.
static Jai_FactoryWrapper.EFactoryError
DSHandle)
J_DataStream_Close
(DATASTREAM_HANDLE
static Jai_FactoryWrapper.EFactoryError J_DataStream_RevokeBuffer (DATASTREAM_HANDLE DSHandle, BUFFER_HANDLE BufferHandle, ref IntPtr BufferPtr, ref IntPtr PrivateDataPtr)
Remove the frame buffer from the Acquisition engine.
static Jai_FactoryWrapper.EFactoryError J_DataStream_GetBufferInfo (DATASTREAM_HANDLE DSHandle, BUFFER_HANDLE BufferHandle, EBufferInfoCmd Cmd, ref BufferInfoStruct BufferInfo, ref UInt32 Size)
Get detailed information about a buffer.
453
static Jai_FactoryWrapper.EFactoryError J_Event_GetData (EVT_HANDLE EventHandle, out DeviceEventData EventData, ref UInt32 Size)
Retrieve the event data associated with the event.
EventHandle,
static Jai_FactoryWrapper.EFactoryError J_Camera_RegisterEvent (CAMERA_HANDLE CameraHandle, EDeviceEventType EventType, SafeWaitHandle WaitHandle, out EVT_HANDLE EventHandle)
Register an event for a device with the Transport Layer interface using Windows events.
static Jai_FactoryWrapper.EFactoryError J_Camera_RegisterEvent (CAMERA_HANDLE CameraHandle, EDeviceEventType EventType, COND_HANDLE ConditionHandle, out EVT_HANDLE
EventHandle)
Register an event for a device with the Transport Layer interface using JAI SDK Conditions instead of
events.
static Jai_FactoryWrapper.EFactoryError J_DataStream_RegisterEvent (DATASTREAM_HANDLE DSHandle, EDeviceEventType EventType, SafeWaitHandle WaitHandle, out EVT_HANDLE EventHandle)
Register an event with the Transport Layer interface.
(DATASTREAM_-
454
Class Documentation
Create new Condition object to be used for event handling.
static Jai_FactoryWrapper.EFactoryError J_Event_WaitForCondition (COND_HANDLE ConditionHandle, UInt32 timeout, ref ECondWaitResult WaitResult)
Wait for the Condition object to be signaled.
455
static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayName (NODE_HANDLE NodeHandle, StringBuilder DisplayName, ref UInt32 Size)
Get the display name for a node.
static Jai_FactoryWrapper.EFactoryError J_Node_GetPropertyByName (NODE_HANDLE NodeHandle, String PropertyName, StringBuilder ValueStr, ref UInt32 SizeValueStr, StringBuilder AttributeStr, ref UInt32 SizeAttributeStr)
Get the property value and attribute string by property name.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
456
Class Documentation
static Jai_FactoryWrapper.EFactoryError J_Node_GetAlias (NODE_HANDLE NodeHandle, out
IntPtr AliasNodeHandle)
Retrieves a node which describes the same feature in a different way.
static Jai_FactoryWrapper.EFactoryError J_Node_GetUnit (NODE_HANDLE NodeHandle, StringBuilder Unit, ref UInt32 Size)
Get the Unit string specified for the node.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
457
static Jai_FactoryWrapper.EFactoryError J_Node_GetValueDouble (NODE_HANDLE NodeHandle, bool Verify, ref double Value)
Get the node value.
458
Class Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
459
static Jai_FactoryWrapper.EFactoryError J_Image_OpenViewWindowEx (EIVWWindowType WindowType, String WindowName, ref RECT FrameRect, ref SIZE MaxSize, HWND hParent, out
VW_HANDLE WindowHandle)
Open image view window.
static Jai_FactoryWrapper.EFactoryError J_Image_SetImageOffset (VW_HANDLE WindowHandle, ref POINT Offset, Int32 ZoomRatio)
Set image offset and zoom ratio.
static Jai_FactoryWrapper.EFactoryError J_Image_SetImageOffsetEx (VW_HANDLE WindowHandle, ref POINT Offset, double ZoomRatioX, double ZoomRatioY)
Set image offset and zoom ratio (individually in both X and Y direction).
static Jai_FactoryWrapper.EFactoryError J_Image_GetImageOffsetEx (VW_HANDLE WindowHandle, ref POINT Offset, ref double ZoomRatioX, ref double ZoomRatioY)
Get image offset and zoom ratio (individually in both X and Y direction).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
460
Class Documentation
static Jai_FactoryWrapper.EFactoryError J_Image_GetViewWindowRect (VW_HANDLE WindowHandle, ref RECT Rect)
Get rectangular coordinates of the client area of the view window.
static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowOption (VW_HANDLE WindowHandle, EIVWOptionType Option, ref IVWOptionValue OptionValue)
Set the value for a View Window option.
static Jai_FactoryWrapper.EFactoryError J_Image_GetViewWindowOption (VW_HANDLE WindowHandle, EIVWOptionType Option, ref IVWOptionValue OptionValue)
Get the current View Window option value.
static Jai_FactoryWrapper.EFactoryError J_Image_OpenStreamLight (CAMERA_HANDLE CameraHandle, UInt32 Channel, out SP_HANDLE StreamHandle)
Open image stream channel and let the factory automatically create all callback delegates and automatically
display live images.
461
static Jai_FactoryWrapper.EFactoryError J_Image_Malloc (ref ImageInfo AqImageInfo, ref ImageInfo BufferInfo, EColorConversionPixelFormat ConversionPixelFormat)
Allocate the buffer memory for the image to use J_Image_ConvertImage().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
462
Class Documentation
static Jai_FactoryWrapper.EFactoryError J_Image_GetPixel (ref ImageInfo BufferInfo, ref POINT
Point, ref PixelValue Pixel)
Get the pixel at a specified position.
static
Jai_FactoryWrapper.EFactoryError
StreamHandle)
J_Image_ExecuteWhiteBalance
(SP_HANDLE
static Jai_FactoryWrapper.EFactoryError J_Image_MallocHDR (ref ImageInfo ImageInfo1, ref ImageInfo ImageInfo2, ref ImageInfo BufferInfo)
Allocate the buffer memory for the HDR output image.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
463
464
Class Documentation
Free the Histogram memory previously allocated using J_Image_MallocHistogram().
the
Histogram
memory
previously
allocated
using
J_Image_-
static Jai_FactoryWrapper.EFactoryError J_Image_GetHistogramValue (ref HistogramInfo HistogramInfo, UInt32 ColorIndex, UInt32 HistogramIndex, ref UInt32 pHistogramValue)
This function directly reads a value from the Histogram.
static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo ImageInfo, EProcessFunctionType ProcessingFunction, IntPtr Parameters)
This function processes the image by the function specified by the parameter.
static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo ImageInfoRef, RedCompensationStruct RedCompensationParameters, bool UseMultiProcessor)
This function performs a Red-Compensation on the image.
static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo ImageInfoRef, GreenCompensationStruct GreenCompensationParameters, bool UseMultiProcessor)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
465
6.18.1
Detailed Description
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
466
Class Documentation
6.19
Public Attributes
UInt32 LUTEntries
Number of LUT entries allocated. This will depend on the pixel depth!
UInt32 PixelDepth
Pixel depth! This can be 8-bit, 10-bit, 12-bit, 14-bit or 16-bit.
UInt32 Colors
Number of colors. This is either 1 (monochrome) or 3 for Bayer and RGB.
IntPtr LutR
Pointer to the actual LUT data for color 1 (Monochrome or Red channel).
IntPtr LutG
Pointer to the actual LUT data for color 2 (Green channel).
IntPtr LutB
Pointer to the actual LUT data for color 3 (Blue channel).
6.19.1
Detailed Description
6.19.2
6.19.2.1
UInt32 LUTEntries
Number of LUT entries allocated. This will depend on the pixel depth!
6.19.2.2
UInt32 PixelDepth
UInt32 Colors
IntPtr LutR
Pointer to the actual LUT data for color 1 (Monochrome or Red channel).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
IntPtr LutG
IntPtr LutB
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
467
468
Class Documentation
6.20
Pixel value structure that will hold Mono8, Mono10, Mono12, Mono16, DIB24, RGB24, DIB32 and
BGR48 pixels.
Public Attributes
Byte MONO8_Y
Luminance in Mono8 format.
UInt16 MONO10_Y
Luminance in Mono10 format.
UInt16 MONO12_Y
Luminance in Mono12 format.
UInt16 MONO16_Y
Luminance in Mono16 format.
Byte DIB24_B
Blue in DIB24 format.
Byte DIB24_G
Green in DIB24 format.
Byte DIB24_R
Red in DIB24 format.
Byte RGB24_B
Blue in RGB24 format.
Byte RGB24_G
Green in RGB24 format.
Byte RGB24_R
Red in RGB24 format.
Byte ARGB32_B
Blue in ARGB32 format.
Byte ARGB32_G
Green in ARGB32 format.
Byte ARGB32_R
Red in ARGB32 format.
Byte ARGB32_A
Alpha in ARGB32 format.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
469
UInt16 BGR48_B
Blue in BGR48 format.
UInt16 BGR48_G
Green in BGR48 format.
UInt16 BGR48_R
Red in BGR48 format.
6.20.1
Detailed Description
Pixel value structure that will hold Mono8, Mono10, Mono12, Mono16, DIB24, RGB24, DIB32 and
BGR48 pixels.
Which values to read and write will depend on the PixelType value of the ImageInfo structure.
PixelType
GVSP_PIX_MONO8
GVSP_PIX_MONO10
GVSP_PIX_MONO10_PACKED
GVSP_PIX_MONO12
GVSP_PIX_MONO12_PACKED
GVSP_PIX_MONO16
PixelValue element
MONO8_Y
MONO10_Y
MONO10_Y
MONO12_Y
MONO12_Y
MONO16_Y
PixelValue element
RGB24_B
RGB24_B
RGB24_B
RGB24_B
BGR48_x
BGR48_x
BGR48_x
BGR48_x
BGR48_x
BGR48_x
BGR48_x
BGR48_x
Table 6.2: Bayer buffer format
6.20.2
6.20.2.1
Byte MONO8_Y
470
Class Documentation
PixelType
GVSP_PIX_RGB8_PACKED
GVSP_PIX_BGR8_PACKED
GVSP_PIX_RGBA8_PACKED
GVSP_PIX_BGRA8_PACKED
GVSP_PIX_RGB10_PACKED
GVSP_PIX_BGR10_PACKED
GVSP_PIX_RGB12_PACKED
GVSP_PIX_BGR12_PACKED
GVSP_PIX_RGB10V1_PACKED
GVSP_PIX_RGB10V2_PACKED
PixelValue element
RGB24_x
RGB24_x
ARGB32_x
ARGB32_x
BGR48_x
BGR48_x
BGR48_x
BGR48_x
BGR48_x
BGR48_x
PixelValue element
BGR48_x
BGR48_x
BGR48_x
UInt16 MONO10_Y
6.20.2.3
UInt16 MONO12_Y
6.20.2.4
UInt16 MONO16_Y
6.20.2.5
Byte DIB24_B
6.20.2.6
Byte DIB24_G
6.20.2.7
Byte DIB24_R
6.20.2.8
Byte RGB24_B
471
PixelValue element
BGR24_x
BGR48_x
BGR48_x
BGR48_x
Byte RGB24_G
Byte RGB24_R
Byte ARGB32_B
Byte ARGB32_G
Byte ARGB32_R
Byte ARGB32_A
UInt16 BGR48_B
UInt16 BGR48_G
UInt16 BGR48_R
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
472
Class Documentation
6.21
Public Attributes
int X
X position.
int Y
Y position.
6.21.1
Detailed Description
6.21.2
6.21.2.1
POINT Constructor.
Parameters:
x X position
y Y position
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.21.3
6.21.3.1
6.21.3.2
6.21.4
6.21.4.1
int X
X position.
6.21.4.2
int Y
Y position.
The documentation for this struct was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
473
474
Class Documentation
6.22
Rectangle ToRectangle ()
Handy method for converting to a System.Drawing.Rectangle.
Public Attributes
int Left
Left.
int Top
Top.
int Right
Right.
int Bottom
Bottom.
Properties
int Height [get]
Height of the rectangle.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
475
6.22.1
Detailed Description
6.22.2
6.22.2.1
Constructor.
Parameters:
left_ Left
top_ Top
right_ Right
bottom_ Bottom
6.22.3
6.22.3.1
Rectangle ToRectangle ()
6.22.3.2
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
476
Class Documentation
6.22.3.3
6.22.3.4
6.22.3.5
6.22.4
6.22.4.1
int Left
Left.
6.22.4.2
int Top
Top.
6.22.4.3
int Right
Right.
6.22.4.4
int Bottom
Bottom.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.22.5
Property Documentation
6.22.5.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
477
478
Class Documentation
6.23
Public Attributes
UInt32 NumOfROI
Number of ROI for color compensation. This has to be a value between 1 and 10.
ColorCompensationROIStruct[ ] ColorCompensationROI
The 10 Red-Compensation ROIs. The NumOfROI field specified how many of these structures are initialized
with data.
6.23.1
Detailed Description
6.23.2
6.23.2.1
UInt32 NumOfROI
Number of ROI for color compensation. This has to be a value between 1 and 10.
6.23.2.2
ColorCompensationROIStruct [ ] ColorCompensationROI
The 10 Red-Compensation ROIs. The NumOfROI field specified how many of these structures are initialized with data.
The documentation for this struct was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.24
void AppendStopImageAcquisition ()
Append a StopImageAcquisition() command to the end of the Script.
Properties
List< Command > CommandList [get, set]
List of commands to be executed.
6.24.1
Detailed Description
6.24.2
6.24.2.1
void Clear ()
479
480
Class Documentation
6.24.2.2
6.24.2.3
6.24.2.4
void AppendStopImageAcquisition ()
6.24.2.5
6.24.2.6
6.24.3
Property Documentation
6.24.3.1
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
481
482
Class Documentation
6.25
Public Attributes
int cx
Width.
int cy
Height.
6.25.1
Detailed Description
6.25.2
6.25.2.1
Constructor.
Parameters:
cx Width
cy Height
6.25.3
6.25.3.1
int cx
Width.
6.25.3.2
int cy
Height.
The documentation for this struct was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.26
483
Public Attributes
Boolean IsGrabbing
Is the acquisition engine running?
UInt64 NumOfFramesDelivered
This is the number of acquired frames since the last acquisition start.
UInt64 NumOfFramesLostQueueUnderrun
This is the number of lost frames due to a queue under-run. If the application is not emptying the acquisition
queue as fast as the queue gets filled then the newly acquired frames will be dropped and this value will be
increased by 1.
UInt64 NumOfBuffersAnnounced
This is the number of frame buffers that have been announced to the acquisition engine using J_DataStream_AnnounceBuffer(). This will be the maximum number of frame buffers in the system
at any point in time.
UInt64 NumOfFramesQueued
This is the number of frame buffers available and ready for image acquisition. When a new frame is acquired
then it will be moved from this queue into the delivery queue and this value will be decreased by 1. The
application can return the frame buffer to this queue using J_DataStream_QueueBuffer() after
handling the new image delivery.
UInt64 NumOfFramesAwaitingDelivery
This is the number of frames that have been put into the delivery queue and are ready to be read and
processed by the application. When the application gets the image using J_Event_GetData() then
the frame buffer will automatically be removed from this delivery queue and the application then have to
manually call J_DataStream_QueueBuffer() to return the buffer to the acquisition queue again.
UInt64 NumOfFramesCorruptOnDelivery
This is the number of frames which have been added to the delivery queue despite the fact that they are
missing one or more packets. This will only happen if the STREAM_PARAM_CMD_PASS_CORRUPT_FRAMES parameter has been set to true using J_DataStream_SetStreamParam().
6.26.1
Detailed Description
484
Class Documentation
6.26.2
6.26.2.1
Boolean IsGrabbing
UInt64 NumOfFramesDelivered
This is the number of acquired frames since the last acquisition start.
6.26.2.3
UInt64 NumOfFramesLostQueueUnderrun
This is the number of lost frames due to a queue under-run. If the application is not emptying the acquisition
queue as fast as the queue gets filled then the newly acquired frames will be dropped and this value will be
increased by 1.
6.26.2.4
UInt64 NumOfBuffersAnnounced
This is the number of frame buffers that have been announced to the acquisition engine using J_DataStream_AnnounceBuffer(). This will be the maximum number of frame buffers in the system
at any point in time.
6.26.2.5
UInt64 NumOfFramesQueued
This is the number of frame buffers available and ready for image acquisition. When a new frame is
acquired then it will be moved from this queue into the delivery queue and this value will be decreased by
1. The application can return the frame buffer to this queue using J_DataStream_QueueBuffer()
after handling the new image delivery.
6.26.2.6
UInt64 NumOfFramesAwaitingDelivery
This is the number of frames that have been put into the delivery queue and are ready to be read and
processed by the application. When the application gets the image using J_Event_GetData() then
the frame buffer will automatically be removed from this delivery queue and the application then have to
manually call J_DataStream_QueueBuffer() to return the buffer to the acquisition queue again.
6.26.2.7
UInt64 NumOfFramesCorruptOnDelivery
This is the number of frames which have been added to the delivery queue despite the fact that they are
missing one or more packets. This will only happen if the STREAM_PARAM_CMD_PASS_CORRUPT_FRAMES parameter has been set to true using J_DataStream_SetStreamParam().
The documentation for this struct was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.27
485
This structure is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam().
Public Attributes
UInt32 CanResend
Flag indicating if the source can handle resends. !=0: Enable resends(default), =0: Disable resends.
UInt32 NumberOfBytesPerFrame
Total Number of bytes per frame.
UInt32 PassCorruptFrames
Flag indicating if corrupt frames are passed to the layer above. !=0: Enable, =0: Disable.
UInt32 MaxFramesInNotCompletedList
Max number of frames in not complete list.
UInt32 RxTimeoutsBeforeListFlush
Number of recieve timeouts before incomplete list is flushed / delivered.
UInt32 OutOfOrderPacketsBeforeResend
Out of order Packets before resend is issued.
UInt32 RxTimeout
Timeout in ms for recieve.
6.27.1
Detailed Description
This structure is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam().
Depending on which buffer information has been requested, different fields has to be read in order to
interpret the answer correctly
6.27.2
6.27.2.1
UInt32 CanResend
Flag indicating if the source can handle resends. !=0: Enable resends(default), =0: Disable resends.
6.27.2.2
UInt32 NumberOfBytesPerFrame
486
Class Documentation
6.27.2.3
UInt32 PassCorruptFrames
Flag indicating if corrupt frames are passed to the layer above. !=0: Enable, =0: Disable.
6.27.2.4
UInt32 MaxFramesInNotCompletedList
UInt32 RxTimeoutsBeforeListFlush
UInt32 OutOfOrderPacketsBeforeResend
UInt32 RxTimeout
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.28
487
Public Attributes
Double OpticalCenterX
Optical center X used to model possible displacement from optical axis.
Double OpticalCenterY
Optical center Y used to model possible displacement from optical axis.
Double FocalLengthX
Focal length X used for normalizing the lens distortion calculation. This is typically a value close to the
Width of the image in pixels.
Double FocalLengthY
Focal length Y used for normalizing the lens distortion calculation. If the pixels on the imager are square
then this is the same as FocalLengthX.
Double CoeffK1
Radial Distortion coefficient k1 for r 2 in Taylor series expansion around r=0:
X(1+k1r 2+k2r 4+k3r 6), Ycorr = Y(1+k1r 2+k2r 4+k3r 6).
Xcorr =
Double CoeffK2
Radial Distortion coefficient k2 for r 2 in Taylor series expansion around r=0:
X(1+k1r 2+k2r 4+k3r 6), Ycorr = Y(1+k1r 2+k2r 4+k3r 6).
Xcorr =
Double CoeffK3
Radial Distortion coefficient k3 for r 2 in Taylor series expansion around r=0: Xcorr =
X(1+k1r 2+k2r 4+k3r 6), Ycorr = Y(1+k1r 2+k2r 4+k3r 6) This value is normally set to 0
unless it is a fish-eye lens.
Double CoeffP1
Tangential
Distortion
coefficient
Ycorr=Y+[p1(r 2+2y 2)+2p2X].
p1.
p2.
Double CoeffP2
Tangential
Distortion
coefficient
Ycorr=Y+[p1(r 2+2y 2)+2p2X].
EInterpolationType InterpolationType
Lens Distortion Interpolation type.
6.28.1
Detailed Description
488
Class Documentation
6.28.2
6.28.2.1
Double OpticalCenterX
6.28.2.2
Double OpticalCenterY
6.28.2.3
Double FocalLengthX
Focal length X used for normalizing the lens distortion calculation. This is typically a value close to the
Width of the image in pixels.
6.28.2.4
Double FocalLengthY
Focal length Y used for normalizing the lens distortion calculation. If the pixels on the imager are square
then this is the same as FocalLengthX.
6.28.2.5
Double CoeffK1
6.28.2.6
Double CoeffK2
6.28.2.7
Xcorr =
Xcorr =
Double CoeffK3
Radial Distortion coefficient k3 for r 2 in Taylor series expansion around r=0: Xcorr =
X(1+k1r 2+k2r 4+k3r 6), Ycorr = Y(1+k1r 2+k2r 4+k3r 6) This value is normally set to 0
unless it is a fish-eye lens.
6.28.2.8
Double CoeffP1
Tangential
Distortion
coefficient
Ycorr=Y+[p1(r 2+2y 2)+2p2X].
6.28.2.9
p1.
p2.
Double CoeffP2
Tangential
Distortion
coefficient
Ycorr=Y+[p1(r 2+2y 2)+2p2X].
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
EInterpolationType InterpolationType
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
489
490
Class Documentation
6.29
User-Draw value structure. This is used by the J_IVW_CB_USER_DRAW_IMAGE and J_IVW_CB_USER_DRAW_VIEW_WINDOW Image View Window event.
Public Attributes
IntPtr hDeviceContext
Handle to the DeviceContext to be used when drawing the image overlay.
UInt32 Width
Width of the User Draw area.
UInt32 Height
Height of the User Draw area.
6.29.1
Detailed Description
User-Draw value structure. This is used by the J_IVW_CB_USER_DRAW_IMAGE and J_IVW_CB_USER_DRAW_VIEW_WINDOW Image View Window event.
6.29.2
6.29.2.1
IntPtr hDeviceContext
UInt32 Width
UInt32 Height
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
6.30
491
Zoom Position value structure. This is used by the J_IVW_CB_ZOOM_POS Image View Window event.
Public Attributes
POINT Offset
Offset like passed into J_Image_SetImageOffset() and J_Image_SetImageOffsetEx().
double ZoomRatioX
Zoom ratio in X-direction: 100.0=The original image is reduced to the window size. 1=1/100 of the original
images is expanded to the window size.
double ZoomRatioY
Zoom ratio in Y-direction: 100.0=The original image is reduced to the window size. 1=1/100 of the original
images is expanded to the window size.
6.30.1
Detailed Description
Zoom Position value structure. This is used by the J_IVW_CB_ZOOM_POS Image View Window event.
6.30.2
6.30.2.1
POINT Offset
double ZoomRatioX
Zoom ratio in X-direction: 100.0=The original image is reduced to the window size. 1=1/100 of the original
images is expanded to the window size.
6.30.2.3
double ZoomRatioY
Zoom ratio in Y-direction: 100.0=The original image is reduced to the window size. 1=1/100 of the original
images is expanded to the window size.
The documentation for this struct was generated from the following file:
Jai_Factory_Wrapper.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
492
Class Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Chapter 7
File Documentation
7.1
Classes
class CCamera
Camera object class used by the Managed Factory.
class Command
Command class used for scripting feature settings.
class Script
Script class used for feature value scripting.
7.1.1
Detailed Description
494
File Documentation
7.2
Classes
class CFactory
Factory object class.
7.2.1
Detailed Description
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
7.3
495
Classes
class Jai_FactoryWrapper
Wrapper class for the JAI SDK Jai_Factory.dll functions.
class FactoryErrorException
JAI SDK Factory Exceptions.
struct GenICamErrorInfo
GenICam Error Info.
struct ActionCommandAck
Action Command Acknowledge structure.
struct BufferInfoStruct
This structure is used for reading buffer information with J_DataStream_GetBufferInfo().
struct StreamInfoStruct
This structure is used for reading buffer information with J_DataStream_GetStreamInfo() or J_Image_GetStreamInfo().
struct StreamParameterStruct
This structure is used to get/set acquisition information using J_DataStream_GetParam() and J_DataStream_GetParam().
struct EventInfoData
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
struct DeviceEventData
Struct containing the information provided by a GigE Event to pass it on to the GenAPI.
struct POINT
Windows POINT implementation for pInvoke.
struct SIZE
Windows SIZE implementation for pInvoke.
struct RECT
Windows RECT implementation for pInvoke.
struct ImageInfo
Image information structure used in callback and image conversion functions.
struct PixelValue
Pixel value structure that will hold Mono8, Mono10, Mono12, Mono16, DIB24, RGB24, DIB32 and BGR48
pixels.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
496
File Documentation
struct IVWOptionValue
Option
type
used
in
GetViewWindowOption().
J_Image_SetViewWindowOption()
and
J_Image_-
struct IVWCallbackValue
Type of value passed on by the Image View Window callback delegate. The value to use depends on the
Callback Type.
struct ZoomPos
Zoom Position value structure. This is used by the J_IVW_CB_ZOOM_POS Image View Window event.
struct UserDrawInfo
User-Draw value structure. This is used by the J_IVW_CB_USER_DRAW_IMAGE and J_IVW_CB_USER_DRAW_VIEW_WINDOW Image View Window event.
struct LUTInfo
Structure containing LUT data.
struct HistogramInfo
Structure containing Histogram data.
struct ColorCompensationROIStruct
Structure containing Color-Compensation parameters. This is used for both Red-Compensation and GreenCompensation.
struct RedCompensationStruct
Structure containing Red-Compensation parameters.
struct GreenCompensationStruct
Structure containing Green-Compensation parameters.
struct UndistortStruct
Structure containing Lens Distortion Correction parameters.
7.3.1
Detailed Description
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
7.4
Classes
class CNode
GenICam Node object class used by the Managed Factory.
class IEnumValue
This class contains information about a single enumeration entry node inside an IEnumeration node.
7.4.1
Detailed Description
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
497
498
File Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Chapter 8
Example Documentation
8.1
ActionCommandSample/ActionCommandForm.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Net;
Microsoft.Win32;
namespace ActionCommandSample
{
public partial class ActionCommandForm : Form
{
CFactory myFactory;
UInt32 myDeviceKey = 1;
UInt32 myGroupKey = 1;
UInt32 myGroupMask = 1;
bool
myRequestAcknowledge = true;
UInt32 myAckCount = 1;
public ActionCommandForm(CFactory factory)
{
InitializeComponent();
myFactory = factory;
// We want to restore the last address from the registry
GetLastActionData();
}
public void GetLastActionData()
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(Application.Product
Name + "\\" + this.Name);
if (key != null)
{
object deviceKeyValue = key.GetValue("ActionCommandDeviceKey");
if (deviceKeyValue != null)
500
Example Documentation
{
myDeviceKey = Convert.ToUInt32(deviceKeyValue);
deviceKeyTextBox.Text = "0x" + myDeviceKey.ToString("X8");
}
object groupKeyValue = key.GetValue("ActionCommandGroupKey");
if (groupKeyValue != null)
{
myGroupKey = Convert.ToUInt32(groupKeyValue);
groupKeyTextBox.Text = "0x" + myGroupKey.ToString("X8");
}
object groupMaskValue = key.GetValue("ActionCommandGroupMask");
if (groupMaskValue != null)
{
myGroupMask = Convert.ToUInt32(groupMaskValue);
groupMaskTextBox.Text = "0x" + myGroupMask.ToString("X8");
}
object acknowledgeCountValue = key.GetValue("ActionCommandAckCoun
t");
if (acknowledgeCountValue != null)
{
myAckCount = Convert.ToUInt32(acknowledgeCountValue);
}
object requestAckValue = key.GetValue("ActionCommandRequestAck");
if (requestAckValue != null)
{
if (Convert.ToUInt32(groupMaskValue) == 0)
myRequestAcknowledge = false;
else
myRequestAcknowledge = true;
}
acknowledgeCountNumericUpDown.Value = Convert.ToDecimal(myAckCoun
t);
requestAcknowledgeCheckBox.Checked = myRequestAcknowledge;
acknowledgeCountNumericUpDown.Enabled = myRequestAcknowledge;
acknowledgeListBox.Enabled = myRequestAcknowledge;
expectedAcknowledeCountLabel.Enabled = myRequestAcknowledge;
}
}
private void SaveCurrentActionCommandData()
{
try
{
RegistryKey key = Registry.CurrentUser.CreateSubKey(Application.P
roductName + "\\" + this.Name);
if (key != null)
{
key.SetValue("ActionCommandDeviceKey", myDeviceKey);
key.SetValue("ActionCommandGroupKey", myGroupKey);
key.SetValue("ActionCommandGroupMask", myGroupMask);
if (myRequestAcknowledge)
key.SetValue("ActionCommandRequestAck", 1);
else
key.SetValue("ActionCommandRequestAck", 0);
key.SetValue("ActionCommandAckCount", myAckCount);
}
}
catch (Exception e)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.1 ActionCommandSample/ActionCommandForm.cs
{
System.Diagnostics.Debug.WriteLine(e.Message);
}
}
private void sendActionCommandButton_Click(object sender, EventArgs e)
{
// Parse the values from the Text Boxes
string valueString = deviceKeyTextBox.Text.ToUpper();
// Is this a hex number?
if (valueString.Contains("0X"))
{
valueString = valueString.Substring(valueString.IndexOf("0X") + 2
);
myDeviceKey = UInt32.Parse(valueString, System.Globalization.Numb
erStyles.HexNumber);
}
else // Assume decimal number
{
try
{
myDeviceKey = UInt32.Parse(valueString);
}
catch (Exception ex)
{
// We could not parse the address as decimal.
System.Diagnostics.Debug.WriteLine(ex.Message);
myDeviceKey = 0;
}
}
deviceKeyTextBox.Text = "0x" + myDeviceKey.ToString("X8");
valueString = groupKeyTextBox.Text.ToUpper();
// Is this a hex number?
if (valueString.Contains("0X"))
{
valueString = valueString.Substring(valueString.IndexOf("0X") + 2
);
myGroupKey = UInt32.Parse(valueString, System.Globalization.Numbe
rStyles.HexNumber);
}
else // Assume decimal number
{
try
{
myGroupKey = UInt32.Parse(valueString);
}
catch (Exception ex)
{
// We could not parse the address as decimal.
System.Diagnostics.Debug.WriteLine(ex.Message);
myGroupKey = 0;
}
}
groupKeyTextBox.Text = "0x" + myGroupKey.ToString("X8");
valueString = groupMaskTextBox.Text.ToUpper();
// Is this a hex number?
if (valueString.Contains("0X"))
{
valueString = valueString.Substring(valueString.IndexOf("0X") + 2
);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
501
502
Example Documentation
myGroupMask = UInt32.Parse(valueString, System.Globalization.Numb
erStyles.HexNumber);
}
else // Assume decimal number
{
try
{
myGroupMask = UInt32.Parse(valueString);
}
catch (Exception ex)
{
// We could not parse the address as decimal.
System.Diagnostics.Debug.WriteLine(ex.Message);
myGroupMask = 0;
}
}
groupMaskTextBox.Text = "0x" + myGroupMask.ToString("X8");
// Persist the last Data to the registry
SaveCurrentActionCommandData();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Execute the Action Command
if (myRequestAcknowledge)
{
acknowledgeListBox.Items.Clear();
Jai_FactoryWrapper.ActionCommandAck[] AckBufferArray = null;
error = myFactory.SendActionCommand(myDeviceKey, myGroupKey, myGr
oupMask, ref AckBufferArray, myAckCount);
if ((AckBufferArray != null) && (AckBufferArray.Length > 0))
{
for (int i = 0; i < AckBufferArray.Length; i++)
{
IPAddress myIPAddress = new IPAddress(AckBufferArray[i].I
PAddress);
System.Diagnostics.Debug.WriteLine("Got acknowledge from
Device " + myIPAddress.ToString());
acknowledgeListBox.Items.Add((i+1).ToString() + ") " + my
IPAddress.ToString());
}
}
else
{
acknowledgeListBox.Items.Add("No acknowledge");
}
}
else
{
error = myFactory.SendActionCommand(myDeviceKey, myGroupKey, myGr
oupMask);
}
if (error != Jai_FactoryWrapper.EFactoryError.Success)
MessageBox.Show(this, "Error executing Action Command!", Jai_Fact
oryWrapper.GetFactoryErrorString(error), MessageBoxButtons.OK, MessageBoxIcon.Err
or);
}
private void requestAcknowledgeCheckBox_CheckedChanged(object sender, Eve
ntArgs e)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.1 ActionCommandSample/ActionCommandForm.cs
myRequestAcknowledge = requestAcknowledgeCheckBox.Checked;
acknowledgeCountNumericUpDown.Enabled = myRequestAcknowledge;
acknowledgeListBox.Enabled = myRequestAcknowledge;
expectedAcknowledeCountLabel.Enabled = myRequestAcknowledge;
// Persist the last Data to the registry
SaveCurrentActionCommandData();
}
private void acknowledgeCountNumericUpDown_ValueChanged(object sender, Ev
entArgs e)
{
myAckCount = Convert.ToUInt32(acknowledgeCountNumericUpDown.Value);
// Persist the last Data to the registry
SaveCurrentActionCommandData();
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
503
504
8.2
Example Documentation
AsyncImageRecordingSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
namespace SimpleImageDisplaySample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
recordingModeComboBox.SelectedIndex = 0;
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString()
);
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString
());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.2 AsyncImageRecordingSample/Form1.cs
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.StartImageAcquisition(true, 5);
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.StopImageAcquisition();
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
// Attach an event that will be called every time the Async Recor
ding finishes
myCamera.AsyncImageRecordingDoneEvent += new CCamera.AsyncImageRe
cordingDoneHandler(myCamera_AsyncImageRecordingDoneEvent);
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.To
String());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.To
String());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToStrin
g());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
505
506
Example Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.2 AsyncImageRecordingSample/Form1.cs
507
if (res == DialogResult.Yes)
{
myCamera.StopAsyncImageRecording();
myCamera.FreeAsyncRecordedImages();
myCamera.StartAsyncImageRecording(Convert.ToInt32(capture
CountNumericUpDown.Value), (CCamera.AsyncImageRecordingMode)recordingModeComboBox
.SelectedIndex, Convert.ToInt32(skipCountNumericUpDown.Value));
}
}
else
{
myCamera.StartAsyncImageRecording(Convert.ToInt32(captureCoun
tNumericUpDown.Value), (CCamera.AsyncImageRecordingMode)recordingModeComboBox.Sel
ectedIndex, Convert.ToInt32(skipCountNumericUpDown.Value));
}
}
}
void myCamera_AsyncImageRecordingDoneEvent(int Count)
{
MessageBox.Show("Done capturing " + Count.ToString() + " images async
hronously!", "Asynch Image Capture");
}
private void stopCaptureButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
myCamera.StopAsyncImageRecording();
progressBar1.Style =
progressBar1.Minimum
progressBar1.Maximum
progressBar1.Value =
progressBar1.Enabled
ProgressBarStyle.Blocks;
= 0;
= myCamera.AsyncImageRecordingCount;
myCamera.TotalAsyncImagesRecordedCount;
= false;
}
}
private void replayButton_Click(object sender, EventArgs e)
{
// Here we have access to the stored images! Lets show them in an ima
ge window!!
//Create a replay window
if (myCamera != null && !myCamera.IsAsyncImageRecordingRunning && (my
Camera.TotalAsyncImagesRecordedCount > 0))
{
IntPtr WindowHandle = IntPtr.Zero;
// Try to read get the maximum width and height by looking for "S
ensorWidth" and "SensorHeight"
Int32 Width = 0;
Int32 Height = 0;
CNode WidthNode = myCamera.GetNode("Width");
CNode HeightNode = myCamera.GetNode("Height");
Width = Convert.ToInt32(WidthNode.Max);
Height = Convert.ToInt32(HeightNode.Max);
IntPtr nodeHandle;
uint BytesPerPixel = 4;
if (Jai_FactoryWrapper.J_Camera_GetNodeByName(myCamera.CameraHand
le, "PixelFormat", out nodeHandle) == Jai_FactoryWrapper.EFactoryError.Success)
{
Int64 value = 0;
if (Jai_FactoryWrapper.J_Node_GetValueInt64(nodeHandle, false
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
508
Example Documentation
, ref value) == Jai_FactoryWrapper.EFactoryError.Success)
{
Jai_FactoryWrapper.EPixelFormatType pixeltype = (Jai_Fact
oryWrapper.EPixelFormatType)value;
BytesPerPixel = Jai_FactoryWrapper.GetPixelTypeMemorySize
(pixeltype);
}
}
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Calculate the size of the window rect to display the images
int RectWidth = 0;
int RectHeight = 0;
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, 100, 100); ;
// Does the image fit in width?
if ((Width + 2 * System.Windows.Forms.SystemInformation.Border3DS
ize.Width) > System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width)
RectWidth = System.Windows.Forms.Screen.PrimaryScreen.Working
Area.Width - 2 * System.Windows.Forms.SystemInformation.Border3DSize.Width;
else
RectWidth = Width;
// Does the image fit in Height?
if ((Height + System.Windows.Forms.SystemInformation.Border3DSize
.Height + System.Windows.Forms.SystemInformation.CaptionHeight) > System.Windows.
Forms.Screen.PrimaryScreen.WorkingArea.Height)
RectHeight = System.Windows.Forms.Screen.PrimaryScreen.Workin
gArea.Height - System.Windows.Forms.SystemInformation.Border3DSize.Height - Syste
m.Windows.Forms.SystemInformation.CaptionHeight;
else
RectHeight = Height;
frameRect = new Jai_FactoryWrapper.RECT(0, 0, RectWidth, RectHeig
ht);
// Open the replay view
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.OverlappedStretch, "Replay", ref frameRect, ref maxSize, Int
Ptr.Zero, out WindowHandle);
if (WindowHandle != IntPtr.Zero)
{
List<Jai_FactoryWrapper.ImageInfo> imageList = myCamera.GetAs
yncRecordedImages();
if (imageList != null && (imageList.Count > 0))
{
for (int index = 0; index < myCamera.TotalAsyncImagesReco
rdedCount; index++)
{
Jai_FactoryWrapper.ImageInfo ii = imageList[index];
Jai_FactoryWrapper.J_Image_SetViewWindowTitle(WindowH
andle, "Replay (" + index.ToString() + "/" + myCamera.TotalAsyncImagesRecordedCou
nt.ToString() + ")");
Jai_FactoryWrapper.J_Image_ShowImage(WindowHandle, re
f ii, 4096, 4096, 4096);
Application.DoEvents();
Thread.Sleep(10);
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.2 AsyncImageRecordingSample/Form1.cs
509
Jai_FactoryWrapper.J_Image_CloseViewWindow(WindowHandle);
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if (myCamera != null)
{
startCaptureButton.Enabled = !myCamera.IsAsyncImageRecordingRunni
ng;
stopCaptureButton.Enabled = myCamera.IsAsyncImageRecordingRunning
;
replayButton.Enabled = !myCamera.IsAsyncImageRecordingRunning &&
(myCamera.TotalAsyncImagesRecordedCount > 0);
saveButton.Enabled = !myCamera.IsAsyncImageRecordingRunning && (m
yCamera.TotalAsyncImagesRecordedCount > 0);
if (!myCamera.IsAsyncImageRecordingRunning)
{
recordingStatusLabel.Text = "Recording Stopped.";
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myCamera.AsyncImageRecordingCount;
progressBar1.Value = myCamera.TotalAsyncImagesRecordedCount;
progressBar1.Enabled = false;
}
else
{
if (myCamera.GetAsyncImageRecordingMode == CCamera.AsyncImage
RecordingMode.List)
{
recordingStatusLabel.Text = "Recorded " + myCamera.TotalA
syncImagesRecordedCount.ToString() + " images out of " + myCamera.AsyncImageRecor
dingCount.ToString();
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myCamera.AsyncImageRecordingCount;
progressBar1.Value = myCamera.TotalAsyncImagesRecordedCou
nt;
}
else
{
if (myCamera.TotalAsyncImagesRecordedCount < myCamera.Asy
ncImageRecordingCount)
{
recordingStatusLabel.Text = "Recorded " + myCamera.To
talAsyncImagesRecordedCount.ToString() + " images out of " + myCamera.AsyncImageR
ecordingCount.ToString();
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myCamera.AsyncImageRecordingCo
unt;
progressBar1.Value = myCamera.TotalAsyncImagesRecorde
dCount;
}
else
{
recordingStatusLabel.Text = "Recording frames Cyclica
lly " + GetProgressChar();
progressBar1.Style = ProgressBarStyle.Marquee;
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
510
Example Documentation
StartButton.Enabled = !myCamera.IsAcquisitionRunning;
StopButton.Enabled = myCamera.IsAcquisitionRunning;
SearchButton.Enabled = !myCamera.IsAcquisitionRunning;
}
else
{
startCaptureButton.Enabled = false;
stopCaptureButton.Enabled = false;
replayButton.Enabled = false;
saveButton.Enabled = false;
SearchButton.Enabled = true;
}
}
private string GetProgressChar()
{
_progressCharIndex++;
if (_progressCharIndex > 3)
_progressCharIndex = 0;
switch (_progressCharIndex)
{
case 0:
return "/";
case 1:
return "--";
case 2:
return "\\";
case 3:
return "|";
}
return "";
}
private void saveButton_Click(object sender, EventArgs e)
{
// Have we got any images to save to disk?
if (myCamera != null && !myCamera.IsAsyncImageRecordingRunning && (my
Camera.TotalAsyncImagesRecordedCount > 0))
{
// Prompt the user if he wants to continue or not with the image
save
if (MessageBox.Show(this, "Image save might take long time!\nAre
you sure you want to continue?", "Image Save", MessageBoxButtons.OKCancel, Messag
eBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.OK)
{
// Disable the Image Recording buttons as long as we are savi
ng the images
asynchImageRecordingGroupBox.Enabled = false;
// Get the recorded images as a list
List<Jai_FactoryWrapper.ImageInfo> imageList = myCamera.GetAs
yncRecordedImages();
// Any images recorded?
if (imageList != null && (imageList.Count > 0))
{
// Run through the list of recorded images
for (int index = 0; index < myCamera.TotalAsyncImagesReco
rdedCount; index++)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryW
rapper.EFactoryError.Success;
// Get the recorded image at this index
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.2 AsyncImageRecordingSample/Form1.cs
Jai_FactoryWrapper.ImageInfo ii = imageList[index];
// Are we saving the images in "raw" format or in Tif
f?
if (saveRawCheckBox.Checked)
{
// Save the image to disk
error = Jai_FactoryWrapper.J_Image_SaveFileRaw(re
f ii, ".\\RecordedImage" + index.ToString("000") + ".raw");
}
else
{
// Create local image that will contain the conve
rted image
Jai_FactoryWrapper.ImageInfo localImageInfo = new
Jai_FactoryWrapper.ImageInfo();
// Allocate buffer that will contain the converte
d image
// In this sample we re-allocate the buffer overand-over because we assume that the recorded images could be
// of different size (If we have been using the S
equence functionality in the cameras)
error = Jai_FactoryWrapper.J_Image_Malloc(ref ii,
ref localImageInfo);
// Convert the raw image to image format
error = Jai_FactoryWrapper.J_Image_FromRawToImage
(ref ii, ref localImageInfo, 4096, 4096, 4096);
// Save the image to disk
error = Jai_FactoryWrapper.J_Image_SaveFile(ref l
ocalImageInfo, ".\\RecordedImage" + index.ToString("000") + ".tif");
//Free the conversion buffer
error = Jai_FactoryWrapper.J_Image_Free(ref local
ImageInfo);
}
Application.DoEvents();
}
MessageBox.Show(this, "The recorded images has been saved
!", "Image save", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
// Re-enable the Image Recording buttons
asynchImageRecordingGroupBox.Enabled = true;
}
}
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
511
512
8.3
Example Documentation
AVISample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
System.Drawing.Imaging;
System.Diagnostics;
AviFile;
namespace AVISample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
String myAVIFileName = "";
AviManager myAviManager;
VideoStream aviStream;
Jai_FactoryWrapper.EPixelFormatType pixelFormatType = Jai_FactoryWrapper.
EPixelFormatType.GVSP_PIX_MONO8;
Jai_FactoryWrapper.ImageInfo myDIBImageInfo = new Jai_FactoryWrapper.Imag
eInfo();
ColorPalette myMonoColorPalette = null;
uint myRGain = 4096;
uint myGGain = 4096;
uint myBGain = 4096;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString()
);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.3 AVISample/Form1.cs
513
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString
());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Get filename for the AVI file
if (saveFileDialog1.ShowDialog(this) == DialogResult.OK)
{
// Open the AVI file for writing
myAviManager = new AviManager(saveFileDialog1.FileName, false
, this.Handle);
if (myAviManager != null)
{
int Width = Convert.ToInt32(WidthNumericUpDown.Value);
int Height = Convert.ToInt32(HeightNumericUpDown.Value);
int ImageSize = Width * Height * 4;
PixelFormat pixelFormat = PixelFormat.Format32bppArgb;
CNode pfNode = myCamera.GetNode("PixelFormat");
if (pfNode != null)
pixelFormatType = (Jai_FactoryWrapper.EPixelFormatTyp
e)((Jai_FactoryDotNET.CNode.IEnumValue)pfNode.Value).Value;
if (optimizeForMono8CheckBox.Checked)
{
if (pixelFormatType == Jai_FactoryWrapper.EPixelForma
tType.GVSP_PIX_MONO8)
{
pixelFormat = PixelFormat.Format8bppIndexed;
ImageSize = Width * Height;
}
}
// Add the video stream to the AVI file
aviStream = myAviManager.AddVideoStream(selectCodecCheckB
ox.Checked, Convert.ToDouble(frameRateNumericUpDown.Value), ImageSize, Width, Hei
ght, pixelFormat);
myAVIFileName = saveFileDialog1.FileName;
}
else
{
MessageBox.Show(this, "Unable to create AVI Writer!", "AV
I Error");
}
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCall
Back(HandleImage);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
514
Example Documentation
myCamera.SkipImageDisplayWhenBusy = false;
myCamera.StartImageAcquisition(true, 5);
}
else
{
myAVIFileName = "";
}
}
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Stop the acquisition
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
// Close the AVI writer
if (myAviManager != null)
{
myAviManager.Close();
myAviManager = null;
}
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
// Get the gain values to be used for image conversion later
myCamera.GetGain(ref myRGain, ref myGGain, ref myBGain);
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.To
String());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.To
String());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToStrin
g());
WidthNumericUpDown.Enabled = true;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.3 AVISample/Form1.cs
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.
ToString());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.
ToString());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToStri
ng());
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
// Local callback function used for handle new images
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
if ((ImageInfo.PixelFormat == Jai_FactoryWrapper.EPixelFormatType.GVS
P_PIX_MONO8) && optimizeForMono8CheckBox.Checked)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
515
516
Example Documentation
// Now we have to create a Bitmap object that we later on can add
to the AVI file
Bitmap newImageBitmap = new Bitmap((int)ImageInfo.SizeX, (int)Ima
geInfo.SizeY, (int)ImageInfo.SizeX, System.Drawing.Imaging.PixelFormat.Format8bpp
Indexed, ImageInfo.ImageBuffer);
// Create a Monochrome palette (only once)
if (myMonoColorPalette == null)
{
Bitmap monoBitmap = new Bitmap(1, 1, PixelFormat.Format8bppIn
dexed);
myMonoColorPalette = monoBitmap.Palette;
for (int i = 0; i < 256; i++)
myMonoColorPalette.Entries[i] = Color.FromArgb(i, i, i);
}
// Set the Monochrome Color Palette
newImageBitmap.Palette = myMonoColorPalette;
// If the bitmap got created OK then simply add it to the AVI fil
e
if (newImageBitmap != null && aviStream != null)
{
aviStream.AddFrame(newImageBitmap);
}
}
else
{
// We have to allocate the conversion buffer - but we only want t
o do it once!
if (myDIBImageInfo.ImageBuffer == IntPtr.Zero)
{
error = Jai_FactoryWrapper.J_Image_MallocDIB(ref ImageInfo, r
ef myDIBImageInfo);
}
// OK - lets check if we have the DIB ImageInfo allocated
if (myDIBImageInfo.ImageBuffer != IntPtr.Zero)
{
// Now we convert from RAW to DIB in order to generate AGB co
lor image
error = Jai_FactoryWrapper.J_Image_FromRawToDIB(ref ImageInfo
, ref myDIBImageInfo, myRGain, myGGain, myBGain);
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
// Now we have to create a Bitmap object that we later on
can add to the AVI file
Bitmap newImageBitmap = new Bitmap((int)myDIBImageInfo.Si
zeX, (int)myDIBImageInfo.SizeY, (int)myDIBImageInfo.SizeX * 4, System.Drawing.Ima
ging.PixelFormat.Format32bppArgb, myDIBImageInfo.ImageBuffer);
// If the bitmap got created OK then simply add it to the
AVI file
if (newImageBitmap != null && aviStream != null)
{
aviStream.AddFrame(newImageBitmap);
}
}
}
}
return;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.3 AVISample/Form1.cs
// Make sure to stop acquisition before closing
StopButton_Click(null, null);
// Free the BID image info buffer (if it is allocated)
if (myDIBImageInfo.ImageBuffer != IntPtr.Zero)
{
Jai_FactoryWrapper.J_Image_Free(ref myDIBImageInfo);
myDIBImageInfo.ImageBuffer = IntPtr.Zero;
}
if (myCamera != null)
{
myCamera.Close();
return;
}
}
private void playAVIButton_Click(object sender, EventArgs e)
{
if (!myAVIFileName.Equals(""))
{
Process p;
ProcessStartInfo pInfo;
pInfo = new ProcessStartInfo();
pInfo.Verb = "open";
pInfo.FileName = myAVIFileName;
pInfo.UseShellExecute = true;
p = Process.Start(pInfo);
}
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
517
518
8.4
Example Documentation
ChildWindowSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace SimpleImageDisplaySample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.4 ChildWindowSample/Form1.cs
{
// Set the "Stretch flag"
myCamera.StretchLiveVideo = stretchCheckBox.Checked;
// Start the image acquisition with the picturebox windows handle. If
the handle is IntPtr.Zero then a new window will be created
myCamera.StartImageAcquisition(true, 5, pictureBox1.Handle);
StartButton.Enabled = false;
StopButton.Enabled = true;
stretchCheckBox.Enabled = false;
}
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
myCamera.StopImageAcquisition();
StartButton.Enabled = true;
StopButton.Enabled = false;
stretchCheckBox.Enabled = true;
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
StartButton.Enabled = true;
StopButton.Enabled = false;
stretchCheckBox.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.ToStrin
g());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.ToStrin
g());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToString());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
519
520
Example Documentation
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainTrackBar.TickFrequency = (GainTrackBar.Maximum - GainTrackBar.
Minimum) / 10;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = false;
StopButton.Enabled = false;
stretchCheckBox.Enabled = false;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = false;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
myCamera.Close();
}
private void Form1_Resize(object sender, EventArgs e)
{
// Here we need to resize the Child Window image display
if (myCamera != null)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.4 ChildWindowSample/Form1.cs
521
Jai_FactoryWrapper.RECT newRectSize;
if (myCamera.StretchLiveVideo)
newRectSize = new Jai_FactoryWrapper.RECT(0, 0, pictureBox1.Wi
dth, pictureBox1.Height);
else
newRectSize = new Jai_FactoryWrapper.RECT(0, 0, Convert.ToInt3
2(myCamera.GetNode("Width").Max), Convert.ToInt32(myCamera.GetNode("Height").Max)
);
Jai_FactoryWrapper.J_Image_ResizeChildWindow(myCamera.WindowHandle
, ref newRectSize);
}
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
522
8.5
Example Documentation
ConnectionDelegateSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace ConnectionDelegateSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
// Update connection status label with current connection status
ConnectionStatusLabel.Text = myCamera.ConnectionStatus.ToString();
// Attach to NewConnectionStatusDelegate in order to get notified ev
ery time the connection status changes
myCamera.NewConnectionStatusDelegate += new Jai_FactoryWrapper.Connec
tionStatusCallBack(myCamera_NewConnectionStatusDelegate);
}
else
{
MessageBox.Show("No Cameras Found!");
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.5 ConnectionDelegateSample/Form1.cs
void myCamera_NewConnectionStatusDelegate(CCamera camera, Jai_FactoryWrappe
r.EDeviceConnectionType connectionStatus)
{
// Is this called from the UI thread?
if (!ConnectionStatusLabel.InvokeRequired)
{
// Simply update the label with the new connection status
ConnectionStatusLabel.Text = connectionStatus.ToString();
}
else
{
// Since this delegate is not called from the UI thread then we need
to Invoke another delegate that will update the label
object[] myArray = new object[1];
myArray[0] = connectionStatus;
BeginInvoke(new UpdateConnectionStatusDelegate(UpdateConnectionStatus
Label), myArray);
}
}
public delegate void UpdateConnectionStatusDelegate(Jai_FactoryWrapper.EDev
iceConnectionType newConnectionStatus);
void UpdateConnectionStatusLabel(Jai_FactoryWrapper.EDeviceConnectionType n
ewConnectionStatus)
{
ConnectionStatusLabel.Text = myCamera.ConnectionStatus.ToString();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myFactory != null)
myFactory.Close();
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
523
524
8.6
Example Documentation
ConsoleApplication/Program.cs
System;
System.Collections.Generic;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace ConsoleApplication
{
class Program
{
static Jai_FactoryDotNET.CFactory factory;
static void Main(string[] args)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
factory = new Jai_FactoryDotNET.CFactory();
error = factory.Open("");
CFactory.EDriverType myPreferredDriverType = CFactory.EDriverType.Filter
Driver;
Console.Out.WriteLine("Factory version = " + factory.Version);
Console.Out.WriteLine("Build Date =
" + factory.BuildDate);
Console.Out.WriteLine("Build Time =
" + factory.BuildTime);
Console.Out.WriteLine("Manufacturer =
" + factory.Manufacturer);
bool AnyChanges = factory.UpdateCameraList(myPreferredDriverType);
if (factory.NumOfCameras > 0)
{
int index = 1;
foreach (CCamera c in factory.CameraList)
{
Console.Out.WriteLine(index.ToString() + ") " + c.ModelName);
index++;
}
Console.Out.WriteLine("Starting Live Video from a camera!\nSelect cam
era number and press Return to continue.");
int CameraChar = Console.In.Read();
int CameraIndex = 0;
// Did the user press 1-9
if ((CameraChar >= 0x31) && (CameraChar <= 0x39))
CameraIndex = CameraChar - 0x31;
factory.CameraList[CameraIndex].Open();
factory.CameraList[CameraIndex].StartImageAcquisition(true, 5);
Console.Out.WriteLine("Press any key to exit");
while (!Console.KeyAvailable)
{
Application.DoEvents();
}
factory.CameraList[CameraIndex].StopImageAcquisition();
}
else
{
Console.Out.WriteLine("No Cameras found!\nPress Return to continue.")
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.6 ConsoleApplication/Program.cs
;
Console.In.ReadLine();
}
factory.Close();
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
525
526
8.7
Example Documentation
CSAutoExposureSample/AutoExposureSampleForm.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace CSAutoExposureSample
{
public partial class AutoExposureSampleForm : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
CNode myExposureNode;
bool m_bAutoExposure = true;
FF
bool m_bUseAverage = true;
used, false if Peak is used
int m_Width = 0;
int m_Height = 0;
Jai_FactoryWrapper.RECT m_MeasureRect;
erage in
bool m_UpdateUI = false;
alling that the GUI needs to be updated
int m_OldRAverage;
he last measured average in the image
int m_OldGAverage;
he last measured average in the image
int m_OldBAverage;
he last measured average in the image
ALC m_ALCController = new ALC();
osed-loop controller
Jai_FactoryWrapper.ImageInfo m_ConversionBuffer;
nverting images before average is calculated
// True if Average is
// Width of image
// Height of image
// Area to measure Av
// Flag used for sign
// Cached value for t
// Cached value for t
// Cached value for t
// The Cl
// Buffer used for co
public AutoExposureSampleForm()
{
// Initialize the ALC controller
m_ALCController.SetALCType(ALC.EALCType.MinGainPriority);
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
m_ALCController.SetThreshold(0.02);
// Threshold of +-0.01 re
lative error
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.7 CSAutoExposureSample/AutoExposureSampleForm.cs
ALCTypeComboBox.SelectedIndex = 0;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
enableALCcheckBox.Checked = m_bAutoExposure;
EnableControls();
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
if (myCamera.ModelName.Contains("030GE"))
{
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
}
else if (myCamera.ModelName.Contains("040GE"))
{
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
}
else if (myCamera.ModelName.Contains("080GE"))
{
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
}
else if (myCamera.ModelName.Contains("140GE"))
{
m_ALCController.SetKGain(25.0);
m_ALCController.SetKExposure(3.0);
}
else if (myCamera.ModelName.Contains("200GE"))
{
m_ALCController.SetKGain(35.0);
m_ALCController.SetKExposure(4.0);
}
else if (myCamera.ModelName.Contains("500GE"))
{
m_ALCController.SetKGain(15.0);
m_ALCController.SetKExposure(3.0);
}
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
m_Width = int.Parse(myWidthNode.Value.ToString());
widthTrackBar.Minimum = Convert.ToInt32(myWidthNode.Min);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
527
528
Example Documentation
widthTrackBar.Maximum = Convert.ToInt32(myWidthNode.Max);
widthTrackBar.Value = Convert.ToInt32(myWidthNode.Value);
widthTrackBar.TickFrequency = (widthTrackBar.Maximum - widthT
rackBar.Minimum) / 20;
widthTextBox.Text = myWidthNode.Value.ToString();
}
else
m_Width = 0;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
m_Height = int.Parse(myHeightNode.Value.ToString());
heightTrackBar.Minimum = Convert.ToInt32(myHeightNode.Min);
heightTrackBar.Maximum = Convert.ToInt32(myHeightNode.Max);
heightTrackBar.Value = Convert.ToInt32(myHeightNode.Value);
heightTrackBar.TickFrequency = (heightTrackBar.Maximum - heig
htTrackBar.Minimum) / 20;
heightTextBox.Text = myHeightNode.Value.ToString();
}
else
m_Height = 0;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
// Update the values inside the ALC controller
m_ALCController.SetMinGain(Convert.ToInt32(myGainNode.Min));
m_ALCController.SetMaxGain(Convert.ToInt32(myGainNode.Max));
m_ALCController.SetCurrentGain(Convert.ToInt32(myGainNode.Val
ue));
gainTrackBar.Minimum = Convert.ToInt32(myGainNode.Min);
gainTrackBar.Maximum = Convert.ToInt32(myGainNode.Max);
gainTrackBar.Value = Convert.ToInt32(myGainNode.Value);
gainTrackBar.TickFrequency = (gainTrackBar.Maximum - gainTrac
kBar.Minimum) / 20;
gainTextBox.Text = myGainNode.Value.ToString();
minGainNumericUpDown.Minimum = Convert.ToInt32(myGainNode.Min
);
minGainNumericUpDown.Maximum = Convert.ToInt32(myGainNode.Max
);
minGainNumericUpDown.Value = Convert.ToInt32(myGainNode.Min);
maxGainNumericUpDown.Minimum = Convert.ToInt32(myGainNode.Min
);
maxGainNumericUpDown.Maximum = Convert.ToInt32(myGainNode.Max
);
maxGainNumericUpDown.Value = Convert.ToInt32(myGainNode.Max);
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.7 CSAutoExposureSample/AutoExposureSampleForm.cs
m_ALCController.SetCurrentExposure(Convert.ToInt32(myExposure
Node.Value));
exposureTrackBar.Minimum = Convert.ToInt32(myExposureNode.Min
);
exposureTrackBar.Maximum = Convert.ToInt32(myExposureNode.Max
);
exposureTrackBar.Value = Convert.ToInt32(myExposureNode.Value
);
exposureTrackBar.TickFrequency = (exposureTrackBar.Maximum exposureTrackBar.Minimum) / 20;
exposureTextBox.Text = myExposureNode.Value.ToString();
minExposureNumericUpDown.Minimum = Convert.ToInt32(myExposure
Node.Min);
minExposureNumericUpDown.Maximum = Convert.ToInt32(myExposure
Node.Max);
minExposureNumericUpDown.Value = Convert.ToInt32(myExposureNo
de.Min);
maxExposureNumericUpDown.Minimum = Convert.ToInt32(myExposure
Node.Min);
maxExposureNumericUpDown.Maximum = Convert.ToInt32(myExposure
Node.Max);
maxExposureNumericUpDown.Value = Convert.ToInt32(myExposureNo
de.Max);
}
object pixelformatValue = myCamera.GetNodeValue("PixelFormat");
CNode.IEnumValue enumValue = pixelformatValue as CNode.IEnumValue
;
uint BytesPerPixel = Jai_FactoryWrapper.GetPixelTypeMemorySize((J
ai_FactoryWrapper.EPixelFormatType)enumValue.Value);
if (BytesPerPixel == 1)
{
m_ALCController.SetSetPoint(128);
setpointTrackBar.Minimum = 0;
setpointTrackBar.Maximum = 255;
setpointTrackBar.Value = m_ALCController.GetSetPoint();
setpointTextBox.Text = setpointTrackBar.Value.ToString();
setpointTrackBar.TickFrequency = 255 / 20;
}
else
{
m_ALCController.SetSetPoint(32768);
setpointTrackBar.Minimum = 0;
setpointTrackBar.Maximum = 65535;
setpointTrackBar.Value = m_ALCController.GetSetPoint();
setpointTextBox.Text = setpointTrackBar.Value.ToString();
setpointTrackBar.TickFrequency = 65535 / 20;
}
// Set up average measurement ROI as centre 1/3 of the image area
as default
m_MeasureRect.Left = m_Width / 3;
m_MeasureRect.Top = m_Width / 3;
m_MeasureRect.Right = m_Width * 2 / 3;
m_MeasureRect.Bottom = m_Height * 2 / 3;
roiwidthNumericUpDown.Minimum = 0;
roiwidthNumericUpDown.Maximum = m_Width;
roiwidthNumericUpDown.Value = m_MeasureRect.Right - m_MeasureRect
.Left;
roiheightNumericUpDown.Minimum = 0;
roiheightNumericUpDown.Maximum = m_Height;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
529
530
Example Documentation
roiheightNumericUpDown.Value = m_MeasureRect.Bottom - m_MeasureRe
ct.Top;
xposNumericUpDown.Minimum = 0;
xposNumericUpDown.Maximum = m_Width;
xposNumericUpDown.Value = m_MeasureRect.Left;
yposNumericUpDown.Minimum = 0;
yposNumericUpDown.Maximum = m_Width;
yposNumericUpDown.Value = m_MeasureRect.Top;
StartButton.Enabled = true;
StopButton.Enabled = true;
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
MessageBox.Show("No Cameras Found!");
}
}
private void EnableControls()
{
if (myCamera != null)
{
StartButton.Enabled = myCamera.IsOpen ? myCamera.IsAcquisitionRun
ning ? false : true : false;
StopButton.Enabled = myCamera.IsOpen ? myCamera.IsAcquisitionRunn
ing ? true : false : false;
heightTrackBar.Enabled = myCamera.IsOpen ? myCamera.IsAcquisition
Running ? false : true : false;
widthTrackBar.Enabled = myCamera.IsOpen ? myCamera.IsAcquisitionR
unning ? false : true : false;
setpointTrackBar.Enabled = m_bAutoExposure ? true : false;
// The Gain and Exposure sliders depend on the actual ALC mode!
gainTrackBar.Enabled = myCamera.IsOpen ? m_bAutoExposure ? (m_ALC
Controller.GetALCType() == ALC.EALCType.ExposureOnly) ? true : false : true : fal
se;
exposureTrackBar.Enabled = myCamera.IsOpen ? m_bAutoExposure ? (m
_ALCController.GetALCType() == ALC.EALCType.GainOnly) ? true : false : true : fal
se;
}
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
myCamera.StartImageAcquisition(true, 5);
}
timer1.Enabled = true;
EnableControls();
}
private void StopButton_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
if (myCamera != null)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.7 CSAutoExposureSample/AutoExposureSampleForm.cs
531
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
}
EnableControls();
}
// Local callback function used for handle new images
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Get average value and calculate new control parameters:
Jai_FactoryWrapper.PixelValue Average = new Jai_FactoryWrapper.PixelV
alue();
Average.BGR48_R = 0;
Average.BGR48_G = 0;
Average.BGR48_B = 0;
// We need to allocate conversion buffer once
if (m_ConversionBuffer.ImageBuffer == IntPtr.Zero)
error = Jai_FactoryWrapper.J_Image_Malloc(ref ImageInfo, ref m_Co
nversionBuffer);
// Then we convert into 48bpp image format
error = Jai_FactoryWrapper.J_Image_FromRawToImage(ref ImageInfo, ref
m_ConversionBuffer, Jai_FactoryWrapper.EColorInterpolationAlgorithm.BayerStandard
Multiprocessor, 4096, 4096, 4096);
// .. and then we can calculate the average value for the measurement
ROI
error = Jai_FactoryWrapper.J_Image_GetAverage(ref m_ConversionBuffer,
ref m_MeasureRect, ref Average);
//
//
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
532
Example Documentation
//if ((int)Peak.G16 != m_OldGPeak)
//{
//
m_OldGPeak = (int)Peak.G16;
//
m_UpdateUI = true;
//}
//if ((int)Peak.B16 != m_OldBPeak)
//{
//
m_OldBPeak = (int)Peak.B16;
//
m_UpdateUI = true;
//}
// Is the ALC active?
if (m_bAutoExposure)
{
// Calculate will return true is any changes has been made to eit
her Gain or Exposure
bool changes = false;
if (m_bUseAverage)
changes = m_ALCController.Calculate(average);
else
changes = m_ALCController.Calculate(peak);
if (changes)
{
// Send the new values to the camera
UpdateGainAndExposureValues();
m_UpdateUI = true;
}
}
return;
}
private void UpdateGainAndExposureValues()
{
if (myGainNode != null)
myGainNode.Value = m_ALCController.GetCurrentGain();
if (myExposureNode != null)
myExposureNode.Value = m_ALCController.GetCurrentExposure();
}
private void AutoExposureSampleForm_FormClosing(object sender, FormClosin
gEventArgs e)
{
if (myCamera != null)
{
myCamera.Close();
return;
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if (m_UpdateUI)
{
// Update UI
averageRTextBox.Text = m_OldRAverage.ToString();
averageGTextBox.Text = m_OldGAverage.ToString();
averageBTextBox.Text = m_OldBAverage.ToString();
int newGain = m_ALCController.GetCurrentGain();
gainTrackBar.Value = newGain;
gainTextBox.Text = newGain.ToString();
int newExposureTime = m_ALCController.GetCurrentExposure();
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.7 CSAutoExposureSample/AutoExposureSampleForm.cs
exposureTrackBar.Value = newExposureTime;
exposureTextBox.Text = newExposureTime.ToString();
m_UpdateUI = false;
}
}
private void enableALCcheckBox_CheckedChanged(object sender, EventArgs e)
{
m_bAutoExposure = enableALCcheckBox.Checked;
EnableControls();
}
private void ALCTypeComboBox_SelectedIndexChanged(object sender, EventArg
s e)
{
m_ALCController.SetALCType((ALC.EALCType) ALCTypeComboBox.SelectedInd
ex);
EnableControls();
}
private void setpointTrackBar_Scroll(object sender, EventArgs e)
{
m_ALCController.SetSetPoint(setpointTrackBar.Value);
setpointTextBox.Text = setpointTrackBar.Value.ToString();
}
private void minGainNumericUpDown_ValueChanged(object sender, EventArgs e
)
{
int minGain = Convert.ToInt32(minGainNumericUpDown.Value);
// When we adjust the Min gain then we should adjust the current gain
accordingly in case the
// current gain is outside the new boundries
if (m_ALCController.SetMinGain(minGain))
{
int currentGain = m_ALCController.GetCurrentGain();
myGainNode.Value = currentGain;
gainTrackBar.Value = currentGain;
gainTextBox.Text = currentGain.ToString();
}
}
private void maxGainNumericUpDown_ValueChanged(object sender, EventArgs e
)
{
int maxGain = Convert.ToInt32(maxGainNumericUpDown.Value);
// When we adjust the Min gain then we should adjust the current gain
accordingly in case the
// current gain is outside the new boundries
if (m_ALCController.SetMaxGain(maxGain))
{
int currentGain = m_ALCController.GetCurrentGain();
myGainNode.Value = currentGain;
gainTrackBar.Value = currentGain;
gainTextBox.Text = currentGain.ToString();
}
}
private void minExposureNumericUpDown_ValueChanged(object sender, EventAr
gs e)
{
int minExposure = Convert.ToInt32(minExposureNumericUpDown.Value);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
533
534
Example Documentation
// When we adjust the Min gain then we should adjust the current gain
accordingly in case the
// current gain is outside the new boundries
if (m_ALCController.SetMinExposure(minExposure))
{
int currentExposure = m_ALCController.GetCurrentExposure();
myExposureNode.Value = currentExposure;
exposureTrackBar.Value = currentExposure;
exposureTextBox.Text = currentExposure.ToString();
}
}
private void maxExposureNumericUpDown_ValueChanged(object sender, EventAr
gs e)
{
int maxExposure = Convert.ToInt32(maxExposureNumericUpDown.Value);
// When we adjust the Min gain then we should adjust the current gain
accordingly in case the
// current gain is outside the new boundries
if (m_ALCController.SetMaxExposure(maxExposure))
{
int currentExposure = m_ALCController.GetCurrentExposure();
myExposureNode.Value = currentExposure;
exposureTrackBar.Value = currentExposure;
exposureTextBox.Text = currentExposure.ToString();
}
}
private void xposNumericUpDown_ValueChanged(object sender, EventArgs e)
{
m_MeasureRect.Left = Convert.ToInt32(xposNumericUpDown.Value);
m_MeasureRect.Right = m_MeasureRect.Left + Convert.ToInt32(roiwidthNu
mericUpDown.Value);
}
private void yposNumericUpDown_ValueChanged(object sender, EventArgs e)
{
m_MeasureRect.Top = Convert.ToInt32(yposNumericUpDown.Value);
m_MeasureRect.Bottom = m_MeasureRect.Top + Convert.ToInt32(roiheightN
umericUpDown.Value);
}
private void roiwidthNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
m_MeasureRect.Right = m_MeasureRect.Left + Convert.ToInt32(roiwidthNu
mericUpDown.Value);
}
private void roiheightNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
m_MeasureRect.Bottom = m_MeasureRect.Top + Convert.ToInt32(roiheightN
umericUpDown.Value);
}
private void gainTrackBar_Scroll(object sender, EventArgs e)
{
// If the auto exposure is inactive then the user can control the val
ues directly
if (!m_bAutoExposure || (m_ALCController.GetALCType() == ALC.EALCType
.ExposureOnly))
{
// Set Value
myGainNode.Value = gainTrackBar.Value;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.7 CSAutoExposureSample/AutoExposureSampleForm.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
535
536
8.8
Example Documentation
CSharpSampleMulticastMaster/CSharpSampleMulticastMaster/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
rj2_cs.Forms;
System.Net;
System.Runtime.InteropServices;
namespace CSharpSampleMulticastMaster
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// Default multicast IP address
// Must be from 224.0.1.0 to 239.255.255.255 for muticasting
UInt32 m_McIpAddress = 0xef000001;
//------------------------------------------------------------------------// Form1
//------------------------------------------------------------------------public Form1()
{
InitializeComponent();
// Indicate default IP address
textIpAddress.Notation = IPAddressTextBox.IPNotation.IPv4Decimal;
IPAddress ipaddr = new IPAddress((Int32)IPAddress.HostToNetworkOrder((In
t32)m_McIpAddress));
textIpAddress.Text = ipaddr.ToString();
// Open the factory with the default Registry database
Jai_FactoryWrapper.EFactoryError error = myFactory.Open("");
// Search cameras
buttonSearchCameras_Click(null, null);
}
//------------------------------------------------------------------------// Form1_FormClosing
//------------------------------------------------------------------------private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
// Close the camera
buttonCloseCamera_Click(null, null);
// Close the factory
myFactory.Close();
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.8 CSharpSampleMulticastMaster/CSharpSampleMulticastMaster/Form1.cs
//------------------------------------------------------------------------// buttonSearchCameras_Click
//------------------------------------------------------------------------private void buttonSearchCameras_Click(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count <= 0)
{
label1.Text = "No camera was found!";
buttonOpenCamera.Enabled = false;
textIpAddress.Enabled = false;
}
else
{
// Indicate the camera ID
label1.Text = myFactory.CameraList[0].CameraID;
buttonOpenCamera.Enabled = true;
textIpAddress.Enabled = true;
}
buttonCloseCamera.Enabled = false;
buttonStart.Enabled = false;
buttonStop.Enabled = false;
Cursor = Cursors.Default;
}
//------------------------------------------------------------------------// buttonOpenCamera_Click
//------------------------------------------------------------------------private void buttonOpenCamera_Click(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
if (myFactory.CameraList.Count > 0)
{
// Convert it to the format required in camera
IPAddress ipaddr = IPAddress.Parse(textIpAddress.GetPureIPAddress());
byte[] addressbytes = ipaddr.GetAddressBytes();
m_McIpAddress = (UInt32)IPAddress.HostToNetworkOrder(Marshal.ReadInt3
2(addressbytes, 0));
// Get the camera found first
myCamera = myFactory.CameraList[0];
// Open the camera
myCamera.Open(Jai_FactoryWrapper.EDeviceAccessFlags.Control, m_McIpAd
dress);
buttonOpenCamera.Enabled = false;
buttonCloseCamera.Enabled = true;
buttonStart.Enabled = true;
buttonStop.Enabled = false;
textIpAddress.Enabled = false;
}
Cursor = Cursors.Default;
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
537
538
Example Documentation
//------------------------------------------------------------------------// buttonCloseCamera_Click
//------------------------------------------------------------------------private void buttonCloseCamera_Click(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
if (myCamera != null)
{
// Close the camera
myCamera.Close();
myCamera = null;
buttonOpenCamera.Enabled = true;
buttonCloseCamera.Enabled = false;
buttonStart.Enabled = false;
buttonStop.Enabled = false;
textIpAddress.Enabled = true;
}
Cursor = Cursors.Default;
}
//------------------------------------------------------------------------// buttonStart_Click
//------------------------------------------------------------------------private void buttonStart_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Start acquisition
myCamera.StartImageAcquisition(true, 5, m_McIpAddress);
buttonStart.Enabled = false;
buttonStop.Enabled = true;
buttonCloseCamera.Enabled = false;
}
}
//------------------------------------------------------------------------// buttonStop_Click
//------------------------------------------------------------------------private void buttonStop_Click(object sender, EventArgs e)
{
if (myCamera != null && myCamera.IsAcquisitionRunning)
{
// Stop acquisition
myCamera.StopImageAcquisition();
buttonStart.Enabled = true;
buttonStop.Enabled = false;
buttonCloseCamera.Enabled = true;
}
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.9 CSharpSampleMulticastSlave/CSharpSampleMulticastSlave/Form1.cs
8.9
CSharpSampleMulticastSlave/CSharpSampleMulticastSlave/Form1.cs
539
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Runtime.InteropServices;
System.Net;
namespace CSharpSampleMulticastSlave
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
//------------------------------------------------------------------------// Form1
//------------------------------------------------------------------------public Form1()
{
InitializeComponent();
// Open the factory with the default Registry database
Jai_FactoryWrapper.EFactoryError error = myFactory.Open("");
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Get the camera found first
myCamera = myFactory.CameraList[0];
// Open the camera with slave mode
myCamera.Open(Jai_FactoryWrapper.EDeviceAccessFlags.ReadOnly, 0);
// Get and indicate the camera ID
label1.Text = myCamera.CameraID;
// Read and indicate IP address from the camera
ReadIPaddress();
buttonStart.Enabled = true;
buttonStop.Enabled = false;
}
else
{
label1.Text = "No camera was found!";
buttonStart.Enabled = false;
buttonStop.Enabled = false;
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
540
Example Documentation
//------------------------------------------------------------------------// Form1_FormClosing
//------------------------------------------------------------------------private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
{
// Close the camera
myCamera.Close();
}
// Close the factory
myFactory.Close();
}
//------------------------------------------------------------------------// buttonStart_Click
//------------------------------------------------------------------------private void buttonStart_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// We need to be sure that the values in the camera are re-read becau
se the
// Master application might have changed the image size!
// This is done by invalidating the node values
Jai_FactoryWrapper.J_Camera_InvalidateNodes(myCamera.CameraHandle);
// Start acquisition
myCamera.StartImageAcquisition(true, 5);
buttonStart.Enabled = false;
buttonStop.Enabled = true;
}
}
//------------------------------------------------------------------------// buttonStop_Click
//------------------------------------------------------------------------private void buttonStop_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Stop acquisition
myCamera.StopImageAcquisition();
buttonStart.Enabled = true;
buttonStop.Enabled = false;
}
}
//------------------------------------------------------------------------// ReadIPaddress
//------------------------------------------------------------------------private void ReadIPaddress()
{
// Allocate the managed buffer to hold the data:
byte[] data = new byte[4];
// Allocate a handle and pin the data in memory so we can get a pointer
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.9 CSharpSampleMulticastSlave/CSharpSampleMulticastSlave/Form1.cs
to data area:
GCHandle gch = GCHandle.Alloc(data, GCHandleType.Pinned);
// Get the pointer of the data inside managed array
IntPtr bufferPtr = gch.AddrOfPinnedObject();
// Read SCDA0 reg. (First Stream Channel Destination Address)
uint size = 4;
Jai_FactoryWrapper.EFactoryError retsta = Jai_FactoryWrapper.J_Camera_Re
adData(myCamera.CameraHandle, 0x0D18, bufferPtr, ref size);
IPAddress ipaddress = new IPAddress(data);
// Indicate IP address
textIpAddress.Text = ipaddress.ToString();
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
541
542
Example Documentation
8.10
CSharpSwTrigger/CSharpSwTrigger/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace CSharpSwTrigger
{
public partial class Form1 : Form
{
CFactory myFactory = new CFactory();
CCamera myCamera = null;
public int iOldSelectedIndex; // Selected camera entry in the ListBox
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the Factory
error = myFactory.Open("");
statusBarLabel.Text = "Searching for cameras...";
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
camListComboBox.Items.Clear(); // delete camera list from combo b
ox
// Device discovery using filter driver
myFactory.UpdateCameraList(CFactory.EDriverType.Undefined);
if (myFactory.CameraList.Count > 0)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
string sList = myFactory.CameraList[i].ModelName;
if (myFactory.CameraList[i].CameraID.Contains("INT=>FD"))
sList += " (Filter Driver)";
else if (myFactory.CameraList[i].CameraID.Contains("INT=>
SD"))
sList += " (Socket Driver)";
camListComboBox.Items.Add(sList);
}
}
else
{
MessageBox.Show("No camera found");
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.10 CSharpSwTrigger/CSharpSwTrigger/Form1.cs
statusBarLabel.Text = "Found " + myFactory.CameraList.Count.ToStr
ing() + " camera(s). Select camera from the ListBox to open it.";
}
else
{
showErrorMsg(error);
//error handling?
}
}
private void Form1_Load(object sender, EventArgs e)
{
// Bind the value member of the trackbar to the textbox.
widthTextBox.DataBindings.Add("Text", widthTrackBar, "Value");
heightTextBox.DataBindings.Add("Text", heightTrackBar, "Value");
gainTextBox.DataBindings.Add("Text", gainTrackBar, "Value");
}
private void showErrorMsg(Jai_FactoryWrapper.EFactoryError error)
{
String sErrorMsg = "Error = " + error.ToString();
MessageBox.Show(sErrorMsg);
}
private void camListComboBox_SelectedIndexChanged(object sender, EventArg
s e)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// do nothing if the selected camera is the same as the previous one
if (myCamera != null && iOldSelectedIndex != camListComboBox.Selected
Index)
{
// Close any other opened camera so we can open a new one...
myCamera.Close();
myCamera = null;
}
if (myCamera == null)
{
// open the selected camera from the list
myCamera = myFactory.CameraList[camListComboBox.SelectedIndex];
cameraIdTextBox.Text = myCamera.CameraID;
error = myCamera.Open();
if (error != Jai_FactoryWrapper.EFactoryError.Success)
{
showErrorMsg(error);
return;
}
else
{
statusBarLabel.Text = camListComboBox.SelectedItem.ToString()
;
// save the selected camera index
iOldSelectedIndex = camListComboBox.SelectedIndex;
// initialze controls
CNode myNode;
// width
myNode = myCamera.GetNode("Width");
widthTrackBar.Maximum = int.Parse(myNode.Max.ToString());
widthTrackBar.Minimum = int.Parse(myNode.Min.ToString());
widthTrackBar.Value = int.Parse(myNode.Value.ToString());
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
543
544
Example Documentation
widthTrackBar.TickFrequency = (widthTrackBar.Maximum - widthT
rackBar.Minimum)/10;
widthTextBox.Text = myNode.Value.ToString();
widthTrackBar.Enabled = true;
// height
myNode = myCamera.GetNode("Height");
heightTrackBar.Maximum = int.Parse(myNode.Max.ToString());
heightTrackBar.Minimum = int.Parse(myNode.Min.ToString());
heightTrackBar.Value = int.Parse(myNode.Value.ToString());
heightTrackBar.TickFrequency = (heightTrackBar.Maximum - heig
htTrackBar.Minimum) / 10;
heightTextBox.Text = myNode.Value.ToString();
heightTrackBar.Enabled = true;
// gain
myNode = myCamera.GetNode("GainRaw");
gainTrackBar.Maximum = int.Parse(myNode.Max.ToString());
gainTrackBar.Minimum = int.Parse(myNode.Min.ToString());
gainTrackBar.Value = int.Parse(myNode.Value.ToString());
gainTrackBar.TickFrequency = (gainTrackBar.Maximum - gainTrac
kBar.Minimum) / 10;
gainTextBox.Text = myNode.Value.ToString();
gainTrackBar.Enabled = true;
// check free running as default
freeRunRadio.Checked = true;
freeRunRadio.Enabled = true;
// .. and remember to set the trigger accordingly
// But we have 2 ways of setting up triggers: JAI and GenICam
SNC
// The GenICam SFNC trigger setup is available if a node call
ed
// TriggerSelector is available
if (myCamera.GetNode("TriggerSelector") != null)
{
// Here we assume that this is the GenICam SFNC way of se
tting up the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// TriggerMode[TriggerSelector]=Off
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
myCamera.GetNode("TriggerMode").Value = "Off";
// Does this camera have a "Software Trigger" feature ava
ilable?
myNode = myCamera.GetNode("TriggerSoftware");
if (myNode == null)
{
swTrigRadio.Enabled = false;
swTriggerButton.Enabled = false;
MessageBox.Show("No GenICam SFNC Software Trigger fou
nd!");
return;
}
else
{
swTrigRadio.Enabled = true;
}
}
else
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.10 CSharpSwTrigger/CSharpSwTrigger/Form1.cs
{
// Here we assume that this is the JAI of setting up the
trigger
// To switch to Continuous the following is required:
// ExposureMode=Continuous
myCamera.GetNode("ExposureMode").Value = "Continuous";
// Does this camera have a "Software Trigger" feature ava
ilable?
myNode = myCamera.GetNode("SoftwareTrigger0");
if (myNode == null)
{
swTrigRadio.Enabled = false;
swTriggerButton.Enabled = false;
MessageBox.Show("No Software Trigger found!");
return;
}
else
{
swTrigRadio.Enabled = true;
}
}
startButton.Enabled = true;
stopButton.Enabled = false;
// Enable the WhiteBalance button if it is a Bayer color came
ra
wBalanceButton.Enabled = myCamera.IsBayerCamera;
}
}
}
private void freeRunRadio_Click(object sender, EventArgs e)
{
// But we have 2 ways of setting up triggers: JAI and GenICam SNC
// The GenICam SFNC trigger setup is available if a node called
// TriggerSelector is available
if (myCamera.GetNode("TriggerSelector") != null)
{
// Here we assume that this is the GenICam SFNC way of setting up
the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// TriggerMode[TriggerSelector]=Off
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
myCamera.GetNode("TriggerMode").Value = "Off";
}
else
{
// Here we assume that this is the JAI of setting up the trigger
// To switch to Continuous the following is required:
// ExposureMode=Continuous
myCamera.GetNode("ExposureMode").Value = "Continuous";
}
}
private void swTrigRadio_Click(object sender, EventArgs e)
{
// Prepare for software trigger:
//
//
//
if
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
545
546
Example Documentation
the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// TriggerMode[TriggerSelector]=On
// TriggerSource[TriggerSelector]=Software
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
myCamera.GetNode("TriggerMode").Value = "On";
myCamera.GetNode("TriggerSource").Value = "Software";
}
else
{
// Select triggered mode (not continuous mode)
// Here we assume that this is the JAI of setting up the trigger
// To switch to Continuous the following is required:
// ExposureMode=EdgePreSelect
// LineSelector=CameraTrigger0
// LineSource=SoftwareTrigger0
// LineInverter=ActiveHigh
myCamera.GetNode("ExposureMode").Value = "EdgePreSelect";
// Set Line Selector to "Camera Trigger 0"
myCamera.GetNode("LineSelector").Value = "CameraTrigger0";
// Set Line Source to "Software Trigger 0"
myCamera.GetNode("LineSource").Value = "SoftwareTrigger0";
// .. and finally set the Line Polarity (LineInverter) to "Active
High"
myCamera.GetNode("LineInverter").Value = "ActiveHigh";
}
}
private void widthTrackBar_Scroll(object sender, EventArgs e)
{
myCamera.GetNode("Width").Value = int.Parse(widthTrackBar.Value.ToStr
ing());
}
private void heightTrackBar_Scroll(object sender, EventArgs e)
{
myCamera.GetNode("Height").Value = int.Parse(heightTrackBar.Value.ToS
tring());
}
private void gainTrackBar_Scroll(object sender, EventArgs e)
{
myCamera.GetNode("GainRaw").Value = int.Parse(gainTrackBar.Value.ToSt
ring());
}
private void startButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Start the Image Acquisition with 5 buffers
myCamera.StartImageAcquisition(true, 5);
stopButton.Enabled = true;
if (swTrigRadio.Checked)
swTriggerButton.Enabled = true;
startButton.Enabled = false;
widthTrackBar.Enabled = false;
heightTrackBar.Enabled = false;
freeRunRadio.Enabled = false;
swTrigRadio.Enabled = false;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.10 CSharpSwTrigger/CSharpSwTrigger/Form1.cs
camListComboBox.Enabled = false;
wBalanceButton.Enabled = myCamera.IsBayerCamera;
}
}
private void stopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.StopImageAcquisition();
startButton.Enabled = true;
widthTrackBar.Enabled = true;
heightTrackBar.Enabled = true;
freeRunRadio.Enabled = true;
if (myCamera.GetNode("SoftwareTrigger0") != null)
swTrigRadio.Enabled = true;
stopButton.Enabled = false;
swTriggerButton.Enabled = false;
wBalanceButton.Enabled = false;
camListComboBox.Enabled = true;
}
private void wBalanceButton_Click(object sender, EventArgs e)
{
int iWidth, iHeight;
iWidth = int.Parse(myCamera.GetNode("Width").Value.ToString());
iHeight = int.Parse(myCamera.GetNode("Height").Value.ToString());
myCamera.ExecuteWhiteBalance(0, 0, iWidth, iHeight);
}
private void swTriggerButton_Click(object sender, EventArgs e)
{
// But we have 2 ways of sending a software trigger: JAI and GenICam
SNC
// The GenICam SFNC software trigger is available if a node called
// TriggerSoftware is available
if (myCamera.GetNode("TriggerSoftware") != null)
{
// Here we assume that this is the GenICam SFNC way of setting up
the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// Execute TriggerSoftware[TriggerSelector] command
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
myCamera.GetNode("TriggerSoftware").ExecuteCommand();
}
else
{
// We need to "pulse" the Software Trigger feature in order to tr
igger the camera!
myCamera.GetNode("SoftwareTrigger0").Value = 0;
myCamera.GetNode("SoftwareTrigger0").Value = 1;
myCamera.GetNode("SoftwareTrigger0").Value = 0;
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
// We have to manually clean up the Factory object.
// CFactory.Close() will automatically cleanup any camera connections
if (myFactory != null)
myFactory.Close();
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
547
548
Example Documentation
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.11 FeatureBrowserSample/Form1.cs
8.11
FeatureBrowserSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace FeatureBrowserSample
{
public partial class Form1 : Form
{
CFactory myFactory = new CFactory();
public Form1()
{
InitializeComponent();
// Open the factory
if (myFactory.Open("") == Jai_FactoryWrapper.EFactoryError.Success)
{
// Find all the connected cameras
myFactory.UpdateCameraList(CFactory.EDriverType.FilterDriver);
if (myFactory.CameraList.Count > 0)
{
// OK - we managed to open the Factory. Now we need to display all
the cameras we have found (if any)
PopulateTreeView();
}
else
{
// Show a message telling about the problems
MessageBox.Show(this, "No cameras found!", "Error", MessageBoxButt
ons.OK, MessageBoxIcon.Error);
}
}
else
{
// Show a message telling about the problems
MessageBox.Show("Unable to open factory!", "Error", MessageBoxButtons
.OK, MessageBoxIcon.Error);
}
}
private void PopulateTreeView()
{
// Clear the tree
NodeTreeView.Nodes.Clear();
if (myFactory.CameraList.Count > 0)
{
foreach (CCamera c in myFactory.CameraList)
{
// Open camera
if (c.Open() == Jai_FactoryWrapper.EFactoryError.Success)
{
// Add the camera to the Root of the tree
TreeNode cameraNode = new TreeNode(c.ModelName, CreateNodeTree(
c, "Root"));
cameraNode.Tag = c;
NodeTreeView.Nodes.Add(cameraNode);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
549
550
Example Documentation
}
}
}
}
private TreeNode[] CreateNodeTree(CCamera c, string p)
{
List<CNode> features = c.GetSubFeatures(p);
TreeNode[] childNodes = new TreeNode[features.Count];
int index = 0;
foreach (CNode n in features)
{
if (n.NodeType == Jai_FactoryWrapper.EConfNodeType.ICategory)
childNodes[index] = new TreeNode(n.DisplayName, CreateNodeTree(c,
n.Name));
else
childNodes[index] = new TreeNode(n.DisplayName);
childNodes[index].Tag = n;
index++;
}
return childNodes;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void NodeTreeView_AfterSelect(object sender, TreeViewEventArgs e)
{
if (e.Node.Tag is CNode)
NodePropertyGrid.SelectedObject = e.Node.Tag as CNode;
else if (e.Node.Tag is CCamera)
NodePropertyGrid.SelectedObject = e.Node.Tag as CCamera;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myFactory != null)
myFactory.Close();
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.12 GigECameraValidationTool/GigECameraValidationTool/Form1.cs
8.12
GigECameraValidationTool/GigECameraValidationTool/Form1.cs
551
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.IO;
namespace GigECameraValidationTool
{
public partial class Form1 : Form
{
private CFactory myFactory = new CFactory();
private CCamera myCamera;
private
private
private
private
List<IntegerTypeNode> IntList
List<FloatTypeNode> FloatList
List<EnumTypeNode> EnumList =
List<Node> NullNodeList = new
= new List<IntegerTypeNode>();
= new List<FloatTypeNode>();
new List<EnumTypeNode>();
List<Node>();
552
Example Documentation
{
result = ValidateIntegerNode(childNode);
switch (result)
{
case ValidationReturnCode.NotPassed:
IntList.Add(new IntegerTypeNode(node.DisplayN
ame, childNode.DisplayName, childNode.Name, Int64.Parse(childNode.Min.ToString())
, Int64.Parse(childNode.Max.ToString()), Int64.Parse(childNode.Value.ToString()))
);
break;
case ValidationReturnCode.NullValue:
NullNodeList.Add(new Node(node.DisplayName, c
hildNode.DisplayName, childNode.Name));
break;
}
}
else if (childNode.NodeType == Jai_FactoryWrapper.EConfNo
deType.IFloat)
{
result = ValidateFloatNode(childNode);
switch (result)
{
case ValidationReturnCode.NotPassed:
FloatList.Add(new FloatTypeNode(node.DisplayN
ame, childNode.DisplayName, childNode.Name, double.Parse(childNode.Min.ToString()
), double.Parse(childNode.Max.ToString()), double.Parse(childNode.Value.ToString(
))));
break;
case ValidationReturnCode.NullValue:
NullNodeList.Add(new Node(node.DisplayName, c
hildNode.DisplayName, childNode.Name));
break;
}
}
else if (childNode.NodeType == Jai_FactoryWrapper.EConfNo
deType.IEnumeration)
{
result = ValidateEnumNode(childNode);
switch (result)
{
case ValidationReturnCode.NotPassed:
EnumList.Add(new EnumTypeNode(node.DisplayNam
e, childNode.DisplayName, childNode.Name, childNode.Value.ToString()));
break;
case ValidationReturnCode.NullValue:
NullNodeList.Add(new Node(node.DisplayName, c
hildNode.DisplayName, childNode.Name));
break;
}
}
}
}
lock (thisLock)
{
featureProgressCount++;
}
}
lblIntCount.Text = IntList.Count.ToString();
lblEnumCount.Text = EnumList.Count.ToString();
lblFloatCount.Text = FloatList.Count.ToString();
fileWriter();
}
private ValidationReturnCode ValidateIntegerNode(CNode node)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.12 GigECameraValidationTool/GigECameraValidationTool/Form1.cs
try
{
if (node.Value != null)
{
Int64 nodeValue = Int64.Parse(node.Value.ToString());
Int64 max = Int64.Parse(node.Max.ToString());
Int64 min = Int64.Parse(node.Min.ToString());
Int64 inc = Int64.Parse(node.Inc.ToString());
if (nodeValue > max || nodeValue < min || ((nodeValue - min)
% inc) != 0)
return ValidationReturnCode.NotPassed;
else
return ValidationReturnCode.Passed;
}
else
{
return ValidationReturnCode.NullValue;
}
}
catch (Jai_FactoryWrapper.FactoryErrorException ex)
{
MessageBox.Show("Error reading node value!" + ex.Message);
return ValidationReturnCode.Unknown;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return ValidationReturnCode.Unknown;
}
}
private ValidationReturnCode ValidateFloatNode(CNode node)
{
try
{
if (node.Value != null)
{
double nodeValue = double.Parse(node.Value.ToString());
double max = double.Parse(node.Max.ToString());
double min = double.Parse(node.Min.ToString());
if (nodeValue > max || nodeValue < min)
return ValidationReturnCode.NotPassed;
else
return ValidationReturnCode.Passed;
}
else
{
return ValidationReturnCode.NullValue;
}
}
catch (Jai_FactoryWrapper.FactoryErrorException ex)
{
MessageBox.Show("Error reading node value!" + ex.Message);
return ValidationReturnCode.Unknown;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return ValidationReturnCode.Unknown;
}
}
private ValidationReturnCode ValidateEnumNode(CNode node)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
553
554
Example Documentation
CNode.IEnumValue[] values = node.EnumValues;
try
{
foreach (CNode.IEnumValue value in values)
{
if (value.DisplayName == node.Value.ToString())
return ValidationReturnCode.Passed;
}
return ValidationReturnCode.NotPassed;
}
catch (Jai_FactoryWrapper.FactoryErrorException ex)
{
MessageBox.Show("Error reading node value!" + ex.Message);
return ValidationReturnCode.Unknown;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return ValidationReturnCode.Unknown;
}
}
#endregion
private void DiscoverCameras()
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the Factory
error = myFactory.Open("");
statusBarLabel.Text = "Searching for cameras...";
if (error == Jai_FactoryWrapper.EFactoryError.Success)
{
camListComboBox.Items.Clear(); // delete camera list from combo b
ox
// Device discovery using filter driver
myFactory.UpdateCameraList(CFactory.EDriverType.Undefined);
if (myFactory.CameraList.Count > 0)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
string sList = myFactory.CameraList[i].ModelName;
if (myFactory.CameraList[i].CameraID.Contains("INT=>FD"))
sList += " (Filter Driver)";
else if (myFactory.CameraList[i].CameraID.Contains("INT=>
SD"))
sList += " (Socket Driver)";
camListComboBox.Items.Add(sList);
}
}
else
{
MessageBox.Show("No camera found");
}
statusBarLabel.Text = "Found " + myFactory.CameraList.Count.ToStr
ing() + " camera(s). Select camera from the ListBox to open it.";
}
else
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.12 GigECameraValidationTool/GigECameraValidationTool/Form1.cs
showErrorMsg(error);
}
private void showErrorMsg(Jai_FactoryWrapper.EFactoryError error)
{
String sErrorMsg = "Error = " + error.ToString();
MessageBox.Show(sErrorMsg);
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
myFactory.Close();
}
private void fileWriter()
{
using (StreamWriter sw = new StreamWriter("log.txt"))
{
// write the current date
sw.WriteLine("Test Date:" + DateTime.Now.ToString("MMMM dd, yyyy
H:mm:ss zzz"));
sw.WriteLine();
sw.WriteLine("========== Camera Information ==========");
sw.WriteLine("Model Name: " + myCamera.ModelName);
sw.WriteLine("Serial Number: " + myCamera.SerialNumber);
sw.WriteLine("Device Version: " + myCamera.GetNodeValue("DeviceVe
rsion"));
sw.WriteLine("Device Firmware Version: " + myCamera.GetNodeValue(
"DeviceFirmwareVersion"));
sw.WriteLine("Device FPGA Version: " + myCamera.GetNodeValue("Dev
iceFPGAVersion"));
sw.WriteLine("XML File Information: " + myCamera.GetNodeValue("Ge
vFirstURL"));
sw.WriteLine();
sw.WriteLine("========== Test Summary ==========");
if (IntList.Count != 0)
sw.WriteLine("Number of errors in IInteger type: " + IntList.
Count);
if (FloatList.Count != 0)
sw.WriteLine("Number of error in IFolat type: " + FloatList.C
ount);
if (EnumList.Count != 0)
sw.WriteLine("Number of error in IEnumeration type: " + EnumL
ist.Count);
if (IntList.Count == 0 && FloatList.Count == 0 && EnumList.Count
== 0)
sw.WriteLine("No Error found");
if (NullNodeList.Count > 0)
sw.WriteLine("Number of nodes that have null values: " + Null
NodeList.Count);
sw.WriteLine();
if (IntList.Count > 0)
{
sw.WriteLine("========== IInteger Nodes ==========");
sw.WriteLine("Number of errors = " + IntList.Count);
sw.WriteLine("");
foreach (IntegerTypeNode i in IntList)
{
sw.WriteLine("Parent DisplayName: " + i.ParentDisplayName
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
555
556
Example Documentation
);
sw.WriteLine("DisplayName: " + i.DisplayName);
sw.WriteLine("GenICam Name: " + i.GenIcamName);
sw.WriteLine("Minimum value: " + i.MinValue.ToString());
sw.WriteLine("Maximum value: " + i.MaxValue.ToString());
sw.WriteLine("Actual Node Value: " + i.ActualValue.ToStri
ng());
sw.WriteLine();
sw.WriteLine();
}
}
if (FloatList.Count > 0)
{
sw.WriteLine("========== IFloat Nodes==========");
sw.WriteLine("Number of errors = " + FloatList.Count);
sw.WriteLine("");
foreach (FloatTypeNode f in FloatList)
{
sw.WriteLine("Parent DisplayName: " + f.ParentDisplayName
);
sw.WriteLine("DisplayName: " + f.DisplayName);
sw.WriteLine("GenICam Name: " + f.GenIcamName);
sw.WriteLine("Minimum value: " + f.MinValue.ToString());
sw.WriteLine("Maximum value: " + f.MaxValue.ToString());
sw.WriteLine("Actual Node Value: " + f.ActualValue);
sw.WriteLine();
sw.WriteLine();
}
}
if (EnumList.Count > 0)
{
sw.WriteLine("========== IEnumeration Nodes ==========");
sw.WriteLine("Number of errors = " + EnumList.Count);
sw.WriteLine("");
foreach (EnumTypeNode e in EnumList)
{
sw.WriteLine("Parent DisplayName: " + e.ParentDisplayName
);
sw.WriteLine("DisplayName: " + e.DisplayName);
sw.WriteLine("GenICam Name: " + e.GenIcamName);
sw.WriteLine("Actual Node Value: " + e.ActualValue);
sw.WriteLine();
sw.WriteLine();
}
}
if (NullNodeList.Count > 0)
{
sw.WriteLine("========== There are {0} nodes that have null v
alues. ==========", NullNodeList.Count);
sw.WriteLine();
foreach (Node n in NullNodeList)
{
sw.WriteLine("Parent DisplayName: " + n.ParentDisplayName
);
sw.WriteLine("DisplayName: " + n.DisplayName);
sw.WriteLine("GenICam Name: " + n.GenIcamName);
sw.WriteLine();
sw.WriteLine();
}
}
sw.Close();
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.12 GigECameraValidationTool/GigECameraValidationTool/Form1.cs
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
557
558
Example Documentation
}
private void btnGenICamXMLTest_Click(object sender, EventArgs e)
{
ValidateNodeValues();
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.13 GreenCompensationSample/Form1.cs
8.13
GreenCompensationSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace GreenCompensationSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
// Handle to the Display Window to output the Red-compensated output imag
e
IntPtr myViewWindow;
// Conversion buffer to convert the image before image processing
Jai_FactoryWrapper.ImageInfo myConversionBuffer;
// Gain values used by the color interpolation during image conversion an
d display
uint myRGain;
uint myGGain;
uint myBGain;
// Red-Compensation parameters
uint myRedThreshold = 240;
uint myGreenThreshold = 250;
uint myBlueThreshold = 220;
uint myRedGain = 50;
uint myGreenGain = 100;
uint myBlueGain = 50;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
559
560
Example Documentation
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString()
);
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString
());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// Get gain values from the camera object
myCamera.GetGain(ref myRGain, ref myGGain, ref myBGain);
Int32
Int32
CNode
CNode
Width = 0;
Height = 0;
WidthNode = myCamera.GetNode("Width");
HeightNode = myCamera.GetNode("Height");
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.13 GreenCompensationSample/Form1.cs
{
Jai_FactoryWrapper.EFactoryError retsta;
if (myCamera != null)
{
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
}
if (myViewWindow != IntPtr.Zero)
{
Jai_FactoryWrapper.J_Image_CloseViewWindow(myViewWindow);
myViewWindow = IntPtr.Zero;
}
// Free the conversion buffer again if it has been allocated
if (myConversionBuffer.ImageBuffer != IntPtr.Zero)
{
retsta = Jai_FactoryWrapper.J_Image_Free(ref myConversionBuffer);
myConversionBuffer.ImageBuffer = IntPtr.Zero;
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.To
String());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.To
String());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToStrin
g());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
561
562
Example Documentation
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.
ToString());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.
ToString());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToStri
ng());
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
// Local callback function used for handle new images
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
Jai_FactoryWrapper.EFactoryError retsta;
// Allocate tha conversion buffer only once
if (myConversionBuffer.ImageBuffer == IntPtr.Zero)
retsta = Jai_FactoryWrapper.J_Image_Malloc(ref ImageInfo, ref myC
onversionBuffer);
// Convert to internal Image format in order to be able to call the J
_Image_Processing() function later
retsta = Jai_FactoryWrapper.J_Image_FromRawToImage(ref ImageInfo, ref
myConversionBuffer, myRGain, myGGain, myBGain);
// Set up the Green-compensation parameter structure
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.13 GreenCompensationSample/Form1.cs
Jai_FactoryWrapper.GreenCompensationStruct myGreenCompensationParamet
ers = new Jai_FactoryWrapper.GreenCompensationStruct();
// Remember to allocate the 10 Red-compensation ROI structures
myGreenCompensationParameters.ColorCompensationROI = new Jai_FactoryW
rapper.ColorCompensationROIStruct[10];
if (fullImageCheckBox.Checked)
{
myGreenCompensationParameters.NumOfROI = 1;
myGreenCompensationParameters.ColorCompensationROI[0].RectOfROI.L
eft = 0;
myGreenCompensationParameters.ColorCompensationROI[0].RectOfROI.R
ight = (int)ImageInfo.SizeX - 1;
myGreenCompensationParameters.ColorCompensationROI[0].RectOfROI.T
op = 0;
myGreenCompensationParameters.ColorCompensationROI[0].RectOfROI.B
ottom = (int)ImageInfo.SizeY - 1;
myGreenCompensationParameters.ColorCompensationROI[0].RThreshold
= myRedThreshold;
myGreenCompensationParameters.ColorCompensationROI[0].GThreshold
= myGreenThreshold;
myGreenCompensationParameters.ColorCompensationROI[0].BThreshold
= myBlueThreshold;
myGreenCompensationParameters.ColorCompensationROI[0].RGain = 409
6 * myRedGain / 100;
myGreenCompensationParameters.ColorCompensationROI[0].GGain = 409
6 * myGreenGain / 100;
myGreenCompensationParameters.ColorCompensationROI[0].BGain = 409
6 * myBlueGain / 100;
}
else
{
myGreenCompensationParameters.NumOfROI = 3;
for (int i = 0; i < 3; i++)
{
myGreenCompensationParameters.ColorCompensationROI[i].RectOfR
OI.Left = (int)ImageInfo.SizeX * i * 2 / 5;
myGreenCompensationParameters.ColorCompensationROI[i].RectOfR
OI.Right = (int)ImageInfo.SizeX * (i * 2 + 1) / 5 - 1;
myGreenCompensationParameters.ColorCompensationROI[i].RectOfR
OI.Top = (int)ImageInfo.SizeY * 2 / 5;
myGreenCompensationParameters.ColorCompensationROI[i].RectOfR
OI.Bottom = (int)ImageInfo.SizeY * 3 / 5 - 1;
myGreenCompensationParameters.ColorCompensationROI[i].RThresh
old = myRedThreshold;
myGreenCompensationParameters.ColorCompensationROI[i].GThresh
old = myGreenThreshold;
myGreenCompensationParameters.ColorCompensationROI[i].BThresh
old = myBlueThreshold;
myGreenCompensationParameters.ColorCompensationROI[i].RGain =
4096 * myRedGain / 100;
myGreenCompensationParameters.ColorCompensationROI[i].GGain =
4096 * myGreenGain / 100;
myGreenCompensationParameters.ColorCompensationROI[i].BGain =
4096 * myBlueGain / 100;
}
}
if (enableCheckBox.Checked)
{
retsta = Jai_FactoryWrapper.J_Image_Processing(ref myConversionBu
ffer, myGreenCompensationParameters, true);
}
if (myViewWindow != IntPtr.Zero)
Jai_FactoryWrapper.J_Image_ShowImage(myViewWindow, ref myConversi
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
563
564
Example Documentation
onBuffer, myRGain, myGGain, myBGain);
return;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Jai_FactoryWrapper.EFactoryError retsta;
// Free the conversion buffer again if it has been allocated
if (myConversionBuffer.ImageBuffer != IntPtr.Zero)
{
retsta = Jai_FactoryWrapper.J_Image_Free(ref myConversionBuffer);
myConversionBuffer.ImageBuffer = IntPtr.Zero;
}
if (myCamera != null)
{
myCamera.Close();
return;
}
}
private void redThresholdNumericUpDown_ValueChanged(object sender, EventA
rgs e)
{
myRedThreshold = Convert.ToUInt32(redThresholdNumericUpDown.Value);
}
private void greenThresholdNumericUpDown_ValueChanged(object sender, Even
tArgs e)
{
myGreenThreshold = Convert.ToUInt32(greenThresholdNumericUpDown.Value
);
}
private void blueThresholdNumericUpDown_ValueChanged(object sender, Event
Args e)
{
myBlueThreshold = Convert.ToUInt32(blueThresholdNumericUpDown.Value);
}
private void redGainNumericUpDown_ValueChanged(object sender, EventArgs e
)
{
myRedGain = Convert.ToUInt32(redGainNumericUpDown.Value);
}
private void greenGainNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
myGreenGain = Convert.ToUInt32(greenGainNumericUpDown.Value);
}
private void blueGainNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
myBlueGain = Convert.ToUInt32(blueGainNumericUpDown.Value);
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
8.14
565
HDRSequenceSample/HDRSequenceSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace HDRSequenceSample
{
public partial class Form1 : Form
{
CFactory myFactory = new CFactory();
// Main CFactory obje
ct that gives us access to the cameras
CCamera myCamera = null;
// Main CCamera objec
t to be used for this sample. The first camera detected will be opened
IntPtr myImage1ViewWindowHandle = IntPtr.Zero;
// View Window handle
used for displaying the first image in the sequence
IntPtr myImage2ViewWindowHandle = IntPtr.Zero;
// View Window handle
used for displaying the second image in the sequence
IntPtr myImageHDRViewWindowHandle = IntPtr.Zero;
// View Window handle
used for displaying the reulting HDR image
int myAcquisitionState = 0;
ence acquisition. This help us assure that we always
// Flag to activate a
// Result of the anal
// Number of retries
566
Example Documentation
InitializeComponent();
// Open the factory and search for cameras
myFactory.Open();
// Simulate press of the Search button
SearchButton_Click(null, null);
timer1.Enabled = true;
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Check if a camera has already been opened!
if (myCamera != null)
{
// Close the camera again in order to release any allocated resou
rces
myCamera.Close();
myCamera = null;
}
// Search for all cameras on all NIC adapters and pick the Filter Dri
ver (if it is available)
myFactory.UpdateCameraList(CFactory.EDriverType.FilterDriver);
// Did we finc any camera?
if (myFactory.CameraList.Count > 0)
{
// Pick the first camera from the list of cameras
myCamera = myFactory.CameraList[0];
// Write the camera ID to the text box
CameraIDTextBox.Text = myCamera.CameraID;
// ... and finally open up the camera connection
myCamera.Open();
// Check if the camera supports the Sequence and Software Trigger
if (CheckCameraFeatures())
{
// Enable the Start and Stop buttons
StartButton.Enabled = true;
StopButton.Enabled = true;
// Update the camera settings GUI with values from the camera
UpdateCameraSettings();
}
else
{
// Disable the Start and Stop buttons
StartButton.Enabled = false;
StopButton.Enabled = false;
// Write error information in the text box
CameraIDTextBox.Text = "The camera " + myCamera.ModelName +
" does not support Sequences and/or Software Trigger mode required for this Samp
le!";
}
}
else
{
// Disable the Start and Stop buttons
StartButton.Enabled = false;
StopButton.Enabled = false;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
567
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
568
Example Documentation
UpdateCameraSettings();
// Assign the "new image" delagate and startup the image acquisit
ion
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
myCamera.StartImageAcquisition(false, 5);
// We dont want the C
Camera object to create a View Window so the first parameter is "false"
// Start the Auto triggering using Software Trigger
TriggerCamera();
}
}
private void StopButton_Click(object sender, EventArgs e)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Stop the image acquisition
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack(Han
dleImage);
// Close the View Windows again
if (myImage1ViewWindowHandle != IntPtr.Zero)
{
error = Jai_FactoryWrapper.J_Image_CloseViewWindow(myImage1ViewWi
ndowHandle);
myImage1ViewWindowHandle = IntPtr.Zero;
}
if (myImage2ViewWindowHandle != IntPtr.Zero)
{
error = Jai_FactoryWrapper.J_Image_CloseViewWindow(myImage2ViewWi
ndowHandle);
myImage2ViewWindowHandle = IntPtr.Zero;
}
if (myImageHDRViewWindowHandle != IntPtr.Zero)
{
error = Jai_FactoryWrapper.J_Image_CloseViewWindow(myImageHDRView
WindowHandle);
myImageHDRViewWindowHandle = IntPtr.Zero;
}
// Have we allocated the output image buffer?
if (myHDROutputImage.ImageBuffer != IntPtr.Zero)
{
// Free up the output image
error = Jai_FactoryWrapper.J_Image_Free(ref myHDROutputImage);
myHDROutputImage.ImageBuffer = IntPtr.Zero;
}
}
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
// Automatic re-trigger the camera
TriggerCamera();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Lock the access to the shared flags and the acquisition state vari
able
lock (myLockObject)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
569
switch (myAcquisitionState)
{
case 0: // Get the first image from sequence
// Show the image
if (myImage1ViewWindowHandle != IntPtr.Zero)
{
error = Jai_FactoryWrapper.J_Image_ShowImage(myImage1
ViewWindowHandle, ref ImageInfo, 4096, 4096, 4096);
}
// Here we simply save the Image Info structure contents
instead of copying any of the image data
// We can do this if we assume that we will finish proces
sing the image before the internal buffer will be
// reused by the acquisition engine! Since we have alloca
ted 5 buffers then this will always be possible because
// the HDR algorithm processing speed is fast enough.
myImageInfo1 = ImageInfo;
break;
case 1: // Get the second image from sequence
// Show the image
if (myImage2ViewWindowHandle != IntPtr.Zero)
{
error = Jai_FactoryWrapper.J_Image_ShowImage(myImage2
ViewWindowHandle, ref ImageInfo, 4096, 4096, 4096);
}
// Here we simply save the Image Info structure contents
instead of copying any of the image data
// We can do this if we assume that we will finish proces
sing the image before the internal buffer will be
// reused by the acquisition engine! Since we have alloca
ted 5 buffers then this will always be possible because
// the HDR algorithm processing speed is fast enough.
myImageInfo2 = ImageInfo;
// Do we need to (re)analyze the images?
if (myAnalyzeImageRequired)
{
error = Jai_FactoryWrapper.J_Image_AnalyzeHDR(ref myI
mageInfo1, ref myImageInfo2, ref myImage1IsBrighter, ref myBlackLevelImage1, ref
myBlackLevelImage2, ref myDarkGain);
if (error == Jai_FactoryWrapper.EFactoryError.Success
)
{
// We got a new analysis result
myAnalyzeImageRequired = false;
// ..
ing
myAnalysisIsOk = true;
// Update the Info and Settings tab value with th
e result from the analysis.
UpdateInfo();
// Reset retry counter to 0
myAnalysisRetries = 0;
}
else
{
// We cannot continue analyzing if the images are
too far off
myAnalysisRetries++;
// .. so we only try 10 times in a row
if (myAnalysisRetries >= 10)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
570
Example Documentation
MessageBox.Show(this, "The automatic HDR anal
ysis failed!", "HDR Analysis Error", MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1);
myAnalyzeImageRequired = false;
}
}
}
// Is the analysis result OK?
if (myAnalysisIsOk)
{
// Have we already allocated the output image buffer?
// If not then we need to explicitly use the J_Image_
MallocHDR() function to do so.
if (myHDROutputImage.ImageBuffer == IntPtr.Zero)
error = Jai_FactoryWrapper.J_Image_MallocHDR(ref
myImageInfo1, ref myImageInfo2, ref myHDROutputImage);
// Here we convert between a boolean and a byte in or
der to use the J_Image_CombineImagesHDR()
byte bUseLog = 0;
if (LogCheckBox.Checked)
bUseLog = 1;
// The J_Image_CombineImagesHDR() requires that we kn
ow in advance which image is brighter and which one is darker
// Do we need to swap the two images because Image2 i
s the brightest image?
if (myImage1IsBrighter != 0)
error = Jai_FactoryWrapper.J_Image_FuseHDR(ref my
ImageInfo1, ref myImageInfo2, ref myHDROutputImage, myBlackLevelImage1, myBlackLe
velImage2, myDarkGain, myDualSlopeGain, bUseLog);
else
error = Jai_FactoryWrapper.J_Image_FuseHDR(ref my
ImageInfo2, ref myImageInfo1, ref myHDROutputImage, myBlackLevelImage2, myBlackLe
velImage1, myDarkGain, myDualSlopeGain, bUseLog);
// Show the HDR output image
if (myImageHDRViewWindowHandle != IntPtr.Zero)
{
// Get WhiteBalance Values
uint rGain = Convert.ToUInt32(RedGainNumericUpDow
n.Value * 4096);
uint gGain = Convert.ToUInt32(GreenGainNumericUpD
own.Value * 4096);
uint bGain = Convert.ToUInt32(BlueGainNumericUpDo
wn.Value * 4096);
error = Jai_FactoryWrapper.J_Image_ShowImage(myIm
ageHDRViewWindowHandle, ref myHDROutputImage, rGain, gGain, bGain);
}
}
break;
}
// Change state automatically
myAcquisitionState++;
if (myAcquisitionState > 1)
myAcquisitionState = 0;
}
return;
}
private void UpdateCameraSettings()
{
if ((myCamera != null) && myCamera.IsOpen)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
{
CNode node = null;
// 1st sequence settings
myCamera.GetNode("SequenceSelector").Value = 0;
// Set up Expoure Time Raw slider
node = myCamera.GetNode("SequenceExposureTimeRaw");
if (node != null)
{
ExposureTime1TextBox.Text = node.Value.ToString();
ExposureTime1TrackBar.Minimum = Convert.ToInt32(node.Min);
ExposureTime1TrackBar.Maximum = Convert.ToInt32(node.Max);
ExposureTime1TrackBar.Value = Convert.ToInt32(node.Value);
ExposureTime1TextBox.Enabled = true;
ExposureTime1TrackBar.Enabled = true;
}
else
{
ExposureTime1TextBox.Text = "-";
ExposureTime1TrackBar.Minimum = 0;
ExposureTime1TrackBar.Maximum = 1;
ExposureTime1TrackBar.Value = 0;
ExposureTime1TextBox.Enabled = false;
ExposureTime1TrackBar.Enabled = false;
}
// Set up Gain Raw slider
node = myCamera.GetNode("SequenceMasterGain");
if (node != null)
{
Gain1TextBox.Text = node.Value.ToString();
Gain1TrackBar.Minimum = Convert.ToInt32(node.Min);
Gain1TrackBar.Maximum = Convert.ToInt32(node.Max);
Gain1TrackBar.Value = Convert.ToInt32(node.Value);
Gain1TextBox.Enabled = true;
Gain1TrackBar.Enabled = true;
}
else
{
Gain1TextBox.Text = "-";
Gain1TrackBar.Minimum = 0;
Gain1TrackBar.Maximum = 1;
Gain1TrackBar.Value = 0;
Gain1TextBox.Enabled = false;
Gain1TrackBar.Enabled = false;
}
// 2nd sequence settings
myCamera.GetNode("SequenceSelector").Value = 1;
// Set up Expoure Time Raw slider
node = myCamera.GetNode("SequenceExposureTimeRaw");
if (node != null)
{
ExposureTime2TextBox.Text = node.Value.ToString();
ExposureTime2TrackBar.Minimum = Convert.ToInt32(node.Min);
ExposureTime2TrackBar.Maximum = Convert.ToInt32(node.Max);
ExposureTime2TrackBar.Value = Convert.ToInt32(node.Value);
ExposureTime2TextBox.Enabled = true;
ExposureTime2TrackBar.Enabled = true;
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
571
572
Example Documentation
else
{
ExposureTime2TextBox.Text = "-";
ExposureTime2TrackBar.Minimum = 0;
ExposureTime2TrackBar.Maximum = 1;
ExposureTime2TrackBar.Value = 0;
ExposureTime2TextBox.Enabled = false;
ExposureTime2TrackBar.Enabled = false;
}
// Set up Gain Raw slider
node = myCamera.GetNode("SequenceMasterGain");
if (node != null)
{
Gain2TextBox.Text = node.Value.ToString();
Gain2TrackBar.Minimum = Convert.ToInt32(node.Min);
Gain2TrackBar.Maximum = Convert.ToInt32(node.Max);
Gain2TrackBar.Value = Convert.ToInt32(node.Value);
Gain2TextBox.Enabled = true;
Gain2TrackBar.Enabled = true;
}
else
{
Gain2TextBox.Text = "-";
Gain2TrackBar.Minimum = 0;
Gain2TrackBar.Maximum = 1;
Gain2TrackBar.Value = 0;
Gain2TextBox.Enabled = false;
Gain2TrackBar.Enabled = false;
}
// Update the Pixel Format Conbo Box
PixelFormatComboBox.Items.Clear();
node = myCamera.GetNode("PixelFormat");
foreach (CNode.IEnumValue enumval in node.EnumValues)
{
PixelFormatComboBox.Items.Add(enumval.DisplayName);
}
PixelFormatComboBox.SelectedIndex = PixelFormatComboBox.FindStrin
gExact(node.Value.ToString());
}
}
private void SetupTriggerMode()
{
if ((myCamera != null) && myCamera.IsOpen)
{
// Prepare for software trigger:
// But we have 2 ways of setting up triggers: JAI and GenICam SNC
// The GenICam SFNC trigger setup is available if a node called
// TriggerSelector is available
if (myCamera.GetNode("TriggerSelector") != null)
{
// Here we assume that this is the GenICam SFNC way of settin
g up the trigger
// To switch to Continuous the following is required:
// TriggerSelector=FrameStart
// TriggerMode[TriggerSelector]=On
// TriggerSource[TriggerSelector]=Software
myCamera.GetNode("TriggerSelector").Value = "FrameStart";
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
573
myCamera.GetNode("TriggerMode").Value = "On";
myCamera.GetNode("TriggerSource").Value = "Software";
}
else
{
// Select triggered mode (not continuous mode)
// Here we assume that this is the JAI of setting up the trig
ger
// To switch to Continuous the following is required:
// ExposureMode=SequentialEPSTrigger
// LineSelector=CameraTrigger0
// LineSource=SoftwareTrigger0
// LineInverter=ActiveHigh
myCamera.GetNode("ExposureMode").Value = "SequentialEPSTrigge
r";
// Set Line Selector to "Camera Trigger 0"
myCamera.GetNode("LineSelector").Value = "CameraTrigger0";
// Set Line Source to "Software Trigger 0"
myCamera.GetNode("LineSource").Value = "SoftwareTrigger0";
// .. and finally set the Line Polarity (LineInverter) to "Ac
tive High"
myCamera.GetNode("LineInverter").Value = "ActiveHigh";
}
}
}
private void SetupSequences()
{
if ((myCamera != null) && myCamera.IsOpen)
{
// Setup the Sequences
// But we have 2 ways of setting up sequences with triggers: JAI
and GenICam SNC
// The GenICam SFNC trigger setup is available if a node called
// SequenceMode is available
if (myCamera.GetNode("SequenceMode") != null)
{
myCamera.GetNode("SequenceMode").Value = "On";
}
// Continuous sequence
myCamera.GetNode("SequenceRepetitions").Value = 0;
// .. with two steps
myCamera.GetNode("SequenceEndingPosition").Value = 2;
// 1st sequence step is full frame size
myCamera.GetNode("SequenceSelector").Value =
myCamera.GetNode("SequenceROIOffsetX").Value
myCamera.GetNode("SequenceROIOffsetY").Value
myCamera.GetNode("SequenceROISizeX").Value =
quenceROISizeX").Max;
myCamera.GetNode("SequenceROISizeY").Value =
quenceROISizeY").Max;
// 2nd sequence step is full frame size
myCamera.GetNode("SequenceSelector").Value =
myCamera.GetNode("SequenceROIOffsetX").Value
myCamera.GetNode("SequenceROIOffsetY").Value
myCamera.GetNode("SequenceROISizeX").Value =
quenceROISizeX").Max;
myCamera.GetNode("SequenceROISizeY").Value =
quenceROISizeY").Max;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
0;
= 0;
= 0;
myCamera.GetNode("Se
myCamera.GetNode("Se
1;
= 0;
= 0;
myCamera.GetNode("Se
myCamera.GetNode("Se
574
Example Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
private bool CheckCameraFeatures()
{
if ((myCamera != null) && myCamera.IsOpen)
{
bool found = false;
CNode node = null;
// We have 2 ways of setting up triggers: JAI and GenICam SNC
// The GenICam SFNC trigger setup is available if a node called
// TriggerSelector is available
node = myCamera.GetNode("TriggerSelector");
if (node != null)
{
found = false;
foreach (CNode.IEnumValue enumValue in node.EnumValues)
{
if (enumValue.Name.Equals("FrameStart"))
{
found = true;
break;
}
}
if (!found)
return false;
// Set the TriggerSelector=FrameStart so we can check for the
rest of the features needed
node.Value = "FrameStart";
// Check if the camera support Trigger
node = myCamera.GetNode("TriggerMode");
if (node == null)
return false;
// Check if the camera support Software Trigger
node = myCamera.GetNode("TriggerSource");
if (node == null)
return false;
found = false;
foreach (CNode.IEnumValue enumValue in node.EnumValues)
{
if (enumValue.Name.Equals("Software"))
{
found = true;
break;
}
}
if (!found)
return false;
// Check if the camera support Software Trigger
node = myCamera.GetNode("TriggerSoftware");
if (node == null)
return false;
}
else
{
// Check if the camera support Sequential Edge-pre select mod
e
node = myCamera.GetNode("ExposureMode");
if (node == null)
return false;
found = false;
foreach (CNode.IEnumValue enumValue in node.EnumValues)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
575
576
Example Documentation
if (enumValue.Name.Equals("SequentialEPSTrigger"))
{
found = true;
break;
}
}
if (!found)
return false;
// Check if the camera support Software Trigger
node = myCamera.GetNode("LineSelector");
if (node == null)
return false;
found = false;
foreach (CNode.IEnumValue enumValue in node.EnumValues)
{
if (enumValue.Name.Equals("CameraTrigger0"))
{
found = true;
break;
}
}
if (!found)
return false;
node = myCamera.GetNode("LineSource");
if (node == null)
return false;
found = false;
foreach (CNode.IEnumValue enumValue in node.EnumValues)
{
if (enumValue.Name.Equals("SoftwareTrigger0"))
{
found = true;
break;
}
}
if (!found)
return false;
}
// Check for Sequence
node = myCamera.GetNode("SequenceRepetitions");
if (node == null)
return false;
node = myCamera.GetNode("SequenceEndingPosition");
if (node == null)
return false;
node = myCamera.GetNode("SequenceSelector");
if (node == null)
return false;
node = myCamera.GetNode("SequenceROIOffsetX");
if (node == null)
return false;
node = myCamera.GetNode("SequenceROIOffsetY");
if (node == null)
return false;
node = myCamera.GetNode("SequenceROISizeX");
if (node == null)
return false;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
node = myCamera.GetNode("SequenceROISizeY");
if (node == null)
return false;
node = myCamera.GetNode("SequenceSaveCommand");
if (node == null)
return false;
}
return true;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
{
// Stop the acquisition if it is already started
StopButton_Click(null, null);
// Close the camera
myCamera.Close();
return;
}
}
private void DarkGainNumericUpDown_ValueChanged_1(object sender, EventArg
s e)
{
// User manually changed the Dark Gain
myDarkGain = Convert.ToSingle(DarkGainNumericUpDown.Value);
UpdateResolution();
}
private void UpdateResolution()
{
int DarkBlackLevel = 0;
if (myImage1IsBrighter != 0)
DarkBlackLevel = myBlackLevelImage2;
else
DarkBlackLevel = myBlackLevelImage1;
Double res = 0.0;
if (myPixelDepth == 8)
{
res = Math.Log(myDarkGain * (255f - DarkBlackLevel), 2.0);
}
else if (myPixelDepth == 10)
{
res = Math.Log(myDarkGain * (1023f - DarkBlackLevel), 2.0);
}
// Update the "resolution" label
ResolutionLabel.Text = "-> ~ " + res.ToString("0.0") + " bit resoluti
on";
}
private void BlackLevel1NumericUpDown_ValueChanged(object sender, EventAr
gs e)
{
// User manually changed the Black Level
myBlackLevelImage1 = Convert.ToInt32(BlackLevel1NumericUpDown.Value);
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
577
578
Example Documentation
private void BlackLevel2NumericUpDown_ValueChanged(object sender, EventAr
gs e)
{
// User manually changed the Black Level
myBlackLevelImage2 = Convert.ToInt32(BlackLevel2NumericUpDown.Value);
}
private void DualSlopeTrackBar_Scroll(object sender, EventArgs e)
{
myDualSlopeGain = Convert.ToSingle(DualSlopeTrackBar.Value)/1000.0f;
DualSlopeTextBox.Text = myDualSlopeGain.ToString("0.000");
}
private void ForceAnalysisButton_Click(object sender, EventArgs e)
{
lock (myLockObject)
{
myAnalysisIsOk = false;
myAnalyzeImageRequired = true;
myAnalysisRetries = 0;
myAcquisitionState = 0;
}
}
private void Image1PictureBox_Resize(object sender, EventArgs e)
{
if ((myCamera != null) && myCamera.IsOpen && myCamera.IsAcquisitionRu
nning && (myImage1ViewWindowHandle != IntPtr.Zero))
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Calculate the size of the window rect to display the images
System.Windows.Forms.Control ctrl = System.Windows.Forms.Control.
FromChildHandle(Image1PictureBox.Handle);
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, ctrl.Width, ctrl.Height);
// Resize the Child Window
error = Jai_FactoryWrapper.J_Image_ResizeChildWindow(myImage1View
WindowHandle, ref frameRect);
}
}
private void Image2PictureBox_Resize(object sender, EventArgs e)
{
if ((myCamera != null) && myCamera.IsOpen && myCamera.IsAcquisitionRu
nning && (myImage2ViewWindowHandle != IntPtr.Zero))
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Calculate the size of the window rect to display the images
System.Windows.Forms.Control ctrl = System.Windows.Forms.Control.
FromChildHandle(Image2PictureBox.Handle);
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, ctrl.Width, ctrl.Height);
// Resize the Child Window
error = Jai_FactoryWrapper.J_Image_ResizeChildWindow(myImage2View
WindowHandle, ref frameRect);
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
private void HDRImagePictureBox_Resize(object sender, EventArgs e)
{
if ((myCamera != null) && myCamera.IsOpen && myCamera.IsAcquisitionRu
nning && (myImageHDRViewWindowHandle != IntPtr.Zero))
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Calculate the size of the window rect to display the images
System.Windows.Forms.Control ctrl = System.Windows.Forms.Control.
FromChildHandle(HDRImagePictureBox.Handle);
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, ctrl.Width, ctrl.Height);
// Resize the Child Window
error = Jai_FactoryWrapper.J_Image_ResizeChildWindow(myImageHDRVi
ewWindowHandle, ref frameRect);
}
}
private void ExposureTime1TrackBar_Scroll(object sender, EventArgs e)
{
// Sequence 1 settings
myCamera.GetNode("SequenceSelector").Value = 0;
// Set up Expoure Time Raw slider
myCamera.GetNode("SequenceExposureTimeRaw").Value = ExposureTime1Trac
kBar.Value;
ExposureTime1TextBox.Text = ExposureTime1TrackBar.Value.ToString();
}
private void Gain1TrackBar_Scroll(object sender, EventArgs e)
{
// Sequence 1 settings
myCamera.GetNode("SequenceSelector").Value = 0;
// Set up Expoure Time Raw slider
myCamera.GetNode("SequenceMasterGain").Value = Gain1TrackBar.Value;
Gain1TextBox.Text = Gain1TrackBar.Value.ToString();
}
private void ExposureTime1TrackBar_MouseUp(object sender, MouseEventArgs
e)
{
ForceAnalysisButton_Click(null, null);
}
private void Gain1TrackBar_MouseUp(object sender, MouseEventArgs e)
{
ForceAnalysisButton_Click(null, null);
}
private void ExposureTime2TrackBar_Scroll(object sender, EventArgs e)
{
// Sequence 2 settings
myCamera.GetNode("SequenceSelector").Value = 1;
// Set up Expoure Time Raw slider
myCamera.GetNode("SequenceExposureTimeRaw").Value = ExposureTime2Trac
kBar.Value;
ExposureTime2TextBox.Text = ExposureTime2TrackBar.Value.ToString();
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
579
580
Example Documentation
private void Gain2TrackBar_Scroll(object sender, EventArgs e)
{
// Sequence 2 settings
myCamera.GetNode("SequenceSelector").Value = 1;
// Set up Expoure Time Raw slider
myCamera.GetNode("SequenceMasterGain").Value = Gain2TrackBar.Value;
Gain1TextBox.Text = Gain2TrackBar.Value.ToString();
}
private void ExposureTime2TrackBar_MouseUp(object sender, MouseEventArgs
e)
{
ForceAnalysisButton_Click(null, null);
}
private void Gain2TrackBar_MouseUp(object sender, MouseEventArgs e)
{
ForceAnalysisButton_Click(null, null);
}
private void PixelFormatComboBox_SelectedIndexChanged(object sender, Even
tArgs e)
{
if ((myCamera != null) && myCamera.IsOpen)
{
if (PixelFormatComboBox.SelectedItem != null)
{
CNode node = myCamera.GetNode("PixelFormat");
// We need to find the correct enum for the possible ones
foreach (CNode.IEnumValue enumval in node.EnumValues)
{
if (enumval.DisplayName.Equals(PixelFormatComboBox.Select
edItem.ToString()))
{
node.Value = enumval;
break;
}
}
// We need this information in order to determine the "resolu
tion"
if (PixelFormatComboBox.SelectedItem.ToString().Contains("8")
)
myPixelDepth = 8;
else if (PixelFormatComboBox.SelectedItem.ToString().Contains
("10"))
myPixelDepth = 10;
UpdateResolution();
ForceAnalysisButton_Click(null, null);
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if ((myCamera != null) && myCamera.IsOpen && myCamera.IsAcquisitionRu
nning)
{
FrameRateTextBox.Text = (myCamera.FramesPerSecond/2.0).ToString("
0.0") + " fps";
}
else
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs
{
FrameRateTextBox.Text = "0.0 fps";
}
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
581
582
Example Documentation
8.15
ImageDelegateSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace ImageDelegateSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.15 ImageDelegateSample/Form1.cs
{
if (myCamera != null)
{
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack(Han
dleImage);
myCamera.StartImageAcquisition(true, 5);
}
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack(Han
dleImage);
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.ToStrin
g());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.ToStrin
g());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToString());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
583
584
Example Documentation
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
// Local callback function used for handle new images
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
// Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// This is in fact a callback, so we would need to handle the data as fa
st as possible and the frame buffer
// we get as a parameter will be recycled when we terminate.
// This leaves us with two choises:
// 1) Get the work we need to do done ASAP and return
// 2) Make a copy of the image data and process this afterwards
//
// We have the access to the buffer directly via the ImageInfo.ImageBuff
er variable
//
// We can access the raw frame buffer bytes if we use "unsafe" code and
pointer
// To do this we need to set the "Allow unsafe code" in the project prop
erties and then access the data like:
//
// unsafe
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.15 ImageDelegateSample/Form1.cs
// {
//
// Cast IntPtr to pointer to byte
//
byte* pArray = (byte*)ImageInfo.ImageBuffer;
//
// Do something with the data
//
// Read values
//
byte value = pArray[10];
//
// Write values
//
for (int i = 0; i < 1000; i++)
//
pArray[i] = (byte)(i % 255);
// }
//
// // If we want to copy the data instead we can do like this without Un
safe code:
// byte[] array = null;
//
// if (ImageInfo.ImageBuffer != IntPtr.Zero)
// {
//
// Allocate byte array that can contain the copy of data
//
array = new byte[ImageInfo.ImageSize];
//
// Do the copying
//
Marshal.Copy(ImageInfo.ImageBuffer, array, 0, (int)ImageInfo.Imag
eSize);
//
//
// Do something with the raw data
//
byte val = array[10];
//}
unsafe
{
// Cast IntPtr to pointer to byte
byte* pArray = (byte*)ImageInfo.ImageBuffer;
// Do something with the data
// Read values
byte value = pArray[10];
// Write values
for (int i = 0; i < 1000; i++)
pArray[i] = (byte)(i % 255);
}
return;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
{
myCamera.Close();
return;
}
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
585
586
8.16
Example Documentation
InterPacketDelayCalculator/InterPacketDelayCalculator/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace InterPacketDelayCalculator
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void SearchButton_Click(object sender, EventArgs e)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
error = myCamera.Open();
if (error == Jai_FactoryWrapper.EFactoryError.Success)
openWizardButton.Enabled = true;
else
{
openWizardButton.Enabled = false;
if (error == Jai_FactoryWrapper.EFactoryError.AccessDenied)
{
// Someone already opened the camera
MessageBox.Show(this, "The camera is already open by anot
her application!", "Camera open error", MessageBoxButtons.YesNo, MessageBoxIcon.Q
uestion, MessageBoxDefaultButton.Button1);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.16 InterPacketDelayCalculator/InterPacketDelayCalculator/Form1.cs
587
}
}
}
else
{
openWizardButton.Enabled = true;
MessageBox.Show("No Cameras Found!");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
myCamera.Close();
}
private void openWizardButton_Click(object sender, EventArgs e)
{
// Create the Inter-Packet Delay form
InterPacketDelayForm myInterPacketDelayForm = new InterPacketDelayFor
m(myCamera);
// .. and show it
if (myInterPacketDelayForm.ShowDialog(this) == DialogResult.OK)
{
Int32 currentInterPacketDelayValue = Convert.ToInt32(myCamera.Get
NodeValue("GevSCPD"));
// We can now get the value from the form and use it to set the v
alue inside the camera
// Befor that we might want to check if it has changed!?
if (currentInterPacketDelayValue != myInterPacketDelayForm.InterP
acketDelay)
{
if (MessageBox.Show(this, "The new Inter-Packet Delay (" + my
InterPacketDelayForm.InterPacketDelay.ToString() + ") is different from the curre
nt value (" + currentInterPacketDelayValue.ToString() + ").\nDo you want to chang
e to the new value?", "Inter-Packer Delay Changed", MessageBoxButtons.YesNo, Mess
ageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
{
myCamera.GetNode("GevSCPD").Value = myInterPacketDelayFor
m.InterPacketDelay;
}
}
}
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
588
8.17
Example Documentation
LensDistortionCorrectionSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace LensDistortionCorrectionSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
uint myRedGain = 4096;
uint myGreenGain = 4096;
uint myBlueGain = 4096;
IntPtr WindowHandle;
Jai_FactoryWrapper.ImageInfo myConversionBuffer = new Jai_FactoryWrapper.
ImageInfo();
Jai_FactoryWrapper.ImageInfo myImageProcessingBuffer = new Jai_FactoryWra
pper.ImageInfo();
Jai_FactoryWrapper.UndistortStruct myUndistortParameters = new Jai_Factor
yWrapper.UndistortStruct();
object myUndistortParametersLock = new object();
bool mybUndistort = true;
bool mybInitialized = false;
bool mybMonochrome = false;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
mybInitialized = true;
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.17 LensDistortionCorrectionSample/Form1.cs
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString()
);
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString
());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
Int32 Width = Convert.ToInt32(myCamera.GetNode("Width").Value);
Int32 Height = Convert.ToInt32(myCamera.GetNode("Height").Value);
myUndistortParameters.OpticalCenterX = Width / 2;
myUndistortParameters.OpticalCenterY = Height / 2;
myUndistortParameters.FocalLengthX = Width;
myUndistortParameters.FocalLengthY = Width;
myUndistortParameters.CoeffK1 = -0.194;
myUndistortParameters.CoeffK2 = 0.115;
myUndistortParameters.CoeffK3 = 0.0; // Only used if it is a fish
-eye lens
myUndistortParameters.CoeffP1 = -0.000619;
myUndistortParameters.CoeffP2 = 0.00115;
myUndistortParameters.InterpolationType = Jai_FactoryWrapper.EInt
erpolationType.InterpolationBiLinear;
CNode.IEnumValue PixelFormatEnumerationValue = myCamera.GetNode("
PixelFormat").Value as CNode.IEnumValue;
Jai_FactoryWrapper.EPixelFormatType PixelFormatType = (Jai_Factor
yWrapper.EPixelFormatType)PixelFormatEnumerationValue.Value;
// In order to optimize for speed then we know that the MONO8, MO
NO10, MONO12 and MONO16 pixel formats
// will be able to be processed without further conversions. The
rest (Bayer, RGB and "packed" Mono)
// will have to be converted using J_Image_FromRawToImage() or J_
Image_FromRawToDIB()!
if ((PixelFormatType == Jai_FactoryWrapper.EPixelFormatType.GVSP_
PIX_MONO8)
|| (PixelFormatType == Jai_FactoryWrapper.EPixelFormatType.GV
SP_PIX_MONO10)
|| (PixelFormatType == Jai_FactoryWrapper.EPixelFormatType.GV
SP_PIX_MONO12)
|| (PixelFormatType == Jai_FactoryWrapper.EPixelFormatType.GV
SP_PIX_MONO16))
{
mybMonochrome = true;
}
else
{
mybMonochrome = false;
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
589
590
Example Documentation
myImageProcessingBuffer.ImageBuffer = IntPtr.Zero;
if (myConversionBuffer.ImageBuffer != IntPtr.Zero)
Jai_FactoryWrapper.J_Image_Free(ref myConversionBuffer);
myConversionBuffer.ImageBuffer = IntPtr.Zero;
if (WindowHandle != IntPtr.Zero)
{
// Close view window
Jai_FactoryWrapper.J_Image_CloseViewWindow(WindowHandle);
WindowHandle = IntPtr.Zero;
}
StartButton.Enabled = true;
StopButton.Enabled = false;
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.17 LensDistortionCorrectionSample/Form1.cs
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
myCamera.GetGain(ref myRedGain, ref myGreenGain, ref myBlueGain);
StartButton.Enabled = true;
StopButton.Enabled = false;
undistortParamGroupBox.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.To
String());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.To
String());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToStrin
g());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.
ToString());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.
ToString());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToStri
ng());
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
591
592
Example Documentation
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
myUndistortParameters.OpticalCenterX = Convert.ToDouble(myWidthNo
de.Value) / 2.0;
myUndistortParameters.OpticalCenterY = Convert.ToDouble(myHeightN
ode.Value) / 2.0;
myUndistortParameters.FocalLengthX = Convert.ToDouble(myWidthNode
.Value);
myUndistortParameters.FocalLengthY = myUndistortParameters.FocalL
engthX;
myUndistortParameters.CoeffK1 = -0.194;
myUndistortParameters.CoeffK2 = 0.115;
myUndistortParameters.CoeffK3 = 0.0; // Only used if it is a fish
-eye lens
myUndistortParameters.CoeffP1 = -0.000619;
myUndistortParameters.CoeffP2 = 0.00115;
myUndistortParameters.InterpolationType = Jai_FactoryWrapper.EInt
erpolationType.InterpolationBiLinear;
opticalCenterXNumericUpDown.Value = Convert.ToDecimal(myUndistort
Parameters.OpticalCenterX);
opticalCenterYNumericUpDown.Value = Convert.ToDecimal(myUndistort
Parameters.OpticalCenterY);
focalLengthXNumericUpDown.Value = Convert.ToDecimal(myUndistortPa
rameters.FocalLengthX);
focalLengthYNumericUpDown.Value = Convert.ToDecimal(myUndistortPa
rameters.FocalLengthY);
k1NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffK1);
k2NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffK2);
k3NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffK3);
p1NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffP1);
p2NumericUpDown.Value = Convert.ToDecimal(myUndistortParameters.C
oeffP2);
if (myUndistortParameters.InterpolationType == Jai_FactoryWrapper
.EInterpolationType.InterpolationBiLinear)
biLinearCheckBox.Checked = true;
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.17 LensDistortionCorrectionSample/Form1.cs
593
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
594
Example Documentation
else
{
// Do the Lens Distortion Correction
lock (myUndistortParametersLock)
{
error = Jai_FactoryWrapper.J_Image_Processing(ref Ima
geInfo, ref myImageProcessingBuffer, myUndistortParameters, true);
}
}
// Shows undistorted image
error = Jai_FactoryWrapper.J_Image_ShowImage(WindowHandle, re
f myImageProcessingBuffer, myRedGain, myGreenGain, myBlueGain);
}
else
error = Jai_FactoryWrapper.J_Image_ShowImage(WindowHandle, re
f ImageInfo, myRedGain, myGreenGain, myBlueGain);
}
return;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
{
myCamera.Close();
return;
}
}
private void opticalCenterXNumericUpDown_ValueChanged(object sender, Even
tArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void opticalCenterYNumericUpDown_ValueChanged(object sender, Even
tArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void focalLengthXNumericUpDown_ValueChanged(object sender, EventA
rgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void focalLengthYNumericUpDown_ValueChanged(object sender, EventA
rgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void k1NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void k2NumericUpDown_ValueChanged(object sender, EventArgs e)
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.17 LensDistortionCorrectionSample/Form1.cs
if (mybInitialized)
applyButton.Enabled = true;
}
private void k3NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void p1NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void p2NumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (mybInitialized)
applyButton.Enabled = true;
}
private void applyButton_Click(object sender, EventArgs e)
{
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
lock (myUndistortParametersLock)
{
myUndistortParameters.OpticalCenterX = Convert.ToDouble(opticalCe
nterXNumericUpDown.Value);
myUndistortParameters.OpticalCenterY = Convert.ToDouble(opticalCe
nterYNumericUpDown.Value);
myUndistortParameters.FocalLengthX = Convert.ToDouble(focalLength
XNumericUpDown.Value);
myUndistortParameters.FocalLengthY = Convert.ToDouble(focalLength
YNumericUpDown.Value);
myUndistortParameters.CoeffK1 = Convert.ToDouble(k1NumericUpDown.
Value);
myUndistortParameters.CoeffK2 = Convert.ToDouble(k2NumericUpDown.
Value);
myUndistortParameters.CoeffK3 = Convert.ToDouble(k3NumericUpDown.
Value);
myUndistortParameters.CoeffP1 = Convert.ToDouble(p1NumericUpDown.
Value);
myUndistortParameters.CoeffP2 = Convert.ToDouble(p2NumericUpDown.
Value);
error = Jai_FactoryWrapper.J_Image_ProcessingInit(ref myImageProc
essingBuffer, ref myUndistortParameters);
}
applyButton.Enabled = false;
}
private void undistortCheckBox_CheckedChanged(object sender, EventArgs e)
{
mybUndistort = undistortCheckBox.Checked;
}
private void biLinearCheckBox_CheckedChanged(object sender, EventArgs e)
{
lock (myUndistortParametersLock)
{
if (biLinearCheckBox.Checked)
myUndistortParameters.InterpolationType = Jai_FactoryWrapper.
EInterpolationType.InterpolationBiLinear;
else
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
595
596
Example Documentation
myUndistortParameters.InterpolationType = Jai_FactoryWrapper.
EInterpolationType.InterpolationNone;
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.18 MultiCamsAsyncImageRecording/MultiCamsAsyncImageRecording/Form1.cs
8.18
597
MultiCamsAsyncImageRecording/MultiCamsAsyncImageRecording/Form1
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.IO;
namespace MultiCamsAsyncImageRecording
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
private int _progressCharIndex = 0;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras, and open
SearchButton_Click(null, null);
// Select List recoding mode as default
recordingModeComboBox.SelectedIndex = 0;
}
private void startCaptureButton_Click(object sender, EventArgs e)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
if (myFactory.CameraList[i].IsAsyncImageRecordingRunning || (myFa
ctory.CameraList[i].TotalAsyncImagesRecordedCount > 0))
{
DialogResult res = MessageBox.Show(this, "The Asychynchronuou
s Image Recording is already active or the internal buffer is not empty! Do you w
ant to restart the image recording and discard recorded images?", "Asynchronous I
mage Capture", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaul
tButton.Button2);
if (res == DialogResult.Yes)
{
myFactory.CameraList[i].StopAsyncImageRecording();
myFactory.CameraList[i].FreeAsyncRecordedImages();
myFactory.CameraList[i].StartAsyncImageRecording(Convert.
ToInt32(captureCountNumericUpDown.Value), (CCamera.AsyncImageRecordingMode)record
ingModeComboBox.SelectedIndex, Convert.ToInt32(skipCountNumericUpDown.Value));
}
}
else
{
myFactory.CameraList[i].StartAsyncImageRecording(Convert.ToIn
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
598
Example Documentation
t32(captureCountNumericUpDown.Value), (CCamera.AsyncImageRecordingMode)recordingM
odeComboBox.SelectedIndex, Convert.ToInt32(skipCountNumericUpDown.Value));
}
}
}
private void stopRecordingButton_Click(object sender, EventArgs e)
{
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
myFactory.CameraList[i].StopAsyncImageRecording();
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myFactory.CameraList[i].AsyncImageRecordin
gCount;
progressBar1.Value = myFactory.CameraList[i].TotalAsyncImagesReco
rdedCount;
progressBar1.Enabled = false;
}
}
private void replayButton_Click(object sender, EventArgs e)
{
// Here we have access to the stored images! Lets show them in an ima
ge window!!
//Create a replay window
for (int i = 0; i < myFactory.CameraList.Count; i++)
{
if (!myFactory.CameraList[i].IsAsyncImageRecordingRunning && (myF
actory.CameraList[i].TotalAsyncImagesRecordedCount > 0))
{
IntPtr WindowHandle = IntPtr.Zero;
// Try to read get the maximum width and height by looking fo
r "SensorWidth" and "SensorHeight"
Int32 Width = 0;
Int32 Height = 0;
CNode WidthNode = myFactory.CameraList[i].GetNode("Width");
CNode HeightNode = myFactory.CameraList[i].GetNode("Height");
Width = Convert.ToInt32(WidthNode.Max);
Height = Convert.ToInt32(HeightNode.Max);
IntPtr nodeHandle;
uint BytesPerPixel = 4;
if (Jai_FactoryWrapper.J_Camera_GetNodeByName(myFactory.Camer
aList[i].CameraHandle, "PixelFormat", out nodeHandle) == Jai_FactoryWrapper.EFact
oryError.Success)
{
Int64 value = 0;
if (Jai_FactoryWrapper.J_Node_GetValueInt64(nodeHandle, f
alse, ref value) == Jai_FactoryWrapper.EFactoryError.Success)
{
Jai_FactoryWrapper.EPixelFormatType pixeltype = (Jai_
FactoryWrapper.EPixelFormatType)value;
BytesPerPixel = Jai_FactoryWrapper.GetPixelTypeMemory
Size(pixeltype);
}
}
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE
(Width, Height);
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.E
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.18 MultiCamsAsyncImageRecording/MultiCamsAsyncImageRecording/Form1.cs
599
FactoryError.Success;
// Calculate the size of the window rect to display the image
s
int RectWidth = 0;
int RectHeight = 0;
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RE
CT(0, 0, 100, 100); ;
// Does the image fit in width?
if ((Width + 2 * System.Windows.Forms.SystemInformation.Borde
r3DSize.Width) > System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width)
RectWidth = System.Windows.Forms.Screen.PrimaryScreen.Wor
kingArea.Width - 2 * System.Windows.Forms.SystemInformation.Border3DSize.Width;
else
RectWidth = Width;
// Does the image fit in Height?
if ((Height + System.Windows.Forms.SystemInformation.Border3D
Size.Height + System.Windows.Forms.SystemInformation.CaptionHeight) > System.Wind
ows.Forms.Screen.PrimaryScreen.WorkingArea.Height)
RectHeight = System.Windows.Forms.Screen.PrimaryScreen.Wo
rkingArea.Height - System.Windows.Forms.SystemInformation.Border3DSize.Height - S
ystem.Windows.Forms.SystemInformation.CaptionHeight;
else
RectHeight = Height;
frameRect = new Jai_FactoryWrapper.RECT(0, 0, RectWidth, Rect
Height);
string sDisplayName = myFactory.CameraList[i].ModelName;
// Open the replay view
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_Facto
ryWrapper.EIVWWindowType.OverlappedStretch, "Replay " + sDisplayName , ref frameR
ect, ref maxSize, IntPtr.Zero, out WindowHandle);
if (WindowHandle != IntPtr.Zero)
{
string sMoedlName = myFactory.CameraList[i].ModelName;
List<Jai_FactoryWrapper.ImageInfo> imageList = myFactory.
CameraList[i].GetAsyncRecordedImages();
if (imageList != null && (imageList.Count > 0))
{
for (int index = 0; index < myFactory.CameraList[i].T
otalAsyncImagesRecordedCount; index++)
{
Jai_FactoryWrapper.ImageInfo ii = imageList[index
];
Jai_FactoryWrapper.J_Image_SetViewWindowTitle(Win
dowHandle, "Replay " + sMoedlName + " " + ii.TimeStamp.ToString() + " (" + index.
ToString() + "/" + myFactory.CameraList[i].TotalAsyncImagesRecordedCount.ToString
() + ")");
Jai_FactoryWrapper.J_Image_ShowImage(WindowHandle
, ref ii, 4096, 4096, 4096);
Application.DoEvents();
Thread.Sleep(10);
}
}
Jai_FactoryWrapper.J_Image_CloseViewWindow(WindowHandle);
}
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
600
Example Documentation
myFactory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.18 MultiCamsAsyncImageRecording/MultiCamsAsyncImageRecording/Form1.cs
601
error = Jai_FactoryWrapper.J_Image_Malloc(ref
ii, ref localImageInfo);
// Convert the raw image to image format
error = Jai_FactoryWrapper.J_Image_FromRawToI
mage(ref ii, ref localImageInfo, 4096, 4096, 4096);
// Save the image to disk
//error = Jai_FactoryWrapper.J_Image_SaveFile
(ref localImageInfo, ".\\RecordedImage" + index.ToString("000") + ".tif");
error = Jai_FactoryWrapper.J_Image_SaveFile(r
ef ii, sSubDirName + "\\" + sModelName + "_" + ii.TimeStamp.ToString() + ".tif");
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
602
Example Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.18 MultiCamsAsyncImageRecording/MultiCamsAsyncImageRecording/Form1.cs
603
progressBar1.Maximum = myFactory.CameraList[iLastCamera].Asyn
cImageRecordingCount;
progressBar1.Value = myFactory.CameraList[iLastCamera].TotalA
syncImagesRecordedCount;
progressBar1.Enabled = false;
}
else
{
if (myFactory.CameraList[iLastCamera].GetAsyncImageRecordingM
ode == CCamera.AsyncImageRecordingMode.List)
{
recordingStatusLabel.Text = "Recorded " + myFactory.Camer
aList[iLastCamera].TotalAsyncImagesRecordedCount.ToString() + " images out of " +
myFactory.CameraList[iLastCamera].AsyncImageRecordingCount.ToString();
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myFactory.CameraList[iLastCamera].
AsyncImageRecordingCount;
progressBar1.Value = myFactory.CameraList[iLastCamera].To
talAsyncImagesRecordedCount;
}
else
{
if (myFactory.CameraList[iLastCamera].TotalAsyncImagesRec
ordedCount < myFactory.CameraList[iLastCamera].AsyncImageRecordingCount)
{
recordingStatusLabel.Text = "Recorded " + myFactory.C
ameraList[iLastCamera].TotalAsyncImagesRecordedCount.ToString() + " images out of
" + myFactory.CameraList[iLastCamera].AsyncImageRecordingCount.ToString();
progressBar1.Style = ProgressBarStyle.Blocks;
progressBar1.Minimum = 0;
progressBar1.Maximum = myFactory.CameraList[iLastCame
ra].AsyncImageRecordingCount;
progressBar1.Value = myFactory.CameraList[iLastCamera
].TotalAsyncImagesRecordedCount;
}
else
{
recordingStatusLabel.Text = "Recording frames Cyclica
lly " + GetProgressChar();
progressBar1.Style = ProgressBarStyle.Marquee;
}
}
}
StartButton.Enabled = !myFactory.CameraList[iLastCamera].IsAcquis
itionRunning;
StopButton.Enabled = myFactory.CameraList[iLastCamera].IsAcquisit
ionRunning;
SearchButton.Enabled = !myFactory.CameraList[iLastCamera].IsAcqui
sitionRunning;
}
else
{
startCaptureButton.Enabled = false;
stopCaptureButton.Enabled = false;
replayButton.Enabled = false;
saveButton.Enabled = false;
SearchButton.Enabled = true;
}
}
private string GetProgressChar()
{
_progressCharIndex++;
if (_progressCharIndex > 3)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
604
Example Documentation
_progressCharIndex = 0;
switch (_progressCharIndex)
{
case 0:
return "/";
case 1:
return "--";
case 2:
return "\\";
case 3:
return "|";
}
return "";
}
private void showErrorMsg(Jai_FactoryWrapper.EFactoryError error)
{
String sErrorMsg = "Error = " + error.ToString();
MessageBox.Show(sErrorMsg);
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.19 NodeEventSample/Form1.cs
8.19
NodeEventSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace NodeEventSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myPayloadSizeNode;
Jai_FactoryWrapper.NodeChangeDelegate myPayloadSizeNodeChangeDelegate;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
605
606
Example Documentation
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.ToStrin
g());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.ToStrin
g());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToString());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myPayloadSizeNode = myCamera.GetNode("PayloadSize");
if (myPayloadSizeNode != null)
{
currentValue = int.Parse(myPayloadSizeNode.Value.ToString());
PayloadSizeLabel.Text = myPayloadSizeNode.Value.ToString() + " byt
es";
PayloadSizeLabel.Enabled = true;
PayloadSizeLabel2.Enabled = true;
// Create new delegate
myPayloadSizeNodeChangeDelegate = new Jai_FactoryWrapper.NodeChang
eDelegate(myPayloadSizeNodeChangeDelegateFunction);
// Register the delegate
Jai_FactoryWrapper.J_Node_RegisterCallback(myPayloadSizeNode.NodeH
andle, myPayloadSizeNodeChangeDelegate);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.19 NodeEventSample/Form1.cs
}
else
{
PayloadSizeLabel.Enabled = false;
}
}
else
{
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
PayloadSizeLabel.Enabled = false;
PayloadSizeLabel2.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
private bool myPayloadSizeNodeChangeDelegateFunction(IntPtr nodeHandle)
{
if (!PayloadSizeLabel.InvokeRequired)
{
PayloadSizeLabel.Text = myPayloadSizeNode.Value.ToString() + " bytes"
;
}
else
{
BeginInvoke(new UpdatePayloadSizeDelegate(UpdatePayloadSizeLabel));
}
return true;
}
public delegate void UpdatePayloadSizeDelegate();
void UpdatePayloadSizeLabel()
{
PayloadSizeLabel.Text = myPayloadSizeNode.Value.ToString() + " bytes";
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
607
608
Example Documentation
8.20
RedCompensationSample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
System.Threading;
System.Runtime.InteropServices;
namespace RedCompensationSample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
// Handle to the Display Window to output the Red-compensated output imag
e
IntPtr myViewWindow;
// Conversion buffer to convert the image before image processing
Jai_FactoryWrapper.ImageInfo myConversionBuffer;
// Gain values used by the color interpolation during image conversion an
d display
uint myRGain;
uint myGGain;
uint myBGain;
// Red-Compensation parameters
uint myRedThreshold = 250;
uint myGreenThreshold = 240;
uint myBlueThreshold = 220;
uint myRedGain = 100;
uint myGreenGain = 50;
uint myBlueGain = 50;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryE
rror.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.20 RedCompensationSample/Form1.cs
609
Width = 0;
Height = 0;
WidthNode = myCamera.GetNode("Width");
HeightNode = myCamera.GetNode("Height");
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
610
Example Documentation
{
Jai_FactoryWrapper.EFactoryError retsta;
if (myCamera != null)
{
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
}
if (myViewWindow != IntPtr.Zero)
{
Jai_FactoryWrapper.J_Image_CloseViewWindow(myViewWindow);
myViewWindow = IntPtr.Zero;
}
// Free the conversion buffer again if it has been allocated
if (myConversionBuffer.ImageBuffer != IntPtr.Zero)
{
retsta = Jai_FactoryWrapper.J_Image_Free(ref myConversionBuffer);
myConversionBuffer.ImageBuffer = IntPtr.Zero;
}
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Fil
terDriver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.To
String());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.To
String());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToStrin
g());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.20 RedCompensationSample/Form1.cs
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.
ToString());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.
ToString());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToStri
ng());
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
// Local callback function used for handle new images
void HandleImage(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
Jai_FactoryWrapper.EFactoryError retsta;
// Allocate tha conversion buffer only once
if (myConversionBuffer.ImageBuffer == IntPtr.Zero)
retsta = Jai_FactoryWrapper.J_Image_Malloc(ref ImageInfo, ref myC
onversionBuffer);
// Convert to internal Image format in order to be able to call the J
_Image_Processing() function later
retsta = Jai_FactoryWrapper.J_Image_FromRawToImage(ref ImageInfo, ref
myConversionBuffer, myRGain, myGGain, myBGain);
// Set up the Red-compensation parameter structure
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
611
612
Example Documentation
Jai_FactoryWrapper.RedCompensationStruct myRedCompensationParameters
= new Jai_FactoryWrapper.RedCompensationStruct();
// Remember to allocate the 10 Red-compensation ROI structures
myRedCompensationParameters.ColorCompensationROI = new Jai_FactoryWra
pper.ColorCompensationROIStruct[10];
if (fullImageCheckBox.Checked)
{
myRedCompensationParameters.NumOfROI = 1;
myRedCompensationParameters.ColorCompensationROI[0].RectOfROI.Lef
t = 0;
myRedCompensationParameters.ColorCompensationROI[0].RectOfROI.Rig
ht = (int)ImageInfo.SizeX - 1;
myRedCompensationParameters.ColorCompensationROI[0].RectOfROI.Top
= 0;
myRedCompensationParameters.ColorCompensationROI[0].RectOfROI.Bot
tom = (int)ImageInfo.SizeY - 1;
myRedCompensationParameters.ColorCompensationROI[0].RThreshold =
myRedThreshold;
myRedCompensationParameters.ColorCompensationROI[0].GThreshold =
myGreenThreshold;
myRedCompensationParameters.ColorCompensationROI[0].BThreshold =
myBlueThreshold;
myRedCompensationParameters.ColorCompensationROI[0].RGain = 4096
* myRedGain / 100;
myRedCompensationParameters.ColorCompensationROI[0].GGain = 4096
* myGreenGain / 100;
myRedCompensationParameters.ColorCompensationROI[0].BGain = 4096
* myBlueGain / 100;
}
else
{
myRedCompensationParameters.NumOfROI = 3;
for (int i = 0; i < 3; i++)
{
myRedCompensationParameters.ColorCompensationROI[i].RectOfROI
.Left = (int)ImageInfo.SizeX * i * 2 / 5;
myRedCompensationParameters.ColorCompensationROI[i].RectOfROI
.Right = (int)ImageInfo.SizeX * (i * 2 + 1) / 5 - 1;
myRedCompensationParameters.ColorCompensationROI[i].RectOfROI
.Top = (int)ImageInfo.SizeY * 2 / 5;
myRedCompensationParameters.ColorCompensationROI[i].RectOfROI
.Bottom = (int)ImageInfo.SizeY * 3 / 5 - 1;
myRedCompensationParameters.ColorCompensationROI[i].RThreshol
d = myRedThreshold;
myRedCompensationParameters.ColorCompensationROI[i].GThreshol
d = myGreenThreshold;
myRedCompensationParameters.ColorCompensationROI[i].BThreshol
d = myBlueThreshold;
myRedCompensationParameters.ColorCompensationROI[i].RGain = 4
096 * myRedGain / 100;
myRedCompensationParameters.ColorCompensationROI[i].GGain = 4
096 * myGreenGain / 100;
myRedCompensationParameters.ColorCompensationROI[i].BGain = 4
096 * myBlueGain / 100;
}
}
if (enableCheckBox.Checked)
{
retsta = Jai_FactoryWrapper.J_Image_Processing(ref myConversionBu
ffer, myRedCompensationParameters, true);
}
if (myViewWindow != IntPtr.Zero)
Jai_FactoryWrapper.J_Image_ShowImage(myViewWindow, ref myConversi
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.20 RedCompensationSample/Form1.cs
onBuffer, myRGain, myGGain, myBGain);
return;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Jai_FactoryWrapper.EFactoryError retsta;
// Free the conversion buffer again if it has been allocated
if (myConversionBuffer.ImageBuffer != IntPtr.Zero)
{
retsta = Jai_FactoryWrapper.J_Image_Free(ref myConversionBuffer);
myConversionBuffer.ImageBuffer = IntPtr.Zero;
}
if (myCamera != null)
{
myCamera.Close();
return;
}
}
private void redThresholdNumericUpDown_ValueChanged(object sender, EventA
rgs e)
{
myRedThreshold = Convert.ToUInt32(redThresholdNumericUpDown.Value);
}
private void greenThresholdNumericUpDown_ValueChanged(object sender, Even
tArgs e)
{
myGreenThreshold = Convert.ToUInt32(greenThresholdNumericUpDown.Value
);
}
private void blueThresholdNumericUpDown_ValueChanged(object sender, Event
Args e)
{
myBlueThreshold = Convert.ToUInt32(blueThresholdNumericUpDown.Value);
}
private void redGainNumericUpDown_ValueChanged(object sender, EventArgs e
)
{
myRedGain = Convert.ToUInt32(redGainNumericUpDown.Value);
}
private void greenGainNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
myGreenGain = Convert.ToUInt32(greenGainNumericUpDown.Value);
}
private void blueGainNumericUpDown_ValueChanged(object sender, EventArgs
e)
{
myBlueGain = Convert.ToUInt32(blueGainNumericUpDown.Value);
}
}
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
613
614
Example Documentation
8.21
SimpleImageDisplaySample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace SimpleImageDisplaySample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.21 SimpleImageDisplaySample/Form1.cs
myCamera.StartImageAcquisition(true, 5);
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.StopImageAcquisition();
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.ToStrin
g());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.ToStrin
g());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToString());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
}
else
HeightNumericUpDown.Enabled = false;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
615
616
Example Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.22 ZoomImageDisplaySample/Form1.cs
8.22
ZoomImageDisplaySample/Form1.cs
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Windows.Forms;
Jai_FactoryDotNET;
namespace ZoomImageDisplaySample
{
public partial class Form1 : Form
{
// Main factory object
CFactory myFactory = new CFactory();
// Opened camera obejct
CCamera myCamera;
// GenICam nodes
CNode myWidthNode;
CNode myHeightNode;
CNode myGainNode;
public Form1()
{
InitializeComponent();
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFactoryErro
r.Success;
// Open the factory with the default Registry database
error = myFactory.Open("");
// Search for cameras and update all controls
SearchButton_Click(null, null);
}
private void WidthNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myWidthNode != null)
myWidthNode.Value = int.Parse(WidthNumericUpDown.Value.ToString());
}
private void HeightNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (myHeightNode != null)
myHeightNode.Value = int.Parse(HeightNumericUpDown.Value.ToString());
}
private void GainTrackBar_Scroll(object sender, EventArgs e)
{
if (myGainNode != null)
myGainNode.Value = int.Parse(GainTrackBar.Value.ToString());
GainLabel.Text = myGainNode.Value.ToString();
}
private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
617
618
Example Documentation
myCamera.StartImageAcquisition(true, 5);
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.StopImageAcquisition();
}
private void SearchButton_Click(object sender, EventArgs e)
{
// Search for any new cameras using Filter Driver
myFactory.UpdateCameraList(Jai_FactoryDotNET.CFactory.EDriverType.Filter
Driver);
if (myFactory.CameraList.Count > 0)
{
// Open the camera
myCamera = myFactory.CameraList[0];
CameraIDTextBox.Text = myCamera.CameraID;
myCamera.Open();
// Zoom will only work if the Live Video is in Stretched mode
myCamera.StretchLiveVideo = true;
StartButton.Enabled = true;
StopButton.Enabled = true;
int currentValue = 0;
// Get the Width GenICam Node
myWidthNode = myCamera.GetNode("Width");
if (myWidthNode != null)
{
currentValue = int.Parse(myWidthNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
WidthNumericUpDown.Maximum = decimal.Parse(myWidthNode.Max.ToStrin
g());
WidthNumericUpDown.Minimum = decimal.Parse(myWidthNode.Min.ToStrin
g());
WidthNumericUpDown.Value = decimal.Parse(currentValue.ToString());
WidthNumericUpDown.Enabled = true;
}
else
WidthNumericUpDown.Enabled = false;
// Get the Height GenICam Node
myHeightNode = myCamera.GetNode("Height");
if (myHeightNode != null)
{
currentValue = int.Parse(myHeightNode.Value.ToString());
// Update range for the Numeric Up/Down control
// Convert from integer to Decimal type
HeightNumericUpDown.Maximum = decimal.Parse(myHeightNode.Max.ToStr
ing());
HeightNumericUpDown.Minimum = decimal.Parse(myHeightNode.Min.ToStr
ing());
HeightNumericUpDown.Value = decimal.Parse(currentValue.ToString())
;
HeightNumericUpDown.Enabled = true;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
8.22 ZoomImageDisplaySample/Form1.cs
}
else
HeightNumericUpDown.Enabled = false;
// Get the GainRaw GenICam Node
myGainNode = myCamera.GetNode("GainRaw");
if (myGainNode != null)
{
currentValue = int.Parse(myGainNode.Value.ToString());
// Update range for the TrackBar Controls
GainTrackBar.Maximum = int.Parse(myGainNode.Max.ToString());
GainTrackBar.Minimum = int.Parse(myGainNode.Min.ToString());
GainTrackBar.Value = currentValue;
GainLabel.Text = myGainNode.Value.ToString();
GainLabel.Enabled = true;
GainTrackBar.Enabled = true;
}
else
{
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
}
}
else
{
StartButton.Enabled = true;
StopButton.Enabled = true;
WidthNumericUpDown.Enabled = false;
HeightNumericUpDown.Enabled = true;
GainLabel.Enabled = false;
GainTrackBar.Enabled = false;
MessageBox.Show("No Cameras Found!");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
myCamera.Close();
}
private void LeftUpButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.NavigateLeftUp();
}
private void UpButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.NavigateUp();
}
private void RightUpButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.NavigateRightUp();
}
private void LeftButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.NavigateLeft();
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
619
620
Example Documentation
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
Index
_UndefinedAccesMode
WRAP_CAM, 163
_UndefinedCachingMode
WRAP_CAM, 163
_UndefinedEDisplayNotation
WRAP_CAM, 164
_UndefinedNameSpace
WRAP_CAM, 163
_UndefinedRepresentation
WRAP_CAM, 163
_UndefinedVisibility
WRAP_CAM, 161
AccessDenied
WRAP_FACTORY, 151
AccessMode
Jai_FactoryDotNET::CNode, 418
Jai_FactoryDotNET::CNode::IEnumValue,
434
AcquisitionCount
CAM_ACQUISITION, 339
AcquisitionStartFlag
Jai_FactoryDotNET::CCamera, 398
Action Command function, 157
Address
Jai_FactoryDotNET::CNode, 419
AliasNodeHandle
Jai_FactoryDotNET::CNode, 417
AnnouncedBuffers
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
AppendDelay
Jai_FactoryDotNET::CCamera::Script, 479
AppendStartImageAcquisition
Jai_FactoryDotNET::CCamera::Script, 480
AppendStopImageAcquisition
Jai_FactoryDotNET::CCamera::Script, 480
ARGB32_A
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 471
ARGB32_B
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 471
ARGB32_G
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 471
ARGB32_R
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 471
Asynchronous image recording, 368
AsyncImageRecordingCount
CAM_ASYNC_RECORDING, 370
AsyncImageRecordingDoneEvent
CAM_ASYNC_RECORDING, 370
AsyncImageRecordingDoneHandler
CAM_ASYNC_RECORDING, 369
AsyncImageRecordingMode
Jai_FactoryDotNET::CCamera, 392
AsyncImageRecordingSkipCount
CAM_ASYNC_RECORDING, 370
Auto
WRAP_CAMERA_SETTING, 185, 186
Automatic
WRAP_CAM, 164
AwaitDelivery
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
380
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
BASE
WRAP_DATASTREAM, 192
Base
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
378
BayerExtended
WRAP_IMAGE_VIEW, 275
BayerExtendedMultiprocessor
WRAP_IMAGE_VIEW, 275
BayerFast
WRAP_IMAGE_VIEW, 275
BayerFastMultiprocessor
WRAP_IMAGE_VIEW, 275
BayerSimple
WRAP_IMAGE_VIEW, 275
BayerSimpleMultiprocessor
WRAP_IMAGE_VIEW, 275
622
INDEX
BayerStandard
CachingMode
WRAP_IMAGE_VIEW, 275
Jai_FactoryDotNET::CNode, 417
BayerStandardMultiprocessor
CallbackMask
WRAP_IMAGE_VIEW, 275
WRAP_IMAGE_VIEW, 274
Beginner
CAM_SCRIPT
WRAP_CAM, 161
CameraNotOpen, 348
BGain
CameraReadOnly, 348
Jai_FactoryDotNET::Jai_ScriptAlreadyRunning, 348
FactoryWrapper::ColorCompensationROIStruct, ScriptCreateError, 348
422
Success, 348
BGR48_B
UnableToLoadScript, 348
Jai_FactoryDotNET::Jai_ValidationError, 348
FactoryWrapper::PixelValue, 471
CAM_ACQUISITION
BGR48_G
AcquisitionCount, 339
Jai_FactoryDotNET::Jai_EnablePacketResend, 339
FactoryWrapper::PixelValue, 471
ImageViewWindowDelegate, 335
BGR48_R
IsGrabbing, 339
Jai_FactoryDotNET::Jai_NewImageDelegate, 338
FactoryWrapper::PixelValue, 471
NumBuffersAnnounced, 340
BLOCK_ID
NumFramesAwaitingDelivery, 341
WRAP_DATASTREAM, 192
NumFramesCorruptOnDelivery, 341
BlockID
NumFramesDelivered, 339
Jai_FactoryDotNET::Jai_NumFramesLost, 340
FactoryWrapper::ImageInfo, 438
NumFramesQueued, 340
BlockId
PassCorruptFrames, 339
Jai_FactoryDotNET::CCamera, 396
StartAcquisition, 335
Jai_FactoryDotNET::Jai_StartImageAcquisition, 335337
FactoryWrapper::BufferInfoStruct,
StopAcquisition, 335
380
StopImageAcquisition, 337
Bmp
StopImageAcquisitionEx, 338
WRAP_IMAGE_MANI, 289
ViewWindowEventDelegate, 338
Boolean
CAM_ASYNC_RECORDING
WRAP_CAM, 163
AsyncImageRecordingCount, 370
BooleanValue
AsyncImageRecordingDoneEvent, 370
Jai_FactoryDotNET::Jai_AsyncImageRecordingDoneHandler, 369
FactoryWrapper::IVWOptionValue,
AsyncImageRecordingSkipCount, 370
441
FreeAsyncRecordedImages, 370
Bottom
GetAsyncImageRecordingMode, 371
Jai_FactoryDotNET::Jai_GetAsyncRecordedImage, 369
FactoryWrapper::RECT, 476
GetAsyncRecordedImages, 369
BThreshold
IsAsyncImageRecordingRunning, 370
Jai_FactoryDotNET::Jai_StartAsyncImageRecording, 369
FactoryWrapper::ColorCompensationROIStruct, StopAsyncImageRecording, 369
421
TotalAsyncImagesRecordedCount, 370
BufferNumber
CAM_CONNECTION
Jai_FactoryDotNET::Jai_NewConnectionStatusDelegate, 344
FactoryWrapper::BufferInfoStruct,
CAM_GEV_EVENT
378
GEVEventDelegate, 345
BuildDate
CAM_IMAGE_SAVE
Jai_FactoryDotNET::CFactory, 409
SaveLastFrame, 354
WRAP_FACTORY, 151
SaveLastFrameRaw, 355
BuildTime
SaveLastRawFrame, 354, 355
Jai_FactoryDotNET::CFactory, 409
SaveLastRawFrameRaw, 355
WRAP_FACTORY, 151
SaveNextFrame, 353
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
CAM_INTERPACKETDEAY
EstimatedInterPacketDelay, 366
CAM_NODE_ACCESS
GetNode, 351
GetNodeValue, 351
GetSubFeatures, 351
CAM_REGISTER_ACCESS
ReadRegister, 350
WriteRegister, 350
CAM_SCRIPT
CreateSettingsScript, 349
GetScriptErrorString, 348
GetScriptLastCommand, 348
GetScriptProgress, 348
RunScript, 348, 349
RunScriptResult, 347
ValidateScript, 348
CAM_WHITE_BALANCE
ExecuteWhiteBalance, 342
GetGain, 342
SetGain, 342
CAM_ZOOM
NavigateCenter, 362
NavigateDown, 363, 364
NavigateLeft, 361, 362
NavigateLeftDown, 363
NavigateLeftUp, 360
NavigateRight, 362, 363
NavigateRightDown, 364
NavigateRightUp, 361
NavigateUp, 360, 361
ZoomDirect, 359
ZoomIn, 358
ZoomOut, 359
ZoomReset, 359
Camera connection functions, 165
Camera Connection Status delegate, 344
Camera event specific functions, 212
Camera specific functions, 159
Camera.cs, 493
CameraHandle
Jai_FactoryDotNET::CCamera, 394
CameraID
Jai_FactoryDotNET::CCamera, 398
CameraList
Jai_FactoryDotNET::CFactory, 408
CameraNotOpen
CAM_SCRIPT, 348
CameraReadOnly
CAM_SCRIPT, 348
CanResend
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamParameterStruct,
485
623
WRAP_DATASTREAM, 193
CCamera
Jai_FactoryDotNET::CCamera, 393
CFactory
Jai_FactoryDotNET::CFactory, 404
Child
WRAP_IMAGE_VIEW, 273
ChildStretch
WRAP_IMAGE_VIEW, 273
Clear
Jai_FactoryDotNET::CCamera::Script, 479
Close
Jai_FactoryDotNET::CCamera, 394
Jai_FactoryDotNET::CFactory, 405
CNode
Jai_FactoryDotNET::CNode, 414
CoeffK1
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
CoeffK2
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
CoeffK3
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
CoeffP1
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
CoeffP2
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
Color-Compensation Image Processing algorithms,
324
ColorCompensationROI
Jai_FactoryDotNET::Jai_FactoryWrapper::GreenCompensationStruct,
430
Jai_FactoryDotNET::Jai_FactoryWrapper::RedCompensationStruct,
478
ColorInterpolationAlgorithm
Jai_FactoryDotNET::CCamera, 400
Colors
Jai_FactoryDotNET::Jai_FactoryWrapper::HistogramInfo, 431
Jai_FactoryDotNET::Jai_FactoryWrapper::LUTInfo, 466
Command
Jai_FactoryDotNET::CCamera::Command,
423
CommandList
Jai_FactoryDotNET::CCamera::Script, 481
Condition specific functions, 225
ConfigDeviceVersion
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
624
INDEX
Jai_FactoryDotNET::CCamera, 400
ConfigGenApiVersion
Jai_FactoryDotNET::CCamera, 400
ConfigModelName
Jai_FactoryDotNET::CCamera, 399
ConfigProductGuid
Jai_FactoryDotNET::CCamera, 400
ConfigSchemaVersion
Jai_FactoryDotNET::CCamera, 400
ConfigStandardNameSpace
Jai_FactoryDotNET::CCamera, 400
ConfigToolTip
Jai_FactoryDotNET::CCamera, 400
Configuration information function, 174
ConfigVendorName
Jai_FactoryDotNET::CCamera, 400
ConfigVersionGuid
Jai_FactoryDotNET::CCamera, 400
Connected
WRAP_EVENTINTERFACE, 208
CONNECTION
WRAP_EVENTINTERFACE, 208
CONNECTION_Status
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
426
ConnectionStatus
Jai_FactoryDotNET::CCamera, 397
ConnectionStatusCallBack
WRAP_DATASTREM_ACCESS, 183
Control
WRAP_CAM, 161
CreateSettingsScript
CAM_SCRIPT, 349
Custom
WRAP_CAM, 163
WRAP_IMAGE, 268
CUSTOM_INFO
WRAP_DATASTREAM, 193
cx
Jai_FactoryDotNET::Jai_FactoryWrapper::SIZE, 482
cy
Jai_FactoryDotNET::Jai_FactoryWrapper::SIZE, 482
CyclicBuffer
Jai_FactoryDotNET::CCamera, 392
Data Stream event specific functions, 217
Data Stream specific functions, 188
Description
Jai_FactoryDotNET::CNode, 416
Jai_FactoryDotNET::CNode::IEnumValue,
434
Jai_FactoryDotNET::Jai_FactoryWrapper::GenICamErrorInfo,
429
DeviceClass
Jai_FactoryDotNET::CCamera, 399
DeviceVersion
WRAP_CAM, 161
DIB24_B
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 470
DIB24_G
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 470
DIB24_R
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 470
Direct GenICam node value access functions, 167
Direct register access functions, 171
Direct Register Access methods, 350
Disconnected
WRAP_EVENTINTERFACE, 208
DisplayName
Jai_FactoryDotNET::CNode, 416
Jai_FactoryDotNET::CNode::IEnumValue,
434
DisplayNotation
Jai_FactoryDotNET::CNode, 416
DisplayPrecision
Jai_FactoryDotNET::CNode, 416
Dispose
Jai_FactoryDotNET::CFactory, 405
DocuURL
Jai_FactoryDotNET::CNode, 416
DoubleBuffering
WRAP_IMAGE_VIEW, 274
DriverType
Jai_FactoryDotNET::CCamera, 399
EAcqQueueType
WRAP_DATASTREAM, 191
EAcqStartFlags
WRAP_DATASTREAM, 191
EAcqStopFlags
WRAP_DATASTREAM, 191
EBufferInfoCmd
WRAP_DATASTREAM, 191
ECameraInfoType
WRAP_FACTORY, 151
EColorConversionPixelFormat
WRAP_IMAGE_VIEW, 275
EColorInterpolationAlgorithm
WRAP_IMAGE_VIEW, 275
ECondWaitResult
WRAP_EVENTINTERFACE, 208
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
EConfAccessMode
WRAP_CAM, 162
EConfCachingMode
WRAP_CAM, 163
EConfInfoType
WRAP_CAM, 161
EConfNameSpace
WRAP_CAM, 163
EConfNodeType
WRAP_CAM, 161
EConfRepresentation
WRAP_CAM, 163
EConfVisibility
WRAP_CAM, 161
EDataStreamParamCmd
WRAP_DATASTREAM, 193
EDeviceAccessFlags
WRAP_CAM, 161
EDeviceClass
Jai_FactoryDotNET::CCamera, 392
EDeviceConnectionType
WRAP_EVENTINTERFACE, 208
EDeviceEventType
WRAP_EVENTINTERFACE, 208
EDisplayNotation
WRAP_CAM, 163
EDriverType
Jai_FactoryDotNET::CFactory, 404
EEventInfoID
WRAP_EVENTINTERFACE, 207
EFactoryError
WRAP_FACTORY, 151
EFactoryInfoType
WRAP_FACTORY, 151
EFlipType
WRAP_IMAGE_TRANSFORM, 317
EInterpolationType
WRAP_IMAGE_PROCESSING_LENS_DISTORTION, 327
EIVWCallbackType
WRAP_IMAGE_VIEW, 274
EIVWOptionType
WRAP_IMAGE_VIEW, 273
EIVWWindowType
WRAP_IMAGE_VIEW, 273
ELoadSettingsFlag
WRAP_CAMERA_SETTING, 185
EnableAutoForceIP
Jai_FactoryDotNET::CFactory, 409
EnableColorInterpolation
Jai_FactoryDotNET::CCamera, 400
EnableLUT
Jai_FactoryDotNET::CCamera, 397
EnableMouseCursorDisplay
625
Jai_FactoryDotNET::CCamera, 396
EnableMouseZoom
Jai_FactoryDotNET::CCamera, 396
EnablePacketResend
CAM_ACQUISITION, 339
EnumAliasNodeHandle
Jai_FactoryDotNET::CNode, 418
EnumValues
Jai_FactoryDotNET::CNode, 418
EPixelFormatType
WRAP_IMAGE, 268
EPixelTypeColorInfo
WRAP_IMAGE, 268
EProcessFunctionType
WRAP_IMAGE_PROCESSING, 320
ERotateType
WRAP_IMAGE_TRANSFORM, 317
ERROR
WRAP_EVENTINTERFACE, 208
Error
WRAP_FACTORY, 151
ESaveFileFormat
WRAP_IMAGE_MANI, 289
ESaveSettingsFlag
WRAP_CAMERA_SETTING, 185
EstimatedInterPacketDelay
CAM_INTERPACKETDEAY, 366
EStreamInfoCmd
WRAP_DATASTREAM, 192
Event Interface functions, 206
EventID
Jai_FactoryDotNET::CNode, 417
Exclusive
WRAP_CAM, 161
ExecuteCommand
Jai_FactoryDotNET::CNode, 415
ExecuteWhiteBalance
CAM_WHITE_BALANCE, 342
Expert
WRAP_CAM, 161
Factory specific functions, 149
Factory.cs, 494
FactoryErrorException
Jai_FactoryDotNET::Jai_FactoryWrapper::FactoryErrorException,
428
FactoryHandle
Jai_FactoryDotNET::CCamera, 394
Jai_FactoryDotNET::CFactory, 408
FeatureName
Jai_FactoryDotNET::CCamera::Command,
423
FeatureValue
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
626
INDEX
Jai_FactoryDotNET::CCamera::Command,
423
FileIO
WRAP_FACTORY, 151
FilterDriver
Jai_FactoryDotNET::CFactory, 404
FindEnumValue
Jai_FactoryDotNET::CNode, 414
Fixed
WRAP_CAM, 164
FlipHorizontally
WRAP_IMAGE_TRANSFORM, 317
FlipImageHorizontally
Jai_FactoryDotNET::CCamera, 397
FlipImageVertically
Jai_FactoryDotNET::CCamera, 397
FlipVertically
WRAP_IMAGE_TRANSFORM, 317
FloatAliasNodeHandle
Jai_FactoryDotNET::CNode, 417
FocalLengthX
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
FocalLengthY
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
ForceAll
WRAP_CAMERA_SETTING, 185
ForceWrite
WRAP_CAMERA_SETTING, 186
FrameCounter
Jai_FactoryDotNET::CCamera, 396
FramesDisplayedPerSecond
Jai_FactoryDotNET::CCamera, 395
FramesPerSecond
Jai_FactoryDotNET::CCamera, 395
FreeAsyncRecordedImages
CAM_ASYNC_RECORDING, 370
FromRectangle
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 475
GenApiVersion
WRAP_CAM, 161
GenICam Feature Node access functions, 175
GenICam Node Access methods, 351
GenICam node specific functions, 235
GenICamError
WRAP_FACTORY, 151
GetAsyncImageRecordingMode
CAM_ASYNC_RECORDING, 371
GetAsyncRecordedImage
CAM_ASYNC_RECORDING, 369
GetAsyncRecordedImages
CAM_ASYNC_RECORDING, 369
GetFactoryErrorString
WRAP_FACTORY, 152
GetGain
CAM_WHITE_BALANCE, 342
GetHashCode
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 475
GetNode
CAM_NODE_ACCESS, 351
GetNodeValue
CAM_NODE_ACCESS, 351
GetPixelTypeColorInfo
WRAP_IMAGE, 269
GetPixelTypeMemorySize
WRAP_IMAGE, 269
GetScriptErrorString
CAM_SCRIPT, 348
GetScriptLastCommand
CAM_SCRIPT, 348
GetScriptProgress
CAM_SCRIPT, 348
GetSubFeatures
CAM_NODE_ACCESS, 351
GEV_EVENT_CMD
WRAP_EVENTINTERFACE, 208
GEV_EVENTDATA_CMD
WRAP_EVENTINTERFACE, 208
GEV_EVENT_CMD_BlockID
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
425
GEV_EVENT_CMD_EventData
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
426
GEV_EVENT_CMD_EventDataLength
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
426
GEV_EVENT_CMD_EventID
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
425
GEV_EVENT_CMD_StreamChannelIndex
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
425
GEV_EVENT_CMD_Timestamp
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
425
GEVEventCallBack
WRAP_DATASTREM_ACCESS, 184
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
GEVEventDelegate
WRAP_IMAGE, 268
CAM_GEV_EVENT, 345
GVSP_PIX_BAYRG10_PACKED
GGain
WRAP_IMAGE, 268
Jai_FactoryDotNET::Jai_GVSP_PIX_BAYRG12
FactoryWrapper::ColorCompensationROIStruct, WRAP_IMAGE, 268
422
GVSP_PIX_BAYRG12_PACKED
GigE Vision Event delegate, 345
WRAP_IMAGE, 269
GreenCompensation
GVSP_PIX_BAYRG16
WRAP_IMAGE_PROCESSING, 320
WRAP_IMAGE, 269
GreenCompensationMulti
GVSP_PIX_BAYRG8
WRAP_IMAGE_PROCESSING, 320
WRAP_IMAGE, 268
GThreshold
GVSP_PIX_BGR10_PACKED
Jai_FactoryDotNET::Jai_WRAP_IMAGE, 269
FactoryWrapper::ColorCompensationROIStruct,
GVSP_PIX_BGR12_PACKED
421
WRAP_IMAGE, 269
Guru
GVSP_PIX_BGR16_PACKED_INTERNAL
WRAP_CAM, 161
WRAP_IMAGE, 269
GVSP_PIX_BAYBG10
GVSP_PIX_BGR8_PACKED
WRAP_IMAGE, 268
WRAP_IMAGE, 269
GVSP_PIX_BAYBG10_PACKED
GVSP_PIX_BGRA8_PACKED
WRAP_IMAGE, 269
WRAP_IMAGE, 269
GVSP_PIX_BAYBG12
GVSP_PIX_MONO10
WRAP_IMAGE, 268
WRAP_IMAGE, 268
GVSP_PIX_BAYBG12_PACKED
GVSP_PIX_MONO10_PACKED
WRAP_IMAGE, 269
WRAP_IMAGE, 268
GVSP_PIX_BAYBG16
GVSP_PIX_MONO12
WRAP_IMAGE, 269
WRAP_IMAGE, 268
GVSP_PIX_BAYBG8
GVSP_PIX_MONO12_PACKED
WRAP_IMAGE, 268
WRAP_IMAGE, 268
GVSP_PIX_BAYGB10
GVSP_PIX_MONO14
WRAP_IMAGE, 268
WRAP_IMAGE, 268
GVSP_PIX_BAYGB10_PACKED
GVSP_PIX_MONO16
WRAP_IMAGE, 269
WRAP_IMAGE, 268
GVSP_PIX_BAYGB12
GVSP_PIX_MONO8
WRAP_IMAGE, 268
WRAP_IMAGE, 268
GVSP_PIX_BAYGB12_PACKED
GVSP_PIX_MONO8_SIGNED
WRAP_IMAGE, 269
WRAP_IMAGE, 268
GVSP_PIX_BAYGB16
GVSP_PIX_RGB10_PACKED
WRAP_IMAGE, 269
WRAP_IMAGE, 269
GVSP_PIX_BAYGB8
GVSP_PIX_RGB10_PLANAR
WRAP_IMAGE, 268
WRAP_IMAGE, 269
GVSP_PIX_BAYGR10
GVSP_PIX_RGB10V1_PACKED
WRAP_IMAGE, 268
WRAP_IMAGE, 269
GVSP_PIX_BAYGR10_PACKED
GVSP_PIX_RGB10V2_PACKED
WRAP_IMAGE, 268
WRAP_IMAGE, 269
GVSP_PIX_BAYGR12
GVSP_PIX_RGB12_PACKED
WRAP_IMAGE, 268
WRAP_IMAGE, 269
GVSP_PIX_BAYGR12_PACKED
GVSP_PIX_RGB12_PLANAR
WRAP_IMAGE, 269
WRAP_IMAGE, 269
GVSP_PIX_BAYGR16
GVSP_PIX_RGB12V1_PACKED
WRAP_IMAGE, 269
WRAP_IMAGE, 269
GVSP_PIX_BAYGR8
GVSP_PIX_RGB16_PACKED
WRAP_IMAGE, 268
WRAP_IMAGE, 269
GVSP_PIX_BAYRG10
GVSP_PIX_RGB16_PLANAR
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
627
628
INDEX
WRAP_IMAGE, 269
GVSP_PIX_RGB8_PACKED
WRAP_IMAGE, 269
GVSP_PIX_RGB8_PLANAR
WRAP_IMAGE, 269
GVSP_PIX_RGBA8_PACKED
WRAP_IMAGE, 269
GVSP_PIX_YUV411_PACKED
WRAP_IMAGE, 269
GVSP_PIX_YUV422_PACKED
WRAP_IMAGE, 269
GVSP_PIX_YUV444_PACKED
WRAP_IMAGE, 269
hDeviceContext
Jai_FactoryDotNET::Jai_FactoryWrapper::UserDrawInfo, 490
HEIGHT
WRAP_DATASTREAM, 192
Height
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 477
Jai_FactoryDotNET::Jai_FactoryWrapper::UserDrawInfo, 490
HexNumber
WRAP_CAM, 163
High Dynamic Range functions, 304
HistB
Jai_FactoryDotNET::Jai_FactoryWrapper::HistogramInfo, 432
HistEntries
Jai_FactoryDotNET::Jai_FactoryWrapper::HistogramInfo, 431
HistG
Jai_FactoryDotNET::Jai_FactoryWrapper::HistogramInfo, 431
Histogram functions, 314
HistR
Jai_FactoryDotNET::Jai_FactoryWrapper::HistogramInfo, 431
IAdvFeatureLock
WRAP_CAM, 162
IBoolean
WRAP_CAM, 162
ICategory
WRAP_CAM, 162
IChunkPort
WRAP_CAM, 162
ICommand
WRAP_CAM, 162
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
ImageViewWindowCallBack
WRAP_IMAGE_VIEW, 282
ImageViewWindowDelegate
CAM_ACQUISITION, 335
IMaskedIntReg
WRAP_CAM, 162
ImposeAccessMode
Jai_FactoryDotNET::CNode, 415
ImposeVisibility
Jai_FactoryDotNET::CNode, 415
Inc
Jai_FactoryDotNET::CNode, 419
INode
WRAP_CAM, 162
INodeMap
WRAP_CAM, 162
INodeMapDyn
WRAP_CAM, 162
INPUT_TO_OUTPUT
WRAP_DATASTREAM, 191
IntegerAliasNodeHandle
Jai_FactoryDotNET::CNode, 417
Inter-packet Delay calculation methods, 366
InterfaceID
Jai_FactoryDotNET::CCamera, 399
WRAP_FACTORY, 152
InterpolationBiLinear
WRAP_IMAGE_PROCESSING_LENS_DISTORTION, 328
InterpolationNone
WRAP_IMAGE_PROCESSING_LENS_DISTORTION, 328
InterpolationType
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
InvalidAddress
WRAP_FACTORY, 151
Invalidate
Jai_FactoryDotNET::CNode, 415
InvalidBufferSize
WRAP_FACTORY, 151
InvalidFilename
WRAP_FACTORY, 151
InvalidHandle
WRAP_FACTORY, 151
InvalidID
WRAP_FACTORY, 151
InvalidParameter
WRAP_FACTORY, 151
Invisible
WRAP_CAM, 161
IPAddress
629
Jai_FactoryDotNET::CCamera, 399
Jai_FactoryDotNET::Jai_FactoryWrapper::ActionCommandAck,
376
WRAP_FACTORY, 152
IPort
WRAP_CAM, 162
IPortConstruct
WRAP_CAM, 162
IPV4Address
WRAP_CAM, 163
IRegister
WRAP_CAM, 162
IRegister GenICam node specific functions, 262
IsAcquisitionRunning
Jai_FactoryDotNET::CCamera, 398
IsAsyncImageRecordingRunning
CAM_ASYNC_RECORDING, 370
IsAvailable
Jai_FactoryDotNET::CNode, 420
Jai_FactoryDotNET::CNode::IEnumValue,
435
IsBayerCamera
Jai_FactoryDotNET::CCamera, 398
IsCachable
Jai_FactoryDotNET::CNode, 416
IsDeprecated
Jai_FactoryDotNET::CNode, 417
ISelector
WRAP_CAM, 162
ISGRABBING
WRAP_DATASTREAM, 192
IsGrabbing
CAM_ACQUISITION, 339
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamInfoStruct,
484
IsImplemented
Jai_FactoryDotNET::CNode, 420
Jai_FactoryDotNET::CNode::IEnumValue,
435
IsLastFrameAvailable
Jai_FactoryDotNET::CCamera, 398
ISmartFeature
WRAP_CAM, 162
IsOpen
Jai_FactoryDotNET::CCamera, 397
ISQUEUED
WRAP_DATASTREAM, 192
IsQueued
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
IsReadable
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
630
INDEX
Jai_FactoryDotNET::CNode, 419
Jai_FactoryDotNET::CNode::IEnumValue,
434
IsReadOnly
Jai_FactoryDotNET::CCamera, 397
IsSelector
Jai_FactoryDotNET::CNode, 417
IsStreamable
Jai_FactoryDotNET::CNode, 417
IString GenICam node specific functions, 260
IStringReg
WRAP_CAM, 162
ISwissKnife
WRAP_CAM, 162
IsWritable
Jai_FactoryDotNET::CNode, 420
Jai_FactoryDotNET::CNode::IEnumValue,
435
ITextDesc
WRAP_CAM, 162
J_IVW_CB_AREA_SELECT
WRAP_IMAGE_VIEW, 274
J_IVW_CB_MOUSE_LBUTTON_DOWN
WRAP_IMAGE_VIEW, 274
J_IVW_CB_MOUSE_LBUTTON_UP
WRAP_IMAGE_VIEW, 274
J_IVW_CB_MOUSE_MOVE
WRAP_IMAGE_VIEW, 274
J_IVW_CB_MOUSE_RBUTTON_DOWN
WRAP_IMAGE_VIEW, 274
J_IVW_CB_MOUSE_RBUTTON_UP
WRAP_IMAGE_VIEW, 274
J_IVW_CB_USER_DRAW_IMAGE
WRAP_IMAGE_VIEW, 274
J_IVW_CB_USER_DRAW_VIEW_WINDOW
WRAP_IMAGE_VIEW, 275
J_IVW_CB_WINDOW_MOVE
WRAP_IMAGE_VIEW, 274
J_IVW_CB_WINDOW_SIZE
WRAP_IMAGE_VIEW, 274
J_IVW_CB_ZOOM_POS
WRAP_IMAGE_VIEW, 274
J_Camera_Close
WRAP_CONNECTION, 166
J_Camera_CreateDataStream
WRAP_DATASTREM_ACCESS, 182
J_Camera_CreateDataStreamMc
WRAP_DATASTREM_ACCESS, 183
J_Camera_ExecuteCommand
WRAP_DIRECT_NODE_ACCESS, 170
J_Camera_GetConfigInfo
WRAP_GET_INFO, 174
J_Camera_GetFeatureByName
WRAP_NODE_ACCESS, 179
J_Camera_GetNodeByIndex
WRAP_NODE_ACCESS, 176
J_Camera_GetNodeByName
WRAP_NODE_ACCESS, 177
J_Camera_GetNumOfDataStreams
WRAP_DATASTREM_ACCESS, 181
J_Camera_GetNumOfNodes
WRAP_NODE_ACCESS, 175
J_Camera_GetNumOfSubFeatures
WRAP_NODE_ACCESS, 177
J_Camera_GetSettingsValidationErrorInfo
WRAP_CAMERA_SETTING, 186
J_Camera_GetSubFeatureByIndex
WRAP_NODE_ACCESS, 178
J_Camera_GetValueDouble
WRAP_DIRECT_NODE_ACCESS, 168
J_Camera_GetValueInt64
WRAP_DIRECT_NODE_ACCESS, 167
J_Camera_GetValueString
WRAP_DIRECT_NODE_ACCESS, 168
J_Camera_InvalidateNodes
WRAP_NODE_ACCESS, 180
J_Camera_LoadSettings
WRAP_CAMERA_SETTING, 186
J_Camera_Open
WRAP_CONNECTION, 165
J_Camera_OpenMc
WRAP_CONNECTION, 165
J_Camera_ReadData
WRAP_DIRECT_REGISTER_ACCESS, 171
J_Camera_RegisterEvent
WRAP_EventInterface_camera, 212, 214
J_Camera_SaveSettings
WRAP_CAMERA_SETTING, 186
J_Camera_SetValueDouble
WRAP_DIRECT_NODE_ACCESS, 169
J_Camera_SetValueInt64
WRAP_DIRECT_NODE_ACCESS, 169
J_Camera_SetValueString
WRAP_DIRECT_NODE_ACCESS, 169
J_Camera_UnRegisterEvent
WRAP_EventInterface_camera, 215
J_Camera_WriteData
WRAP_DIRECT_REGISTER_ACCESS, 172
J_DataStream_AnnounceBuffer
WRAP_DATASTREAM, 193
J_DataStream_Close
WRAP_DATASTREAM, 197
J_DataStream_FlushQueue
WRAP_DATASTREAM, 194
J_DataStream_GetBufferID
WRAP_DATASTREAM, 197
J_DataStream_GetBufferInfo
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
WRAP_DATASTREAM, 200
J_DataStream_GetParam
WRAP_DATASTREAM, 204
J_DataStream_GetStreamInfo
WRAP_DATASTREAM, 197
J_DataStream_QueueBuffer
WRAP_DATASTREAM, 199
J_DataStream_RegisterEvent
WRAP_EventInterface_datastream, 217, 220
J_DataStream_RevokeBuffer
WRAP_DATASTREAM, 198
J_DataStream_SetParam
WRAP_DATASTREAM, 205
J_DataStream_StartAcquisition
WRAP_DATASTREAM, 195
J_DataStream_StopAcquisition
WRAP_DATASTREAM, 196
J_DataStream_UnRegisterEvent
WRAP_EventInterface_datastream, 224
J_Event_Close
WRAP_EVENTINTERFACE, 210
J_Event_CloseCondition
WRAP_EventInterface_condition, 232
J_Event_CreateCondition
WRAP_EventInterface_condition, 226
J_Event_ExitCondition
WRAP_EventInterface_condition, 227
J_Event_Flush
WRAP_EVENTINTERFACE, 210
J_Event_GetData
WRAP_EVENTINTERFACE, 209
J_Event_GetInfo
WRAP_EVENTINTERFACE, 210
J_Event_ResetCondition
WRAP_EventInterface_condition, 228
J_Event_SignalCondition
WRAP_EventInterface_condition, 227
J_Event_WaitForCondition
WRAP_EventInterface_condition, 228
J_Event_WaitForMultipleConditions
WRAP_EventInterface_condition, 230
J_Factory_Close
WRAP_FACTORY, 152
J_Factory_EnableForceIp
WRAP_FACTORY, 156
J_Factory_GetCameraIDByIndex
WRAP_FACTORY, 155
J_Factory_GetCameraInfo
WRAP_FACTORY, 155
J_Factory_GetGenICamErrorInfo
WRAP_FACTORY, 156
J_Factory_GetInfo
WRAP_FACTORY, 153
J_Factory_GetNumOfCameras
631
WRAP_FACTORY, 154
J_Factory_Open
WRAP_FACTORY, 152
J_Factory_SendActionCommand
WRAP_ACTION_CMD, 158
J_Factory_UpdateCameraList
WRAP_FACTORY, 153
J_Image_AnalyzeHDR
WRAP_IMAGE_HDR, 305
J_Image_ApplyGammaToLUT
WRAP_IMAGE_LUT, 309
J_Image_ClearHistogram
WRAP_IMAGE_HIST, 315
J_Image_CloseStream
WRAP_IMAGE_STREAM, 286
J_Image_CloseViewWindow
WRAP_IMAGE_VIEW, 277
J_Image_ConvertImage
WRAP_IMAGE_MANI, 292
J_Image_ConvertLUT
WRAP_IMAGE_LUT, 308
J_Image_CreateGammaLUT
WRAP_IMAGE_LUT, 309
J_Image_CreateHistogram
WRAP_IMAGE_HIST, 315
J_Image_CreateKneeLUT
WRAP_IMAGE_LUT, 311
J_Image_CreateLinearLUT
WRAP_IMAGE_LUT, 310
J_Image_ExecuteWhiteBalance
WRAP_IMAGE_WB, 303
J_Image_Flip
WRAP_IMAGE_TRANSFORM, 318
J_Image_Free
WRAP_IMAGE_MANI, 294
J_Image_FreeHistogram
WRAP_IMAGE_HIST, 315
J_Image_FreeLUT
WRAP_IMAGE_LUT, 308
J_Image_FromRawToDIB
WRAP_IMAGE_MANI, 289
J_Image_FromRawToImage
WRAP_IMAGE_MANI, 290, 291
J_Image_FuseHDR
WRAP_IMAGE_HDR, 305
J_Image_GetAverage
WRAP_IMAGE_pixel, 301
J_Image_GetFrameWindowRect
WRAP_IMAGE_VIEW, 280
J_Image_GetGain
WRAP_IMAGE_WB, 302
J_Image_GetHistogramValue
WRAP_IMAGE_HIST, 315
J_Image_GetImageOffsetEx
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
632
INDEX
WRAP_IMAGE_VIEW, 279
J_Image_GetLUTValue
WRAP_IMAGE_LUT, 312
J_Image_GetPixel
WRAP_IMAGE_pixel, 300
J_Image_GetPixelEx
WRAP_IMAGE_pixel, 300
J_Image_GetStreamHandle
WRAP_IMAGE_STREAM, 286
J_Image_GetStreamInfo
WRAP_IMAGE_STREAM, 286
J_Image_GetViewWindowOption
WRAP_IMAGE_VIEW, 282
J_Image_GetViewWindowRect
WRAP_IMAGE_VIEW, 280
J_Image_LoadFileRaw
WRAP_IMAGE_save, 298
J_Image_LoadLUT
WRAP_IMAGE_LUT, 313
J_Image_LUT
WRAP_IMAGE_LUT, 309
J_Image_Malloc
WRAP_IMAGE_MANI, 292, 294
J_Image_MallocDIB
WRAP_IMAGE_MANI, 293
J_Image_MallocHDR
WRAP_IMAGE_HDR, 304
J_Image_MallocHistogram
WRAP_IMAGE_HIST, 314
J_Image_MallocLUT
WRAP_IMAGE_LUT, 308
J_Image_MoveViewWindow
WRAP_IMAGE_VIEW, 279
J_Image_OpenStream
WRAP_IMAGE_STREAM, 285
J_Image_OpenStreamLight
WRAP_IMAGE_STREAM, 285
J_Image_OpenViewWindow
WRAP_IMAGE_VIEW, 276
J_Image_OpenViewWindowEx
WRAP_IMAGE_VIEW, 277
J_Image_Processing
WRAP_IMAGE_PROCESSING, 320
WRAP_IMAGE_PROCESSING_COLOR_COMPENSATION, 324, 325
WRAP_IMAGE_PROCESSING_LENS_DISTORTION, 328
J_Image_ProcessingEx
WRAP_IMAGE_PROCESSING, 322
J_Image_ProcessingFree
WRAP_IMAGE_PROCESSING_LENS_DISTORTION, 329
J_Image_ProcessingInit
WRAP_IMAGE_PROCESSING_LENS_DISTORTION, 329
J_Image_ResizeChildWindow
WRAP_IMAGE_VIEW, 280
J_Image_Rotate
WRAP_IMAGE_TRANSFORM, 318
J_Image_SaveFile
WRAP_IMAGE_save, 297
J_Image_SaveFileEx
WRAP_IMAGE_save, 297
J_Image_SaveFileRaw
WRAP_IMAGE_save, 298
J_Image_SaveLUT
WRAP_IMAGE_LUT, 313
J_Image_SetGain
WRAP_IMAGE_WB, 302
J_Image_SetImageOffset
WRAP_IMAGE_VIEW, 278
J_Image_SetImageOffsetEx
WRAP_IMAGE_VIEW, 279
J_Image_SetLUTValue
WRAP_IMAGE_LUT, 312
J_Image_SetPixel
WRAP_IMAGE_pixel, 301
J_Image_SetViewWindowCallback
WRAP_IMAGE_VIEW, 283
J_Image_SetViewWindowOption
WRAP_IMAGE_VIEW, 281
J_Image_SetViewWindowTitle
WRAP_IMAGE_VIEW, 281
J_Image_ShowImage
WRAP_IMAGE_VIEW, 277, 278
J_Node_ExecuteCommand
WRAP_NODE_CMD, 259
J_Node_GetAccessMode
WRAP_NODE, 238
J_Node_GetAlias
WRAP_NODE, 243
J_Node_GetCachingMode
WRAP_NODE, 240
J_Node_GetCommandIsDone
WRAP_NODE_CMD, 259
J_Node_GetDescription
WRAP_NODE, 241
J_Node_GetDisplayName
WRAP_NODE, 241
J_Node_GetDisplayNotation
WRAP_NODE_FLOAT, 254
J_Node_GetDisplayPrecision
WRAP_NODE_FLOAT, 254
J_Node_GetDocuURL
WRAP_NODE, 246
J_Node_GetEnumAlias
WRAP_NODE_FLOAT, 256
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
J_Node_GetEnumEntryByIndex
WRAP_NODE_ENUM, 258
J_Node_GetEnumEntryValue
WRAP_NODE_ENUM, 258
J_Node_GetEventID
WRAP_NODE, 241
J_Node_GetFloatAlias
WRAP_NODE_INT, 250
J_Node_GetFloatHasInc
WRAP_NODE_FLOAT, 255
J_Node_GetFloatInc
WRAP_NODE_FLOAT, 255
J_Node_GetInc
WRAP_NODE_INT, 249
J_Node_GetIntAlias
WRAP_NODE_FLOAT, 255
J_Node_GetIsCachable
WRAP_NODE, 239
J_Node_GetIsDeprecated
WRAP_NODE, 247
J_Node_GetIsSelector
WRAP_NODE, 244
J_Node_GetIsStreamable
WRAP_NODE, 241
J_Node_GetMaxDouble
WRAP_NODE_FLOAT, 253
J_Node_GetMaxInt64
WRAP_NODE_INT, 249
J_Node_GetMinDouble
WRAP_NODE_FLOAT, 253
J_Node_GetMinInt64
WRAP_NODE_INT, 248
J_Node_GetName
WRAP_NODE, 238
J_Node_GetNameSpace
WRAP_NODE, 239
J_Node_GetNumOfEnumEntries
WRAP_NODE_ENUM, 257
J_Node_GetNumOfProperties
WRAP_NODE, 242
J_Node_GetNumOfSelectedFeatures
WRAP_NODE, 244
J_Node_GetNumOfSelectingFeatures
WRAP_NODE, 245
J_Node_GetPollingTime
WRAP_NODE, 240
J_Node_GetPropertyByName
WRAP_NODE, 242
J_Node_GetPropertyNameByIndex
WRAP_NODE, 242
J_Node_GetRegisterAddress
WRAP_NODE_REG, 263
J_Node_GetRegisterLength
WRAP_NODE_REG, 263
633
J_Node_GetRepresentation
WRAP_NODE, 246
J_Node_GetSelectedFeatureByIndex
WRAP_NODE, 245
J_Node_GetSelectingFeatureByIndex
WRAP_NODE, 245
J_Node_GetToolTip
WRAP_NODE, 240
J_Node_GetType
WRAP_NODE, 244
J_Node_GetUnit
WRAP_NODE, 246
J_Node_GetValueDouble
WRAP_NODE_FLOAT, 254
J_Node_GetValueInt64
WRAP_NODE_INT, 250
J_Node_GetValueRegister
WRAP_NODE_REG, 263
J_Node_GetValueString
WRAP_NODE_STR, 260
J_Node_GetVisibility
WRAP_NODE, 239
J_Node_ImposeAccessMode
WRAP_NODE, 243
J_Node_ImposeVisibility
WRAP_NODE, 243
J_Node_Invalidate
WRAP_NODE, 239
J_Node_RegisterCallback
WRAP_NODE, 244
J_Node_SetValueDouble
WRAP_NODE_FLOAT, 253
J_Node_SetValueInt64
WRAP_NODE_INT, 250
J_Node_SetValueRegister
WRAP_NODE_REG, 262
J_Node_SetValueString
WRAP_NODE_STR, 260
Jai
WRAP_IMAGE_MANI, 289
JAI SDK .NET Wrapper, 147
Jai_FactoryDotNET::CCamera
CyclicBuffer, 392
List, 392
Peripheral, 393
Receiver, 393
Transceiver, 393
Transmitter, 393
Jai_FactoryDotNET::CFactory
FilterDriver, 404
SocketDriver, 404
Undefined, 404
Jai_Factory_Wrapper.cs, 495
Jai_FactoryDotNET::CCamera, 381
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
634
INDEX
AcquisitionStartFlag, 398
AsyncImageRecordingMode, 392
BlockId, 396
CameraHandle, 394
CameraID, 398
CCamera, 393
Close, 394
ColorInterpolationAlgorithm, 400
ConfigDeviceVersion, 400
ConfigGenApiVersion, 400
ConfigModelName, 399
ConfigProductGuid, 400
ConfigSchemaVersion, 400
ConfigStandardNameSpace, 400
ConfigToolTip, 400
ConfigVendorName, 400
ConfigVersionGuid, 400
ConnectionStatus, 397
DeviceClass, 399
DriverType, 399
EDeviceClass, 392
EnableColorInterpolation, 400
EnableLUT, 397
EnableMouseCursorDisplay, 396
EnableMouseZoom, 396
FactoryHandle, 394
FlipImageHorizontally, 397
FlipImageVertically, 397
FrameCounter, 396
FramesDisplayedPerSecond, 395
FramesPerSecond, 395
ImageRotateType, 397
ImageSize, 395
InterfaceID, 399
IPAddress, 399
IsAcquisitionRunning, 398
IsBayerCamera, 398
IsLastFrameAvailable, 398
IsOpen, 397
IsReadOnly, 397
LastFrameCopy, 398
LastRawFrameCopy, 398
LiveVideoWindowRectangle, 397
LUT, 397
MACAddress, 399
Manufacturer, 398
MissingPackets, 396
ModelName, 399
NumOfDataStreams, 399
OffsetX, 395
OffsetY, 395
Open, 393
RestoreLiveVideoWindow, 396
RotateImage, 397
SerialNumber, 399
SizeX, 395
SizeY, 395
SkipImageDisplayWhenBusy, 397
StreamHandle, 394
StretchLiveVideo, 396
Tag, 395
TickFrequency, 396
TimeStamp, 395
TimeStampMs, 396
TotalMissingPackets, 396
UserName, 399
WindowHandle, 394
Jai_FactoryDotNET::CCamera::Command, 423
Command, 423
FeatureName, 423
FeatureValue, 423
Jai_FactoryDotNET::CCamera::Script, 479
AppendDelay, 479
AppendStartImageAcquisition, 480
AppendStopImageAcquisition, 480
Clear, 479
CommandList, 481
LoadScript, 480
SaveScript, 480
Jai_FactoryDotNET::CFactory, 402
BuildDate, 409
BuildTime, 409
CameraList, 408
CFactory, 404
Close, 405
Dispose, 405
EDriverType, 404
EnableAutoForceIP, 409
FactoryHandle, 408
Manufacturer, 409
NumOfCameras, 410
Open, 405
PreferredDriverType, 409
SendActionCommand, 405, 407
UpdateCameraList, 405
Version, 409
Jai_FactoryDotNET::CNode, 411
AccessMode, 418
Address, 419
AliasNodeHandle, 417
CachingMode, 417
CNode, 414
Description, 416
DisplayName, 416
DisplayNotation, 416
DisplayPrecision, 416
DocuURL, 416
EnumAliasNodeHandle, 418
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
EnumValues, 418
EventID, 417
ExecuteCommand, 415
FindEnumValue, 414
FloatAliasNodeHandle, 417
ImposeAccessMode, 415
ImposeVisibility, 415
Inc, 419
IntegerAliasNodeHandle, 417
Invalidate, 415
IsAvailable, 420
IsCachable, 416
IsDeprecated, 417
IsImplemented, 420
IsReadable, 419
IsSelector, 417
IsStreamable, 417
IsWritable, 420
Length, 419
Max, 419
Min, 418
Name, 416
NameSpace, 416
NodeHandle, 418
NodeType, 418
NodeValueType, 420
PollingTime, 417
Representation, 416
SelectedNodes, 417
SelectingNodeNames, 417
Tag, 418
ToolTip, 416
Unit, 416
Value, 420
Visibility, 418
Jai_FactoryDotNET::CNode::IEnumValue, 433
AccessMode, 434
Description, 434
DisplayName, 434
IEnumValue, 434
IsAvailable, 435
IsImplemented, 435
IsReadable, 434
IsWritable, 435
Name, 434
ToString, 434
Value, 434
Jai_FactoryDotNET::Jai_FactoryWrapper, 442
Jai_FactoryDotNET::Jai_FactoryWrapper::ActionCommandAck,
375
ID, 376
IPAddress, 376
Length, 376
635
Status, 375
Type, 375
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
377
AwaitDelivery, 380
Base, 378
BlockId, 380
BufferNumber, 378
Height, 379
IsQueued, 379
MissingPackets, 380
NewData, 378
PayloadType, 379
PixelFormat, 379
Size, 378
TimeStamp, 378
UserPointer, 378
Width, 379
XOffset, 379
XPadding, 379
YOffset, 379
YPadding, 379
Jai_FactoryDotNET::Jai_FactoryWrapper::ColorCompensationROIStruct,
421
BGain, 422
BThreshold, 421
GGain, 422
GThreshold, 421
RectOfROI, 421
RGain, 422
RThreshold, 421
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
425
CONNECTION_Status, 426
GEV_EVENT_CMD_BlockID, 425
GEV_EVENT_CMD_EventData, 426
GEV_EVENT_CMD_EventDataLength, 426
GEV_EVENT_CMD_EventID, 425
GEV_EVENT_CMD_StreamChannelIndex,
425
GEV_EVENT_CMD_Timestamp, 425
NEW_BUFFER_BufferHandle, 426
Jai_FactoryDotNET::Jai_FactoryWrapper::EventInfoData, 427
NumEntriesInQueue, 427
Jai_FactoryDotNET::Jai_FactoryWrapper::FactoryErrorException,
428
FactoryErrorException, 428
Jai_FactoryDotNET::Jai_FactoryWrapper::GenICamErrorInfo,
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
636
INDEX
429
ARGB32_A, 471
Description, 429
ARGB32_B, 471
NodeName, 429
ARGB32_G, 471
Jai_FactoryDotNET::Jai_ARGB32_R, 471
FactoryWrapper::GreenCompensationStruct,
BGR48_B, 471
430
BGR48_G, 471
ColorCompensationROI, 430
BGR48_R, 471
NumOfROI, 430
DIB24_B, 470
Jai_FactoryDotNET::Jai_DIB24_G, 470
FactoryWrapper::HistogramInfo, 431
DIB24_R, 470
Colors, 431
MONO10_Y, 469
HistB, 432
MONO12_Y, 470
HistEntries, 431
MONO16_Y, 470
HistG, 431
MONO8_Y, 469
HistR, 431
RGB24_B, 470
PixelDepth, 431
RGB24_G, 470
Jai_FactoryDotNET::Jai_RGB24_R, 471
FactoryWrapper::ImageInfo, 436
Jai_FactoryDotNET::Jai_FactoryWrapper::POINT,
AnnouncedBuffers, 437
472
AwaitDelivery, 437
operator POINT, 473
BlockID, 438
operator System.Drawing.Point, 473
ImageBuffer, 437
POINT, 472
ImageSize, 437
X, 473
MissingPackets, 437
Y, 473
OffsetX, 437
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT,
OffsetY, 437
474
PixelFormat, 437
Bottom, 476
QueuedBuffers, 437
FromRectangle, 475
SizeX, 437
GetHashCode, 475
SizeY, 437
Height, 477
TimeStamp, 437
Left, 476
Jai_FactoryDotNET::Jai_Location, 477
FactoryWrapper::IVWCallbackValue,
operator RECT, 476
439
operator Rectangle, 476
PointValue, 439
RECT, 475
RectValue, 439
Right, 476
SizeValue, 439
Size, 477
UserDrawInfoValue, 439
Top, 476
ZoomPosValue, 439
ToRectangle, 475
Jai_FactoryDotNET::Jai_Width, 477
FactoryWrapper::IVWOptionValue,
Jai_FactoryDotNET::Jai_441
FactoryWrapper::RedCompensationStruct,
BooleanValue, 441
478
UInt32Value, 441
ColorCompensationROI, 478
Jai_FactoryDotNET::Jai_NumOfROI, 478
FactoryWrapper::LUTInfo, 466
Jai_FactoryDotNET::Jai_FactoryWrapper::SIZE,
Colors, 466
482
LutB, 467
cx, 482
LUTEntries, 466
cy, 482
LutG, 466
SIZE, 482
LutR, 466
Jai_FactoryDotNET::Jai_PixelDepth, 466
FactoryWrapper::StreamInfoStruct,
Jai_FactoryDotNET::Jai_483
FactoryWrapper::PixelValue, 468
IsGrabbing, 484
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
NumOfBuffersAnnounced, 484
NumOfFramesAwaitingDelivery, 484
NumOfFramesCorruptOnDelivery, 484
NumOfFramesDelivered, 484
NumOfFramesLostQueueUnderrun, 484
NumOfFramesQueued, 484
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamParameterStruct,
485
CanResend, 485
MaxFramesInNotCompletedList, 486
NumberOfBytesPerFrame, 485
OutOfOrderPacketsBeforeResend, 486
PassCorruptFrames, 485
RxTimeout, 486
RxTimeoutsBeforeListFlush, 486
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 487
CoeffK1, 488
CoeffK2, 488
CoeffK3, 488
CoeffP1, 488
CoeffP2, 488
FocalLengthX, 488
FocalLengthY, 488
InterpolationType, 488
OpticalCenterX, 488
OpticalCenterY, 488
Jai_FactoryDotNET::Jai_FactoryWrapper::UserDrawInfo, 490
hDeviceContext, 490
Height, 490
Width, 490
Jai_FactoryDotNET::Jai_FactoryWrapper::ZoomPos, 491
Offset, 491
ZoomRatioX, 491
ZoomRatioY, 491
Jpeg
WRAP_IMAGE_MANI, 289
KILL
WRAP_DATASTREAM, 191
LAST_IMAGE
WRAP_DATASTREAM, 191
LastFrameCopy
Jai_FactoryDotNET::CCamera, 398
LastRawFrameCopy
Jai_FactoryDotNET::CCamera, 398
Left
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 476
Length
637
Jai_FactoryDotNET::CNode, 419
Jai_FactoryDotNET::Jai_FactoryWrapper::ActionCommandAck,
376
Lens Distortion Correction Image Processing algorithms, 327
LensDistortion
WRAP_IMAGE_PROCESSING, 320
LensDistortionMapFree
WRAP_IMAGE_PROCESSING, 320
LensDistortionMapInit
WRAP_IMAGE_PROCESSING, 320
LensDistortionMulti
WRAP_IMAGE_PROCESSING, 320
Linear
WRAP_CAM, 163
List
Jai_FactoryDotNET::CCamera, 392
LiveVideoWindowRectangle
Jai_FactoryDotNET::CCamera, 397
LoadScript
Jai_FactoryDotNET::CCamera::Script, 480
Location
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 477
Logarithmic
WRAP_CAM, 163
Lookup-Table functions, 307
LostControl
WRAP_EVENTINTERFACE, 208
LUT
Jai_FactoryDotNET::CCamera, 397
LutB
Jai_FactoryDotNET::Jai_FactoryWrapper::LUTInfo, 467
LUTEntries
Jai_FactoryDotNET::Jai_FactoryWrapper::LUTInfo, 466
LutG
Jai_FactoryDotNET::Jai_FactoryWrapper::LUTInfo, 466
LutR
Jai_FactoryDotNET::Jai_FactoryWrapper::LUTInfo, 466
MACAddress
Jai_FactoryDotNET::CCamera, 399
WRAP_CAM, 163
WRAP_FACTORY, 152
Manufacturer
Jai_FactoryDotNET::CCamera, 398
Jai_FactoryDotNET::CFactory, 409
WRAP_FACTORY, 151, 152
Max
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
638
INDEX
Jai_FactoryDotNET::CNode, 419
MAX_ID
WRAP_EVENTINTERFACE, 208
MaxFramesInNotCompletedList
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamParameterStruct,
486
WRAP_DATASTREAM, 193
Min
Jai_FactoryDotNET::CNode, 418
MissingPackets
Jai_FactoryDotNET::CCamera, 396
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
380
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
ModelName
Jai_FactoryDotNET::CCamera, 399
WRAP_CAM, 161
WRAP_FACTORY, 152
MONO10_Y
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 469
MONO12_Y
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 470
MONO16_Y
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 470
MONO8_Y
Jai_FactoryDotNET::Jai_FactoryWrapper::PixelValue, 469
Monochrome
WRAP_IMAGE, 268
MouseCursor
WRAP_IMAGE_VIEW, 274
MouseZoom
WRAP_IMAGE_VIEW, 274
NA
WRAP_CAM, 163
Name
Jai_FactoryDotNET::CNode, 416
Jai_FactoryDotNET::CNode::IEnumValue,
434
NameSpace
Jai_FactoryDotNET::CNode, 416
NavigateCenter
CAM_ZOOM, 362
NavigateDown
CAM_ZOOM, 363, 364
NavigateLeft
CAM_ZOOM, 361, 362
NavigateLeftDown
CAM_ZOOM, 363
NavigateLeftUp
CAM_ZOOM, 360
NavigateRight
CAM_ZOOM, 362, 363
NavigateRightDown
CAM_ZOOM, 364
NavigateRightUp
CAM_ZOOM, 361
NavigateUp
CAM_ZOOM, 360, 361
NEW_BUFFER
WRAP_EVENTINTERFACE, 208
NEW_DATA
WRAP_DATASTREAM, 192
NEW_IMAGE
WRAP_DATASTREAM, 191
NEW_BUFFER_BufferHandle
Jai_FactoryDotNET::Jai_FactoryWrapper::DeviceEventData,
426
NewConnectionStatusDelegate
CAM_CONNECTION, 344
NewData
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
378
NewImageDelegate
CAM_ACQUISITION, 338
NEXT_IMAGE
WRAP_DATASTREAM, 191
NI
WRAP_CAM, 163
NoCache
WRAP_CAM, 163
NoData
WRAP_FACTORY, 151
Node Event delegate, 346
Node.cs, 497
NODE_EVENT
NodeEventDelegate, 346
NodeChangeDelegate
WRAP_NODE, 243
NodeEventCallBack
WRAP_DATASTREM_ACCESS, 184
NodeEventDelegate
NODE_EVENT, 346
NodeHandle
Jai_FactoryDotNET::CNode, 418
NodeName
Jai_FactoryDotNET::Jai_FactoryWrapper::GenICamErrorInfo,
429
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
NodeType
Jai_FactoryDotNET::CNode, 418
NodeValueType
Jai_FactoryDotNET::CNode, 420
NONE
WRAP_DATASTREAM, 191, 192
None
WRAP_CAM, 161
NUM_ENTRYS_IN_QUEUE
WRAP_EVENTINTERFACE, 208
NUM_PACKETS_MISSING
WRAP_DATASTREAM, 192
NUMBER
WRAP_DATASTREAM, 192
NUMBER_OF_FRAMES_ANNOUNCED
WRAP_DATASTREAM, 192
NUMBER_OF_FRAMES_AWAIT_DELIVERY
WRAP_DATASTREAM, 192
NUMBER_OF_FRAMES_CORRUPT_ON_DELIEVRY
WRAP_DATASTREAM, 193
NUMBER_OF_FRAMES_DELIVERED
WRAP_DATASTREAM, 192
NUMBER_OF_FRAMES_LOST_QUEUE_UNDERRUN
WRAP_DATASTREAM, 192
NUMBER_OF_FRAMES_QUEUED
WRAP_DATASTREAM, 192
NumberOfBytesPerFrame
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamParameterStruct,
485
WRAP_DATASTREAM, 193
NumBuffersAnnounced
CAM_ACQUISITION, 340
NumEntriesInQueue
Jai_FactoryDotNET::Jai_FactoryWrapper::EventInfoData, 427
NumFramesAwaitingDelivery
CAM_ACQUISITION, 341
NumFramesCorruptOnDelivery
CAM_ACQUISITION, 341
NumFramesDelivered
CAM_ACQUISITION, 339
NumFramesLost
CAM_ACQUISITION, 340
NumFramesQueued
CAM_ACQUISITION, 340
NumOfBuffersAnnounced
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamInfoStruct,
484
NumOfCameras
Jai_FactoryDotNET::CFactory, 410
639
NumOfDataStreams
Jai_FactoryDotNET::CCamera, 399
NumOfFramesAwaitingDelivery
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamInfoStruct,
484
NumOfFramesCorruptOnDelivery
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamInfoStruct,
484
NumOfFramesDelivered
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamInfoStruct,
484
NumOfFramesLostQueueUnderrun
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamInfoStruct,
484
NumOfFramesQueued
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamInfoStruct,
484
NumOfROI
Jai_FactoryDotNET::Jai_FactoryWrapper::GreenCompensationStruct,
430
Jai_FactoryDotNET::Jai_FactoryWrapper::RedCompensationStruct,
478
Offset
Jai_FactoryDotNET::Jai_FactoryWrapper::ZoomPos, 491
OffsetX
Jai_FactoryDotNET::CCamera, 395
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
OffsetY
Jai_FactoryDotNET::CCamera, 395
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
Open
Jai_FactoryDotNET::CCamera, 393
Jai_FactoryDotNET::CFactory, 405
operator POINT
Jai_FactoryDotNET::Jai_FactoryWrapper::POINT, 473
operator RECT
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 476
operator Rectangle
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 476
operator System.Drawing.Point
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
640
INDEX
Jai_FactoryDotNET::Jai_FactoryWrapper::POINT, 473
OpticalCenterX
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
OpticalCenterY
Jai_FactoryDotNET::Jai_FactoryWrapper::UndistortStruct, 488
OutOfOrderPacketsBeforeResend
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamParameterStruct,
486
WRAP_DATASTREAM, 193
OUTPUT_DISCARD
WRAP_DATASTREAM, 191
Overlapped
WRAP_IMAGE_VIEW, 273
OverlappedStretch
WRAP_IMAGE_VIEW, 273
PassCorruptFrames
CAM_ACQUISITION, 339
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamParameterStruct,
485
WRAP_DATASTREAM, 193
PAYLOADTYPE
WRAP_DATASTREAM, 192
PayloadType
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
Peripheral
Jai_FactoryDotNET::CCamera, 393
Pixel access functions, 300
PixelDepth
Jai_FactoryDotNET::Jai_FactoryWrapper::HistogramInfo, 431
Jai_FactoryDotNET::Jai_FactoryWrapper::LUTInfo, 466
PixelFormat
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
PixelFormat16BitY
WRAP_IMAGE_VIEW, 276
PixelFormat24BitSwapRB
WRAP_IMAGE_VIEW, 275
PixelFormat24BitUYV
WRAP_IMAGE_VIEW, 276
PixelFormat24BitYCBCR
WRAP_IMAGE_VIEW, 276
PixelFormat3YH
WRAP_IMAGE_VIEW, 276
PixelFormat3YV
WRAP_IMAGE_VIEW, 276
PixelFormat48BitSwapRB
WRAP_IMAGE_VIEW, 276
PixelFormat8BitY
WRAP_IMAGE_VIEW, 275
PixelFormatNone
WRAP_IMAGE_VIEW, 275
PixelFormatSwapRB
WRAP_IMAGE_VIEW, 276
PixelFormatY
WRAP_IMAGE_VIEW, 276
PIXELTYPE
WRAP_DATASTREAM, 192
POINT
Jai_FactoryDotNET::Jai_FactoryWrapper::POINT, 472
PointValue
Jai_FactoryDotNET::Jai_FactoryWrapper::IVWCallbackValue,
439
PollingTime
Jai_FactoryDotNET::CNode, 417
PreferredDriverType
Jai_FactoryDotNET::CFactory, 409
ProductGuid
WRAP_CAM, 161
PureNumber
WRAP_CAM, 163
QueuedBuffers
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
RAW
WRAP_IMAGE_MANI, 289
ReadOnly
WRAP_CAM, 161
ReadRegister
CAM_REGISTER_ACCESS, 350
Receiver
Jai_FactoryDotNET::CCamera, 393
RECT
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 475
RectOfROI
Jai_FactoryDotNET::Jai_FactoryWrapper::ColorCompensationROIStruct,
421
RectValue
Jai_FactoryDotNET::Jai_FactoryWrapper::IVWCallbackValue,
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
641
439
Jai_FactoryDotNET::Jai_FactoryWrapper::StreamParameterStruct,
RedCompensation
486
WRAP_IMAGE_PROCESSING, 320
WRAP_DATASTREAM,
193
RedCompensationMulti
WRAP_IMAGE_PROCESSING, 320
Save or Load Setting functions, 185
Representation
SaveLastFrame
Jai_FactoryDotNET::CNode, 416
CAM_IMAGE_SAVE, 354
RestoreLiveVideoWindow
SaveLastFrameRaw
Jai_FactoryDotNET::CCamera, 396
CAM_IMAGE_SAVE, 355
RGain
SaveLastRawFrame
Jai_FactoryDotNET::Jai_FactoryWrapper::ColorCompensationROIStruct, CAM_IMAGE_SAVE, 354, 355
SaveLastRawFrameRaw
422
CAM_IMAGE_SAVE, 355
RGB
SaveNextFrame
WRAP_IMAGE, 268
CAM_IMAGE_SAVE, 353
RGB24_B
SaveScript
Jai_FactoryDotNET::Jai_Jai_FactoryDotNET::CCamera::Script, 480
FactoryWrapper::PixelValue, 470
SchemaVersion
RGB24_G
WRAP_CAM, 161
Jai_FactoryDotNET::Jai_Scientific
FactoryWrapper::PixelValue, 470
WRAP_CAM, 164
RGB24_R
ScriptAlreadyRunning
Jai_FactoryDotNET::Jai_CAM_SCRIPT, 348
FactoryWrapper::PixelValue, 471
ScriptCreateError
Right
CAM_SCRIPT, 348
Jai_FactoryDotNET::Jai_Scripting and Command Classes, 332
FactoryWrapper::RECT, 476
Scripting methods, 347
RO
SelectedNodes
WRAP_CAM, 163
Jai_FactoryDotNET::CNode, 417
Rotate180Deg
SelectingNodeNames
WRAP_IMAGE_TRANSFORM, 317
Jai_FactoryDotNET::CNode, 417
Rotate90DegCcw
SendActionCommand
WRAP_IMAGE_TRANSFORM, 317
Jai_FactoryDotNET::CFactory, 405, 407
Rotate90DegCw
SerialNumber
WRAP_IMAGE_TRANSFORM, 317
Jai_FactoryDotNET::CCamera, 399
RotateImage
WRAP_FACTORY, 152
Jai_FactoryDotNET::CCamera, 397
SetGain
RThreshold
CAM_WHITE_BALANCE, 342
Jai_FactoryDotNET::Jai_SIZE
FactoryWrapper::ColorCompensationROIStruct, Jai_FactoryDotNET::Jai_421
FactoryWrapper::SIZE, 482
RunScript
WRAP_DATASTREAM, 192
CAM_SCRIPT, 348, 349
Size
RunScriptResult
Jai_FactoryDotNET::Jai_CAM_SCRIPT, 347
FactoryWrapper::BufferInfoStruct,
RW
378
WRAP_CAM, 163
Jai_FactoryDotNET::Jai_RxTimeout
FactoryWrapper::RECT, 477
Jai_FactoryDotNET::Jai_SizeValue
FactoryWrapper::StreamParameterStruct,
Jai_FactoryDotNET::Jai_486
FactoryWrapper::IVWCallbackValue,
WRAP_DATASTREAM, 193
439
RxTimeoutsBeforeListFlush
SizeX
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
642
INDEX
Jai_FactoryDotNET::CCamera, 395
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
SizeY
Jai_FactoryDotNET::CCamera, 395
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
SkipImageDisplayWhenBusy
Jai_FactoryDotNET::CCamera, 397
SocketDriver
Jai_FactoryDotNET::CFactory, 404
Standard
WRAP_CAM, 163
StandardNameSpace
WRAP_CAM, 161
StartAcquisition
CAM_ACQUISITION, 335
StartAsyncImageRecording
CAM_ASYNC_RECORDING, 369
StartImageAcquisition
CAM_ACQUISITION, 335337
Status
Jai_FactoryDotNET::Jai_FactoryWrapper::ActionCommandAck,
375
StopAcquisition
CAM_ACQUISITION, 335
StopAsyncImageRecording
CAM_ASYNC_RECORDING, 369
StopImageAcquisition
CAM_ACQUISITION, 337
StopImageAcquisitionEx
CAM_ACQUISITION, 338
Stream channel specific functions, 284
StreamableOnly
WRAP_CAMERA_SETTING, 185
StreamHandle
Jai_FactoryDotNET::CCamera, 394
StretchLiveVideo
Jai_FactoryDotNET::CCamera, 396
Success
CAM_SCRIPT, 348
WRAP_FACTORY, 151
Tag
Jai_FactoryDotNET::CCamera, 395
Jai_FactoryDotNET::CNode, 418
The CCamera Class, 331
The CFactory Class, 330
The CNode Class, 372
The Managed JAI SDK Classes, 373
TickFrequency
Jai_FactoryDotNET::CCamera, 396
Tiff
WRAP_IMAGE_MANI, 289
Timeout
WRAP_FACTORY, 151
TIMESTAMP
WRAP_DATASTREAM, 192
TimeStamp
Jai_FactoryDotNET::CCamera, 395
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
378
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
TimeStampMs
Jai_FactoryDotNET::CCamera, 396
ToolTip
Jai_FactoryDotNET::CNode, 416
WRAP_CAM, 161
Top
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 476
ToRectangle
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 475
ToString
Jai_FactoryDotNET::CNode::IEnumValue,
434
TotalAsyncImagesRecordedCount
CAM_ASYNC_RECORDING, 370
TotalMissingPackets
Jai_FactoryDotNET::CCamera, 396
Transceiver
Jai_FactoryDotNET::CCamera, 393
Transformation functions, 317
Transmitter
Jai_FactoryDotNET::CCamera, 393
Type
Jai_FactoryDotNET::Jai_FactoryWrapper::ActionCommandAck,
375
UInt32Value
Jai_FactoryDotNET::Jai_FactoryWrapper::IVWOptionValue,
441
UnableToLoadScript
CAM_SCRIPT, 348
Undefined
Jai_FactoryDotNET::CFactory, 404
Unit
Jai_FactoryDotNET::CNode, 416
UnknowNodeType
WRAP_CAM, 162
UpdateCameraList
Jai_FactoryDotNET::CFactory, 405
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
USER_PTR
WRAP_DATASTREAM, 192
UserDrawInfoValue
Jai_FactoryDotNET::Jai_FactoryWrapper::IVWCallbackValue,
439
UserName
Jai_FactoryDotNET::CCamera, 399
WRAP_FACTORY, 152
UserPointer
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
378
ValidateOnly
WRAP_CAMERA_SETTING, 186
ValidateScript
CAM_SCRIPT, 348
ValidationError
CAM_SCRIPT, 348
WRAP_FACTORY, 151
ValidationWarning
WRAP_FACTORY, 151
Value
Jai_FactoryDotNET::CNode, 420
Jai_FactoryDotNET::CNode::IEnumValue,
434
VendorName
WRAP_CAM, 161
Version
Jai_FactoryDotNET::CFactory, 409
WRAP_FACTORY, 151
VersionGuid
WRAP_CAM, 161
View window specific functions, 271
ViewWindowEventDelegate
CAM_ACQUISITION, 338
Visibility
Jai_FactoryDotNET::CNode, 418
WaitError
WRAP_EVENTINTERFACE, 209
WaitExit
WRAP_EVENTINTERFACE, 208
WaitExit1
WRAP_EVENTINTERFACE, 208
WaitExit2
WRAP_EVENTINTERFACE, 208
WaitExit3
WRAP_EVENTINTERFACE, 209
WaitExit5
WRAP_EVENTINTERFACE, 209
WaitExit6
WRAP_EVENTINTERFACE, 209
643
WaitExit7
WRAP_EVENTINTERFACE, 209
WaitExit8
WRAP_EVENTINTERFACE, 209
WaitExit9
WRAP_EVENTINTERFACE, 209
WaitSignal
WRAP_EVENTINTERFACE, 208
WaitSignal1
WRAP_EVENTINTERFACE, 208
WaitSignal2
WRAP_EVENTINTERFACE, 208
WaitSignal3
WRAP_EVENTINTERFACE, 209
WaitSignal4
WRAP_EVENTINTERFACE, 209
WaitSignal6
WRAP_EVENTINTERFACE, 209
WaitSignal7
WRAP_EVENTINTERFACE, 209
WaitSignal8
WRAP_EVENTINTERFACE, 209
WaitSignal9
WRAP_EVENTINTERFACE, 209
WaitTimeout
WRAP_EVENTINTERFACE, 208
White-Balance control methods, 342
WIDTH
WRAP_DATASTREAM, 192
Width
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
Jai_FactoryDotNET::Jai_FactoryWrapper::RECT, 477
Jai_FactoryDotNET::Jai_FactoryWrapper::UserDrawInfo, 490
WindowHandle
Jai_FactoryDotNET::CCamera, 394
WO
WRAP_CAM, 163
WRAP_CAM
_UndefinedAccesMode, 163
_UndefinedCachingMode, 163
_UndefinedEDisplayNotation, 164
_UndefinedNameSpace, 163
_UndefinedRepresentation, 163
_UndefinedVisibility, 161
Automatic, 164
Beginner, 161
Boolean, 163
Control, 161
Custom, 163
DeviceVersion, 161
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
644
INDEX
Exclusive, 161
Expert, 161
Fixed, 164
GenApiVersion, 161
Guru, 161
HexNumber, 163
IAdvFeatureLock, 162
IBoolean, 162
ICategory, 162
IChunkPort, 162
ICommand, 162
IConfRom, 162
IConverter, 162
IDeviceInfo, 162
IEnumEntry, 162
IEnumeration, 162
IFloat, 162
IFloatReg, 162
IIntConverter, 162
IInteger, 162
IIntKey, 162
IIntReg, 162
IIntSwissKnife, 162
IMaskedIntReg, 162
INode, 162
INodeMap, 162
INodeMapDyn, 162
Invisible, 161
IPort, 162
IPortConstruct, 162
IPV4Address, 163
IRegister, 162
ISelector, 162
ISmartFeature, 162
IStringReg, 162
ISwissKnife, 162
ITextDesc, 162
Linear, 163
Logarithmic, 163
MACAddress, 163
ModelName, 161
NA, 163
NI, 163
NoCache, 163
None, 161
ProductGuid, 161
PureNumber, 163
ReadOnly, 161
RO, 163
RW, 163
SchemaVersion, 161
Scientific, 164
Standard, 163
StandardNameSpace, 161
ToolTip, 161
UnknowNodeType, 162
VendorName, 161
VersionGuid, 161
WO, 163
WriteAround, 163
WriteThrough, 163
WRAP_CAMERA_SETTING
Auto, 185, 186
ForceAll, 185
ForceWrite, 186
StreamableOnly, 185
ValidateOnly, 186
WRAP_DATASTREAM
BASE, 192
BLOCK_ID, 192
CanResend, 193
CUSTOM_INFO, 193
HEIGHT, 192
INPUT_TO_OUTPUT, 191
ISGRABBING, 192
ISQUEUED, 192
KILL, 191
LAST_IMAGE, 191
MaxFramesInNotCompletedList, 193
NEW_DATA, 192
NEW_IMAGE, 191
NEXT_IMAGE, 191
NONE, 191, 192
NUM_PACKETS_MISSING, 192
NUMBER, 192
NUMBER_OF_FRAMES_ANNOUNCED,
192
NUMBER_OF_FRAMES_AWAIT_DELIVERY, 192
NUMBER_OF_FRAMES_CORRUPT_ON_DELIEVRY, 193
NUMBER_OF_FRAMES_DELIVERED, 192
NUMBER_OF_FRAMES_LOST_QUEUE_UNDERRUN, 192
NUMBER_OF_FRAMES_QUEUED, 192
NumberOfBytesPerFrame, 193
OutOfOrderPacketsBeforeResend, 193
OUTPUT_DISCARD, 191
PassCorruptFrames, 193
PAYLOADTYPE, 192
PIXELTYPE, 192
RxTimeout, 193
RxTimeoutsBeforeListFlush, 193
SIZE, 192
TIMESTAMP, 192
USER_PTR, 192
WIDTH, 192
XOFFSET, 192
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
XPADDING, 192
YOFFSET, 192
YPADDING, 192
WRAP_EVENTINTERFACE
Connected, 208
CONNECTION, 208
Disconnected, 208
ERROR, 208
GEV_EVENT_CMD, 208
GEV_EVENTDATA_CMD, 208
LostControl, 208
MAX_ID, 208
NEW_BUFFER, 208
NUM_ENTRYS_IN_QUEUE, 208
WaitError, 209
WaitExit, 208
WaitExit1, 208
WaitExit2, 208
WaitExit3, 209
WaitExit5, 209
WaitExit6, 209
WaitExit7, 209
WaitExit8, 209
WaitExit9, 209
WaitSignal, 208
WaitSignal1, 208
WaitSignal2, 208
WaitSignal3, 209
WaitSignal4, 209
WaitSignal6, 209
WaitSignal7, 209
WaitSignal8, 209
WaitSignal9, 209
WaitTimeout, 208
WRAP_FACTORY
AccessDenied, 151
BuildDate, 151
BuildTime, 151
Error, 151
FileIO, 151
GenICamError, 151
InterfaceID, 152
InvalidAddress, 151
InvalidBufferSize, 151
InvalidFilename, 151
InvalidHandle, 151
InvalidID, 151
InvalidParameter, 151
IPAddress, 152
MACAddress, 152
Manufacturer, 151, 152
ModelName, 152
NoData, 151
SerialNumber, 152
645
Success, 151
Timeout, 151
UserName, 152
ValidationError, 151
ValidationWarning, 151
Version, 151
WRAP_IMAGE
Custom, 268
GVSP_PIX_BAYBG10, 268
GVSP_PIX_BAYBG10_PACKED, 269
GVSP_PIX_BAYBG12, 268
GVSP_PIX_BAYBG12_PACKED, 269
GVSP_PIX_BAYBG16, 269
GVSP_PIX_BAYBG8, 268
GVSP_PIX_BAYGB10, 268
GVSP_PIX_BAYGB10_PACKED, 269
GVSP_PIX_BAYGB12, 268
GVSP_PIX_BAYGB12_PACKED, 269
GVSP_PIX_BAYGB16, 269
GVSP_PIX_BAYGB8, 268
GVSP_PIX_BAYGR10, 268
GVSP_PIX_BAYGR10_PACKED, 268
GVSP_PIX_BAYGR12, 268
GVSP_PIX_BAYGR12_PACKED, 269
GVSP_PIX_BAYGR16, 269
GVSP_PIX_BAYGR8, 268
GVSP_PIX_BAYRG10, 268
GVSP_PIX_BAYRG10_PACKED, 268
GVSP_PIX_BAYRG12, 268
GVSP_PIX_BAYRG12_PACKED, 269
GVSP_PIX_BAYRG16, 269
GVSP_PIX_BAYRG8, 268
GVSP_PIX_BGR10_PACKED, 269
GVSP_PIX_BGR12_PACKED, 269
GVSP_PIX_BGR16_PACKED_INTERNAL,
269
GVSP_PIX_BGR8_PACKED, 269
GVSP_PIX_BGRA8_PACKED, 269
GVSP_PIX_MONO10, 268
GVSP_PIX_MONO10_PACKED, 268
GVSP_PIX_MONO12, 268
GVSP_PIX_MONO12_PACKED, 268
GVSP_PIX_MONO14, 268
GVSP_PIX_MONO16, 268
GVSP_PIX_MONO8, 268
GVSP_PIX_MONO8_SIGNED, 268
GVSP_PIX_RGB10_PACKED, 269
GVSP_PIX_RGB10_PLANAR, 269
GVSP_PIX_RGB10V1_PACKED, 269
GVSP_PIX_RGB10V2_PACKED, 269
GVSP_PIX_RGB12_PACKED, 269
GVSP_PIX_RGB12_PLANAR, 269
GVSP_PIX_RGB12V1_PACKED, 269
GVSP_PIX_RGB16_PACKED, 269
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
646
INDEX
GVSP_PIX_RGB16_PLANAR, 269
GVSP_PIX_RGB8_PACKED, 269
GVSP_PIX_RGB8_PLANAR, 269
GVSP_PIX_RGBA8_PACKED, 269
GVSP_PIX_YUV411_PACKED, 269
GVSP_PIX_YUV422_PACKED, 269
GVSP_PIX_YUV444_PACKED, 269
Monochrome, 268
RGB, 268
WRAP_IMAGE_MANI
Bmp, 289
Jai, 289
Jpeg, 289
RAW, 289
Tiff, 289
WRAP_IMAGE_PROCESSING
GreenCompensation, 320
GreenCompensationMulti, 320
LensDistortion, 320
LensDistortionMapFree, 320
LensDistortionMapInit, 320
LensDistortionMulti, 320
RedCompensation, 320
RedCompensationMulti, 320
WRAP_IMAGE_PROCESSING_LENS_DISTORTION
InterpolationBiLinear, 328
InterpolationNone, 328
WRAP_IMAGE_TRANSFORM
FlipHorizontally, 317
FlipVertically, 317
Rotate180Deg, 317
Rotate90DegCcw, 317
Rotate90DegCw, 317
WRAP_IMAGE_VIEW
BayerExtended, 275
BayerExtendedMultiprocessor, 275
BayerFast, 275
BayerFastMultiprocessor, 275
BayerSimple, 275
BayerSimpleMultiprocessor, 275
BayerStandard, 275
BayerStandardMultiprocessor, 275
CallbackMask, 274
Child, 273
ChildStretch, 273
DoubleBuffering, 274
J_IVW_CB_AREA_SELECT, 274
J_IVW_CB_MOUSE_LBUTTON_DOWN,
274
J_IVW_CB_MOUSE_LBUTTON_UP, 274
J_IVW_CB_MOUSE_MOVE, 274
J_IVW_CB_MOUSE_RBUTTON_DOWN,
274
J_IVW_CB_MOUSE_RBUTTON_UP, 274
J_IVW_CB_USER_DRAW_IMAGE, 274
J_IVW_CB_USER_DRAW_VIEW_WINDOW, 275
J_IVW_CB_WINDOW_MOVE, 274
J_IVW_CB_WINDOW_SIZE, 274
J_IVW_CB_ZOOM_POS, 274
MouseCursor, 274
MouseZoom, 274
Overlapped, 273
OverlappedStretch, 273
PixelFormat16BitY, 276
PixelFormat24BitSwapRB, 275
PixelFormat24BitUYV, 276
PixelFormat24BitYCBCR, 276
PixelFormat3YH, 276
PixelFormat3YV, 276
PixelFormat48BitSwapRB, 276
PixelFormat8BitY, 275
PixelFormatNone, 275
PixelFormatSwapRB, 276
PixelFormatY, 276
WRAP_ACTION_CMD
J_Factory_SendActionCommand, 158
WRAP_CAM
EConfAccessMode, 162
EConfCachingMode, 163
EConfInfoType, 161
EConfNameSpace, 163
EConfNodeType, 161
EConfRepresentation, 163
EConfVisibility, 161
EDeviceAccessFlags, 161
EDisplayNotation, 163
WRAP_CAMERA_SETTING
ELoadSettingsFlag, 185
ESaveSettingsFlag, 185
J_Camera_GetSettingsValidationErrorInfo,
186
J_Camera_LoadSettings, 186
J_Camera_SaveSettings, 186
WRAP_CONNECTION
J_Camera_Close, 166
J_Camera_Open, 165
J_Camera_OpenMc, 165
WRAP_DATASTREAM
EAcqQueueType, 191
EAcqStartFlags, 191
EAcqStopFlags, 191
EBufferInfoCmd, 191
EDataStreamParamCmd, 193
EStreamInfoCmd, 192
J_DataStream_AnnounceBuffer, 193
J_DataStream_Close, 197
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
J_DataStream_FlushQueue, 194
J_DataStream_GetBufferID, 197
J_DataStream_GetBufferInfo, 200
J_DataStream_GetParam, 204
J_DataStream_GetStreamInfo, 197
J_DataStream_QueueBuffer, 199
J_DataStream_RevokeBuffer, 198
J_DataStream_SetParam, 205
J_DataStream_StartAcquisition, 195
J_DataStream_StopAcquisition, 196
WRAP_DATASTREM_ACCESS
ConnectionStatusCallBack, 183
GEVEventCallBack, 184
ImageCallBack, 183
J_Camera_CreateDataStream, 182
J_Camera_CreateDataStreamMc, 183
J_Camera_GetNumOfDataStreams, 181
NodeEventCallBack, 184
WRAP_DIRECT_NODE_ACCESS
J_Camera_ExecuteCommand, 170
J_Camera_GetValueDouble, 168
J_Camera_GetValueInt64, 167
J_Camera_GetValueString, 168
J_Camera_SetValueDouble, 169
J_Camera_SetValueInt64, 169
J_Camera_SetValueString, 169
WRAP_DIRECT_REGISTER_ACCESS
J_Camera_ReadData, 171
J_Camera_WriteData, 172
WRAP_EVENTINTERFACE
ECondWaitResult, 208
EDeviceConnectionType, 208
EDeviceEventType, 208
EEventInfoID, 207
J_Event_Close, 210
J_Event_Flush, 210
J_Event_GetData, 209
J_Event_GetInfo, 210
WRAP_EventInterface_camera
J_Camera_RegisterEvent, 212, 214
J_Camera_UnRegisterEvent, 215
WRAP_EventInterface_condition
J_Event_CloseCondition, 232
J_Event_CreateCondition, 226
J_Event_ExitCondition, 227
J_Event_ResetCondition, 228
J_Event_SignalCondition, 227
J_Event_WaitForCondition, 228
J_Event_WaitForMultipleConditions, 230
WRAP_EventInterface_datastream
J_DataStream_RegisterEvent, 217, 220
J_DataStream_UnRegisterEvent, 224
WRAP_FACTORY
ECameraInfoType, 151
647
EFactoryError, 151
EFactoryInfoType, 151
GetFactoryErrorString, 152
J_Factory_Close, 152
J_Factory_EnableForceIp, 156
J_Factory_GetCameraIDByIndex, 155
J_Factory_GetCameraInfo, 155
J_Factory_GetGenICamErrorInfo, 156
J_Factory_GetInfo, 153
J_Factory_GetNumOfCameras, 154
J_Factory_Open, 152
J_Factory_UpdateCameraList, 153
WRAP_GET_INFO
J_Camera_GetConfigInfo, 174
WRAP_IMAGE
EPixelFormatType, 268
EPixelTypeColorInfo, 268
GetPixelTypeColorInfo, 269
GetPixelTypeMemorySize, 269
WRAP_IMAGE_HDR
J_Image_AnalyzeHDR, 305
J_Image_FuseHDR, 305
J_Image_MallocHDR, 304
WRAP_IMAGE_HIST
J_Image_ClearHistogram, 315
J_Image_CreateHistogram, 315
J_Image_FreeHistogram, 315
J_Image_GetHistogramValue, 315
J_Image_MallocHistogram, 314
WRAP_IMAGE_LUT
J_Image_ApplyGammaToLUT, 309
J_Image_ConvertLUT, 308
J_Image_CreateGammaLUT, 309
J_Image_CreateKneeLUT, 311
J_Image_CreateLinearLUT, 310
J_Image_FreeLUT, 308
J_Image_GetLUTValue, 312
J_Image_LoadLUT, 313
J_Image_LUT, 309
J_Image_MallocLUT, 308
J_Image_SaveLUT, 313
J_Image_SetLUTValue, 312
WRAP_IMAGE_MANI
ESaveFileFormat, 289
J_Image_ConvertImage, 292
J_Image_Free, 294
J_Image_FromRawToDIB, 289
J_Image_FromRawToImage, 290, 291
J_Image_Malloc, 292, 294
J_Image_MallocDIB, 293
WRAP_IMAGE_pixel
J_Image_GetAverage, 301
J_Image_GetPixel, 300
J_Image_GetPixelEx, 300
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
648
INDEX
J_Image_SetPixel, 301
WRAP_IMAGE_PROCESSING
EProcessFunctionType, 320
J_Image_Processing, 320
J_Image_ProcessingEx, 322
WRAP_IMAGE_PROCESSING_COLOR_COMPENSATION
J_Image_Processing, 324, 325
WRAP_IMAGE_PROCESSING_LENS_DISTORTION
EInterpolationType, 327
J_Image_Processing, 328
J_Image_ProcessingFree, 329
J_Image_ProcessingInit, 329
WRAP_IMAGE_save
J_Image_LoadFileRaw, 298
J_Image_SaveFile, 297
J_Image_SaveFileEx, 297
J_Image_SaveFileRaw, 298
WRAP_IMAGE_STREAM
J_Image_CloseStream, 286
J_Image_GetStreamHandle, 286
J_Image_GetStreamInfo, 286
J_Image_OpenStream, 285
J_Image_OpenStreamLight, 285
WRAP_IMAGE_TRANSFORM
EFlipType, 317
ERotateType, 317
J_Image_Flip, 318
J_Image_Rotate, 318
WRAP_IMAGE_VIEW
EColorConversionPixelFormat, 275
EColorInterpolationAlgorithm, 275
EIVWCallbackType, 274
EIVWOptionType, 273
EIVWWindowType, 273
ImageViewWindowCallBack, 282
J_Image_CloseViewWindow, 277
J_Image_GetFrameWindowRect, 280
J_Image_GetImageOffsetEx, 279
J_Image_GetViewWindowOption, 282
J_Image_GetViewWindowRect, 280
J_Image_MoveViewWindow, 279
J_Image_OpenViewWindow, 276
J_Image_OpenViewWindowEx, 277
J_Image_ResizeChildWindow, 280
J_Image_SetImageOffset, 278
J_Image_SetImageOffsetEx, 279
J_Image_SetViewWindowCallback, 283
J_Image_SetViewWindowOption, 281
J_Image_SetViewWindowTitle, 281
J_Image_ShowImage, 277, 278
WRAP_IMAGE_WB
J_Image_ExecuteWhiteBalance, 303
J_Image_GetGain, 302
J_Image_SetGain, 302
WRAP_NODE
J_Node_GetAccessMode, 238
J_Node_GetAlias, 243
J_Node_GetCachingMode, 240
J_Node_GetDescription, 241
J_Node_GetDisplayName, 241
J_Node_GetDocuURL, 246
J_Node_GetEventID, 241
J_Node_GetIsCachable, 239
J_Node_GetIsDeprecated, 247
J_Node_GetIsSelector, 244
J_Node_GetIsStreamable, 241
J_Node_GetName, 238
J_Node_GetNameSpace, 239
J_Node_GetNumOfProperties, 242
J_Node_GetNumOfSelectedFeatures, 244
J_Node_GetNumOfSelectingFeatures, 245
J_Node_GetPollingTime, 240
J_Node_GetPropertyByName, 242
J_Node_GetPropertyNameByIndex, 242
J_Node_GetRepresentation, 246
J_Node_GetSelectedFeatureByIndex, 245
J_Node_GetSelectingFeatureByIndex, 245
J_Node_GetToolTip, 240
J_Node_GetType, 244
J_Node_GetUnit, 246
J_Node_GetVisibility, 239
J_Node_ImposeAccessMode, 243
J_Node_ImposeVisibility, 243
J_Node_Invalidate, 239
J_Node_RegisterCallback, 244
NodeChangeDelegate, 243
WRAP_NODE_ACCESS
J_Camera_GetFeatureByName, 179
J_Camera_GetNodeByIndex, 176
J_Camera_GetNodeByName, 177
J_Camera_GetNumOfNodes, 175
J_Camera_GetNumOfSubFeatures, 177
J_Camera_GetSubFeatureByIndex, 178
J_Camera_InvalidateNodes, 180
WRAP_NODE_CMD
J_Node_ExecuteCommand, 259
J_Node_GetCommandIsDone, 259
WRAP_NODE_ENUM
J_Node_GetEnumEntryByIndex, 258
J_Node_GetEnumEntryValue, 258
J_Node_GetNumOfEnumEntries, 257
WRAP_NODE_FLOAT
J_Node_GetDisplayNotation, 254
J_Node_GetDisplayPrecision, 254
J_Node_GetEnumAlias, 256
J_Node_GetFloatHasInc, 255
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen
INDEX
J_Node_GetFloatInc, 255
J_Node_GetIntAlias, 255
J_Node_GetMaxDouble, 253
J_Node_GetMinDouble, 253
J_Node_GetValueDouble, 254
J_Node_SetValueDouble, 253
WRAP_NODE_INT
J_Node_GetFloatAlias, 250
J_Node_GetInc, 249
J_Node_GetMaxInt64, 249
J_Node_GetMinInt64, 248
J_Node_GetValueInt64, 250
J_Node_SetValueInt64, 250
WRAP_NODE_REG
J_Node_GetRegisterAddress, 263
J_Node_GetRegisterLength, 263
J_Node_GetValueRegister, 263
J_Node_SetValueRegister, 262
WRAP_NODE_STR
J_Node_GetValueString, 260
J_Node_SetValueString, 260
WriteAround
WRAP_CAM, 163
WriteRegister
CAM_REGISTER_ACCESS, 350
WriteThrough
WRAP_CAM, 163
649
WRAP_DATASTREAM, 192
YPadding
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
Zoom and Navigation methods, 357
ZoomDirect
CAM_ZOOM, 359
ZoomIn
CAM_ZOOM, 358
ZoomOut
CAM_ZOOM, 359
ZoomPosValue
Jai_FactoryDotNET::Jai_FactoryWrapper::IVWCallbackValue,
439
ZoomRatioX
Jai_FactoryDotNET::Jai_FactoryWrapper::ZoomPos, 491
ZoomRatioY
Jai_FactoryDotNET::Jai_FactoryWrapper::ZoomPos, 491
ZoomReset
CAM_ZOOM, 359
X
Jai_FactoryDotNET::Jai_FactoryWrapper::POINT, 473
XOFFSET
WRAP_DATASTREAM, 192
XOffset
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
XPADDING
WRAP_DATASTREAM, 192
XPadding
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
Y
Jai_FactoryDotNET::Jai_FactoryWrapper::POINT, 473
YOFFSET
WRAP_DATASTREAM, 192
YOffset
Jai_FactoryDotNET::Jai_FactoryWrapper::BufferInfoStruct,
379
YPADDING
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen