OpenGL for Mars API
OpenGL_TOF: Achieve point cloud-related functions: display, mouse drag rotation
Functions
1. InitShaders
Routine
SODLL void InitShaders(int Width, int Height);
Description
Initialize OPENGL
Parameters:
- Width [in] Image width
- Height [in] Image height
2. display
Routine
SODLL void display(GLData_t *S_buf, GLRgbData_t* rgb_buffer);
Description
Display the point cloud data
Parameters:
- S_buf [input] Pointer to the depth data
- rgb_buffer [input] The RGB value of the depth data
3. PointCloud_Zoom
Routine
SODLL void PointCloud_Zoom(int value);
Description
Zoom the point cloud images
Parameters:
- value [input] Zoom value, positive – zoom out, negative – zoom in.
4. Follow_rotation
Routine
SODLL void Follow_rotation(bool state, int x, int y);
Description
Rotate the point cloud images
Parameters:
- state [input] TRUE: do rotation, FALSE: stop rotation
- x [input] Image width
- y [input] Image height
5. Set_Rotate_Core
Routine
SODLL void Set_Rotate_Core(bool state, int x,int y,int z);
Description
Setting the rotation point cloud data center
Parameters
- state [in] Whether to use the settings, TRUE: use, FALSE: reset(Center is 0)
- x [in] X coordinate of the center of rotation
- y [in] Y coordinate of the center of rotation
- Z [in] Z coordinate of the center of rotation
Structures
1. tag_GLDATA
typedef struct tag_GLDATA {
float x;
float y;
float z;
}GLData_t;
Description
Depth data
Members:
- x x coordinate
- y Y coordinate
- z Z coordinate
2 tag_FRAMEDATA_RGB
typedef struct tag_FRAMEDATA_RGB {
char r;
char g;
char b;
}FrameDataRgb_t;
Description
Depth data structure
Members:
- r R value
- g G value
- b B value