dynamic keyframes, textbox rework, andrea ffmpeg.opts, perpetual chkpt undo, lv2...
[goodguy/history.git] / cinelerra-5.1 / plugins / timeavg / timeavg.C
index 02ce4f5d73a56d1607a8a2d646099711178ac22c..d32db7efe1eb80c849806a4ac5ab0214f567642c 100644 (file)
@@ -19,8 +19,9 @@
  *
  */
 
-#include "clip.h"
+#include "bccolors.h"
 #include "bchash.h"
+#include "clip.h"
 #include "filexml.h"
 #include "keyframe.h"
 #include "language.h"
@@ -115,7 +116,7 @@ TimeAvgMain::~TimeAvgMain()
        if(history_valid) delete [] history_valid;
 }
 
-const char* TimeAvgMain::plugin_title() { return _("Time Average"); }
+const char* TimeAvgMain::plugin_title() { return N_("Time Average"); }
 int TimeAvgMain::is_realtime() { return 1; }
 
 
@@ -498,8 +499,7 @@ void TimeAvgMain::reset_accum(int w, int h, int color_model)
        }
 }
 
-#define RGB_TO_VALUE(r, g, b) \
-((r) * R_TO_Y + (g) * G_TO_Y + (b) * B_TO_Y)
+#define RGB_TO_VALUE(r, g, b) YUV::yuv.rgb_to_y_f((r),(g),(b))
 
 // Only AVERAGE and ACCUMULATE use this
 #define SUBTRACT_ACCUM(type, \
@@ -1026,7 +1026,7 @@ void TimeAvgMain::save_data(KeyFrame *keyframe)
        FileXML output;
 
 // cause data to be stored directly in text
-       output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+       output.set_shared_output(keyframe->xbuf);
        output.tag.set_title("TIME_AVERAGE");
        output.tag.set_property("FRAMES", config.frames);
        output.tag.set_property("MODE", config.mode);
@@ -1045,7 +1045,7 @@ void TimeAvgMain::read_data(KeyFrame *keyframe)
 {
        FileXML input;
 
-       input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+       input.set_shared_input(keyframe->xbuf);
 
        while(!input.read_tag())
        {