void scratcher_apply(VJFrame *src,
		     int width, int height, int opacity, int n,
		     int no_reverse)
{

    unsigned int len = src->len;
    unsigned int op1 = (opacity > 255) ? 255 : opacity;
    int offset = len * nframe;
    int uv_len = src->uv_len;
    int uv_offset = uv_len * nframe;
	VJFrame copy;

    if (nframe== 0) {
		int strides[4] = { len, uv_len, uv_len, 0 };
		vj_frame_copy( src->data, frame, strides );
        return;
    }
	
	VJFrame srcB;
	veejay_memcpy( &srcB, src, sizeof(VJFrame) );
	srcB.data[0] = frame[0] + offset;
	srcB.data[1] = frame[1] + uv_offset;
	srcB.data[2] = frame[2] + uv_offset;
	opacity_applyN( src, &srcB, src->width,src->height, opacity );
	copy.uv_len = src->uv_len;
	copy.data[0] = frame[0];
	copy.data[1] = frame[1];
	copy.data[2] = frame[2];
   	
	store_frame( &copy, width, height, n, no_reverse);

}
Exemple #2
0
void scratcher_apply(VJFrame *src,int opacity, int n, int no_reverse)
{
    const int len = src->len;
    const int offset = len * nframe;
    const int uv_len = src->uv_len;
    const int uv_offset = uv_len * nframe;

	VJFrame tmp;
	veejay_memcpy( &tmp, src, sizeof(VJFrame) );
	
	tmp.data[0] = frame[0] + offset;
	tmp.data[1] = frame[1] + uv_offset;
	tmp.data[2] = frame[2] + uv_offset;

	if( no_reverse != last_reverse || n != last_n )
	{
		last_reverse = no_reverse;
		nframe = n;
		last_n = n;
	}		

	if( nframe == 0 ) {
		tmp.data[0] = src->data[0];
		tmp.data[1] = src->data[1];
		tmp.data[2] = src->data[2];
	}

	opacity_applyN( src, &tmp, opacity );
	
	store_frame( src, n, no_reverse);
}