Linux设备驱动之LCD显示摄像图像之一框架与准备工作

大体框架:
1、摄像头读出数据存入VideoBuf
2、将VideoBuf转换成RGB模式(LCD为RGB模式),存入ConvertBuf
3、进行缩放,存入ZoomBuf
4、进行合并,存入FrameBuf
5、LCD读取FrameBuf,进行显示

面对对象编程:
1、VideoDevice
.iPixelFormat
.iWidth
.iHeight
2、VideoOpr
.InitDevice
.ExitDevice
.GetFrame
.PutFrame
.StartDevice
.StopDevice
我们如今只需要一个
所以我们构造:
V4l2VideoOpr
3、ConvertOpr
.isSurpport
.convert
.ConvertExit
我们需要转换:YUV2RGB, MJPEG2RGB, RGB2RGB
所以我们要构造一个Convert_manager.c
然后写三个Yuv2rgb.c mjpeg2rgb.c rgb2rgb.c 然后向Convert_manager.c进行结构体的注册RegisterVideoConvert
4、DispOpr
.DeviceInit
.ShowPixel
.CleanScreen
.ShowPage
需要写两个函数,fb和VGA。一个在屏幕上显示,一个在LCD上显示
我们可以通过main.c便可以看出整个项目的主要流程:
这是在LCD上进行显示的main函数

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <config.h>
#include <disp_manager.h>
#include <video_manager.h>
#include <convert_manager.h>
#include <render.h>
#include <string.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>


/* video2lcd </dev/video0,1,...> */
int main(int argc, char **argv)
{   
    int iError;
    T_VideoDevice tVideoDevice;
    PT_VideoConvert ptVideoConvert;
    int iPixelFormatOfVideo;
    int iPixelFormatOfDisp;

    PT_VideoBuf ptVideoBufCur;
    T_VideoBuf tVideoBuf;
    T_VideoBuf tConvertBuf;
    T_VideoBuf tZoomBuf;
    T_VideoBuf tFrameBuf;

    int iLcdWidth;
    int iLcdHeigt;
    int iLcdBpp;

    int iTopLeftX;
    int iTopLeftY;

    float k;

    if (argc != 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值