6.6. 图像处理

工程内支持多种图像处理

  • 支持播放GIF, JPG, PNG

  • 支持任意尺寸缩放,裁剪,图像旋转。(具体查看 yuv_soft_scalling.h

  • 支持多种数据转换 RGB565->yuv420, YUV420->RGB565等等(具体查看 yuv_to_rgb.h

  • 支持软件图像合成代码开放 lcd_data_driver.c

  • 支持JPG->YUV, YUV->JPG。

  • 支持同步帧处理te_driver文件夹

1、播放GIF

已经封装好成api函数使用,路径 apps/common/ui/gif_api.c

2、播放JPG

已经封装好成api测试线程,路径 apps/wifi_camera/ui_camera_demo/sd_play_jpg_mp3.c

3、播放PNG

需要开启UI使用UI工程加载PNG文件,demo_ui工程中UI_DEMO_1_0.c控件测试。

4、有关图像合成应用

在camera出图时需要图像上显示一些时间信息或者大头框等

../../_images/png.png

该相机为儿童拍照打印相机量产在售,支持前后双摄,320x240分辨率,摄像头640x480帧数20帧无条纹切线,拍照将数据打印出来或者上传到手机。

6.6.1. 图像转码例子

相关测试例子查看路径 apps/common/example/video/image

API函数:

Functions

u16 rgb_24_to_565(u8 R, u8 G, u8 B)
void yuv420p_quto_rgb24(unsigned char *yuvBuffer_in, unsigned char *rgbBuffer_out, int width, int height, char be)
void yuv420p_quto_rgb565(unsigned char *yuvBuffer_in, unsigned char *rgbBuffer_out, int width, int height, char be)
void yuv422p_quto_rgb565(unsigned char *yuvBuffer_in, unsigned char *rgbBuffer_out, int width, int height, char be)
void yuv444p_quto_rgb565(unsigned char *yuvBuffer_in, unsigned char *rgbBuffer_out, int width, int height, char be)
int rgb565_to_yuv420p(unsigned char *rgb565, unsigned char *yuv420p, int width, int height, char be)
int rgb24_to_yuv420p(unsigned char *rgb24, unsigned char *yuv420p, int width, int height)
void RGB565_to_RGB888(unsigned char *rgb565, unsigned char *rgb888, int width, int height)
void RGB888_to_YUV420(u8 *rgb_buf, u8 *yuv_buf, u16 width, u16 heigh)

Functions

int YUYV422ToYUV422p(unsigned char *yuyv, unsigned char *yuv422p, int width, int height)
int YUV444pToYUV422p(unsigned char *yuv444p, unsigned char *yuv422p, int width, int height)
int YUV444pToYUV420p(unsigned char *yuv444p, unsigned char *yuv420p, int width, int height)
int YUV422pToYUV420p(unsigned char *yuv422p, unsigned char *yuv420p, int width, int height)
int YUV420p_REVERSAL(char *src, char *out, int src_w, int src_h, int *out_w, int *out_h, int angle)
int YUV420p_ALIGN(unsigned char *src, int src_w, int src_h, int *out_w, int *out_h, int width_align, int height_align)
int YUV420p_Zoom_Out(unsigned char *src, unsigned char *out, int src_w, int src_h, int out_w, int out_h)
int YUV420p_Zoom_In(unsigned char *src, unsigned char *out, int src_w, int src_h, int out_w, int out_h)
int YUV420p_ZOOM(unsigned char *src, unsigned char *out, int src_w, int src_h, int out_w, int out_h)
int YUV420p_Soft_Scaling(unsigned char *src, unsigned char *out, int src_w, int src_h, int out_w, int out_h)
int YUV420p_Cut(unsigned char *yuv420p, int src_w, int src_h, unsigned char *out, int out_size, int w_start, int w_size, int h_start, int h_size)
void RGB_Soft_90(unsigned char mode, char *out_buf, char *in_buf, int width, int height)
struct image_info

Public Members

int w
int h
union image_info::[anonymous] [anonymous]
image_info.__unnamed48__

Public Members

unsigned char *pixels
unsigned char *data
unsigned char *data16