diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-08-16 14:52:13 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-08-16 14:52:13 +0100 |
| commit | 5084f2e72df92416254905811af99f6e419de0cf (patch) | |
| tree | a78214a32c41942a544841b328df1276186c8bf1 /rotord/src/rotor.h | |
| parent | 10f50e4a6b8cbe83cf8c9bee238afe93a5958053 (diff) | |
fix command string issue on video load
Diffstat (limited to 'rotord/src/rotor.h')
| -rwxr-xr-x | rotord/src/rotor.h | 71 |
1 files changed, 65 insertions, 6 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h index e1d4c9e..0d46bdc 100755 --- a/rotord/src/rotor.h +++ b/rotord/src/rotor.h @@ -385,7 +385,7 @@ namespace Rotor { Signal_greyscale(){ create_signal_input("Signal","Signal input"); title="Signal greyscale"; - description="Renders signal level (0..1) as greyscale background"; + description="Renders signal level as greyscale background"; }; Signal_greyscale(map<string,string> &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<int,Image*> 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<string,string> &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;i<out.w*out.h*3;i++){ + out.RGBdata[i]=LUT[in.RGBdata[i]]; + } + } + Image *output(const Frame_spec &frame){ + Image *in=image_inputs[0]->get(frame); + if (in){ + generate_LUT(); + apply_LUT(*in); + } + return ℑ + } + Luma_levels* clone(map<string,string> &_settings) { return new Luma_levels(_settings);}; + protected: + unsigned char *LUT; + }; + */ #define BLEND_blend 1 #define BLEND_screen 2 #define BLEND_multiply 3 |
