NDEVR
API Documentation
RasterCameraRenderer.h
1#pragma once
2#include "Base/Headers/Vector.hpp"
3#include "Base/Headers/Bounds.hpp"
4#include "Base/Headers/String.h"
5#include <QOpenGLWindow>
6#include <QOpenGLFunctions>
7#include <opencv2/core.hpp>
8namespace NDEVR
9{
10 struct OpenGLDisplayImpl;
15 class RasterCameraRenderer : public QOpenGLWindow, public QOpenGLFunctions
16 {
17 Q_OBJECT
18 public:
29 void setBackgroundColor(QColor color) { m_background_color = color; }
35 Angle<sint04> rotation() const { return m_rotation; }
38 void setInfrared(bool infrared);
39 protected:
41 void initializeGL() override;
45 void resizeGL(int w, int h) override;
47 void paintGL() override;
48 protected slots:
51 void onFrameUpdated(const String& id);
52 private:
53 bool m_depth = true;
54 QColor m_background_color;
55 String m_feed_id;
56 OpenGLDisplayImpl* m_impl;
57 cv::Mat m_frame;
58 Angle<sint04> m_rotation;
59 fltp04 m_zoom;
60 };
61}
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
Definition Angle.h:83
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:54
void setInfrared(bool infrared)
Toggle infrared display mode.
Angle< sint04 > rotation() const
Get the current rotation angle.
void paintGL() override
Render the current camera frame to the OpenGL surface.
RasterCameraRenderer(const String &id)
Construct a renderer for the camera feed with the given connection ID.
void setBackgroundColor(QColor color)
Set the background color behind the camera frame.
void resizeGL(int w, int h) override
Handle window resize by updating the viewport.
void initializeGL() override
Initialize OpenGL state and shaders.
void setRotation(const Angle< sint04 > &rotation)
Set the rotation angle applied to the displayed camera frame.
Bounds< 2, sint04 > adjustRatio(const Bounds< 2, sint04 > &bounds, const Vector< 2, sint04 > &size)
Adjust a viewport rectangle to maintain the camera aspect ratio.
void onFrameUpdated(const String &id)
Slot called when a new frame is available for the given feed.
The core String class for the NDEVR API.
Definition String.h:95
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...