r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / plugins / dissolve / dissolve.C
blob237fe8f3b33dea9ff5c2749def4537375bebbe03
1 #include "dissolve.h"
2 #include "edl.inc"
3 #include "overlayframe.h"
4 #include "picon_png.h"
5 #include "vframe.h"
7 #include <libintl.h>
8 #define _(String) gettext(String)
9 #define gettext_noop(String) String
10 #define N_(String) gettext_noop (String)
12 PluginClient* new_plugin(PluginServer *server)
14         return new DissolveMain(server);
21 DissolveMain::DissolveMain(PluginServer *server)
22  : PluginVClient(server)
24         overlayer = 0;
27 DissolveMain::~DissolveMain()
29         if(overlayer)
30                 delete overlayer;
33 char* DissolveMain::plugin_title() { return _("Dissolve"); }
34 int DissolveMain::is_video() { return 1; }
35 int DissolveMain::is_transition() { return 1; }
36 int DissolveMain::uses_gui() { return 0; }
38 NEW_PICON_MACRO(DissolveMain)
41 int DissolveMain::process_realtime(VFrame *incoming, VFrame *outgoing)
43         float fade = (float)PluginClient::get_source_position() / 
44                         PluginClient::get_total_len();
46         if(!overlayer) overlayer = new OverlayFrame(get_project_smp() + 1);
47 //printf("DissolveMain::process_realtime %f\n", fade);
48         overlayer->overlay(outgoing, 
49                 incoming, 
50                 0, 
51                 0, 
52                 incoming->get_w(),
53                 incoming->get_h(),
54                 0,
55                 0,
56                 incoming->get_w(),
57                 incoming->get_h(),
58                 fade,
59                 TRANSFER_NORMAL,
60                 NEAREST_NEIGHBOR);
62         return 0;