dynamic keyframes, textbox rework, andrea ffmpeg.opts, perpetual chkpt undo, lv2...
[goodguy/history.git] / cinelerra-5.1 / plugins / threshold / threshold.C
index 09a3680b58a9b501c73458455e55f9da1888f7ad..ad68519830ef042fc89489cf7a402f7ad45c624b 100644 (file)
@@ -127,7 +127,7 @@ ThresholdMain::~ThresholdMain()
        delete threshold_engine;
 }
 
-const char* ThresholdMain::plugin_title() { return _("Threshold"); }
+const char* ThresholdMain::plugin_title() { return N_("Threshold"); }
 int ThresholdMain::is_realtime() { return 1; }
 
 
@@ -169,7 +169,7 @@ int ThresholdMain::process_buffer(VFrame *frame,
 void ThresholdMain::save_data(KeyFrame *keyframe)
 {
        FileXML output;
-       output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+       output.set_shared_output(keyframe->xbuf);
        output.tag.set_title("THRESHOLD");
        output.tag.set_property("MIN", config.min);
        output.tag.set_property("MAX", config.max);
@@ -187,8 +187,7 @@ void ThresholdMain::save_data(KeyFrame *keyframe)
 void ThresholdMain::read_data(KeyFrame *keyframe)
 {
        FileXML input;
-       const char *data = keyframe->get_data();
-       input.set_shared_input((char *)data, strlen(data));
+       input.set_shared_input(keyframe->xbuf);
        int result = 0;
        while(!result)
        {
@@ -259,12 +258,12 @@ int ThresholdMain::handle_opengl()
                "uniform vec4 low_color;\n"
                "uniform vec4 mid_color;\n"
                "uniform vec4 high_color;\n"
-               "uniform mat3 rgb_to_yuv_matrix;\n"
+               "uniform vec3 rgb_to_y_vector;\n"
                "uniform float yminf;\n"
                "void main()\n"
                "{\n"
                "       vec4 pixel = texture2D(tex, gl_TexCoord[0].st);\n"
-               "       float v = dot(pixel.rgb, rgb_to_yuv_matrix[0]) + yminf;\n"
+               "       float v = dot(pixel.rgb, rgb_to_y_vector) + yminf;\n"
                "       if(v < min)\n"
                "               pixel = low_color;\n"
                "       else if(v < max)\n"
@@ -356,7 +355,7 @@ int ThresholdMain::handle_opengl()
                                        (float)config.high_color.g / 0xff,
                                        (float)config.high_color.b / 0xff,
                                        has_alpha ? (float)config.high_color.a / 0xff : 1.0);
-                       BC_GL_RGB_TO_YUV(shader);
+                       BC_GL_RGB_TO_Y(shader);
                }
        }