HoviTron Video Pipeline
helpersSynthesis.h
1#pragma once
2
3#include "Config.h"
4#include <opencv2/core/mat.hpp>
5#include <glm/glm.hpp>
6#include <glm/gtc/type_ptr.hpp>
7
8template<int rows, int cols>
9bool fromCV2GLM(const cv::Mat& cvmat, glm::mat<cols, rows, float, glm::packed_highp>* glmmat) {
10 assert(cvmat.cols == cols && cvmat.rows == rows && cvmat.type() == CV_32FC1);
11
12 memcpy(glm::value_ptr(*glmmat), cvmat.data, rows * cols * sizeof(float));
13 *glmmat = glm::transpose(*glmmat);
14 return true;
15}
16
17#define INDEX_E(x,y,W) ((y)*(W) + (x))
18std::vector<uint32_t> generate_picture_EBO(const cv::Size& s);
19
20
22cv::Matx33f EulerAnglesToRotationMatrix(cv::Vec3f);
23
25cv::Matx33f EulerAnglesDegreeToRotationMatrixNotOMAF(cv::Vec3f);
26
27
29glm::mat3x3 glmEulerAnglesDegreeToRotationMatrix(glm::vec3);
30
32glm::mat3x3 glmEulerAnglesDegreeToRotationMatrixNotOMAF(glm::vec3);