Vous êtes sur la page 1sur 679

JAI SDK .

NET Wrapper
Generated by Doxygen 1.5.9
Wed Sep 19 12:02:08 2012

Contents
1

JAI SDK .NET Wrapper

1.1

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.2

Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.3

Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Module Index
2.1

143

Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

File Index
4.1

Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

Class Index
3.1

141

145

File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

Module Documentation

147

5.1

JAI SDK .NET Wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

5.2

Factory specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149


5.2.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.2.2

Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 151

5.2.3

5.2.2.1

EFactoryError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

5.2.2.2

EFactoryInfoType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

5.2.2.3

ECameraInfoType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152


5.2.3.1

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.2.3.10 J_Factory_GetGenICamErrorInfo . . . . . . . . . . . . . . . . . . . . . 156


5.3

Action Command function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157


5.3.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

5.3.2

Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158


5.3.2.1

5.4

5.5

5.6

5.7

J_Factory_SendActionCommand . . . . . . . . . . . . . . . . . . . . . 158

Camera specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159


5.4.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

5.4.2

Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 161


5.4.2.1

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

Camera connection functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165


5.5.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

5.5.2

Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165


5.5.2.1

J_Camera_Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

5.5.2.2

J_Camera_OpenMc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166

5.5.2.3

J_Camera_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166

Direct GenICam node value access functions . . . . . . . . . . . . . . . . . . . . . . . . 167


5.6.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

5.6.2

Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167


5.6.2.1

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

Direct register access functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

CONTENTS

iii

5.7.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

5.7.2

Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

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

Configuration information function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174


5.8.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

5.8.2

Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174


5.8.2.1

5.9

J_Camera_GetConfigInfo . . . . . . . . . . . . . . . . . . . . . . . . . 174

GenICam Feature Node access functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 175


5.9.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

5.9.2

Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175


5.9.2.1

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

5.10 Image Data Stream access functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181


5.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
5.10.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
5.10.2.1 J_Camera_GetNumOfDataStreams . . . . . . . . . . . . . . . . . . . . 181
5.10.2.2 J_Camera_CreateDataStream . . . . . . . . . . . . . . . . . . . . . . . 182
5.10.2.3 J_Camera_CreateDataStreamMc . . . . . . . . . . . . . . . . . . . . . 183
5.10.2.4 ImageCallBack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
5.10.2.5 ConnectionStatusCallBack . . . . . . . . . . . . . . . . . . . . . . . . 184
5.10.2.6 GEVEventCallBack . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
5.10.2.7 NodeEventCallBack . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
5.11 Save or Load Setting functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5.11.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5.11.2.1 ESaveSettingsFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5.11.2.2 ELoadSettingsFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.11.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.11.3.1 J_Camera_SaveSettings . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

5.14 Camera event specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212


5.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.14.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.14.2.1 J_Camera_RegisterEvent . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.14.2.2 J_Camera_RegisterEvent . . . . . . . . . . . . . . . . . . . . . . . . . 214
5.14.2.3 J_Camera_UnRegisterEvent . . . . . . . . . . . . . . . . . . . . . . . . 216
5.15 Data Stream event specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
5.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
5.15.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
5.15.2.1 J_DataStream_RegisterEvent . . . . . . . . . . . . . . . . . . . . . . . 217
5.15.2.2 J_DataStream_RegisterEvent . . . . . . . . . . . . . . . . . . . . . . . 220
5.15.2.3 J_DataStream_UnRegisterEvent . . . . . . . . . . . . . . . . . . . . . 224
5.16 Condition specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
5.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
5.16.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
5.16.2.1 J_Event_CreateCondition . . . . . . . . . . . . . . . . . . . . . . . . . 226
5.16.2.2 J_Event_SignalCondition . . . . . . . . . . . . . . . . . . . . . . . . . 227
5.16.2.3 J_Event_ExitCondition . . . . . . . . . . . . . . . . . . . . . . . . . . 228
5.16.2.4 J_Event_ResetCondition . . . . . . . . . . . . . . . . . . . . . . . . . 228
5.16.2.5 J_Event_WaitForCondition . . . . . . . . . . . . . . . . . . . . . . . . 228
5.16.2.6 J_Event_WaitForMultipleConditions . . . . . . . . . . . . . . . . . . . 230
5.16.2.7 J_Event_CloseCondition . . . . . . . . . . . . . . . . . . . . . . . . . 232
5.17 GenICam node specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
5.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
5.17.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
5.17.2.1 J_Node_GetAccessMode . . . . . . . . . . . . . . . . . . . . . . . . . 238
5.17.2.2 J_Node_GetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
5.17.2.3 J_Node_GetNameSpace . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.17.2.4 J_Node_GetVisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.17.2.5 J_Node_Invalidate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.17.2.6 J_Node_GetIsCachable . . . . . . . . . . . . . . . . . . . . . . . . . . 240
5.17.2.7 J_Node_GetCachingMode . . . . . . . . . . . . . . . . . . . . . . . . 240
5.17.2.8 J_Node_GetPollingTime . . . . . . . . . . . . . . . . . . . . . . . . . 240
5.17.2.9 J_Node_GetToolTip . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
5.17.2.10 J_Node_GetDescription . . . . . . . . . . . . . . . . . . . . . . . . . . 241
5.17.2.11 J_Node_GetDisplayName . . . . . . . . . . . . . . . . . . . . . . . . . 241
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

5.20 IEnumeration GenICam node specific functions . . . . . . . . . . . . . . . . . . . . . . . 257


5.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
5.20.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
5.20.2.1 J_Node_GetNumOfEnumEntries . . . . . . . . . . . . . . . . . . . . . 257
5.20.2.2 J_Node_GetEnumEntryByIndex . . . . . . . . . . . . . . . . . . . . . 258
5.20.2.3 J_Node_GetEnumEntryValue . . . . . . . . . . . . . . . . . . . . . . . 258
5.21 ICommand GenICam node specific functions . . . . . . . . . . . . . . . . . . . . . . . . 259
5.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.21.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.21.2.1 J_Node_ExecuteCommand . . . . . . . . . . . . . . . . . . . . . . . . 259
5.21.2.2 J_Node_GetCommandIsDone . . . . . . . . . . . . . . . . . . . . . . . 259
5.22 IString GenICam node specific functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.22.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.22.2.1 J_Node_SetValueString . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.22.2.2 J_Node_GetValueString . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.23 IRegister GenICam node specific functions . . . . . . . . . . . . . . . . . . . . . . . . . 262
5.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
5.23.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
5.23.2.1 J_Node_SetValueRegister . . . . . . . . . . . . . . . . . . . . . . . . . 262
5.23.2.2 J_Node_GetValueRegister . . . . . . . . . . . . . . . . . . . . . . . . . 263
5.23.2.3 J_Node_GetRegisterLength . . . . . . . . . . . . . . . . . . . . . . . . 263
5.23.2.4 J_Node_GetRegisterAddress . . . . . . . . . . . . . . . . . . . . . . . 263
5.24 Image acquisition and manipulation functions . . . . . . . . . . . . . . . . . . . . . . . . 265
5.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
5.24.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 268
5.24.2.1 EPixelTypeColorInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
5.24.2.2 EPixelFormatType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
5.24.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
5.24.3.1 GetPixelTypeColorInfo . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

5.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289


5.27.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.27.2.1 ESaveFileFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.27.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.27.3.1 J_Image_FromRawToDIB . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.27.3.2 J_Image_FromRawToDIB . . . . . . . . . . . . . . . . . . . . . . . . . 290
5.27.3.3 J_Image_FromRawToImage . . . . . . . . . . . . . . . . . . . . . . . 290
5.27.3.4 J_Image_FromRawToImage . . . . . . . . . . . . . . . . . . . . . . . 291
5.27.3.5 J_Image_ConvertImage . . . . . . . . . . . . . . . . . . . . . . . . . . 292
5.27.3.6 J_Image_Malloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
5.27.3.7 J_Image_MallocDIB . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
5.27.3.8 J_Image_Malloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
5.27.3.9 J_Image_Free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
5.28 Image save and load functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
5.28.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
5.28.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
5.28.2.1 J_Image_SaveFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
5.28.2.2 J_Image_SaveFileEx . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
5.28.2.3 J_Image_SaveFileRaw . . . . . . . . . . . . . . . . . . . . . . . . . . 298
5.28.2.4 J_Image_LoadFileRaw . . . . . . . . . . . . . . . . . . . . . . . . . . 298
5.29 Pixel access functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
5.29.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
5.29.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
5.29.2.1 J_Image_GetPixel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
5.29.2.2 J_Image_GetPixelEx . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
5.29.2.3 J_Image_SetPixel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
5.29.2.4 J_Image_GetAverage . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
5.30 Image white balance control functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
5.30.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
5.30.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
5.30.2.1 J_Image_SetGain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
5.30.2.2 J_Image_GetGain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
5.30.2.3 J_Image_ExecuteWhiteBalance . . . . . . . . . . . . . . . . . . . . . . 303
5.31 High Dynamic Range functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
5.31.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
5.31.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

5.35.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 320


5.35.2.1 EProcessFunctionType . . . . . . . . . . . . . . . . . . . . . . . . . . 320
5.35.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
5.35.3.1 J_Image_Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
5.35.3.2 J_Image_ProcessingEx . . . . . . . . . . . . . . . . . . . . . . . . . . 322
5.36 Color-Compensation Image Processing algorithms . . . . . . . . . . . . . . . . . . . . . 324
5.36.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
5.36.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
5.36.2.1 J_Image_Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
5.36.2.2 J_Image_Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
5.37 Lens Distortion Correction Image Processing algorithms . . . . . . . . . . . . . . . . . . 327
5.37.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
5.37.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 327
5.37.2.1 EInterpolationType . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
5.37.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
5.37.3.1 J_Image_Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
5.37.3.2 J_Image_ProcessingInit . . . . . . . . . . . . . . . . . . . . . . . . . . 329
5.37.3.3 J_Image_ProcessingFree . . . . . . . . . . . . . . . . . . . . . . . . . 329
5.38 The CFactory Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
5.39 The CCamera Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
5.40 Scripting and Command Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
5.41 Image Acquisition Control methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
5.41.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
5.41.1.1 ImageViewWindowDelegate . . . . . . . . . . . . . . . . . . . . . . . 335
5.41.1.2 StartAcquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
5.41.1.3 StopAcquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
5.41.1.4 StartImageAcquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
5.41.1.5 StartImageAcquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
5.41.1.6 StartImageAcquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
5.41.1.7 StartImageAcquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
5.41.1.8 StopImageAcquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
5.41.1.9 StopImageAcquisitionEx . . . . . . . . . . . . . . . . . . . . . . . . . 338
5.41.2 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
5.41.2.1 NewImageDelegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
5.41.2.2 ViewWindowEventDelegate . . . . . . . . . . . . . . . . . . . . . . . . 338
5.41.3 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

5.47.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350


5.47.1.1 WriteRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
5.47.1.2 ReadRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
5.48 GenICam Node Access methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
5.48.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
5.48.1.1 GetNodeValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
5.48.1.2 GetNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
5.48.1.3 GetSubFeatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
5.49 Image Save methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
5.49.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
5.49.1.1 SaveNextFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
5.49.1.2 SaveNextFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
5.49.1.3 SaveLastFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
5.49.1.4 SaveLastRawFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
5.49.1.5 SaveLastFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
5.49.1.6 SaveLastRawFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
5.49.1.7 SaveLastFrameRaw . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
5.49.1.8 SaveLastRawFrameRaw . . . . . . . . . . . . . . . . . . . . . . . . . . 355
5.50 Zoom and Navigation methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
5.50.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
5.50.1.1 ZoomIn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
5.50.1.2 ZoomIn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
5.50.1.3 ZoomOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
5.50.1.4 ZoomOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
5.50.1.5 ZoomReset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
5.50.1.6 ZoomDirect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
5.50.1.7 NavigateLeftUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
5.50.1.8 NavigateLeftUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
5.50.1.9 NavigateUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
5.50.1.10 NavigateUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
5.50.1.11 NavigateRightUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
5.50.1.12 NavigateRightUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
5.50.1.13 NavigateLeft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
5.50.1.14 NavigateLeft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
5.50.1.15 NavigateCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
5.50.1.16 NavigateRight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

ActionCommandAck Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375


6.1.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375

6.1.2

Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375


6.1.2.1

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

BufferInfoStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377


6.2.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378

6.2.2

Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378


6.2.2.1

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.2.2.10 Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379


6.2.2.11 Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
6.2.2.12 XOffset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
6.2.2.13 YOffset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
6.2.2.14 XPadding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
6.2.2.15 YPadding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
6.2.2.16 MissingPackets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
6.2.2.17 AwaitDelivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
6.2.2.18 BlockId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
6.3

CCamera Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381


6.3.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392

6.3.2

Member Enumeration Documentation . . . . . . . . . . . . . . . . . . . . . . . . 392

6.3.3

6.3.2.1

AsyncImageRecordingMode . . . . . . . . . . . . . . . . . . . . . . . 392

6.3.2.2

EDeviceClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 393


6.3.3.1

6.3.4

6.3.5

CCamera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393

Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 393


6.3.4.1

Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393

6.3.4.2

Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393

6.3.4.3

Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394

Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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

Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395


6.3.6.1

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

6.3.6.10 TimeStampMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396


6.3.6.11 BlockId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
6.3.6.12 TickFrequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
6.3.6.13 MissingPackets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
6.3.6.14 FrameCounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
6.3.6.15 TotalMissingPackets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
6.3.6.16 StretchLiveVideo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
6.3.6.17 EnableMouseZoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
6.3.6.18 EnableMouseCursorDisplay . . . . . . . . . . . . . . . . . . . . . . . . 396
6.3.6.19 RestoreLiveVideoWindow . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.20 LiveVideoWindowRectangle . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.21 SkipImageDisplayWhenBusy . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.22 RotateImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.23 ImageRotateType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.24 FlipImageHorizontally . . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.25 FlipImageVertically . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.26 EnableLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.27 LUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.28 IsOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.29 IsReadOnly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
6.3.6.30 ConnectionStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
6.3.6.31 IsAcquisitionRunning . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

CFactory Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402


6.4.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404

6.4.2

Member Enumeration Documentation . . . . . . . . . . . . . . . . . . . . . . . . 404


6.4.2.1

6.4.3

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 404


6.4.3.1

6.4.4

EDriverType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404

CFactory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404

Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 405


6.4.4.1

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

Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408


6.4.5.1

CameraList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408

6.4.5.2

FactoryHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408

Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409


6.4.6.1

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

CNode Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411


6.5.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414

6.5.2

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 414


6.5.2.1

6.5.3

6.5.4

CNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414

Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 414


6.5.3.1

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

Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416


6.5.4.1

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

ColorCompensationROIStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . 421


6.6.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421

6.6.2

Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421


6.6.2.1

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

Command Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423


6.7.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423

6.7.2

Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 423

6.7.3

6.8

6.6.2.3

6.7.2.1

Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423

6.7.2.2

Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423

Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423


6.7.3.1

FeatureName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423

6.7.3.2

FeatureValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424

DeviceEventData Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425


6.8.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425

6.8.2

Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425


6.8.2.1

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

EventInfoData Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427


6.9.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427

6.9.2

Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427


6.9.2.1

NumEntriesInQueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427

6.10 FactoryErrorException Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 428


6.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
6.10.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 428
6.10.2.1 FactoryErrorException . . . . . . . . . . . . . . . . . . . . . . . . . . 428
6.10.2.2 FactoryErrorException . . . . . . . . . . . . . . . . . . . . . . . . . . 428
6.10.2.3 FactoryErrorException . . . . . . . . . . . . . . . . . . . . . . . . . . 428
6.11 GenICamErrorInfo Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
6.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

CONTENTS

xxi

6.11.2 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429


6.11.2.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
6.11.2.2 NodeName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
6.12 GreenCompensationStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . 430
6.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
6.12.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
6.12.2.1 NumOfROI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
6.12.2.2 ColorCompensationROI . . . . . . . . . . . . . . . . . . . . . . . . . . 430
6.13 HistogramInfo Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.13.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.13.2.1 HistEntries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.13.2.2 PixelDepth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.13.2.3 Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.13.2.4 HistR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.13.2.5 HistG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
6.13.2.6 HistB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
6.14 IEnumValue Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
6.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
6.14.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 434
6.14.2.1 IEnumValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.3.1 ToString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.4 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.4.1 Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.4.2 DisplayName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.4.3 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.4.4 Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.4.5 AccessMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
6.14.4.6 IsReadable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
6.14.4.7 IsWritable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
6.14.4.8 IsImplemented . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
6.14.4.9 IsAvailable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
6.15 ImageInfo Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
6.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
6.15.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

6.16 IVWCallbackValue Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439


6.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
6.16.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
6.16.2.1 PointValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
6.16.2.2 SizeValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
6.16.2.3 RectValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
6.16.2.4 ZoomPosValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
6.16.2.5 UserDrawInfoValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
6.17 IVWOptionValue Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
6.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
6.17.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
6.17.2.1 BooleanValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
6.17.2.2 UInt32Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
6.18 Jai_FactoryWrapper Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
6.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
6.19 LUTInfo Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
6.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
6.19.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
6.19.2.1 LUTEntries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
6.19.2.2 PixelDepth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
6.19.2.3 Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
6.19.2.4 LutR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
6.19.2.5 LutG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

CONTENTS

xxiii
6.19.2.6 LutB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467

6.20 PixelValue Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468


6.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
6.20.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
6.20.2.1 MONO8_Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
6.20.2.2 MONO10_Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
6.20.2.3 MONO12_Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
6.20.2.4 MONO16_Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
6.20.2.5 DIB24_B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
6.20.2.6 DIB24_G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
6.20.2.7 DIB24_R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
6.20.2.8 RGB24_B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
6.20.2.9 RGB24_G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.20.2.10 RGB24_R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.20.2.11 ARGB32_B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.20.2.12 ARGB32_G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.20.2.13 ARGB32_R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.20.2.14 ARGB32_A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.20.2.15 BGR48_B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.20.2.16 BGR48_G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.20.2.17 BGR48_R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
6.21 POINT Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
6.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
6.21.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 472
6.21.2.1 POINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
6.21.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 473
6.21.3.1 operator System.Drawing.Point . . . . . . . . . . . . . . . . . . . . . . 473
6.21.3.2 operator POINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
6.21.4 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
6.21.4.1 X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
6.21.4.2 Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
6.22 RECT Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
6.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
6.22.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 475
6.22.2.1 RECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
6.22.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

6.23 RedCompensationStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 478


6.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
6.23.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
6.23.2.1 NumOfROI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
6.23.2.2 ColorCompensationROI . . . . . . . . . . . . . . . . . . . . . . . . . . 478
6.24 Script Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
6.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
6.24.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 479
6.24.2.1 Clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
6.24.2.2 AppendDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
6.24.2.3 AppendStartImageAcquisition . . . . . . . . . . . . . . . . . . . . . . 480
6.24.2.4 AppendStopImageAcquisition . . . . . . . . . . . . . . . . . . . . . . 480
6.24.2.5 LoadScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
6.24.2.6 SaveScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
6.24.3 Property Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
6.24.3.1 CommandList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
6.25 SIZE Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
6.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
6.25.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 482
6.25.2.1 SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
6.25.3 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

CONTENTS

xxv
6.25.3.1 cx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
6.25.3.2 cy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482

6.26 StreamInfoStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483


6.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
6.26.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
6.26.2.1 IsGrabbing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
6.26.2.2 NumOfFramesDelivered . . . . . . . . . . . . . . . . . . . . . . . . . 484
6.26.2.3 NumOfFramesLostQueueUnderrun . . . . . . . . . . . . . . . . . . . . 484
6.26.2.4 NumOfBuffersAnnounced . . . . . . . . . . . . . . . . . . . . . . . . . 484
6.26.2.5 NumOfFramesQueued . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
6.26.2.6 NumOfFramesAwaitingDelivery . . . . . . . . . . . . . . . . . . . . . 484
6.26.2.7 NumOfFramesCorruptOnDelivery . . . . . . . . . . . . . . . . . . . . 484
6.27 StreamParameterStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
6.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
6.27.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
6.27.2.1 CanResend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
6.27.2.2 NumberOfBytesPerFrame . . . . . . . . . . . . . . . . . . . . . . . . . 485
6.27.2.3 PassCorruptFrames . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
6.27.2.4 MaxFramesInNotCompletedList . . . . . . . . . . . . . . . . . . . . . 486
6.27.2.5 RxTimeoutsBeforeListFlush . . . . . . . . . . . . . . . . . . . . . . . 486
6.27.2.6 OutOfOrderPacketsBeforeResend . . . . . . . . . . . . . . . . . . . . . 486
6.27.2.7 RxTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
6.28 UndistortStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
6.28.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
6.28.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.1 OpticalCenterX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.2 OpticalCenterY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.3 FocalLengthX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.4 FocalLengthY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.5 CoeffK1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.6 CoeffK2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.7 CoeffK3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.8 CoeffP1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.9 CoeffP2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
6.28.2.10 InterpolationType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
6.29 UserDrawInfo Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

6.30 ZoomPos Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491


6.30.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
6.30.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
6.30.2.1 Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
6.30.2.2 ZoomRatioX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
6.30.2.3 ZoomRatioY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
7

File Documentation
7.1

Camera.cs File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493


7.1.1

7.2

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496

Node.cs File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497


7.4.1

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494

Jai_Factory_Wrapper.cs File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 495


7.3.1

7.4

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493

Factory.cs File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494


7.2.1

7.3

493

Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497

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

8.10 CSharpSwTrigger/CSharpSwTrigger/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . 542


8.11 FeatureBrowserSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
8.12 GigECameraValidationTool/GigECameraValidationTool/Form1.cs . . . . . . . . . . . . . 551
8.13 GreenCompensationSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
8.14 HDRSequenceSample/HDRSequenceSample/Form1.cs . . . . . . . . . . . . . . . . . . . 565
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

CONTENTS

xxvii

8.15 ImageDelegateSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582


8.16 InterPacketDelayCalculator/InterPacketDelayCalculator/Form1.cs . . . . . . . . . . . . . 586
8.17 LensDistortionCorrectionSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . 588
8.18 MultiCamsAsyncImageRecording/MultiCamsAsyncImageRecording/Form1.cs . . . . . . 597
8.19 NodeEventSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
8.20 RedCompensationSample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
8.21 SimpleImageDisplaySample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
8.22 ZoomImageDisplaySample/Form1.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

Chapter 1

JAI SDK .NET Wrapper


Version:
1.4.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:

JAI SDK .NET Wrapper

Figure 1.1: Block Diagram

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

JAI SDK .NET Wrapper


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);
... 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

JAI SDK .NET Wrapper


StringBuilder sb = new StringBuilder(512);
uint Size = (uint)sb.Capacity;
Size = (uint)sb.Capacity;
error = J_Node_GetName(nodeHandle, sb, Size, 0);
String nodeName = sb.ToString();
EConfNodeType nodeType;
// Is this a category node then get all the sub features of the node
error = J_Node_GetType(nodeHandle, ref nodeType);
// Is this a category node?
if (nodeType == EConfNodeType.ICategory)
{
// Get number of sub features under the category node
UInt32 NumOfSubSubFeatureNodes = 0;
error = J_Camera_GetNumOfSubFeatures(cameraHandle,
nodeName,
ref NumOfSubSubFeatureNodes);
if (NumOfSubFeatureNodes > 0)
{
for (int subindex = 0; subindex <NumOfSubSubFeatureNodes; subindex++)
{
IntPtr subNodeHandle;
error = J_Camera_GetSubFeatureByIndex(cameraHandle,
nodeName,
subindex,
out subNodeHandle);
if (error == EFactoryError.Success)
{
Size = (uint)sb.Capacity;
error = subNodeHandle(nodeHandle, sb, Size, 0);
String subNodeName = sb.ToString();
// Print out the name
Console.Out.WriteLine(subNodeName);
}
}
}
}
else
{
// Print out the name
Console.Out.WriteLine(nodeName);
}
}
}

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

JAI SDK .NET Wrapper


foreach (CCamera c in factory.CameraList)
{
c.Open();
// Get the raw gain node
CNode node = c.GetNode("GainRaw");
if (node != null)
{
// Set the raw gain value to 100
node.Value = 100;
}
}

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

The JAI SDK software package consists of the following files:


Jai_Factory.dll
Jai_Factory.h
Jai_Factory.lib
On top of these files the JAI SDK .NET Wrapper adds the file
Jai_FactoryDotNet.dll
The first three files listed above (Jai_Factory.dll through Jai_Factory.lib) are the entire set of SDK software
that is used by C files to create programs. It is these 3 files which are likely to change with any upgrade to
the JAI SDK software.
The first item (Jai_Factory.dll) is the library file which contains all the SDK subroutines. When using
this library, the C file must include the header file Jai_Factory.h (2nd item) at the top of the program. If
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

JAI SDK .NET Wrapper

.\sample\CPP\ConnectionEventSample 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 create camera communication supervision thread
.\sample\CPP\DynamicLoadSample covers the following items:
How to use the Jai_Factory_Dynamic.h to dynamically load the Jai_Factory.dll at runtime
How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to control named features using GenICam
.\sample\CPP\GigEVisionEventSample 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 C3 compact (JAI CM- and CB- cameras) software trigger features
How to create GigE Vision Event Supervision thread
How to use Conditions for event handling
.\sample\CPP\GreenCompensationSample 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 (perform Green-Compensation and display
the image)
How to open a window and display video from a camera using Image Library functions
How to use J_Image_Processing() function to perform Green-Compensation
.\sample\CPP\HDR_AD081GESample covers the following items:
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

11

How to open the Factory


How to find cameras (Device Discovery)
How to open the first AD-081GE camera
How to control named features using GenICam
How to use the High Dynamic Range functions
.\sample\CPP\HDRSequenceSample 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 C3 (JAI BM-, BB-, CM- and CB- cameras) software trigger features
How to use C3 (JAI BM-, BB-, CM- and CB- cameras) sequence features
How to use the High Dynamic Range functions
.\sample\CPP\ImageConversionSample 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 use J_Image_ConvertImage() function to convert between Color image and Y (Monochrome)
.\sample\CPP\LensDistortionSample 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 use the Lens-Distortion Correction Image-processing functionality from inside the Stream
Callback function
.\sample\CPP\LUTSample covers the following items:
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

12

JAI SDK .NET Wrapper


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 use Lookup-table functions to process the image data before display
How to create standard LUT contents to Compress, Expand, Invert and apply Gamma correction to
images

.\sample\CPP\MultipleConditionSample 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 create a single supervision thread that handles Camera Connection events, GigE Vision
events and New Image events using Multiple Conditions
.\sample\CPP\NodeEventSample 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 the GenICam node callback functionality to update user interface when status or value
changes
.\sample\CPP\OpenCVCameraCalibrationSample 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 image callback to manipulate the images using the open-source vision library OpenCV
How to display images in OpenCV using cvNamedWindow and cvShowImage
How to perform Camera Calibration using cvCalibrateCamera2 function
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

13

.\sample\CPP\OpenCVSample1 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 image callback to manipulate the images using the open-source vision library OpenCV
How to display images in OpenCV using vcNamedWindow and cvShowImage
.\sample\CPP\OpenCVSampleSequence 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 C3 (JAI BM-, BB-, CM- and CB- cameras) sequence features
How to use image callback to manipulate the images using the open-source vision library OpenCV
How to display images in OpenCV using vcNamedWindow and cvShowImage
OpenCV needs version 2.1.0 to be installed prior to compiling and running these OpenCV
samples!
This is an Open-Source vision library and can be downloaded for free from
http://opencvlibrary.sourceforge.net/
.\sample\CPP\ReadPixelSample 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 use J_Image_GetPixel() function to directly read pixel values
.\sample\CPP\RedCompensationSample 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
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

14

JAI SDK .NET Wrapper


How to use callback function to handle new image data (perform Red-Compensation and display the
image)
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

.\sample\CPP\SaveAndLoadSettingsSample 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 camera settings to disk using J_Camera_SaveSettings()
How to load camera settings from disk using J_Camera_LoadSettings()
.\sample\CPP\SimpleImageDisplaySample 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 internal image acquisition thread to automatically display image data (display the image)
.\sample\CPP\StreamCallbackSample 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
.\sample\CPP\StreamThreadSample 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 create a thread and manage all DataStream related function directly
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

JAI SDK .NET Wrapper


How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera with a multicast IP address
How to control named features using GenICam
How to setup a multicast stream channel where video can be sent to multiple PCs in parallel

.\sample\CPP\VCSampleMulticastSlave covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera with Read-Only access (as Slave)
How to control named features using GenICam
How to setup a multicast stream channel where video is sent to multiple PCs in parallel
.\sample\CPP\VCSampleSwTrigger 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 C3 compact (JAI CM- and CB- cameras) software trigger features
.\sample\CPP\ZoomImageDisplaySample 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 handle Pan and Zoom inside the display window using the Image Library functions
Visual C#
.\sample\NET\ActionCommandSample covers the following items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first two cameras found
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

17

How to control named features using GenICam


How to use callback functions to handle new image data from multiple cameras (display the image
and get timestamp)
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
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 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

JAI SDK .NET Wrapper


StopButton.Enabled = true;
StartButton.Enabled = false;
action1Button.Enabled = true;
}
if ((myFactory.CameraList.Count > 1) && (myFactory.CameraList[1] != n
ull))
{
myFactory.CameraList[1].NewImageDelegate += new Jai_FactoryWrappe
r.ImageCallBack(HandleImage2);
myFactory.CameraList[1].StartImageAcquisition(true, 5);
StopButton.Enabled = true;
StartButton.Enabled = false;
action1Button.Enabled = true;
}
}
private void StopButton_Click(object sender, EventArgs e)
{
if ((myFactory.CameraList.Count > 0) && (myFactory.CameraList[0] != n
ull))
{
myFactory.CameraList[0].StopImageAcquisition();
myFactory.CameraList[0].NewImageDelegate -= new Jai_FactoryWrappe
r.ImageCallBack(HandleImage1);
StopButton.Enabled = false;
StartButton.Enabled = true;
action1Button.Enabled = false;
}
if ((myFactory.CameraList.Count > 1) && (myFactory.CameraList[1] != n
ull))
{
myFactory.CameraList[1].StopImageAcquisition();
myFactory.CameraList[1].NewImageDelegate -= new Jai_FactoryWrappe
r.ImageCallBack(HandleImage2);
StopButton.Enabled = false;
StartButton.Enabled = true;
action1Button.Enabled = false;
}
}
// Local callback function used for handle new images
void HandleImage1(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
// Convert timestamp from ticks to milliseconds
myTimestampMs1 = (double)ImageInfo.TimeStamp / ((double)(myTimestampT
ickFrequency / 1000));
return;
}
// Local callback function used for handle new images
void HandleImage2(ref Jai_FactoryWrapper.ImageInfo ImageInfo)
{
// Convert timestamp from ticks to milliseconds
myTimestampMs2 = (double)ImageInfo.TimeStamp / ((double)(myTimestampT
ickFrequency / 1000));
return;
}
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

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

JAI SDK .NET Wrapper


foreach (CCamera cam in myFactory.CameraList)
{
if (cam != null && cam.IsOpen && !cam.IsReadOnly)
{
// Set up Action 1:
// ActionDeviceKey=DEVICE_KEY
// ActionSelector=1
// ActionGroupKey[ActionSelector]=GROUP_KEY_ACTION_1
// ActionGroupMask[ActionSelector]=GROUP_MASK_ACTION_1
// ActionDeviceKey=DEVICE_KEY
node = cam.GetNode("ActionDeviceKey");
if (node == null)
{
MessageBox.Show("Unable to get ActionDeviceKey node!");
return false;
}
node.Value = DEVICE_KEY;
// ActionSelector=1
node = cam.GetNode("ActionSelector");
if (node == null)
{
MessageBox.Show("Unable to get ActionSelector node!");
return false;
}
node.Value = 1;
// ActionGroupKey[ActionSelector]=GROUP_KEY_ACTION_1
node = cam.GetNode("ActionGroupKey");
if (node == null)
{
MessageBox.Show("Unable to get ActionGroupKey node!");
return false;
}
node.Value = GROUP_KEY_ACTION_1;
// ActionGroupMask[ActionSelector]=GROUP_MASK_ACTION_1
node = cam.GetNode("ActionGroupMask");
if (node == null)
{
MessageBox.Show("Unable to get ActionGroupMask node!");
return false;
}
node.Value = GROUP_MASK_ACTION_1;
//
//
//
//

Set up the camera for trigger on Action 1


TriggerSelector=FrameStart
TriggerMode=On
TriggerSource=Action1

// 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;
//
//
//
//

Set up the timestamp reset on Action 2


LineSelector=TimeStampReset
LineSource=Action1
LineInverter=ActiveHigh

// 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

JAI SDK .NET Wrapper


}
return true;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
// Revert the camera back to Continuous mode
SetupContinuousMode();
if (myActionCommandForm != null)
myActionCommandForm.Close();
foreach (CCamera cam in myFactory.CameraList)
{
if (cam != null)
{
cam.Close();
}
}
}
private void SetupContinuousMode()
{
foreach (CCamera cam in myFactory.CameraList)
{
if (cam != null && cam.IsOpen && !cam.IsReadOnly)
{
// ExposureMode=EdgePreSelect
cam.GetNode("ExposureMode").Value = "Continuous";
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
// Update the timestamp on the dialog
if (myTimestampMs1 != 0.0)
timestampTextBox1.Text = myTimestampMs1.ToString("0.000") + "ms";
else
timestampTextBox1.Text = "";
if (myTimestampMs2 != 0.0)
timestampTextBox2.Text = myTimestampMs2.ToString("0.000") + "ms";
else
timestampTextBox2.Text = "";
}
private void setupActionsButton_Click(object sender, EventArgs e)
{
SetupActions();
}
private void action1Button_Click(object sender, EventArgs e)
{
// Send Action 1
myFactory.SendActionCommand(DEVICE_KEY, GROUP_KEY_ACTION_1, GROUP_MAS
K_ALL_ACTIONS);
}
private void action2Button_Click(object sender, EventArgs e)
{
// Send Action 2
myFactory.SendActionCommand(DEVICE_KEY, GROUP_KEY_ACTION_2, GROUP_MAS
K_ALL_ACTIONS);
}

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

23

private void openManualActionCommandButton_Click(object sender, EventArgs


e)
{
if (myActionCommandForm == null)
{
myActionCommandForm = new ActionCommandForm(myFactory);
}
else
{
// It might already have been closed??
if (myActionCommandForm.IsDisposed)
myActionCommandForm = new ActionCommandForm(myFactory);
}
if (myActionCommandForm != null)
myActionCommandForm.Show(this);
}
}
}

.\sample\NET\AsyncImageRecordingSample covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to open a window and display video from a camera
How to use the Asynchronous Image Recording features in the CCamera class
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;

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;

private int _progressCharIndex = 0;

public Form1()
{
InitializeComponent();
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

24

JAI SDK .NET Wrapper

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)
{
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);

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

JAI SDK .NET Wrapper


{
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 startCaptureButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
if (myCamera.IsAsyncImageRecordingRunning || (myCamera.TotalAsync
ImagesRecordedCount > 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)
{
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;

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

JAI SDK .NET Wrapper


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);
}
}
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;

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

JAI SDK .NET Wrapper


{
// 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
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);

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

31
}
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;
}
}
}
}
}

.\sample\NET\AVISample 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 (Width, Height and GainRaw)
How to create and attach a delegate that will be called for each captured frame
How to access the raw image data buffer contents and to create a Bitmap object
How to create AVI file and add the Bitmap to the AVI file
using
using
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.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

JAI SDK .NET Wrapper


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()
);
}
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");

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

JAI SDK .NET Wrapper


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;
}
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;

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

JAI SDK .NET Wrapper


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)
{
// 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);
}
}
}

.\sample\NET\ChildWindowSample covers the following items:


How to open the Factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

JAI SDK .NET Wrapper


private void StartButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
// 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

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

JAI SDK .NET Wrapper


// Here we need to resize the Child Window image display
if (myCamera != null)
{
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);
}
}
}

.\sample\NET\ConnectionDelegateSample covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to set up connection event delegate to supervise camera communication
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 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();
}
}
}

.\sample\NET\ConsoleApplication covers the following items:


How to open the Factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

42

JAI SDK .NET Wrapper


How to find cameras (Device Discovery)
How to open the first camera
How to open a window and display video from a camera
How to create message loop to enable video display update

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();
}
}
}

.\sample\NET\CSAutoExposureSample 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
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 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;

// Auto Exposure ON/O

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

JAI SDK .NET Wrapper


alling that the GUI needs to be
int m_OldRAverage;
he last measured average in the
int m_OldGAverage;
he last measured average in the
int m_OldBAverage;
he last measured average in the

updated
// Cached value for t
image
// Cached value for t
image
// Cached value for t
image

ALC m_ALCController = new ALC();


osed-loop controller
Jai_FactoryWrapper.ImageInfo m_ConversionBuffer;
nverting images before average is calculated

// 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

JAI SDK .NET Wrapper


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);
}

// Get the GainRaw GenICam Node


myExposureNode = myCamera.GetNode("ExposureTimeRaw");
if (myExposureNode != null)
{
// Update the values inside the ALC controller
m_ALCController.SetMinExposure(Convert.ToInt32(myExposureNode
.Min));
m_ALCController.SetMaxExposure(Convert.ToInt32(myExposureNode
.Max));
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();

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;
}

// 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;
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

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

48

JAI SDK .NET Wrapper


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)
{
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);

//

error = FindPeak(&m_ConversionBuffer, &m_MeasureRect, &Peak);


// Update the last measured average
int average = (int)Average.BGR48_G;

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;

//

//if ((int)Peak.R16 != m_OldRPeak)


//{
//
m_OldRPeak = (int)Peak.R16;
//
m_UpdateUI = true;
//}
//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();
}

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

50

JAI SDK .NET Wrapper

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();
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;

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

JAI SDK .NET Wrapper


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;
// Update the Text Control with the new value
gainTextBox.Text = myGainNode.Value.ToString();
m_ALCController.SetCurrentGain(Convert.ToInt32(myGainNode.Value))
;
}
}
private void exposureTrackBar_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
.GainOnly))
{
// Set Value
myExposureNode.Value = exposureTrackBar.Value;
// Update the Text Control with the new value
exposureTextBox.Text = myExposureNode.Value.ToString();
m_ALCController.SetCurrentExposure(Convert.ToInt32(myExposureNode
.Value));
}
}
}

.\sample\NET\CSharpSampleMulticastMaster\CSharpSampleMulticastMaster covers the following


items:
How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera with a multicast IP address specified
How to start image acquisition with a multicast IP address specified
using System;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

JAI SDK .NET Wrapper


{
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;
}
//------------------------------------------------------------------------// buttonCloseCamera_Click
//-------------------------------------------------------------------------

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

55

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;
}
}
}
}

.\sample\NET\CSharpSampleMulticastSlave\CSharpSampleMulticastSlave covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera with read-only attributes and read the multicast IP address from the
camera
How to start image acquisition to receive the multicast stream
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

56
using
using
using
using
using
using
using
using
using
using

JAI SDK .NET Wrapper


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;
}
}
//------------------------------------------------------------------------// Form1_FormClosing
//-------------------------------------------------------------------------

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

57

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
to data area:
GCHandle gch = GCHandle.Alloc(data, GCHandleType.Pinned);
// Get the pointer of the data inside managed array
IntPtr bufferPtr = gch.AddrOfPinnedObject();

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

58

JAI SDK .NET Wrapper


// 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();
}
}

.\sample\NET\CSharpSwTrigger\CSharpSwTrigger 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 C3 compact (JAI CM- and CB- cameras) software trigger features
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 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

JAI SDK .NET Wrapper


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());
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

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

JAI SDK .NET Wrapper


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
{

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
(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]=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)

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

JAI SDK .NET Wrapper


myCamera.GetNode("TriggerSelector").Value = "FrameStart";
myCamera.GetNode("TriggerSoftware").ExecuteCommand();
}
else
{
// We need to "pulse" the Software Trigger
igger the camera!
myCamera.GetNode("SoftwareTrigger0").Value
myCamera.GetNode("SoftwareTrigger0").Value
myCamera.GetNode("SoftwareTrigger0").Value
}
}

feature in order to tr
= 0;
= 1;
= 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();
}
}
}

.\sample\NET\FeatureBrowserSample covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
How to open all cameras
How to populate a tree-view control with all the GenICam nodes read from each camera
How to populate a property-grid with detailed information about both the CCamera and CNode
classes
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 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

JAI SDK .NET Wrapper


{
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();
}
}

.\sample\NET\GigECameraValidationTool\GigECameraValidationTool covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
How to create a list of cameras
How to open camera selected from the list
How to control named features using GenICam
How to validate all the GenICam nodes in the open camera
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.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>();

public Nullable<int> iOldSelectedIndex = null;


private int featureProgressCount = 0;
// Count for progress bar
private Object thisLock = new Object();
System.Windows.Forms.Timer t = new Timer(); // timer for progress bar
public Form1()
{
InitializeComponent();
// Find cameras and list in the combo box
DiscoverCameras();
}

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

JAI SDK .NET Wrapper


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)
{
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());

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

JAI SDK .NET Wrapper

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

JAI SDK .NET Wrapper


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();
}
}
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
{
try
{
myCamera.GetNode("UserSetSelector").Value = "Default";
Jai_FactoryWrapper.J_Camera_ExecuteCommand(myCamera.Camer
aHandle, "UserSetLoad");
statusBarLabel.Text = camListComboBox.SelectedItem.ToStri
ng() + " has been selected";
// save the selected camera index

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();
}
}
}

.\sample\NET\GreenCompensationSample 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 (perform Green-Compensation and display
the image)
How to open a window and display video from a camera using Image Library functions
How to use J_Image_Processing() function to perform Green-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 GreenCompensationSample
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

74

JAI SDK .NET Wrapper


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);
}
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)

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");

// Pleora hack! They set Width.Max and Height.Max to 16K in their


custom systems
if ((Convert.ToInt32(WidthNode.Max) >= 16383) && (Convert.ToInt32
(WidthNode.Max) >= 16383))
{
Width = Convert.ToInt32(WidthNode.Value);
Height = Convert.ToInt32(HeightNode.Value);
}
else
{
Width = Convert.ToInt32(WidthNode.Max);
Height = Convert.ToInt32(HeightNode.Max);
}
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(1
00, 100, Width, Height);
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
// Create View Window to display the processed output (instead of
the original)
Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWrapper.EI
VWWindowType.OverlappedStretch, "Green-Compensation Output", ref frameRect, ref m
axSize, IntPtr.Zero, out myViewWindow);
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
myCamera.StartImageAcquisition(true, 5);
}
}
private void StopButton_Click(object sender, EventArgs e)
{
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)

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

76

JAI SDK .NET Wrapper


{
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)
{
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

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

JAI SDK .NET Wrapper


= 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
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)

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);
}
}
}

.\sample\NET\HDRSequenceSample\HDRSequenceSample 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 C3 (JAI BM-, BB-, CM- and CB- cameras) software trigger features
How to use C3 (JAI BM-, BB-, CM- and CB- cameras) sequence features
How to use the High Dynamic Range functions
using System;
using System.Collections.Generic;
using System.ComponentModel;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

80
using
using
using
using
using

JAI SDK .NET Wrapper


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

// State for the sequ


// get two images bef

ore we use the HDR algorithms


bool myAnalyzeImageRequired = true;
nalysis of the next two images
bool myAnalysisIsOk = true;
ysis
int myAnalysisRetries = 0;
used when trying to analyze the two images

// Flag to activate a
// Result of the anal
// Number of retries

Jai_FactoryWrapper.ImageInfo myImageInfo1 = new Jai_FactoryWrapper.ImageI


nfo();
// Copy of the buffer information for the first image
Jai_FactoryWrapper.ImageInfo myImageInfo2 = new Jai_FactoryWrapper.ImageI
nfo();
// Copy of the buffer information for the second image
Jai_FactoryWrapper.ImageInfo myHDROutputImage = new Jai_FactoryWrapper.Im
ageInfo(); // Buffer information allocated for the HDR output image
byte myImage1IsBrighter = 0;
// This flag tells us
if the first image is brighter than the second image
int myBlackLevelImage1 = 0;
// Black level for th
e first image. This value is used for the HDR merging
int myBlackLevelImage2 = 0;
// Black level for th
e second image. This value is used for the HDR merging
float myDarkGain = 1.0f;
// Multiplication fac
tor between the dark image and the bright image
float myDualSlopeGain = 1.0f;
// Dual-slope gain. T
his value will typically be below 1.0 (1.0 = Dual-Slope off)
object myLockObject = new object();
// Object used for lo
cking access to the flags and values above
int myPixelDepth = 8;
pixel for the selected Pixel Format

// Number of bits per

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

JAI SDK .NET Wrapper


// Verify that the camera connection is actually opened
if ((myCamera != null) && myCamera.IsOpen)
{
// Create the View Windows
// Try to read get the maximum image width and height by reading
the Max values for the mandatory "Width" and "Height" features.
CNode WidthNode = myCamera.GetNode("Width");
CNode HeightNode = myCamera.GetNode("Height");
Int32 Width = Convert.ToInt32(WidthNode.Max);
Int32 Height = Convert.ToInt32(HeightNode.Max);
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Create the View Windows for the 3 tabs
// Calculate the size of the window rect to display the images
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, 100, 100); ;
System.Windows.Forms.Control ctrl = System.Windows.Forms.Control.
FromChildHandle(Image1PictureBox.Handle);
frameRect = new Jai_FactoryWrapper.RECT(0, 0, ctrl.Width, ctrl.He
ight);
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.ChildStretch, "Image1", ref frameRect, ref maxSize, Image1Pi
ctureBox.Handle, out myImage1ViewWindowHandle);
ctrl = System.Windows.Forms.Control.FromChildHandle(Image2Picture
Box.Handle);
frameRect = new Jai_FactoryWrapper.RECT(0, 0, ctrl.Width, ctrl.He
ight);
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.ChildStretch, "Image2", ref frameRect, ref maxSize, Image2Pi
ctureBox.Handle, out myImage2ViewWindowHandle);
ctrl = System.Windows.Forms.Control.FromChildHandle(HDRImagePictu
reBox.Handle);
frameRect = new Jai_FactoryWrapper.RECT(0, 0, ctrl.Width, ctrl.He
ight);
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.ChildStretch, "HDRImage", ref frameRect, ref maxSize, HDRIma
gePictureBox.Handle, out myImageHDRViewWindowHandle);
// Setup the camera for software trigger
SetupTriggerMode();
// Setup the sequences
SetupSequences();
// Get the current camera values and update the GUI
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"

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

83

// 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)
{
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);

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

84

JAI SDK .NET Wrapper


}
// 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;
// ..

so we can now proceed with the HDR process

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?

// 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)
{
CNode node = null;
// 1st sequence settings
myCamera.GetNode("SequenceSelector").Value = 0;
// Set up Expoure Time Raw slider
node = myCamera.GetNode("SequenceExposureTimeRaw");

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

86

JAI SDK .NET Wrapper


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;
}
else
{
ExposureTime2TextBox.Text = "-";
ExposureTime2TrackBar.Minimum = 0;
ExposureTime2TrackBar.Maximum = 1;
ExposureTime2TrackBar.Value = 0;
ExposureTime2TextBox.Enabled = false;

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

JAI SDK .NET Wrapper


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;

0;
= 0;
= 0;
myCamera.GetNode("Se
myCamera.GetNode("Se

1;
= 0;
= 0;
myCamera.GetNode("Se
myCamera.GetNode("Se

// Save the sequence settings into flash memory


myCamera.GetNode("SequenceSaveCommand").ExecuteCommand();
}
}
delegate void UpdateInfoDelegate();

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

JAI SDK .NET Wrapper


// 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)
{
if (enumValue.Name.Equals("SequentialEPSTrigger"))
{
found = true;
break;
}
}
if (!found)
return false;

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

91

// 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;
node = myCamera.GetNode("SequenceROISizeY");
if (node == null)
return false;
node = myCamera.GetNode("SequenceSaveCommand");
if (node == null)
return false;

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

92

JAI SDK .NET Wrapper


}
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);
}
private void BlackLevel2NumericUpDown_ValueChanged(object sender, EventAr
gs e)
{
// User manually changed the Black Level
myBlackLevelImage2 = Convert.ToInt32(BlackLevel2NumericUpDown.Value);
}

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

JAI SDK .NET Wrapper


// 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();
}
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;

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";
}
}
}
}

.\sample\NET\ImageDelegateSample covers the following items:


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

96

JAI SDK .NET Wrapper


How to open the Factory
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 create and attach a delegate that will be called for each captured frame
How to access the raw image data buffer contents and to modify the image at runtime
How to open a window and display video from a camera

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

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.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;

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

98

JAI SDK .NET Wrapper


// 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;
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;
//
st as
//
//
//
//
//

This is in fact a callback, so we would need to handle the data as fa


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

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;
}
}
}
}

.\sample\NET\InterPacketDelayCalculator\InterPacketDelayCalculator covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

99

100

JAI SDK .NET Wrapper


How to open the first camera
How to calculate the Inter-Packet Delay value based on current camera settings

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

JAI SDK .NET Wrapper


int PayloadSize = 0;
int PacketSize = 0;
int PacketCount = 0;
Int64 TickFrequency = 0;
int OverHead = 0;
int TotalSize = 0;
int TransmissionRate = 1000000000 / 8;
double TransmissionTime = 0.0;
double MaxFps = 60.0;
double ExpectedBandwidthUsage = 90.0;
int CurrentInterPacketDelay = 0;
int MinInterPacketDelay = 0;
Int64 MaxInterPacketDelay = Int32.MaxValue;
double PauseTime = 0;
double TotalInterPacketDelayTime = 0.0;
bool Initialized = false;
public InterPacketDelayForm(CCamera camera)
{
InitializeComponent();
myCamera = camera;
}
public int InterPacketDelay
{
get
{
return _InterPacketDelay;
}
}
private void MaxFpsTextBox_TextChanged(object sender, EventArgs e)
{
if (Initialized)
{
CalculateButton.Enabled = true;
}
}
private void CalculateButton_Click(object sender, EventArgs e)
{
try
{
MaxFps = double.Parse(MaxFpsTextBox.Text);
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
try
{
ExpectedBandwidthUsage = double.Parse(MaxErrorUpDown.Value.ToSt
ring());
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
TransmissionTime = (MaxFps * (double)TotalSize) / (double)Transmissio
nRate;
PauseTime = ExpectedBandwidthUsage / 100.0 - TransmissionTime;
// Is the transmission time larger than the time calculated based on

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

1.3 Samples

103

the expected bandwidth usage?


if (PauseTime < 0.0)
{
string message = string.Format("The calculated transmission time
is too long!\nEither the number of frames per second ({0} fps) has to be lowered
or the expected bandwidth usage ({1} %) has to be increased!", MaxFpsTextBox.Text
, MaxErrorUpDown.Value.ToString());
_InterPacketDelay = MinInterPacketDelay;
MessageBox.Show(this, message, "Inter Packet Delay Calculation Er
ror");
}
else
{
TotalInterPacketDelayTime = PauseTime / ((double)PacketCount * Ma
xFps);
_InterPacketDelay = (int)Math.Truncate(TotalInterPacketDelayTime
* (double)TickFrequency + 0.5);
InterPacketDelayTextBox.Text = _InterPacketDelay.ToString();
if (_InterPacketDelay < MinInterPacketDelay)
{
string message = string.Format("The calculated Inter Packet D
elay {0} is smaller than allowed minimum value {1}!\nThe value is forced to the m
inimum value automatically!", _InterPacketDelay, MinInterPacketDelay);
_InterPacketDelay = MinInterPacketDelay;
MessageBox.Show(this, message, "Inter Packet Delay Calculatio
n Error");
}
if (_InterPacketDelay > MaxInterPacketDelay)
{
string message = string.Format("The calculated Inter Packet D
elay {0} is greate than allowed maximum value {1}!\nThe value is forced to the ma
ximum value automatically!", _InterPacketDelay, MaxInterPacketDelay);
_InterPacketDelay = int.Parse(MaxInterPacketDelay.ToString())
;
MessageBox.Show(this, message, "Inter Packet Delay Calculatio
n Error");
}
InterPacketDelayTextBox.Text = _InterPacketDelay.ToString();
InterPacketDelayTextBoxus.Text = ((double)((double)_InterPacketDe
lay * 1000000 / (double)TickFrequency)).ToString();
MbitPerSecTextBox.Text = (MaxFps * (double)TotalSize * 8.0 / 1000
000.0).ToString("0.0");
}
CalculateButton.Enabled = false;
}
private void OKButton_Click(object sender, EventArgs e)
{
}
private void CancelButton_Click(object sender, EventArgs e)
{
}
private void InterPacketDelayForm_Load(object sender, EventArgs e)
{
// Gets a NumberFormatInfo associated with the en-US culture.
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat
;
nfi.NumberDecimalSeparator = ",";

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

104

JAI SDK .NET Wrapper

// We need to get all the values from the camera


if (myCamera != null)
{
object obj = null;
// PayloadSize (Mandatory GenICam)
obj = myCamera.GetNodeValue("PayloadSize");
if (obj != null)
{
try
{
PayloadSize = int.Parse(obj.ToString());
PayloadSizeTextBox.Text = PayloadSize.ToString();
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
}
// Packet Size (Recommended GenICam)
obj = myCamera.GetNodeValue("GevSCPSPacketSize");
if (obj != null)
{
try
{
PacketSize = int.Parse(obj.ToString());
PacketSizeTextBox.Text = PacketSize.ToString();
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message);
}
}
else
{
// If not defined then we need to read it manually from regis
ter
// Allocate the managed buffer to hold the data:
byte[] buffer = new byte[4];
// Allocate a handle and pin the data in memory so we can get
a pointer to data area:
GCHandle gch = GCHandle.Alloc(buffer, GCHandleType.Pinned);
// Get the pointer of the data inside managed array
IntPtr bufferPtr = gch.AddrOfPinnedObject();
uint size = 4;
Jai_FactoryWrapper.EFactoryError retsta = Jai_FactoryWrapper.
J_Camera_ReadData(myCamera.CameraHandle, 0xD04, bufferPtr, ref size);
PacketSize = IPAddress.HostToNetworkOrder(Marshal.ReadInt32(b
ufferPtr)) & 0x0000FFFF;
PacketSizeTextBox.Text = PacketSize.ToString();
// Free the handle again after we have call the unmanaged dll
gch.Free();
}
// Calculate number of packets
int PacketPayload = PacketSize - 36;
PacketCount = (PayloadSize / PacketPayload) + 2;
if ((PayloadSize % PacketPayload) != 0)

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];

// Allocate a handle and pin the data in memory so we can get a p


ointer to data area:
GCHandle gch2 = GCHandle.Alloc(buffer2, GCHandleType.Pinned);
// Get the pointer of the data inside managed array
IntPtr bufferPtr2 = gch2.AddrOfPinnedObject();
uint size2 = 8;
Jai_FactoryWrapper.EFactoryError retsta2 = Jai_FactoryWrapper.J_C
amera_ReadData(myCamera.CameraHandle, 0x93C, bufferPtr2, ref size2);
TickFrequency = IPAddress.HostToNetworkOrder(Marshal.ReadInt64(bu
fferPtr2));
// Free the handle again after we have call the unmanaged dll
gch2.Free();
TickFrequenceTextBox.Text = TickFrequency.ToString();
OverHead = (PacketCount * 54) + 36 + 12; // Total # of packets *
54 (Ethernet+IP+UDP+GVSP headers) + 36 (Image Leader payload) + 10 (Image Trailer
payload + 2 extra padding??)
OverheadTextBox.Text = OverHead.ToString();
TotalSize = PayloadSize + OverHead;
TotalSizeTextBox.Text = TotalSize.ToString();
TransmissionTime = (double)TotalSize / (double)TransmissionRate;
TransmissionTimeTextBox.Text = ((double)(TransmissionTime*1000.0)
).ToString("0.000000");
PacketTransmissionTimeTextBox.Text = ((double)((double)PacketSize
* 1000000.0 / (double)TransmissionRate)).ToString("0.000000");
MaxFpsTextBox.Text = MaxFps.ToString("0.00");
//

MaxErrorTextBox.Text = ExpectedBandwidthUsage.ToString("0.00");
MaxErrorUpDown.Value = Convert.ToDecimal(ExpectedBandwidthUsage);

// Update Current InterPacketDelay field


CNode InterPacketDelayNode = myCamera.GetNode("GevSCPD");
if (InterPacketDelayNode == null)
{
InterPacketDelayNode = myCamera.GetNode("PacketDelay");
if (InterPacketDelayNode == null)
{
// We then need to read it directly from the register
// If not defined then we need to read it manually from r
egister
// Allocate the managed buffer to hold the data:
byte[] buffer3 = new byte[4];
// Allocate a handle and pin the data in memory so we can
get a pointer to data area:

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

106

JAI SDK .NET Wrapper


GCHandle gch3 = GCHandle.Alloc(buffer3, GCHandleType.Pinn
ed);
// Get the pointer of the data inside managed array
IntPtr bufferPtr3 = gch3.AddrOfPinnedObject();
uint size3 = 4;
Jai_FactoryWrapper.EFactoryError retsta = Jai_FactoryWrap
per.J_Camera_ReadData(myCamera.CameraHandle, 0xD04, bufferPtr3, ref size3);
CurrentInterPacketDelay = IPAddress.HostToNetworkOrder(Ma
rshal.ReadInt32(bufferPtr3));
CurrentInterPacketDelayTextBox.Text = CurrentInterPacketD
elay.ToString();
MinInterPacketDelay = 0;
MinTextBox.Text = MinInterPacketDelay.ToString();
MaxInterPacketDelay = Int32.MaxValue;
MaxTextBox.Text = MaxInterPacketDelay.ToString();
// Free the handle again after we have call the unmanaged
dll
gch3.Free();
}
else
{
CurrentInterPacketDelay = Convert.ToInt32(InterPacketDela
yNode.Value);
CurrentInterPacketDelayTextBox.Text = CurrentInterPacketD
elay.ToString();
MinInterPacketDelay = Convert.ToInt32(InterPacketDelayNod
e.Min);
MinTextBox.Text = MinInterPacketDelay.ToString();
MaxInterPacketDelay = Convert.ToInt64(InterPacketDelayNod
e.Max);
MaxTextBox.Text = MaxInterPacketDelay.ToString();
}
}
else
{
CurrentInterPacketDelay = Convert.ToInt32(InterPacketDelayNod
e.Value);
CurrentInterPacketDelayTextBox.Text = CurrentInterPacketDelay
.ToString();
MinInterPacketDelay = Convert.ToInt32(InterPacketDelayNode.Mi
n);
MinTextBox.Text = MinInterPacketDelay.ToString();
MaxInterPacketDelay = Convert.ToInt64(InterPacketDelayNode.Ma
x);
MaxTextBox.Text = MaxInterPacketDelay.ToString();
}
// Try to get the frame rate from AcquisitionFrameRateRaw
obj = myCamera.GetNodeValue("AcquisitionFrameRateRaw");
if (obj != null)
{
try
{
string[] split = obj.ToString().Split(new char[] { })
;
if (split.Length > 1)
{

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

JAI SDK .NET Wrapper


}
private void MaxErrorUpDown_ValueChanged(object sender, EventArgs e)
{
if (Initialized)
{
CalculateButton_Click(null, null);
}
}
}

.\sample\NET\LensDistortionCorrectionSample 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 use the Lens-Distortion Correction Image-processing functionality from inside the Stream
Callback function
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 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

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)
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;

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

110

JAI SDK .NET Wrapper


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;
}

Jai_FactoryWrapper.POINT pnt = new Jai_FactoryWrapper.POINT(10, 1


0);
Jai_FactoryWrapper.RECT rect = new Jai_FactoryWrapper.RECT(0, 0,
Width, Height);
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
// Open the live view
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.OverlappedStretch, "Output", ref rect, ref maxSize, IntPtr.Z
ero, out WindowHandle);
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
myCamera.StartImageAcquisition(true, 5);
StartButton.Enabled = false;
StopButton.Enabled = true;
}
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
lock (myUndistortParametersLock)
{
// Free the internal undistortion map if it has been initiali
zed
Jai_FactoryWrapper.J_Image_ProcessingFree(ref myConversionBuf
fer, ref myUndistortParameters);
}

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

JAI SDK .NET Wrapper


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;
}
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);

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

JAI SDK .NET Wrapper


fo, ref myUndistortParameters);
}
}
if ((ImageInfo.AwaitDelivery < 2) && (WindowHandle != IntPtr.Zero))
{
if (mybUndistort)
{
if (!mybMonochrome)
{
// First we need to convert the image into either 32-bit
DIB or 48-bit "Image" format
error = Jai_FactoryWrapper.J_Image_FromRawToDIB(ref Image
Info, ref myConversionBuffer, Jai_FactoryWrapper.EColorInterpolationAlgorithm.Bay
erStandardMultiprocessor, myRedGain, myBlueGain, myGreenGain);
//error = Jai_FactoryWrapper.J_Image_FromRawToImage(ref I
mageInfo, ref myConversionBuffer, Jai_FactoryWrapper.EColorInterpolationAlgorithm
.BayerStandardMultiprocessor, myRedGain, myBlueGain, myGreenGain);
// Do the Lens Distortion Correction
lock (myUndistortParametersLock)
{
error = Jai_FactoryWrapper.J_Image_Processing(ref myC
onversionBuffer, ref myImageProcessingBuffer, myUndistortParameters, true);
}
}
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)
{

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

JAI SDK .NET Wrapper


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
myUndistortParameters.InterpolationType = Jai_FactoryWrapper.
EInterpolationType.InterpolationNone;
}
}
}

.\sample\NET\MultiCamsAsyncImageRecording covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
How to open multiple cameras
How to open a window and display video from a camera
How to use the Asynchronous Image Recording features in the CCamera class
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.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

JAI SDK .NET Wrapper


//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
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

JAI SDK .NET Wrapper


List<Jai_FactoryWrapper.ImageInfo> imageList =
.CameraList[i].GetAsyncRecordedImages();

myFactory

// Any images recorded?


if (imageList != null && (imageList.Count > 0))
{
// Run through the list of recorded images
for (int index = 0; index < myFactory.CameraList[i].
TotalAsyncImagesRecordedCount; index++)
{
Jai_FactoryWrapper.EFactoryError error = Jai_Fact
oryWrapper.EFactoryError.Success;
// Get the recorded image at this index
Jai_FactoryWrapper.ImageInfo ii = imageList[index
];
// Are we saving the images in "raw" format or in
Tiff?
if (saveRawCheckBox.Checked)
{
// Save the image to disk
//error = Jai_FactoryWrapper.J_Image_SaveFile
Raw(ref ii, ".\\RecordedImage" + index.ToString("000") + ".raw");
error = Jai_FactoryWrapper.J_Image_SaveFileRa
w(ref ii, sSubDirName + "\\" + sModelName + "_" + ii.TimeStamp.ToString() + ".raw
");
}
else
{
// Create local image that will contain the c
onverted image
Jai_FactoryWrapper.ImageInfo localImageInfo =
new Jai_FactoryWrapper.ImageInfo();
// Allocate buffer that will contain the conv
erted image
// In this sample we re-allocate the buffer o
ver-and-over because we assume that the recorded images could be
// of different size (If we have been using t
he Sequence 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_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");

//Free the conversion buffer


error = Jai_FactoryWrapper.J_Image_Free(ref l
ocalImageInfo);
}
Application.DoEvents();
}
MessageBox.Show(this, "The recorded images has been s
aved!", "Image save", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}

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

JAI SDK .NET Wrapper

}
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

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)
_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

124

JAI SDK .NET Wrapper

.\sample\NET\NodeEventSample covers the following items:


How to open the Factory
How to find cameras (Device Discovery)
How to open the first camera
How to set up GenICam Node event delegate to receive updates everytime state or value of a node
changes
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 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

// 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();
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;

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

126

JAI SDK .NET Wrapper


// Create new delegate
myPayloadSizeNodeChangeDelegate = new Jai_FactoryWrapper.NodeChang
eDelegate(myPayloadSizeNodeChangeDelegateFunction);
// Register the delegate
Jai_FactoryWrapper.J_Node_RegisterCallback(myPayloadSizeNode.NodeH
andle, myPayloadSizeNodeChangeDelegate);
}
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";
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e)


{
if (myFactory != null)
myFactory.Close();
}
}
}

.\sample\NET\RedCompensationSample 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 (perform Red-Compensation and display the
image)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

JAI SDK .NET Wrapper


{
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");

// Pleora hack! They set Width.Max and Height.Max to 16K in their


custom systems
if ((Convert.ToInt32(WidthNode.Max) >= 16383) && (Convert.ToInt32
(WidthNode.Max) >= 16383))
{
Width = Convert.ToInt32(WidthNode.Value);
Height = Convert.ToInt32(HeightNode.Value);
}
else
{
Width = Convert.ToInt32(WidthNode.Max);
Height = Convert.ToInt32(HeightNode.Max);
}
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(1
00, 100, Width, Height);
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
// Create View Window to display the processed output (instead of
the original)
Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWrapper.EI
VWWindowType.OverlappedStretch, "Red-Compensation Output", ref frameRect, ref max
Size, IntPtr.Zero, out myViewWindow);
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
myCamera.StartImageAcquisition(true, 5);
}
}
private void StopButton_Click(object sender, EventArgs e)
{

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

JAI SDK .NET Wrapper


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
Jai_FactoryWrapper.RedCompensationStruct myRedCompensationParameters

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

JAI SDK .NET Wrapper

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);
}
}
}

.\sample\NET\SimpleImageDisplaySample covers the following items:


How to open the Factory
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

JAI SDK .NET Wrapper


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.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;

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();
}
}
}

.\sample\NET\ZoomImageDisplaySample 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 handle Pan and Zoom inside the display window using the Image Library functions
using System;
using System.Collections.Generic;
using System.ComponentModel;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

136
using
using
using
using
using

JAI SDK .NET Wrapper


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)
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

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;
}
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

JAI SDK .NET Wrapper


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();
}
private void CenterButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
myCamera.NavigateCenter();
}
private void RightButton_Click(object sender, EventArgs e)

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

JAI SDK .NET Wrapper

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

Chapter 2

Module Index
2.1

Modules

Here is a list of all modules:


JAI SDK .NET Wrapper . . . . . . . . . . . . . . . .
Factory specific functions . . . . . . . . . . . . . .
Action Command function . . . . . . . . . . .
Camera specific functions . . . . . . . . . . . . . .
Camera connection functions . . . . . . . . . .
Direct GenICam node value access functions . .
Direct register access functions . . . . . . . . .
Configuration information function . . . . . . .
GenICam Feature Node access functions . . . .
Image Data Stream access functions . . . . . .
Save or Load Setting functions . . . . . . . . .
Data Stream specific functions . . . . . . . . . . .
Event Interface functions . . . . . . . . . . . . . .
Camera event specific functions . . . . . . . .
Data Stream event specific functions . . . . . .
Condition specific functions . . . . . . . . . .
GenICam node specific functions . . . . . . . . . .
IInteger GenICam node specific functions . . .
IFloat GenICam node specific functions . . . .
IEnumeration GenICam node specific functions
ICommand GenICam node specific functions .
IString GenICam node specific functions . . . .
IRegister GenICam node specific functions . .
Image acquisition and manipulation functions . . .
View window specific functions . . . . . . . .
Stream channel specific functions . . . . . . . .
Image manipulation functions . . . . . . . . . .
Image save and load functions . . . . . . . . .
Pixel access functions . . . . . . . . . . . . . .
Image white balance control functions . . . . .
High Dynamic Range functions . . . . . . . . .
Lookup-Table functions . . . . . . . . . . . . .
Histogram functions . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

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

Here is a list of all documented files with brief descriptions:


Camera.cs (Camera object implementation of the Managed JAI Factory ) . . . . . . . . .
Factory.cs (Factory object implementation of the Managed JAI SDK ) . . . . . . . . . .
Jai_Factory_Wrapper.cs (.NET Wrapper implementation for the JAI SDK Factory DLL )
Node.cs (GenICam Node object implementation of the Managed JAI Factory ) . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

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

JAI SDK .NET Wrapper

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_...().

Camera specific functions


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_...().

Data Stream specific functions


The Data Stream specific functions are used for controlling the Image Acquisition manually from the user
application.

Event Interface functions


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.

148

Module Documentation

GenICam node specific functions


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.

Image acquisition and manipulation functions


The JAI SDK contains a number of functions to handle automatic image acquisition via callback functions,
image manipulation and image display.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.2 Factory specific functions

5.2

149

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_...().

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 EFactoryInfoType { Version, BuildDate, BuildTime, Manufacturer }


Factory information type 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

Open the factory and return a valid handle.

static Jai_FactoryWrapper.EFactoryError J_Factory_Close (FACTORY_HANDLE FactoryHandle)


Close a previously opened factory handle.

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_UpdateCameraList (FACTORY_HANDLE


FactoryHandle, ref bool HasChanged)
Perform a Device Discovery and update the internal list of available cameras.

static Jai_FactoryWrapper.EFactoryError J_Factory_GetNumOfCameras (FACTORY_HANDLE


FactoryHandle, ref UInt32 NumOfCameras)
Get the number of cameras found during Device Discovery with J_Factory_UpdateCameraList().

static Jai_FactoryWrapper.EFactoryError J_Factory_GetCameraIDByIndex (FACTORY_HANDLE


FactoryHandle, Int32 Index, StringBuilder CameraID, out UInt32 Size)
Get a string that uniquely identifies the camera, interface and the transport layer.

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_Factory_EnableForceIp (FACTORY_HANDLE FactoryHandle, UInt32 ForceEnabled)


Set Automatic Force IP mode.

static Jai_FactoryWrapper.EFactoryError J_Factory_GetGenICamErrorInfo (ref GenICamErrorInfo


genICamErrorInfo)
Get detailed information about GenICam errors exceptions caught in Jai_Factory.dll.

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 Factory specific functions

5.2.2

Enumeration Type Documentation

5.2.2.1

enum EFactoryError [inherited]

151

Error return code enumeration.


This is returned by all Jai_Factory.dll wrapper functions
Enumerator:
Success OK.
InvalidBufferSize Invalid buffer size.
InvalidHandle Invalid handle.
InvalidID Invalid ID.
AccessDenied Access denied.
NoData No data.
Error Generic errorcode.
InvalidParameter Invalid parameter.
Timeout Timeout.
InvalidFilename Invalid file name.
InvalidAddress Invalid address.
FileIO File IO error.
GenICamError Exception caught from GenApi code.
Use J_Factory_GetGenICamErrorInfo() to get information string.
ValidationError Validation error found in J_Camera_LoadSettings(). Use J_Camera_GetValidationErrorInfo() to get information string.
ValidationWarning Validation warning found in J_Camera_LoadSettings(). Use J_Camera_GetValidationErrorInfo() to get information string.

5.2.2.2

enum EFactoryInfoType [inherited]

Factory information type enumeration.


This enumeration is used in the J_Factory_GetInfo() function to retrieve detailed information about
the Jai_Factory.dll
Enumerator:
Version Jai_Factory.dll Version
BuildDate Jai_Factory.dll Build Date
BuildTime Jai_Factory.dll Build Time
Manufacturer Jai_Factory.dll Manufacturer

5.2.2.3

enum ECameraInfoType [inherited]

Camera information type enumeration.


This enumeration is used in J_Factory_GetCameraInfo() to acquire detailed information about
each detected camera.
The camera connection does not need to be established in order to get this information. The information is
retrieved during Device Discovery.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static string GetFactoryErrorString (Jai_FactoryWrapper.EFactoryError error)


[static, inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Factory_Open (String RegistryFileName, out


FACTORY_HANDLE FactoryHandle) [inherited]

Open the factory and return a valid handle.


If the Registry file name is left empty then the default registry file will be used.
Parameters:
RegistryFileName A string with the file name and path to the registry database that the user want to
use
FactoryHandle A reference to where the valid factory handle should be returned
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.2 Factory specific functions


5.2.3.3

153

static Jai_FactoryWrapper.EFactoryError J_Factory_Close (FACTORY_HANDLE


FactoryHandle) [inherited]

Close a previously opened factory handle.


When the factory is closed the underlaying transport layer and interfaces will be automatically closed and
released as well
See also:
J_Factory_Open(String, out FACTORY_HANDLE)
Parameters:
FactoryHandle Valid factory handle
Returns:
Jai_FactoryWrapper.EFactoryError

5.2.3.4

static Jai_FactoryWrapper.EFactoryError J_Factory_GetInfo (EFactoryInfoType


InfoType, StringBuilder InfoString, ref int BufferSize) [inherited]

Get information about the Jai_Factory.dll.


// C# Sample demonstrating how to read the version information from t
he factory
public String Version
{
get
{
StringBuilder infoString = new StringBuilder(100);
int bufferSize = infoString.Capacity;
if (factoryHandle != null)
J_Factory_GetInfo(EFactoryInfoType.Version, infoString, re
f bufferSize);
return infoString.ToString();
}
}

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

static Jai_FactoryWrapper.EFactoryError J_Factory_UpdateCameraList


(FACTORY_HANDLE FactoryHandle, ref bool HasChanged) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Factory_GetNumOfCameras


(FACTORY_HANDLE FactoryHandle, ref UInt32 NumOfCameras) [inherited]

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

5.2 Factory specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Factory_GetCameraIDByIndex


(FACTORY_HANDLE FactoryHandle, Int32 Index, StringBuilder CameraID, out UInt32
Size) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Factory_GetCameraInfo


(FACTORY_HANDLE FactoryHandle, String CameraID, ECameraInfoType InfoType,
StringBuilder InfoString, ref UInt32 Size) [inherited]

Get detailed information about a camera.


This information will be available even before the camera connection has been established since it is collected during the GigE Vision Device Discovery.
EFactoryError error = EFactoryError.Success;
StringBuilder stringBuilder = new StringBuilder(512);
uint Size = (uint)stringBuilder.Capacity;
String Manufacturer;
error = J_Factory_GetCameraInfo(factoryHandle, CameraID,
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_Factory_EnableForceIp


(FACTORY_HANDLE FactoryHandle, UInt32 ForceEnabled) [inherited]

Set Automatic Force IP mode.


If the Automatic Force IP is enabled and a camera is not accessible because it is on a wrong subnet then
the Factory will automatically assign an IP address to this camera so the camera will be on the same subnet
as the NIC where the camera was discovered.
Parameters:
FactoryHandle Handle to a valid factory object, obtained by J_Factory_Open() function
ForceEnabled 0: Force IP is disabled, !=0: Force IP is enabled
Returns:
Jai_FactoryWrapper.EFactoryError

5.2.3.10

static Jai_FactoryWrapper.EFactoryError J_Factory_GetGenICamErrorInfo (ref


GenICamErrorInfo genICamErrorInfo) [inherited]

Get detailed information about GenICam errors exceptions caught in Jai_Factory.dll.


EFactoryError error = EFactoryError.Success;
GenICamErrorInfo genICamErrorInfo = new GenICamErrorInfo;
error = J_Factory_GetCameraInfo(factoryHandle, CameraID,
ECameraInfoType.Manufacturer, stringBuilder, ref Size);
if (error == EFactoryError.GenICamError)
{
J_Factory_GetGenICamErrorInfo(ref genICamErrorInfo);
MessageBox.Show(genICamErrorInfo.Description);
}

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 Action Command function

5.3

157

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.

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

static Jai_FactoryWrapper.EFactoryError J_Factory_SendActionCommand


(FACTORY_HANDLE FactoryHandle, UInt32 DeviceKey, UInt32 GroupKey, UInt32
GroupMask, IntPtr pAckBufferArray, ref UInt32 NumOfAck) [inherited]

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 Camera specific functions

5.4

159

Camera specific functions

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.

Direct GenICam node value access functions


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.

Direct register access functions


The following functions are used for reading and writing registers valued inside cameras without using the
GenICam feature nodes.

Configuration information function


The following function is used for accessing the XML-file configuration information about a camera.

GenICam Feature Node access functions


The following functions are used for accessing the GenICam feature nodes from the XML-file loaded from
the camera.

Image Data Stream access functions


The following functions are used for accesing the Image Data Streams for a camera.

Save or Load Setting functions


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 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 EConfNameSpace { Custom, Standard, _UndefinedNameSpace }


Defines if a node name is standard or custom namespace.

enum EConfCachingMode { NoCache, WriteThrough, WriteAround, _UndefinedCachingMode }


Caching mode of a GenICam register node.

enum EConfRepresentation {
Linear, Logarithmic, Boolean, PureNumber,
HexNumber, IPV4Address, MACAddress, _UndefinedRepresentation }
Defines the node representaion in the GUI.

enum EDisplayNotation { Automatic, Fixed, Scientific, _UndefinedEDisplayNotation }


Defines the IFloat Display Notation 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 Camera specific functions

5.4.2

Enumeration Type Documentation

5.4.2.1

enum EDeviceAccessFlags [inherited]

161

Camera access mode flag enumeration.


This enumeration is used in J_Camera_OpenMc() to specify the access mode when connecting to a
camera.
Enumerator:
None Access denied.
ReadOnly Host has / can have Read Only access to the device.
Control Host has / can have Control access to the device.
Exclusive Host has / can have Exclusive access to the device.

5.4.2.2

enum EConfInfoType [inherited]

XML-file configuration information type enumeration.


Enumerator:
ModelName Model Name (CV-A70GE...).
VendorName Vendor Name (JAI).
ToolTip Tooltip. Short description about the configuration file.
StandardNameSpace Standard Name Space (GigE Vision, IEEE...).
GenApiVersion GenAPI Version.
SchemaVersion GenICam Schema Version.
DeviceVersion Device Version.
ProductGuid Product GUID. Unique identifier for the camera. This will be unique to the camera
type.
VersionGuid Version GUID. Unique identifier for the XML-file version. This will help to identify
the current XML-file version.

5.4.2.3

enum EConfVisibility [inherited]

Recommended visibility of an GenICam node.


Enumerator:
Beginner Always visible.
Expert Visible for experts or Gurus.
Guru Visible for Gurus.
Invisible Not Visible.
_UndefinedVisibility Object is not yet initialized.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

162

Module Documentation

5.4.2.4

enum EConfNodeType [inherited]

The GenICam interface node type of a specific node.


Enumerator:
UnknowNodeType Unknown node type.
INode INode node (all nodes are derived from this type).
ICategory ICategory node. Represent the Category grouping node type.
IInteger IInteger node. An 64-bit integer type.
IEnumeration IEnumeration node. Enumeration type.
IEnumEntry IEnumEntry node. Enumeration entry type that contains the value of an emumeration.
IMaskedIntReg IMaskedIntReg node. Masked integer register node.
IRegister IRegister node. Register node.
IIntReg IIntReg node. Integer register node.
IFloat IFloat node. Floating point node.
IFloatReg IFloatReg node. Floating point register node.
ISwissKnife ISwissKnife node. Special node used for doing calculations and conversions.
IIntSwissKnife IIntSwissKnife node. Special node used for doing integer calculations and conversions.
IIntKey IIntKey node. Integer key node.
ITextDesc ITextDesc node. Text description node.
IPort IPort node. Generic port node.
IConfRom IConfRom node. Configuration node.
IAdvFeatureLock IAdvFeatureLock node. Advanced feature lock node.
ISmartFeature ISmartFeature node. Smart feature node.
IStringReg IStringReg node. String register node.
IBoolean IBoolean node. Boolean node.
ICommand ICommand node. Command node that can execute a predefined command.
IConverter IConverter node. Special node used for conversion.
IIntConverter IIntConverter node. Special node used for integer conversion.
IChunkPort IChunkPort node.
INodeMap INodeMap node.
INodeMapDyn INodeMapDyn node.
IDeviceInfo IDeviceInfo node.
ISelector ISelector node.
IPortConstruct IPortConstruct node.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.4 Camera specific functions


5.4.2.5

enum EConfAccessMode [inherited]

Access mode of a GenICam node.


Enumerator:
NI Not implemented access mode.
NA Not available access mode.
WO Write Only access mode.
RO Read Only access mode.
RW Read and Write access mode.
_UndefinedAccesMode Object is not yet initialized.

5.4.2.6

enum EConfNameSpace [inherited]

Defines if a node name is standard or custom namespace.


Enumerator:
Custom Name resides in custom namespace.
Standard Name resides in one of the standard namespaces.
_UndefinedNameSpace Object is not yet initialized.

5.4.2.7

enum EConfCachingMode [inherited]

Caching mode of a GenICam register node.


Enumerator:
NoCache Do not use cache.
WriteThrough Write to cache and register.
WriteAround Write to register, write to cache on read.
_UndefinedCachingMode Not yet initialized.

5.4.2.8

enum EConfRepresentation [inherited]

Defines the node representaion in the GUI.


Enumerator:
Linear Linear.
Logarithmic Logarithmic.
Boolean Boolean.
PureNumber Pure number.
HexNumber Hex number.
IPV4Address IP version 4 address (like 192.169.1.2).
MACAddress MAC address (aa:bb:cc:dd:ee:ff).
_UndefinedRepresentation Object is not yet initialized.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

163

164

Module Documentation

5.4.2.9

enum EDisplayNotation [inherited]

Defines the IFloat Display Notation in the GUI.


Enumerator:
Automatic Automatic (the notation if either scientific or fixed depending on what is shorter).
Fixed Fixed (the notation is fixed, e.g. 123.4).
Scientific Scientific (the notation is scientific, e.g. 1.234e2).
_UndefinedEDisplayNotation Object is not yet initialized.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.5 Camera connection functions

5.5

165

Camera connection functions

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.

static Jai_FactoryWrapper.EFactoryError J_Camera_Close (CAMERA_HANDLE CameraHandle)


Close the camera connection.

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

static Jai_FactoryWrapper.EFactoryError J_Camera_Open (FACTORY_HANDLE


FactoryHandle, String CameraID, out CAMERA_HANDLE CameraHandle)
[inherited]

Open a camera 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.
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

166

Module Documentation

5.5.2.2

static Jai_FactoryWrapper.EFactoryError J_Camera_OpenMc (FACTORY_HANDLE


FactoryHandle, String CameraID, out CAMERA_HANDLE CameraHandle,
EDeviceAccessFlags OpenFlags, UInt32 McIP) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Camera_Close (CAMERA_HANDLE


CameraHandle) [inherited]

Close the camera connection.


See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
Parameters:
CameraHandle A valid camera handle
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.6 Direct GenICam node value access functions

5.6

167

Direct GenICam node value access functions

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.

static Jai_FactoryWrapper.EFactoryError J_Camera_SetValueInt64 (CAMERA_HANDLE CameraHandle, String NodeName, Int64 Value)


Set the value of a GenICam feature node as Int64 type.

static Jai_FactoryWrapper.EFactoryError J_Camera_SetValueDouble (CAMERA_HANDLE CameraHandle, String NodeName, double Value)


Set the value of a GenICam feature node as double type.

static Jai_FactoryWrapper.EFactoryError J_Camera_SetValueString (CAMERA_HANDLE CameraHandle, String NodeName, String ValueStr)


Set node value as a String.

static Jai_FactoryWrapper.EFactoryError J_Camera_ExecuteCommand (CAMERA_HANDLE


CameraHandle, String NodeName)
Execute the GenICam command.

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

static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueInt64


(CAMERA_HANDLE CameraHandle, String NodeName, ref Int64 Value)
[inherited]

Get the value of a GenICam feature node as Int64 type.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

168

Module Documentation

The node type has to be one of the following node types:


EConfNodeType.IInteger
EConfNodeType.IMaskedIntReg
EConfNodeType.IIntReg
EConfNodeType.IIntSwissKnife
EConfNodeType.IIntKey
EConfNodeType.IIntConverter
Parameters:
CameraHandle A valid camera handle
NodeName The name of the node requested
Value Reference to a Int64 variable to receive the value of the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.6.2.2

static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueDouble


(CAMERA_HANDLE CameraHandle, String NodeName, ref double Value)
[inherited]

Get the value of a GenICam feature node as double type.


The node type has to be one of the following node types:
EConfNodeType.IFloat
EConfNodeType.IFloatReg
EConfNodeType.ISwissKnife
EConfNodeType.IConverter
Parameters:
CameraHandle A valid camera handle
NodeName The name of the node requested
Value Reference to a double variable to receive the value of the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.6.2.3

static Jai_FactoryWrapper.EFactoryError J_Camera_GetValueString


(CAMERA_HANDLE CameraHandle, String NodeName, StringBuilder ValueStr, ref
UInt32 SizeValueStr) [inherited]

Get the value of a GenICam feature node as String type.


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:
CameraHandle A valid camera handle
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.6 Direct GenICam node value access functions

169

NodeName The name of the node requested


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

5.6.2.4

static Jai_FactoryWrapper.EFactoryError J_Camera_SetValueInt64


(CAMERA_HANDLE CameraHandle, String NodeName, Int64 Value) [inherited]

Set the value of a GenICam feature node as Int64 type.


The node type has to be one of the following node types:
EConfNodeType.IInteger
EConfNodeType.IMaskedIntReg
EConfNodeType.IIntReg
EConfNodeType.IIntSwissKnife
EConfNodeType.IIntKey
EConfNodeType.IIntConverter
Parameters:
CameraHandle A valid camera handle
NodeName The name of the node requested
Value The new value to be set in the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.6.2.5

static Jai_FactoryWrapper.EFactoryError J_Camera_SetValueDouble


(CAMERA_HANDLE CameraHandle, String NodeName, double Value) [inherited]

Set the value of a GenICam feature node as double type.


The node type has to be one of the following node types:
EConfNodeType.IFloat
EConfNodeType.IFloatReg
EConfNodeType.ISwissKnife
EConfNodeType.IConverter
Parameters:
CameraHandle A valid camera handle
NodeName The name of the node requested
Value The new value to be set in the node
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

170

Module Documentation

5.6.2.6

static Jai_FactoryWrapper.EFactoryError J_Camera_SetValueString


(CAMERA_HANDLE CameraHandle, String NodeName, String ValueStr)
[inherited]

Set node value as a String.


The camera needs to be opened using J_Camera_Open() before the value can be set The node type can
be any type. The value will automatically be converted internally in the factory
Parameters:
CameraHandle A valid camera handle
NodeName The name of the node requested
ValueStr The new value to be set in the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.6.2.7

static Jai_FactoryWrapper.EFactoryError J_Camera_ExecuteCommand


(CAMERA_HANDLE CameraHandle, String NodeName) [inherited]

Execute the GenICam command.


Parameters:
CameraHandle A valid camera handle
NodeName The name of the EConfNodeType.ICommand GenICam node
Returns:

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.7 Direct register access functions

5.7

171

Direct register access functions

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

static Jai_FactoryWrapper.EFactoryError J_Camera_ReadData (CAMERA_HANDLE


CameraHandle, Int64 Address, IntPtr Data, ref UInt32 Size) [inherited]

Read data directly from the camera.


The camera needs to be opened using J_Camera_Open() before read and write operations can be performed
// C# Sample reads directly from memory
EFactoryError error = EFactoryError.Success;
// Allocate managed buffer to hold answer
byte[] buffer = new byte[4];
// Allocate a handle to the buffer and lock the memory so the unmanag
ed function can write the data
GCHandle gch = GCHandle.Alloc(buffer, GCHandleType.Pinned);
// Get the pointer to the data
IntPtr bufferPtr = gch.AddrOfPinnedObject();
// Read the data bytes
uint size = 4;
error = J_Camera_ReadData(cameraHandle, 0xa410, bufferPtr, ref size);

// Release the pinned data


gch.Free();

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

static Jai_FactoryWrapper.EFactoryError J_Camera_WriteData (CAMERA_HANDLE


CameraHandle, Int64 Address, byte[ ] Data, ref UInt32 Size) [inherited]

Write data directly to the camera.


The camera needs to be opened using J_Camera_Open() before read and write operations can be performed
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
Parameters:
CameraHandle A valide camera handle
Address The address to be written to
Data A buffer with the data to be written
Size The size of data that is written to the device
Returns:
Jai_FactoryWrapper.EFactoryError

5.7.2.3

static Jai_FactoryWrapper.EFactoryError J_Camera_WriteData (CAMERA_HANDLE


CameraHandle, Int64 Address, IntPtr Data, ref UInt32 Size) [inherited]

Write data directly to the camera.


The camera needs to be opened using J_Camera_Open() before read and write operations can be performed
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
Parameters:
CameraHandle A valide camera handle
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.7 Direct register access functions


Address The address to be written to
Data A pointer to a buffer containing the data
Size The size of data that is written to the device
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

173

174

Module Documentation

5.8

Configuration information function

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

static Jai_FactoryWrapper.EFactoryError J_Camera_GetConfigInfo


(CAMERA_HANDLE CameraHandle, EConfInfoType InfoType, StringBuilder
InfoString, ref UInt32 Size) [inherited]

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 GenICam Feature Node access functions

5.9

175

GenICam Feature Node access functions

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().

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNodeByName (CAMERA_HANDLE


CameraHandle, String NodeName, out NODE_HANDLE NodeHandle)
Get node by the GenICam node name.

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNumOfSubFeatures (CAMERA_HANDLE


CameraHandle, String ParentNodeName, ref UInt32 NumOfSubFeatures)
Get the number of sub feature nodes in the given node map tree specified by a parent node name.

static Jai_FactoryWrapper.EFactoryError J_Camera_GetSubFeatureByIndex (CAMERA_HANDLE


CameraHandle, String ParentNodeName, UInt32 Index, out NODE_HANDLE NodeHandle)
Get feature node by the index.

static Jai_FactoryWrapper.EFactoryError J_Camera_GetFeatureByName (CAMERA_HANDLE


CameraHandle, String FeatureNodeName, out NODE_HANDLE NodeHandle)
Get feature node by the name.

static Jai_FactoryWrapper.EFactoryError J_Camera_InvalidateNodes (CAMERA_HANDLE CameraHandle)


Invalidates all GenICam nodes.

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

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNumOfNodes


(CAMERA_HANDLE CameraHandle, ref UInt32 NumOfNodes) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNodeByIndex


(CAMERA_HANDLE CameraHandle, UInt32 Index, out NODE_HANDLE NodeHandle)
[inherited]

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

5.9 GenICam Feature Node access functions

177

for (int index = 0; index <NumOfNodes; index++)


{
IntPtr nodeHandle;
error = J_Camera_GetNodeByIndex(cameraHandle, index, out nodeHand
le);
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());
}
}
}
}

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

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNodeByName


(CAMERA_HANDLE CameraHandle, String NodeName, out NODE_HANDLE
NodeHandle) [inherited]

Get node by the GenICam node name.


The camera needs to be opened using J_Camera_Open() before the nodes can be opened
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
Parameters:
CameraHandle A valid handle to a camera
NodeName The name of the node requested
NodeHandle The handle to the node
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

178

Module Documentation

5.9.2.4

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNumOfSubFeatures


(CAMERA_HANDLE CameraHandle, String ParentNodeName, ref UInt32
NumOfSubFeatures) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Camera_GetSubFeatureByIndex


(CAMERA_HANDLE CameraHandle, String ParentNodeName, UInt32 Index, out
NODE_HANDLE NodeHandle) [inherited]

Get feature node by the index.


The camera needs to be opened using J_Camera_Open() before the sub feature nodes can be opened
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.9 GenICam Feature Node access functions

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

static Jai_FactoryWrapper.EFactoryError J_Camera_GetFeatureByName


(CAMERA_HANDLE CameraHandle, String FeatureNodeName, out NODE_HANDLE
NodeHandle) [inherited]

Get feature node by the name.


The camera needs to be opened using J_Camera_Open() before the feature nodes can be opened
See also:
J_Camera_Open(FACTORY_HANDLE,
String,
out
CAMERA_HANDLE),
GetName(NODE_HANDLE, StringBuilder, ref UInt32, UInt32)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_Camera_InvalidateNodes


(CAMERA_HANDLE CameraHandle) [inherited]

Invalidates all GenICam nodes.


The camera needs to be opened using J_Camera_Open() before the feature nodes can be opened
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
Parameters:
CameraHandle A handle to a camera device
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.10 Image Data Stream access functions

5.10

181

Image Data Stream access functions

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_-

Get the number of available Data Streams from the Camera.

static Jai_FactoryWrapper.EFactoryError J_Camera_CreateDataStream (CAMERA_HANDLE


CameraHandle, UInt32 Channel, out DATASTREAM_HANDLE DSHandle)
Create and open data stream channel to the camera.

static Jai_FactoryWrapper.EFactoryError J_Camera_CreateDataStreamMc (CAMERA_HANDLE


CameraHandle, UInt32 Channel, out DATASTREAM_HANDLE DSHandle, UInt32 McIP)
Create and open data stream channel to the camera.

delegate void ImageCallBack (ref ImageInfo ImageInfo)


Delegate to be called as callback function when a new image has been received.

delegate
void
ConnectionStatusCallBack
(CCamera
FactoryWrapper.EDeviceConnectionType connectionStatus)

camera,

Jai_-

Delegate to be called as callback function when a new image has been received.

delegate void GEVEventCallBack (CCamera camera, UInt16 EventID, UInt16 StreamChannelIndex,


UInt16 BlockID, UInt64 Timestamp, byte[ ] EventData)
Delegate to be called as callback function when a new GigE Vision Event has been received.

delegate void NodeEventCallBack (CNode node)


Delegate to be called as callback function when a new Node Event 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

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNumOfDataStreams


(CAMERA_HANDLE CameraHandle, ref UInt32 NumOfDataStreams) [inherited]

Get the number of available Data Streams from the Camera.


The camera needs to be opened using J_Camera_Open() before the number of data streams can be
read. The number of data streams are used to check the available data streams so the stream channel index
used in J_Camera_CreateDataStream() is within leagal range.
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_Camera_CreateDataStream


(CAMERA_HANDLE CameraHandle, UInt32 Channel, out DATASTREAM_HANDLE
DSHandle) [inherited]

Create and open data stream channel to the camera.


The camera needs to be opened using J_Camera_Open() before the data stream can be created.
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
private Boolean CreateStreamThread(UInt32 Channel, UInt32 BufferSize)
{
// Is it already created?
if (m_streamThread != null)
return false;
// Open the stream channel(GVSP)
if (StreamHandle == IntPtr.Zero)
{
if (EFactoryError.Success != J_Camera_CreateDataStream(CameraHand
le, Channel, out StreamHandle))
{
return false;
}
}
// Prepare the frame buffers (this announces the buffers to the acq
uisition engine)
if (0 == PrepareBuffer(BufferSize))
{
J_DataStream_Close(StreamHandle);
return false;
}
// Stream thread event created?
if (StreamEvent == null)
StreamEvent = new AutoResetEvent(false);
else
StreamEvent.Reset();
// Create a Stream Thread.
w = new Work();
w.DataStreamHandle = StreamHandle;
w.EnableThread = true;
w.camera = this;
ThreadStart threadDelegate = new ThreadStart(w.StreamThread);
m_streamThread = new Thread(threadDelegate);
if (m_streamThread != null)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.10 Image Data Stream access functions

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

static Jai_FactoryWrapper.EFactoryError J_Camera_CreateDataStreamMc


(CAMERA_HANDLE CameraHandle, UInt32 Channel, out DATASTREAM_HANDLE
DSHandle, UInt32 McIP) [inherited]

Create and open data stream channel to the camera.


The camera needs to be opened using J_Camera_Open() before the data stream can be created
See also:
J_Camera_Open(FACTORY_HANDLE, String, out CAMERA_HANDLE)
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
McIP Multicast IP address. It will be ignored if it is 0
Returns:
Jai_FactoryWrapper.EFactoryError

5.10.2.4

delegate void ImageCallBack (ref ImageInfo ImageInfo) [inherited]

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 void ConnectionStatusCallBack (CCamera camera,


Jai_FactoryWrapper.EDeviceConnectionType connectionStatus) [inherited]

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 void GEVEventCallBack (CCamera camera, UInt16 EventID, UInt16


StreamChannelIndex, UInt16 BlockID, UInt64 Timestamp, byte[ ] EventData)
[inherited]

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 void NodeEventCallBack (CNode node) [inherited]

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 Save or Load Setting functions

5.11

185

Save or Load Setting functions

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().

enum ELoadSettingsFlag { Auto, ValidateOnly, ForceWrite }


Defines the Load Settings flags used in J_Camera_LoadSettings().

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_LoadSettings (CAMERA_HANDLE CameraHandle, String SettingsFileName, ELoadSettingsFlag LoadFlag)


Load camera settings from disk and either validate or send the the settings to the connected camera.

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

Enumeration Type Documentation

5.11.2.1

enum ESaveSettingsFlag [inherited]

Defines the Save Settings flags used in J_Camera_SaveSettings().


Enumerator:
Auto Auto: Save all camera settings to disk. If the usage of the GenICam Streamable flags is detected
then it will be used. Otherwise all features that are both Readable and Writable will be saved.
StreamableOnly Streamable Only: Force the persistence algorithm to use the GenICam Streamable
flag. All features that have the Streamable flag set and are both Readable and Writable will be
saved.
ForceAll Force All: Force the persistence algorithm to ignore the GenICam Streamable flag and save
all features that are both Readable and Writable.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

186

Module Documentation

5.11.2.2

enum ELoadSettingsFlag [inherited]

Defines the Load Settings flags used in J_Camera_LoadSettings().


Enumerator:
Auto Auto: Load all camera settings from disk and validate the settings before writing the values to
the camera. If the validation fails then a detailed validation error information will be available
using the J_Camera_GetSettingsValidationErrorInfo() function. If a validation
error is detected then the writing to the camera will be aborted.
ValidateOnly Validate Only: Load all camera settings from disk and validate the settings. The values
will not be written to the camera. If the validation fails then a detailed validation error information will be available using the J_Camera_GetSettingsValidationErrorInfo()
function.
ForceWrite Force Write: Force all the settings to be written to the camera without validating the
feature names or the values.

5.11.3

Function Documentation

5.11.3.1

static Jai_FactoryWrapper.EFactoryError J_Camera_SaveSettings


(CAMERA_HANDLE CameraHandle, String SettingsFileName, ESaveSettingsFlag
SaveFlag) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Camera_LoadSettings


(CAMERA_HANDLE CameraHandle, String SettingsFileName, ELoadSettingsFlag
LoadFlag) [inherited]

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

5.11 Save or Load Setting functions


5.11.3.3

187

static Jai_FactoryWrapper.EFactoryError J_Camera_GetSettingsValidationErrorInfo


(CAMERA_HANDLE CameraHandle, StringBuilder ErrorInfoBuffer, ref UInt32 Size)
[inherited]

Get Camera Settings Validation error information.


Parameters:
CameraHandle Handle to a valid camera object, obtained by J_Camera_Open() function.
ErrorInfoBuffer Buffer where the detailed validation information will be returned.
Size Pointer to a variable that contains the size of the user allocated buffer. If the size is set to 0 by
the user application then this function will return the size required to hold the complete error
information string. If the size is set to non-zero then it will be updated with the actual size of the
string returned in ErrorInfoBuffer
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

188

Module Documentation

5.12

Data Stream specific functions

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 EAcqStartFlags { NONE = 0, NEXT_IMAGE = 0x1, LAST_IMAGE = 0x2, NEW_IMAGE


= 0x3 }
The EAcqStartFlags are used to control the start of image acquisition using J_DataStream_StartAcquisition().

enum EAcqStopFlags { NONE = 0, KILL = 1 }


The EAcqStopFlags are used to control the stop of image acquisition using J_DataStream_StopAcquisition().

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

5.12 Data Stream specific functions

189

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().

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.

static Jai_FactoryWrapper.EFactoryError J_DataStream_FlushQueue (DATASTREAM_HANDLE


DSHandle, EAcqQueueType QueueType)
Flush Queues.

static Jai_FactoryWrapper.EFactoryError J_DataStream_StartAcquisition


HANDLE DSHandle, EAcqStartFlags Flags, UInt64 NumImages)

(DATASTREAM_-

Start the image acquisition on the stream channel.

static Jai_FactoryWrapper.EFactoryError J_DataStream_StopAcquisition


HANDLE DSHandle, EAcqStopFlags Flags)

(DATASTREAM_-

Stop the image acquisition on the stream channel.

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 J_DataStream_GetBufferID (DATASTREAM_HANDLE


DSHandle, UInt32 Index, out BUFFER_HANDLE BufferHandle)
Get the buffer handle by index.

static Jai_FactoryWrapper.EFactoryError
DSHandle)

J_DataStream_Close

(DATASTREAM_HANDLE

Close the data stream.

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_QueueBuffer (DATASTREAM_HANDLE


DSHandle, BUFFER_HANDLE BufferHandle)
Queue the buffer in the acquisition engine.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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.

static Jai_FactoryWrapper.EFactoryError J_DataStream_GetParam (DATASTREAM_HANDLE


DSHandle, EDataStreamParamCmd Cmd, ref StreamParameterStruct StreamParameter, ref UInt32
Size)
Get parameters for the data stream.

static Jai_FactoryWrapper.EFactoryError J_DataStream_SetParam (DATASTREAM_HANDLE


DSHandle, EDataStreamParamCmd Cmd, ref StreamParameterStruct StreamParameter, ref UInt32
Size)
Set parameters for the data stream.

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

5.12 Data Stream specific functions

191

DataStream_FlushQueue() and the calling J_DataStream_RevokeBuffer() for each


buffer.
7) The allocated memory is now ready to be Freed

Please refer to the Stream Thread Sample application for more details!

5.12.2

Enumeration Type Documentation

5.12.2.1

enum EAcqQueueType [inherited]

The EAcqQueueType is used to select queue type to be flushed using J_DataStream_FlushQueue().


Enumerator:
INPUT_TO_OUTPUT Flush queue of frames, waiting for new data through the acquisition engine
to the output queue.
OUTPUT_DISCARD Flush queue of frames, containing new data, waiting to be delivered.

5.12.2.2

enum EAcqStartFlags [inherited]

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

enum EAcqStopFlags [inherited]

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

enum EBufferInfoCmd [inherited]

The EBufferInfoCmd is used to get buffer information using J_DataStream_GetBufferInfo().


Enumerator:
BASE Base address of delivered buffer (void ).
SIZE Size in Bytes (size_t).
USER_PTR Private Pointer (void ).
TIMESTAMP Timestamp (uint64_t).
NUMBER Buffer Number as announced (uint64_t).
NEW_DATA Flag if Buffer contains new data since it was queued.
ISQUEUED Is the buffer queued?
PAYLOADTYPE Payload Type from GigE Vision Stream Protocol.
PIXELTYPE Pixel Type from GigE Vision Stream Protocol.
WIDTH Width from GigE Vision Stream Protocol.
HEIGHT Height from GigE Vision Stream Protocol.
XOFFSET X Offset from GigE Vision Stream Protocol.
YOFFSET Y Offset from GigE Vision Stream Protocol.
XPADDING XPadding from GigE Vision Stream Protocol.
YPADDING YPadding from GigE Vision Stream Protocol.
NUM_PACKETS_MISSING Number of packets missing in the frame.
BLOCK_ID GigE Vision Stream Protocol Block-ID.

5.12.2.5

enum EStreamInfoCmd [inherited]

The EStreamInfoCmd is used to get acquisition information


GetStreamInfo() or J_Image_GetStreamInfo().

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

5.12 Data Stream specific functions

193

NUMBER_OF_FRAMES_AWAIT_DELIVERY This command inquire 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.
NUMBER_OF_FRAMES_CORRUPT_ON_DELIEVRY This command inquire 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().
CUSTOM_INFO

5.12.2.6

enum EDataStreamParamCmd [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_DataStream_AnnounceBuffer


(DATASTREAM_HANDLE DSHandle, IntPtr Buffer, UInt32 BufferSize, IntPtr
PrivateData, out BUFFER_HANDLE BufferHandle) [inherited]

Announce buffer pointer for the acquisition engine.


The data stream needs to be created using J_Camera_CreateDataStream() before buffers can be
announced.
private List<GCHandle> AquBufferList = new List<GCHandle>();
ffers allocated to hold image data
private List<IntPtr> AquBufferIDList = new List<IntPtr>();
ndles for all the image buffers

// 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

static Jai_FactoryWrapper.EFactoryError J_DataStream_FlushQueue


(DATASTREAM_HANDLE DSHandle, EAcqQueueType QueueType) [inherited]

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

5.12 Data Stream specific functions


private List<GCHandle> AquBufferList = new List<GCHandle>();
ffers allocated to hold image data
private List<IntPtr> AquBufferIDList = new List<IntPtr>();
ndles for all the image buffers

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

static Jai_FactoryWrapper.EFactoryError J_DataStream_StartAcquisition


(DATASTREAM_HANDLE DSHandle, EAcqStartFlags Flags, UInt64 NumImages)
[inherited]

Start the image acquisition on the stream channel.


The data stream needs to be created using J_Camera_CreateDataStream() and buffers needs to be
announced using J_DataStream_AnnounceBuffer() before acquisition can be started.
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.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_DataStream_StopAcquisition


(DATASTREAM_HANDLE DSHandle, EAcqStopFlags Flags) [inherited]

Stop the image acquisition on the stream channel.


//==============================================================////
// Terminate Stream Thread
//==============================================================////
Boolean TerminateStreamThread()
{
// Is the data stream opened?
if (StreamHandle == IntPtr.Zero)
return false;
// Reset the thread execution flag.
w.EnableThread = false;
// Signal the image thread to stop faster
J_Event_ExitCondition(NewImageCondition);
// Stop the image acquisition engine
J_DataStream_StopAcquisition(StreamHandle, Jai_FactoryWrapper.EAcqS
topFlags.KILL);
// Wait for the thread to end
StreamEvent.WaitOne();
// UnPrepare Buffers (this removed the buffers from the acquisition
engine and frees buffers)
UnPrepareBuffer();
// Close Stream
if (StreamHandle != IntPtr.Zero)
{
Jai_FactoryWrapper.J_DataStream_Close(StreamHandle);
StreamHandle = IntPtr.Zero;
}
m_streamThread = null;
return true;
}

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

5.12 Data Stream specific functions

197

Returns:
Jai_FactoryWrapper.EFactoryError

5.12.3.5

static Jai_FactoryWrapper.EFactoryError J_DataStream_GetStreamInfo


(DATASTREAM_HANDLE DSHandle, EStreamInfoCmd Cmd, ref StreamInfoStruct
Info, ref UInt32 Size) [inherited]

Get detailed information about a data stream.


Parameters:
DSHandle Handle to a valid data stream object, obtained by J_Camera_CreateDataStream()
function.
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

5.12.3.6

static Jai_FactoryWrapper.EFactoryError J_DataStream_GetBufferID


(DATASTREAM_HANDLE DSHandle, UInt32 Index, out BUFFER_HANDLE
BufferHandle) [inherited]

Get the buffer handle by index.


Parameters:
DSHandle Handle to a valid data stream, obtained by J_Camera_CreateDataStream() function.
Index Zero based index for the buffer.
BufferHandle Variable in which the buffer handle is stored.
Returns:
Jai_FactoryWrapper.EFactoryError

5.12.3.7

static Jai_FactoryWrapper.EFactoryError J_DataStream_Close


(DATASTREAM_HANDLE DSHandle) [inherited]

Close the data stream.


//==============================================================////
// Terminate Stream Thread
//==============================================================////
Boolean TerminateStreamThread()
{
// Is the data stream opened?
if (StreamHandle == IntPtr.Zero)
return false;
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

198

Module Documentation

// Reset the thread execution flag.


w.EnableThread = false;
// Signal the image thread to stop faster
J_Event_ExitCondition(NewImageCondition);
// Stop the image acquisition engine
J_DataStream_StopAcquisition(StreamHandle, EAcqStopFlags.KILL);
// Wait for the thread to end
StreamEvent.WaitOne();
// UnPrepare Buffers (this removed the buffers from the acquisition
engine and frees buffers)
UnPrepareBuffer();
// Close Stream
if (StreamHandle != IntPtr.Zero)
{
J_DataStream_Close(StreamHandle);
StreamHandle = IntPtr.Zero;
}
m_streamThread = null;
return true;
}

Parameters:
DSHandle Handle to a valid data stream, obtained by J_Camera_CreateDataStream() function.
Returns:
Jai_FactoryWrapper.EFactoryError

5.12.3.8

static Jai_FactoryWrapper.EFactoryError J_DataStream_RevokeBuffer


(DATASTREAM_HANDLE DSHandle, BUFFER_HANDLE BufferHandle, ref IntPtr
BufferPtr, ref IntPtr PrivateDataPtr) [inherited]

Remove the frame buffer from the Acquisition engine.


//==============================================================////
// Unprepare buffers
//==============================================================////
BOOL CStreamThread::UnPrepareBuffers(void)
{
void
*pPrivate;
void
*pBuffer;
uint32_t i;
// Flush Queues
J_DataStream_FlushQueue(m_hDS, ACQ_QUEUE_INPUT_TO_OUTPUT);
J_DataStream_FlushQueue(m_hDS, ACQ_QUEUE_OUTPUT_DISCARD);
for(i = 0 ; i < m_iValidBuffers ; i++)
{
// Remove the frame buffer from the Acquisition engine.
J_DataStream_RevokeBuffer(m_hDS, m_pAquBufferID[i], &pBuffer , &p
Private);

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.12 Data Stream specific functions

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

static Jai_FactoryWrapper.EFactoryError J_DataStream_QueueBuffer


(DATASTREAM_HANDLE DSHandle, BUFFER_HANDLE BufferHandle)
[inherited]

Queue the buffer in the acquisition engine.


The buffers needs to be announced using J_DataStream_AnnounceBuffer() before they can be
queued.
//==============================================================////
// Prepare frame buffers
//==============================================================////
Int32 PrepareBuffer(UInt32 BufferSize, UInt32 BufferCount)
{
if (m_iValidBuffers != 0)
return m_iValidBuffers;
for (int i = 0; i < (int)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, IntPtr.Zero, out BufferHandle))
{
gch.Free();
break;
}
// Queueing it.
if (EFactoryError.Success != J_DataStream_QueueBuffer(StreamHandl
e, BufferHandle))
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_DataStream_GetBufferInfo


(DATASTREAM_HANDLE DSHandle, BUFFER_HANDLE BufferHandle,
EBufferInfoCmd Cmd, ref BufferInfoStruct BufferInfo, ref UInt32 Size)
[inherited]

Get detailed information about a buffer.


// 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();
ECondWaitResult WaitResult = ECondWaitResult.WaitError;
DeviceEventData EventData = new DeviceEventData();
if (NewImageCondition == IntPtr.Zero)
retsta = J_Event_CreateCondition(ref NewImageCondition);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.12 Data Stream specific functions

201

IntPtr hDeviceEvent; // Buffer event handle


// Register the event with the acquisition engine
retsta = J_DataStream_RegisterEvent(DataStreamHandle,
EDeviceEventType.NEW_BUFFER,
NewImageCondition,
out hDeviceEvent);
// Start image acquisition
retsta = J_DataStream_StartAcquisition(DataStreamHandle,
camera._AcquisitionStartFl
ag,
0);
AcquisitionStarted = true;
while (EnableThread)
{
// Wait for Buffer event (or kill event)
retsta = J_Event_WaitForCondition(NewImageCondition, 1000, ref
WaitResult);
if (retsta == EFactoryError.Success)
{
// Did we get a new buffer event?
if (WaitResult == ECondWaitResult.WaitSignal)
{
// Are we capturing specific count?
if (AcquisitionCount != 0)
{
iFrameCounter++;
// Did we capture all frames we need?
if (iFrameCounter >= AcquisitionCount)
{
// Stop any further images from being sent
camera.StopAcquisition();
}
}
// 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)
{
// Fill in structure for image display
// Get the pointer to the frame buffer.
iSize = (uint)Marshal.SizeOf(BufferInfo.Base);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.BASE,
ref BufferInfo,
ref iSize);
ImageInfo.ImageBuffer = BufferInfo.Base;
// Get Timestamp.
iSize = (uint)Marshal.SizeOf(BufferInfo.TimeStamp);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.TIMEST
AMP,
ref BufferInfo,

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

5.12 Data Stream specific functions

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

static Jai_FactoryWrapper.EFactoryError J_DataStream_GetParam


(DATASTREAM_HANDLE DSHandle, EDataStreamParamCmd Cmd, ref
StreamParameterStruct StreamParameter, ref UInt32 Size) [inherited]

Get parameters for the data stream.


// This small piece of code demonstrate how to get a stream channel p
arameter using J_DataStream_GetParam()
public bool IsResendEnabled(void)
{
Jai_FactoryWrapper.EFactoryError retsta;
bool bCanResend = false;
Jai_FactoryWrapper.StreamParameterStruct StreamParameter = new Jai_
FactoryWrapper.StreamParameterStruct();
uint Size = sizeof(uint);
retsta = Jai_FactoryWrapper.J_DataStream_GetParam(StreamHandle, Jai
_FactoryWrapper.EDataStreamParamCmd.CanResend, ref StreamParameter, ref Size);
if (StreamParameter.CanResend != 0)
bCanResend = true;
else
bCanResend = false;
bCanResend retsta;
}

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

5.12 Data Stream specific functions

205

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

5.12.3.12

static Jai_FactoryWrapper.EFactoryError J_DataStream_SetParam


(DATASTREAM_HANDLE DSHandle, EDataStreamParamCmd Cmd, ref
StreamParameterStruct StreamParameter, ref UInt32 Size) [inherited]

Set parameters for the data stream.


// This small piece of code demonstrate how to set a stream channel p
arameter using J_DataStream_SetParam()
public Jai_FactoryWrapper.EFactoryError EnableResend(bool EnablePacke
tResend)
{
Jai_FactoryWrapper.EFactoryError retsta;
Jai_FactoryWrapper.StreamParameterStruct StreamParameter = new Jai_
FactoryWrapper.StreamParameterStruct();
if (EnablePacketResend)
StreamParameter.CanResend = 1;
else
StreamParameter.CanResend = 0;
uint Size = sizeof(uint);
retsta = Jai_FactoryWrapper.J_DataStream_SetParam(StreamHandle, Jai
_FactoryWrapper.EDataStreamParamCmd.CanResend, ref StreamParameter, ref Size);
return retsta;
}

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

Event Interface functions

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.

Data Stream event specific functions


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().

Condition specific functions


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.

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

5.13 Event Interface functions

207

The EDeviceEventType is used to specify which type of event to register with the Transport Layer.

enum EDeviceConnectionType { Connected, Disconnected, LostControl }


The EDeviceConnectionType is used to report changes in connection state.

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.

static Jai_FactoryWrapper.EFactoryError J_Event_GetInfo (EVT_HANDLE


EEventInfoID EventInfoID, out EventInfoData EventInfo, ref UInt32 Size)

EventHandle,

Retrieve event information.

static Jai_FactoryWrapper.EFactoryError J_Event_Flush (EVT_HANDLE EventHandle)


Flush all Event currently in the queue.

static Jai_FactoryWrapper.EFactoryError J_Event_Close (EVT_HANDLE EventHandle)


Close Event.

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

Enumeration Type Documentation

5.13.2.1

enum EEventInfoID [inherited]

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

enum EDeviceEventType [inherited]

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

enum EDeviceConnectionType [inherited]

The EDeviceConnectionType is used to report changes in connection state.


Enumerator:
Connected Camera is connected.
Disconnected Camera is disconnected.
LostControl The camera timed out internally and we lost control access. We cannot control the
camera before re-acquiring control again.

5.13.2.4

enum ECondWaitResult [inherited]

The ECondWaitResult is wait result type returned in J_Event_WaitForCondition().


Enumerator:
WaitTimeout J_Event_WaitForCondition() timed out
WaitSignal J_Event_WaitForCondition()
got
signaled
using
J_Event_SignalCondition() or J_Event_WaitForMultipleConditions() got signaled
on Condition 0 using J_Event_SignalCondition()
WaitExit J_Event_WaitForCondition()
got
signaled
using
J_Event_ExitCondition() or J_Event_WaitForCondition() got signaled on Condition 0
using J_Event_ExitCondition()
WaitSignal1 J_Event_WaitForMultipleConditions() got signaled on Condition 1 using
J_Event_SignalCondition()
WaitExit1 J_Event_WaitForMultipleConditions() got signaled on Condition 1 using
J_Event_ExitCondition()
WaitSignal2 J_Event_WaitForMultipleConditions() got signaled on Condition 2 using
J_Event_SignalCondition()
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.13 Event Interface functions

209

WaitExit2 J_Event_WaitForMultipleConditions() got signaled on Condition 2 using


J_Event_ExitCondition()
WaitSignal3 J_Event_WaitForMultipleConditions() got signaled on Condition 3 using
J_Event_SignalCondition() </summary
WaitExit3 J_Event_WaitForMultipleConditions() got signaled on Condition 3 using
J_Event_ExitCondition()
WaitSignal4 J_Event_WaitForMultipleConditions() got signaled on Condition 4 using
J_Event_SignalCondition()
WaitExit5 J_Event_WaitForMultipleConditions() got signaled on Condition 5 using
J_Event_ExitCondition()
WaitSignal6 J_Event_WaitForMultipleConditions() got signaled on Condition 6 using
J_Event_SignalCondition()
WaitExit6 J_Event_WaitForMultipleConditions() got signaled on Condition 6 using
J_Event_ExitCondition()
WaitSignal7 J_Event_WaitForMultipleConditions() got signaled on Condition 7 using
J_Event_SignalCondition()
WaitExit7 J_Event_WaitForMultipleConditions() got signaled on Condition 7 using
J_Event_ExitCondition()
WaitSignal8 J_Event_WaitForMultipleConditions() got signaled on Condition 8 using
J_Event_SignalCondition()
WaitExit8 J_Event_WaitForMultipleConditions() got signaled on Condition 8 using
J_Event_ExitCondition()
WaitSignal9 J_Event_WaitForMultipleConditions() got signaled on Condition 9 using
J_Event_SignalCondition()
WaitExit9 J_Event_WaitForMultipleConditions() got signaled on Condition 9 using
J_Event_ExitCondition()
WaitError Error
in
J_Event_WaitForCondition()
or
J_Event_WaitForMultipleConditions().

5.13.3

Function Documentation

5.13.3.1

static Jai_FactoryWrapper.EFactoryError J_Event_GetData (EVT_HANDLE


EventHandle, out DeviceEventData EventData, ref UInt32 Size) [inherited]

Retrieve the event data associated with the event.


The data type returned by this function will depend on the event type. If the event is of type
EDeviceEventType.NEW_BUFFER then this function will return the image buffer handle as described
by the DeviceEventData.NEW_BUFFER_BufferHandle structure value. If the event is of type
EDeviceEventType.GEV_EVENT_CMD then this function will return information about the GEV
command as described by the DeviceEventData.GEV_EVENT_CMD_xxx structure values.
See also:
J_Camera_RegisterEvent(CAMERA_HANDLE, EDeviceEventType, SafeWaitHandle, out EVT_HANDLE), J_DataStream_RegisterEvent(DATASTREAM_HANDLE, EDeviceEventType, SafeWaitHandle, out EVT_HANDLE)
Parameters:
EventHandle Internal event handle obtained by the J_Camera_RegisterEvent() or J_DataStream_RegisterEvent() functions.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

If no events are available in the event queue

static Jai_FactoryWrapper.EFactoryError J_Event_GetInfo (EVT_HANDLE


EventHandle, EEventInfoID EventInfoID, out EventInfoData EventInfo, ref UInt32 Size)
[inherited]

Retrieve event information.


See also:
J_Camera_RegisterEvent(CAMERA_HANDLE, EDeviceEventType, SafeWaitHandle, out EVT_HANDLE), J_DataStream_RegisterEvent(DATASTREAM_HANDLE, EDeviceEventType, SafeWaitHandle, out EVT_HANDLE)
Parameters:
EventHandle Internal event handle obtained by the J_Camera_RegisterEvent() or J_DataStream_RegisterEvent() functions.
EventInfoID Event information type to retrieve
EventInfo Reference to a EventInfoData structure in which the information is stored.
Size The size of the EventInfoData structure. The function sets the actual size of data stored into the
EventInfoData structure.
Returns:
Jai_FactoryWrapper.EFactoryError

5.13.3.3

static Jai_FactoryWrapper.EFactoryError J_Event_Flush (EVT_HANDLE EventHandle)


[inherited]

Flush all Event currently in the queue.


See also:
J_Camera_RegisterEvent(CAMERA_HANDLE, EDeviceEventType, SafeWaitHandle, out EVT_HANDLE), J_DataStream_RegisterEvent(DATASTREAM_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

5.13 Event Interface functions


5.13.3.4

211

static Jai_FactoryWrapper.EFactoryError J_Event_Close (EVT_HANDLE EventHandle)


[inherited]

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

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.

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.

static Jai_FactoryWrapper.EFactoryError J_Camera_UnRegisterEvent (CAMERA_HANDLE CameraHandle, EDeviceEventType EventType)


Un-register an event with the Transport Layer interface.

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

static Jai_FactoryWrapper.EFactoryError J_Camera_RegisterEvent


(CAMERA_HANDLE CameraHandle, EDeviceEventType EventType, SafeWaitHandle
WaitHandle, out EVT_HANDLE EventHandle) [inherited]

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;

//
//

// Camera Connection thread


public void StreamThread()
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.14 Camera event specific functions


{
UInt32 iSize;
int iWaitResult;
EFactoryError retsta;
DeviceEventData EventData = new DeviceEventData();
// Create event to be used by the Transport Layer to signal when
the Camera Connection state changes
AutoResetEvent ConnectionEvent = new AutoResetEvent(false);
// Make a WaitHandle list
WaitHandle[] waitHandles = { ConnectionEvent, KillEvent };
IntPtr hDeviceEvent; // Buffer event handle
// Register the event with the Transport Layer
retsta = J_Camera_RegisterEvent(camera.CameraHandle,
EDeviceEventType.CONNECTION,
ConnectionEvent.SafeWaitHandle,
out hDeviceEvent);
while (EnableThread)
{
// Wait for connection status event (or kill event)
iWaitResult = WaitHandle.WaitAny(waitHandles, 1000, false);
// Did we get a connection status event?
if (iWaitResult == 0)
{
// Get the data associated with the event
iSize = (uint)Marshal.SizeOf(typeof(DeviceEventData));
retsta = J_Event_GetData(hDeviceEvent, out EventData, ref iSi
ze);
if (retsta == EFactoryError.Success)
{
camera.CurrentConnectionStatus = EventData.CONNECTION_Statu
s;
if (EnableThread)
{
if (camera != null)
camera.HandleConnection(camera.CurrentConnectionStatus);
}
}
}
}
// Unregister the Camera Connection event
retsta = J_Camera_UnRegisterEvent(camera.CameraHandle,
EDeviceEventType.CONNECTION);
// Free the event object
if (hDeviceEvent != null)
{
J_Event_Close(hDeviceEvent);
hDeviceEvent = IntPtr.Zero;
}
}
}

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

static Jai_FactoryWrapper.EFactoryError J_Camera_RegisterEvent


(CAMERA_HANDLE CameraHandle, EDeviceEventType EventType, COND_HANDLE
ConditionHandle, out EVT_HANDLE EventHandle) [inherited]

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

5.14 Camera event specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Camera_UnRegisterEvent


(CAMERA_HANDLE CameraHandle, EDeviceEventType EventType) [inherited]

Un-register an event with the Transport Layer interface.


Parameters:
CameraHandle Handle to a valid camera object, obtained by J_Camera_Open() function.
EventType Event type to un-register
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.15 Data Stream event specific functions

5.15

217

Data Stream event specific functions

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.

static Jai_FactoryWrapper.EFactoryError J_DataStream_RegisterEvent (DATASTREAM_HANDLE DSHandle, EDeviceEventType EventType, COND_HANDLE ConditionHandle,


out EVT_HANDLE EventHandle)
Register an event with the Transport Layer interface. This is an overloaded version that uses Conditions
instead of directly using Windows Events.

static Jai_FactoryWrapper.EFactoryError J_DataStream_UnRegisterEvent


HANDLE DSHandle, EDeviceEventType EventType)

(DATASTREAM_-

Un-register an event with the Transport Layer interface.

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

static Jai_FactoryWrapper.EFactoryError J_DataStream_RegisterEvent


(DATASTREAM_HANDLE DSHandle, EDeviceEventType EventType, SafeWaitHandle
WaitHandle, out EVT_HANDLE EventHandle) [inherited]

Register an event with the Transport Layer interface.


// 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 Work
{
public AutoResetEvent KillEvent = new AutoResetEvent(false); // Eve
nt used to stop Stream Thread faster
public IntPtr DataStreamHandle = IntPtr.Zero;
// Dat
aStream Handle
public Boolean EnableThread = true;
// Fla
g used to control thread run
public CCamera camera = null;

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

5.15 Data Stream event specific functions

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

static Jai_FactoryWrapper.EFactoryError J_DataStream_RegisterEvent


(DATASTREAM_HANDLE DSHandle, EDeviceEventType EventType,
COND_HANDLE ConditionHandle, out EVT_HANDLE EventHandle) [inherited]

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

5.15 Data Stream event specific functions

221

ECondWaitResult WaitResult = ECondWaitResult.WaitError;


DeviceEventData EventData = new DeviceEventData();
if (NewImageCondition == IntPtr.Zero)
retsta = J_Event_CreateCondition(ref NewImageCondition);
IntPtr hDeviceEvent; // Buffer event handle
// Register the event with the acquisition engine
retsta = J_DataStream_RegisterEvent(DataStreamHandle,
EDeviceEventType.NEW_BUFFER,
NewImageCondition,
out hDeviceEvent);
// Start image acquisition
retsta = J_DataStream_StartAcquisition(DataStreamHandle,
camera._AcquisitionStartFl
ag,
0);
AcquisitionStarted = true;
while (EnableThread)
{
// Wait for Buffer event (or kill event)
retsta = J_Event_WaitForCondition(NewImageCondition, 1000, ref
WaitResult);
if (retsta == EFactoryError.Success)
{
// Did we get a new buffer event?
if (WaitResult == ECondWaitResult.WaitSignal)
{
// Are we capturing specific count?
if (AcquisitionCount != 0)
{
iFrameCounter++;
// Did we capture all frames we need?
if (iFrameCounter >= AcquisitionCount)
{
// Stop any further images from being sent
camera.StopAcquisition();
}
}
// 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)
{
// Fill in structure for image display
// Get the pointer to the frame buffer.
iSize = (uint)Marshal.SizeOf(BufferInfo.Base);
retsta = J_DataStream_GetBufferInfo(DataStreamHandle,
EventData.NEW_BUFFER_
BufferHandle,
EBufferInfoCmd.BASE,
ref BufferInfo,
ref iSize);
ImageInfo.ImageBuffer = BufferInfo.Base;
// Get Timestamp.

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

5.15 Data Stream event specific functions

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

// 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
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

static Jai_FactoryWrapper.EFactoryError J_DataStream_UnRegisterEvent


(DATASTREAM_HANDLE DSHandle, EDeviceEventType EventType) [inherited]

Un-register an event with the Transport Layer interface.


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.
EventType Event type to un-register
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.16 Condition specific functions

5.16

225

Condition specific functions

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_SignalCondition (COND_HANDLE ConditionHandle)


Signal Condition object. J_Event_WaitForCondition() will return ECondWaitResult.WaitSignal if
this is called.

static Jai_FactoryWrapper.EFactoryError J_Event_ExitCondition (COND_HANDLE ConditionHandle)


Send an EXIT Signal to the Condition object. J_Event_WaitForCondition() will return ECondWaitResult.WaitExit if this is called.

static Jai_FactoryWrapper.EFactoryError J_Event_ResetCondition (COND_HANDLE ConditionHandle)


Reset the Condition object state to its initial state.

static Jai_FactoryWrapper.EFactoryError J_Event_WaitForCondition (COND_HANDLE ConditionHandle, UInt32 timeout, ref ECondWaitResult WaitResult)
Wait for the Condition object to be signaled.

static Jai_FactoryWrapper.EFactoryError J_Event_WaitForMultipleConditions (Int32 nCount,


COND_HANDLE[ ] ConditionHandles, UInt32 timeout, ref ECondWaitResult WaitResult)
Wait for one of multiple Condition objects to be signaled.

static Jai_FactoryWrapper.EFactoryError J_Event_CloseCondition (COND_HANDLE ConditionHandle)


Close the Condition object.

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

static Jai_FactoryWrapper.EFactoryError J_Event_CreateCondition (ref


COND_HANDLE ConditionHandle) [inherited]

Create new Condition object to be used for event handling.


// 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);
if (retsta == EFactoryError.Success)
{
if (EnableThread)
{
if (camera != null)
camera.HandleConnectionStatus(camera, EventData.CONNE
CTION_Status);
}
}
}
else
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.16 Condition specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Event_SignalCondition (COND_HANDLE


ConditionHandle) [inherited]

Signal Condition object. J_Event_WaitForCondition() will return ECondWaitResult.WaitSignal


if this is called.
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

228

Module Documentation

5.16.2.3

static Jai_FactoryWrapper.EFactoryError J_Event_ExitCondition (COND_HANDLE


ConditionHandle) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Event_ResetCondition (COND_HANDLE


ConditionHandle) [inherited]

Reset the Condition object state to its initial state.


Parameters:
ConditionHandle Internal Condition handle obtained by the J_Event_CreateCondition()
function.
Returns:
Jai_FactoryWrapper.EFactoryError

5.16.2.5

static Jai_FactoryWrapper.EFactoryError J_Event_WaitForCondition


(COND_HANDLE ConditionHandle, UInt32 timeout, ref ECondWaitResult WaitResult)
[inherited]

Wait for the Condition object to be signaled.


// 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);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.16 Condition specific functions

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 Camera Connection 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)
{
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)
{
retsta = J_Event_Close(hDeviceEvent);
hDeviceEvent = IntPtr.Zero;
}

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

static Jai_FactoryWrapper.EFactoryError J_Event_WaitForMultipleConditions (Int32


nCount, COND_HANDLE[ ] ConditionHandles, UInt32 timeout, ref ECondWaitResult
WaitResult) [inherited]

Wait for one of multiple Condition objects to be signaled.


// 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 GevEventCondition = IntPtr.Zero;
public IntPtr ConnectionCondition = IntPtr.Zero;
public IntPtr[] ConditionList = new IntPtr[2];
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 (GevEventCondition == IntPtr.Zero)
retsta = J_Event_CreateCondition(ref GevEventCondition);
if (ConnectionCondition == IntPtr.Zero)
retsta = J_Event_CreateCondition(ref ConnectionCondition);
ConditionList[0] = GevEventCondition;
ConditionList[1] = ConnectionCondition;
IntPtr hGevEvent; // GigE Vision Event handle
// Register the event with the Transport Layer
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.16 Condition specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Event_CloseCondition (COND_HANDLE


ConditionHandle) [inherited]

Close the Condition object.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.16 Condition specific functions


// 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);
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;

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 GenICam node specific functions

5.17

235

GenICam node specific functions

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.

IFloat GenICam node specific functions


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.

IEnumeration GenICam node specific functions


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().

ICommand GenICam node specific functions


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.

IString GenICam node specific functions


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!

IRegister GenICam node specific functions


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_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_GetNameSpace (NODE_HANDLE NodeHandle,


ref EConfNameSpace NameSpace)
Get the namespace for a GenICam node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetVisibility (NODE_HANDLE NodeHandle,


ref EConfVisibility Visibility)
Get the recommended visibility for a GenICam node.

static Jai_FactoryWrapper.EFactoryError J_Node_Invalidate (NODE_HANDLE NodeHandle)


Invalidate the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsCachable (NODE_HANDLE NodeHandle,


ref UInt32 IsCachable)
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().

static Jai_FactoryWrapper.EFactoryError J_Node_GetCachingMode (NODE_HANDLE NodeHandle, ref EConfCachingMode CachingMode)


Get the caching mode for a GenICam node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetPollingTime (NODE_HANDLE NodeHandle, ref Int64 PollingTime)


Get the recommended polling time for the GenICam node. This is only necessary if the node is not cachable.

static Jai_FactoryWrapper.EFactoryError J_Node_GetToolTip (NODE_HANDLE NodeHandle,


StringBuilder ToolTip, ref UInt32 Size)
Get the tooltip for a node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetDescription (NODE_HANDLE NodeHandle,


StringBuilder Description, ref UInt32 Size)
Get the description 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.

static Jai_FactoryWrapper.EFactoryError J_Node_GetEventID (NODE_HANDLE NodeHandle,


StringBuilder EventID, ref UInt32 Size)
Get the Event ID string for a node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsStreamable (NODE_HANDLE NodeHandle, ref UInt32 IsStreamable)


Get if the GenICam node is streamable.

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfProperties (NODE_HANDLE NodeHandle, ref UInt32 NumOfProperties)


Get the number of properties on the node.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.17 GenICam node specific functions

237

static Jai_FactoryWrapper.EFactoryError J_Node_GetPropertyNameByIndex (NODE_HANDLE


NodeHandle, UInt32 Index, StringBuilder PropertyName, ref UInt32 Size)
Get the name of the property by index.

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.

static Jai_FactoryWrapper.EFactoryError J_Node_ImposeAccessMode (NODE_HANDLE NodeHandle, EConfAccessMode AccessMode)


Override the current access mode for a node.

static Jai_FactoryWrapper.EFactoryError J_Node_ImposeVisibility (NODE_HANDLE NodeHandle, EConfVisibility Visibility)


Override the current recommended visibility for a node.

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.

delegate bool NodeChangeDelegate (NODE_HANDLE NodeHandle)


Delegate to be called whenever the value or any of the node properties changes.

static Jai_FactoryWrapper.EFactoryError J_Node_RegisterCallback (NODE_HANDLE NodeHandle, NodeChangeDelegate NodeChangeDelegateFunction)


Register a delegate for a specific node. The delegate will be called when the node changes state or value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetType (NODE_HANDLE NodeHandle, ref


EConfNodeType NodeType)
Get the GenICam node type of the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsSelector (NODE_HANDLE NodeHandle,


ref UInt32 IsSelector)
Get if the GenICam node is a Selector.

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfSelectedFeatures (NODE_HANDLE


NodeHandle, ref UInt32 NumOfSelectedFeatures)
Get the number of Selected Features on the Selector node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetSelectedFeatureByIndex (NODE_HANDLE


NodeHandle, UInt32 Index, out NODE_HANDLE SelectedNodeHandle)
Get the selected feature node by index.

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfSelectingFeatures (NODE_HANDLE


NodeHandle, ref UInt32 NumOfSelectingFeatures)
Get the number of Selecting Features on the Selector node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetSelectingFeatureByIndex (NODE_HANDLE


NodeHandle, UInt32 Index, out NODE_HANDLE SelectingNodeHandle)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

238

Module Documentation
Get the selecting feature node by index.

static Jai_FactoryWrapper.EFactoryError J_Node_GetRepresentation (NODE_HANDLE NodeHandle, ref EConfRepresentation Representation)


Get the Representation specified for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetUnit (NODE_HANDLE NodeHandle, StringBuilder Unit, ref UInt32 Size)
Get the Unit string specified for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetDocuURL (NODE_HANDLE NodeHandle,


StringBuilder DocuURL, ref UInt32 Size)
Get the Documentation URL string specified for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsDeprecated (NODE_HANDLE NodeHandle, ref UInt32 IsDeprecated)


Get if the GenICam node is Deprecated.

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetAccessMode (NODE_HANDLE


NodeHandle, ref EConfAccessMode AccessMode) [inherited]

Get the access mode for a GenICam node.


Parameters:
NodeHandle A valid handle to a GenICam node
AccessMode Access mode of the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.2

static Jai_FactoryWrapper.EFactoryError J_Node_GetName (NODE_HANDLE


NodeHandle, StringBuilder Buffer, ref UInt32 Size, UInt32 FullQualified)
[inherited]

Get the GenICam name for a node.


Parameters:
NodeHandle A valid handle to a GenICam node
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.17 GenICam node specific functions

239

Buffer StringBuilder to put the node name


Size Capacity of the StringBuilder. The length of the name will be returned
FullQualified If this value is not 0 then the full qualified name will be returned
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.3

static Jai_FactoryWrapper.EFactoryError J_Node_GetNameSpace (NODE_HANDLE


NodeHandle, ref EConfNameSpace NameSpace) [inherited]

Get the namespace for a GenICam node.


Parameters:
NodeHandle A valid handle to a GenICam node
NameSpace Reference to variable where the Namespace of the node will be returned
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.4

static Jai_FactoryWrapper.EFactoryError J_Node_GetVisibility (NODE_HANDLE


NodeHandle, ref EConfVisibility Visibility) [inherited]

Get the recommended visibility for a GenICam node.


Parameters:
NodeHandle A valid handle to a GenICam node
Visibility Recommended visibility of the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.5

static Jai_FactoryWrapper.EFactoryError J_Node_Invalidate (NODE_HANDLE


NodeHandle) [inherited]

Invalidate the node.


Parameters:
NodeHandle A valid handle to a GenICam node
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

240

Module Documentation

5.17.2.6

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsCachable (NODE_HANDLE


NodeHandle, ref UInt32 IsCachable) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetCachingMode (NODE_HANDLE


NodeHandle, ref EConfCachingMode CachingMode) [inherited]

Get the caching mode for a GenICam node.


Parameters:
NodeHandle A valid handle to a GenICam node
CachingMode Caching mode of the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.8

static Jai_FactoryWrapper.EFactoryError J_Node_GetPollingTime (NODE_HANDLE


NodeHandle, ref Int64 PollingTime) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetToolTip (NODE_HANDLE


NodeHandle, StringBuilder ToolTip, ref UInt32 Size) [inherited]

Get the tooltip for a node.


Parameters:
NodeHandle A valid handle to a GenICam node
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.17 GenICam node specific functions

241

ToolTip StringBuilder to put the tooltip


Size Capacity of the StringBuilder. The length of the tooltip will be returned
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.10

static Jai_FactoryWrapper.EFactoryError J_Node_GetDescription (NODE_HANDLE


NodeHandle, StringBuilder Description, ref UInt32 Size) [inherited]

Get the description for a node.


Parameters:
NodeHandle A valid handle to a GenICam node
Description StringBuilder to put the description
Size Capacity of the StringBuilder. The length of the description will be returned
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.11

static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayName (NODE_HANDLE


NodeHandle, StringBuilder DisplayName, ref UInt32 Size) [inherited]

Get the display name for a node.


Parameters:
NodeHandle A valid handle to a GenICam node
DisplayName StringBuilder to put the display name
Size Capacity of the StringBuilder. The length of the display name will be returned
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.12

static Jai_FactoryWrapper.EFactoryError J_Node_GetEventID (NODE_HANDLE


NodeHandle, StringBuilder EventID, ref UInt32 Size) [inherited]

Get the Event ID string for a node.


Parameters:
NodeHandle A valid handle to a GenICam node
EventID StringBuilder to put the Event ID
Size Capacity of the StringBuilder. The length of the Event ID will be returned
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

242

Module Documentation

5.17.2.13

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsStreamable (NODE_HANDLE


NodeHandle, ref UInt32 IsStreamable) [inherited]

Get if the GenICam node is streamable.


Parameters:
NodeHandle A valid handle to a GenICam node
IsStreamable Is the node streamable
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.14

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfProperties


(NODE_HANDLE NodeHandle, ref UInt32 NumOfProperties) [inherited]

Get the number of properties on the node.


Parameters:
NodeHandle A valid handle to a GenICam node
NumOfProperties The number of properties
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.15

static Jai_FactoryWrapper.EFactoryError J_Node_GetPropertyNameByIndex


(NODE_HANDLE NodeHandle, UInt32 Index, StringBuilder PropertyName, ref
UInt32 Size) [inherited]

Get the name of the property by index.


Parameters:
NodeHandle A valid handle to a GenICam node
Index The index of the property
PropertyName StringBuilder to put the property name
Size Capacity of the StringBuilder. The length of the property name will be returned
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.16

static Jai_FactoryWrapper.EFactoryError J_Node_GetPropertyByName


(NODE_HANDLE NodeHandle, String PropertyName, StringBuilder ValueStr,
ref UInt32 SizeValueStr, StringBuilder AttributeStr, ref UInt32 SizeAttributeStr)
[inherited]

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

5.17 GenICam node specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Node_ImposeAccessMode


(NODE_HANDLE NodeHandle, EConfAccessMode AccessMode) [inherited]

Override the current access mode for a node.


Parameters:
NodeHandle A valid handle to a GenICam node
AccessMode The new imposed access mode
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.18

static Jai_FactoryWrapper.EFactoryError J_Node_ImposeVisibility (NODE_HANDLE


NodeHandle, EConfVisibility Visibility) [inherited]

Override the current recommended visibility for a node.


Parameters:
NodeHandle A valid handle to a GenICam node
Visibility The new recommended visibility mode
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.19

static Jai_FactoryWrapper.EFactoryError J_Node_GetAlias (NODE_HANDLE


NodeHandle, out IntPtr AliasNodeHandle) [inherited]

Retrieves a node which describes the same feature in a different way.


Parameters:
NodeHandle A valid handle to a GenICam node
AliasNodeHandle Handle to a node that describes the same feature differently
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

244

Module Documentation

5.17.2.20

delegate bool NodeChangeDelegate (NODE_HANDLE NodeHandle) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Node_RegisterCallback (NODE_HANDLE


NodeHandle, NodeChangeDelegate NodeChangeDelegateFunction) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetType (NODE_HANDLE


NodeHandle, ref EConfNodeType NodeType) [inherited]

Get the GenICam node type of the node.


Parameters:
NodeHandle A valid handle to a GenICam node
NodeType The type of the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.23

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsSelector (NODE_HANDLE


NodeHandle, ref UInt32 IsSelector) [inherited]

Get if the GenICam node is a Selector.


Parameters:
NodeHandle A valid handle to a GenICam node
IsSelector Is the node a Selector
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.17 GenICam node specific functions


5.17.2.24

245

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfSelectedFeatures


(NODE_HANDLE NodeHandle, ref UInt32 NumOfSelectedFeatures) [inherited]

Get the number of Selected Features on the Selector node.


Use J_NodeGetIsSelector() to determine if the node is a Selector node or not
Parameters:
NodeHandle A valid handle to a GenICam Selector node
NumOfSelectedFeatures The number of features that are selected by this Selector
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.25

static Jai_FactoryWrapper.EFactoryError J_Node_GetSelectedFeatureByIndex


(NODE_HANDLE NodeHandle, UInt32 Index, out NODE_HANDLE
SelectedNodeHandle) [inherited]

Get the selected feature node by index.


Use J_NodeGetIsSelector() to determine if the node is a Selector node or not
Parameters:
NodeHandle A valid handle to a GenICam Selector node
Index Index of the Selected feature node entry
SelectedNodeHandle
Returns:

5.17.2.26

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfSelectingFeatures


(NODE_HANDLE NodeHandle, ref UInt32 NumOfSelectingFeatures) [inherited]

Get the number of Selecting Features on the Selector node.


Use J_NodeGetIsSelector() to determine if the node is a Selector node or not
Parameters:
NodeHandle A valid handle to a GenICam Selector node
NumOfSelectingFeatures The number of features that are selecting this Selector
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

246

Module Documentation

5.17.2.27

static Jai_FactoryWrapper.EFactoryError J_Node_GetSelectingFeatureByIndex


(NODE_HANDLE NodeHandle, UInt32 Index, out NODE_HANDLE
SelectingNodeHandle) [inherited]

Get the selecting feature node by index.


Use J_NodeGetIsSelector() to determine if the node is a Selector node or not
Parameters:
NodeHandle A valid handle to a GenICam Selector node
Index Index of the Selecting feature node entry
SelectingNodeHandle
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.28

static Jai_FactoryWrapper.EFactoryError J_Node_GetRepresentation


(NODE_HANDLE NodeHandle, ref EConfRepresentation Representation)
[inherited]

Get the Representation specified for the node.


The node type has to be IInteger or IFloat.
Parameters:
NodeHandle A valid handle to a GenICam node
Representation Reference to the variable in which the Representation is stored.
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.29

static Jai_FactoryWrapper.EFactoryError J_Node_GetUnit (NODE_HANDLE


NodeHandle, StringBuilder Unit, ref UInt32 Size) [inherited]

Get the Unit string specified for the node.


Parameters:
NodeHandle A valid handle to a GenICam node
Unit StringBuilder to put the Unit string
Size Capacity of the StringBuilder. The length of the Unit 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.17 GenICam node specific functions


5.17.2.30

247

static Jai_FactoryWrapper.EFactoryError J_Node_GetDocuURL (NODE_HANDLE


NodeHandle, StringBuilder DocuURL, ref UInt32 Size) [inherited]

Get the Documentation URL string specified for the node.


Parameters:
NodeHandle A valid handle to a GenICam node
DocuURL StringBuilder to put the Documentation URL string
Size Capacity of the StringBuilder. The length of the Documentation URL string will be returned
Returns:
Jai_FactoryWrapper.EFactoryError

5.17.2.31

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsDeprecated (NODE_HANDLE


NodeHandle, ref UInt32 IsDeprecated) [inherited]

Get if the GenICam node is Deprecated.


Parameters:
NodeHandle A valid handle to a GenICam node
IsDeprecated Nonzero if the node is deprecated
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

248

Module Documentation

5.18

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_GetMinInt64 (NODE_HANDLE NodeHandle,
ref Int64 Min)
Get minimum value allowed for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetMaxInt64 (NODE_HANDLE NodeHandle,


ref Int64 Max)
Get maximum value allowed for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetInc (NODE_HANDLE NodeHandle, ref Int64


Inc)
Get the increment value for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueInt64 (NODE_HANDLE NodeHandle,


bool Verify, Int64 Value)
Set the node value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueInt64 (NODE_HANDLE NodeHandle,


bool Verify, ref Int64 Value)
Get the node value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatAlias (NODE_HANDLE NodeHandle,


ref NODE_HANDLE FloatNodeHandle)
Get the IFloat Alias node from the IInteger 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

static Jai_FactoryWrapper.EFactoryError J_Node_GetMinInt64 (NODE_HANDLE


NodeHandle, ref Int64 Min) [inherited]

Get minimum value allowed for the node.


The node type has to be one of the following node types:
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.18 IInteger GenICam node specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetMaxInt64 (NODE_HANDLE


NodeHandle, ref Int64 Max) [inherited]

Get maximum value allowed for the node.


The node type has to be one of the following node types:
EConfNodeType.IInteger
EConfNodeType.IMaskedIntReg
EConfNodeType.IIntReg
EConfNodeType.IIntSwissKnife
EConfNodeType.IIntKey
EConfNodeType.IIntConverter
Parameters:
NodeHandle A valid handle to a GenICam node
Max Reference to a Int64 variable to receive the maximum value for the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.18.2.3

static Jai_FactoryWrapper.EFactoryError J_Node_GetInc (NODE_HANDLE


NodeHandle, ref Int64 Inc) [inherited]

Get the increment value for the node.


The increment determines together with the minimum- and maximum value which values are legal for the
node. The node type has to be one of the following node types:
EConfNodeType.IInteger
EConfNodeType.IMaskedIntReg
EConfNodeType.IIntReg
EConfNodeType.IIntSwissKnife
EConfNodeType.IIntKey
EConfNodeType.IIntConverter
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueInt64 (NODE_HANDLE


NodeHandle, bool Verify, Int64 Value) [inherited]

Set the node value.


The node type has to be one of the following node types:
EConfNodeType.IInteger
EConfNodeType.IMaskedIntReg
EConfNodeType.IIntReg
EConfNodeType.IIntSwissKnife
EConfNodeType.IIntKey
EConfNodeType.IIntConverter
Parameters:
NodeHandle A valid handle to a GenICam node
Verify Verify that the value is set
Value The new value to be set in the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.18.2.5

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueInt64 (NODE_HANDLE


NodeHandle, bool Verify, ref Int64 Value) [inherited]

Get the node value.


The node type has to be one of the following node types:
EConfNodeType.IInteger
EConfNodeType.IMaskedIntReg
EConfNodeType.IIntReg
EConfNodeType.IIntSwissKnife
EConfNodeType.IIntKey
EConfNodeType.IIntConverter
Parameters:
NodeHandle A valid handle to a GenICam node
Verify Verify the value
Value Reference to a Int64 variable to receive the value of the node
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.18 IInteger GenICam node specific functions


5.18.2.6

251

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatAlias (NODE_HANDLE


NodeHandle, ref NODE_HANDLE FloatNodeHandle) [inherited]

Get the IFloat Alias node from the IInteger node.


Parameters:
NodeHandle A valid handle to a GenICam node
FloatNodeHandle Reference to a NODE_HANDLE variable to receive the handle of the Float Alias
node
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

252

Module Documentation

5.19

IFloat GenICam node specific functions

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_GetMaxDouble (NODE_HANDLE NodeHandle,


ref double Max)
Get minimum value allowed for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueDouble (NODE_HANDLE NodeHandle, bool Verify, double Value)


Set node value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueDouble (NODE_HANDLE NodeHandle, bool Verify, ref double Value)
Get the node value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayNotation (NODE_HANDLE NodeHandle, ref EDisplayNotation Value)


Get the Display Notation specified for the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayPrecision (NODE_HANDLE NodeHandle, ref Int64 Value)


Get the Display Precision specified for the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatHasInc (NODE_HANDLE NodeHandle,


ref UInt32 Value)
Inquire if the IFloat node has got an Increment defined.

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatInc (NODE_HANDLE NodeHandle, ref


double Value)
Get the constant increment value as double type from the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIntAlias (NODE_HANDLE NodeHandle, ref


NODE_HANDLE IntegerNodeHandle)
Get the IInteger Alias node from the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumAlias (NODE_HANDLE NodeHandle,


ref NODE_HANDLE EnumNodeHandle)
Get the IEnumeration Alias node from the IFloat node.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.19 IFloat GenICam node specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetMinDouble (NODE_HANDLE


NodeHandle, ref double Min) [inherited]

Get minimum value allowed for the node.


The node type has to be one of the following node types:
EConfNodeType.IFloat
EConfNodeType.IFloatReg
EConfNodeType.ISwissKnife
EConfNodeType.IConverter
Parameters:
NodeHandle A valid handle to a GenICam node
Min Reference to a double variable to receive the minimum value for the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.19.2.2

static Jai_FactoryWrapper.EFactoryError J_Node_GetMaxDouble (NODE_HANDLE


NodeHandle, ref double Max) [inherited]

Get minimum value allowed for the node.


The node type has to be one of the following node types:
EConfNodeType.IFloat
EConfNodeType.IFloatReg
EConfNodeType.ISwissKnife
EConfNodeType.IConverter
Parameters:
NodeHandle A valid handle to a GenICam node
Max Reference to a double variable to receive the maximum value for the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.19.2.3

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueDouble (NODE_HANDLE


NodeHandle, bool Verify, double Value) [inherited]

Set node value.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

254

Module Documentation

The node type has to be one of the following node types:


EConfNodeType.IFloat
EConfNodeType.IFloatReg
EConfNodeType.ISwissKnife
EConfNodeType.IConverter
Parameters:
NodeHandle A valid handle to a GenICam node
Verify Verify that the value is set
Value The new value to be set in the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.19.2.4

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueDouble (NODE_HANDLE


NodeHandle, bool Verify, ref double Value) [inherited]

Get the node value.


The node type has to be one of the following node types:
EConfNodeType.IFloat
EConfNodeType.IFloatReg
EConfNodeType.ISwissKnife
EConfNodeType.IConverter
Parameters:
NodeHandle A valid handle to a GenICam node
Verify Verify the value
Value Reference to a double variable to receive the value of the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.19.2.5

static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayNotation


(NODE_HANDLE NodeHandle, ref EDisplayNotation Value) [inherited]

Get the Display Notation specified for the IFloat node.


Parameters:
NodeHandle A valid handle to a IFloat GenICam node
Value Reference to a EDisplayNotation variable to receive the Display Notation for the node
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.19 IFloat GenICam node specific functions


5.19.2.6

255

static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayPrecision


(NODE_HANDLE NodeHandle, ref Int64 Value) [inherited]

Get the Display Precision specified for the IFloat node.


Parameters:
NodeHandle A valid handle to a IFloat GenICam node
Value Reference to a UInt64 variable to receive the Display Precision for the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.19.2.7

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatHasInc (NODE_HANDLE


NodeHandle, ref UInt32 Value) [inherited]

Inquire if the IFloat node has got an Increment defined.


Parameters:
NodeHandle A valid handle to a IFloat GenICam node
Value Reference to a UInt32 variable. The value will be non-zero if the IFloat node has got an
Increment
Returns:
Jai_FactoryWrapper.EFactoryError

5.19.2.8

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatInc (NODE_HANDLE


NodeHandle, ref double Value) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetIntAlias (NODE_HANDLE


NodeHandle, ref NODE_HANDLE IntegerNodeHandle) [inherited]

Get the IInteger Alias node from the IFloat node.


Parameters:
NodeHandle A valid handle to a GenICam node
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumAlias (NODE_HANDLE


NodeHandle, ref NODE_HANDLE EnumNodeHandle) [inherited]

Get the IEnumeration Alias node from the IFloat node.


Parameters:
NodeHandle A valid handle to a GenICam node
EnumNodeHandle Reference to a NODE_HANDLE variable to receive the handle of the Enumeration
Alias node
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.20 IEnumeration GenICam node specific functions

5.20

257

IEnumeration GenICam node specific functions

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.

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumEntryByIndex (NODE_HANDLE


NodeHandle, UInt32 Index, out ENUMNODE_HANDLE EnumNodeHandle)
Get the enumeration entry on a EConfNodeType.IEnumeration node. The node type returned will
be EConfNodeType.IEnumEntry.

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumEntryValue (ENUMNODE_HANDLE


EnumNodeHandle, ref Int64 Value)
Get the integer value of a EConfNodeType.IEnumEntry 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

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfEnumEntries


(NODE_HANDLE NodeHandle, ref UInt32 NumOfEnumEntries) [inherited]

Get the number of enumeration entries on a EConfNodeType.IEnumeration node.


Parameters:
NodeHandle A valid handle to a GenICam node
NumOfEnumEntries Reference to a UInt32 variable that will receive the number of enumeration
entries
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

258

Module Documentation

Returns:
Jai_FactoryWrapper.EFactoryError

5.20.2.2

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumEntryByIndex


(NODE_HANDLE NodeHandle, UInt32 Index, out ENUMNODE_HANDLE
EnumNodeHandle) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumEntryValue


(ENUMNODE_HANDLE EnumNodeHandle, ref Int64 Value) [inherited]

Get the integer value of a EConfNodeType.IEnumEntry node.


Parameters:
EnumNodeHandle A valid handle to a EConfNodeType.IEnumEntry GenICam node
Value Reference to a Int32 variable that
EConfNodeType.IEnumEntry node

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 ICommand GenICam node specific functions

5.21

259

ICommand GenICam node specific functions

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.

static Jai_FactoryWrapper.EFactoryError J_Node_GetCommandIsDone (NODE_HANDLE NodeHandle, ref UInt32 IsDone)


Read if the GenICam command has been executed.

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

static Jai_FactoryWrapper.EFactoryError J_Node_ExecuteCommand (NODE_HANDLE


NodeHandle) [inherited]

Execute the GenICam command.


Parameters:
NodeHandle A valid handle to a EConfNodeType.ICommand GenICam node
Returns:
Jai_FactoryWrapper.EFactoryError

5.21.2.2

static Jai_FactoryWrapper.EFactoryError J_Node_GetCommandIsDone


(NODE_HANDLE NodeHandle, ref UInt32 IsDone) [inherited]

Read if the GenICam command has been executed.


Parameters:
NodeHandle A valid handle to a EConfNodeType.ICommand GenICam node
IsDone Is the command executed
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

260

Module Documentation

5.22

IString GenICam node specific functions

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.

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueString (NODE_HANDLE NodeHandle,


bool Verify, StringBuilder ValueStr, ref UInt32 SizeValueStr)
Get 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

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueString (NODE_HANDLE


NodeHandle, bool Verify, String ValueStr) [inherited]

Set node value as a String.


The camera needs to be opened using J_Camera_Open() before the value can be set 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 that the value is set
ValueStr The new value to be set in the node
Returns:
Jai_FactoryWrapper.EFactoryError

5.22.2.2

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueString (NODE_HANDLE


NodeHandle, bool Verify, StringBuilder ValueStr, ref UInt32 SizeValueStr)
[inherited]

Get node value as a String.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.22 IString GenICam node specific functions

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

IRegister GenICam node specific functions

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.

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueRegister (NODE_HANDLE NodeHandle, IntPtr pBuffer, UInt64 Length)


Read register values of nodes of type EConfNodeType.IRegister, IIntReg, IStringReg or IFloatReg.

static Jai_FactoryWrapper.EFactoryError J_Node_GetRegisterLength (NODE_HANDLE NodeHandle, ref UInt64 pLength)


Get the length of a EConfNodeType.IRegister, IIntReg, IStringReg and IFloatReg node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetRegisterAddress (NODE_HANDLE NodeHandle, ref UInt64 pAddress)


Get the address of a EConfNodeType.IRegister, IIntReg, IStringReg and IFloatReg node.

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

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueRegister (NODE_HANDLE


NodeHandle, IntPtr pBuffer, UInt64 Length) [inherited]

Writes register values to nodes of type EConfNodeType.IRegister, IIntReg, IStringReg or IFloatReg.


The camera needs to be opened using J_Camera_Open() before the value can be set The node type has
to be either EConfNodeType.IRegister, EConfNodeType.IIntReg, EConfNodeType.IStringReg or EConfNodeType.IFloatReg. The value will automatically be converted internally in the factory
Parameters:
NodeHandle A valid handle to a GenICam node
pBuffer Pointer to the data to write to the register
Length Length of the data to write to the register
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.23 IRegister GenICam node specific functions

263

Returns:
Jai_FactoryWrapper.EFactoryError

5.23.2.2

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueRegister (NODE_HANDLE


NodeHandle, IntPtr pBuffer, UInt64 Length) [inherited]

Read register values of nodes of type EConfNodeType.IRegister, IIntReg, IStringReg or IFloatReg.


The camera needs to be opened using J_Camera_Open() before the value can be read The node type has
to be either EConfNodeType.IRegister, EConfNodeType.IIntReg, EConfNodeType.IStringReg or EConfNodeType.IFloatReg. The value will automatically be converted internally in the factory
Parameters:
NodeHandle A valid handle to a GenICam node
pBuffer Pointer to a buffer where to put the data read from the register
Length Capacity of the buffer
Returns:
Jai_FactoryWrapper.EFactoryError

5.23.2.3

static Jai_FactoryWrapper.EFactoryError J_Node_GetRegisterLength


(NODE_HANDLE NodeHandle, ref UInt64 pLength) [inherited]

Get the length of a EConfNodeType.IRegister, IIntReg, IStringReg and IFloatReg node.


The camera needs to be opened using J_Camera_Open() before the length can be read The node
type has to be either EConfNodeType.IRegister, EConfNodeType.IIntReg, EConfNodeType.IStringReg or
EConfNodeType.IFloatReg. The value will automatically be converted internally in the factory
Parameters:
NodeHandle A valid handle to a GenICam node
pLength Reference to a UInt64 variable to receive the length for the register node
Returns:
Jai_FactoryWrapper.EFactoryError

5.23.2.4

static Jai_FactoryWrapper.EFactoryError J_Node_GetRegisterAddress


(NODE_HANDLE NodeHandle, ref UInt64 pAddress) [inherited]

Get the address of a EConfNodeType.IRegister, IIntReg, IStringReg and IFloatReg node.


The camera needs to be opened using J_Camera_Open() before the length can be read The node
type has to be either EConfNodeType.IRegister, EConfNodeType.IIntReg, EConfNodeType.IStringReg or
EConfNodeType.IFloatReg. The value will automatically be converted internally in the factory
Parameters:
NodeHandle A valid handle to a GenICam node
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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 Image acquisition and manipulation functions

5.24

265

Image acquisition and manipulation functions

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.

Stream channel specific functions


The Stream Channel specific functions are used for utilizing the automatic Image Acquisition via callback
functions.

Image manipulation functions


The JAI SDK contains a number of functions that are used for manipulating the raw images acquired from
the cameras.

Image save and load functions


These functions are used for saving the acquired images to disk as well as loading previously saved images.

Pixel access functions


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.

Image white balance control functions


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.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

266

Module Documentation

High Dynamic Range functions


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.

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.

Image Processing functions


The Image Processing functions makes it possible for the user to apply a number of different image processing algorithms to an image buffer.

Enumerations
enum EPixelTypeColorInfo { Monochrome = 0x01000000, RGB = 0x02000000, Custom =
0x80000000 }
Color information for the EPixelType enumeration.
GetPixelTypeColorInfo().

To get the Color information call

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

5.24 Image acquisition and manipulation functions

267

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),
GVSP_PIX_BAYGR12_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT
| 0x002A), GVSP_PIX_BAYRG12_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x002B), GVSP_PIX_BAYGB12_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x002C), GVSP_PIX_BAYBG12_PACKED = (GVSP_PIX_MONO |
GVSP_PIX_OCCUPY12BIT | 0x002D),
GVSP_PIX_BAYGR16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x002E), GVSP_PIX_BAYRG16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x002F), GVSP_PIX_BAYGB16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0030), GVSP_PIX_BAYBG16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0031),
GVSP_PIX_RGB8_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY24BIT | 0x0014),
GVSP_PIX_BGR8_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY24BIT | 0x0015),
GVSP_PIX_RGBA8_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY32BIT | 0x0016),
GVSP_PIX_BGRA8_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY32BIT | 0x0017),
GVSP_PIX_RGB10_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x0018),
GVSP_PIX_BGR10_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x0019),
GVSP_PIX_RGB12_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x001A),
GVSP_PIX_BGR12_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x001B),
GVSP_PIX_RGB16_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x0033),
GVSP_PIX_RGB10V1_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY32BIT
| 0x001C), GVSP_PIX_RGB10V2_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY32BIT | 0x001D), GVSP_PIX_RGB12V1_PACKED = (GVSP_PIX_COLOR |
GVSP_PIX_OCCUPY36BIT | 0x0034),
GVSP_PIX_YUV411_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY12BIT | 0x001E),
GVSP_PIX_YUV422_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY16BIT | 0x001F),
GVSP_PIX_YUV444_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY24BIT | 0x0020),
GVSP_PIX_RGB8_PLANAR = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY24BIT | 0x0021),
GVSP_PIX_RGB10_PLANAR = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT |
0x0022), GVSP_PIX_RGB12_PLANAR = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT |
0x0023), GVSP_PIX_RGB16_PLANAR = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT
| 0x0024), GVSP_PIX_BGR16_PACKED_INTERNAL = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x0000) }
Pixel Types used by the camera and in the buffer information structure ImageInfo.

Functions
static Jai_FactoryWrapper.EPixelTypeColorInfo GetPixelTypeColorInfo (EPixelFormatType pixelType)
Get Color Information based on Pixel type.

static uint GetPixelTypeMemorySize (Jai_FactoryWrapper.EPixelFormatType pixelType)


Get memory size occupied by each pixel 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

Enumeration Type Documentation

5.24.2.1

enum EPixelTypeColorInfo [inherited]

Color information for the EPixelType enumeration.


GetPixelTypeColorInfo().

To get the Color information call

Enumerator:
Monochrome Monochrome pixel value format.
RGB RGB color pixel value format.
Custom Custom pixel value format.

5.24.2.2

enum EPixelFormatType [inherited]

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

5.24 Image acquisition and manipulation functions

269

GVSP_PIX_BAYRG10_PACKED Bayer RG 10 bit packed (BayerRG10Packed=0x010C0027).


GVSP_PIX_BAYGB10_PACKED Bayer GB 10 bit packed (BayerGB10Packed=0x010C0028).
GVSP_PIX_BAYBG10_PACKED Bayer BG 10 bit packed (BayerBG10Packed=0x010C0029).
GVSP_PIX_BAYGR12_PACKED Bayer GR 12 bit packed (BayerGR12Packed=0x010C002A).
GVSP_PIX_BAYRG12_PACKED Bayer RG 12 bit packed (BayerRG12Packed=0x010C002B).
GVSP_PIX_BAYGB12_PACKED Bayer GB 12 bit packed (BayerGB12Packed=0x010C002C).
GVSP_PIX_BAYBG12_PACKED Bayer BG 12 bit packed (BayerBG12Packed=0x010C002D).
GVSP_PIX_BAYGR16 Bayer GR 16 bit (BayerGR16=0x0110002E).
GVSP_PIX_BAYRG16 Bayer RG 16 bit (BayerRG16=0x0110002F).
GVSP_PIX_BAYGB16 Bayer GB 16 bit (BayerGB16=0x01100030).
GVSP_PIX_BAYBG16 Bayer BG 16 bit (BayerBG16=0x01100031).
GVSP_PIX_RGB8_PACKED RGB 8 bit packed.
GVSP_PIX_BGR8_PACKED BGR 8 bit packed.
GVSP_PIX_RGBA8_PACKED RGBA 8 bit packed.
GVSP_PIX_BGRA8_PACKED BGRA 8 bit packed.
GVSP_PIX_RGB10_PACKED RGB 10 bit packed.
GVSP_PIX_BGR10_PACKED BGR 10 bit packed.
GVSP_PIX_RGB12_PACKED RGB 12 bit packed.
GVSP_PIX_BGR12_PACKED BGR 12 bit packed.
GVSP_PIX_RGB16_PACKED RGB 16 bit packed.
GVSP_PIX_RGB10V1_PACKED RGB 10 bit version 1 packed.
GVSP_PIX_RGB10V2_PACKED RGB 10 bit version 2 packed.
GVSP_PIX_RGB12V1_PACKED RGB 12 bit version 1 packed.
GVSP_PIX_YUV411_PACKED YUV 4.1.1 packed.
GVSP_PIX_YUV422_PACKED YUV 4.2.2 packed.
GVSP_PIX_YUV444_PACKED YUV 4.4.4 packed.
GVSP_PIX_RGB8_PLANAR RGB 8 bit planar.
GVSP_PIX_RGB10_PLANAR RGB 10 bit planar.
GVSP_PIX_RGB12_PLANAR RGB 12 bit planar.
GVSP_PIX_RGB16_PLANAR RGB 16 bit planar.
GVSP_PIX_BGR16_PACKED_INTERNAL RGB 16 bit per color used internally.

5.24.3

Function Documentation

5.24.3.1

static Jai_FactoryWrapper.EPixelTypeColorInfo GetPixelTypeColorInfo


(EPixelFormatType pixelType) [static, inherited]

Get Color Information based on Pixel type.


Parameters:
pixelType Pixel Type enumeration value
Returns:
Jai_FactoryWrapper.EPixelTypeColorInfo

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

270

Module Documentation

5.24.3.2

static uint GetPixelTypeMemorySize (Jai_FactoryWrapper.EPixelFormatType pixelType)


[static, inherited]

Get memory size occupied by each pixel based on Pixel type.


Parameters:
pixelType Pixel Type enumeration value
Returns:
Number of bytes per pixel

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.25 View window specific functions

5.25

271

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.

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 EIVWOptionType { MouseZoom = 0, MouseCursor = 1, CallbackMask = 2, DoubleBuffering


=3}
View Window option types used in J_Image_SetViewWindowOption() and J_Image_GetViewWindowOption().

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_CloseViewWindow (VW_HANDLE WindowHandle)


Close view window previously opened with J_Image_OpenViewWindow() or J_Image_OpenViewWindowEx().

static Jai_FactoryWrapper.EFactoryError J_Image_ShowImage (VW_HANDLE WindowHandle,


ref ImageInfo AqImageInfo, UInt32 RGain, UInt32 GGain, UInt32 BGain)
Display an image in a view window.

static Jai_FactoryWrapper.EFactoryError J_Image_ShowImage (VW_HANDLE WindowHandle,


ref ImageInfo AqImageInfo, EColorInterpolationAlgorithm BayerAlgorithm, UInt32 RGain, UInt32
GGain, UInt32 BGain)
Display an image in a view window using a specific Bayer Color Interpolation algorithm.

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).

static Jai_FactoryWrapper.EFactoryError J_Image_MoveViewWindow (VW_HANDLE WindowHandle, ref POINT Point)


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.25 View window specific functions

273

Move view window.

static Jai_FactoryWrapper.EFactoryError J_Image_ResizeChildWindow (VW_HANDLE WindowHandle, ref RECT Rect)


Resize child(view) window. Resize the child view window to new rectangle specified by RECT.

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_GetFrameWindowRect (VW_HANDLE WindowHandle, ref RECT Rect)


Get position and size of the view window including the windows frame.

static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowTitle (VW_HANDLE WindowHandle, String WindowTitle)


Set the title of 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.

delegate void ImageViewWindowCallBack (VW_HANDLE WindowHandle, EIVWCallbackType


Type, ref IVWCallbackValue CallbackValue)
Delegate to be called as callback function when a View Window event has been detected.

static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowCallback (VW_HANDLE WindowHandle, IntPtr CBObject, ImageViewWindowCallBack CallbackDelegate)

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

Enumeration Type Documentation

5.25.2.1

enum EIVWWindowType [inherited]

Window type used in J_Image_OpenViewWindowEx().


Enumerator:
Overlapped Overlapped window.
Child Child window.
ChildStretch Stretched child window.
OverlappedStretch Stretched overlapped window.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

274

Module Documentation

5.25.2.2

enum EIVWOptionType [inherited]

View Window option types used in J_Image_SetViewWindowOption() and J_Image_GetViewWindowOption().


Enumerator:
MouseZoom Enable/Disable
the
mouse
zoom
feature
using
J_Image_SetViewWindowOption(). The Option parameter is a reference to a boolean value.
MouseCursor Enable/Disable the mouse cursor using J_Image_SetViewWindowOption().
The Option parameter is a reference to a boolean value.
CallbackMask Select which of the callback events to enable using J_Image_SetViewWindowOption(). The Option parameter is a reference to a uint32 value
and the value is a bitmask created by ORing the J_IVW_CALLBACK_TYPE enumeration
values.
DoubleBuffering Enable/Disable
the
double-buffering
using
J_Image_SetViewWindowOption(). The Option parameter is a reference to a boolean value
This will remove any View Window overlay flickering but it will be slightly slower than without
double-buffering.

5.25.2.3

enum EIVWCallbackType [inherited]

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

5.25 View window specific functions

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

enum EColorInterpolationAlgorithm [inherited]

Bayer color interpolation algorithm.


Enumerator:
BayerStandard Standard 3x3 Bayer algorithm.
BayerStandardMultiprocessor Standard 3x3 Bayer algorithm (Enables parallel-processing with
multi-processor/core).
BayerExtended Extended 3x3 Bayer algorithm based on smallest gradient. This enhances horizontal
and vertical lines and avoids "zipper-effect".
BayerExtendedMultiprocessor Extended 3x3 Bayer algorithm based on smallest gradient. This enhances horizontal and vertical lines and avoids "zipper-effect". (Enables parallel-processing with
multi-processor/core).
BayerSimple Simple Bayer algorithm that improves processing speed over the "Standard 3x3 Bayer
Algorithm" but sacrifies the image quality. Instead of averaging neighbour pixels this algorithm
will simply copy values instead.
BayerSimpleMultiprocessor Simple Bayer algorithm that improves processing speed over the "Standard 3x3 Bayer Algorithm" but sacrifies the image quality. Instead of averaging neighbour
pixels this algorithm will simply copy values instead. (Enables parallel-processing with multiprocessor/core).
BayerFast Very fast Bayer algorithm that sacrifies the image quality as well as halfing both the
horizontal and vertical resolution. This can be used in application that only display the images
and where the speed is most important.
BayerFastMultiprocessor Very fast Bayer algorithm that sacrifies the image quality as well as
halfing both the horizontal and vertical resolution. (Enables parallel-processing with multiprocessor/core). This can be used in application that only display the images and where the
speed is most important.

5.25.2.5

enum EColorConversionPixelFormat [inherited]

Image conversion pixelformat options used in J_Image_ConvertImage() and J_Image_Malloc().


Enumerator:
PixelFormatNone This is only used in J_Image_Malloc() to allocate an image with identical
size and pixel format.
PixelFormat24BitSwapRB Swaps the data of R and B. (24bit).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_Image_OpenViewWindow (String


WindowName, ref POINT Point, ref SIZE MaxSize, out VW_HANDLE WindowHandle)
[inherited]

Open image view window.


A window of size MaxSize is created for the client area. When the images are displayed using J_ImageShowImage() the view window will automatically be resized.
// 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);
if (error == EFactoryError.Success)
error = J_Node_ExecuteCommand(nodeHandle);
}
}

See also:
J_Camera_GetNodeByName(CAMERA_HANDLE, String,
ExecuteCommand(NODE_HANDLE), EFactoryError

out NODE_HANDLE), J_Node_-

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.25 View window specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Image_OpenViewWindowEx


(EIVWWindowType WindowType, String WindowName, ref RECT FrameRect, ref SIZE
MaxSize, HWND hParent, out VW_HANDLE WindowHandle) [inherited]

Open image view window.


A window of size MaxSize is created for the client area. When the images are displayed using J_ImageShowImage() the view window will automatically be resized.
Parameters:
WindowType Type of window to be displayed
WindowName Name to be displayed in the view window caption
FrameRect The view window frame location on the screen
MaxSize Maximum size of the view window
hParent Windows handle to the parent window
WindowHandle The handle of the created window (window object) is returned.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.25.3.3

static Jai_FactoryWrapper.EFactoryError J_Image_CloseViewWindow (VW_HANDLE


WindowHandle) [inherited]

Close view window previously opened with J_Image_OpenViewWindow() or J_Image_OpenViewWindowEx().


Parameters:
WindowHandle Handle
that
J_Image_OpenViewWindow()
OpenViewWindowEx() returned.
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

or

J_Image_-

278

Module Documentation

5.25.3.4

static Jai_FactoryWrapper.EFactoryError J_Image_ShowImage (VW_HANDLE


WindowHandle, ref ImageInfo AqImageInfo, UInt32 RGain, UInt32 GGain, UInt32
BGain) [inherited]

Display an image in a view window.


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_-

AqImageInfo ImageInfo structure with information on RAW image.


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.25.3.5

static Jai_FactoryWrapper.EFactoryError J_Image_ShowImage (VW_HANDLE


WindowHandle, ref ImageInfo AqImageInfo, EColorInterpolationAlgorithm
BayerAlgorithm, UInt32 RGain, UInt32 GGain, UInt32 BGain) [inherited]

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_-

AqImageInfo ImageInfo structure with information on RAW image.


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.25.3.6

static Jai_FactoryWrapper.EFactoryError J_Image_SetImageOffset (VW_HANDLE


WindowHandle, ref POINT Offset, Int32 ZoomRatio) [inherited]

Set image offset and zoom ratio.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.25 View window specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Image_SetImageOffsetEx (VW_HANDLE


WindowHandle, ref POINT Offset, double ZoomRatioX, double ZoomRatioY)
[inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_GetImageOffsetEx (VW_HANDLE


WindowHandle, ref POINT Offset, ref double ZoomRatioX, ref double ZoomRatioY)
[inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_MoveViewWindow (VW_HANDLE


WindowHandle, ref POINT Point) [inherited]

Move view window.


Moves the view window to the absolute position specified by Point
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx().

using

J_Image_-

Point Upper left position of the view window.


Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.25.3.10

static Jai_FactoryWrapper.EFactoryError J_Image_ResizeChildWindow


(VW_HANDLE WindowHandle, ref RECT Rect) [inherited]

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_-

Rect Relative rectangular coordinates from parent window.


Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.25.3.11

static Jai_FactoryWrapper.EFactoryError J_Image_GetViewWindowRect


(VW_HANDLE WindowHandle, ref RECT Rect) [inherited]

Get rectangular coordinates of the client area of the view window.


The current position and size of the client area 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_-

Rect Current view window child area coordinates.


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.25 View window specific functions


5.25.3.12

281

static Jai_FactoryWrapper.EFactoryError J_Image_GetFrameWindowRect


(VW_HANDLE WindowHandle, ref RECT Rect) [inherited]

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_-

Rect Current view window frame coordinates.


Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.25.3.13

static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowTitle


(VW_HANDLE WindowHandle, String WindowTitle) [inherited]

Set the title of view window.


Modify the caption text of the view window
Parameters:
WindowHandle Handle to a view window previously opened
OpenViewWindow() or J_Image_OpenViewWindowEx()

using

J_Image_-

WindowTitle String that will be displayed in title bar


Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.25.3.14

static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowOption


(VW_HANDLE WindowHandle, EIVWOptionType Option, ref IVWOptionValue
OptionValue) [inherited]

Set the value for a View Window option.


Modify of the options for the view window
// C# Sample that show how to set a View Window option
...
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);
IVWOptionValue OptionValue;
// Open the live view
EFactoryError error = EFactoryError.Success;
error = J_Image_OpenViewWindow("Live view!", ref pnt, ref maxSize, ou
t WindowHandle);
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_Image_GetViewWindowOption


(VW_HANDLE WindowHandle, EIVWOptionType Option, ref IVWOptionValue
OptionValue) [inherited]

Get the current View Window option value.


Read the value of the options for the view window
Parameters:
WindowHandle Handle to a view window previously opened using J_Image_OpenViewWindow() or J_Image_OpenViewWindowEx()
Option Option type to get
OptionValue Reference to the value to be assigned with the current value for the option
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.25.3.16

delegate void ImageViewWindowCallBack (VW_HANDLE WindowHandle,


EIVWCallbackType Type, ref IVWCallbackValue CallbackValue) [inherited]

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

5.25 View window specific functions

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

static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowCallback


(VW_HANDLE WindowHandle, IntPtr CBObject, ImageViewWindowCallBack
CallbackDelegate) [inherited]

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

Stream channel specific functions

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.

static Jai_FactoryWrapper.EFactoryError J_Image_CloseStream (SP_HANDLE StreamHandle)


Close a stream channel that has previously been opened using J_Image_OpenStream() or J_Image_OpenStreamLight().

static Jai_FactoryWrapper.EFactoryError J_Image_GetStreamInfo (SP_HANDLE StreamHandle,


EStreamInfoCmd Cmd, ref StreamInfoStruct Info, ref UInt32 Size)
Get detailed information about the underlying data stream via stream handle.

static Jai_FactoryWrapper.EFactoryError J_Image_GetStreamHandle (SP_HANDLE StreamHandle, out DATASTREAM_HANDLE DSHandle)


Get DataStream handle from internal image stream handle.

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

5.26 Stream channel specific functions

285

5.26.2

Function Documentation

5.26.2.1

static Jai_FactoryWrapper.EFactoryError J_Image_OpenStream (CAMERA_HANDLE


CameraHandle, UInt32 Channel, IntPtr CBObject, IntPtr CallbackDelegate, out
SP_HANDLE StreamHandle, UInt32 BufferSize, UInt32 McIP) [inherited]

Open image stream channel.


Parameters:
CameraHandle Handle to the camera
Channel Stream channel index. This index is zero-based
CBObject Pointer to a callback class object that contains a dynamic callback function
CallbackDelegate Pointer to a static or dynamic callback delegate
StreamHandle The handle of the created stream channel is returned.
BufferSize Buffersize to be allocated per image
McIP Multicast IP address
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.26.2.2

static Jai_FactoryWrapper.EFactoryError J_Image_OpenStreamLight


(CAMERA_HANDLE CameraHandle, UInt32 Channel, out SP_HANDLE
StreamHandle) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_CloseStream (SP_HANDLE


StreamHandle) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_GetStreamInfo (SP_HANDLE


StreamHandle, EStreamInfoCmd Cmd, ref StreamInfoStruct Info, ref UInt32 Size)
[inherited]

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

5.26 Stream channel specific functions


5.26.2.5

287

static Jai_FactoryWrapper.EFactoryError J_Image_GetStreamHandle (SP_HANDLE


StreamHandle, out DATASTREAM_HANDLE DSHandle) [inherited]

Get DataStream handle from internal image stream handle.


Parameters:
StreamHandle Handle to a valid stream channel, obtained by J_Image_OpenStream() function
or J_Image_OpenStreamLight().
DSHandle The DataStream handle requested
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

288

Module Documentation

5.27

Image manipulation functions

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_FromRawToDIB (ref ImageInfo AqImageInfo,


ref ImageInfo BufferInfo, EColorInterpolationAlgorithm BayerAlgorithm, UInt32 RGain, UInt32
GGain, UInt32 BGain)
Convert image from RAW to DIB.

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToImage (ref ImageInfo AqImageInfo,


ref ImageInfo BufferInfo, UInt32 RGain, UInt32 GGain, UInt32 BGain)
Convert from RAW to an image that can be saved or modified.

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToImage (ref ImageInfo AqImageInfo,


ref ImageInfo BufferInfo, EColorInterpolationAlgorithm BayerAlgorithm, UInt32 RGain, UInt32
GGain, UInt32 BGain)
Convert from RAW to an image that can be saved or modified.

static Jai_FactoryWrapper.EFactoryError J_Image_ConvertImage (ref ImageInfo InputImageInfo,


ref ImageInfo OutputImageInfo, EColorConversionPixelFormat ConversionPixelFormat)
Convert an image to a new image with some other format such as Color to Monochrome conversion.

static Jai_FactoryWrapper.EFactoryError J_Image_Malloc (ref ImageInfo AqImageInfo, ref ImageInfo BufferInfo)


Allocate the buffer memory for the image.

static Jai_FactoryWrapper.EFactoryError J_Image_MallocDIB (ref ImageInfo AqImageInfo, ref ImageInfo BufferInfo)


Allocate the buffer memory for the DIB (32-bit ARGB).

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

5.27 Image manipulation functions

289

static Jai_FactoryWrapper.EFactoryError J_Image_Free (ref ImageInfo BufferInfo)


Free a previously allocated image buffer.

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

Enumeration Type Documentation

5.27.2.1

enum ESaveFileFormat [inherited]

File type used in J_Image_SaveFileEx().


Enumerator:
Tiff Uncompressed Tiff file format.
Jpeg Jpeg file format. When this format is selected then the EncoderParameter should be used in
J_Image_SaveFileEx().
Bmp BMP file format.
Jai Proprietary RAW file format that includes the RAW pixel data as well as additional image informations.
RAW RAW file format that only contains the pixel data. This is identical to using the J_Image_SaveFileRaw() function.

5.27.3

Function Documentation

5.27.3.1

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToDIB (ref ImageInfo


AqImageInfo, ref ImageInfo BufferInfo, UInt32 RGain, UInt32 GGain, UInt32 BGain)
[inherited]

Convert image from RAW to DIB.


Convert the RAW image specified with AqImageInfo into 32-bit aRGB, and store it in the area specified
with BufferInfo.
Parameters:
AqImageInfo Pointer of ImageInfo structure with information on RAW data.
BufferInfo Pointer of 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

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

290

Module Documentation

5.27.3.2

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToDIB (ref ImageInfo


AqImageInfo, ref ImageInfo BufferInfo, EColorInterpolationAlgorithm BayerAlgorithm,
UInt32 RGain, UInt32 GGain, UInt32 BGain) [inherited]

Convert image from RAW to DIB.


Convert the RAW image specified with AqImageInfo into 32-bit aRGB, and store it in the area specified
with BufferInfo. This function makes it possible to specify which Bayer Color Interpolation algorithm to
be used.
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!
Parameters:
AqImageInfo Pointer of ImageInfo structure with information on RAW data.
BufferInfo Pointer of 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.3

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToImage (ref ImageInfo


AqImageInfo, ref ImageInfo BufferInfo, UInt32 RGain, UInt32 GGain, UInt32 BGain)
[inherited]

Convert from RAW to an image that can be saved or modified.


Convert the RAW image specified with AqImageInfo by the following rule, and store it in the area specified
by BufferInfo.
PixelFormat information for the converted image is returned in the BufferInfo structure:
AqImageInfo PixelFormat
8bpp Grayscale
10-16bpp Grayscale
24bpp RGB
30bpp RGB
8bpp Bayer
10-12bpp Bayer

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

5.27 Image manipulation functions

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

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToImage (ref ImageInfo


AqImageInfo, ref ImageInfo BufferInfo, EColorInterpolationAlgorithm BayerAlgorithm,
UInt32 RGain, UInt32 GGain, UInt32 BGain) [inherited]

Convert from RAW to an image that can be saved or modified.


Convert the RAW image specified with AqImageInfo by the following rule, and store it in the area specified
by BufferInfo.
PixelFormat information for the converted image is returned in the BufferInfo structure: This function
makes it possible to specify which Bayer Color Interpolation algorithm to be used.
AqImageInfo PixelFormat
8bpp Grayscale
10-16bpp Grayscale
24bpp RGB
30bpp RGB
8bpp Bayer
10-12bpp Bayer

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

static Jai_FactoryWrapper.EFactoryError J_Image_ConvertImage (ref ImageInfo


InputImageInfo, ref ImageInfo OutputImageInfo, EColorConversionPixelFormat
ConversionPixelFormat) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_Malloc (ref ImageInfo AqImageInfo,


ref ImageInfo BufferInfo) [inherited]

Allocate the buffer memory for the image.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.27 Image manipulation functions

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

static Jai_FactoryWrapper.EFactoryError J_Image_MallocDIB (ref ImageInfo


AqImageInfo, ref ImageInfo BufferInfo) [inherited]

Allocate the buffer memory for the DIB (32-bit ARGB).


Allocate the buffer to store the converted image. Information on the allocated buffer is returned in BufferInfo structure.
// C# Sample that allocated an DIB 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_MallocDIB(ref ImageInfo, ref ConvertedImageInfo);
if (error == EFactoryError.Success)
{
error = J_Image_RawToDIB(ref ImageInfo, ref ConvertedImageInfo, RGa
in, GGain, BGain);
... Do something with the DIB buffer
// Free up the image buffer again
error = J_Image_Free(ref ConvertedImageInfo);
}

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

static Jai_FactoryWrapper.EFactoryError J_Image_Malloc (ref ImageInfo AqImageInfo,


ref ImageInfo BufferInfo, EColorConversionPixelFormat ConversionPixelFormat)
[inherited]

Allocate the buffer memory for the image to use J_Image_ConvertImage().


Allocate the buffer to store the converted image to use J_Image_ConvertImage(). Information on
the allocated buffer is returned in BufferInfo structure.
// C# Sample that allocated an image buffer for use with the \c J_Ima
ge_ConvertImage() 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,
EColorConversionPixelFormat.PixelFormatY);
if (error == EFactoryError.Success)
{
error = J_Image_ConvertImage(ref ImageInfo,
ref ConvertedImageInfo,
EColorConversionPixelFormat.PixelForma
tY);
... Do something with the Y 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.
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

static Jai_FactoryWrapper.EFactoryError J_Image_Free (ref ImageInfo BufferInfo)


[inherited]

Free a previously allocated image buffer.


Frees the memory allocated for an image buffer using J_Image_Malloc(), J_Image_MallocDIB() or J_Image_MallocHDR()
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.27 Image manipulation functions

295

// 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);
}
\endcode

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

Image save and load functions

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.

static Jai_FactoryWrapper.EFactoryError J_Image_SaveFileEx (ref ImageInfo BufferInfo, String


FileName, ESaveFileFormat FileFormat, byte EncoderParameter)
Save an image to disk using various file formats such as TIFF, JPEG, BMP or JAI.

static Jai_FactoryWrapper.EFactoryError J_Image_SaveFileRaw (ref ImageInfo BufferInfo, String


FileName)
Save an image to disk as raw binary file.

static Jai_FactoryWrapper.EFactoryError J_Image_LoadFileRaw (ref ImageInfo BufferInfo, String


FileName)
Load a previously saved RAW image file from disk.

5.28.1

Detailed Description

These functions are used for saving the acquired images to disk as well as loading previously saved images.

The following file formats are currently supported:


1) Tiff: This format is an uncompressed format and it can be used for saving images in up to 16-bit
pixel depth (48-bit color).
2) Jpeg: This format compressed format where the compression ration can be specified as a parameter
to the J_Image_SaveFileEx(). This format only support 8-bit pixel depth (24-bit color)
3) BMP: This is an uncompressed Windows Bitmap format and it only supports 8-bit pixel depth
(24-bit color)
4) JAI: This is an uncompressed RAW file format that support all the GigE Vision file image formats
supported by the JAI SDK

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

5.28 Image save and load functions

297

5.28.2

Function Documentation

5.28.2.1

static Jai_FactoryWrapper.EFactoryError J_Image_SaveFile (ref ImageInfo BufferInfo,


String FileName) [inherited]

Save an image to disk as TIFF file.


Saves an image to disk as a TIFF file. A raw image needs to be converted using J_Image_FromRawToImage() before it can be saved
// C# Sample that converts a raw image and saves 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)
{
// 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:
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

static Jai_FactoryWrapper.EFactoryError J_Image_SaveFileEx (ref ImageInfo


BufferInfo, String FileName, ESaveFileFormat FileFormat, byte EncoderParameter)
[inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_SaveFileRaw (ref ImageInfo


BufferInfo, String FileName) [inherited]

Save an image to disk as raw binary file.


Saves an image to disk as a raw binary file. The image data is saved without any header information so it
is not possible to display the image directly.
Parameters:
BufferInfo Reference to ImageInfo structure in which the information about the image buffer is read.
FileName Full file name and path of the raw binary file to be stored to disk.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.28.2.4

static Jai_FactoryWrapper.EFactoryError J_Image_LoadFileRaw (ref ImageInfo


BufferInfo, String FileName) [inherited]

Load a previously saved RAW image file from disk.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.28 Image save and load functions

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

Pixel access functions

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.

static Jai_FactoryWrapper.EFactoryError J_Image_GetPixelEx (ref ImageInfo BufferInfo, Double


XPos, Double YPos, ref PixelValue Pixel)
Get the pixel at a specified floating-point position.

static Jai_FactoryWrapper.EFactoryError J_Image_SetPixel (ref ImageInfo BufferInfo, ref POINT


Point, ref PixelValue Pixel)
Set the pixel at a specified position.

static Jai_FactoryWrapper.EFactoryError J_Image_GetAverage (ref ImageInfo BufferInfo, ref


RECT MeasureRect, ref PixelValue RGBAverage)
Measures pixel average value for a region in the image.

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

static Jai_FactoryWrapper.EFactoryError J_Image_GetPixel (ref ImageInfo BufferInfo,


ref POINT Point, ref PixelValue Pixel) [inherited]

Get the pixel at a specified position.


Read the current pixel value at the position Point. A raw image needs to be converted using J_Image_FromRawToImage() before pixels can be read.
Parameters:
BufferInfo Reference to ImageInfo structure in which the pixel value will be read.
Point Absolute position in which pixel value is read.
Pixel Pixel value data read from the image.
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.29 Pixel access functions


5.29.2.2

301

static Jai_FactoryWrapper.EFactoryError J_Image_GetPixelEx (ref ImageInfo


BufferInfo, Double XPos, Double YPos, ref PixelValue Pixel) [inherited]

Get the pixel at a specified floating-point position.


Read the current pixel value at the position XPos,YPos. A raw image needs to be converted using J_Image_FromRawToImage() before pixels can be read. The returned pixel value will be generated
using bi-linear interpolation of nearest pixels.
Parameters:
BufferInfo Reference to ImageInfo structure in which the pixel value will be read.
XPos Absolute X-position in which pixel value is read.
YPos Absolute position in which pixel value is read.
Pixel Pixel value data read from the image.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.29.2.3

static Jai_FactoryWrapper.EFactoryError J_Image_SetPixel (ref ImageInfo BufferInfo,


ref POINT Point, ref PixelValue Pixel) [inherited]

Set the pixel at a specified position.


Writes the current pixel value at the position Point. A raw image needs to be converted using J_Image_FromRawToImage() before pixels can be written.
Where to set the actual values inside the PixelValue structure depends on the PixelFormat that can
be read from BufferInfo.
Parameters:
BufferInfo ImageInfo structure in which the pixel value will be written.
Point Absolute position in which pixel value is written.
Pixel Pixel value data to write.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.29.2.4

static Jai_FactoryWrapper.EFactoryError J_Image_GetAverage (ref ImageInfo


BufferInfo, ref RECT MeasureRect, ref PixelValue RGBAverage) [inherited]

Measures pixel average value for a region in the image.


Parameters:
BufferInfo ImageInfo structure which contains a converted image.
MeasureRect Measurement rectangular coordinates.
RGBAverage Measured average pixel value for all the pixels inside the measurement rectangle. The
pixel format for the PixelValue structure will always be in BGR48 format (16 bit per color)
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

302

Module Documentation

5.30

Image white balance control functions

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 J_Image_GetGain (SP_HANDLE StreamHandle, ref


UInt32 RGain, ref UInt32 GGain, ref UInt32 BGain)
Get RGB software gain.

static
Jai_FactoryWrapper.EFactoryError
StreamHandle)

J_Image_ExecuteWhiteBalance

(SP_HANDLE

Calculate software auto white balance.

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

static Jai_FactoryWrapper.EFactoryError J_Image_SetGain (SP_HANDLE


StreamHandle, UInt32 RGain, UInt32 GGain, UInt32 BGain) [inherited]

Set RGB software gain.


The gain is only used inside the factory when the J_Image_OpenStreamLight() has been used to
display live video.
This function doesnt return the white balance gain from inside the camera. It is only used inside the factory
when the J_Image_OpenStreamLight() has been used to display live video
Parameters:
StreamHandle Handle to the stream channel opened using J_Image_OpenStream() or J_Image_OpenStreamLight().
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

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.30 Image white balance control functions


5.30.2.2

303

static Jai_FactoryWrapper.EFactoryError J_Image_GetGain (SP_HANDLE


StreamHandle, ref UInt32 RGain, ref UInt32 GGain, ref UInt32 BGain) [inherited]

Get RGB software gain.


The gain is only used inside the factory when the J_Image_OpenStreamLight() has been used to
display live video. If J_Image_ExecuteWhiteBalance() has been called, the resulting gain values
can be read with this function after the next image has been received on the stream channel.
This function doesnt affect the white balance settings inside the camera.
Parameters:
StreamHandle Handle to the stream channel opened using J_Image_OpenStream() or J_Image_OpenStreamLight().
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.30.2.3

static Jai_FactoryWrapper.EFactoryError J_Image_ExecuteWhiteBalance


(SP_HANDLE StreamHandle) [inherited]

Calculate software auto white balance.


When this function has been called, the resulting gain values can be read with J_Image_GetGain()
function after the next image has been received on the stream channel. The resulting white balance is only
used inside the factory when the J_Image_OpenStreamLight() has been used to display live video.
After executing this function, you can use the J_Image_GetGain() function to get the resulting gain
values.
This function doesnt affect the white balance settings inside the camera.
Parameters:
StreamHandle Handle to the stream channel opened using J_Image_OpenStream() or J_Image_OpenStreamLight().
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

304

Module Documentation

5.31

High Dynamic Range functions

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.

static Jai_FactoryWrapper.EFactoryError J_Image_AnalyzeHDR (ref ImageInfo ImageInfo1, ref


ImageInfo ImageInfo2, ref byte Image1IsBrighter, ref Int32 BlackLevelImage1, ref Int32 BlackLevelImage2, ref float DarkGain)
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().

static Jai_FactoryWrapper.EFactoryError J_Image_FuseHDR (ref ImageInfo BrighterImageInfo, ref


ImageInfo DarkerImageInfo, ref ImageInfo OutputImage, Int32 BrighterBlackLevel, Int32 DarkerBlackLevel, float DarkGain, float DualSlopeGain, byte LogarithmicOutput)
Fuses two input images into a "High Dynamic Range" 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

static Jai_FactoryWrapper.EFactoryError J_Image_MallocHDR (ref ImageInfo


ImageInfo1, ref ImageInfo ImageInfo2, ref ImageInfo BufferInfo) [inherited]

Allocate the buffer memory for the HDR output image.


16-bit per pixel will be allocated and they will be 16-byte alligned in order to speed up the HDR processing.
The allocated HDR image will need to be freed up using J_Image_Free() Information on the allocated
buffer is returned in the J_tIMAGE_INFO structure.
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.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.31 High Dynamic Range functions

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

static Jai_FactoryWrapper.EFactoryError J_Image_AnalyzeHDR (ref ImageInfo


ImageInfo1, ref ImageInfo ImageInfo2, ref byte Image1IsBrighter, ref Int32
BlackLevelImage1, ref Int32 BlackLevelImage2, ref float DarkGain) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_FuseHDR (ref ImageInfo


BrighterImageInfo, ref ImageInfo DarkerImageInfo, ref ImageInfo OutputImage, Int32
BrighterBlackLevel, Int32 DarkerBlackLevel, float DarkGain, float DualSlopeGain, byte
LogarithmicOutput) [inherited]

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 Lookup-Table functions

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.

static Jai_FactoryWrapper.EFactoryError J_Image_FreeLUT (ref LUTInfo LUTInfo)


Free the LUT memory previously allocated using J_Image_MallocLUT().

static Jai_FactoryWrapper.EFactoryError J_Image_ConvertLUT (ref LUTInfo SourceLUTInfo, ref


LUTInfo DestinationLUTInfo)
Convert an existing LUT into a different size and copy the data.

static Jai_FactoryWrapper.EFactoryError J_Image_LUT (ref ImageInfo ImageInfo, ref LUTInfo


LUTInfo)
Process the image by sending all pixels through the LUT.

static Jai_FactoryWrapper.EFactoryError J_Image_CreateGammaLUT (ref LUTInfo LUTInfo,


UInt32 ColorIndex, double gamma)
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().

static Jai_FactoryWrapper.EFactoryError J_Image_ApplyGammaToLUT (ref LUTInfo LUTInfo,


UInt32 ColorIndex, double gamma)
This function applies a user-defined Gamma LUT to a LUT that has already been initialized with values.

static Jai_FactoryWrapper.EFactoryError J_Image_CreateLinearLUT (ref LUTInfo LUTInfo,


UInt32 ColorIndex, UInt32 X1, UInt32 X2, UInt32 Y1, UInt32 Y2)
This function initializes a LUT with linear values between an user defined input and output range. Any
existing LUT values will be overwritten.

static Jai_FactoryWrapper.EFactoryError J_Image_CreateKneeLUT (ref LUTInfo LUTInfo, UInt32


ColorIndex, POINT knee1, POINT knee2)
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.

static Jai_FactoryWrapper.EFactoryError J_Image_GetLUTValue (ref LUTInfo LUTInfo, UInt32


ColorIndex, UInt32 LUTIndex, ref UInt32 pLUTValue)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

308

Module Documentation
This function directly reads a value from the LUT.

static Jai_FactoryWrapper.EFactoryError J_Image_SetLUTValue (ref LUTInfo LUTInfo, UInt32


ColorIndex, UInt32 LUTIndex, UInt32 LUTValue)
This function directly writes a value to the LUT.

static Jai_FactoryWrapper.EFactoryError J_Image_SaveLUT (ref LUTInfo LUTInfo, String FileName)


This function saves a LUT to disk as a binary file.

static Jai_FactoryWrapper.EFactoryError J_Image_LoadLUT (ref LUTInfo LUTInfo, String FileName)


This function loads a LUT from disk. If the LUT already contains data then it will be overwritten.

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

static Jai_FactoryWrapper.EFactoryError J_Image_MallocLUT (ref ImageInfo


ImageInfo, ref LUTInfo LUTInfo) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_FreeLUT (ref LUTInfo LUTInfo)


[inherited]

Free the LUT memory previously allocated using J_Image_MallocLUT().


Parameters:
LUTInfo Reference to LUTInfo structure with information on LUT.
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 Lookup-Table functions


5.32.2.3

309

static Jai_FactoryWrapper.EFactoryError J_Image_ConvertLUT (ref LUTInfo


SourceLUTInfo, ref LUTInfo DestinationLUTInfo) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_LUT (ref ImageInfo ImageInfo, ref


LUTInfo LUTInfo) [inherited]

Process the image by sending all pixels through the LUT.


All the pixels values in the image will be replaced with the corresponding value from the LUT.
The LUT has to be created using J_Image_MallocLUT() from an image with the identical pixel format
so the LUT has the correct dimension.
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.5

static Jai_FactoryWrapper.EFactoryError J_Image_CreateGammaLUT (ref LUTInfo


LUTInfo, UInt32 ColorIndex, double gamma) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_ApplyGammaToLUT (ref LUTInfo


LUTInfo, UInt32 ColorIndex, double gamma) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_CreateLinearLUT (ref LUTInfo


LUTInfo, UInt32 ColorIndex, UInt32 X1, UInt32 X2, UInt32 Y1, UInt32 Y2)
[inherited]

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

5.32 Lookup-Table functions

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

static Jai_FactoryWrapper.EFactoryError J_Image_CreateKneeLUT (ref LUTInfo


LUTInfo, UInt32 ColorIndex, POINT knee1, POINT knee2) [inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_GetLUTValue (ref LUTInfo


LUTInfo, UInt32 ColorIndex, UInt32 LUTIndex, ref UInt32 pLUTValue)
[inherited]

This function directly reads a value from the LUT.


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
LUTIndex Zero-based index into the LUT.
pLUTValue Reference to UInt32 variable where the LUT value is to be returned.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.32.2.10

static Jai_FactoryWrapper.EFactoryError J_Image_SetLUTValue (ref LUTInfo


LUTInfo, UInt32 ColorIndex, UInt32 LUTIndex, UInt32 LUTValue) [inherited]

This function directly writes a value to the LUT.


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
LUTIndex Zero-based index into the LUT.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.32 Lookup-Table functions

313

LUTValue New UInt32 value to be entered into the LUT.


Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.32.2.11

static Jai_FactoryWrapper.EFactoryError J_Image_SaveLUT (ref LUTInfo LUTInfo,


String FileName) [inherited]

This function saves a LUT to disk as a binary file.


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.
FileName Filename and path to where the LUT will be written.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.32.2.12

static Jai_FactoryWrapper.EFactoryError J_Image_LoadLUT (ref LUTInfo LUTInfo,


String FileName) [inherited]

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

The Histogram functions makes it possible to create a Histogram from an image.

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.

static Jai_FactoryWrapper.EFactoryError J_Image_FreeHistogram (ref HistogramInfo HistogramInfo)


Free the Histogram memory previously allocated using J_Image_MallocHistogram().

static Jai_FactoryWrapper.EFactoryError J_Image_ClearHistogram (ref HistogramInfo HistogramInfo)


Clear the contents of
MallocHistogram().

the

Histogram

memory

previously

allocated

using

J_Image_-

static Jai_FactoryWrapper.EFactoryError J_Image_CreateHistogram (ref ImageInfo ImageInfo, ref


RECT MeasureRect, ref HistogramInfo HistogramInfo)
Creates the Histogram from the image contents.

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

The Histogram functions makes it possible to create a Histogram from an image.

5.33.2

Function Documentation

5.33.2.1

static Jai_FactoryWrapper.EFactoryError J_Image_MallocHistogram (ref ImageInfo


ImageInfo, ref HistogramInfo HistogramInfo) [inherited]

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

5.33 Histogram functions

315

HistogramInfo Reference to HistogramInfo structure with information on Histogram.


Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.33.2.2

static Jai_FactoryWrapper.EFactoryError J_Image_FreeHistogram (ref HistogramInfo


HistogramInfo) [inherited]

Free the Histogram memory previously allocated using J_Image_MallocHistogram().


Parameters:
HistogramInfo Reference to HistogramInfo structure with information on Histogram.
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.33.2.3

static Jai_FactoryWrapper.EFactoryError J_Image_ClearHistogram (ref HistogramInfo


HistogramInfo) [inherited]

Clear the contents of


MallocHistogram().

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

static Jai_FactoryWrapper.EFactoryError J_Image_CreateHistogram (ref ImageInfo


ImageInfo, ref RECT MeasureRect, ref HistogramInfo HistogramInfo) [inherited]

Creates the Histogram from the image contents.


The Histogram will be has to be allocated in advance using J_Image_MallocHistogram()
Parameters:
ImageInfo Reference to ImageInfo structure with information on the image data.
MeasureRect Measurement rectangular coordinates.
HistogramInfo Reference to HistogramInfo structure with information on Histogram.
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

316

Module Documentation

5.33.2.5

static Jai_FactoryWrapper.EFactoryError J_Image_GetHistogramValue (ref


HistogramInfo HistogramInfo, UInt32 ColorIndex, UInt32 HistogramIndex, ref UInt32
pHistogramValue) [inherited]

This function directly reads a value from the Histogram.


The Histogram has to be created using J_Image_MallocHistogram() and initialized using J_Image_CreateHistogram() before this function can be called.
Parameters:
HistogramInfo Reference to HistogramInfo structure with information on Histogram.
ColorIndex Select the Histogram color index to use. 0=Monochrome or Red, 1=Green, 2=Blue
HistogramIndex Zero-based index into the Histogram.
pHistogramValue Reference to UInt32 variable where the Histogram value is to be returned.
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.34 Transformation functions

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().

enum ERotateType { Rotate90DegCw = 0, Rotate90DegCcw = 1, Rotate180Deg = 2 }


Rotate type used in J_Image_Rotate().

Functions
static Jai_FactoryWrapper.EFactoryError J_Image_Flip (ref ImageInfo ImageInfo, EFlipType flipType)
Flip the image contents in the image buffer.

static Jai_FactoryWrapper.EFactoryError J_Image_Rotate (ref ImageInfo ImageInfo, ERotateType


rotateType)
Rotate 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

Enumeration Type Documentation

5.34.2.1

enum EFlipType [inherited]

Flip type used in J_Image_Flip().


Enumerator:
FlipHorizontally Flip Horizontally (Mirror).
FlipVertically Flip Vertically.

5.34.2.2

enum ERotateType [inherited]

Rotate type used in J_Image_Rotate().


Enumerator:
Rotate90DegCw Rotate 90 degree clockwise.
Rotate90DegCcw Rotate 90 degree counter-clockwise.
Rotate180Deg Rotate 180 degree (upside-down).
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

318

Module Documentation

5.34.3

Function Documentation

5.34.3.1

static Jai_FactoryWrapper.EFactoryError J_Image_Flip (ref ImageInfo ImageInfo,


EFlipType flipType) [inherited]

Flip the image contents in the image buffer.


The input images needs to be 8, 10, 12, 14 or 16-bit Monochrome or Bayer-Color unpacked pixel format.
Parameters:
ImageInfo Reference to ImageInfo structure with information on the image data.
flipType Flip type to be used
Returns:
Jai_FactoryWrapper.EFactoryError Errorcode returned by the factory

5.34.3.2

static Jai_FactoryWrapper.EFactoryError J_Image_Rotate (ref ImageInfo ImageInfo,


ERotateType rotateType) [inherited]

Rotate the image contents in the image buffer.


The input images needs to be 8, 10, 12, 14 or 16-bit Monochrome or Bayer-Color unpacked pixel format.
Parameters:
ImageInfo Reference to ImageInfo structure with information on the image data.
rotateType Rotate type 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

5.35 Image Processing functions

5.35

319

Image Processing functions

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.

Lens Distortion Correction Image Processing algorithms


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!

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.

static Jai_FactoryWrapper.EFactoryError J_Image_ProcessingEx (ref ImageInfo InputImageInfo, ref


ImageInfo OutputImageInfo, EProcessFunctionType ProcessingFunction, IntPtr Parameters)
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.

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

Enumeration Type Documentation

5.35.2.1

enum EProcessFunctionType [inherited]

Image Processing algorithm type used in J_Image_Processing().


Enumerator:
RedCompensation Red-Compensation.
RedCompensationMulti Red-Compensation using multi-processor.
GreenCompensation Green-Compensation.
GreenCompensationMulti Green-Compensation using multi-processor.
LensDistortion Lens Distortion Correction.
LensDistortionMulti Lens Distortion Correction using multi-processor.
LensDistortionMapInit Lens Distortion Correction map creation and initialization. If this function
is used then the processing speed of the LensDistortion and LensDistortionMulti
will be faster. The Lens Distortion Correction map will need to be released after the processing
is ended by using LensDistortionMapFree.
LensDistortionMapFree Lens
Distortion
Correction
map
cleanup.
If
the
LensDistortionMapInit function has been used then all allocated resources will be
freed using this function.

5.35.3

Function Documentation

5.35.3.1

static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo


ImageInfo, EProcessFunctionType ProcessingFunction, IntPtr Parameters)
[inherited]

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

5.35 Image Processing functions


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
// instead we will handle the Marshalling directly here instead t
o show how this could be done!
IntPtr pParameters;
// Allocates memory from the unmanaged memory of the process usin
g GlobalAlloc
pParameters = Marshal.AllocHGlobal(Marshal.SizeOf(myRedCompParam)
);
try
{
// Marshals data from a managed object to an unmanaged block of
memory
Marshal.StructureToPtr(myRedCompParam, pParameters, false);
// Call the Red-Compensation Image Processing algorithm
error = J_Image_Processing(ref ConvImageInfo,
EProcessFunctionType.RedCompensation, pParameters);
}
finally
{
// Frees memory previously allocated from the unmanaged memory
of the process with AllocHGlobal
Marshal.FreeHGlobal(pParameters);
}
}
// Free up the image conversion buffer again
error = J_Image_Free(ref ConvImageInfo);
}

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

static Jai_FactoryWrapper.EFactoryError J_Image_ProcessingEx (ref ImageInfo


InputImageInfo, ref ImageInfo OutputImageInfo, EProcessFunctionType
ProcessingFunction, IntPtr Parameters) [inherited]

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

5.35 Image Processing functions


// instead we will handle the Marshalling directly here instead t
o show how this could be done!
IntPtr pParameters;
// Allocates memory from the unmanaged memory of the process usin
g GlobalAlloc
pParameters = Marshal.AllocHGlobal(Marshal.SizeOf(myRedCompParam)
);
try
{
// Marshals data from a managed object to an unmanaged block of
memory
Marshal.StructureToPtr(myRedCompParam, pParameters, false);
// Call the Red-Compensation Image Processing algorithm
error = J_Image_ProcessingEx(ref ConvImageInfo, IntPtr.Zero,
EProcessFunctionType.RedCompensation, pParameters);
}
finally
{
// Frees memory previously allocated from the unmanaged memory
of the process with AllocHGlobal
Marshal.FreeHGlobal(pParameters);
}
}
// Free up the image conversion buffer again
error = J_Image_Free(ref ConvImageInfo);
}

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

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.

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

static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo


ImageInfoRef, RedCompensationStruct RedCompensationParameters, bool
UseMultiProcessor) [static, inherited]

This function performs a Red-Compensation on the image.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.36 Color-Compensation Image Processing algorithms


// C# Sample that perform Red-Compensation on a color image received
from a camera.
...
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;
retsta = Jai_FactoryWrapper.J_Image_Processing(ref ConvImageInfo,
myRedCompParam, true);
}
// Free up the image conversion buffer again
error = J_Image_Free(ref ConvImageInfo);
}

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

static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo


ImageInfoRef, GreenCompensationStruct GreenCompensationParameters, bool
UseMultiProcessor) [static, inherited]

This function performs a Green-Compensation on the image.


Parameters:
ImageInfoRef Reference to ImageInfo structure with information on the image data.
GreenCompensationParameters Green-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

5.37 Lens Distortion Correction Image Processing algorithms

5.37

327

Lens Distortion Correction Image Processing algorithms

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.

static Jai_FactoryWrapper.EFactoryError J_Image_ProcessingInit (ref ImageInfo InputImageInfoRef, ref UndistortStruct UndistortParameters)


This function allocates and initializes an internal undistort map so the following Lens Distortion Correction
calls will be speeded up considerably.

static Jai_FactoryWrapper.EFactoryError J_Image_ProcessingFree (ref ImageInfo InputImageInfoRef, ref UndistortStruct UndistortParameters)


This function releases the memory allocated to the internal undistort map.

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

Enumeration Type Documentation

5.37.2.1

enum EInterpolationType [inherited]

Lens Distortion Interpolation type used in UndistortStruct


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

static Jai_FactoryWrapper.EFactoryError J_Image_Processing (ref ImageInfo


InputImageInfoRef, ref ImageInfo OutputImageInfoRef, UndistortStruct
UndistortParameters, bool UseMultiProcessor) [static, inherited]

This function performs a Lens Distortion Correction on the image.


// C# Sample that perform Lens Distortion Correction on a color image
received from a camera.
// The processing speed of the Lens Distortion Correction will be muc
h faster if this internal map
// is initialized by calling Jai_FactoryWrapper.J_Image_ProcessingIni
t(ref ConvImageInfo, myUndistortParam);
...
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 Lens Distortion Correction:
// Start by setting up the Undistort parameter structure
Jai_FactoryWrapper.UndistortStruct myUndistortParam = new Jai_Fac
toryWrapper.UndistortStruct();
// The lens distortion parameters need to be determined via a cal
ibration process
myUndistortParam.OpticalCenterX = myOpticalCenterX; // Typically
close to the image centre (ImageInfo.SizeX/2)
myUndistortParam.OpticalCenterY = myOpticalCenterY; // Typically
close to the image centre (ImageInfo.SizeY/2)
myUndistortParam.FocalLengthX = myFocalLengthX;
// Typically
the image width (ImageInfo.SizeX)
myUndistortParam.FocalLengthY = myFocalLengthY;
// Typically
the image width (ImageInfo.SizeX)
myUndistortParam.CoeffK1 = myCoeffK1;
// Depending
on lens (around -0.33246 for a std. 4mm lens)
myUndistortParam.CoeffK2 = myCoeffK2;
// Depending
on lens (around 0.01839 for a std. 4mm lens)
myUndistortParam.CoeffK3 = myCoeffK3;
// Depending
on lens (0.0 unless it is a fish-eye lens)
myUndistortParam.CoeffP1 = myCoeffP1;
// Depending
on lens (around -0.00020 for a std. 4mm lens)
myUndistortParam.CoeffP2 = myCoeffP2;
// Depending
on lens (around 0.00022 for a std. 4mm lens)
myUndistortParam.InterpolationType = EInterpolationType.Interpola
tionBiLinear;
retsta = Jai_FactoryWrapper.J_Image_Processing(ref ConvImageInfo,
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.37 Lens Distortion Correction Image Processing algorithms

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

static Jai_FactoryWrapper.EFactoryError J_Image_ProcessingInit (ref ImageInfo


InputImageInfoRef, ref UndistortStruct UndistortParameters) [static,
inherited]

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

static Jai_FactoryWrapper.EFactoryError J_Image_ProcessingFree (ref ImageInfo


InputImageInfoRef, ref UndistortStruct UndistortParameters) [static,
inherited]

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

The CFactory Class

Classes
class CFactory
Factory object class.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.39 The CCamera Class

5.39

The CCamera Class

Classes
class CCamera
Camera object class used by the Managed Factory.

Modules

Image Acquisition Control methods


Camera Connection Status delegate
GigE Vision Event delegate
Node Event delegate
Scripting methods
Direct Register Access methods
GenICam Node Access methods
Image Save methods
Inter-packet Delay calculation methods

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

331

332

Module Documentation

5.40

Scripting and Command Classes

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 Image Acquisition Control methods

5.41

333

Image Acquisition Control methods

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)


Start image aquisition from the camera and optionally display the images in a View Window.

Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow, UInt32 BufferCount, IntPtr ChildWindowHandle)


Start image aquisition from the camera and optionally display the images inside a Child Window.

Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow, UInt32 BufferCount, UInt32 McIP)


Start image aquisition from the camera using Multi Cast and optionally display the images in a View Window.

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

bool EnablePacketResend [get, set]


Enable Image Packet Resend in driver. Must be set before calling StartImageAcquisition().

bool PassCorruptFrames [get, set]


Enable passing of corrupt frames from driver. Must be set before calling StartImageAcquisition().

bool IsGrabbing [get]


Is the acquisition engine running?

UInt64 NumFramesDelivered [get]


This is the number of acquired frames since the last acquisition start.

UInt64 NumFramesLost [get]


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 NumBuffersAnnounced [get]


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 NumFramesQueued [get]


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 NumFramesAwaitingDelivery [get]


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 NumFramesCorruptOnDelivery [get]


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.41 Image Acquisition Control methods

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 void ImageViewWindowDelegate (CCamera camera, Jai_FactoryWrapper.EIVWCallbackType Type, ref Jai_FactoryWrapper.IVWCallbackValue


CallbackValue) [inherited]

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

Jai_FactoryWrapper.EFactoryError StartAcquisition () [inherited]

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

Jai_FactoryWrapper.EFactoryError StopAcquisition () [inherited]

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

Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow,


UInt32 BufferCount) [inherited]

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

Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow,


UInt32 BufferCount, IntPtr ChildWindowHandle) [inherited]

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

5.41 Image Acquisition Control methods


5.41.1.6

337

Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow,


UInt32 BufferCount, UInt32 McIP) [inherited]

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

Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow,


UInt32 BufferCount, UInt32 McIP, IntPtr ChildWindowHandle) [inherited]

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

void StopImageAcquisition () [inherited]

Stop image acquisition and close the live view window (if it has been opened).
See also:
CCamera.StartImageAcquisition(Boolean, UInt32)

5.41.1.9

Jai_FactoryWrapper.EFactoryError StopImageAcquisitionEx () [inherited]

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

Jai_FactoryWrapper.ImageCallBack NewImageDelegate [inherited]

This delegate will be called for every image captured.


// To attach to the NewImageDelegate you have to do like this:
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack(myL
ocalNewImageFunction);
void myLocalNewImageFunction(ref Jai_FactoryWrapper.ImageInfo ImageIn
fo)
{
// Do something with the image (but remember to make it as fast a
s possible!)
}
// To remove the delegate again you have to do like this:
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack(myL
ocalNewImageFunction);

5.41.2.2

ImageViewWindowDelegate ViewWindowEventDelegate [inherited]

This delegate will be called for every View Window event.


// To attach to the ViewWindowEventDelegate you have to do like this:
myCamera.ViewWindowEventDelegate += new Jai_FactoryWrapper.ImageViewW
indowDelegate(myLocalViewWindowDelegateFunction);
void myLocalViewWindowDelegateFunction(CCamera camera, EIVWCallbackTy
pe Type, ref IVWCallbackValue CallbackValue)
{
// Do something with the event (but remember to make it as fast a
s possible!)
}
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.41 Image Acquisition Control methods

339

// To remove the delegate again you have to do like this:


myCamera.ViewWindowEventDelegate -= new Jai_FactoryWrapper.ImageViewW
indowDelegate(myLocalViewWindowDelegateFunction);

5.41.3

Properties

5.41.3.1

UInt32 AcquisitionCount [get, set, inherited]

Number of images to capture


StartImageAcquisition().

by

Image

Acquisition.

Must

be

set

before

calling

See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()

5.41.3.2

bool EnablePacketResend [get, set, inherited]

Enable Image Packet Resend in driver. Must be set before calling StartImageAcquisition().
See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()

5.41.3.3

bool PassCorruptFrames [get, set, inherited]

Enable passing of corrupt frames


StartImageAcquisition().

from

driver.

Must

be

set

before

calling

See also:
CCamera.StartImageAcquisition(Boolean, UInt32), CCamera.StopImageAcquisition()

5.41.3.4

bool IsGrabbing [get, inherited]

Is the acquisition engine running?


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

340

Module Documentation

5.41.3.5

UInt64 NumFramesDelivered [get, inherited]

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

UInt64 NumFramesLost [get, inherited]

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

UInt64 NumBuffersAnnounced [get, inherited]

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

UInt64 NumFramesQueued [get, inherited]

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

5.41 Image Acquisition Control methods

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

UInt64 NumFramesAwaitingDelivery [get, inherited]

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

UInt64 NumFramesCorruptOnDelivery [get, inherited]

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

White-Balance control methods

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

void SetGain (uint redGain, uint greenGain, uint blueGain) [inherited]

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

void ExecuteWhiteBalance (int AWBXOffset, int AWBYOffset, int AWBWidth, int


AWBHeight) [inherited]

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

5.42 White-Balance control methods


Parameters:
AWBXOffset X Offset of the White Balance calculation area used from in the image
AWBYOffset Y Offset of the White Balance calculation area used from in the image
AWBWidth Width of the White Balance calculation area used from in the image
AWBHeight Height of the White Balance calculation area used from in the image

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

343

344

Module Documentation

5.43

Camera Connection Status delegate

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]

This delegate will be called for every change in Connection Status.


// To attach to the NewConnectionStatusDelegate you have to do like t
his:
myCamera.NewConnectionStatusDelegate += new ConnectionStatusCallBack(
myLocalConnectionStatusFunction);
void myLocalNewConnectionStatusFunction(CCamera camera, Jai_FactoryWr
apper.EDeviceConnectionType connectionStatus)
{
// Do something with the new connection status
}
// To remove the delegate again you have to do like this:
myCamera.NewConnectionStatusDelegate -= new ConnectionStatusCallBack(
myLocalNewConnectionStatusFunction);

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.44 GigE Vision Event delegate

5.44

GigE Vision Event delegate

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

Jai_FactoryWrapper.GEVEventCallBack GEVEventDelegate [inherited]

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

Node Event delegate

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

Jai_FactoryWrapper.NodeEventCallBack NodeEventDelegate [inherited]

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 Scripting methods

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().

bool ValidateScript (Script script)


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().

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.

RunScriptResult RunScript (string filename)


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().

RunScriptResult RunScript (Script script)


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().

Script CreateSettingsScript ()
Create a script that contains the complete camera settings that can be saved and later restored.

5.46.1

Enumeration Type Documentation

5.46.1.1

enum RunScriptResult [inherited]

Return value enumeration when running feature scripts.


This enumeration is the return value from RunScript().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

string GetScriptErrorString () [inherited]

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

bool ValidateScript (Script script) [inherited]

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

int GetScriptProgress () [inherited]

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

Command GetScriptLastCommand () [inherited]

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

5.46 Scripting methods


5.46.2.5

349

RunScriptResult RunScript (string filename) [inherited]

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

RunScriptResult RunScript (Script script) [inherited]

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

Script CreateSettingsScript () [inherited]

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

Direct Register Access methods

Functions
Jai_FactoryWrapper.EFactoryError WriteRegister (Int64 address, UInt32 value)
Write a DWORD register value directly to the camera. This does not involve GenICam.

Jai_FactoryWrapper.EFactoryError ReadRegister (Int64 address, ref UInt32 value)


Read a DWORD register directly from the camera. This does not involve GenICam.

5.47.1

Function Documentation

5.47.1.1

Jai_FactoryWrapper.EFactoryError WriteRegister (Int64 address, UInt32 value)


[inherited]

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

Jai_FactoryWrapper.EFactoryError ReadRegister (Int64 address, ref UInt32 value)


[inherited]

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 GenICam Node Access methods

5.48

351

GenICam Node Access methods

Functions
object GetNodeValue (string nodeName)
Get the current value of a named GenICam node.

CNode GetNode (string nodeName)


Get a GenICam node by name.

List< CNode > GetSubFeatures (String ParentFeatureName)


Get a list of subfeatures under a named parent GenICam node.

5.48.1

Function Documentation

5.48.1.1

object GetNodeValue (string nodeName) [inherited]

Get the current value of a named GenICam node.


This function will return the current value of a GenICam node. The return value type will depend on the
node type.
Parameters:
nodeName Name of the GenICam node. This name has to be the GenICam name - not the Display
Name
Returns:
value object

5.48.1.2

CNode GetNode (string nodeName) [inherited]

Get a GenICam node by name.


This function will search for a GenICam node with the specified name
Parameters:
nodeName Name of the GenICam node. This name has to be the GenICam name - not the Display
Name
Returns:
CNode object if the GenICam node is found

5.48.1.3

List<CNode> GetSubFeatures (String ParentFeatureName) [inherited]

Get a list of subfeatures under a named parent GenICam node.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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 Image Save methods

5.49

353

Image Save methods

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_-

Save the next frame from the camera to disk.

Jai_FactoryWrapper.EFactoryError SaveLastFrame (string FileName)


Save the last frame received from the camera to disk as a tiff image. This image might have transformations
and a LUT applied!

Jai_FactoryWrapper.EFactoryError SaveLastRawFrame (string FileName)


Save the last frame received from the camera to disk as a tiff image.

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_-

Save the last frame received from the camera to disk.

Jai_FactoryWrapper.EFactoryError SaveLastFrameRaw (string FileName)


Save the last frame received from the camera to disk as a raw binary file. This image might have transformations and a LUT applied!

Jai_FactoryWrapper.EFactoryError SaveLastRawFrameRaw (string FileName)


Save the last frame received from the camera to disk as a raw binary file.

5.49.1

Function Documentation

5.49.1.1

Jai_FactoryWrapper.EFactoryError SaveNextFrame (string FileName) [inherited]

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

Jai_FactoryWrapper.EFactoryError SaveNextFrame (string FileName,


Jai_FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
[inherited]

Save the next frame from the camera to disk.


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.3

Jai_FactoryWrapper.EFactoryError SaveLastFrame (string FileName) [inherited]

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

Jai_FactoryWrapper.EFactoryError SaveLastRawFrame (string FileName)


[inherited]

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

Jai_FactoryWrapper.EFactoryError SaveLastFrame (string FileName,


Jai_FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
[inherited]

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

5.49 Image Save methods

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

Jai_FactoryWrapper.EFactoryError SaveLastRawFrame (string FileName,


Jai_FactoryWrapper.ESaveFileFormat FileFormat, byte EncoderParameter)
[inherited]

Save the last frame received from the camera to disk.


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.7

Jai_FactoryWrapper.EFactoryError SaveLastFrameRaw (string FileName)


[inherited]

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

Jai_FactoryWrapper.EFactoryError SaveLastRawFrameRaw (string FileName)


[inherited]

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 Zoom and Navigation methods

5.50

357

Zoom and Navigation methods

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 ZoomIn (int zoomSpeed)


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.

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 ZoomOut (int zoomSpeed)


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.

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 ZoomDirect (int zoomPosition)


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.

Jai_FactoryWrapper.EFactoryError NavigateLeftUp ()
Navigate Left and Up using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateLeftUp (int stepSize)


Navigate Left and Up using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateUp ()
Navigate Up using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateUp (int stepSize)


Navigate Up using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateRightUp ()
Navigate Right and Up using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateRightUp (int stepSize)


Navigate Right and Up using specified step size (in pixels).

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 NavigateLeft (int stepSize)


Navigate Left using specified step size (in pixels).

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 NavigateRight (int stepSize)


Navigate Right using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateLeftDown ()
Navigate Left and Down using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateLeftDown (int stepSize)


Navigate Left and Down using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateDown ()
Navigate Down using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateDown (int stepSize)


Navigate Down using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateRightDown ()
Navigate Right and Down using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateRightDown (int stepSize)


Navigate Right and Down using specified step size (in pixels).

5.50.1

Function Documentation

5.50.1.1

Jai_FactoryWrapper.EFactoryError ZoomIn () [inherited]

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

5.50 Zoom and Navigation methods


5.50.1.2

359

Jai_FactoryWrapper.EFactoryError ZoomIn (int zoomSpeed) [inherited]

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

Jai_FactoryWrapper.EFactoryError ZoomOut () [inherited]

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

Jai_FactoryWrapper.EFactoryError ZoomOut (int zoomSpeed) [inherited]

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

Jai_FactoryWrapper.EFactoryError ZoomReset () [inherited]

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

Jai_FactoryWrapper.EFactoryError ZoomDirect (int zoomPosition) [inherited]

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

Jai_FactoryWrapper.EFactoryError NavigateLeftUp () [inherited]

Navigate Left and Up 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.8

Jai_FactoryWrapper.EFactoryError NavigateLeftUp (int stepSize) [inherited]

Navigate Left and Up 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 Navigation step size in pixels
Returns:
Jai_FactoryWrapper.EFactoryError

5.50.1.9

Jai_FactoryWrapper.EFactoryError NavigateUp () [inherited]

Navigate Up 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.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.50 Zoom and Navigation methods

361

Returns:
Jai_FactoryWrapper.EFactoryError

5.50.1.10

Jai_FactoryWrapper.EFactoryError NavigateUp (int stepSize) [inherited]

Navigate Up 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

5.50.1.11

Jai_FactoryWrapper.EFactoryError NavigateRightUp () [inherited]

Navigate Right and Up 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.12

Jai_FactoryWrapper.EFactoryError NavigateRightUp (int stepSize) [inherited]

Navigate Right and Up 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

362

Module Documentation

5.50.1.13

Jai_FactoryWrapper.EFactoryError NavigateLeft () [inherited]

Navigate Left 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.14

Jai_FactoryWrapper.EFactoryError NavigateLeft (int stepSize) [inherited]

Navigate Left 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

5.50.1.15

Jai_FactoryWrapper.EFactoryError NavigateCenter () [inherited]

Navigate back to the center of the image.


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.16

Jai_FactoryWrapper.EFactoryError NavigateRight () [inherited]

Navigate Right 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.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.50 Zoom and Navigation methods

363

Returns:
Jai_FactoryWrapper.EFactoryError

5.50.1.17

Jai_FactoryWrapper.EFactoryError NavigateRight (int stepSize) [inherited]

Navigate Right 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

5.50.1.18

Jai_FactoryWrapper.EFactoryError NavigateLeftDown () [inherited]

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

Jai_FactoryWrapper.EFactoryError NavigateLeftDown (int stepSize) [inherited]

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

Jai_FactoryWrapper.EFactoryError NavigateDown () [inherited]

Navigate 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.21

Jai_FactoryWrapper.EFactoryError NavigateDown (int stepSize) [inherited]

Navigate 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

5.50.1.22

Jai_FactoryWrapper.EFactoryError NavigateRightDown () [inherited]

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

Jai_FactoryWrapper.EFactoryError NavigateRightDown (int stepSize) [inherited]

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

5.50 Zoom and Navigation methods


Parameters:
stepSize
Returns:
Jai_FactoryWrapper.EFactoryError

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

365

366

Module Documentation

5.51

Inter-packet Delay calculation methods

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

int EstimatedInterPacketDelay (double maxFramesPerSecond) [inherited]

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

int EstimatedInterPacketDelay (double maxFramesPerSecond, double


expectedBandWidthUsagePercentage) [inherited]

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

5.51 Inter-packet Delay calculation methods

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

Asynchronous image recording

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.

delegate void AsyncImageRecordingDoneHandler (int Count)


This event is fired when the Asynchronous Image Recording is done.

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.

List< Jai_FactoryWrapper.ImageInfo > GetAsyncRecordedImages ()


Get the complete list of the recorded images.

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.

int AsyncImageRecordingCount [get]


Get number of Images to be recorded using the StartAsyncImageRecording() method.

int TotalAsyncImagesRecordedCount [get]


Get total number of images already recorded using the StartAsyncImageRecording() method.

bool IsAsyncImageRecordingRunning [get]


Is the Asynchronous Image Recording running?

AsyncImageRecordingMode GetAsyncImageRecordingMode [get]


Get the current Asynchronous Image Recording Mode.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

5.52 Asynchronous image recording

5.52.1

Function Documentation

5.52.1.1

Jai_FactoryWrapper.EFactoryError StartAsyncImageRecording (int count,


AsyncImageRecordingMode mode, int skipCount) [inherited]

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

Jai_FactoryWrapper.EFactoryError StopAsyncImageRecording () [inherited]

Stop a previously started Asynchronous Image recording.


Returns:

5.52.1.3

delegate void AsyncImageRecordingDoneHandler (int Count) [inherited]

This event is fired when the Asynchronous Image Recording is done.


Parameters:
Count Number of images captured

5.52.1.4

Jai_FactoryWrapper.EFactoryError GetAsyncRecordedImage (int index, ref


Jai_FactoryWrapper.ImageInfo pImageInfo) [inherited]

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

List<Jai_FactoryWrapper.ImageInfo> GetAsyncRecordedImages () [inherited]

Get the complete list of the recorded images.


Returns:
List of raw images recorded using StartAsyncImageRecording()

5.52.1.6

void FreeAsyncRecordedImages () [inherited]

Free up all the images that has been captured.

5.52.2

Events

5.52.2.1

AsyncImageRecordingDoneHandler AsyncImageRecordingDoneEvent [inherited]

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

int AsyncImageRecordingSkipCount [get, inherited]

Get the number of Images to be skipped during the recording.


The value 0 will record all frames. The values 1 will record every second frame The values 2 will record
every third frame ...

5.52.3.2

int AsyncImageRecordingCount [get, inherited]

Get number of Images to be recorded using the StartAsyncImageRecording() method.

5.52.3.3

int TotalAsyncImagesRecordedCount [get, inherited]

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

5.52 Asynchronous image recording


5.52.3.4

bool IsAsyncImageRecordingRunning [get, inherited]

Is the Asynchronous Image Recording running?


5.52.3.5

AsyncImageRecordingMode GetAsyncImageRecordingMode [get, inherited]

Get the current Asynchronous Image Recording Mode.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

371

372

Module Documentation

5.53

The CNode Class

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 The Managed JAI SDK Classes

5.54

The Managed JAI SDK Classes

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

ActionCommandAck Struct Reference

Action Command Acknowledge structure.

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

Action Command Acknowledge structure.

6.1.2

Member Data Documentation

6.1.2.1

UInt16 Status

GEV.STATUS of the ACK.

376

Class Documentation

6.1.2.2

UInt16 Type

GEV.GVCP of the packet.


6.1.2.3

UInt16 Length

Number of bytes after the header.


6.1.2.4

UInt16 ID

ACK ID to match incomming CMD.


6.1.2.5

UInt32 IPAddress

IP address of the device that sent the Action Command Acknowledge.


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.2 BufferInfoStruct Struct Reference

6.2

377

BufferInfoStruct Struct Reference

This structure is used for reading buffer information with J_DataStream_GetBufferInfo().

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

This structure is used for reading buffer information with J_DataStream_GetBufferInfo().


Depending on which buffer information has been requested, different fields has to be read in order to
interpret the answer correctly

6.2.2

Member Data Documentation

6.2.2.1

IntPtr Base

Frame Data Base address read with J_DataStream_GetBufferInfo(EBufferInfoCmd.BASE).


6.2.2.2

UInt32 Size

Size in bytes read with J_DataStream_GetBufferInfo(EBufferInfoCmd.SIZE).


6.2.2.3

IntPtr UserPointer

User pointer read with J_DataStream_GetBufferInfo(EBufferInfoCmd.USER_PTR).


6.2.2.4

UInt64 TimeStamp

Timestamp read with J_DataStream_GetBufferInfo(EBufferInfoCmd.TIMESTAMP).


6.2.2.5

UInt64 BufferNumber

Buffer Number as announced read with J_DataStream_GetBufferInfo(EBufferInfoCmd.NUMBER).


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.2 BufferInfoStruct Struct Reference


6.2.2.6

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

Payload Type from GigE Vision Stream Protocol


GetBufferInfo(EBufferInfoCmd.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

Number of packets Awaiting Delivery from the driver.


6.2.2.18

UInt32 BlockId

Block-ID from the GigE Vision Stream Protocol.


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.3 CCamera Class Reference

6.3

381

CCamera Class Reference

Camera object class used by the Managed Factory.

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 EDeviceClass { Transmitter = 0, Receiver = 1, Transceiver = 2, Peripheral = 3 }


GigE Vision device class. This enumeration contains all valid Device Classes supported by GigE Vision 1.2
and higher.

enum RunScriptResult {
Success = 0, CameraNotOpen = 1, CameraReadOnly = 2, ScriptAlreadyRunning = 3,
UnableToLoadScript = 4, ValidationError = 5, ScriptCreateError = 6 }
Return value enumeration when running feature scripts.

Public Member Functions


CCamera (IntPtr factoryHandle, string cameraID)
Public constructor for the CCamera object.

Jai_FactoryWrapper.EFactoryError Open ()
Opens the connection to the camera.

Jai_FactoryWrapper.EFactoryError
Open
FactoryWrapper.EDeviceAccessFlags OpenFlags, UInt32 McIP)

(Jai_FactoryDotNET.Jai_-

Opens the connection to the camera.

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)


Start image aquisition from the camera and optionally display the images in a View Window.

Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow, UInt32 BufferCount, IntPtr ChildWindowHandle)


Start image aquisition from the camera and optionally display the images inside a Child Window.

Jai_FactoryWrapper.EFactoryError StartImageAcquisition (Boolean ShowWindow, UInt32 BufferCount, UInt32 McIP)


Start image aquisition from the camera using Multi Cast and optionally display the images in a View Window.

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 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.

string GetScriptErrorString ()
Returns the last error detected during load and/or validation of the script selected by RunScript() or ValidateScript().

bool ValidateScript (Script script)


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().

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference

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.

RunScriptResult RunScript (string filename)


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().

RunScriptResult RunScript (Script script)


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().

Script CreateSettingsScript ()
Create a script that contains the complete camera settings that can be saved and later restored.

Jai_FactoryWrapper.EFactoryError WriteRegister (Int64 address, UInt32 value)


Write a DWORD register value directly to the camera. This does not involve GenICam.

Jai_FactoryWrapper.EFactoryError ReadRegister (Int64 address, ref UInt32 value)


Read a DWORD register directly from the camera. This does not involve GenICam.

object GetNodeValue (string nodeName)


Get the current value of a named GenICam node.

CNode GetNode (string nodeName)


Get a GenICam node by name.

List< CNode > GetSubFeatures (String ParentFeatureName)


Get a list of subfeatures under a named parent GenICam node.

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_-

Save the next frame from the camera to disk.

Jai_FactoryWrapper.EFactoryError SaveLastFrame (string FileName)


Save the last frame received from the camera to disk as a tiff image. This image might have transformations
and a LUT applied!

Jai_FactoryWrapper.EFactoryError SaveLastRawFrame (string FileName)


Save the last frame received from the camera to disk as a tiff image.

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_-

Save the last frame received from the camera to disk.

Jai_FactoryWrapper.EFactoryError SaveLastFrameRaw (string FileName)


Save the last frame received from the camera to disk as a raw binary file. This image might have transformations and a LUT applied!

Jai_FactoryWrapper.EFactoryError SaveLastRawFrameRaw (string FileName)


Save the last frame received from the camera to disk as a raw binary file.

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 ZoomIn (int zoomSpeed)


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.

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 ZoomOut (int zoomSpeed)


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.

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 ZoomDirect (int zoomPosition)


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.

Jai_FactoryWrapper.EFactoryError NavigateLeftUp ()
Navigate Left and Up using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateLeftUp (int stepSize)


Navigate Left and Up using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateUp ()
Navigate Up using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateUp (int stepSize)


Navigate Up using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateRightUp ()
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference

385

Navigate Right and Up using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateRightUp (int stepSize)


Navigate Right and Up using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateLeft ()
Navigate Left using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateLeft (int stepSize)


Navigate Left using specified step size (in pixels).

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 NavigateRight (int stepSize)


Navigate Right using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateLeftDown ()
Navigate Left and Down using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateLeftDown (int stepSize)


Navigate Left and Down using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateDown ()
Navigate Down using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateDown (int stepSize)


Navigate Down using specified step size (in pixels).

Jai_FactoryWrapper.EFactoryError NavigateRightDown ()
Navigate Right and Down using minimum step size (a single pixel).

Jai_FactoryWrapper.EFactoryError NavigateRightDown (int stepSize)


Navigate Right and Down using specified step size (in pixels).

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,

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 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.

delegate void AsyncImageRecordingDoneHandler (int Count)


This event is fired when the Asynchronous Image Recording is done.

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.

List< Jai_FactoryWrapper.ImageInfo > GetAsyncRecordedImages ()


Get the complete list of the recorded images.

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()).

IntPtr CameraHandle = IntPtr.Zero


Camera Handle to be used in the Jai_FactoryWrapper functions(such as Jai_FactoryWrapper.J_Camera_Open(),
Jai_FactoryWrapper.J_Camera_Close()
and Jai_FactoryWrapper.J_Camera_CreateDataStream()).

IntPtr StreamHandle = IntPtr.Zero


Stream Handle to be used in the Jai_FactoryWrapper functions(such as Jai_FactoryWrapper.J_DataStream_AnnounceBuffer(),
Jai_FactoryWrapper.J_DataStream_StartAcquisition() and Jai_FactoryWrapper.J_DataStream_GetBufferInfo()).

IntPtr WindowHandle = IntPtr.Zero


View Window Handle to be used in the Jai_FactoryWrapper functions (such as J_Image_ShowImage(),
J_Image_SetImageOffset() and J_Image_MoveViewWindow()).

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference

387

Properties
object Tag [get, set]
Camera Tag This tag can be used for storing any object related to the camera.

double FramesPerSecond [get]


Average frames recieved per second. This values is automatically updated when Image Aquisition is active.

double FramesDisplayedPerSecond [get]


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.

UInt32 ImageSize [get]


Image Size in bytes for the last received image. This will be overwritten when the next images is received.

UInt32 SizeX [get]


Offset X for the last received image. This will be overwritten when the next images is received.

UInt32 SizeY [get]


Size Y for the last received image. This will be overwritten when the next images is received.

UInt32 OffsetX [get]


Offset X for the last received image. This will be overwritten when the next images is received.

UInt32 OffsetY [get]


Offset Y for the last received image. This will be overwritten when the next images is received.

UInt64 TimeStamp [get]


Timestamp from the last received image. This timestamp will be overwritten when the next images is received.

UInt64 TimeStampMs [get]


Timestamp from the last received image in Milliseconds. This timestamp will be overwritten when the next
images is received.

UInt32 BlockId [get]


Block ID from the GigE Vision Stream for the last received image. This Block ID will be overwritten when
the next images is received.

UInt64 TickFrequency [get]


The unit of the TimeStamp value specific to the camera. The Timestamp tick frequency can be read from the
camera using GenICam node GevTimestampTickFrequency.

UInt32 MissingPackets [get]


Number of missing packets from the last received frame. This value will be overwritten when the next images
is received.

UInt64 FrameCounter [get, set]


Total number of images received. This value can be reset by assigning 0 to the value.

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.

bool StretchLiveVideo [get, set]


Stretch the images from the cameras in the Live Video window.

bool EnableMouseZoom [get, set]


Enable mouse zoom in the Live Video window.

bool EnableMouseCursorDisplay [get, set]


Enable mouse cursor display in the Live Video window.

bool RestoreLiveVideoWindow [get, set]


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.

Rectangle LiveVideoWindowRectangle [get, set]


Set or get the Live Video Window location and size.

bool SkipImageDisplayWhenBusy [get, set]


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.

bool RotateImage [get, set]


Rotate the image before displaying it. The rotation is determined by RotationType.

Jai_FactoryWrapper.ERotateType ImageRotateType [get, set]


Select the type of rotation to be performed on the image before displaying it.

bool FlipImageHorizontally [get, set]


Flip the image horizontally (mirror) before displaying it.

bool FlipImageVertically [get, set]


Flip the image vertically (upside-down) before displaying it.

bool EnableLUT [get, set]


Use Lookup-table before image display.

Jai_FactoryWrapper.LUTInfo LUT [get, set]


Use Lookup-table before image display.

bool IsOpen [get]


Flag showing if the camera connection has been opened successfully.

bool IsReadOnly [get]


Flag showing if the camera connection has been opened as ReadOnly or not.

Jai_FactoryWrapper.EDeviceConnectionType ConnectionStatus [get]


Current connection status for the camera. This status is maintained based on events from the Transport
Layer.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference

389

bool IsAcquisitionRunning [get]


Flag showing if the camera is currently streaming images to the PC.

bool IsLastFrameAvailable [get]


Flag showing if the last received frame is stored so it can be saved later using SaveLastFrame().

Jai_FactoryDotNET.Jai_FactoryWrapper.ImageInfo LastFrameCopy [get]


Get a copy of the last received frame (after any processing such as transformations and LUT has been
applied).

Jai_FactoryDotNET.Jai_FactoryWrapper.ImageInfo LastRawFrameCopy [get]


Get a copy of the last received frame directly from the camera.

bool IsBayerCamera [get]


Flag showing if the camera is sending images in Bayer format to the PC.

Jai_FactoryWrapper.EAcqStartFlags AcquisitionStartFlag [get, set]


This flag is determining how the Image Acquisition is started.
StartImageAcquisition().

It must be set before calling

string CameraID [get]


Unique camera ID obtained using the J_Factory_GetCameraIDByIndex().

string Manufacturer [get]


Manufacturer Name obtained using the J_Factory_GetCameraInfo(). The camera connection does
not need to be opened before this information is available.

string ModelName [get]


Model Name obtained using the J_Factory_GetCameraInfo(). The camera connection does not
need to be opened before this information is available.

EDeviceClass DeviceClass [get]


GigE Vision Device Class. This indicated the streaming capabilities of the device introduced in GigE Vision
1.2.

string IPAddress [get]


IP Address obtained using the J_Factory_GetCameraInfo(). The camera connection does not need
to be opened before this information is available.

string MACAddress [get]


MAC address obtained using the J_Factory_GetCameraInfo(). The camera connection does not
need to be opened before this information is available.

string UserName [get]


Used-defined Name obtained using the J_Factory_GetCameraInfo(). The camera connection does
not need to be opened before this information is available.

string SerialNumber [get]


Serial Number obtained using the J_Factory_GetCameraInfo(). The camera connection does not
need to be opened before this information is available.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

390

Class Documentation

string InterfaceID [get]


Interface ID obtained using the J_Factory_GetCameraInfo(). The camera connection does not
need to be opened before this information is available.

CFactory.EDriverType DriverType [get]


Drivertype derived from the CCamera.InterfaceID string (For instance SocketDriver or FilterDriver).

uint NumOfDataStreams [get]


Number of Data Streams available for the camera.

string ConfigModelName [get]


Model Name read from the Configuration file (XML-file) when the camera connection has been opened.

string ConfigVendorName [get]


Vendor Name read from the Configuration file (XML-file) when the camera connection has been opened.

string ConfigToolTip [get]


Tooltip read from the Configuration file (XML-file) when the camera connection has been opened.

string ConfigStandardNameSpace [get]


Standard Name Space read from the Configuration file (XML-file) when the camera connection has been
opened.

string ConfigGenApiVersion [get]


GenApi Version read from the Configuration file (XML-file) when the camera connection has been opened.

string ConfigSchemaVersion [get]


GenICam Schema Version read from the Configuration file (XML-file) when the camera connection has been
opened.

string ConfigDeviceVersion [get]


Camera Device Version read from the Configuration file (XML-file) when the camera connection has been
opened.

string ConfigProductGuid [get]


Unique Product GUID read from the Configuration file (XML-file) when the camera connection has been
opened.

string ConfigVersionGuid [get]


Configuration File Version GUID read from the Configuration file (XML-file) when the camera connection
has been opened.

Boolean EnableColorInterpolation [get, set]


Enable Bayer Color Interpolation.

Jai_FactoryWrapper.EColorInterpolationAlgorithm
set]

ColorInterpolationAlgorithm [get,

Bayer Color Interpolation Algorithm.

UInt32 AcquisitionCount [get, set]


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference


Number of images to capture
StartImageAcquisition().

391
by

Image

Acquisition.

Must

be

set

before

calling

bool EnablePacketResend [get, set]


Enable Image Packet Resend in driver. Must be set before calling StartImageAcquisition().

bool PassCorruptFrames [get, set]


Enable passing of corrupt frames from driver. Must be set before calling StartImageAcquisition().

bool IsGrabbing [get]


Is the acquisition engine running?

UInt64 NumFramesDelivered [get]


This is the number of acquired frames since the last acquisition start.

UInt64 NumFramesLost [get]


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 NumBuffersAnnounced [get]


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 NumFramesQueued [get]


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 NumFramesAwaitingDelivery [get]


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 NumFramesCorruptOnDelivery [get]


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().

int AsyncImageRecordingSkipCount [get]


Get the number of Images to be skipped during the recording.

int AsyncImageRecordingCount [get]


Get number of Images to be recorded using the StartAsyncImageRecording() method.

int TotalAsyncImagesRecordedCount [get]


Get total number of images already recorded using the StartAsyncImageRecording() method.

bool IsAsyncImageRecordingRunning [get]


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

392

Class Documentation
Is the Asynchronous Image Recording running?

AsyncImageRecordingMode GetAsyncImageRecordingMode [get]


Get the current Asynchronous Image Recording Mode.

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

Camera object class used by the Managed Factory.


The Camera class contains all settings related to a camera
See also:
Jai_FactoryWrapper

6.3.2

Member Enumeration Documentation

6.3.2.1

enum AsyncImageRecordingMode

Specify the asynchronous image recording mode.


The supported types are either a List where the recording automatically stops when it is full or a Cyclic
Buffer where the oldest image is automatically overwritten until the recording is stopped
Enumerator:
List List of images. The recordings automatically stops after the specified number of images is
recorded.
CyclicBuffer Cyclic buffer. The recording automatically overwrites the oldest element.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference


6.3.2.2

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

Constructor & Destructor Documentation

6.3.3.1

CCamera (IntPtr factoryHandle, string cameraID)

Public constructor for the CCamera object.


This constructor is normally not used directly since a collection of CCamera objects will automatically be
created using the Factory object during CFactory.UpdateCameraList()
Parameters:
factoryHandle Valid handle to an opened Factory object. This handle is obtained from the CFactory
object like myFactory.FactoryHandle
cameraID Unique
camera
GetCameraIDByIndex()

ID

string

returned

6.3.4

Member Function Documentation

6.3.4.1

Jai_FactoryWrapper.EFactoryError Open ()

by

Jai_FactoryWrapper.J_Factory_-

Opens the connection to the camera.


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
Returns:
Jai_FactoryWrapper.EFactoryError

6.3.4.2

Jai_FactoryWrapper.EFactoryError Open (Jai_FactoryDotNET.Jai_FactoryWrapper.EDeviceAccessFlags OpenFlags, UInt32 McIP)

Opens the connection to the camera.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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 ()

Closes a previously opened connection to the camera.


See also:
CCamera.Open()
Returns:
Jai_FactoryWrapper.EFactoryError

6.3.5

Member Data Documentation

6.3.5.1

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()).

6.3.5.2

IntPtr CameraHandle = IntPtr.Zero

Camera Handle to be used in the Jai_FactoryWrapper functions(such as Jai_FactoryWrapper.J_Camera_Open(),


Jai_FactoryWrapper.J_Camera_Close()
and Jai_FactoryWrapper.J_Camera_CreateDataStream()).
Factory Handle to be used in the Jai_FactoryWrapper functions

6.3.5.3

IntPtr StreamHandle = IntPtr.Zero

Stream Handle to be used in the Jai_FactoryWrapper functions(such as Jai_FactoryWrapper.J_DataStream_AnnounceBuffer(),


Jai_FactoryWrapper.J_DataStream_StartAcquisition() and Jai_FactoryWrapper.J_DataStream_GetBufferInfo()).
Camera Handle to be used in the Jai_FactoryWrapper functions
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference


6.3.5.4

395

IntPtr WindowHandle = IntPtr.Zero

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

object Tag [get, set]

Camera Tag This tag can be used for storing any object related to the camera.
6.3.6.2

double FramesPerSecond [get]

Average frames recieved per second. This values is automatically updated when Image Aquisition is active.
6.3.6.3

double FramesDisplayedPerSecond [get]

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

UInt32 ImageSize [get]

Image Size in bytes for the last received image. This will be overwritten when the next images is received.
6.3.6.5

UInt32 SizeX [get]

Offset X for the last received image. This will be overwritten when the next images is received.
6.3.6.6

UInt32 SizeY [get]

Size Y for the last received image. This will be overwritten when the next images is received.
6.3.6.7

UInt32 OffsetX [get]

Offset X for the last received image. This will be overwritten when the next images is received.
6.3.6.8

UInt32 OffsetY [get]

Offset Y for the last received image. This will be overwritten when the next images is received.
6.3.6.9

UInt64 TimeStamp [get]

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

UInt64 TimeStampMs [get]

Timestamp from the last received image in Milliseconds. This timestamp will be overwritten when the next
images is received.

6.3.6.11

UInt32 BlockId [get]

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

UInt64 TickFrequency [get]

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

UInt32 MissingPackets [get]

Number of missing packets from the last received frame. This value will be overwritten when the next
images is received.

6.3.6.14

UInt64 FrameCounter [get, set]

Total number of images received. This value can be reset by assigning 0 to the value.

6.3.6.15

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.

6.3.6.16

bool StretchLiveVideo [get, set]

Stretch the images from the cameras in the Live Video window.

6.3.6.17

bool EnableMouseZoom [get, set]

Enable mouse zoom in the Live Video window.

6.3.6.18

bool EnableMouseCursorDisplay [get, set]

Enable mouse cursor display in the Live Video window.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference


6.3.6.19

397

bool RestoreLiveVideoWindow [get, set]

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

Rectangle LiveVideoWindowRectangle [get, set]

Set or get the Live Video Window location and size.


6.3.6.21

bool SkipImageDisplayWhenBusy [get, set]

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

bool RotateImage [get, set]

Rotate the image before displaying it. The rotation is determined by RotationType.
6.3.6.23

Jai_FactoryWrapper.ERotateType ImageRotateType [get, set]

Select the type of rotation to be performed on the image before displaying it.
6.3.6.24

bool FlipImageHorizontally [get, set]

Flip the image horizontally (mirror) before displaying it.


6.3.6.25

bool FlipImageVertically [get, set]

Flip the image vertically (upside-down) before displaying it.


6.3.6.26

bool EnableLUT [get, set]

Use Lookup-table before image display.


6.3.6.27

Jai_FactoryWrapper.LUTInfo LUT [get, set]

Use Lookup-table before image display.


6.3.6.28

bool IsOpen [get]

Flag showing if the camera connection has been opened successfully.


6.3.6.29

bool IsReadOnly [get]

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

Jai_FactoryWrapper.EDeviceConnectionType ConnectionStatus [get]

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

bool IsAcquisitionRunning [get]

Flag showing if the camera is currently streaming images to the PC.

6.3.6.32

bool IsLastFrameAvailable [get]

Flag showing if the last received frame is stored so it can be saved later using SaveLastFrame().

6.3.6.33

Jai_FactoryDotNET.Jai_FactoryWrapper.ImageInfo LastFrameCopy [get]

Get a copy of the last received frame (after any processing such as transformations and LUT has been
applied).

6.3.6.34

Jai_FactoryDotNET.Jai_FactoryWrapper.ImageInfo LastRawFrameCopy [get]

Get a copy of the last received frame directly from the camera.

6.3.6.35

bool IsBayerCamera [get]

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

Jai_FactoryWrapper.EAcqStartFlags AcquisitionStartFlag [get, set]

This flag is determining how the Image Acquisition is started.


StartImageAcquisition().

6.3.6.37

It must be set before calling

string CameraID [get]

Unique camera ID obtained using the J_Factory_GetCameraIDByIndex().


This unique string contains information about Transport Layer, Driver Type, NIC interface MAC-address
etc.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference


6.3.6.38

399

string Manufacturer [get]

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

string ModelName [get]

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

EDeviceClass DeviceClass [get]

GigE Vision Device Class. This indicated the streaming capabilities of the device introduced in GigE
Vision 1.2.
6.3.6.41

string IPAddress [get]

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

string MACAddress [get]

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

string UserName [get]

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

string SerialNumber [get]

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

string InterfaceID [get]

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

CFactory.EDriverType DriverType [get]

Drivertype derived from the CCamera.InterfaceID string (For instance SocketDriver or FilterDriver).
6.3.6.47

uint NumOfDataStreams [get]

Number of Data Streams available for the camera.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

string ConfigVendorName [get]

Vendor Name read from the Configuration file (XML-file) when the camera connection has been opened.
6.3.6.50

string ConfigToolTip [get]

Tooltip read from the Configuration file (XML-file) when the camera connection has been opened.
6.3.6.51

string ConfigStandardNameSpace [get]

Standard Name Space read from the Configuration file (XML-file) when the camera connection has been
opened.
6.3.6.52

string ConfigGenApiVersion [get]

GenApi Version read from the Configuration file (XML-file) when the camera connection has been opened.
6.3.6.53

string ConfigSchemaVersion [get]

GenICam Schema Version read from the Configuration file (XML-file) when the camera connection has
been opened.
6.3.6.54

string ConfigDeviceVersion [get]

Camera Device Version read from the Configuration file (XML-file) when the camera connection has been
opened.
6.3.6.55

string ConfigProductGuid [get]

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

string ConfigVersionGuid [get]

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

Boolean EnableColorInterpolation [get, set]

Enable Bayer Color Interpolation.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.3 CCamera Class Reference


6.3.6.58

Jai_FactoryWrapper.EColorInterpolationAlgorithm ColorInterpolationAlgorithm
[get, set]

Bayer Color Interpolation Algorithm.


The documentation for this class was generated from the following file:
Camera.cs

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

401

402

Class Documentation

6.4

CFactory Class Reference

Factory object class.

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.

Public Member Functions


CFactory ()
Public constructor for the CFactory object.

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 Open (String RegistryFile)


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.

bool UpdateCameraList (EDriverType preferredDriverType)


Update the CCamera List using GigE Vision Device Discovery
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.

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.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.4 CFactory Class Reference

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.
.

Jai_FactoryWrapper.EFactoryError SendActionCommand (UInt32 DeviceKey, UInt32 GroupKey,


UInt32 GroupMask)
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.
.

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.

bool EnableAutoForceIP [get, set]


This flag enables automatic Force IP handling for the Device Discovery. It has to be set up before calling
UpdateCameraList().

String Version [get]


Jai_Factory.dll version information

String BuildDate [get]


Jai_Factory.dll Build Date

String BuildTime [get]


Jai_Factory.dll Build Time

String Manufacturer [get]


Jai_Factory.dll Manufacturer

uint NumOfCameras [get]


Get the number of cameras found during Device Discovery.

6.4.1

Detailed Description

Factory object class.


The Factory class contains all settings related to the Factory. It used the Jai_FactoryWrapper to communicate with the unmanaged Jai_Factory.dll
See also:
Jai_FactoryWrapper

6.4.2

Member Enumeration Documentation

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

Constructor & Destructor Documentation

6.4.3.1

CFactory ()

Public constructor for the CFactory object.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.4 CFactory Class Reference

6.4.4

Member Function Documentation

6.4.4.1

void Dispose ()

405

This object will be cleaned up by the Dispose method.


6.4.4.2

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

Jai_FactoryWrapper.EFactoryError Open (String RegistryFile)

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 ()

Close the previously opened CFactory object.


Returns:

6.4.4.5

bool UpdateCameraList (EDriverType preferredDriverType)

Update the CCamera List using GigE Vision Device Discovery


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:
CCamera, CFactory.PreferredDriverType
Parameters:
preferredDriverType
Returns:
Boolean indicating if there has been any changes

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

6.4 CFactory Class Reference

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

Jai_FactoryWrapper.EFactoryError SendActionCommand (UInt32 DeviceKey, UInt32


GroupKey, UInt32 GroupMask)

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

Member Data Documentation

6.4.5.1

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.
See also:
UpdateCameraList(EDriverType), CCamera

6.4.5.2

FACTORY_HANDLE FactoryHandle

Handle to the Factory.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.4 CFactory Class Reference

6.4.6

Property Documentation

6.4.6.1

EDriverType PreferredDriverType [get, set]

409

The preferred driver type used to filter the cameras found during Device Discovery.
See also:
UpdateCameraList(EDriverType)

6.4.6.2

bool EnableAutoForceIP [get, set]

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

String Version [get]

Jai_Factory.dll version information


Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_Factory_GetInfo() functions return an error

6.4.6.4

String BuildDate [get]

Jai_Factory.dll Build Date


Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_Factory_GetInfo() functions return an error

6.4.6.5

String BuildTime [get]

Jai_Factory.dll Build Time


Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_Factory_GetInfo() functions return an error

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

410

Class Documentation

6.4.6.6

String Manufacturer [get]

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

uint NumOfCameras [get]

Get the number of cameras found during Device Discovery.


Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_Factory_GetNumOfCameras() functions return an error
The documentation for this class was generated from the following file:
Factory.cs

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.5 CNode Class Reference

6.5

411

CNode Class Reference

GenICam Node object class used by the Managed Factory.

Classes
class IEnumValue
This class contains information about a single enumeration entry node inside an IEnumeration node.

Public Member Functions


IEnumValue FindEnumValue (string enumValueName, bool findExact)
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.

CNode (IntPtr nodeHandle)


Public constructor for the CNode object. The CNode object will be created based on the Node Handle
passed to the constructor.

Jai_FactoryWrapper.EFactoryError ImposeAccessMode (Jai_FactoryWrapper.EConfAccessMode


accessMode)
Set the current access mode of the node. The access mode might change at runtime depending on the values
of other nodes.

Jai_FactoryWrapper.EFactoryError ImposeVisibility (Jai_FactoryWrapper.EConfVisibility visibility)


Set the current recommended visibility of the 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.

string DisplayName [get]


User friendly name for the node. If no DisplayName is not found in the XML-file the DisplayName
will contain the Name value instead.

string ToolTip [get]


Short description of the node. If no Tooltip is not found in the XML-file the Tooltip will contain the
DisplayName value instead.

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.

Jai_FactoryWrapper.EConfNameSpace NameSpace [get]


GenICam name space. This can be "Standard" or "Custom".

Jai_FactoryWrapper.EConfRepresentation Representation [get]


Representation of the value in a Graphical User Interface.

Jai_FactoryWrapper.EDisplayNotation DisplayNotation [get, set]


Display Notation for Float node values in a Graphical User Interface.

Int64 DisplayPrecision [get, set]


Display Precision for Float node values in a Graphical User Interface.

String Unit [get]


Unit of the value in a Graphical User Interface.

String DocuURL [get]


Documentation URL for the node.

bool IsCachable [get]


Is the node cachable or do we need to read it back once in a while to get changes?

Jai_FactoryWrapper.EConfCachingMode CachingMode [get]


GenICam caching mode.

Int64 PollingTime [get]


Recommended polling time (in milliseconds).

string EventID [get]


Event ID string.

bool IsStreamable [get]


Is the node streamable?

bool IsDeprecated [get]


Is the node Deprecated?

bool IsSelector [get]


Is the node a Selector Node?

List< CNode > SelectedNodes [get]


Selected nodes (only if this is a Selector Node).

List< String > SelectingNodeNames [get]


Names of all Selecting nodes (only if other nodes are selectors for this node).

IntPtr AliasNodeHandle [get]


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.5 CNode Class Reference

413

Is there another node that displays the same feature in a different way.

IntPtr FloatAliasNodeHandle [get]


Is there an IFloat node that displays the same feature as this IInteger node?

IntPtr IntegerAliasNodeHandle [get]


Is there an IInteger node that displays the same feature as this IFloat node?

IntPtr EnumAliasNodeHandle [get]


Is there an IEnumeration node that displays the same feature as this IFloat node?

Jai_FactoryWrapper.EConfNodeType NodeType [get]


GenICam node type.

IEnumValue[ ] EnumValues [get]


If the node is of type IEnumeration, then the EnumValues array will contain the different enumeration
values defined for the node.

object Tag [get, set]


GenICam node Tag This tag can be used for storing any object related to the Node.

IntPtr NodeHandle [get]


The handle of this node. This handle can be used for calling the Jai_FactoryWrapper.J_Node_xxx() functions.

Jai_FactoryWrapper.EConfAccessMode AccessMode [get, set]


Get/set the current access mode of the node. The access mode might change at runtime depending on the
values of other nodes.

Jai_FactoryWrapper.EConfVisibility Visibility [get, set]


Get/set the current recommended visibility of the node.

object Min [get]


Get minimum value for the node. The value type depends on the node type.

object Max [get]


Get maximum value for the node. The value type depends on the node type.

object Inc [get]


Get increment value for the node. The value type depends on the node type.

object Length [get]


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.

object Address [get]


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.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

414

Class Documentation

bool IsReadable [get]


Is the node value readable? This is calculated based on the current access mode.

bool IsWritable [get]


Is the node value writable? This is calculated based on the current access mode.

bool IsImplemented [get]


Is the node implemented? This is calculated based on the current access mode.

bool IsAvailable [get]


Is the node value available? This is calculated based on the current access mode.

Type NodeValueType [get]


Get the managed datatype of the internal value representation of the node value.

object Value [get, set]


Get/set the current value of the node. The value return type will depend on the GenICam node type.

6.5.1

Detailed Description

GenICam Node object class used by the Managed Factory.


The Node class contains all settings related to a GenICam Node
See also:
Jai_FactoryWrapper

6.5.2

Constructor & Destructor Documentation

6.5.2.1

CNode (IntPtr nodeHandle)

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

Member Function Documentation

6.5.3.1

IEnumValue FindEnumValue (string enumValueName, bool findExact)

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

6.5 CNode Class Reference

415

findExact Flag to enforce searching for the exact name or to allow substring search as well
Returns:

6.5.3.2

Jai_FactoryWrapper.EFactoryError ImposeAccessMode (Jai_FactoryWrapper.EConfAccessMode accessMode)

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

Jai_FactoryWrapper.EFactoryError ImposeVisibility (Jai_FactoryWrapper.EConfVisibility visibility)

Set the current recommended visibility of the node.


Parameters:
visibility New recommended visibility for the node
Returns:

6.5.3.4

void ExecuteCommand ()

Execute the command if the node is of type ICommand.


Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_Node_ExecuteCommand() function return an error

6.5.3.5

void Invalidate ()

Invalidate the node.


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

416

Class Documentation

6.5.4

Property Documentation

6.5.4.1

string Name [get]

GenICam node name.

6.5.4.2

string DisplayName [get]

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

string ToolTip [get]

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

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.

6.5.4.5

Jai_FactoryWrapper.EConfNameSpace NameSpace [get]

GenICam name space. This can be "Standard" or "Custom".

6.5.4.6

Jai_FactoryWrapper.EConfRepresentation Representation [get]

Representation of the value in a Graphical User Interface.

6.5.4.7

Jai_FactoryWrapper.EDisplayNotation DisplayNotation [get, set]

Display Notation for Float node values in a Graphical User Interface.

6.5.4.8

Int64 DisplayPrecision [get, set]

Display Precision for Float node values in a Graphical User Interface.

6.5.4.9

String Unit [get]

Unit of the value in a Graphical User Interface.

6.5.4.10

String DocuURL [get]

Documentation URL for the node.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.5 CNode Class Reference


6.5.4.11

bool IsCachable [get]

Is the node cachable or do we need to read it back once in a while to get changes?

6.5.4.12

Jai_FactoryWrapper.EConfCachingMode CachingMode [get]

GenICam caching mode.

6.5.4.13

Int64 PollingTime [get]

Recommended polling time (in milliseconds).

6.5.4.14

string EventID [get]

Event ID string.

6.5.4.15

bool IsStreamable [get]

Is the node streamable?

6.5.4.16

bool IsDeprecated [get]

Is the node Deprecated?

6.5.4.17

bool IsSelector [get]

Is the node a Selector Node?

6.5.4.18

List<CNode> SelectedNodes [get]

Selected nodes (only if this is a Selector Node).

6.5.4.19

List<String> SelectingNodeNames [get]

Names of all Selecting nodes (only if other nodes are selectors for this node).

6.5.4.20

IntPtr AliasNodeHandle [get]

Is there another node that displays the same feature in a different way.

6.5.4.21

IntPtr FloatAliasNodeHandle [get]

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

IntPtr IntegerAliasNodeHandle [get]

Is there an IInteger node that displays the same feature as this IFloat node?

6.5.4.23

IntPtr EnumAliasNodeHandle [get]

Is there an IEnumeration node that displays the same feature as this IFloat node?

6.5.4.24

Jai_FactoryWrapper.EConfNodeType NodeType [get]

GenICam node type.

6.5.4.25

IEnumValue [ ] EnumValues [get]

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

object Tag [get, set]

GenICam node Tag This tag can be used for storing any object related to the Node.

6.5.4.27

IntPtr NodeHandle [get]

The handle of this node. This handle can be used for calling the Jai_FactoryWrapper.J_Node_xxx() functions.

6.5.4.28

Jai_FactoryWrapper.EConfAccessMode AccessMode [get, set]

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

Jai_FactoryWrapper.EConfVisibility Visibility [get, set]

Get/set the current recommended visibility of the node.


Exceptions:
Jai_FactoryWrapper.FactoryErrorException Thrown if the internal call to Jai_FactoryWrapper.J_Node_GetVisibility() or Jai_FactoryWrapper.J_Node_ImposeVisibility() functions return an error

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.5 CNode Class Reference


6.5.4.30

419

object Min [get]

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

object Max [get]

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

object Inc [get]

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

object Length [get]

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

object Address [get]

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

bool IsReadable [get]

Is the node value readable? This is calculated based on the current access mode.
6.5.4.36

bool IsWritable [get]

Is the node value writable? This is calculated based on the current access mode.
6.5.4.37

bool IsImplemented [get]

Is the node implemented? This is calculated based on the current access mode.
6.5.4.38

bool IsAvailable [get]

Is the node value available? This is calculated based on the current access mode.
6.5.4.39

Type NodeValueType [get]

Get the managed datatype of the internal value representation of the node value.
6.5.4.40

object Value [get, set]

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 ColorCompensationROIStruct Struct Reference

6.6

421

ColorCompensationROIStruct Struct Reference

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

Member Data Documentation

6.6.2.1

RECT RectOfROI

Rectangle of a region of interest.


6.6.2.2

UInt32 BThreshold

Threshold of blue channel.


6.6.2.3

UInt32 GThreshold

Threshold of green channel.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

422

Class Documentation

6.6.2.4

UInt32 RThreshold

Threshold of red channel.


6.6.2.5

UInt32 BGain

Blue gain for compensation. 4096:1.00.


6.6.2.6

UInt32 GGain

Green gain for compensation. 4096:1.00.


6.6.2.7

UInt32 RGain

Red gain for compensation. 4096:1.00.


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.7 Command Class Reference

6.7

Command Class Reference

Command class used for scripting feature settings.

Public Member Functions


Command ()
Default constructor.

Command (string feature, object value)


Initializing constructor.

Properties
string FeatureName [get, set]
GenICam feature name.

string FeatureValue [get, set]


Value of the feature.

6.7.1

Detailed Description

Command class used for scripting feature settings.

6.7.2

Constructor & Destructor Documentation

6.7.2.1

Command ()

Default constructor.

6.7.2.2

Command (string feature, object value)

Initializing constructor.
Parameters:
feature GenICam feature name
value Feature value to be stored

6.7.3

Property Documentation

6.7.3.1

string FeatureName [get, set]

GenICam feature name.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

423

424

Class Documentation

6.7.3.2

string FeatureValue [get, set]

Value of the feature.


The documentation for this class was generated from the following file:
Camera.cs

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.8 DeviceEventData Struct Reference

6.8

DeviceEventData Struct Reference

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

Member Data Documentation

6.8.2.1

UInt16 GEV_EVENT_CMD_EventID

EVENT identifying reason.


6.8.2.2

UInt16 GEV_EVENT_CMD_StreamChannelIndex

Index of stream channel (0xFFFF for no channel).


6.8.2.3

UInt16 GEV_EVENT_CMD_BlockID

Data block ID (0 for no block).


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

425

426

Class Documentation

6.8.2.4

UInt64 GEV_EVENT_CMD_Timestamp

Event timestamp (0 if not supported).


6.8.2.5

UInt16 GEV_EVENT_CMD_EventDataLength

Number of additional data associated with the event.


6.8.2.6

byte [ ] GEV_EVENT_CMD_EventData

The additional data associated with the event.


6.8.2.7

BUFFER_HANDLE NEW_BUFFER_BufferHandle

Buffer handle of the delivered buffer.


6.8.2.8

EDeviceConnectionType CONNECTION_Status

Current status for the camera connection.


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.9 EventInfoData Struct Reference

6.9

EventInfoData Struct Reference

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

Member Data Documentation

6.9.2.1

UInt32 NumEntriesInQueue

Number of events in queue.


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

427

428

Class Documentation

6.10

FactoryErrorException Class Reference

JAI SDK Factory Exceptions.

Public Member Functions


FactoryErrorException ()
Contructor.

FactoryErrorException (string message)


Constructor.

FactoryErrorException (string message, Exception inner)


Constructor.

6.10.1

Detailed Description

JAI SDK Factory Exceptions.

6.10.2

Constructor & Destructor Documentation

6.10.2.1

FactoryErrorException ()

Contructor.
6.10.2.2

FactoryErrorException (string message)

Constructor.
Parameters:
message Message string

6.10.2.3

FactoryErrorException (string message, Exception inner)

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 GenICamErrorInfo Struct Reference

6.11

GenICamErrorInfo Struct Reference

GenICam Error Info.

Properties
string Description [get]
Error description.

string NodeName [get]


GenICam Node Name.

6.11.1

Detailed Description

GenICam Error Info.

6.11.2

Property Documentation

6.11.2.1

string Description [get]

Error description.
6.11.2.2

string NodeName [get]

GenICam Node Name.


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

429

430

Class Documentation

6.12

GreenCompensationStruct Struct Reference

Structure containing Green-Compensation parameters.

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

Structure containing Green-Compensation parameters.

6.12.2

Member Data Documentation

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 HistogramInfo Struct Reference

6.13

HistogramInfo Struct Reference

Structure containing Histogram data.

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

Structure containing Histogram data.

6.13.2

Member Data Documentation

6.13.2.1

UInt32 HistEntries

Number of Histogram entries allocated. This will depend on the pixel depth!
6.13.2.2

UInt32 PixelDepth

Pixel depth! This can be 8-bit, 10-bit, 12-bit, 14-bit or 16-bit.


6.13.2.3

UInt32 Colors

Number of colors. This is either 1 (monochrome) or 3 for Bayer and RGB.


6.13.2.4

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

Pointer to the actual Histogram data for color 2 (Green channel).


6.13.2.6

IntPtr HistB

Pointer to the actual Histogram data for color 3 (Blue channel).


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.14 IEnumValue Class Reference

6.14

433

IEnumValue Class Reference

This class contains information about a single enumeration entry node inside an IEnumeration node.

Public Member Functions


IEnumValue (string Name, string DisplayName, string Description, Int64 Value, Jai_FactoryWrapper.EConfAccessMode AccessMode)
Public constructor for the IEnumValue object.

override string ToString ()


Name of the IEnumEntry node.

Properties
string Name [get]
Name of the IEnumEntry node.

string DisplayName [get]


Display Name of the IEnumEntry node.

string Description [get]


Description of the IEnumEntry node.

Int64 Value [get]


Integer value of the IEnumEntry node.

Jai_FactoryWrapper.EConfAccessMode AccessMode [get]


Access Mode of the IEnumEntry node.

bool IsReadable [get]


Is the IEnumEntry node value readable? This is calculated based on the current access mode.

bool IsWritable [get]


Is the IEnumEntry IEnumEntry node value writable? This is calculated based on the current access mode.

bool IsImplemented [get]


Is the IEnumEntry node implemented? This is calculated based on the current access mode.

bool IsAvailable [get]


Is the IEnumEntry node value available? This is calculated based on the current access mode.

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

Constructor & Destructor Documentation

6.14.2.1

IEnumValue (string Name, string DisplayName, string Description, Int64 Value,


Jai_FactoryWrapper.EConfAccessMode AccessMode)

Public constructor for the IEnumValue object.


Parameters:
Name GenICam Name of the IEnumEntry node
DisplayName Display name of the IEnumEntry node
Description Description of the IEnumEntry node
Value Value of the IEnumEntry node
AccessMode Access Mode of the IEnumEntry node

6.14.3

Member Function Documentation

6.14.3.1

override string ToString ()

Name of the IEnumEntry node.


Returns:

6.14.4

Property Documentation

6.14.4.1

string Name [get]

Name of the IEnumEntry node.

6.14.4.2

string DisplayName [get]

Display Name of the IEnumEntry node.

6.14.4.3

string Description [get]

Description of the IEnumEntry node.

6.14.4.4

Int64 Value [get]

Integer value of the IEnumEntry node.

6.14.4.5

Jai_FactoryWrapper.EConfAccessMode AccessMode [get]

Access Mode of the IEnumEntry node.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.14 IEnumValue Class Reference


6.14.4.6

435

bool IsReadable [get]

Is the IEnumEntry node value readable? This is calculated based on the current access mode.
6.14.4.7

bool IsWritable [get]

Is the IEnumEntry IEnumEntry node value writable? This is calculated based on the current access mode.
6.14.4.8

bool IsImplemented [get]

Is the IEnumEntry node implemented? This is calculated based on the current access mode.
6.14.4.9

bool IsAvailable [get]

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

ImageInfo Struct Reference

Image information structure used in callback and image conversion functions.

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

Image information structure used in callback and image conversion functions.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.15 ImageInfo Struct Reference

6.15.2

Member Data Documentation

6.15.2.1

EPixelFormatType PixelFormat

Pixel Format Type.


6.15.2.2

UInt32 SizeX

Image width.
6.15.2.3

UInt32 SizeY

Image height.
6.15.2.4

UInt32 ImageSize

Number of bytes for image.


6.15.2.5

IntPtr ImageBuffer

Buffer pointer. This is a handle to the buffer used in J_Image_GetBufferInfo().


6.15.2.6

UInt64 TimeStamp

Timestamp from camera.


6.15.2.7

UInt32 MissingPackets

Number of missing packets.


6.15.2.8

UInt32 AnnouncedBuffers

Number of announced buffers.


6.15.2.9

UInt32 QueuedBuffers

Number of queued buffers.


6.15.2.10

UInt32 OffsetX

Image X-offset (in case of ROI).


6.15.2.11

UInt32 OffsetY

Image Y-offset (in case of ROI).


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

437

438

Class Documentation

6.15.2.12

UInt32 AwaitDelivery

Number of frames awaiting delivery from the driver.


6.15.2.13

UInt32 BlockID

Block-ID for the GigE Vision Stream Protocol.


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.16 IVWCallbackValue Struct Reference

6.16

439

IVWCallbackValue Struct Reference

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

Member Data Documentation

6.16.2.1

POINT PointValue

The Callback value is a POINT.

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 IVWOptionValue Struct Reference

6.17

441

IVWOptionValue Struct Reference

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

Member Data Documentation

6.17.2.1

bool BooleanValue

and

J_Image_-

Image View Window Option value of type Boolean.


6.17.2.2

UInt32 UInt32Value

Image View Window Option value of


EIVWOptionType.CallbackMask option.

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

Jai_FactoryWrapper Class Reference

Wrapper class for the JAI SDK Jai_Factory.dll functions.

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

6.18 Jai_FactoryWrapper Class Reference

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 EFactoryInfoType { Version, BuildDate, BuildTime, Manufacturer }


Factory information type 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 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.

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 EConfNameSpace { Custom, Standard, _UndefinedNameSpace }


Defines if a node name is standard or custom namespace.

enum EConfCachingMode { NoCache, WriteThrough, WriteAround, _UndefinedCachingMode }


Caching mode of a GenICam register node.

enum EConfRepresentation {
Linear, Logarithmic, Boolean, PureNumber,
HexNumber, IPV4Address, MACAddress, _UndefinedRepresentation }
Defines the node representaion in the GUI.

enum EDisplayNotation { Automatic, Fixed, Scientific, _UndefinedEDisplayNotation }


Defines the IFloat Display Notation in the GUI.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.18 Jai_FactoryWrapper Class Reference

445

enum ESaveSettingsFlag { Auto, StreamableOnly, ForceAll }


Defines the Save Settings flags used in J_Camera_SaveSettings().

enum ELoadSettingsFlag { Auto, ValidateOnly, ForceWrite }


Defines the Load Settings flags used in J_Camera_LoadSettings().

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 EAcqStartFlags { NONE = 0, NEXT_IMAGE = 0x1, LAST_IMAGE = 0x2, NEW_IMAGE


= 0x3 }
The EAcqStartFlags are used to control the start of image acquisition using J_DataStream_StartAcquisition().

enum EAcqStopFlags { NONE = 0, KILL = 1 }


The EAcqStopFlags are used to control the stop of image acquisition using J_DataStream_StopAcquisition().

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().

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().

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 EDeviceConnectionType { Connected, Disconnected, LostControl }


The EDeviceConnectionType is used to report changes in connection state.

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 EPixelTypeColorInfo { Monochrome = 0x01000000, RGB = 0x02000000, Custom =


0x80000000 }
Color information for the EPixelType enumeration.
GetPixelTypeColorInfo().

To get the Color information call

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

6.18 Jai_FactoryWrapper Class Reference

447

GVSP_PIX_BAYGR12_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT


| 0x002A), GVSP_PIX_BAYRG12_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x002B), GVSP_PIX_BAYGB12_PACKED = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY12BIT | 0x002C), GVSP_PIX_BAYBG12_PACKED = (GVSP_PIX_MONO |
GVSP_PIX_OCCUPY12BIT | 0x002D),
GVSP_PIX_BAYGR16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x002E), GVSP_PIX_BAYRG16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x002F), GVSP_PIX_BAYGB16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0030), GVSP_PIX_BAYBG16 = (GVSP_PIX_MONO | GVSP_PIX_OCCUPY16BIT | 0x0031),
GVSP_PIX_RGB8_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY24BIT | 0x0014),
GVSP_PIX_BGR8_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY24BIT | 0x0015),
GVSP_PIX_RGBA8_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY32BIT | 0x0016),
GVSP_PIX_BGRA8_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY32BIT | 0x0017),
GVSP_PIX_RGB10_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x0018),
GVSP_PIX_BGR10_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x0019),
GVSP_PIX_RGB12_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x001A),
GVSP_PIX_BGR12_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x001B),
GVSP_PIX_RGB16_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x0033),
GVSP_PIX_RGB10V1_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY32BIT
| 0x001C), GVSP_PIX_RGB10V2_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY32BIT | 0x001D), GVSP_PIX_RGB12V1_PACKED = (GVSP_PIX_COLOR |
GVSP_PIX_OCCUPY36BIT | 0x0034),
GVSP_PIX_YUV411_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY12BIT | 0x001E),
GVSP_PIX_YUV422_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY16BIT | 0x001F),
GVSP_PIX_YUV444_PACKED = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY24BIT | 0x0020),
GVSP_PIX_RGB8_PLANAR = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY24BIT | 0x0021),
GVSP_PIX_RGB10_PLANAR = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT |
0x0022), GVSP_PIX_RGB12_PLANAR = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT |
0x0023), GVSP_PIX_RGB16_PLANAR = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT
| 0x0024), GVSP_PIX_BGR16_PACKED_INTERNAL = (GVSP_PIX_COLOR | GVSP_PIX_OCCUPY48BIT | 0x0000) }
Pixel Types used by the camera and in the buffer information structure ImageInfo.

enum EIVWWindowType { Overlapped = 0, Child = 1, ChildStretch = 2, OverlappedStretch = 3 }


Window type used in J_Image_OpenViewWindowEx().

enum EIVWOptionType { MouseZoom = 0, MouseCursor = 1, CallbackMask = 2, DoubleBuffering


=3}
View Window option types used in J_Image_SetViewWindowOption() and J_Image_GetViewWindowOption().

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 EFlipType { FlipHorizontally = 0, FlipVertically = 1 }


Flip type used in J_Image_Flip().

enum ERotateType { Rotate90DegCw = 0, Rotate90DegCcw = 1, Rotate180Deg = 2 }


Rotate type used in J_Image_Rotate().

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().

enum EInterpolationType { InterpolationNone = 0, InterpolationBiLinear = 1 }

Public Member Functions


static Jai_FactoryWrapper.EFactoryError
FACTORY_HANDLE FactoryHandle)

J_Factory_Open

(String

RegistryFileName,

out

Open the factory and return a valid handle.

static Jai_FactoryWrapper.EFactoryError J_Factory_Close (FACTORY_HANDLE FactoryHandle)


Close a previously opened factory handle.

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

6.18 Jai_FactoryWrapper Class Reference

449

Get information about the Jai_Factory.dll.

static Jai_FactoryWrapper.EFactoryError J_Factory_UpdateCameraList (FACTORY_HANDLE


FactoryHandle, ref bool HasChanged)
Perform a Device Discovery and update the internal list of available cameras.

static Jai_FactoryWrapper.EFactoryError J_Factory_GetNumOfCameras (FACTORY_HANDLE


FactoryHandle, ref UInt32 NumOfCameras)
Get the number of cameras found during Device Discovery with J_Factory_UpdateCameraList().

static Jai_FactoryWrapper.EFactoryError J_Factory_GetCameraIDByIndex (FACTORY_HANDLE


FactoryHandle, Int32 Index, StringBuilder CameraID, out UInt32 Size)
Get a string that uniquely identifies the camera, interface and the transport layer.

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_Factory_EnableForceIp (FACTORY_HANDLE FactoryHandle, UInt32 ForceEnabled)


Set Automatic Force IP mode.

static Jai_FactoryWrapper.EFactoryError J_Factory_GetGenICamErrorInfo (ref GenICamErrorInfo


genICamErrorInfo)
Get detailed information about GenICam errors exceptions caught in Jai_Factory.dll.

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.

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.

static Jai_FactoryWrapper.EFactoryError J_Camera_Close (CAMERA_HANDLE CameraHandle)


Close the camera connection.

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_SetValueInt64 (CAMERA_HANDLE CameraHandle, String NodeName, Int64 Value)


Set the value of a GenICam feature node as Int64 type.

static Jai_FactoryWrapper.EFactoryError J_Camera_SetValueDouble (CAMERA_HANDLE CameraHandle, String NodeName, double Value)


Set the value of a GenICam feature node as double type.

static Jai_FactoryWrapper.EFactoryError J_Camera_SetValueString (CAMERA_HANDLE CameraHandle, String NodeName, String ValueStr)


Set node value as a String.

static Jai_FactoryWrapper.EFactoryError J_Camera_ExecuteCommand (CAMERA_HANDLE


CameraHandle, String NodeName)
Execute the GenICam command.

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_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().

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNodeByName (CAMERA_HANDLE


CameraHandle, String NodeName, out NODE_HANDLE NodeHandle)
Get node by the GenICam node name.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.18 Jai_FactoryWrapper Class Reference

451

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNumOfSubFeatures (CAMERA_HANDLE


CameraHandle, String ParentNodeName, ref UInt32 NumOfSubFeatures)
Get the number of sub feature nodes in the given node map tree specified by a parent node name.

static Jai_FactoryWrapper.EFactoryError J_Camera_GetSubFeatureByIndex (CAMERA_HANDLE


CameraHandle, String ParentNodeName, UInt32 Index, out NODE_HANDLE NodeHandle)
Get feature node by the index.

static Jai_FactoryWrapper.EFactoryError J_Camera_GetFeatureByName (CAMERA_HANDLE


CameraHandle, String FeatureNodeName, out NODE_HANDLE NodeHandle)
Get feature node by the name.

static Jai_FactoryWrapper.EFactoryError J_Camera_InvalidateNodes (CAMERA_HANDLE CameraHandle)


Invalidates all GenICam nodes.

static Jai_FactoryWrapper.EFactoryError J_Camera_GetNumOfDataStreams


HANDLE CameraHandle, ref UInt32 NumOfDataStreams)

(CAMERA_-

Get the number of available Data Streams from the Camera.

static Jai_FactoryWrapper.EFactoryError J_Camera_CreateDataStream (CAMERA_HANDLE


CameraHandle, UInt32 Channel, out DATASTREAM_HANDLE DSHandle)
Create and open data stream channel to the camera.

static Jai_FactoryWrapper.EFactoryError J_Camera_CreateDataStreamMc (CAMERA_HANDLE


CameraHandle, UInt32 Channel, out DATASTREAM_HANDLE DSHandle, UInt32 McIP)
Create and open data stream channel to the camera.

delegate void ImageCallBack (ref ImageInfo ImageInfo)


Delegate to be called as callback function when a new image has been received.

delegate
void
ConnectionStatusCallBack
(CCamera
FactoryWrapper.EDeviceConnectionType connectionStatus)

camera,

Jai_-

Delegate to be called as callback function when a new image has been received.

delegate void GEVEventCallBack (CCamera camera, UInt16 EventID, UInt16 StreamChannelIndex,


UInt16 BlockID, UInt64 Timestamp, byte[ ] EventData)
Delegate to be called as callback function when a new GigE Vision Event has been received.

delegate void NodeEventCallBack (CNode node)


Delegate to be called as callback function when a new Node Event has been received.

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_LoadSettings (CAMERA_HANDLE CameraHandle, String SettingsFileName, ELoadSettingsFlag LoadFlag)


Load camera settings from disk and either validate or send the the settings to the connected camera.

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.

static Jai_FactoryWrapper.EFactoryError J_DataStream_FlushQueue (DATASTREAM_HANDLE


DSHandle, EAcqQueueType QueueType)
Flush Queues.

static Jai_FactoryWrapper.EFactoryError J_DataStream_StartAcquisition


HANDLE DSHandle, EAcqStartFlags Flags, UInt64 NumImages)

(DATASTREAM_-

Start the image acquisition on the stream channel.

static Jai_FactoryWrapper.EFactoryError J_DataStream_StopAcquisition


HANDLE DSHandle, EAcqStopFlags Flags)

(DATASTREAM_-

Stop the image acquisition on the stream channel.

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 J_DataStream_GetBufferID (DATASTREAM_HANDLE


DSHandle, UInt32 Index, out BUFFER_HANDLE BufferHandle)
Get the buffer handle by index.

static Jai_FactoryWrapper.EFactoryError
DSHandle)

J_DataStream_Close

(DATASTREAM_HANDLE

Close the data stream.

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_QueueBuffer (DATASTREAM_HANDLE


DSHandle, BUFFER_HANDLE BufferHandle)
Queue the buffer in 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.

static Jai_FactoryWrapper.EFactoryError J_DataStream_GetParam (DATASTREAM_HANDLE


DSHandle, EDataStreamParamCmd Cmd, ref StreamParameterStruct StreamParameter, ref UInt32
Size)
Get parameters for the data stream.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.18 Jai_FactoryWrapper Class Reference

453

static Jai_FactoryWrapper.EFactoryError J_DataStream_SetParam (DATASTREAM_HANDLE


DSHandle, EDataStreamParamCmd Cmd, ref StreamParameterStruct StreamParameter, ref UInt32
Size)
Set parameters for the data stream.

static Jai_FactoryWrapper.EFactoryError J_Event_GetData (EVT_HANDLE EventHandle, out DeviceEventData EventData, ref UInt32 Size)
Retrieve the event data associated with the event.

static Jai_FactoryWrapper.EFactoryError J_Event_GetInfo (EVT_HANDLE


EEventInfoID EventInfoID, out EventInfoData EventInfo, ref UInt32 Size)

EventHandle,

Retrieve event information.

static Jai_FactoryWrapper.EFactoryError J_Event_Flush (EVT_HANDLE EventHandle)


Flush all Event currently in the queue.

static Jai_FactoryWrapper.EFactoryError J_Event_Close (EVT_HANDLE EventHandle)


Close Event.

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_Camera_UnRegisterEvent (CAMERA_HANDLE CameraHandle, EDeviceEventType EventType)


Un-register an event with the Transport Layer interface.

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.

static Jai_FactoryWrapper.EFactoryError J_DataStream_RegisterEvent (DATASTREAM_HANDLE DSHandle, EDeviceEventType EventType, COND_HANDLE ConditionHandle,


out EVT_HANDLE EventHandle)
Register an event with the Transport Layer interface. This is an overloaded version that uses Conditions
instead of directly using Windows Events.

static Jai_FactoryWrapper.EFactoryError J_DataStream_UnRegisterEvent


HANDLE DSHandle, EDeviceEventType EventType)

(DATASTREAM_-

Un-register an event with the Transport Layer interface.

static Jai_FactoryWrapper.EFactoryError J_Event_CreateCondition (ref COND_HANDLE ConditionHandle)


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

454

Class Documentation
Create new Condition object to be used for event handling.

static Jai_FactoryWrapper.EFactoryError J_Event_SignalCondition (COND_HANDLE ConditionHandle)


Signal Condition object. J_Event_WaitForCondition() will return ECondWaitResult.WaitSignal if
this is called.

static Jai_FactoryWrapper.EFactoryError J_Event_ExitCondition (COND_HANDLE ConditionHandle)


Send an EXIT Signal to the Condition object. J_Event_WaitForCondition() will return ECondWaitResult.WaitExit if this is called.

static Jai_FactoryWrapper.EFactoryError J_Event_ResetCondition (COND_HANDLE ConditionHandle)


Reset the Condition object state to its initial state.

static Jai_FactoryWrapper.EFactoryError J_Event_WaitForCondition (COND_HANDLE ConditionHandle, UInt32 timeout, ref ECondWaitResult WaitResult)
Wait for the Condition object to be signaled.

static Jai_FactoryWrapper.EFactoryError J_Event_WaitForMultipleConditions (Int32 nCount,


COND_HANDLE[ ] ConditionHandles, UInt32 timeout, ref ECondWaitResult WaitResult)
Wait for one of multiple Condition objects to be signaled.

static Jai_FactoryWrapper.EFactoryError J_Event_CloseCondition (COND_HANDLE ConditionHandle)


Close the Condition object.

static Jai_FactoryWrapper.EFactoryError J_Node_GetAccessMode (NODE_HANDLE NodeHandle, ref EConfAccessMode AccessMode)


Get the access mode for a GenICam node.

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_GetNameSpace (NODE_HANDLE NodeHandle,


ref EConfNameSpace NameSpace)
Get the namespace for a GenICam node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetVisibility (NODE_HANDLE NodeHandle,


ref EConfVisibility Visibility)
Get the recommended visibility for a GenICam node.

static Jai_FactoryWrapper.EFactoryError J_Node_Invalidate (NODE_HANDLE NodeHandle)


Invalidate the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsCachable (NODE_HANDLE NodeHandle,


ref UInt32 IsCachable)
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().
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.18 Jai_FactoryWrapper Class Reference

455

static Jai_FactoryWrapper.EFactoryError J_Node_GetCachingMode (NODE_HANDLE NodeHandle, ref EConfCachingMode CachingMode)


Get the caching mode for a GenICam node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetPollingTime (NODE_HANDLE NodeHandle, ref Int64 PollingTime)


Get the recommended polling time for the GenICam node. This is only necessary if the node is not cachable.

static Jai_FactoryWrapper.EFactoryError J_Node_GetToolTip (NODE_HANDLE NodeHandle,


StringBuilder ToolTip, ref UInt32 Size)
Get the tooltip for a node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetDescription (NODE_HANDLE NodeHandle,


StringBuilder Description, ref UInt32 Size)
Get the description 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.

static Jai_FactoryWrapper.EFactoryError J_Node_GetEventID (NODE_HANDLE NodeHandle,


StringBuilder EventID, ref UInt32 Size)
Get the Event ID string for a node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsStreamable (NODE_HANDLE NodeHandle, ref UInt32 IsStreamable)


Get if the GenICam node is streamable.

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfProperties (NODE_HANDLE NodeHandle, ref UInt32 NumOfProperties)


Get the number of properties on the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetPropertyNameByIndex (NODE_HANDLE


NodeHandle, UInt32 Index, StringBuilder PropertyName, ref UInt32 Size)
Get the name of the property by index.

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.

static Jai_FactoryWrapper.EFactoryError J_Node_ImposeAccessMode (NODE_HANDLE NodeHandle, EConfAccessMode AccessMode)


Override the current access mode for a node.

static Jai_FactoryWrapper.EFactoryError J_Node_ImposeVisibility (NODE_HANDLE NodeHandle, EConfVisibility Visibility)


Override the current recommended visibility for a node.

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.

delegate bool NodeChangeDelegate (NODE_HANDLE NodeHandle)


Delegate to be called whenever the value or any of the node properties changes.

static Jai_FactoryWrapper.EFactoryError J_Node_RegisterCallback (NODE_HANDLE NodeHandle, NodeChangeDelegate NodeChangeDelegateFunction)


Register a delegate for a specific node. The delegate will be called when the node changes state or value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetType (NODE_HANDLE NodeHandle, ref


EConfNodeType NodeType)
Get the GenICam node type of the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsSelector (NODE_HANDLE NodeHandle,


ref UInt32 IsSelector)
Get if the GenICam node is a Selector.

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfSelectedFeatures (NODE_HANDLE


NodeHandle, ref UInt32 NumOfSelectedFeatures)
Get the number of Selected Features on the Selector node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetSelectedFeatureByIndex (NODE_HANDLE


NodeHandle, UInt32 Index, out NODE_HANDLE SelectedNodeHandle)
Get the selected feature node by index.

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfSelectingFeatures (NODE_HANDLE


NodeHandle, ref UInt32 NumOfSelectingFeatures)
Get the number of Selecting Features on the Selector node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetSelectingFeatureByIndex (NODE_HANDLE


NodeHandle, UInt32 Index, out NODE_HANDLE SelectingNodeHandle)
Get the selecting feature node by index.

static Jai_FactoryWrapper.EFactoryError J_Node_GetRepresentation (NODE_HANDLE NodeHandle, ref EConfRepresentation Representation)


Get the Representation specified for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetUnit (NODE_HANDLE NodeHandle, StringBuilder Unit, ref UInt32 Size)
Get the Unit string specified for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetDocuURL (NODE_HANDLE NodeHandle,


StringBuilder DocuURL, ref UInt32 Size)
Get the Documentation URL string specified for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIsDeprecated (NODE_HANDLE NodeHandle, ref UInt32 IsDeprecated)


Get if the GenICam node is Deprecated.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.18 Jai_FactoryWrapper Class Reference

457

static Jai_FactoryWrapper.EFactoryError J_Node_GetMinInt64 (NODE_HANDLE NodeHandle,


ref Int64 Min)
Get minimum value allowed for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetMaxInt64 (NODE_HANDLE NodeHandle,


ref Int64 Max)
Get maximum value allowed for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetInc (NODE_HANDLE NodeHandle, ref Int64


Inc)
Get the increment value for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueInt64 (NODE_HANDLE NodeHandle,


bool Verify, Int64 Value)
Set the node value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueInt64 (NODE_HANDLE NodeHandle,


bool Verify, ref Int64 Value)
Get the node value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatAlias (NODE_HANDLE NodeHandle,


ref NODE_HANDLE FloatNodeHandle)
Get the IFloat Alias node from the IInteger node.

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_GetMaxDouble (NODE_HANDLE NodeHandle,


ref double Max)
Get minimum value allowed for the node.

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueDouble (NODE_HANDLE NodeHandle, bool Verify, double Value)


Set node value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueDouble (NODE_HANDLE NodeHandle, bool Verify, ref double Value)
Get the node value.

static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayNotation (NODE_HANDLE NodeHandle, ref EDisplayNotation Value)


Get the Display Notation specified for the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetDisplayPrecision (NODE_HANDLE NodeHandle, ref Int64 Value)


Get the Display Precision specified for the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatHasInc (NODE_HANDLE NodeHandle,


ref UInt32 Value)
Inquire if the IFloat node has got an Increment defined.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

458

Class Documentation

static Jai_FactoryWrapper.EFactoryError J_Node_GetFloatInc (NODE_HANDLE NodeHandle, ref


double Value)
Get the constant increment value as double type from the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetIntAlias (NODE_HANDLE NodeHandle, ref


NODE_HANDLE IntegerNodeHandle)
Get the IInteger Alias node from the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumAlias (NODE_HANDLE NodeHandle,


ref NODE_HANDLE EnumNodeHandle)
Get the IEnumeration Alias node from the IFloat node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetNumOfEnumEntries (NODE_HANDLE


NodeHandle, ref UInt32 NumOfEnumEntries)
Get the number of enumeration entries on a EConfNodeType.IEnumeration node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumEntryByIndex (NODE_HANDLE


NodeHandle, UInt32 Index, out ENUMNODE_HANDLE EnumNodeHandle)
Get the enumeration entry on a EConfNodeType.IEnumeration node. The node type returned will
be EConfNodeType.IEnumEntry.

static Jai_FactoryWrapper.EFactoryError J_Node_GetEnumEntryValue (ENUMNODE_HANDLE


EnumNodeHandle, ref Int64 Value)
Get the integer value of a EConfNodeType.IEnumEntry node.

static Jai_FactoryWrapper.EFactoryError J_Node_ExecuteCommand (NODE_HANDLE NodeHandle)


Execute the GenICam command.

static Jai_FactoryWrapper.EFactoryError J_Node_GetCommandIsDone (NODE_HANDLE NodeHandle, ref UInt32 IsDone)


Read if the GenICam command has been executed.

static Jai_FactoryWrapper.EFactoryError J_Node_SetValueString (NODE_HANDLE NodeHandle,


bool Verify, String ValueStr)
Set node value as a String.

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueString (NODE_HANDLE NodeHandle,


bool Verify, StringBuilder ValueStr, ref UInt32 SizeValueStr)
Get node value as a String.

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.

static Jai_FactoryWrapper.EFactoryError J_Node_GetValueRegister (NODE_HANDLE NodeHandle, IntPtr pBuffer, UInt64 Length)


Read register values of nodes of type EConfNodeType.IRegister, IIntReg, IStringReg or IFloatReg.

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.18 Jai_FactoryWrapper Class Reference

459

static Jai_FactoryWrapper.EFactoryError J_Node_GetRegisterLength (NODE_HANDLE NodeHandle, ref UInt64 pLength)


Get the length of a EConfNodeType.IRegister, IIntReg, IStringReg and IFloatReg node.

static Jai_FactoryWrapper.EFactoryError J_Node_GetRegisterAddress (NODE_HANDLE NodeHandle, ref UInt64 pAddress)


Get the address of a EConfNodeType.IRegister, IIntReg, IStringReg and IFloatReg node.

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_CloseViewWindow (VW_HANDLE WindowHandle)


Close view window previously opened with J_Image_OpenViewWindow() or J_Image_OpenViewWindowEx().

static Jai_FactoryWrapper.EFactoryError J_Image_ShowImage (VW_HANDLE WindowHandle,


ref ImageInfo AqImageInfo, UInt32 RGain, UInt32 GGain, UInt32 BGain)
Display an image in a view window.

static Jai_FactoryWrapper.EFactoryError J_Image_ShowImage (VW_HANDLE WindowHandle,


ref ImageInfo AqImageInfo, EColorInterpolationAlgorithm BayerAlgorithm, UInt32 RGain, UInt32
GGain, UInt32 BGain)
Display an image in a view window using a specific Bayer Color Interpolation algorithm.

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).

static Jai_FactoryWrapper.EFactoryError J_Image_MoveViewWindow (VW_HANDLE WindowHandle, ref POINT Point)


Move view window.

static Jai_FactoryWrapper.EFactoryError J_Image_ResizeChildWindow (VW_HANDLE WindowHandle, ref RECT Rect)


Resize child(view) window. Resize the child view window to new rectangle specified by RECT.

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_GetFrameWindowRect (VW_HANDLE WindowHandle, ref RECT Rect)


Get position and size of the view window including the windows frame.

static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowTitle (VW_HANDLE WindowHandle, String WindowTitle)


Set the title of 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.

delegate void ImageViewWindowCallBack (VW_HANDLE WindowHandle, EIVWCallbackType


Type, ref IVWCallbackValue CallbackValue)
Delegate to be called as callback function when a View Window event has been detected.

static Jai_FactoryWrapper.EFactoryError J_Image_SetViewWindowCallback (VW_HANDLE WindowHandle, IntPtr CBObject, ImageViewWindowCallBack CallbackDelegate)


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.

static Jai_FactoryWrapper.EFactoryError J_Image_CloseStream (SP_HANDLE StreamHandle)


Close a stream channel that has previously been opened using J_Image_OpenStream() or J_Image_OpenStreamLight().

static Jai_FactoryWrapper.EFactoryError J_Image_GetStreamInfo (SP_HANDLE StreamHandle,


EStreamInfoCmd Cmd, ref StreamInfoStruct Info, ref UInt32 Size)
Get detailed information about the underlying data stream via stream handle.

static Jai_FactoryWrapper.EFactoryError J_Image_GetStreamHandle (SP_HANDLE StreamHandle, out DATASTREAM_HANDLE DSHandle)


Get DataStream handle from internal image stream handle.

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.
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.18 Jai_FactoryWrapper Class Reference

461

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToDIB (ref ImageInfo AqImageInfo,


ref ImageInfo BufferInfo, EColorInterpolationAlgorithm BayerAlgorithm, UInt32 RGain, UInt32
GGain, UInt32 BGain)
Convert image from RAW to DIB.

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToImage (ref ImageInfo AqImageInfo,


ref ImageInfo BufferInfo, UInt32 RGain, UInt32 GGain, UInt32 BGain)
Convert from RAW to an image that can be saved or modified.

static Jai_FactoryWrapper.EFactoryError J_Image_FromRawToImage (ref ImageInfo AqImageInfo,


ref ImageInfo BufferInfo, EColorInterpolationAlgorithm BayerAlgorithm, UInt32 RGain, UInt32
GGain, UInt32 BGain)
Convert from RAW to an image that can be saved or modified.

static Jai_FactoryWrapper.EFactoryError J_Image_ConvertImage (ref ImageInfo InputImageInfo,


ref ImageInfo OutputImageInfo, EColorConversionPixelFormat ConversionPixelFormat)
Convert an image to a new image with some other format such as Color to Monochrome conversion.

static Jai_FactoryWrapper.EFactoryError J_Image_Malloc (ref ImageInfo AqImageInfo, ref ImageInfo BufferInfo)


Allocate the buffer memory for the image.

static Jai_FactoryWrapper.EFactoryError J_Image_MallocDIB (ref ImageInfo AqImageInfo, ref ImageInfo BufferInfo)


Allocate the buffer memory for the DIB (32-bit ARGB).

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().

static Jai_FactoryWrapper.EFactoryError J_Image_Free (ref ImageInfo BufferInfo)


Free a previously allocated image buffer.

static Jai_FactoryWrapper.EFactoryError J_Image_SaveFile (ref ImageInfo BufferInfo, String FileName)


Save an image to disk as TIFF file.

static Jai_FactoryWrapper.EFactoryError J_Image_SaveFileEx (ref ImageInfo BufferInfo, String


FileName, ESaveFileFormat FileFormat, byte EncoderParameter)
Save an image to disk using various file formats such as TIFF, JPEG, BMP or JAI.

static Jai_FactoryWrapper.EFactoryError J_Image_SaveFileRaw (ref ImageInfo BufferInfo, String


FileName)
Save an image to disk as raw binary file.

static Jai_FactoryWrapper.EFactoryError J_Image_LoadFileRaw (ref ImageInfo BufferInfo, String


FileName)
Load a previously saved RAW image file from disk.

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 J_Image_GetPixelEx (ref ImageInfo BufferInfo, Double


XPos, Double YPos, ref PixelValue Pixel)
Get the pixel at a specified floating-point position.

static Jai_FactoryWrapper.EFactoryError J_Image_SetPixel (ref ImageInfo BufferInfo, ref POINT


Point, ref PixelValue Pixel)
Set the pixel at a specified position.

static Jai_FactoryWrapper.EFactoryError J_Image_GetAverage (ref ImageInfo BufferInfo, ref


RECT MeasureRect, ref PixelValue RGBAverage)
Measures pixel average value for a region in the image.

static Jai_FactoryWrapper.EFactoryError J_Image_SetGain (SP_HANDLE StreamHandle, UInt32


RGain, UInt32 GGain, UInt32 BGain)
Set RGB software gain.

static Jai_FactoryWrapper.EFactoryError J_Image_GetGain (SP_HANDLE StreamHandle, ref


UInt32 RGain, ref UInt32 GGain, ref UInt32 BGain)
Get RGB software gain.

static
Jai_FactoryWrapper.EFactoryError
StreamHandle)

J_Image_ExecuteWhiteBalance

(SP_HANDLE

Calculate software auto white balance.

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.

static Jai_FactoryWrapper.EFactoryError J_Image_AnalyzeHDR (ref ImageInfo ImageInfo1, ref


ImageInfo ImageInfo2, ref byte Image1IsBrighter, ref Int32 BlackLevelImage1, ref Int32 BlackLevelImage2, ref float DarkGain)
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().

static Jai_FactoryWrapper.EFactoryError J_Image_FuseHDR (ref ImageInfo BrighterImageInfo, ref


ImageInfo DarkerImageInfo, ref ImageInfo OutputImage, Int32 BrighterBlackLevel, Int32 DarkerBlackLevel, float DarkGain, float DualSlopeGain, byte LogarithmicOutput)
Fuses two input images into a "High Dynamic Range" output image.

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.

static Jai_FactoryWrapper.EFactoryError J_Image_FreeLUT (ref LUTInfo LUTInfo)


Free the LUT memory previously allocated using J_Image_MallocLUT().

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.18 Jai_FactoryWrapper Class Reference

463

static Jai_FactoryWrapper.EFactoryError J_Image_ConvertLUT (ref LUTInfo SourceLUTInfo, ref


LUTInfo DestinationLUTInfo)
Convert an existing LUT into a different size and copy the data.

static Jai_FactoryWrapper.EFactoryError J_Image_LUT (ref ImageInfo ImageInfo, ref LUTInfo


LUTInfo)
Process the image by sending all pixels through the LUT.

static Jai_FactoryWrapper.EFactoryError J_Image_CreateGammaLUT (ref LUTInfo LUTInfo,


UInt32 ColorIndex, double gamma)
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().

static Jai_FactoryWrapper.EFactoryError J_Image_ApplyGammaToLUT (ref LUTInfo LUTInfo,


UInt32 ColorIndex, double gamma)
This function applies a user-defined Gamma LUT to a LUT that has already been initialized with values.

static Jai_FactoryWrapper.EFactoryError J_Image_CreateLinearLUT (ref LUTInfo LUTInfo,


UInt32 ColorIndex, UInt32 X1, UInt32 X2, UInt32 Y1, UInt32 Y2)
This function initializes a LUT with linear values between an user defined input and output range. Any
existing LUT values will be overwritten.

static Jai_FactoryWrapper.EFactoryError J_Image_CreateKneeLUT (ref LUTInfo LUTInfo, UInt32


ColorIndex, POINT knee1, POINT knee2)
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.

static Jai_FactoryWrapper.EFactoryError J_Image_GetLUTValue (ref LUTInfo LUTInfo, UInt32


ColorIndex, UInt32 LUTIndex, ref UInt32 pLUTValue)
This function directly reads a value from the LUT.

static Jai_FactoryWrapper.EFactoryError J_Image_SetLUTValue (ref LUTInfo LUTInfo, UInt32


ColorIndex, UInt32 LUTIndex, UInt32 LUTValue)
This function directly writes a value to the LUT.

static Jai_FactoryWrapper.EFactoryError J_Image_SaveLUT (ref LUTInfo LUTInfo, String FileName)


This function saves a LUT to disk as a binary file.

static Jai_FactoryWrapper.EFactoryError J_Image_LoadLUT (ref LUTInfo LUTInfo, String FileName)


This function loads a LUT from disk. If the LUT already contains data then it will be overwritten.

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.

static Jai_FactoryWrapper.EFactoryError J_Image_FreeHistogram (ref HistogramInfo HistogramInfo)


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

464

Class Documentation
Free the Histogram memory previously allocated using J_Image_MallocHistogram().

static Jai_FactoryWrapper.EFactoryError J_Image_ClearHistogram (ref HistogramInfo HistogramInfo)


Clear the contents of
MallocHistogram().

the

Histogram

memory

previously

allocated

using

J_Image_-

static Jai_FactoryWrapper.EFactoryError J_Image_CreateHistogram (ref ImageInfo ImageInfo, ref


RECT MeasureRect, ref HistogramInfo HistogramInfo)
Creates the Histogram from the image contents.

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_Flip (ref ImageInfo ImageInfo, EFlipType flipType)


Flip the image contents in the image buffer.

static Jai_FactoryWrapper.EFactoryError J_Image_Rotate (ref ImageInfo ImageInfo, ERotateType


rotateType)
Rotate the image contents in the image buffer.

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_ProcessingEx (ref ImageInfo InputImageInfo, ref


ImageInfo OutputImageInfo, EProcessFunctionType ProcessingFunction, IntPtr Parameters)
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.

Static Public Member Functions


static string GetFactoryErrorString (Jai_FactoryWrapper.EFactoryError error)
Return a string that gives more explanation about the Factory Error code.

static Jai_FactoryWrapper.EPixelTypeColorInfo GetPixelTypeColorInfo (EPixelFormatType pixelType)


Get Color Information based on Pixel type.

static uint GetPixelTypeMemorySize (Jai_FactoryWrapper.EPixelFormatType pixelType)


Get memory size occupied by each pixel based on Pixel type.

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

6.18 Jai_FactoryWrapper Class Reference

465

This function performs a Green-Compensation on the image.

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.

static Jai_FactoryWrapper.EFactoryError J_Image_ProcessingInit (ref ImageInfo InputImageInfoRef, ref UndistortStruct UndistortParameters)


This function allocates and initializes an internal undistort map so the following Lens Distortion Correction
calls will be speeded up considerably.

static Jai_FactoryWrapper.EFactoryError J_Image_ProcessingFree (ref ImageInfo InputImageInfoRef, ref UndistortStruct UndistortParameters)


This function releases the memory allocated to the internal undistort map.

6.18.1

Detailed Description

Wrapper class for the JAI SDK Jai_Factory.dll functions.


The wrapper class incapsulates the Jai_factory.dll using pInvoke calls from managed to unmanaged
code All functions from Jai_Factory.dll will be exposed using Jai_FactoryDotNET.Jai_FactoryWrapper
Instead of using this wrapper directly we recommend to use the CFactory, CCamera and CNode classes
instead. They are using the Jai_FactoryDotNET.Jai_FactoryWrapper internally to create an
object-oriented way of controlling the cameras instead
See also:
CFactory, CCamera, CNode
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

466

Class Documentation

6.19

LUTInfo Struct Reference

Structure containing LUT data.

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

Structure containing LUT data.

6.19.2

Member Data Documentation

6.19.2.1

UInt32 LUTEntries

Number of LUT entries allocated. This will depend on the pixel depth!
6.19.2.2

UInt32 PixelDepth

Pixel depth! This can be 8-bit, 10-bit, 12-bit, 14-bit or 16-bit.


6.19.2.3

UInt32 Colors

Number of colors. This is either 1 (monochrome) or 3 for Bayer and RGB.


6.19.2.4

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

6.19 LUTInfo Struct Reference


6.19.2.5

IntPtr LutG

Pointer to the actual LUT data for color 2 (Green channel).


6.19.2.6

IntPtr LutB

Pointer to the actual LUT data for color 3 (Blue channel).


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

467

468

Class Documentation

6.20

PixelValue Struct Reference

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

6.20 PixelValue Struct Reference

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

Table 6.1: Monochrome buffer format


PixelType
GVSP_PIX_BAYGR8
GVSP_PIX_BAYRG8
GVSP_PIX_BAYGB8
GVSP_PIX_BAYBG8
GVSP_PIX_BAYGR10
GVSP_PIX_BAYRG10
GVSP_PIX_BAYGB10
GVSP_PIX_BAYBG10
GVSP_PIX_BAYGR12
GVSP_PIX_BAYRG12
GVSP_PIX_BAYGB12
GVSP_PIX_BAYBG12

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

Internal use only


GVSP_PIX_BGR16_PACKED_INTERNAL -> BGR48_x

6.20.2

Member Data Documentation

6.20.2.1

Byte MONO8_Y

Luminance in Mono8 format.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

Table 6.3: RGB Packed buffer format defines


PixelType
GVSP_PIX_YUV411_PACKED
GVSP_PIX_YUV422_PACKED
GVSP_PIX_YUV444_PACKED

PixelValue element
BGR48_x
BGR48_x
BGR48_x

Table 6.4: YUV Packed buffer format


6.20.2.2

UInt16 MONO10_Y

Luminance in Mono10 format.

6.20.2.3

UInt16 MONO12_Y

Luminance in Mono12 format.

6.20.2.4

UInt16 MONO16_Y

Luminance in Mono16 format.

6.20.2.5

Byte DIB24_B

Blue in DIB24 format.

6.20.2.6

Byte DIB24_G

Green in DIB24 format.

6.20.2.7

Byte DIB24_R

Red in DIB24 format.

6.20.2.8

Byte RGB24_B

Blue in RGB24 format.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.20 PixelValue Struct Reference


PixelType
GVSP_PIX_RGB8_PLANAR
GVSP_PIX_RGB10_PLANAR
GVSP_PIX_RGB12_PLANAR
GVSP_PIX_RGB16_PLANAR

471
PixelValue element
BGR24_x
BGR48_x
BGR48_x
BGR48_x

Table 6.5: RGB Planar buffer format


6.20.2.9

Byte RGB24_G

Green in RGB24 format.


6.20.2.10

Byte RGB24_R

Red in RGB24 format.


6.20.2.11

Byte ARGB32_B

Blue in ARGB32 format.


6.20.2.12

Byte ARGB32_G

Green in ARGB32 format.


6.20.2.13

Byte ARGB32_R

Red in ARGB32 format.


6.20.2.14

Byte ARGB32_A

Alpha in ARGB32 format.


6.20.2.15

UInt16 BGR48_B

Blue in BGR48 format.


6.20.2.16

UInt16 BGR48_G

Green in BGR48 format.


6.20.2.17

UInt16 BGR48_R

Red in BGR48 format.


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

472

Class Documentation

6.21

POINT Struct Reference

Windows POINT implementation for pInvoke.

Public Member Functions


POINT (int x, int y)
POINT Constructor.

Static Public Member Functions


static implicit operator System.Drawing.Point (POINT p)
Implicit assigment operator.

static implicit operator POINT (System.Drawing.Point p)


Implicit assigment operator.

Public Attributes
int X
X position.

int Y
Y position.

6.21.1

Detailed Description

Windows POINT implementation for pInvoke.


This structure makes it possible to call an unmanaged function that is having a standard C/C++ POINT
structure as parameter

6.21.2

Constructor & Destructor Documentation

6.21.2.1

POINT (int x, int y)

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 POINT Struct Reference

6.21.3

Member Function Documentation

6.21.3.1

static implicit operator System.Drawing.Point (POINT p) [static]

Implicit assigment operator.


Parameters:
p POINT structure to be converted to System.Drawing.Point
Returns:
System.Drawing.Point

6.21.3.2

static implicit operator POINT (System.Drawing.Point p) [static]

Implicit assigment operator.


Parameters:
p System.Drawing.Point to be converted to POINT structure
Returns:
POINT

6.21.4

Member Data Documentation

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

RECT Struct Reference

Windows RECT implementation for pInvoke.

Public Member Functions


RECT (int left_, int top_, int right_, int bottom_)
Constructor.

Rectangle ToRectangle ()
Handy method for converting to a System.Drawing.Rectangle.

override int GetHashCode ()


Return Hash code for the RECT.

Static Public Member Functions


static RECT FromRectangle (Rectangle rectangle)
Handy method for converting from a System.Drawing.Rectangle.

static implicit operator Rectangle (RECT rect)


Implicit assignment operator from RECT to Rectangle.

static implicit operator RECT (Rectangle rect)


Implicit assignment operator from Rectangle to RECT.

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

6.22 RECT Struct Reference

475

int Width [get]


Width of the rectangle.

Size Size [get]


Size of the rectangle.

Point Location [get]


Location of the rectangle.

6.22.1

Detailed Description

Windows RECT implementation for pInvoke.


This structure makes it possible to call an unmanaged function that is having a standard C/C++ RECT
structure as parameter

6.22.2

Constructor & Destructor Documentation

6.22.2.1

RECT (int left_, int top_, int right_, int bottom_)

Constructor.
Parameters:
left_ Left
top_ Top
right_ Right
bottom_ Bottom

6.22.3

Member Function Documentation

6.22.3.1

Rectangle ToRectangle ()

Handy method for converting to a System.Drawing.Rectangle.


Returns:
System.Drawing.Rectangle

6.22.3.2

static RECT FromRectangle (Rectangle rectangle) [static]

Handy method for converting from a System.Drawing.Rectangle.


Parameters:
rectangle System.Drawing.Rectangle to be converted from
Returns:
RECT

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

476

Class Documentation

6.22.3.3

override int GetHashCode ()

Return Hash code for the RECT.


Returns:

6.22.3.4

static implicit operator Rectangle (RECT rect) [static]

Implicit assignment operator from RECT to Rectangle.


Parameters:
rect RECT to be assigned to a Rectangle
Returns:

6.22.3.5

static implicit operator RECT (Rectangle rect) [static]

Implicit assignment operator from Rectangle to RECT.


Parameters:
rect Rectangle to be assigned to a RECT
Returns:

6.22.4

Member Data Documentation

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 RECT Struct Reference

6.22.5

Property Documentation

6.22.5.1

int Height [get]

Height of the rectangle.


6.22.5.2

int Width [get]

Width of the rectangle.


6.22.5.3

Size Size [get]

Size of the rectangle.


6.22.5.4

Point Location [get]

Location of the rectangle.


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

477

478

Class Documentation

6.23

RedCompensationStruct Struct Reference

Structure containing Red-Compensation parameters.

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

Structure containing Red-Compensation parameters.

6.23.2

Member Data Documentation

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 Script Class Reference

6.24

Script Class Reference

Script class used for feature value scripting.

Public Member Functions


void Clear ()
Empty the command list in the Script.

void AppendDelay (int DelayMs)


Append a delay to the end of the Script.

void AppendStartImageAcquisition (Boolean ShowWindow, UInt32 BufferCount)


Append a StartImageAcquisition() command to the end of the Script.

void AppendStopImageAcquisition ()
Append a StopImageAcquisition() command to the end of the Script.

Static Public Member Functions


static Script LoadScript (String Filename)
Load Script from disk.

static void SaveScript (String Filename, Script script)


Save a Script to disk.

Properties
List< Command > CommandList [get, set]
List of commands to be executed.

6.24.1

Detailed Description

Script class used for feature value scripting.

6.24.2

Member Function Documentation

6.24.2.1

void Clear ()

Empty the command list in the Script.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

479

480

Class Documentation

6.24.2.2

void AppendDelay (int DelayMs)

Append a delay to the end of the Script.


Parameters:
DelayMs Delay (in milliseconds) to be appended.

6.24.2.3

void AppendStartImageAcquisition (Boolean ShowWindow, UInt32 BufferCount)

Append a StartImageAcquisition() command to the end of the Script.


Parameters:
ShowWindow Display the acquired images in a window or not.
BufferCount Number of buffers to be allocated for the image acquisition.
See also:
CCamera.StartImageAcquisition(Boolean, UInt32)

6.24.2.4

void AppendStopImageAcquisition ()

Append a StopImageAcquisition() command to the end of the Script.


See also:
CCamera.StopImageAcquisition()

6.24.2.5

static Script LoadScript (String Filename) [static]

Load Script from disk.


Parameters:
Filename Filename for the Script file
Returns:
Script file. If the file cannot be loaded then this function returns null.

6.24.2.6

static void SaveScript (String Filename, Script script) [static]

Save a Script to disk.


Parameters:
Filename Filename of the Script file
script Script to be saved
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

6.24 Script Class Reference

6.24.3

Property Documentation

6.24.3.1

List<Command> CommandList [get, set]

List of commands to be executed.


The documentation for this class was generated from the following file:
Camera.cs

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

481

482

Class Documentation

6.25

SIZE Struct Reference

Windows SIZE implementation for pInvoke.

Public Member Functions


SIZE (int cx, int cy)
Constructor.

Public Attributes
int cx
Width.

int cy
Height.

6.25.1

Detailed Description

Windows SIZE implementation for pInvoke.


This structure makes it possible to call an unmanaged function that is having a standard C/C++ SIZE
structure as parameter

6.25.2

Constructor & Destructor Documentation

6.25.2.1

SIZE (int cx, int cy)

Constructor.
Parameters:
cx Width
cy Height

6.25.3

Member Data Documentation

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 StreamInfoStruct Struct Reference

6.26

483

StreamInfoStruct Struct Reference

This structure is used for reading buffer information with J_DataStream_GetStreamInfo() or


J_Image_GetStreamInfo().

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

This structure is used for reading buffer information with J_DataStream_GetStreamInfo() or


J_Image_GetStreamInfo().
Depending on which buffer information has been requested, different fields has to be read in order to
interpret the answer correctly
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

484

Class Documentation

6.26.2

Member Data Documentation

6.26.2.1

Boolean IsGrabbing

Is the acquisition engine running?


6.26.2.2

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 StreamParameterStruct Struct Reference

6.27

485

StreamParameterStruct Struct Reference

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

Member Data Documentation

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

Total Number of bytes per frame.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

Max number of frames in not complete list.


6.27.2.5

UInt32 RxTimeoutsBeforeListFlush

Number of recieve timeouts before incomplete list is flushed / delivered.


6.27.2.6

UInt32 OutOfOrderPacketsBeforeResend

Out of order Packets before resend is issued.


6.27.2.7

UInt32 RxTimeout

Timeout in ms for recieve.


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.28 UndistortStruct Struct Reference

6.28

487

UndistortStruct Struct Reference

Structure containing Lens Distortion Correction parameters.

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.

Xcorr=X+[2p1Y+p2(r 2+2X 2)],

p2.

Xcorr=X+[2p1Y+p2(r 2+2X 2)],

Double CoeffP2
Tangential
Distortion
coefficient
Ycorr=Y+[p1(r 2+2y 2)+2p2X].

EInterpolationType InterpolationType
Lens Distortion Interpolation type.

6.28.1

Detailed Description

Structure containing Lens Distortion Correction parameters.


Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

488

Class Documentation

6.28.2

Member Data Documentation

6.28.2.1

Double OpticalCenterX

Optical center X used to model possible displacement from optical axis.

6.28.2.2

Double OpticalCenterY

Optical center Y used to model possible displacement from optical axis.

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

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).

6.28.2.6

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).

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.

Xcorr=X+[2p1Y+p2(r 2+2X 2)],

p2.

Xcorr=X+[2p1Y+p2(r 2+2X 2)],

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

6.28 UndistortStruct Struct Reference


6.28.2.10

EInterpolationType InterpolationType

Lens Distortion Interpolation type.


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

489

490

Class Documentation

6.29

UserDrawInfo Struct Reference

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

Member Data Documentation

6.29.2.1

IntPtr hDeviceContext

Handle to the DeviceContext to be used when drawing the image overlay.


6.29.2.2

UInt32 Width

Width of the User Draw area.


6.29.2.3

UInt32 Height

Height of the User Draw area.


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.30 ZoomPos Struct Reference

6.30

491

ZoomPos Struct Reference

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

Member Data Documentation

6.30.2.1

POINT Offset

Offset like passed into J_Image_SetImageOffset() and J_Image_SetImageOffsetEx().


6.30.2.2

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

Camera.cs File Reference

Camera object implementation of the Managed JAI Factory.

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

Camera object implementation of the Managed JAI Factory.


Version:
Revison: 0.1
Author:
kic ( JAI )

494

File Documentation

7.2

Factory.cs File Reference

Factory object implementation of the Managed JAI SDK.

Classes
class CFactory
Factory object class.

7.2.1

Detailed Description

Factory object implementation of the Managed JAI SDK.


Version:
Revison: 0.1
Author:
kic ( JAI )

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

7.3 Jai_Factory_Wrapper.cs File Reference

7.3

495

Jai_Factory_Wrapper.cs File Reference

.NET Wrapper implementation for the JAI SDK Factory DLL

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

.NET Wrapper implementation for the JAI SDK Factory DLL


Version:
Revison: 1.2
Author:
kic ( JAI )

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

7.4 Node.cs File Reference

7.4

Node.cs File Reference

GenICam Node object implementation of the Managed JAI Factory.

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

GenICam Node object implementation of the Managed JAI Factory.


Version:
Revison: 0.1
Author:
kic ( JAI )

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

This is the source of the ActionCommandSample/ActionCommandForm.cs file


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.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

This is the source of the AsyncImageRecordingSample/Form1.cs file


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;

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;

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 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

// 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!");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (myCamera != null)
myCamera.Close();
}
private void startCaptureButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
if (myCamera.IsAsyncImageRecordingRunning || (myCamera.TotalAsync
ImagesRecordedCount > 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);

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

This is the source of the AVISample/Form1.cs file


using
using
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.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

This is the source of the ChildWindowSample/Form1.cs file


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();
}
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

This is the source of the ConnectionDelegateSample/Form1.cs file


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 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

This is the source of the ConsoleApplication/Program.cs file


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();
}
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

This is the source of the CSAutoExposureSample/AutoExposureSampleForm.cs file


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 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;

// Auto Exposure ON/O

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);
}

// Get the GainRaw GenICam Node


myExposureNode = myCamera.GetNode("ExposureTimeRaw");
if (myExposureNode != null)
{
// Update the values inside the ALC controller
m_ALCController.SetMinExposure(Convert.ToInt32(myExposureNode
.Min));
m_ALCController.SetMaxExposure(Convert.ToInt32(myExposureNode
.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);
//

error = FindPeak(&m_ConversionBuffer, &m_MeasureRect, &Peak);


// Update the last measured average
int average = (int)Average.BGR48_G;
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;
//if ((int)Peak.R16 != m_OldRPeak)
//{
//
m_OldRPeak = (int)Peak.R16;
//
m_UpdateUI = true;
//}

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

// Update the Text Control with the new value


gainTextBox.Text = myGainNode.Value.ToString();
m_ALCController.SetCurrentGain(Convert.ToInt32(myGainNode.Value))
;
}
}
private void exposureTrackBar_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
.GainOnly))
{
// Set Value
myExposureNode.Value = exposureTrackBar.Value;
// Update the Text Control with the new value
exposureTextBox.Text = myExposureNode.Value.ToString();
m_ALCController.SetCurrentExposure(Convert.ToInt32(myExposureNode
.Value));
}
}
}
}

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

This is the source of the CSharpSampleMulticastMaster/CSharpSampleMulticastMaster/Form1.cs file


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;
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

This is the source of the CSharpSampleMulticastSlave/CSharpSampleMulticastSlave/Form1.cs file


using
using
using
using
using
using
using
using
using
using

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

This is the source of the CSharpSwTrigger/CSharpSwTrigger/Form1.cs file


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 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
{

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
(myCamera.GetNode("TriggerSelector") != null)
// Here we assume that this is the GenICam SFNC way of setting up

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

This is the source of the FeatureBrowserSample/Form1.cs file


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 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

This is the source of the GigECameraValidationTool/GigECameraValidationTool/Form1.cs file


using
using
using
using
using
using
using
using
using

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>();

public Nullable<int> iOldSelectedIndex = null;


private int featureProgressCount = 0;
// Count for progress bar
private Object thisLock = new Object();
System.Windows.Forms.Timer t = new Timer(); // timer for progress bar
public Form1()
{
InitializeComponent();
// Find cameras and list in the combo box
DiscoverCameras();
}
#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)
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

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

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
{
try
{
myCamera.GetNode("UserSetSelector").Value = "Default";
Jai_FactoryWrapper.J_Camera_ExecuteCommand(myCamera.Camer
aHandle, "UserSetLoad");
statusBarLabel.Text = camListComboBox.SelectedItem.ToStri
ng() + " has been selected";
// save the selected camera index
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();
}

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

This is the source of the GreenCompensationSample/Form1.cs file


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 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");

// Pleora hack! They set Width.Max and Height.Max to 16K in their


custom systems
if ((Convert.ToInt32(WidthNode.Max) >= 16383) && (Convert.ToInt32
(WidthNode.Max) >= 16383))
{
Width = Convert.ToInt32(WidthNode.Value);
Height = Convert.ToInt32(HeightNode.Value);
}
else
{
Width = Convert.ToInt32(WidthNode.Max);
Height = Convert.ToInt32(HeightNode.Max);
}
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(1
00, 100, Width, Height);
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
// Create View Window to display the processed output (instead of
the original)
Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWrapper.EI
VWWindowType.OverlappedStretch, "Green-Compensation Output", ref frameRect, ref m
axSize, IntPtr.Zero, out myViewWindow);
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
myCamera.StartImageAcquisition(true, 5);
}
}
private void StopButton_Click(object sender, EventArgs e)

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

This is the source of the HDRSequenceSample/HDRSequenceSample/Form1.cs file


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 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

// State for the sequ


// get two images bef

ore we use the HDR algorithms


bool myAnalyzeImageRequired = true;
nalysis of the next two images
bool myAnalysisIsOk = true;
ysis
int myAnalysisRetries = 0;
used when trying to analyze the two images

// Flag to activate a
// Result of the anal
// Number of retries

Jai_FactoryWrapper.ImageInfo myImageInfo1 = new Jai_FactoryWrapper.ImageI


nfo();
// Copy of the buffer information for the first image
Jai_FactoryWrapper.ImageInfo myImageInfo2 = new Jai_FactoryWrapper.ImageI
nfo();
// Copy of the buffer information for the second image
Jai_FactoryWrapper.ImageInfo myHDROutputImage = new Jai_FactoryWrapper.Im
ageInfo(); // Buffer information allocated for the HDR output image
byte myImage1IsBrighter = 0;
// This flag tells us
if the first image is brighter than the second image
int myBlackLevelImage1 = 0;
// Black level for th
e first image. This value is used for the HDR merging
int myBlackLevelImage2 = 0;
// Black level for th
e second image. This value is used for the HDR merging
float myDarkGain = 1.0f;
// Multiplication fac
tor between the dark image and the bright image
float myDualSlopeGain = 1.0f;
// Dual-slope gain. T
his value will typically be below 1.0 (1.0 = Dual-Slope off)
object myLockObject = new object();
// Object used for lo
cking access to the flags and values above
int myPixelDepth = 8;
pixel for the selected Pixel Format
public Form1()
{
Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

// Number of bits per

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

// Write error information in the text box


CameraIDTextBox.Text = "Error! No cameras found.";
}
}
private void StartButton_Click(object sender, EventArgs e)
{
// Verify that the camera connection is actually opened
if ((myCamera != null) && myCamera.IsOpen)
{
// Create the View Windows
// Try to read get the maximum image width and height by reading
the Max values for the mandatory "Width" and "Height" features.
CNode WidthNode = myCamera.GetNode("Width");
CNode HeightNode = myCamera.GetNode("Height");
Int32 Width = Convert.ToInt32(WidthNode.Max);
Int32 Height = Convert.ToInt32(HeightNode.Max);
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
// Create the View Windows for the 3 tabs
// Calculate the size of the window rect to display the images
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(0
, 0, 100, 100); ;
System.Windows.Forms.Control ctrl = System.Windows.Forms.Control.
FromChildHandle(Image1PictureBox.Handle);
frameRect = new Jai_FactoryWrapper.RECT(0, 0, ctrl.Width, ctrl.He
ight);
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.ChildStretch, "Image1", ref frameRect, ref maxSize, Image1Pi
ctureBox.Handle, out myImage1ViewWindowHandle);
ctrl = System.Windows.Forms.Control.FromChildHandle(Image2Picture
Box.Handle);
frameRect = new Jai_FactoryWrapper.RECT(0, 0, ctrl.Width, ctrl.He
ight);
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.ChildStretch, "Image2", ref frameRect, ref maxSize, Image2Pi
ctureBox.Handle, out myImage2ViewWindowHandle);
ctrl = System.Windows.Forms.Control.FromChildHandle(HDRImagePictu
reBox.Handle);
frameRect = new Jai_FactoryWrapper.RECT(0, 0, ctrl.Width, ctrl.He
ight);
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.ChildStretch, "HDRImage", ref frameRect, ref maxSize, HDRIma
gePictureBox.Handle, out myImageHDRViewWindowHandle);
// Setup the camera for software trigger
SetupTriggerMode();
// Setup the sequences
SetupSequences();
// Get the current camera values and update the GUI

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;
// ..

so we can now proceed with the HDR process

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

// Save the sequence settings into flash memory


myCamera.GetNode("SequenceSaveCommand").ExecuteCommand();
}
}
delegate void UpdateInfoDelegate();
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;
}
}
}

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

This is the source of the ImageDelegateSample/Form1.cs file


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());
}
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

This is the source of the InterPacketDelayCalculator/InterPacketDelayCalculator/Form1.cs file


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

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

This is the source of the LensDistortionCorrectionSample/Form1.cs file


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 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

Jai_FactoryWrapper.POINT pnt = new Jai_FactoryWrapper.POINT(10, 1


0);
Jai_FactoryWrapper.RECT rect = new Jai_FactoryWrapper.RECT(0, 0,
Width, Height);
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
// Open the live view
Jai_FactoryWrapper.EFactoryError error = Jai_FactoryWrapper.EFact
oryError.Success;
error = Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWr
apper.EIVWWindowType.OverlappedStretch, "Output", ref rect, ref maxSize, IntPtr.Z
ero, out WindowHandle);
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
myCamera.StartImageAcquisition(true, 5);
StartButton.Enabled = false;
StopButton.Enabled = true;
}
}
private void StopButton_Click(object sender, EventArgs e)
{
if (myCamera != null)
{
myCamera.StopImageAcquisition();
myCamera.NewImageDelegate -= new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
lock (myUndistortParametersLock)
{
// Free the internal undistortion map if it has been initiali
zed
Jai_FactoryWrapper.J_Image_ProcessingFree(ref myConversionBuf
fer, ref myUndistortParameters);
}
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

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

// 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
fo, ref myUndistortParameters);
}
}
if ((ImageInfo.AwaitDelivery < 2) && (WindowHandle != IntPtr.Zero))
{
if (mybUndistort)
{
if (!mybMonochrome)
{
// First we need to convert the image into either 32-bit
DIB or 48-bit "Image" format
error = Jai_FactoryWrapper.J_Image_FromRawToDIB(ref Image
Info, ref myConversionBuffer, Jai_FactoryWrapper.EColorInterpolationAlgorithm.Bay
erStandardMultiprocessor, myRedGain, myBlueGain, myGreenGain);
//error = Jai_FactoryWrapper.J_Image_FromRawToImage(ref I
mageInfo, ref myConversionBuffer, Jai_FactoryWrapper.EColorInterpolationAlgorithm
.BayerStandardMultiprocessor, myRedGain, myBlueGain, myGreenGain);
// Do the Lens Distortion Correction
lock (myUndistortParametersLock)
{
error = Jai_FactoryWrapper.J_Image_Processing(ref myC
onversionBuffer, ref myImageProcessingBuffer, myUndistortParameters, true);
}
}

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

This is the source of the MultiCamsAsyncImageRecording/MultiCamsAsyncImageRecording/Form1.cs


file
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.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

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
List<Jai_FactoryWrapper.ImageInfo> imageList =
.CameraList[i].GetAsyncRecordedImages();

myFactory

// Any images recorded?


if (imageList != null && (imageList.Count > 0))
{
// Run through the list of recorded images
for (int index = 0; index < myFactory.CameraList[i].
TotalAsyncImagesRecordedCount; index++)
{
Jai_FactoryWrapper.EFactoryError error = Jai_Fact
oryWrapper.EFactoryError.Success;
// Get the recorded image at this index
Jai_FactoryWrapper.ImageInfo ii = imageList[index
];
// Are we saving the images in "raw" format or in
Tiff?
if (saveRawCheckBox.Checked)
{
// Save the image to disk
//error = Jai_FactoryWrapper.J_Image_SaveFile
Raw(ref ii, ".\\RecordedImage" + index.ToString("000") + ".raw");
error = Jai_FactoryWrapper.J_Image_SaveFileRa
w(ref ii, sSubDirName + "\\" + sModelName + "_" + ii.TimeStamp.ToString() + ".raw
");
}
else
{
// Create local image that will contain the c
onverted image
Jai_FactoryWrapper.ImageInfo localImageInfo =
new Jai_FactoryWrapper.ImageInfo();
// Allocate buffer that will contain the conv
erted image
// In this sample we re-allocate the buffer o
ver-and-over because we assume that the recorded images could be
// of different size (If we have been using t
he Sequence functionality in the cameras)

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");

//Free the conversion buffer


error = Jai_FactoryWrapper.J_Image_Free(ref l
ocalImageInfo);
}
Application.DoEvents();
}
MessageBox.Show(this, "The recorded images has been s
aved!", "Image save", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
// 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();
}
}

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

602

Example Documentation

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;
}
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;

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

This is the source of the NodeEventSample/Form1.cs file


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 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";
}

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

607

608

Example Documentation

8.20

RedCompensationSample/Form1.cs

This is the source of the RedCompensationSample/Form1.cs file


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);
}

Generated on Wed Sep 19 12:02:03 2012 for JAI SDK .NET Wrapper by Doxygen

8.20 RedCompensationSample/Form1.cs

609

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");

// Pleora hack! They set Width.Max and Height.Max to 16K in their


custom systems
if ((Convert.ToInt32(WidthNode.Max) >= 16383) && (Convert.ToInt32
(WidthNode.Max) >= 16383))
{
Width = Convert.ToInt32(WidthNode.Value);
Height = Convert.ToInt32(HeightNode.Value);
}
else
{
Width = Convert.ToInt32(WidthNode.Max);
Height = Convert.ToInt32(HeightNode.Max);
}
Jai_FactoryWrapper.RECT frameRect = new Jai_FactoryWrapper.RECT(1
00, 100, Width, Height);
Jai_FactoryWrapper.SIZE maxSize = new Jai_FactoryWrapper.SIZE(Wid
th, Height);
// Create View Window to display the processed output (instead of
the original)
Jai_FactoryWrapper.J_Image_OpenViewWindowEx(Jai_FactoryWrapper.EI
VWWindowType.OverlappedStretch, "Red-Compensation Output", ref frameRect, ref max
Size, IntPtr.Zero, out myViewWindow);
myCamera.NewImageDelegate += new Jai_FactoryWrapper.ImageCallBack
(HandleImage);
myCamera.StartImageAcquisition(true, 5);
}
}
private void StopButton_Click(object sender, EventArgs e)

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

This is the source of the SimpleImageDisplaySample/Form1.cs file


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();
}
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

// 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();
}
}
}

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

This is the source of the ZoomImageDisplaySample/Form1.cs file


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 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

private void CenterButton_Click(object sender, EventArgs e)


{
if (myCamera != null)
myCamera.NavigateCenter();
}
private void RightButton_Click(object sender, EventArgs e)
{
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

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

ICommand GenICam node specific functions, 259


IConfRom
WRAP_CAM, 162
IConverter
WRAP_CAM, 162
ID
Jai_FactoryDotNET::Jai_FactoryWrapper::ActionCommandAck,
376
IDeviceInfo
WRAP_CAM, 162
IEnumEntry
WRAP_CAM, 162
IEnumeration
WRAP_CAM, 162
IEnumeration GenICam node specific functions,
257
IEnumValue
Jai_FactoryDotNET::CNode::IEnumValue,
434
IFloat
WRAP_CAM, 162
IFloat GenICam node specific functions, 252
IFloatReg
WRAP_CAM, 162
IIntConverter
WRAP_CAM, 162
IInteger
WRAP_CAM, 162
IInteger GenICam node specific functions, 248
IIntKey
WRAP_CAM, 162
IIntReg
WRAP_CAM, 162
IIntSwissKnife
WRAP_CAM, 162
Image acquisition and manipulation functions, 265
Image Acquisition Control methods, 333
Image Data Stream access functions, 181
Image manipulation functions, 288
Image Processing functions, 319
Image save and load functions, 296
Image Save methods, 353
Image white balance control functions, 302
ImageBuffer
Jai_FactoryDotNET::Jai_FactoryWrapper::ImageInfo, 437
ImageCallBack
WRAP_DATASTREM_ACCESS, 183
ImageRotateType
Jai_FactoryDotNET::CCamera, 397
ImageSize
Jai_FactoryDotNET::CCamera, 395

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

Vous aimerez peut-être aussi