]> git.sesse.net Git - movit/blobdiff - util.cpp
Add an effect for 4:2:2 interleaved YCbCr input (UYVY).
[movit] / util.cpp
index 3ebf162d31a0558ddfb54d3a8520706035ee45e6..a6175b4dbaf81bcad6fe7d9b6b585a4b2a3b76b6 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -183,6 +183,16 @@ string output_glsl_mat3(const string &name, const Eigen::Matrix3d &m)
        return ss.str();
 }
 
+string output_glsl_float(const string &name, float x)
+{
+       // Use stringstream to be independent of the current locale in a thread-safe manner.
+       stringstream ss;
+       ss.imbue(locale("C"));
+       ss.precision(8);
+       ss << "const float " << name << " = " << x << ";\n";
+       return ss.str();
+}
+
 string output_glsl_vec2(const string &name, float x, float y)
 {
        // Use stringstream to be independent of the current locale in a thread-safe manner.