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类能够调用底层的摄像头接口,完成启动摄像头.预 览摄像头图像.拍照等功能: ...
随机推荐
- UVA1194 Machine Schedule[二分图最小点覆盖]
题意翻译 有两台机器 A,B 分别有 n,m 种模式. 现在有 k 个任务.对于每个任务 i ,给定两个整数$ a_i\(和\) b_i$,表示如果该任务在 A上执行,需要设置模式为 \(a_i\): ...
- matlab的diff()函数
diff():求差分 一阶差分 X = [1 1 2 3 5 8 13 21]; Y = diff(X) 结果: Y = 0 1 1 2 3 5 8 X = [1 1 1; 5 5 5; 25 25 ...
- Linux 使用shell脚本实现自动SSH互信功能
说假设有一个1000台节点的Hadoop集群,要配置节点之间的SSH免密码登录,该如何用shell脚本实现?#!/bin/expect #循环1000台机器的IP地址,生成密钥文件authorized ...
- .net之大文件断点续传
HTML部分 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.a ...
- GSS3 C - Can you answer these queries III
//在gss1的基础上加了修改操作,一样的做法,加一个modify函数就可以了 #include<iostream> #include<cstdio> #include< ...
- 《挑战30天C++入门极限》新手入门:C/C++中的结构体
新手入门:C/C++中的结构体 什么是结构体? 简单的来说,结构体就是一个可以包含不同数据类型的一个结构,它是一种可以自己定义的数据类型,它的特点和数组主要有两点不同,首先结构体可以在一个结构 ...
- RGB(204,204,204) 转 #cccccc
RGB 是十进制 ,转换成相应的十六进制即可. 例如 255 的十六进制 是 F ,204 的十六进制是 C (不区分大小写)
- Spring Boot AOP 简易操作日志管理
AOP (Aspect Oriented Programming) 面向切面编程. 业务有核心业务和边缘业务. 比如用户管理,菜单管理,权限管理,这些都属于核心业务. 比如日志管理,操作记录管理,这些 ...
- 第06组 团队Git现场编程实战
一.组员职责分工 队员姓名 主要分工 朱庆章 测评福州最受欢迎的商圈(参考人气) 陈梦雪 测评福州最受欢迎的商圈(参考人气) 关文涛 分别测评福州人均消费50以下,50-100.100-200.200 ...
- PHP是单线程还是多线程?
PHP 从设计之初到流行起来都没有出现明显需要用多线程才能解决的需求.某些需要用到多线程的地方也有相应的解决方案和替代方案.多线程并不总是比单线程优,多线程可能会引入其他问题(例如:两个线程同时调用一 ...