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 &center, 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检测摄像头的更多相关文章

  1. Flex(flash)检测摄像头的3种状态(是否被占用,没安装摄像头,正常)

    在视频程序的编写过程中,我们经常要使用摄像头,在使用摄像头前有必要对摄像头的现有状态做个检测: 1.被占用 2.没安装摄像头 3.正常 camera=Camera.getCamera();       ...

  2. iOS中检测硬件和传感器

    首先要知道,你需要查看所需的硬件或传感器是否存在,而不是假设设备有哪些功能.举个例子,你不能假设只有iPhone才有麦克风,而应该使用API来查看麦克风是否存在.下面这段代码的第一个优势在于,它能自动 ...

  3. SmileyFace——基于OpenCV的人脸人眼检测、面部识别程序

    项目地址 https://github.com/guoyaohua/SmileyFace 开发环境 Visual Studio 2010 MFC + OpenCV 功能描述 静态图像人脸检测 视频人脸 ...

  4. python之OpenCv(五)---抓取摄像头视频图像

    OpenCV 可以通过 头videoCapture()方法打开摄像 摄像头变量 = cv2.VideoCapture(n)   n为整数,内置摄像头为0,若有其他摄像头则依次为1,2,3,4,... ...

  5. 树莓派3 之 USB摄像头安装和使用

    需求 如果你想在树莓上拍照或者录影,你可以安装树莓派的摄像头(有点贵).如果你不想要为摄像头模块花费额外的金钱,那有另外一个方法,就是你常见的USB 摄像头.你可能已经在PC上安装过了.我买的如图的这 ...

  6. 虚拟机上使用 opecnv 读取USB摄像头无法显示

    使用opecv读取USB摄像头时候,无法显示图像. 设置 首先查看虚拟机Ubuntu检测摄像头是否已正常插入: ls /dev/video* 结果为: 设置虚拟机USB属性: USB的兼容性设置为US ...

  7. 第46章 DCMI—OV5640摄像头—零死角玩转STM32-F429系列

    第46章     DCMI—OV5640摄像头 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com ...

  8. 第45章 DCMI—OV2640摄像头—零死角玩转STM32-F429系列

    第45章     DCMI—OV2640摄像头 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com ...

  9. android摄像头获取图像——第二弹

    使用android内的Camera对象 (1)Camera是控制着摄像头的api,拥有一系列控制摄像头的上层方法:camera类能够调用底层的摄像头接口,完成启动摄像头.预 览摄像头图像.拍照等功能: ...

随机推荐

  1. 《BUG创造队》作业9:【Beta】冲刺 Scrum meeting 2

    项目 内容 这个作业属于哪个课程 2016级软件工程 这个作业的要求在哪里 实验十三 团队作业9:Beta冲刺与团队项目验收 团队名称 BUG创造队 作业学习目标 (1)掌握软件黑盒测试技术:(2)学 ...

  2. 行为型模式(十) 备忘录模式(Memento)

    一.动机(Motivate) 我们看上图,一个对象肯定会有很多状态,这些状态肯定会相互转变而促进对象的发展,如果要想在某一时刻把当前对象回复到以前某一时刻的状态,这个情况用"备忘录模式&qu ...

  3. TAPD----设置新缺陷模板必填信息

    进入设置的路径:设置-->应用设置-->缺陷-->显示设置-->创建页面模板-->点击某个模板

  4. LightOJ - 1067 - Combinations(组合数)

    链接: https://vjudge.net/problem/LightOJ-1067 题意: Given n different objects, you want to take k of the ...

  5. 使用Default Trace查看谁还原了你的数据库?

    select e.nameaseventclass,t.loginname,t.spid,t.starttime, t.textdata,t.objectid,t.objectname,t.datab ...

  6. Springboot-data-jpa增删改查

    导入依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http:/ ...

  7. S1_搭建分布式OpenStack集群_01 准备虚拟机

    Openstack版本:openstack-queen 版本 一.环境准备 网络规划: Management + API Network:10.10.11.0/24 eth1    网桥:br1 VM ...

  8. cube.js 学习(七)cube.js type 以及format 说明

      cube.js 对于measure以及dimension 提供了丰富的数据类型,基本满足我们常见应用的开发,同时对于不同类型也提供了 格式化的操作 measure类型 number 格式 purc ...

  9. 【一起来烧脑】一步学会CSS3体系

    [外链图片转存失败(img-yfi1VPyy-1563434266398)(https://upload-images.jianshu.io/upload_images/11158618-fc8784 ...

  10. makefile通用版本(一)

    实际当中程序文件比较大,这时候对文件进行分类,分为头文件.源文件.目标文件.可执行文件.也就是说通常将文件按照文件类型放在不同的目录当中,这个时候的Makefile需要统一管理这些文件,将生产的目标文 ...