📄 usb.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -