From 89891a18e5b5e966848ac76518cf5c4d05d708af Mon Sep 17 00:00:00 2001 From: brunoherbelin Date: Sat, 26 Sep 2020 20:02:17 +0200 Subject: [PATCH] Minor bug fix PatternSource. --- GlmToolkit.cpp | 2 +- PatternSource.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GlmToolkit.cpp b/GlmToolkit.cpp index c748f8e..f2d23e5 100644 --- a/GlmToolkit.cpp +++ b/GlmToolkit.cpp @@ -186,7 +186,7 @@ glm::ivec2 GlmToolkit::resolutionFromDescription(int aspectratio, int height) int h = glm::clamp(height, 0, 8); static glm::vec2 aspect_ratio_size[6] = { glm::vec2(1.f,1.f), glm::vec2(4.f,3.f), glm::vec2(3.f,2.f), glm::vec2(16.f,10.f), glm::vec2(16.f,9.f), glm::vec2(21.f,9.f) }; - static float resolution_height[9] = { 16.f, 64.f, 200.f, 320.f, 480.f, 720.f, 1080.f, 1440.f, 2160.f }; + static float resolution_height[10] = { 16.f, 64.f, 200.f, 320.f, 480.f, 576.f, 720.f, 1080.f, 1440.f, 2160.f }; float width = aspect_ratio_size[ar].x * resolution_height[h] / aspect_ratio_size[ar].y; glm::ivec2 res = glm::ivec2( width, resolution_height[h]); diff --git a/PatternSource.cpp b/PatternSource.cpp index 1abb44c..1a65e2c 100644 --- a/PatternSource.cpp +++ b/PatternSource.cpp @@ -109,7 +109,7 @@ void Pattern::open( uint pattern, glm::ivec2 res ) case 17: { std::ostringstream oss; - oss << " kx2=" << (int)(aspectRatio() * 10.f) << " ky2=10 kt=4"; + oss << " kx2=" << (int)(res.x * 10.f / res.y) << " ky2=10 kt=4"; gstreamer_pattern += oss.str(); // Zone plate } break;