Loading...
Searching...
No Matches
WindowSettings.hpp
1#pragma once
2#include <QPointF>
3#include <QRectF>
4#include <QSize>
5#include <QString>
6
7namespace Gfx
8{
9
11{
12 int width{};
13 int height{};
14 double rate{};
15 bool viewportSize{};
16 bool vsync{};
17};
18
19enum class WindowMode : int
20{
21 Single = 0,
22 Background = 1,
23 MultiWindow = 2
24};
25
26enum class SwapchainFlag : int
27{
28 NoFlag = 0,
29 sRGB = (1 << 2)
30};
31
32// Matches QRhiSwapchainFormat
33enum class SwapchainFormat : int
34{
35 SDR,
36 HDRExtendedSrgbLinear,
37 HDR10,
38 HDRExtendedDisplayP3Linear
39};
40
41
43{
44 float width{0.0f}; // Blend width in UV space (0.0 = no blend, 0.15 = 15% of output)
45 float gamma{2.2f}; // Blend curve exponent (1.0 = linear, 2.2 = typical projector)
46};
47
49{
50 QPointF topLeft{0.0, 0.0};
51 QPointF topRight{1.0, 0.0};
52 QPointF bottomLeft{0.0, 1.0};
53 QPointF bottomRight{1.0, 1.0};
54
55 bool isIdentity() const noexcept
56 {
57 constexpr double eps = 1e-6;
58 return qAbs(topLeft.x()) < eps && qAbs(topLeft.y()) < eps
59 && qAbs(topRight.x() - 1.0) < eps && qAbs(topRight.y()) < eps
60 && qAbs(bottomLeft.x()) < eps && qAbs(bottomLeft.y() - 1.0) < eps
61 && qAbs(bottomRight.x() - 1.0) < eps && qAbs(bottomRight.y() - 1.0) < eps;
62 }
63};
64
65enum class OutputLockMode : int
66{
67 Free = 0, // No constraints
68 AspectRatio = 1, // Output window preserves input section aspect ratio
69 OneToOne = 2, // Output window size = input source rect pixels (1:1)
70 FullLock = 3 // Cannot move or resize in graphics scenes
71};
72
74{
75 QRectF sourceRect{0.0, 0.0, 1.0, 1.0}; // UV coords in input texture
76 int screenIndex{-1}; // -1 = default screen
77 QPoint windowPosition{0, 0};
78 QSize windowSize{1280, 720};
79 bool fullscreen{false};
80
81 // Soft-edge blending per side
82 EdgeBlend blendLeft;
83 EdgeBlend blendRight;
84 EdgeBlend blendTop;
85 EdgeBlend blendBottom;
86
87 // 4-corner perspective warp (output UV space)
88 CornerWarp cornerWarp;
89
90 OutputLockMode lockMode{OutputLockMode::Free};
91};
92
93}
Binds the rendering pipeline to ossia processes.
Definition CameraDevice.cpp:30
Definition WindowSettings.hpp:49
Definition WindowSettings.hpp:43
Definition WindowSettings.hpp:74
Definition WindowSettings.hpp:11