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类能够调用底层的摄像头接口,完成启动摄像头.预 览摄像头图像.拍照等功能: ...
随机推荐
- 一 创建一个springboot项目之(微信点餐系统的设计与开发)
第一步:收到项目需求,进行数据库表的设计. 1.角色的划分: 卖家: 订单,类目 买家: 商品列表 2.功能模块的划分: 商品:商品列表 订单: 订单创建,订单查询,订单取消 类目:基于管理的功 ...
- CH6302 雨天的尾巴
6302 雨天的尾巴 0x60「图论」例题 背景 深绘里一直很讨厌雨天. 灼热的天气穿透了前半个夏天,后来一场大雨和随之而来的洪水,浇灭了一切. 虽然深绘里家乡的小村落对洪水有着顽固的抵抗力,但也倒了 ...
- machine learning (7)---normal equation相对于gradient descent而言求解linear regression问题的另一种方式
Normal equation: 一种用来linear regression问题的求解Θ的方法,另一种可以是gradient descent 仅适用于linear regression问题的求解,对其 ...
- 十五.ProtoBuf3的基础总结
转自: https://blog.csdn.net/u011518120/article/details/54604615 定义一个消息类型 指定字段类型 分配标识号 指定字段规则 添加更多消息类型 ...
- 09 webpack的介绍
webpack干嘛的?: 模块打包机,分析目录结构,找到js模块(包括浏览器不能直接识别的代码 typscript sass...),打包成合适的格式供浏览器访问 webpack是一款模块加载器兼打 ...
- [Svelte 3] Use Svelte 3 transitions to gracefully show and hide DOM elements
Most websites are quite static and adding some animations/transitions can improve the user experienc ...
- Kubernetes 学习14 kubernetes statefulset
一.概述 1.在应用程序中我们有两类,一种是有状态一种是无状态.此前一直演示的是deployment管理的应用,比如nginx或者我们自己定义的myapp它们都属于无状态应用. 2.而对于有状态应用, ...
- am335x system upgrade kernel uart(七)
1 Scope of Document This document describes UART hardware design, uart driver porting 2 Re ...
- Intel 80286 CPU
一.80286概述 INTEL 1982年推出80286芯片,该芯片相比8086和8088有了飞跃式发展,虽然它仍是16位结构,但在CPU内部含有13.4万个晶体管,时钟频率由最初6MHz逐步提高到2 ...
- CODE FESTIVAL 2016 qual C题解
传送门 \(A\) 什么玩意儿-- const int N=105; char s[N];int n,f1,f2; int main(){ scanf("%s",s+1),n=st ...