]> git.sesse.net Git - movit/blobdiff - resize_effect.cpp
Support changing resolution in effects, and add a simple ResizeEffect that does that...
[movit] / resize_effect.cpp
diff --git a/resize_effect.cpp b/resize_effect.cpp
new file mode 100644 (file)
index 0000000..e701d71
--- /dev/null
@@ -0,0 +1,20 @@
+#include "resize_effect.h"
+#include "util.h"
+
+ResizeEffect::ResizeEffect()
+       : width(1280), height(720)
+{
+       register_int("width", &width);
+       register_int("height", &height);
+}
+
+std::string ResizeEffect::output_fragment_shader()
+{
+       return read_file("identity.frag");
+}
+
+void ResizeEffect::get_output_size(unsigned *width, unsigned *height) const
+{
+       *width = this->width;
+       *height = this->height;
+}