MGBaseDefine.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // MGBaseDefine.h
  3. // MGBaseAPI
  4. //
  5. // Created by megvii on 15/12/21.
  6. // Copyright © 2015Year megvii. All rights reserved.
  7. //
  8. #ifndef MGBaseDefine_h
  9. #define MGBaseDefine_h
  10. #import <UIKit/UIKit.h>
  11. #import <AVFoundation/AVFoundation.h>
  12. /* 屏幕宽度 (区别于viewcontroller.view.fream)*/
  13. #define MG_WIN_WIDTH [UIScreen mainScreen].bounds.size.width
  14. /* 屏幕高度 (区别于viewcontroller.view.fream)*/
  15. #define MG_WIN_HEIGHT [UIScreen mainScreen].bounds.size.height
  16. /* 手机系统版本 */
  17. #define MG_IOS_SysVersion [[UIDevice currentDevice] systemVersion].floatValue
  18. /* rgb颜色转换(16进制->10进制)*/
  19. #define MGColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
  20. /* rgba颜色 */
  21. #define MGColorWithRGB(R, G, B, A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]
  22. #ifdef DEBUG
  23. #define MGLog(...) NSLog(__VA_ARGS__)
  24. #else
  25. #define MGLog(...)
  26. #endif
  27. typedef void(^VoidBlock)();
  28. typedef void(^videoOutputBlock)(AVCaptureOutput *captureOutput,
  29. CMSampleBufferRef sampleBuffer,
  30. AVCaptureConnection *connection);
  31. #endif /* MGBaseDefine_h */