projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mixer enable playback, home/end fixes, stop throw with exrlist missing file
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
plugins
/
crikey
/
crikey.C
diff --git
a/cinelerra-5.1/plugins/crikey/crikey.C
b/cinelerra-5.1/plugins/crikey/crikey.C
index 2f22fed98adf620db3442ef8221a76c8e42b2bb9..d5a6cd13f4c740dc711adeb03472821c14e5ce0e 100644
(file)
--- a/
cinelerra-5.1/plugins/crikey/crikey.C
+++ b/
cinelerra-5.1/plugins/crikey/crikey.C
@@
-27,6
+27,7
@@
#include "bccmodels.h"
#include "bccolors.h"
#include "clip.h"
#include "bccmodels.h"
#include "bccolors.h"
#include "clip.h"
+#include "edl.h"
#include "edlsession.h"
#include "filexml.h"
#include "crikey.h"
#include "edlsession.h"
#include "filexml.h"
#include "crikey.h"
@@
-212,7
+213,7
@@
void FillRegion::run()
if( edge_pixel(lofs) ) break;
}
int rofs = ofs;
if( edge_pixel(lofs) ) break;
}
int rofs = ofs;
- for( int i=rt; ++i< w;
rt=i,msk[rofs]=0
) {
+ for( int i=rt; ++i< w; ) {
if( !msk[++rofs] ) break;
msk[rofs] = 0; rt = i;
if( edge_pixel(rofs) ) break;
if( !msk[++rofs] ) break;
msk[rofs] = 0; rt = i;
if( edge_pixel(rofs) ) break;
@@
-263,7
+264,7
@@
LOAD_CONFIGURATION_MACRO(CriKey, CriKeyConfig)
int CriKey::new_point()
{
int CriKey::new_point()
{
- EDLSession *session = get_edl
session()
;
+ EDLSession *session = get_edl
()->session
;
float x = !session ? 0.f : session->output_w / 2.f;
float y = !session ? 0.f : session->output_h / 2.f;
return config.add_point(-1, 0, x, y, 0.5f);
float x = !session ? 0.f : session->output_w / 2.f;
float y = !session ? 0.f : session->output_h / 2.f;
return config.add_point(-1, 0, x, y, 0.5f);
@@
-334,11
+335,12
@@
void CriKey::read_data(KeyFrame *keyframe)
void CriKey::update_gui()
{
if( !thread ) return;
void CriKey::update_gui()
{
if( !thread ) return;
- if( !load_configuration() ) return;
thread->window->lock_window("CriKey::update_gui");
CriKeyWindow *window = (CriKeyWindow*)thread->window;
thread->window->lock_window("CriKey::update_gui");
CriKeyWindow *window = (CriKeyWindow*)thread->window;
- window->update_gui();
- window->flush();
+ if( load_configuration() ) {
+ window->update_gui();
+ window->flush();
+ }
thread->window->unlock_window();
}
thread->window->unlock_window();
}
@@
-569,14
+571,6
@@
void CriKey::draw_point(VFrame *src, CriKeyPoint *pt)
}
}
-static void get_vframe(VFrame *&vfrm, int w, int h, int color_model)
-{
- if( vfrm && ( vfrm->get_w() != w || vfrm->get_h() != h ) ) {
- delete vfrm; vfrm = 0;
- }
- if( !vfrm ) vfrm = new VFrame(w, h, color_model, 0);
-}
-
static void fill_edge(VFrame *vfrm, int w, int h)
{
int w1 = w-1, h1 = h-1;
static void fill_edge(VFrame *vfrm, int w, int h)
{
int w1 = w-1, h1 = h-1;
@@
-598,14
+592,14
@@
int CriKey::process_buffer(VFrame *frame, int64_t start_position, double frame_r
if( comp > 3 ) comp = 3;
read_frame(src, 0, start_position, frame_rate, 0);
if( comp > 3 ) comp = 3;
read_frame(src, 0, start_position, frame_rate, 0);
-
get_vframe
(edg, w, h, BC_A_FLOAT);
+
VFrame::get_temp
(edg, w, h, BC_A_FLOAT);
if( !engine )
engine = new CriKeyEngine(this,
PluginClient::get_project_smp() + 1,
PluginClient::get_project_smp() + 1);
if( !engine )
engine = new CriKeyEngine(this,
PluginClient::get_project_smp() + 1,
PluginClient::get_project_smp() + 1);
-
get_vframe
(msk, w, h, BC_A8);
+
VFrame::get_temp
(msk, w, h, BC_A8);
memset(msk->get_data(), 0xff, msk->get_data_size());
for( int i=0, n=config.points.size(); i<n; ++i ) {
memset(msk->get_data(), 0xff, msk->get_data_size());
for( int i=0, n=config.points.size(); i<n; ++i ) {
@@
-613,7
+607,7
@@
int CriKey::process_buffer(VFrame *frame, int64_t start_position, double frame_r
if( !pt->e ) continue;
if( set_target(engine->color, pt->x, pt->y) ) continue;
engine->threshold = pt->t;
if( !pt->e ) continue;
if( set_target(engine->color, pt->x, pt->y) ) continue;
engine->threshold = pt->t;
- edg->
clear
_frame();
+ edg->
black
_frame();
engine->process_packages();
fill_edge(edg, w, h);
FillRegion fill_region(edg, msk);
engine->process_packages();
fill_edge(edg, w, h);
FillRegion fill_region(edg, msk);