QCamera检测摄像头
The QCamera class provides interface for system camera devices. More...
Header: #include <QCamera>
qmake: QT += multimedia
Inherits: QMediaObject
/****************************************************************************
**
** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/ #ifndef QT3DRENDER_CAMERA_H
#define QT3DRENDER_CAMERA_H #include <Qt3DCore/qentity.h>
#include <Qt3DRender/qt3drender_global.h>
#include <Qt3DRender/qcameralens.h>
#include <QtGui/QMatrix4x4>
#include <QtGui/QQuaternion>
#include <QtGui/QVector3D> QT_BEGIN_NAMESPACE namespace Qt3DCore {
class QEntity;
class QTransform;
} namespace Qt3DRender { class QCameraPrivate; class QT3DRENDERSHARED_EXPORT QCamera : public Qt3DCore::QEntity
{
Q_OBJECT
// CameraLens
Q_PROPERTY(Qt3DRender::QCameraLens::ProjectionType projectionType READ projectionType WRITE setProjectionType NOTIFY projectionTypeChanged)
Q_PROPERTY(float nearPlane READ nearPlane WRITE setNearPlane NOTIFY nearPlaneChanged)
Q_PROPERTY(float farPlane READ farPlane WRITE setFarPlane NOTIFY farPlaneChanged)
Q_PROPERTY(float fieldOfView READ fieldOfView WRITE setFieldOfView NOTIFY fieldOfViewChanged)
Q_PROPERTY(float aspectRatio READ aspectRatio WRITE setAspectRatio NOTIFY aspectRatioChanged)
Q_PROPERTY(float left READ left WRITE setLeft NOTIFY leftChanged)
Q_PROPERTY(float right READ right WRITE setRight NOTIFY rightChanged)
Q_PROPERTY(float bottom READ bottom WRITE setBottom NOTIFY bottomChanged)
Q_PROPERTY(float top READ top WRITE setTop NOTIFY topChanged)
Q_PROPERTY(QMatrix4x4 projectionMatrix READ projectionMatrix WRITE setProjectionMatrix NOTIFY projectionMatrixChanged)
Q_PROPERTY(float exposure READ exposure WRITE setExposure NOTIFY exposureChanged REVISION )
// LookAt
Q_PROPERTY(QVector3D position READ position WRITE setPosition NOTIFY positionChanged)
Q_PROPERTY(QVector3D upVector READ upVector WRITE setUpVector NOTIFY upVectorChanged)
Q_PROPERTY(QVector3D viewCenter READ viewCenter WRITE setViewCenter NOTIFY viewCenterChanged)
Q_PROPERTY(QVector3D viewVector READ viewVector NOTIFY viewVectorChanged)
Q_PROPERTY(QMatrix4x4 viewMatrix READ viewMatrix NOTIFY viewMatrixChanged) public:
explicit QCamera(QNode *parent = nullptr);
~QCamera(); enum CameraTranslationOption {
TranslateViewCenter,
DontTranslateViewCenter
};
Q_ENUM(CameraTranslationOption) // LCOV_EXCL_LINE QCameraLens *lens() const;
Qt3DCore::QTransform *transform() const; Q_INVOKABLE QQuaternion tiltRotation(float angle) const;
Q_INVOKABLE QQuaternion panRotation(float angle) const;
Q_INVOKABLE QQuaternion rollRotation(float angle) const;
Q_INVOKABLE QQuaternion rotation(float angle, const QVector3D &axis) const; // Translate relative to camera orientation axes
Q_INVOKABLE void translate(const QVector3D& vLocal, CameraTranslationOption option = TranslateViewCenter); // Translate relative to world axes
Q_INVOKABLE void translateWorld(const QVector3D& vWorld, CameraTranslationOption option = TranslateViewCenter); Q_INVOKABLE void tilt(float angle);
Q_INVOKABLE void pan(float angle);
Q_INVOKABLE void pan(float angle, const QVector3D &axis);
Q_INVOKABLE void roll(float angle); Q_INVOKABLE void tiltAboutViewCenter(float angle);
Q_INVOKABLE void panAboutViewCenter(float angle);
Q_INVOKABLE void panAboutViewCenter(float angle, const QVector3D &axis);
Q_INVOKABLE void rollAboutViewCenter(float angle); Q_INVOKABLE void rotate(const QQuaternion& q);
Q_INVOKABLE void rotateAboutViewCenter(const QQuaternion& q); QCameraLens::ProjectionType projectionType() const;
float nearPlane() const;
float farPlane() const;
float fieldOfView() const;
float aspectRatio() const;
float left() const;
float right() const;
float bottom() const;
float top() const;
QMatrix4x4 projectionMatrix() const;
float exposure() const;
QVector3D position() const;
QVector3D upVector() const;
QVector3D viewCenter() const;
QVector3D viewVector() const;
QMatrix4x4 viewMatrix() const; public Q_SLOTS:
void setProjectionType(QCameraLens::ProjectionType type);
void setNearPlane(float nearPlane);
void setFarPlane(float farPlane);
void setFieldOfView(float fieldOfView);
void setAspectRatio(float aspectRatio);
void setLeft(float left);
void setRight(float right);
void setBottom(float bottom);
void setTop(float top);
void setProjectionMatrix(const QMatrix4x4 &projectionMatrix);
void setExposure(float exposure);
void setPosition(const QVector3D &position);
void setUpVector(const QVector3D &upVector);
void setViewCenter(const QVector3D &viewCenter); void viewAll();
void viewSphere(const QVector3D ¢er, float radius);
void viewEntity(Qt3DCore::QEntity *entity); Q_SIGNALS:
void projectionTypeChanged(QCameraLens::ProjectionType projectionType);
void nearPlaneChanged(float nearPlane);
void farPlaneChanged(float farPlane);
void fieldOfViewChanged(float fieldOfView);
void aspectRatioChanged(float aspectRatio);
void leftChanged(float left);
void rightChanged(float right);
void bottomChanged(float bottom);
void topChanged(float top);
void projectionMatrixChanged(const QMatrix4x4 &projectionMatrix);
void exposureChanged(float exposure);
void positionChanged(const QVector3D &position);
void upVectorChanged(const QVector3D &upVector);
void viewCenterChanged(const QVector3D &viewCenter);
void viewVectorChanged(const QVector3D &viewVector);
void viewMatrixChanged(); protected:
Q_DECLARE_PRIVATE(QCamera)
explicit QCamera(QCameraPrivate &dd, QNode *parent = nullptr);
}; } // namespace Qt3DRender QT_END_NAMESPACE #endif // QT3DRENDER_CAMERA_H

QCamera检测摄像头的更多相关文章
- Flex(flash)检测摄像头的3种状态(是否被占用,没安装摄像头,正常)
在视频程序的编写过程中,我们经常要使用摄像头,在使用摄像头前有必要对摄像头的现有状态做个检测: 1.被占用 2.没安装摄像头 3.正常 camera=Camera.getCamera(); ...
- iOS中检测硬件和传感器
首先要知道,你需要查看所需的硬件或传感器是否存在,而不是假设设备有哪些功能.举个例子,你不能假设只有iPhone才有麦克风,而应该使用API来查看麦克风是否存在.下面这段代码的第一个优势在于,它能自动 ...
- SmileyFace——基于OpenCV的人脸人眼检测、面部识别程序
项目地址 https://github.com/guoyaohua/SmileyFace 开发环境 Visual Studio 2010 MFC + OpenCV 功能描述 静态图像人脸检测 视频人脸 ...
- python之OpenCv(五)---抓取摄像头视频图像
OpenCV 可以通过 头videoCapture()方法打开摄像 摄像头变量 = cv2.VideoCapture(n) n为整数,内置摄像头为0,若有其他摄像头则依次为1,2,3,4,... ...
- 树莓派3 之 USB摄像头安装和使用
需求 如果你想在树莓上拍照或者录影,你可以安装树莓派的摄像头(有点贵).如果你不想要为摄像头模块花费额外的金钱,那有另外一个方法,就是你常见的USB 摄像头.你可能已经在PC上安装过了.我买的如图的这 ...
- 虚拟机上使用 opecnv 读取USB摄像头无法显示
使用opecv读取USB摄像头时候,无法显示图像. 设置 首先查看虚拟机Ubuntu检测摄像头是否已正常插入: ls /dev/video* 结果为: 设置虚拟机USB属性: USB的兼容性设置为US ...
- 第46章 DCMI—OV5640摄像头—零死角玩转STM32-F429系列
第46章 DCMI—OV5640摄像头 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com ...
- 第45章 DCMI—OV2640摄像头—零死角玩转STM32-F429系列
第45章 DCMI—OV2640摄像头 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com ...
- android摄像头获取图像——第二弹
使用android内的Camera对象 (1)Camera是控制着摄像头的api,拥有一系列控制摄像头的上层方法:camera类能够调用底层的摄像头接口,完成启动摄像头.预 览摄像头图像.拍照等功能: ...
随机推荐
- postscript打印机语言
http://tongxinmao.com/Article/Detail/id/257
- 关于使用scipy.stats.lognorm来模拟对数正态分布的误区
lognorm方法的参数容易把人搞蒙.例如lognorm.rvs(s, loc=0, scale=1, size=1)中的参数s,loc,scale, 要记住:loc和scale并不是我们通常理解的对 ...
- MongoDB与Python的交互
驱动模块 pymongo是python里常用的操作MongoDB的驱动模块 可用pip下载安装 pip install pymongo 创建连接 MongoClient是MongoDB的客户端代理对象 ...
- Python语言程序设计(3)--数字类型及操作--实例3-天天向上的力量
1.整数 2.浮点数 3.复数 4.数值运算操作符 5.数值运算函数 5.天天向上的力量:实例
- “挂起”bug处理执行方案
目的:避免bug状态改为挂起后,就无人问津,导致一直未得到解决.因而影响用户的使用与产品质量较差.
- GITHUB添加SSH内容
首先,你需要注册一个 github账号,最好取一个有意义的名字,比如姓名全拼,昵称全拼,如果被占用,可以加上有意义的数字. 本文中假设用户名为 chuaaqiCSDN(我的博客名的全拼) 一.gihu ...
- LightOJ - 1246 - Colorful Board(DP)
链接: https://vjudge.net/problem/LightOJ-1246 题意: You are given a rectangular board. You are asked to ...
- 洛谷 P1955 [NOI2015]程序自动分析 题解
每日一题 day22 打卡 Analysis 离散化+并查集 先离散化所有的约束条件,再处理所有e=1的条件,将i的祖先和j的祖先合并到一个集合中:e=0时,如果i的祖先与j的祖先在同一个集合中,说明 ...
- YAML_11 when条件判断
当系统负载超过0.7时,则关掉httpd ansible]# vim when.yml --- - hosts: cache remote_user: root tasks: - sh ...
- BCB key事件中判断Shift、Alt、Ctrl状态
BCB key事件中判断Shift.Alt.Ctrl状态: 类似此事件中 void __fastcall TForm1::keydown(TObject *Sender, WORD &Key, ...