MGLiveBundle.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // MGFaceBundle.h
  3. // MGFaceDetection
  4. //
  5. // Created by megvii on 15/12/23.
  6. // Copyright © 2015Year megvii. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. /** 要读取的文件类型 */
  10. typedef NS_ENUM(NSInteger, MGBundleDirectory) {
  11. /** 图片 */
  12. MGBundleImage = 1,
  13. /** 语音 */
  14. MGBundleAudio,
  15. /** 其他类型 */
  16. MGBundleMain,
  17. };
  18. @interface MGLiveBundle : NSObject
  19. /**
  20. * 读取 facebundle 的资源
  21. *
  22. * @param name 资源名字
  23. * @param type 资源类型
  24. *
  25. * @return 资源路径
  26. */
  27. + (NSString *)LivePathForResource:(NSString *)name ofType:(NSString *)type;
  28. + (NSString *)LivePathForResource:(NSString *)name ofType:(NSString *)type inDirectory:(MGBundleDirectory)Directory;
  29. /**
  30. * 返回语言
  31. * @param key 字符串的 key
  32. * @return 字符串
  33. */
  34. + (NSString *)LiveBundleString:(NSString *)key;
  35. /**
  36. * 读取 facebundle的图片 -- 必须为 png格式
  37. *
  38. * @param name 图片名字
  39. *
  40. * @return 图片
  41. */
  42. + (UIImage *)LiveImageWithName:(NSString *)name;
  43. @end