FEDRA emulsion software from the OPERA Collaboration
imapidef.h
Go to the documentation of this file.
1 /*******************************************************************
2  *
3  * COPYRIGHT (c) 2000 Matrox Electronic Systems Ltd.
4  * All Rights Reserved
5  *
6  *******************************************************************/
7 
8 #ifndef __IMAPIDEF_H__
9 #define __IMAPIDEF_H__
10 
11 #if !defined(_IM_LOCAL_CODE) && defined(SHOW_INCLUDE_FILE)
12 #pragma message ("#include "__FILE__)
13 #endif
14 
15 
16 /*******************************************************************
17  *
18  * Odyssey Native Library #defines.
19  *
20  *******************************************************************/
21 
22 /* Initialization */
23 #define IM_PARTIAL_RESET 1
24 #define IM_DOWNLOAD 2
25 #define IM_DOWNLOAD_ONLY 4
26 
27 /* Messaging macro */
28 #define IM_PRINT_NO_WAIT(NodeId) (((NodeId) << 16) | 0)
29 #define IM_PRINT_WAIT(NodeId) (((NodeId) << 16) | 1)
30 #define IM_PRINT_WAIT_NO_ECHO(NodeId) (((NodeId) << 16) | 2)
31 #define IM_PRINT_WAIT_ECHO(NodeId) (((NodeId) << 16) | 4)
32 #define IM_PRINT_RETRY(NodeId) (((NodeId) << 16) | 8)
33 #define IM_PRINT_NO_ECHO(NodeId) (((NodeId) << 16) | 0x10)
34 
35 /* Data formats */
36 #define IM_UNSIGNED 0x00000000
37 #define IM_SIGNED 0x10000000
38 #define IM_IEEE754 0x20000000
39 #define IM_PACKED 0x40000000
40 #define IM_ALIGN_ON_SIZE 0x80000000 /* Internal use only */
41 
42 /* Buffer types */
43 #define IM_BINARY (1L | IM_PACKED)
44 #define IM_RGB (24L | IM_PACKED)
45 #define IM_UBYTE (8L | IM_UNSIGNED)
46 #define IM_USHORT (16L | IM_UNSIGNED)
47 #define IM_ULONG (32L | IM_UNSIGNED)
48 #define IM_BYTE (8L | IM_SIGNED)
49 #define IM_SHORT (16L | IM_SIGNED)
50 #define IM_LONG (32L | IM_SIGNED)
51 #define IM_FLOAT (32L | IM_IEEE754)
52 #define IM_DOUBLE (64L | IM_IEEE754)
53 
54 /* Conditional operators */
55 #define IM_IN_RANGE 1
56 #define IM_OUT_RANGE 2
57 #define IM_EQUAL 3
58 #define IM_NOT_EQUAL 4
59 #define IM_GREATER 5
60 #define IM_LESS 6
61 #define IM_GREATER_OR_EQUAL 7
62 #define IM_LESS_OR_EQUAL 8
63 
64 /* Morphological operators */
65 #define IM_ERODE 1
66 #define IM_DILATE 2
67 #define IM_THIN 3
68 #define IM_THICK 4
69 #define IM_HIT_OR_MISS 5
70 #define IM_MATCH 6
71 #define IM_CLOSE 10
72 #define IM_OPEN 11
73 
74 /* Arithmetic operators */
75 #define IM_ADD 0x0000
76 #define IM_SUB 0x0001
77 #define IM_SUB_NEG 0x000A
78 #define IM_SUB_ABS 0x0011
79 #define IM_MIN 0x0012
80 #define IM_MAX 0x0013
81 #define IM_OR 0x0016
82 #define IM_AND 0x0017
83 #define IM_XOR 0x0018
84 #define IM_NOR 0x0019
85 #define IM_NAND 0x001A
86 #define IM_XNOR 0x001B
87 #define IM_NOT 0x0014
88 #define IM_NEG 0x0023
89 #define IM_ABS 0x000C
90 #define IM_PASS 0x0002
91 #define IM_MULT 0x0100
92 #define IM_DIV 0x0101
93 #define IM_DIV_INTO 0x0102
94 
95 /* Additional arithmetic operators */
96 #define IM_LOG 0x0000
97 #define IM_EXP 0x0001
98 #define IM_SIN 0x0002
99 #define IM_COS 0x0003
100 #define IM_TAN 0x0004
101 #define IM_QUAD 0x0005
102 
103 /* Yet more arithmetic operators */
104 #define IM_SUB_CLIP 0x0081
105 #define IM_SHIFT 0x0200
106 #define IM_ADD_SAT 0x0201
107 #define IM_SUB_SAT 0x0202
108 #define IM_MULT_SAT 0x0203
109 #define IM_SQUARE 0x0300
110 #define IM_SQRT 0x0301
111 #define IM_ATAN 0x0302
112 #define IM_CUBE 0x0303
113 #define IM_CBRT 0x0304
114 #define IM_SQUARE_ADD 0x0305
115 #define IM_MULT_MSB 0x0306
116 #define IM_DIV_FRAC 0x0307
117 #define IM_ATAN2 0x0308
118 #define IM_MAGNITUDE 0x0309
119 #define IM_POW 0x030A
120 #define IM_POW_YX 0x030B
121 
122 
123 /* imGen1d() */
124 #define IM_POLYNOMIAL 0x0400
125 
126 /* Buffer inquiries */
127 #define IM_BUF_SIZE_X 1
128 #define IM_BUF_SIZE_Y 2
129 #define IM_BUF_NUM_BANDS 3
130 #define IM_BUF_TYPE 4
131 #define IM_BUF_SIZE_BIT 5
132 #define IM_BUF_FORMAT 6
133 #define IM_BUF_PARENT_ID 7
134 #define IM_BUF_OFFSET_X 8
135 #define IM_BUF_OFFSET_Y 9
136 #define IM_BUF_OFFSET_BAND 10
137 #define IM_BUF_NUM_FIELDS 11
138 #define IM_BUF_OWNER_ID 12
139 
140 /* Additional buffer inquiries */
141 #define IM_BUF_LOCATION 13
142 #define IM_BUF_PHYSICAL_ADDRESS 14
143 #define IM_BUF_PITCH 15
144 #define IM_BUF_PITCH_GRANULARITY 16
145 #define IM_BUF_BUF_POINTER 17
146 #define IM_BUF_BUF_JPEG_POINTER 18
147 #define IM_BUF_BAND_PTR 19
148 #define IM_BUF_LOCAL_ADDRESS 20
149 #define IM_BUF_PARENT_POINTER 21
150 #define IM_BUF_PHYSICAL_ADDRESS64 22
151 
152 /* System inquiries */
153 #define IM_SYS_NUM_NODES 1
154 #define IM_SYS_NUM_DIGITIZERS 2
155 #define IM_SYS_NUM_DISPLAYS 3
156 #define IM_SYS_NUM_SYSTEMS 4
157 #define IM_SYS_PRODUCT_LIST 5
158 #define IM_SYS_PRODUCT_LIST_FREE 6
159 #define IM_SYS_GET_DEV_NUMBER 7
160 
161 /* Device inquiries */
162 #define IM_DEV_CPU 1
163 #define IM_DEV_CPU_SPEED 2
164 #define IM_DEV_VIA_PRIMARY 3
165 #define IM_DEV_VIA_DISPLAY 4
166 #define IM_DEV_ACCELERATOR 5
167 #define IM_DEV_MEM_PROC 6
168 #define IM_DEV_MEM_DISP 7
169 #define IM_DEV_MEM_OVERLAY 8
170 #define IM_DEV_MEM_HOST 9
171 #define IM_DEV_OWNER_SYSTEM 10
172 #define IM_DEV_OWNER_NODE 11
173 #define IM_DEV_MSG_TOTAL 12
174 #define IM_DEV_MSG_FREE 13
175 #define IM_DEV_FREE_MEM_PROC 14
176 #define IM_DEV_FREE_MEM_DISP 15
177 #define IM_DEV_FREE_MEM_HOST 16
178 #define IM_DEV_FREE_MEM_PROC_FAST 17
179 #define IM_DEV_FREE_MEM_PROC_SHARED 18
180 #define IM_DEV_FREE_MEM_PROC_EXTENDED 19
181 #define IM_DEV_FREE_HEAP 20
182 #define IM_DEV_PRODUCT_ID 21
183 #define IM_DEV_PRODUCT_CLASS 22
184 #define IM_DEV_CUSTOMER_PRODUCT_ID 23
185 #define IM_DEV_PRODUCT_SERIAL_NUMBER 24
186 #define IM_DEV_CPU_TYPE 25
187 #define IM_DEV_PITCH_GRANULARITY 26
188 #define IM_DEV_HEAP_SIZE 27
189 #define IM_DEV_NUM_OF_STREAMS 28 /* Internal use */
190 #define IM_DEV_PERCENT_UTILIZATION 29
191 
192 #define IM_DEV_PPC 1
193 
194 /* Device control */
195 #define IM_DEV_RAMDISK 1
196 #define IM_DEV_TRACING 2
197 #define IM_DEV_SET_MEMORY_CALIBRATION 3
198 
199 /* Device inquiries product id */
200 #define IM_DEV_ODYSSEY_CLASS 0x10000
201 #define IM_DEV_ODYSSEY_PHASE_II (IM_DEV_ODYSSEY_CLASS | 1)
202 #define IM_DEV_ODYSSEY_PROTO (IM_DEV_ODYSSEY_CLASS | 2)
203 #define IM_DEV_ODYSSEY (IM_DEV_ODYSSEY_CLASS | 3)
204 #define IM_DEV_ODYSSEY_XCL (IM_DEV_ODYSSEY_CLASS | 4)
205 #define IM_DEV_ODYSSEY_XA (IM_DEV_ODYSSEY_CLASS | 5)
206 #define IM_DEV_ODYSSEY_XD (IM_DEV_ODYSSEY_CLASS | 6)
207 #define IM_DEV_ODYSSEY_XPRO (IM_DEV_ODYSSEY_CLASS | 7)
208 #define IM_DEV_ODYSSEY_XPRO_PROC (IM_DEV_ODYSSEY_CLASS | 8)
209 #define IM_DEV_ODYSSEY_XPRO_FLEX (IM_DEV_ODYSSEY_CLASS | 9)
210 #define IM_DEV_ODYSSEY_DISPLAY (IM_DEV_ODYSSEY_CLASS | 10)
211 #define IM_DEV_ODYSSEY_CARRIER (IM_DEV_ODYSSEY_CLASS | 11)
212 #define IM_DEV_ODYSSEY_UNDEF (IM_DEV_ODYSSEY_CLASS | 99)
213 
214 /* Externel Device inquiries board id */
215 #define IM_EXTDEV_NONE 0
216 #define IM_EXTDEV_USER 1
217 #define IM_EXTDEV_UNKNOWN 2
218 #define IM_EXTDEV_CL_FULL 3
219 #define IM_EXTDEV_CL_DUAL 4
220 #define IM_EXTDEV_ANALOG 5
221 #define IM_EXTDEV_DIGITAL 6
222 
223 #define IM_EXTREV_UNKNOWN 0
224 #define IM_EXTREV_CL_FULL 1
225 #define IM_EXTREV_XCL_FULL 2
226 #define IM_EXTREV_CL_DUAL 3
227 #define IM_EXTREV_XCL_DUAL 4
228 #define IM_EXTREV_ANALOG_PMC 5
229 #define IM_EXTREV_ANALOG_PMC_REV2 6
230 #define IM_EXTREV_ANALOG_PMC_REV2_100 7
231 #define IM_EXTREV_ANALOG_XA 8
232 #define IM_EXTREV_ANALOG_XA_LC 9
233 #define IM_EXTREV_DIGITAL_PMC 10
234 #define IM_EXTREV_DIGITAL_XD 11
235 
236 
237 /* Link port speed */
238 
239 #define IM_LINK_SPEED_PCI_PTHRU_16_66_MHZ 0
240 #define IM_LINK_SPEED_PCI_16_66_MHZ 1
241 #define IM_LINK_SPEED_PCI_33_33_MHZ 2
242 #define IM_LINK_SPEED_PCI_50_00_MHZ 3
243 #define IM_LINK_SPEED_PCI_66_66_MHZ 4
244 #define IM_LINK_SPEED_NOT_USED1 5
245 #define IM_LINK_SPEED_NOT_USED2 6
246 #define IM_LINK_SPEED_NOT_USED3 7
247 #define IM_LINK_SPEED_PCIX_PTHRU_16_66_MHZ 8
248 #define IM_LINK_SPEED_PCIX_16_66_MHZ 9
249 #define IM_LINK_SPEED_PCIX_33_33_MHZ 10
250 #define IM_LINK_SPEED_PCIX_50_00_MHZ 11
251 #define IM_LINK_SPEED_PCIX_66_66_MHZ 12
252 #define IM_LINK_SPEED_PCIX_83_33_MHZ 13
253 #define IM_LINK_SPEED_PCIX_100_00_MHZ 14
254 #define IM_LINK_SPEED_PCIX_133_33_MHZ 15
255 #define IM_LINK_SPEED_NOT_SET 16
256 
257 /* Application inquires */
258 #define IM_APP_TIMEOUT 1
259 #define IM_APP_STDOUT 2
260 
261 /* Miscellaneous defines */
262 #define IM_DEFAULT 0x10000000
263 #define IM_NONE 0x20000000
264 #define IM_DONT_CARE_32 0x00ffffff
265 #define IM_NO_CHANGE -9999
266 #define IM_ALL 0
267 #define IM_ENABLE -9997
268 #define IM_DISABLE -9999
269 #define IM_UNKNOWN -9999
270 #define IM_CONTINUOUS -1
271 #define IM_FORWARD 1
272 #define IM_REVERSE 2
273 #define IM_REVERSE_0 0x10
274 #define IM_REVERSE_1 0x20
275 #define IM_REVERSE_2 0x40
276 #define IM_REVERSE_3 0x80
277 #define IM_REVERSE_4 0x100
278 #define IM_REVERSE_5 0x200
279 #define IM_REVERSE_6 0x400
280 #define IM_REVERSE_7 0x800
281 #define IM_VERY_LOW 0
282 #define IM_LOW 1
283 #define IM_MEDIUM 2
284 #define IM_HIGH 3
285 #define IM_CLEAR 1
286 #define IM_NO_CLEAR 2
287 #define IM_IDEMPOTENCE -1
288 #define IM_FAST 0x40000
289 #define IM_VERY_FAST 0x80000
290 #define IM_BEST 0x100000
291 #define IM_MULTIPLE 0x400000
292 #define IM_ABSOLUTE 1
293 #define IM_OFFSET 2
294 #define IM_CLEAR_BACKGROUND 0x2000
295 #define IM_SYNCHRONOUS 1
296 #define IM_ASYNCHRONOUS 2
297 #define IM_FILL -1
298 #define IM_VIA_ONLY 0
299 #define IM_ADDRESS_ONLY 1
300 #define IM_SAVE 2
301 #define IM_FASTEST 3
302 #define IM_SAME_KERNEL 4
303 #define IM_CACHE_BUF_SIZE 0x1000
304 #define IM_PARENT 0x40000000
305 #define IM_CALCULATE -9998
306 
307 /* More miscellaneous stuff */
308 #define IM_NO_HALT 0
309 #define IM_NOW 1
310 #define IM_FRAME 2
311 #define IM_FIELD 3
312 #define IM_LINE 4
313 #define IM_PATCH 5
314 #define IM_PACK_0 1
315 #define IM_UNPACK_0 2
316 #define IM_PACK_1 17
317 #define IM_UNPACK_1 18
318 #define IM_DONT_CARE 0x8000
319 #define IM_EXACT 0x20000
320 #define IM_URGENT 5
321 #define IM_SYNCHRONIZED 1
322 #define IM_CLIP_SQUARE 10
323 #define IM_FIRST_FIELD -1
324 #define IM_FIRST 0
325 #define IM_SECOND 1
326 #define IM_BOTH 2
327 #define IM_MODE_2 0x8000000
328 #define IM_THRESH_CONSTANT 0x100
329 #define IM_THRESH_PIXEL 0x200
330 #define IM_PASS_CONSTANT 0x400
331 #define IM_PASS_PIXEL 0x800
332 #define IM_PIXEL 1
333 #define IM_LINE_INTERLACED 0x10000000
334 #define IM_LINE_PSEUDO 0x20000000
335 
336 /* VIA-related values not defined elsewhere */
337 #define IM_24_TO_32 1
338 #define IM_32_TO_24 2
339 #define IM_PROGRESSIVE 0
340 #define IM_INTERLACED 1
341 #define IM_ODD 0
342 #define IM_EVEN 1
343 #define IM_NEXT 2
344 
345 /* Display control */
346 #define IM_KEY_OFF 0
347 #define IM_KEY_ALWAYS 1
348 #define IM_KEY_IN_RANGE 2
349 #define IM_KEY_OUT_RANGE 3
350 
351 /* VGA Mode */
352 #define IM_SINGLE_SCREEN 0
353 #define IM_DUAL_SCREEN 1
354 #define IM_DUAL_HEAD 2
355 #define IM_WINDOWED 3
356 #define IM_NO_DISPLAY 4
357 
358 /* File formats */
359 #define IM_MIL 0
360 #define IM_RAW 1
361 #define IM_TIFF 2
362 
363 /* Additional file formats */
364 #define IM_NATIVE 10
365 
366 /* Conversions */
367 #define IM_TRUNCATE 1
368 #define IM_ROUND 2
369 #define IM_ZERO_EXTEND 4
370 #define IM_SIGN_EXTEND 5
371 #define IM_CLIP 0x80
372 #define IM_ABS_CLIP (IM_ABS | IM_CLIP)
373 
374 /* imBufStatistics() */
375 #define IM_MAX_PIXEL 0x00000001
376 #define IM_MIN_PIXEL 0x00000002
377 #define IM_SUM_PIXEL 0x00000004
378 #define IM_SUM_PIXEL_SQUARED 0x00000008
379 #define IM_MEAN_PIXEL 0x00000010
380 #define IM_SIGMA_PIXEL 0x00000020
381 #define IM_MIN_ABS_PIXEL 0x00000040
382 #define IM_MAX_ABS_PIXEL 0x00000080
383 #define IM_SUM_ABS_PIXEL 0x00000100
384 #define IM_NUM_PIXEL 0x00000200
385 #define IM_FIELDS_ONLY 0x40000000
386 #define IM_NO_FIELDS 0x80000000
387 
388 /* imIntFlip() */
389 #define IM_FLIP_H 0x0001
390 #define IM_FLIP_V 0x0002
391 #define IM_ROTATE_90 0x0010
392 #define IM_ROTATE_180 0x0020
393 #define IM_ROTATE_270 0x0030
394 
395 /* imIntHistogramEqualize() */
396 #define IM_UNIFORM 1
397 #define IM_EXPONENTIAL 2
398 #define IM_RAYLEIGH 3
399 #define IM_HYPER_CUBE_ROOT 4
400 #define IM_HYPER_LOG 5
401 #define IM_IMAGE_TO_LUT 1
402 #define IM_HIST_TO_LUT 3
403 
404 /* imIntRank() */
405 #define IM_MEDIAN 0x10000
406 
407 /* Geometric transforms */
408 #define IM_ROTATE 0x401
409 #define IM_SCALE 2
410 #define IM_TRANSLATE 4
411 #define IM_SHEAR_X 5
412 #define IM_SHEAR_Y 6
413 #define IM_RECT_TO_POLAR 7
414 #define IM_POLAR_TO_RECT 8
415 
416 /* Interpolation types */
417 #define IM_NO_INTERPOLATE 0x00000002
418 #define IM_INTERPOLATE 0x00000004
419 #define IM_BILINEAR 0x00000008
420 #define IM_BICUBIC 0x00000010
421 #define IM_AVERAGE 0x00000020
422 #define IM_NEAREST_NEIGHBOR 0x00000040
423 
424 /* Overscan or graphic modes */
425 #define IM_OPAQUE 0x01000058
426 #define IM_TRANSPARENT 0x01000059
427 #define IM_REPLACE 0x01000060
428 #define IM_MIRROR 0x01000061
429 #define IM_REPLACE_MAX 0x01000063
430 #define IM_REPLACE_MIN 0x01000064
431 
432 /* Synchronization */
433 #define IM_WAITING 0x1
434 #define IM_EXECUTING 0x2
435 #define IM_READY 0x4
436 #define IM_STARTED 0x8
437 #define IM_COMPLETED 0x10
438 #define IM_OSB_RESET 0x20
439 #define IM_OSB_CANCEL 0x40
440 
441 #define IM_INQUIRE 0x0800000
442 #define IM_LINE_INT 0x1000000
443 #define IM_INFINITE -1
444 #define IM_NON_SIGNALLED IM_WAITING
445 #define IM_SIGNALLED IM_COMPLETED
446 #define IM_AUTO_RESET 1
447 #define IM_MANUAL_RESET 2
448 
449 #define IM_SINGLE_NODE 1
450 #define IM_MULTI_NODE 2
451 
452 /* Buffer location */
453 #define IM_PROC 1
454 #define IM_DISP 2
455 #define IM_HOST 3
456 #define IM_NON_PAGED 4
457 #define IM_NON_PAGED_VIRTUAL 5
458 #define IM_PROC_EXTENDED 6
459 #define IM_PROC_FAST 7
460 #define IM_PROC_SHARED 8
461 #define IM_LOCAL 9 // This case is for imBufCreate when we pass local address
462 
463 #define IM_NO_FLUSH 0x10000
464 #define IM_NO_READ_WRITE 0x20000
465 #define IM_NO_WRITE 0x40000
466 
467 /* Buffer control */
468 #define IM_BUF_FLUSH 1
469 #define IM_BUF_PROTECT 2
470 #define IM_BUF_PAD 3
471 // Also IM_BUF_PITCH 15
472 
473 // Protect values
474 #define IM_START 0x01000000
475 #define IM_END 0x02000000
476 #define IM_READ_ONLY 0x04000000
477 #define IM_NO_ACCESS 0x08000000
478 
479 
480 /* PP ALU opcodes for imBinTriadic() and imIntTriadic() */
481 #define IM_PP_ZERO 0x00000000
482 #define IM_PP_ONE 0x07f80000
483 #define IM_PP_PASS_A 0x05500000
484 #define IM_PP_PASS IM_PP_PASS_A
485 #define IM_PP_NOT 0x02a80000
486 #define IM_PP_AND 0x04400000
487 #define IM_PP_OR 0x07700000
488 #define IM_PP_XOR 0x03300000
489 #define IM_PP_NAND 0x03b80000
490 #define IM_PP_NOR 0x00880000
491 #define IM_PP_XNOR 0x04c80000
492 #define IM_PP_MERGE 0x05600000
493 #define IM_PP_XOR_XOR 0x04b00000
494 
495 /* PP ALU opcodes for imIntTriadic() */
496 #define IM_PP_PASS_B 0x06600000
497 #define IM_PP_PASS_C 0x07800000
498 #define IM_PP_SRA_ADD 0x0b510000
499 #define IM_PP_SRA_SUB 0x0cad0000
500 #define IM_PP_ADD_AND 0x0b500000
501 #define IM_PP_SUB_AND 0x0cac0000
502 #define IM_PP_ADD_OR 0x0ab00000
503 #define IM_PP_SUB_OR 0x0d4c0000
504 #define IM_PP_ADD_ABS 0x0cb30000
505 #define IM_PP_SUB_ABS 0x0b4f0000
506 #define IM_PP_EXT_FIELD 0x06000000
507 #define IM_PP_INS_FIELD 0x05600000
508 #define IM_PP_ADD_FIELD 0x0b000000
509 
510 /* Pseudo-opcodes for imIntTriadic() */
511 #define IM_PP_ADD_ADD 0xf0000f00
512 #define IM_PP_ADD_SUB 0xf0000f01
513 #define IM_PP_SUB_SUB 0xf0000f02
514 
515 /* Colour conversion */
516 #define IM_RGB_TO_HSL 1
517 #define IM_RGB_TO_L 2
518 #define IM_HSL_TO_RGB 3
519 #define IM_L_TO_RGB 4
520 #define IM_RGB_TO_I 5
521 #define IM_RGB_TO_H 6
522 #define IM_RGB_TO_RGB 7
523 #define IM_RGB_TO_BGR 8
524 #define IM_BGR_TO_RGB IM_RGB_TO_BGR
525 #define IM_BAYER_GB 10
526 #define IM_BAYER_BG 11
527 #define IM_BAYER_GR 12
528 #define IM_BAYER_RG 13
529 #define IM_RGB_TO_Y 20
530 #define IM_RGB_TO_YUV 0x20
531 #define IM_RGB_TO_YUV16 0x21
532 #define IM_RGB_TO_YUV12 0x22
533 #define IM_RGB_TO_YUV9 0x23
534 #define IM_Y_TO_RGB 40
535 #define IM_YUV_TO_RGB 0x40
536 #define IM_YUV16_TO_RGB 0x41
537 #define IM_YUV12_TO_RGB 0x42
538 #define IM_YUV9_TO_RGB 0x43
539 #define IM_RGB_TO_RGB555 0x50
540 #define IM_RGB_TO_RGB565 0x51
541 #define IM_MATRIX 0x100
542 #define _IM_RGB_TO_YCRCB 0x200
543 #define _IM_RGB_TO_YCLIP 0x201
544 #define _IM_YCRCB_TO_RGB 0x202
545 
546 /* Distance transforms */
547 #define IM_CHAMFER_3_4 1
548 #define IM_CITY_BLOCK 2
549 #define IM_CHESSBOARD 3
550 
551 /* Lattice values */
552 #define IM_4_CONNECTED 0x10
553 #define IM_8_CONNECTED 0x20
554 
555 /* imIntTriadic() */
556 #define IM_CONSTANT_A 0x100
557 #define IM_CONSTANT_B 0x200
558 #define IM_CONSTANT_C 0x400
559 #define IM_CONSTANT_AC (IM_CONSTANT_A | IM_CONSTANT_C)
560 
561 /* Graphics control */
562 #define IM_PLOT_POLY 1
563 #define IM_PLOT_LINES 2
564 #define IM_PLOT_DOTS 3
565 #define IM_FONT_DEFAULT 1
566 #define IM_FONT_SMALL 2
567 #define IM_FONT_MEDIUM 3
568 #define IM_FONT_LARGE 4
569 
570 /* JPEG module */
571 #define IM_BASELINE 0
572 #define IM_LOSSLESS 3
573 #define IM_HUFFMAN 0
574 #define IM_ARITHMETIC 8
575 #define IM_RGB24 0
576 #define IM_YUV24 1
577 #define IM_YUV16 2
578 #define IM_YUV12 3
579 #define IM_YUV9 4
580 
581 /*************************************/
582 /* Pattern matching module */
583 /*************************************/
584 #define IM_TEMPLATE 0x0001
585 #define IM_NORMALIZED 0x0002
586 #define IM_ROTATION 0x0004
587 
588 #define IM_PAT_FOUND_FLAG 1
589 #define IM_PAT_SCORE 2
590 #define IM_PAT_POSITION_X 3
591 #define IM_PAT_POSITION_Y 4
592 #define IM_PAT_ANGLE 5
593 #define IM_PAT_SCALE 6
594 #define IM_PAT_ORIENTATION 7
595 
596 #define IM_PAT_TYPE 1
597 #define IM_PAT_SIZE_X 2
598 #define IM_PAT_SIZE_Y 3
599 #define IM_PAT_CENTRE_X 4
600 #define IM_PAT_CENTRE_Y 5
601 #define IM_PAT_NOMINAL_X 6
602 #define IM_PAT_NOMINAL_Y 7
603 #define IM_PAT_SPEED 8
604 #define IM_PAT_POSITION_START_X 9
605 #define IM_PAT_POSITION_START_Y 10
606 #define IM_PAT_POSITION_SIZE_X 11
607 #define IM_PAT_POSITION_SIZE_Y 12
608 #define IM_PAT_POSITION_ACCURACY 13
609 #define IM_PAT_PREPROCESSED 14
610 #define IM_PAT_OFFSET_X 15
611 #define IM_PAT_OFFSET_Y 16
612 #define IM_PAT_ACCEPTANCE 17
613 #define IM_PAT_NUMBER 18
614 #define IM_PAT_WORKBUF_SIZE_X 19
615 #define IM_PAT_WORKBUF_SIZE_Y 20
616 #define IM_PAT_WORKBUF_FAST 21
617 #define IM_PAT_WORKBUF_ROTATION 22
618 #define IM_PAT_WORKBUF 23
619 #define IM_PAT_RESULT_SIZE 24
620 #define IM_PAT_CERTAINTY 25
621 
622 #define IM_PAT_FIRST_LEVEL 31
623 #define IM_PAT_LAST_LEVEL 32
624 #define IM_PAT_MODEL_STEP 33
625 #define IM_PAT_FAST_FIND 34
626 #define IM_PAT_MIN_SPACING_X 35
627 #define IM_PAT_MIN_SPACING_Y 36
628 #define IM_PAT_SCORE_TYPE 37
629 #define IM_PAT_FILE_TYPE 38
630 
631 #define IM_PAT_MODEL_POINTER 39
632 #define IM_PAT_RESULT_POINTER 40
633 #define IM_PAT_REJECTION 41
634 #define IM_PAT_BEST_REJECT_SCORE 42
635 #define IM_PAT_BEST_REJECT_LEVEL 43
636 
637 #define IM_PAT_CENTER_X IM_PAT_CENTRE_X
638 #define IM_PAT_CENTER_Y IM_PAT_CENTRE_Y
639 #define IM_PAT_ORIGINAL_X IM_PAT_NOMINAL_X
640 #define IM_PAT_ORIGINAL_Y IM_PAT_NOMINAL_Y
641 
642 /**********************************/
643 /* Blob Analysis module */
644 /**********************************/
645 /* Binary features */
646 #define IM_BLOB_LABEL_VALUE 1
647 #define IM_BLOB_AREA 2
648 #define IM_BLOB_PERIMETER 3
649 #define IM_BLOB_FERET_X 4
650 #define IM_BLOB_FERET_Y 5
651 #define IM_BLOB_BOX_X_MIN 6
652 #define IM_BLOB_BOX_Y_MIN 7
653 #define IM_BLOB_BOX_X_MAX 8
654 #define IM_BLOB_BOX_Y_MAX 9
655 #define IM_BLOB_FIRST_POINT_X 10
656 #define IM_BLOB_FIRST_POINT_Y 11
657 #define IM_BLOB_AXIS_PRINCIPAL_LENGTH 12
658 #define IM_BLOB_AXIS_SECONDARY_LENGTH 13
659 #define IM_BLOB_FERET_MIN_DIAMETER 14
660 #define IM_BLOB_FERET_MIN_ANGLE 15
661 #define IM_BLOB_FERET_MAX_DIAMETER 16
662 #define IM_BLOB_FERET_MAX_ANGLE 17
663 #define IM_BLOB_FERET_MEAN_DIAMETER 18
664 #define IM_BLOB_CONVEX_AREA 19
665 #define IM_BLOB_CONVEX_PERIMETER 20
666 #define IM_BLOB_X_MIN_AT_Y_MIN 21
667 #define IM_BLOB_X_MAX_AT_Y_MAX 22
668 #define IM_BLOB_Y_MIN_AT_X_MAX 23
669 #define IM_BLOB_Y_MAX_AT_X_MIN 24
670 #define IM_BLOB_COMPACTNESS 25
671 #define IM_BLOB_NUMBER_OF_HOLES 26
672 #define IM_BLOB_FERET_ELONGATION 27
673 #define IM_BLOB_ROUGHNESS 28
674 #define IM_BLOB_EULER_NUMBER 47
675 #define IM_BLOB_LENGTH 48
676 #define IM_BLOB_BREADTH 49
677 #define IM_BLOB_ELONGATION 50
678 #define IM_BLOB_INTERCEPT_0 51
679 #define IM_BLOB_INTERCEPT_45 52
680 #define IM_BLOB_INTERCEPT_90 53
681 #define IM_BLOB_INTERCEPT_135 54
682 #define IM_BLOB_NUMBER_OF_RUNS 55
683 #define IM_BLOB_ASPECT_RATIO IM_BLOB_FERET_ELONGATION
684 #define IM_BLOB_GENERAL_FERET 0x400
685 
686 /* Greyscale features */
687 #define IM_BLOB_SUM_PIXEL 29
688 #define IM_BLOB_MIN_PIXEL 30
689 #define IM_BLOB_MAX_PIXEL 31
690 #define IM_BLOB_MEAN_PIXEL 32
691 #define IM_BLOB_SIGMA_PIXEL 33
692 #define IM_BLOB_SUM_PIXEL_SQUARED 46
693 
694 /* Binary or greyscale features */
695 #define IM_BLOB_CENTER_OF_GRAVITY_X 34
696 #define IM_BLOB_CENTER_OF_GRAVITY_Y 35
697 #define IM_BLOB_MOMENT_X0_Y1 36
698 #define IM_BLOB_MOMENT_X1_Y0 37
699 #define IM_BLOB_MOMENT_X1_Y1 38
700 #define IM_BLOB_MOMENT_X0_Y2 39
701 #define IM_BLOB_MOMENT_X2_Y0 40
702 #define IM_BLOB_MOMENT_CENTRAL_X1_Y1 41
703 #define IM_BLOB_MOMENT_CENTRAL_X0_Y2 42
704 #define IM_BLOB_MOMENT_CENTRAL_X2_Y0 43
705 #define IM_BLOB_AXIS_PRINCIPAL_ANGLE 44
706 #define IM_BLOB_AXIS_SECONDARY_ANGLE 45
707 #define IM_BLOB_GENERAL_MOMENT 0x800
708 
709 /* Short cuts for enabling multiple features */
710 #define IM_BLOB_ALL_FEATURES 0x100
711 #define IM_BLOB_BOX 0x101
712 #define IM_BLOB_CONTACT_POINTS 0x102
713 #define IM_BLOB_CENTER_OF_GRAVITY 0x103
714 #define IM_BLOB_NO_FEATURES 0x104
715 
716 /* Groups of results that can be read back together */
717 #define IM_BLOB_GROUP1 0x201
718 #define IM_BLOB_GROUP2 0x202
719 #define IM_BLOB_GROUP3 0x203
720 #define IM_BLOB_GROUP4 0x204
721 #define IM_BLOB_GROUP5 0x205
722 #define IM_BLOB_GROUP6 0x206
723 #define IM_BLOB_GROUP7 0x207
724 #define IM_BLOB_GROUP8 0x208
725 #define IM_BLOB_GROUP9 0x209
726 
727 /* imBlobControl() and/or imBlobInquire() */
728 #define IM_BLOB_IMAGE_TYPE 1
729 #define IM_BLOB_IDENTIFICATION 2
730 #define IM_BLOB_LATTICE 3
731 #define IM_BLOB_FOREGROUND_VALUE 4
732 #define IM_BLOB_PIXEL_ASPECT_RATIO 5
733 #define IM_BLOB_NUMBER_OF_FERETS 6
734 #define IM_BLOB_RESET 9
735 #define IM_BLOB_SAVE_RUNS 14
736 #define IM_BLOB_MAX_LABEL 16
737 #define IM_BLOB_MAX_TIME 17
738 #define IM_BLOB_TIMEOUT 18
739 #define IM_BLOB_TIME_SLICE 19
740 
741 /* General moment type */
742 #define IM_ORDINARY 0x400
743 #define IM_CENTRAL 0x800
744 
745 /* Blob identification */
746 #define IM_WHOLE_IMAGE 1
747 #define IM_INDIVIDUAL 2
748 #define IM_LABELLED 4
749 
750 /* Foreground values */
751 #define IM_NONZERO 0x80
752 #define IM_ZERO 0x100
753 #define IM_NON_ZERO IM_NONZERO
754 
755 /* Image type values (and modifiers for certain features) */
756 #define IM_GREYSCALE 0x0200
757 #define IM_GRAYSCALE IM_GREYSCALE
758 
759 /* Data types for results */
760 #define IM_TYPE_CHAR 0x10000
761 #define IM_TYPE_SHORT 0x20000
762 #define IM_TYPE_LONG 0x40000
763 #define IM_TYPE_FLOAT 0x80000
764 #define IM_TYPE_DOUBLE 0x100000
765 
766 /* Miscellaneous */
767 #define IM_ALWAYS 0
768 #define IM_ALL_BLOBS 0x105
769 #define IM_INCLUDED_BLOBS 0x106
770 #define IM_EXCLUDED_BLOBS 0x107
771 #define IM_INCLUDE 1
772 #define IM_EXCLUDE 2
773 #define IM_DELETE 3
774 #define IM_COMPRESS 8
775 #define IM_MIN_FERETS 2
776 #define IM_MAX_FERETS 64
777 #define IM_INCLUDE_ONLY 0x101
778 #define IM_EXCLUDE_ONLY 0x102
779 /*********************************/
780 /* End of Blob Analysis #defines */
781 /*********************************/
782 
783 /* Error handling */
784 #define IM_ERR_RESET 0x1
785 #define IM_ERR_CODE 0x2
786 #define IM_ERR_MSG 0x4
787 #define IM_ERR_FUNC 0x8
788 #define IM_ERR_MSG_FUNC 0xc
789 #define IM_ERR_MSG_SIZE 80 /* Multiple of 8 for endian portability */
790 #define IM_ERR_FUNC_SIZE 32 /* Multiple of 8 for endian portability */
791 #define IM_ERR_SIZE (2 * IM_ERR_MSG_SIZE) /* to hold both message and function plus some extra */
792 
793 /* Error codes */
794 #define IM_SUCCESS 0
795 #define IM_ERR_BUFFER -1
796 #define IM_ERR_DEVICE -2
797 #define IM_ERR_FILE -3
798 #define IM_ERR_MEMORY -4
799 #define IM_ERR_NOT_PRESENT -5
800 #define IM_ERR_OPCODE -6
801 #define IM_ERR_OSB -7
802 #define IM_ERR_PARAMETER -8
803 #define IM_ERR_RESTRICTION -9
804 #define IM_ERR_THREAD -10
805 #define IM_ERR_TIMEOUT -11
806 #define IM_ERR_SYSTEM -12
807 #define IM_ERR_HALTED -13
808 #define IM_ERR_BUF_ATTRIBUTE -14
809 #define IM_ERR_MISC -15
810 #define IM_ERR_INTERNODE -16
811 #define IM_ERR_BUF_PARAM IM_ERR_BUF_ATTRIBUTE
812 
813 /*******************************************************************
814  * Pre-defined pseudo-buffers.
815  * These can be passed in place of a buffer only where documented.
816  *******************************************************************/
817 
818 /* Flag bit to identify pre-defined buffers */
819 #define IM_BUF_PREDEFINED 0x80000000
820 
821 /* Miscellaneous */
822 /* IM_LINK_MEMORY is to say to the router to put the stream in memory */
823 #define IM_VM_CHANNEL (IM_BUF_PREDEFINED | 0x00)
824 #define IM_PCI_TRANSFER_WINDOW (IM_BUF_PREDEFINED | 0x01)
825 #define IM_DISP_TEXT (IM_BUF_PREDEFINED | 0x02)
826 #define IM_LINK_0 (IM_BUF_PREDEFINED | 0x03)
827 #define IM_LINK_1 (IM_BUF_PREDEFINED | 0x04)
828 #define IM_LINK_2 (IM_BUF_PREDEFINED | 0x05)
829 #define IM_LINK_3 (IM_BUF_PREDEFINED | 0x06)
830 #define IM_LINK_MEMORY (IM_BUF_PREDEFINED | 0x07)
831 
832 /* the internal predefined buffers go here */
833 /* do not use any define from 0x10 to 0x1F */
834 /* they are reserved to pass the priority of the default thread */
835 /* The priority will be in the range of the user thread (1 to 15) */
836 #define _IM_DEFAULT_THREAD (IM_BUF_PREDEFINED | 0x10)
837 /* imBufChild() */
838 #define IM_DISP_MONO (IM_BUF_PREDEFINED | 0x20)
839 #define IM_DISP_COLOR (IM_BUF_PREDEFINED | 0x30)
840 #define IM_DISP_RED (IM_BUF_PREDEFINED | 0x40)
841 #define IM_DISP_GREEN (IM_BUF_PREDEFINED | 0x50)
842 #define IM_DISP_BLUE (IM_BUF_PREDEFINED | 0x60)
843 #define IM_DISP_OVERLAY (IM_BUF_PREDEFINED | 0x70)
844 
845 /* imIntConvolve() */
846 #define IM_SMOOTH (IM_BUF_PREDEFINED | 0x80)
847 #define IM_LAPLACIAN_EDGE (IM_BUF_PREDEFINED | 0x81)
848 #define IM_LAPLACIAN_EDGE2 (IM_BUF_PREDEFINED | 0x82)
849 #define IM_SHARPEN (IM_BUF_PREDEFINED | 0x83)
850 #define IM_SHARPEN2 (IM_BUF_PREDEFINED | 0x84)
851 #define IM_HORIZ_EDGE (IM_BUF_PREDEFINED | 0x85)
852 #define IM_VERT_EDGE (IM_BUF_PREDEFINED | 0x86)
853 #define IM_SOBEL_EDGE (IM_BUF_PREDEFINED | 0x87)
854 #define IM_PREWITT_EDGE (IM_BUF_PREDEFINED | 0x88)
855 #define IM_ROBERTS_EDGE (IM_BUF_PREDEFINED | 0x89)
856 
857 /* imIntRank() or morphology */
858 #define IM_3X3_RECT_0 (IM_BUF_PREDEFINED | 0x8a)
859 #define IM_3X3_CROSS_0 (IM_BUF_PREDEFINED | 0x8b)
860 
861 /* Morphology */
862 #define IM_3X3_RECT_1 (IM_BUF_PREDEFINED | 0x8c)
863 #define IM_3X3_CROSS_1 (IM_BUF_PREDEFINED | 0x8d)
864 
865 /* imIntRank() */
866 #define IM_3X1 (IM_BUF_PREDEFINED | 0x8e)
867 #define IM_5X1 (IM_BUF_PREDEFINED | 0x8f)
868 #define IM_7X1 (IM_BUF_PREDEFINED | 0x90)
869 #define IM_9X1 (IM_BUF_PREDEFINED | 0x91)
870 #define IM_1X3 (IM_BUF_PREDEFINED | 0x92)
871 #define IM_1X5 (IM_BUF_PREDEFINED | 0x93)
872 #define IM_1X7 (IM_BUF_PREDEFINED | 0x94)
873 #define IM_1X9 (IM_BUF_PREDEFINED | 0x95)
874 
875 /* Morphology */
876 #define IM_5X5_RECT_1 (IM_BUF_PREDEFINED | 0x96)
877 #define IM_7X7_RECT_1 (IM_BUF_PREDEFINED | 0x97)
878 
879 /* imIntRank() */
880 #define IM_3X3_X (IM_BUF_PREDEFINED | 0x98) /* 0x98 */
881 
882 /* imIntConvolve() */
883 #define IM_SMOOTH_FAST (IM_BUF_PREDEFINED | 0x99)
884 #define IM_SOBEL_X (IM_BUF_PREDEFINED | 0x9a)
885 #define IM_SOBEL_Y (IM_BUF_PREDEFINED | 0x9b)
886 
887 #define __PUT_NEXT_ONE_HERE__ (IM_BUF_PREDEFINED | 0xa0) /* I mean on the next lines update _IM_BUF_LAST_PREDEF accordingly */
888 
889 /* ---------------- */
890 #define _IM_BUF_LAST_PREDEF (IM_BUF_PREDEFINED | 0xd1) /* This one must always stay the last one */
891 
892 #define _IM_BUF_NUM_PREDEF (_IM_BUF_LAST_PREDEF & ~IM_BUF_PREDEFINED)
893 
894 /*******************************************************************
895  * Default thread macro to pass the priority
896  *******************************************************************/
897 #define _IM_DEFAULT_THREAD_PRIO(p) (_IM_DEFAULT_THREAD | p)
898 #define _IM_DEFAULT_THREAD_GET_PRIO(p) (p & 0xF)
899 #define _IM_IS_A_DEFAULT_THREAD(p) ((p & ~0xf) == _IM_DEFAULT_THREAD)
900 
901 /*******************************************************************
902  * Buffer fields (all tag values must be unique).
903  * Tags below 10000 are reserved for user-defined fields.
904  *******************************************************************/
905 
906 /* VIA control options */
907 #define IM_CTL_BYTE_SWAP 10000
908 #define IM_CTL_DIR_X 10001
909 #define IM_CTL_DIR_Y 10002
910 #define IM_CTL_PACK 10003
911 #define IM_CTL_PRIORITY 10004
912 #define IM_CTL_SUBSAMP_X 10005
913 #define IM_CTL_SUBSAMP_Y 10006
914 #define IM_CTL_TAG_BUF 10007
915 #define IM_CTL_VIA 10008
916 #define IM_CTL_FMTCVR 10009
917 #define IM_CTL_WRTMSK 10010
918 #define IM_CTL_ZOOM_X 10011
919 #define IM_CTL_ZOOM_Y 10012
920 #define IM_CTL_BYTE_EXT 10013
921 #define IM_CTL_HEADER_EOF 10014
922 #define IM_CTL_HEADER_SOF 10015
923 #define IM_CTL_COUNT 10016
924 #define IM_CTL_SCAN_MODE 10017
925 #define IM_CTL_STREAM_ID 10018
926 #define IM_CTL_START_X 10019
927 #define IM_CTL_START_Y 10020
928 #define IM_CTL_STOP_X 10021
929 #define IM_CTL_STOP_Y 10022
930 #define IM_CTL_START_FIELD 10023
931 #define IM_CTL_ADDR_MODE 10024
932 #define IM_CTL_COUNT_MODE 10025
933 #define IM_CTL_LINE_INT 10026
934 #define IM_CTL_GRAB_MODE 10027
935 #define IM_CTL_CHANNEL 10028
936 #define IM_CTL_BYPASS 10029
937 #define IM_CTL_CAPTURE_MODE 10030
938 #define IM_CTL_LINE_INT_FIELD 10031
939 #define IM_CTL_LINE_INT_STEP 10032
940 #define IM_CTL_SETUP 10033
941 #define IM_CTL_DISPLAY_SYNC 10034
942 #define IM_CTL_SETUP_ADDRESS 10035
943 #define IM_CTL_REPLICATE 10037
944 #define IM_CTL_CHANNEL_DELAY 10038
945 #define IM_CTL_LINK 10039
946 
947 /* Processing results */
948 #define IM_RES_MIN_PIXEL 11000L
949 #define IM_RES_MAX_PIXEL 11001L
950 #define IM_RES_NUM_EVENTS 11002L
951 #define IM_RES_NUM_DIFFERENCES 11003L
952 #define IM_RES_NUM_PIXELS 11004L
953 #define IM_RES_IDEMPOTENCE 11005L
954 #define IM_RES_SUM_PIXEL 11006L
955 #define IM_RES_SUM_PIXEL_SQUARED 11007L
956 #define IM_RES_MEAN_PIXEL 11008L
957 #define IM_RES_SIGMA_PIXEL 11009L
958 #define IM_RES_MIN_ABS_PIXEL 11010L
959 #define IM_RES_MAX_ABS_PIXEL 11011L
960 #define IM_RES_SUM_ABS_PIXEL 11012L
961 
962 /* Run length encoding */
963 #define IM_RLE_SIZE 12000
964 #define IM_RLE_START 12001
965 #define IM_RLE_MODE 12002
966 #define IM_RLE_COLOR 12003
967 #define IM_RLE_BACK_COLOR 12004
968 
969 /* Display control and inquiry */
970 #define IM_DISP_BUF 13000
971 #define IM_DISP_KEY_MODE 13001
972 #define IM_DISP_KEY_LOW 13002
973 #define IM_DISP_KEY_HIGH 13003
974 #define IM_DISP_LUT_BUF 13004
975 #define IM_DISP_MODE 13005
976 #define IM_DISP_PAN_X 13006
977 #define IM_DISP_PAN_Y 13007
978 #define IM_DISP_WRTMSK 13008
979 #define IM_DISP_ZOOM 13010
980 #define IM_DISP_RESOLUTION_X 13011
981 #define IM_DISP_RESOLUTION_Y 13012
982 #define IM_DISP_VGA_MODE 13013
983 #define IM_DISP_ZOOM_Y 13014
984 #define IM_DISP_OVERLAY_MODE 13015
985 
986 /* Neighbourhood processing options */
987 #define IM_KER_ABSOLUTE 14050
988 #define IM_KER_FACTOR 14052
989 #define IM_CTL_OVERSCAN 14053
990 #define IM_CTL_OVERSCAN_VAL 14054
991 #define IM_KER_CENTER_X 14055
992 #define IM_KER_CENTER_Y 14056
993 
994 /* Additional kernel attributes */
995 #define IM_KER_CLIP 14200
996 #define IM_KER_SHIFT 14201
997 #define IM_KER_OFFSET 14202
998 
999 /* Thread attributes */
1000 #define IM_THR_MAX_PPS 15001
1001 #define IM_THR_PRIORITY 15002
1002 #define IM_THR_OWNER_ID 15003
1003 #define IM_THR_STACK_SIZE 15004
1004 #define IM_THR_VERIFY 15005
1005 #define IM_THR_EXECUTE 15006
1006 #define IM_THR_ACCELERATOR 15007
1007 #define IM_THR_TMP_BUFFER 15008
1008 #define IM_THR_TIME_SLICE 15009
1009 
1010 /* Additional control options */
1011 #define IM_CTL_DIRECTION 16000
1012 #define IM_CTL_BLOCK_X 16001
1013 #define IM_CTL_BLOCK_Y 16002
1014 #define IM_CTL_WORK_BUF 16003
1015 #define IM_CTL_WORK_BUF2 16004
1016 #define IM_CTL_WORK_BUF3 16005
1017 #define IM_CTL_NORMALIZE 16006
1018 #define IM_CTL_THRESHOLD 16007
1019 #define IM_CTL_RESAMPLE 16008
1020 #define IM_CTL_SAMPLE_X 16009
1021 #define IM_CTL_SAMPLE_Y 16010
1022 #define IM_CTL_PRECISION 16011
1023 #define IM_CTL_CENTER_X 16012
1024 #define IM_CTL_CENTER_Y 16013
1025 #define IM_CTL_INPUT_BITS 16014
1026 #define IM_CTL_OUTPUT_BITS 16015
1027 #define IM_CTL_COMPUTATION 16016
1028 #define IM_CTL_OVERSCAN_X 16017
1029 #define IM_CTL_OVERSCAN_Y 16018
1030 #define IM_CTL_SRC_SIZE_X 16019
1031 #define IM_CTL_SRC_SIZE_Y 16020
1032 #define IM_CTL_ZOOM 16021
1033 #define IM_CTL_MASK_BUF 16022
1034 #define IM_CTL_MAX_SCORE 16023
1035 #define IM_CTL_SCORE_TYPE 16024
1036 #define IM_CTL_SHIFT 16025
1037 #define IM_CTL_STEP 16026
1038 #define IM_CTL_STEP_X 16027
1039 #define IM_CTL_STEP_Y 16028
1040 #define IM_CTL_CLIP 16029
1041 #define IM_CTL_COEF_ORDER 16030
1042 #define IM_CTL_SKIP_ZERO 16031
1043 #define IM_CTL_INPUT_FORMAT 16032
1044 #define IM_CTL_OUTPUT_FORMAT 16033
1045 #define IM_CTL_WEIGHT 16034
1046 #define IM_CTL_SRC_BUF3 16035
1047 #define IM_CTL_RASTER_OUT 16036
1048 #define IM_CTL_COEF_TYPE 16037
1049 #define IM_CTL_KER_SIZE 16038
1050 #define IM_CTL_MASK_OP 16039
1051 #define IM_CTL_CACHE_BUF 16040
1052 #define IM_CTL_LUT_BUF 16041
1053 #define IM_CTL_THRESHOLD_FRAC 16042
1054 #define IM_CTL_WEIGHT_2 16043
1055 #define IM_CTL_BIT_ORDER 16044
1056 #define IM_CTL_MODE 16045
1057 #define IM_CTL_WHITE_BALANCE 16046
1058 #define IM_CTL_CENTER_DC 16047
1059 
1060 
1061 /* Graphics context */
1062 #define IM_GRA_COLOR 17000
1063 #define IM_GRA_BACK_COLOR 17001
1064 #define IM_GRA_DRAW_MODE 17002
1065 #define IM_GRA_PLOT_MODE 17003
1066 #define IM_GRA_SCALE_X 17004
1067 #define IM_GRA_SCALE_Y 17005
1068 #define IM_GRA_OFFSET_X 17006
1069 #define IM_GRA_OFFSET_Y 17007
1070 #define IM_GRA_FONT 17008
1071 #define IM_GRA_FONT_SCALE_X 17009
1072 #define IM_GRA_FONT_SCALE_Y 17010
1073 #define IM_GRA_BACK_MODE 17011
1074 #define IM_GRA_COLOR_MODE 17012
1075 #define IM_GRA_BOX_X_MIN 17013
1076 #define IM_GRA_BOX_X_MAX 17014
1077 #define IM_GRA_BOX_Y_MIN 17015
1078 #define IM_GRA_BOX_Y_MAX 17016
1079 #define IM_GRA_START_X 17017
1080 #define IM_GRA_START_Y 17018
1081 #define IM_GRA_NUMBER 17019
1082 #define IM_GRA_THRESHOLD 17020
1083 #define IM_GRA_MAX_SIZE 17021
1084 #define IM_GRA_FLUSH 17022
1085 
1086 /* OSB attributes */
1087 #define IM_OSB_STATE 18000
1088 #define IM_OSB_MODE 18001
1089 #define IM_OSB_INTERRUPT_DRIVEN 18002 /* Internal use only */
1090 #define IM_OSB_TIMEOUT 18003
1091 #define IM_OSB_SCOPE 18004
1092 
1093 /* JPEG control */
1094 #define IM_JPEG_MODE 19000
1095 #define IM_JPEG_NUM_BANDS 19001
1096 #define IM_JPEG_SIZE_X 19002
1097 #define IM_JPEG_SIZE_Y 19003
1098 #define IM_JPEG_SIZE_BIT 19004
1099 #define IM_JPEG_SIZE 19005
1100 #define IM_JPEG_TYPE 19006
1101 #define IM_JPEG_TABLE_QUANT 19007
1102 #define IM_JPEG_TABLE_AC 19008
1103 #define IM_JPEG_TABLE_DC 19009
1104 #define IM_JPEG_SAVE_TABLES 19010
1105 #define IM_JPEG_SAVE_IMAGE 19011
1106 #define IM_JPEG_SAVE_HEADER 19012
1107 #define IM_JPEG_PREDICTOR 19013
1108 #define IM_JPEG_Q_FACTOR 19014
1109 #define IM_JPEG_NUM_BLOCKS 19015
1110 #define IM_JPEG_SUBSAMP_X 19016
1111 #define IM_JPEG_SUBSAMP_Y 19017
1112 #define IM_JPEG_RESTART_ROWS 19018
1113 #define IM_JPEG_COMPUTE_TABLES 19019
1114 #define IM_JPEG_ENTROPY_CODING 19020
1115 #define IM_JPEG_RESET 19021
1116 #define IM_JPEG_MEM_SEG_LENGTH 19022
1117 #define IM_JPEG_START_INTERVAL 19023
1118 #define IM_JPEG_SAVE_RSTINFO 19024
1119 #define IM_JPEG_FORMAT 19025
1120 #define IM_JPEG_CONVERT_COLOR 19026
1121 
1122 #define IM_GMOD_TYPE 20000
1123 
1124 /* imBufCopyROI */
1125 #define IM_ROI_SIZE_X 21001
1126 #define IM_ROI_SIZE_Y 21002
1127 #define IM_ROI_SRC_START_X 21003
1128 #define IM_ROI_SRC_START_Y 21004
1129 #define IM_ROI_DST_START_X 21005
1130 #define IM_ROI_DST_START_Y 21006
1131 #define IM_ROI_NUMBER 21007
1132 
1133 /***************************************
1134 * Grab control and inquire defines *
1135 ****************************************/
1136 
1137 /* Limit of the grab control generic defines */
1138 #define IM_DIG_CHANNEL 30000
1139 #define IM_DIG_SYNC_CHANNEL 30001
1140 #define IM_DIG_GAIN 30002
1141 #define IM_DIG_REF_WHITE 30003
1142 #define IM_DIG_REF_BLACK 30004
1143 #define IM_DIG_LUT_BUF 30005
1144 #define IM_DIG_USER_IN 30006
1145 #define IM_DIG_USER_OUT 30007
1146 #define IM_DIG_EXP_TIME 30008
1147 #define IM_DIG_EXP_DELAY 30009
1148 #define IM_DIG_EXP_SOURCE 30010
1149 #define IM_DIG_EXP_MODE 30011
1150 #define IM_DIG_EXPOSURE 30012
1151 #define IM_DIG_TRIG_SOURCE 30013
1152 #define IM_DIG_TRIG_MODE 30014
1153 #define IM_DIG_TRIGGER 30015
1154 #define IM_DIG_SIZE_X 30016
1155 #define IM_DIG_SIZE_Y 30017
1156 #define IM_DIG_SIZE_BIT 30018
1157 #define IM_DIG_TYPE 30019
1158 #define IM_DIG_NUM_BANDS 30020
1159 #define IM_DIG_SCAN_MODE 30021
1160 #define IM_DIG_MAX_CHANNELS 30022
1161 #define IM_DIG_INPUT_MODE 30023
1162 #define IM_DIG_USER_IN_FORMAT 30024
1163 #define IM_DIG_USER_OUT_FORMAT 30025
1164 #define IM_DIG_GRAB_SOURCE 30026
1165 #define IM_DIG_BRIGHTNESS 30027
1166 #define IM_DIG_CONTRAST 30028
1167 #define IM_DIG_HUE 30029
1168 #define IM_DIG_SATURATION 30030
1169 #define IM_DIG_YC_SEPARATION 30031
1170 #define IM_DIG_SIGNAL_AMPLITUDE 30032
1171 #define IM_DIG_SIGNAL_BLACK 30033
1172 #define IM_DIG_SIGNAL_WHITE 30034
1173 #define IM_DIG_PIXEL_CLOCK 30035
1174 #define IM_DIG_AUTOMATIC_INPUT_GAIN 30036
1175 #define IM_DIG_INPUT_GAIN 30037
1176 
1177 /* Additional control for UART */
1178 #define IM_UART_BAUD_RATE 30038
1179 #define IM_UART_PARITY 30039
1180 #define IM_UART_STOP_BITS 30040
1181 #define IM_UART_DATA_BITS 30041
1182 #define IM_UART_TIMEOUT 30042
1183 #define IM_UART_WRITE_CHAR 30043
1184 #define IM_UART_READ_CHAR 30044
1185 #define IM_UART_READ_LENGTH 30045
1186 #define IM_UART_READ_MAX_LENGTH 30046
1187 #define IM_UART_READ_STRING 30047
1188 #define IM_UART_WRITE_LENGTH 30048
1189 #define IM_UART_WRITE_STRING 30049
1190 #define IM_UART_DATA_PRESENT 30050
1191 #define IM_UART_ERROR 30051
1192 /* IM_UART_ERROR+IM_ERR_RESET is reserved 30052 */
1193 #define IM_UART_WRITE_TERMINATOR 30053
1194 #define IM_UART_READ_TERMINATOR 30054
1195 #define _IM_UART_READ_CONFIG 30055 /* Internal use only */
1196 
1197 /* do NOT modify the following values */
1198 #define IM_UART_WRITE_TERMINATED_STRING 0x00002000
1199 #define IM_UART_WRITE_FIXED_STRING 0x00004000
1200 #define IM_UART_READ_TERMINATED_STRING 0x00006000
1201 #define IM_UART_READ_FIXED_STRING 0x00008000
1202 
1203 // Additional control for Odyssey grab modules extra timer pulse
1204 #define IM_DIG_EXP_TIME2 30056
1205 #define IM_DIG_EXP_DELAY2 30057
1206 
1207 /* Additional control for Odyssey PMC module */
1208 #define IM_DIG_EXP_ARM_SOURCE 30058
1209 #define IM_DIG_EXP_ARM_MODE 30059
1210 #define IM_DIG_HRST_MODE 30060
1211 #define IM_DIG_VRST_MODE 30061
1212 
1213 /* Additional control for Camera Link module */
1214 #define IM_DIG_CC1_SOURCE 30062
1215 #define IM_DIG_CC2_SOURCE 30063
1216 #define IM_DIG_CC3_SOURCE 30064
1217 #define IM_DIG_CC4_SOURCE 30065
1218 
1219 /* Additional control for Analog module */
1220 #define IM_DIG_INPUT_SOURCE 30066
1221 
1222 /* Additionnal control for UART */
1223 #define IM_UART_CHANNEL_LOCK 30067
1224 #define IM_UART_CHANNEL_UNLOCK 30068
1225 
1226 /* inquire to get the Camera data from remote nodes */
1227 #define IM_DIG_CAM_POINTER 30069
1228 
1229 /* inquire to get the Digitizer data from remote nodes */
1230 #define IM_DIG_DATA_POINTER 30070
1231 
1232 // Users events
1233 #define IM_DIG_EVENT_HUNLCK 30071
1234 #define IM_DIG_EVENT_HLCK 30072
1235 #define IM_DIG_EVENT_PLLUNLCK 30073
1236 #define IM_DIG_EVENT_PLLLCK 30074
1237 #define IM_DIG_EVENT_SOONG 30075
1238 #define IM_DIG_EVENT_SOENG 30076
1239 #define IM_DIG_EVENT_EOOG 30077
1240 #define IM_DIG_EVENT_SOOG 30078
1241 #define IM_DIG_EVENT_EOEG 30079
1242 #define IM_DIG_EVENT_SOEG 30080
1243 #define IM_DIG_EVENT_EOFG 30081
1244 #define IM_DIG_EVENT_SOFG 30082
1245 #define IM_DIG_EVENT_EOG 30083
1246 #define IM_DIG_EVENT_SOG 30084
1247 #define IM_DIG_EVENT_EOT0 30085
1248 #define IM_DIG_EVENT_SOT0 30086
1249 #define IM_DIG_EVENT_EOT1 30087
1250 #define IM_DIG_EVENT_SOT1 30088
1251 #define IM_DIG_EVENT_BUFOVR 30089
1252 #define IM_DIG_EVENT_UART 30090
1253 #define IM_DIG_EVENT_SONDF 30091
1254 #define IM_DIG_EVENT_SENDF 30092
1255 #define IM_DIG_EVENT_USRIN 30093
1256 
1257 #define IM_DIG_ENCODER 30094
1258 #define IM_DIG_ENCODER_EOG 30095
1259 #define IM_DIG_ENC_TCOUNT 30096
1260 
1261 // Number of channels present on a digitizer
1262 #define IM_DIG_NUM_CHANNELS 30097
1263 
1264 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1265 // Insert new IM_DIG_... control above here
1266 // Renumber IM_DIG_LAST_CONTROL according to previous addition
1267 // It must be the same value than the last IM_DIG_... defined
1268 #define IM_DIG_LAST_CONTROL 30097
1269 
1270 // WARNING
1271 // do not put any control for imDigControl/imDigInquire in the following 4 ranges:
1272 // 8192-12287 space for IM_UART_WRITE_TERMINATED_STRING
1273 // 16384-20479 space for IM_UART_WRITE_FIXED_STRING
1274 // 24576-28671 space for IM_UART_READ_TERMINATED_STRING
1275 // 32768-36863 space for IM_UART_READ_FIXED_STRING
1276 
1277 
1278 #define IM_UART_FRAMING_ERROR 0x0001
1279 #define IM_UART_PARITY_ERROR 0x0002
1280 #define IM_UART_OVERRUN_ERROR 0x0004
1281 #define IM_UART_TIMEOUT_ERROR 0x0008
1282 
1283 #define IM_SEQ_TIME 50100
1284 #define IM_SEQ_FRAMES 50101
1285 #define IM_SEQ_MAX_TIME 50102
1286 #define IM_SEQ_TIME_BUF 50103
1287 #define IM_SEQ_TIME_BUF2 50104
1288 #define IM_SEQ_PRIORITY 50105
1289 
1290 #define IM_SEQ_WAIT 1
1291 #define IM_SEQ_HALT 2
1292 #define IM_SEQ_ABORT 3
1293 #define IM_SEQ_WAIT_THREAD 4
1294 
1295 /* Digitizer Low Level control */
1296 #define IM_DIGLL_REF_WHITE 4
1297 #define IM_DIGLL_REF_BLACK 5
1298 #define IM_DIGLL_LEVEL_COARSE 6
1299 #define IM_DIGLL_LEVEL_FINE 7
1300 
1301 
1302 /***************************************/
1303 /* Control and inquire values */
1304 /***************************************/
1305 
1306 #define IM_CHANNEL_0 0x00010000
1307 #define IM_CHANNEL_1 0x00020000
1308 #define IM_CHANNEL_2 0x00040000
1309 #define IM_CHANNEL_3 0x00080000
1310 #define IM_CHANNEL_GRAB 0x01000000
1311 #define IM_ALL_CHANNELS (IM_CHANNEL_0|IM_CHANNEL_1|IM_CHANNEL_2|IM_CHANNEL_3)
1312 
1313 #define IM_CHANNEL(index) (IM_CHANNEL_0 << (index))
1314 
1315 #define IM_BIT0 0x01000000
1316 #define IM_BIT1 0x02000000
1317 #define IM_BIT2 0x04000000
1318 #define IM_BIT3 0x08000000
1319 #define IM_BIT4 0x10000000
1320 #define IM_BIT5 0x20000000
1321 #define IM_BIT6 0x40000000
1322 #define IM_ALL_BITS (IM_BIT0|IM_BIT1|IM_BIT2|IM_BIT3|IM_BIT4|IM_BIT5|IM_BIT6)
1323 
1324 #define IM_BIT(index) (IM_BIT0 << (index))
1325 
1326 /* Flags that could be ored with channels */
1327 #define IM_AUTO 0x0L
1328 #define IM_MANUAL 0x1000000L
1329 
1330 #define IM_SOFTWARE 0L
1331 #define IM_HARDWARE 1L
1332 #define IM_VSYNC 2L
1333 #define IM_HSYNC 3L
1334 #define IM_EXPOSURE 4L
1335 #define IM_USER_BIT 5L /* equal IM_VSYNC+IM_FIELD */
1336 #define IM_USER_OUT 6L /* Camera Link only */
1337 #define IM_ENCODER 7L
1338 #define IM_TIMER1 0x01000000
1339 #define IM_TIMER2 0x02000000
1340 #define IM_TIMER3 0x04000000
1341 #define IM_TIMER4 0x08000000
1342 #define IM_ALL_TIMERS (IM_TIMER1|IM_TIMER2|IM_TIMER3|IM_TIMER4)
1343 #define IM_TRIGGER1 0x00100000
1344 #define IM_TRIGGER2 0x00200000
1345 #define IM_TRIGGER3 0x00400000
1346 #define IM_TRIGGER4 0x00800000
1347 #define IM_ALL_TRIGGERS (IM_TRIGGER1|IM_TRIGGER2|IM_TRIGGER3|IM_TRIGGER4)
1348 
1349 #define IM_FALLING_EDGE 0
1350 #define IM_RISING_EDGE 1
1351 
1352 #define IM_ACTIVE_LOW 2
1353 #define IM_ACTIVE_HIGH 3
1354 
1355 #define IM_ANALOG 0
1356 #define IM_DIGITAL 1
1357 
1358 #define IM_TTL 0x00010000
1359 #define IM_RS422 0x00020000
1360 #define IM_LVDS IM_RS422
1361 
1362 #define IM_USE_MEMORY_DCF 0
1363 #define IM_USE_EMBEDDED_DCF 1
1364 
1365 #define IM_PORT1 1
1366 #define IM_PORT2 2
1367 
1368 #define IM_INPUT_A 0x00000001
1369 #define IM_INPUT_B 0x00000002
1370 #define IM_ALL_INPUTS (IM_INPUT_A|IM_INPUT_B)
1371 #define IM_AC_COUPLED 0x00010000
1372 #define IM_DC_COUPLED 0x00020000
1373 #define IM_INPUT_A_AC (IM_INPUT_A|IM_AC_COUPLED)
1374 #define IM_INPUT_A_DC (IM_INPUT_A|IM_DC_COUPLED)
1375 #define IM_INPUT_B_AC (IM_INPUT_B|IM_AC_COUPLED)
1376 #define IM_INPUT_B_DC (IM_INPUT_B|IM_DC_COUPLED)
1377 
1378 #define IM_COM_PORT 0x10000
1379 #define IM_ODYSSEY 0x20000
1380 
1381 #endif /* __IMAPIDEF_H__ */
1382