HoviTron Video Pipeline
InputProvider.h
1/* ----------------------
2* Copyright 2023 Université Libre de Bruxelles(ULB), Universidad Politécnica de Madrid(UPM), CREAL, Deutsches Zentrum für Luft - und Raumfahrt(DLR)
3
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at < http://www.apache.org/licenses/LICENSE-2.0>
7
8* Unless required by applicable law or agreed to in writing, software
9* distributed under the License is distributed on an "AS IS" BASIS,
10* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11* See the License for the specific language governing permissionsand
12* limitations under the License.
13---------------------- */
14
15
16
17#pragma once
22#include <span>
23#include <variant>
24
25#include <glm/vec3.hpp>
26#include <glm/vec2.hpp>
27#include <glm/gtc/quaternion.hpp>
28
29#include "commonVulkan.h"
30
36 public:
37
38 enum class ProjectionType {
39 PROJECTION_INVALID,
40 PROJECTION_PERSPECTIVE,
41 PROJECTION_EQUIRECTANGULAR
42 };
43 struct Extrinsics{
44 glm::vec3 position = {-1,-1,-1};
45 glm::vec3 rotation= { -1,-1,-1 }; //Yaw, pitch, roll rotation
46 };
47
52 glm::vec2 verticalRange = { -1,-1};
53 glm::vec2 horizontalRange = {-1,-1};
54 };
55
60 glm::vec2 focals ;
61 glm::vec2 principle ;
62 };
63
67 using Intrinsics = std::variant<PerspectiveIntrinsics, EquirectangularIntrinsics>;
72 std::string streamName = "UNDEFINED";
73
74 glm::ivec2 colorResolution = {-1,-1};
75 glm::ivec2 depthResolution = {-1,-1};
76 float nearDepth; float farDepth;
77
78 vk::Format colorFormat = vk::Format::eUndefined;
79 vk::Format depthFormat = vk::Format::eUndefined;
80
81
82 vk::Sampler colorSampler ;
83 vk::Sampler depthSampler ;
84
85 ProjectionType projectionType = ProjectionType::PROJECTION_INVALID;
86 };
87
89 vk::Image image ;
90 vk::ImageView view ;
91 };
92
94 uint32_t imageIndex = UINT_MAX;
95 Extrinsics extrinsics;
96 Intrinsics intrinsics;
97 };
98
99
100 virtual std::vector<StreamParameters> enumerateStreamsParameters() const = 0;
101 virtual std::vector<StreamImage> enumerateStreamImages(uint32_t streamIndex, bool depth) const = 0;
102 virtual void acquireStreamsFrames(const Extrinsics& targetViewExtrinsics, std::span<StreamFrameInfo> outFrameInfos) = 0;
103 virtual void releaseStreamsFrames() = 0;
104
105 virtual ~InputProvider() = default;
106};
Abstract interface around getting source views parameters and data.
Definition: InputProvider.h:35
std::variant< PerspectiveIntrinsics, EquirectangularIntrinsics > Intrinsics
Union of possible intrinsics types data.
Definition: InputProvider.h:67
file that contains the common include for the Vulkan part
Intrinsics parameters of a equirectangular projection.
Definition: InputProvider.h:51
Intrinsics parameters of a perspective projection.
Definition: InputProvider.h:59
Static parameters of an input view stream.
Definition: InputProvider.h:71