usb.h
来自「在linux系统下」· C头文件 代码 · 共 64 行
H
64 行
#ifndef _HIGHLIGHT_USB_H_
#define _HIGHLIGHT_USB_H_
#include "common.h"
class QImage;
namespace Highlight
{
class USB
{
public:
USB(char* name = "/dev/video0");
public:
//static const int DEFAULT_WIDTH = 320;
//static const int DEFAULT_HEIGHT= 240;
enum pix
{
DEFAULT_WIDTH = 320,
DEFAULT_HEIGHT = 240
};
private:
v4ldevice vd;
char* devName;
int len;
short currentGrap, currentDisplay;
bool isFirstGrap;
int curWidth, curHeight;
unsigned char * returnBuf;
short n;
bool isOpen;
bool isShow;
public:
bool isopen();
bool isshow();
bool openDevice();
bool getPicture();
void setPicture(video_picture &newPic);
void setContrast(int contrast);
int getContrast();
void setBrightness(int brightness);
int getBrightness();
void setHue(int hue);
int getHue();
bool getCapability();
void setCapability(video_capture &newPic);
bool initDevice();
//bool getMemory(int width = DEFAULT_WIDTH,int height = DEFAULT_HEIGHT);
bool readData();
void closeDevice();
void playMode(bool isHigh);
unsigned char* getBuffer();
void setMmap();
inline const int getCurrentWidth(){ return curWidth; }
inline const int getCurrentHeight() { return curHeight; }
private:
void setCapture();
void changeResolution();
void setMbuf();
};
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?