From ad9715a9e69ad869eaa26fe202da4ba9a729a05d Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 2 Dec 2013 13:49:46 +0000 Subject: fix feedback glitch 1st frame --- rotord/src/graph.cpp | 1 + rotord/src/nodes_channels.h | 1 + rotord/src/rotor.h | 5 +++++ 3 files changed, 7 insertions(+) (limited to 'rotord/src') diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp index 4039d4b..ef493e8 100644 --- a/rotord/src/graph.cpp +++ b/rotord/src/graph.cpp @@ -108,6 +108,7 @@ bool Graph::video_render(const string &output_filename,const float framerate,int } for (auto f: find_nodes("video_feedback")){ + video_output->clear_output(outW,outH); (dynamic_cast(f))->set_feedback(&(video_output->image)); } // diff --git a/rotord/src/nodes_channels.h b/rotord/src/nodes_channels.h index 086ad2f..d7d93b2 100644 --- a/rotord/src/nodes_channels.h +++ b/rotord/src/nodes_channels.h @@ -468,6 +468,7 @@ namespace Rotor { Frame_spec wanted=Frame_spec(absframe,frame.framerate,frame.duration,frame.w,frame.h); Image *in2=(((Image_node*)image_inputs[0]->connection)->get_image_output(wanted)); if (in2) apply_LUT(*(in2),*(images[absframe])); + else in2->clear(); } if (fless(1.0f,parameters["fadeto"]->value)){ float amount=(((parameters["number"]->value-i)/parameters["number"]->value)*(1.0f-parameters["fadeto"]->value))+(1.0f-parameters["fadeto"]->value); diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h index 5e77704..e3b218d 100644 --- a/rotord/src/rotor.h +++ b/rotord/src/rotor.h @@ -459,6 +459,10 @@ namespace Rotor { return i; } virtual Image *output(const Frame_spec &frame)=0; + void clear_output(int w,int h){ + image.setup(w,h); + image.clear(); + } Image image; float get_time_used(){ float t=time_taken; @@ -467,6 +471,7 @@ namespace Rotor { for (auto i:image_inputs) t-=i->get_time_taken(); return t; } + private: float image_time; //? could be used to detect image reuse? -- cgit v1.2.3