bef_effect_ai_yuv_process.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. #ifndef BEF_EFFECT_YUV_PROCESS_H
  3. #define BEF_EFFECT_YUV_PROCESS_H
  4. #include "bef_effect_ai_public_define.h"
  5. /**
  6. * @param image yuv数据源
  7. * @param dst 结果输出地址
  8. * @param pixel_format yuv数据格式
  9. * 目前支持BEF_AI_PIX_FMT_YUV420P BEF_AI_PIX_FMT_NV12 和BEF_AI_PIX_FMT_NV21
  10. * @param image_width输入图像宽度
  11. * @param image_height 输入图像高度
  12. * @param dst_width 输出图像宽度
  13. * @param dst_height 输出图像高度
  14. * @param orientation 输入图像的旋转角度
  15. * @param is_front 是否需要左右翻转
  16. */
  17. BEF_SDK_API void cvt_yuv2rgba(
  18. const unsigned char* image,
  19. unsigned char* dst,
  20. bef_ai_pixel_format pixel_format,
  21. int image_width,
  22. int image_height,
  23. int dst_width,
  24. int dst_height,
  25. bef_ai_rotate_type orientation,
  26. bool is_front);
  27. /**
  28. * @param image rgba数据源
  29. * @param dst 结果输出地址
  30. * @param pixel_format 输出yuv数据的格式
  31. * 目前支持BEF_AI_PIX_FMT_YUV420P BEF_AI_PIX_FMT_NV12 和BEF_AI_PIX_FMT_NV21
  32. * @param image_width输入图像宽度
  33. * @param image_height 输入图像高度
  34. */
  35. BEF_SDK_API void cvt_rgba2yuv(
  36. const unsigned char *image,
  37. unsigned char *dst,
  38. bef_ai_pixel_format dst_pixel_format,
  39. int image_width,
  40. int image_height);
  41. unsigned char *cvt_resize(
  42. const unsigned char *image,
  43. int image_width,
  44. int image_height,
  45. int resize_width,
  46. int resize_height
  47. );
  48. BEF_SDK_API void cvt_yuv_resize(
  49. const unsigned char *image,
  50. unsigned char *dst,
  51. bef_ai_pixel_format pixel_format,
  52. int image_width,
  53. int image_height,
  54. int resize_width,
  55. int resize_height
  56. );
  57. BEF_SDK_API void cvt_rgba2bgr(
  58. const unsigned char *image,
  59. unsigned char *dst,
  60. bef_ai_pixel_format dst_pixel_format,
  61. int image_width,
  62. int image_height);
  63. BEF_SDK_API void cvt_bgr2rgba(
  64. const unsigned char *image,
  65. unsigned char *dst,
  66. bef_ai_pixel_format dst_pixel_format,
  67. int image_width,
  68. int image_height);
  69. #endif //BEF_EFFECT_YUV_PROCESS_H