From 3252e78c0a43613e2a48d39a8dec74ffaf5ee100 Mon Sep 17 00:00:00 2001 From: Comment Date: Sun, 6 Oct 2013 02:03:44 +0100 Subject: video loader stretch to segment --- rotord/src/nodes_transform.h | 68 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'rotord/src/nodes_transform.h') diff --git a/rotord/src/nodes_transform.h b/rotord/src/nodes_transform.h index 624ad21..99f553e 100644 --- a/rotord/src/nodes_transform.h +++ b/rotord/src/nodes_transform.h @@ -186,6 +186,74 @@ namespace Rotor { private: Image still; }; +#define MIRROR_horiz 1 +#define MIRROR_vert 2 +#define MIRROR_horizR 3 +#define MIRROR_vertR 4 + class Mirror: public Image_node { + public: + Mirror(){ + create_image_input("image input","Image input"); + create_attribute("mode","Mirror mode","Mirror mode","horiz",{"horiz","vert","horizR","vertR"}); + title="Mirror"; + description="Mirror video across a central axis"; + UID="1fed5b26-2d0a-11e3-9901-4b5ea78a005d"; + }; + Mirror(map &settings):Mirror() { + base_settings(settings); + }; + ~Mirror(){ }; + Mirror* clone(map &_settings) { return new Mirror(_settings);}; + Image *output(const Frame_spec &frame){ + Image *in=image_inputs[0]->get(frame); + if (in){ + //copy incoming image **writable + image=(*in); + //could be more efficient here by only copying once + switch (attributes["mode"]->intVal) { + case MIRROR_horiz: + for (int i=0;i