VRGLViewController.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // VRGLViewController.h
  3. // VRDemo
  4. //
  5. // Created by J.J. on 16/8/26.
  6. // Copyright © 2016年 xm. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <GLKit/GLKit.h>
  10. #import "VRSoft.h"
  11. #include <queue>
  12. using namespace std;
  13. typedef struct SYUVData
  14. {
  15. int width;
  16. int height;
  17. unsigned char *pData;
  18. SYUVData(int width, int height, unsigned char *pData)
  19. {
  20. this->width = width;
  21. this->height = height;
  22. int len = width * height * 3 / 2;
  23. if(len > 0){
  24. this->pData = new unsigned char[len];
  25. memcpy(this->pData, pData, len);
  26. } else {
  27. this->pData = NULL;
  28. }
  29. }
  30. ~SYUVData()
  31. {
  32. if(pData){
  33. delete []pData;
  34. pData = NULL;
  35. }
  36. }
  37. } SYUVData;
  38. typedef std::queue<SYUVData *> QUEUE_YUV_DATA;
  39. @interface VRGLViewController : GLKViewController
  40. @property (nonatomic,assign) int VRShowMode;
  41. @property (nonatomic, assign) BOOL changeModel; //是否切换吸顶模式和壁挂模式
  42. //设置软解
  43. -(void)configSoftEAGLContext;
  44. -(void)setVRType:(XMVRType)type;
  45. -(void)setVRShapeType:(XMVRShape)shapetype;
  46. -(void)setVRVRCameraMount:(XMVRMount)Mount;
  47. //鱼眼参数设置(半径宽高)
  48. -(void)setVRFecParams:(int)xCenter yCenter:(int)yCenter radius:(int)radius Width:(int)imgWidth Height:(int)imgHeight;
  49. -(void)PushData:(int)width height:(int)height YUVData:(unsigned char *)pData;
  50. //智能分析报警之后界面旋转
  51. -(void)setAnalyzeWithXL:(int)x0 YL:(int)y0 XR:(int)x1 YR:(int)y1 Width:(int)imgWidth Height:(int)imgHeight;
  52. //滑动开始
  53. -(void)SoftTouchMoveBegan:(NSSet *)SoftTouch Softevent:(UIEvent *)Softevent;
  54. //滑动
  55. -(void)SoftTouchMove:(NSSet *)SoftTouch Softevent:(UIEvent *)Softevent;
  56. //滑动结束
  57. -(void)SoftTouchMoveEnd:(NSSet *)SoftTouch Softevent:(UIEvent *)Softevent;
  58. //捏合手势
  59. -(void)SoftTouchesPinch:(CGFloat)scale;
  60. -(void)reloadInitView:(CGRect)frame;
  61. -(void)DoubleTap:(UITapGestureRecognizer*)recognizer;//双击手势
  62. @end