From 5084f2e72df92416254905811af99f6e419de0cf Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 16 Aug 2013 14:52:13 +0100 Subject: fix command string issue on video load --- rotord/src/rendercontext.cpp | 26 ++++++++-------- rotord/src/rotor.h | 71 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 78 insertions(+), 19 deletions(-) (limited to 'rotord/src') diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp index 4825b96..0737b2d 100644 --- a/rotord/src/rendercontext.cpp +++ b/rotord/src/rendercontext.cpp @@ -62,8 +62,8 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H s+=c; s+=" "; } - cerr<<"uid:"< &settings):Signal_greyscale() { base_settings(settings); @@ -456,11 +456,11 @@ namespace Rotor { public: Luma_levels(){ create_image_input("image input","Image input"); - create_parameter("black_in","number","input black point (0..1)","Input black point",0.0f,0.0f,1.0f); - create_parameter("white_in","number","input white point (0..1)","Input white point",1.0f,0.0f,1.0f); + create_parameter("black_in","number","input black point","Input black point",0.0f,0.0f,1.0f); + create_parameter("white_in","number","input white point","Input white point",1.0f,0.0f,1.0f); create_parameter("gamma","number","gamma level","Gamma",1.0f,0.0f,10.0f); - create_parameter("black_out","number","output black point (0..1)","Output black point",0.0f,0.0f,1.0f); - create_parameter("white_out","number","output white point (0..1)","Output white point",1.0f,0.0f,1.0f); + create_parameter("black_out","number","output black point","Output black point",0.0f,0.0f,1.0f); + create_parameter("white_out","number","output white point","Output white point",1.0f,0.0f,1.0f); title="Luma levels"; description="Remap luma values of image"; LUT=nullptr; @@ -528,7 +528,7 @@ namespace Rotor { Echo_trails(){ //calls base class constructor first create_parameter("number","number","number of echoes","Number echoes",25.0f); - create_parameter("fadeto","number","amount that echoes fade out (0..1)","Fadout amount",1.0f,0.0f,1.0f); + create_parameter("fadeto","number","amount that echoes fade out","Fadout amount",1.0f,0.0f,1.0f); create_attribute("mode","blend mode for echoes","Blend mode","screen",{"screen","wrap"}); title="Echo trails"; description="Draw trail frames additively that fade off over time"; @@ -614,6 +614,65 @@ namespace Rotor { int interval,total,lastframe; //number of frames between displayed echoes unordered_map images; }; + /* + class RGB_levels: public Image_node { + public: + Luma_levels(){ + create_image_input("image input","Image input"); + create_parameter("red_black_in","number","Red input black-point","Red input black-point",0.0f,0.0f,1.0f); + create_parameter("red_white_in","number","Red input white-point","Red input white-point",1.0f,0.0f,1.0f); + create_parameter("red gamma","number","red gamma level","Red gamma",1.0f,0.0f,10.0f); + create_parameter("red_black_out","number","output black point","Output black point",0.0f,0.0f,1.0f); + create_parameter("red_white_out","number","output white point","Output white point",1.0f,0.0f,1.0f); + create_parameter("black_in","number","input black point","Input black point",0.0f,0.0f,1.0f); + create_parameter("white_in","number","input white point","Input white point",1.0f,0.0f,1.0f); + create_parameter("gamma","number","gamma level","Gamma",1.0f,0.0f,10.0f); + create_parameter("black_out","number","output black point","Output black point",0.0f,0.0f,1.0f); + create_parameter("white_out","number","output white point","Output white point",1.0f,0.0f,1.0f); + create_parameter("black_in","number","input black point","Input black point",0.0f,0.0f,1.0f); + create_parameter("white_in","number","input white point","Input white point",1.0f,0.0f,1.0f); + create_parameter("gamma","number","gamma level","Gamma",1.0f,0.0f,10.0f); + create_parameter("black_out","number","output black point","Output black point",0.0f,0.0f,1.0f); + create_parameter("white_out","number","output white point","Output white point",1.0f,0.0f,1.0f); + title="Luma levels"; + description="Remap luma values of image"; + LUT=nullptr; + }; + Luma_levels(map &settings):Luma_levels() { + base_settings(settings); + } + ~Luma_levels(){if (LUT) { delete[] LUT;} }; + void generate_LUT(){ + //can check here if anything has changed + if (LUT) delete[] LUT; + LUT=new unsigned char[256]; + float fltmax=(255.0f/256.0f); + for (int i=0;i<256;i++){ + LUT[i]=(unsigned char)(((pow(min(fltmax,max(0.0f,(((((float)i)/256.0f)-parameters["black_in"]->value)/(parameters["white_in"]->value-parameters["black_in"]->value)))),(1.0/parameters["gamma"]->value))*(parameters["white_out"]->value-parameters["black_out"]->value))+parameters["black_out"]->value)*255.0f); + } + } + void apply_LUT(const Image& in){ + apply_LUT(in,image); + } + void apply_LUT(const Image& in,Image &out){ //facility to apply to other images for inherited classes + out.setup(in.w,in.h); + for (int i=0;iget(frame); + if (in){ + generate_LUT(); + apply_LUT(*in); + } + return ℑ + } + Luma_levels* clone(map &_settings) { return new Luma_levels(_settings);}; + protected: + unsigned char *LUT; + }; + */ #define BLEND_blend 1 #define BLEND_screen 2 #define BLEND_multiply 3 -- cgit v1.2.3