Move the sources to trunk
[opencv] / otherlibs / PTGrey / PGControl.h
1 #ifndef __PG_CONTROL__
2 #define __PG_CONTROL__
3
4 /* the values of enum is important! */
5
6 typedef enum
7 {
8     PT_TOP_RAW_IMAGE = 0,
9     PT_LEFT_RAW_IMAGE = 1, 
10     PT_RIGHT_RAW_IMAGE = 2, 
11     PT_DISPARITY_IMAGE = 3, 
12
13     PT_RECTIFIED_IMAGE = 4, 
14     PT_EDGE_IMAGE = 5, 
15
16     PT_OBJ_IMAGE = 6, /* Corresponds to the right camera */
17     PT_DISPARITY_OBJ_IMAGE = 7, 
18
19     PT_BACKGROUND_IMAGE = 8,
20     PT_POINTCLOUD_IMAGE = 9, 
21     PT_IMAGE_MAX = 10
22 } PTGreyImageType;
23
24 #define PG_IMAGE_MAX ((int)PT_IMAGE_MAX)
25 #define PG_RAW_IMAGE(x) ((PTGreyImageType)(((int)(x))&0x3))
26 #define PG_DIGICLOPS_IMAGE(x) (1<<(((int)(x))&0x3))
27
28 const static char* ImageNames[PT_IMAGE_MAX] = 
29 { "Top raw image", "Left raw image", "Right raw image", 
30     "Disparity", "Rectified image", "Edge image",
31     "Object image", "Object disparity", "Background", 
32     "Pointcloud"
33 };
34
35 #define PT_IMAGE_NAME(x) ImageNames[x]
36
37
38
39 // Structure needed to communicate to the companion task consuming the images.
40 typedef struct {
41         HANDLE MyHandle;                                                // handle to our partner task.
42         int   PGTerminate;
43         int   VBTaskPresent;    // flag used to indicate that the VB code is in the driver's seat.
44
45         int   ImageList[PG_IMAGE_MAX];          // Selected images
46
47         int   nrows;                                                    // Raw imput resolution
48         int   ncols;
49         int   DRows;                                            // Use the tmp values to speed up disparity computations.
50         int   DCols;                                            // DRows and DCols are the Rows and Cols to display
51         int   NewParameters;
52
53         int   MinDisparity;
54         int   MaxDisparity;
55
56         int   TextureValidation;                                // True or false
57         float TextureValidationThreshold;
58         int   TextureValidationMapping;
59
60         int   UniquenessValidation;                             // True or false
61         float UniquenessValidationThreshold;
62         int   UniquenessValidationMapping;
63
64         int   StereoMask;
65         int   SubPixelInterpolation;
66         int   StrictSubPixelValidation;
67
68         int   Rectify;
69         int   LowPass;
70         int   DoStereo;
71
72         int   EdgeMask;
73         int   EdgeCorrelation;
74         int   PGDebug;                                  // Turn on debugs in the Point Grey code
75
76         int       Total_Memory;                         // How much memory we have allocated to share.  Make sure we don't exceed this.
77         float ZCapValue;                                // Useful to trim uninteresting Z-Key data in the bud  
78         int   DifferenceThreshold;              // Controls what values appear in the background subtraction
79         int   ComputedView;                             // a disparity, rectified, edge or pointcloud has been requested
80         int   ShowCameraControl;                // Show the iris and brightness control (inside filter)
81         int   ZBucketMin;                               // a ZBucket must have more than this to qualify as meaningful.
82         int       MaxCols;                                      // maximum columns (so max buffer is obtained.)
83         int       MaxRows;                                      // maximum rows (so max buffer is obtained.)
84     int   DisparityThreshold;       // if disparity < DisparityThreshold then disparity = MinDisparity
85         int   RectifiedDisparity;       // disparity images rectification flag 
86
87 } PGClient;
88
89 typedef struct {
90         int   Initializing;
91     int   NewData[PG_IMAGE_MAX];
92
93         char *DigiclopsBase;            // set this so other address spaces can translate databuffers above.
94         char *DataBuffers[PG_IMAGE_MAX]; // Addresses of buffers for each image type
95         char *OutputBuffers[PG_IMAGE_MAX]; // Addresses of buffers for each image type
96
97         int   BackGroundAvailable;      // A background image is available.
98         int   FrameCount;                               // Server counts how many frames are coming over.
99     long  ticks;               // Pointer to the clock value corresponding to the frame
100
101         int   Top;                                              // BoundingBox for hand
102         int   Left;                                             // BoundingBox for hand
103         int   Width;                                            // BoundingBox for hand
104         int   Height;                                           // BoundingBox for hand
105 } PGServer;
106
107 typedef struct {
108         float x;
109         float y;
110         float z;
111 } xyzTuple;                                                                                             
112
113 typedef struct {
114         double CameraDistance;
115         double CameraAzimuth;
116         double CameraInclination;
117         double CameraX;
118         double CameraY;
119
120         int Terminate;          // use this to terminate the OpenGL task.
121         int VBTaskPresent;      // flag used to indicate that the VB code is in the driver's seat.
122         int CloudCount;         // Count of xyz tuples in pointcloud after background subtraction.
123         int MinCloudCount;      // Required minimum cloud count (or assume it is not an interesting point cloud.) 
124         int ComputeHandRegion; // flag to indicate that the OpenGL task should compute the hand region.
125
126         float NextLine[6];                      // Expose the coordinates of the fitted line.
127
128         float CenterX;          // This is the center of the hand in 3D
129         float CenterY;
130         float CenterZ;
131 } OpenGLData;
132
133 #endif /* __PG_CONTROL__ */