void chameleon_apply( VJFrame *frame, int mode) { const int len = frame->len; VJFrame source; int strides[4] = { len, len, len, 0 }; vj_frame_copy( frame->data, tmpimage, strides ); source.data[0] = tmpimage[0]; source.data[1] = tmpimage[1]; source.data[2] = tmpimage[2]; source.len = len; uint32_t activity = 0; int auto_switch = 0; int tmp1,tmp2; if( motionmap_active() ) { motionmap_scale_to( 32,32,1,1, &tmp1,&tmp2, &n__, &N__ ); auto_switch = 1; activity = motionmap_activity(); } else { N__ = 0; n__ = 0; } if( n__ == N__ || n__ == 0 ) auto_switch = 0; if(auto_switch) { if( activity <= 40 ) { // into the wall drawDisappearing( &source, frame ); } else { // out of the wall drawAppearing( &source, frame ); } } if( mode == 0 ) drawDisappearing( &source, frame ); else drawAppearing( &source, frame ); }
void chameleonblend_apply( VJFrame *frame, VJFrame *source, int width, int height, int mode ) { uint32_t activity = 0; int auto_switch = 0; int tmp1,tmp2; if( motionmap_active() ) { motionmap_scale_to( 32,32,1,1, &tmp1,&tmp2, &n__, &N__ ); auto_switch = 1; activity = motionmap_activity(); } else { N__ = 0; n__ = 0; } if( n__ == N__ || n__ == 0 ) auto_switch = 0; if(auto_switch) { if( activity <= 40 ) { veejay_msg(2, "Activity > 40, draw disappearing" ); // into the wall drawDisappearing( source, frame ); } else { veejay_msg(2, "Activity > 40, draw appearing" ); // out of the wall drawAppearing( source, frame ); } } else { if( mode == 0 ) drawDisappearing( source, frame ); else drawAppearing( source, frame ); } }