mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-20 23:00:02 +01:00
Merge pull request #126 from d-j-a-y/djay_libvje
libvje / refactor : progress
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include <libsubsample/subsample.h>
|
||||
#include "common.h"
|
||||
#include "bgpush.h"
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
|
||||
#ifndef PUSH_H
|
||||
#define PUSH_H
|
||||
#include <libvje/vje.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *bgpush_init(int w, int h);
|
||||
void bgpush_apply( VJFrame *frame );
|
||||
int bgpush_malloc(int w, int h);
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include "color.h"
|
||||
|
||||
vj_effect *color_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
@@ -48,9 +50,7 @@ vj_effect *color_init(int w, int h)
|
||||
}
|
||||
|
||||
|
||||
void color_apply(VJFrame *frame, int width, int height,
|
||||
int opacity_a, int opacity_b,
|
||||
int opacity_c)
|
||||
void color_apply(VJFrame *frame, int opacity_a, int opacity_b, int opacity_c)
|
||||
{
|
||||
unsigned int i;
|
||||
const unsigned int op_a0 = 255 - opacity_a;
|
||||
@@ -93,7 +93,6 @@ void color_apply(VJFrame *frame, int width, int height,
|
||||
Cb[i] = q1;
|
||||
Cr[i] = q2;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void color_free(){}
|
||||
|
||||
@@ -20,12 +20,6 @@
|
||||
|
||||
#ifndef COLORVAL_H
|
||||
#define COLORVAL_H
|
||||
#include <libvje/vje.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *color_init();
|
||||
void color_apply( VJFrame *frame , int width, int height, int a, int b, int c);
|
||||
|
||||
void color_free();
|
||||
void color_apply( VJFrame *frame, int a, int b, int c);
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <math.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libavutil/avutil.h>
|
||||
#include <libvjmsg/vj-msg.h>
|
||||
#include <libyuv/yuvconv.h>
|
||||
|
||||
@@ -28,12 +28,13 @@
|
||||
|
||||
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include "lumamask.h"
|
||||
#include "common.h"
|
||||
#include "lumamask.h"
|
||||
|
||||
static uint8_t *buf[4] = { NULL,NULL,NULL,NULL };
|
||||
|
||||
vj_effect *lumamask_init(int width, int height)
|
||||
@@ -84,8 +85,8 @@ int lumamask_malloc(int width, int height)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void lumamask_apply( VJFrame *frame, VJFrame *frame2, int width,
|
||||
int height, int v_scale, int h_scale, int border, int alpha )
|
||||
void lumamask_apply( VJFrame *frame, VJFrame *frame2, int v_scale, int h_scale,
|
||||
int border, int alpha )
|
||||
{
|
||||
unsigned int x,y;
|
||||
int dx,dy,nx,ny;
|
||||
@@ -94,6 +95,9 @@ void lumamask_apply( VJFrame *frame, VJFrame *frame2, int width,
|
||||
int tmp1 = v_scale;
|
||||
int tmp2 = h_scale;
|
||||
int motion = 0;
|
||||
const unsigned int width = frame->width;
|
||||
const unsigned int height = frame->height;
|
||||
const unsigned int len = frame->len;
|
||||
|
||||
if( motionmap_active() )
|
||||
{
|
||||
@@ -118,7 +122,7 @@ void lumamask_apply( VJFrame *frame, VJFrame *frame2, int width,
|
||||
uint8_t *Cr2 = frame2->data[2];
|
||||
uint8_t *aA = frame->data[3];
|
||||
uint8_t *aB = frame2->data[3];
|
||||
int strides[4] = { width * height, width * height, width * height ,( alpha ? width * height : 0 )};
|
||||
int strides[4] = { len, len, len ,( alpha ? len : 0 )};
|
||||
vj_frame_copy( frame->data, buf, strides );
|
||||
|
||||
if( alpha == 0 )
|
||||
|
||||
@@ -20,11 +20,7 @@
|
||||
|
||||
#ifndef LUMAMASK_H
|
||||
#define LUMAMASK_H
|
||||
#include <libvje/vje.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void lumamask_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int mode, int h_scale, int border, int alpha);
|
||||
void lumamask_apply( VJFrame *frame, VJFrame *frame2, int mode, int h_scale, int border, int alpha);
|
||||
vj_effect *lumamask_init(int w, int h);
|
||||
int lumamask_malloc(int w, int h);
|
||||
void lumamask_free();
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA.
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "magicmirror.h"
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include "common.h"
|
||||
#include "motionmap.h"
|
||||
#include <libvje/internal.h>
|
||||
#include "magicmirror.h"
|
||||
|
||||
|
||||
// if d or n changes, tables need to be calculated
|
||||
static uint8_t *magicmirrorbuf[4] = { NULL,NULL,NULL,NULL };
|
||||
@@ -123,8 +123,11 @@ void magicmirror_free()
|
||||
funhouse_y = NULL;
|
||||
}
|
||||
|
||||
void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int n, int alpha )
|
||||
void magicmirror_apply( VJFrame *frame, int vx, int vy, int d, int n, int alpha )
|
||||
{
|
||||
const unsigned int width = frame->width;
|
||||
const unsigned int height = frame->height;
|
||||
const unsigned int len = frame->len;
|
||||
double c1 = (double)vx;
|
||||
double c2 = (double)vy;
|
||||
int motion = 0;
|
||||
@@ -151,10 +154,10 @@ void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int
|
||||
interpolate = 0;
|
||||
|
||||
double c3 = (double)d * 0.001;
|
||||
unsigned int dx,dy,x,y,p,q,len=w*h;
|
||||
unsigned int dx,dy,x,y,p,q;
|
||||
double c4 = (double)n * 0.001;
|
||||
int changed = 0;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb= frame->data[1];
|
||||
uint8_t *Cr= frame->data[2];
|
||||
uint8_t *A = frame->data[3];
|
||||
@@ -176,31 +179,31 @@ void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int
|
||||
if(changed==1)
|
||||
{
|
||||
// degrees x or y changed, need new sin
|
||||
for(x=0; x < w ; x++)
|
||||
for(x=0; x < width ; x++)
|
||||
{
|
||||
double res;
|
||||
fast_sin(res,(double)(c3*x));
|
||||
funhouse_x[x] = res;
|
||||
}
|
||||
for(y=0; y < h; y++)
|
||||
for(y=0; y < height; y++)
|
||||
{
|
||||
double res;
|
||||
fast_sin(res,(double)(c4*y));
|
||||
funhouse_y[y] = res;
|
||||
}
|
||||
}
|
||||
for(x=0; x < w; x++)
|
||||
for(x=0; x < width; x++)
|
||||
{
|
||||
dx = x + funhouse_x[x] * c1;
|
||||
if(dx < 0) dx += w;
|
||||
if(dx < 0) dx = 0; else if (dx >= w) dx = w-1;
|
||||
if(dx < 0) dx += width;
|
||||
if(dx < 0) dx = 0; else if (dx >= width) dx = width-1;
|
||||
cache_x[x] = dx;
|
||||
}
|
||||
for(y=0; y < h; y++)
|
||||
for(y=0; y < height; y++)
|
||||
{
|
||||
dy = y + funhouse_y[y] * c2;
|
||||
if(dy < 0) dy += h;
|
||||
if(dy < 0) dy = 0; else if (dy >= h) dy = h-1;
|
||||
if(dy < 0) dy += height;
|
||||
if(dy < 0) dy = 0; else if (dy >= height) dy = height-1;
|
||||
cache_y[y] = dy;
|
||||
}
|
||||
|
||||
@@ -211,12 +214,12 @@ void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int
|
||||
if( alpha ) {
|
||||
veejay_memcpy( magicmirrorbuf[3], frame->data[3], len );
|
||||
/* apply on alpha first */
|
||||
for(y=1; y < h-1; y++)
|
||||
for(y=1; y < height-1; y++)
|
||||
{
|
||||
for(x=1; x < w-1; x++)
|
||||
for(x=1; x < width-1; x++)
|
||||
{
|
||||
q = y * w + x;
|
||||
p = cache_y[y] * w + cache_x[x];
|
||||
q = y * width + x;
|
||||
p = cache_y[y] * width + cache_x[x];
|
||||
A[q] = magicmirrorbuf[3][p];
|
||||
}
|
||||
}
|
||||
@@ -225,12 +228,12 @@ void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int
|
||||
|
||||
switch(alpha) {
|
||||
case 1:
|
||||
for(y=1; y < h-1; y++)
|
||||
for(y=1; y < height-1; y++)
|
||||
{
|
||||
for(x=1; x < w-1; x++)
|
||||
for(x=1; x < width-1; x++)
|
||||
{
|
||||
q = y * w + x;
|
||||
p = cache_y[y] * w + cache_x[x];
|
||||
q = y * width + x;
|
||||
p = cache_y[y] * width + cache_x[x];
|
||||
if( Am[p] || A[q] ) {
|
||||
Y[q] = magicmirrorbuf[0][p];
|
||||
Cb[q] = magicmirrorbuf[1][p];
|
||||
@@ -250,12 +253,12 @@ void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int
|
||||
veejay_msg(0,"This mode requires 'Subtract background' FX");
|
||||
break;
|
||||
}
|
||||
for(y=1; y < h-1; y++)
|
||||
for(y=1; y < height-1; y++)
|
||||
{
|
||||
for(x=1; x < w-1; x++)
|
||||
for(x=1; x < width-1; x++)
|
||||
{
|
||||
q = y * w + x;
|
||||
p = cache_y[y] * w + cache_x[x];
|
||||
q = y * width + x;
|
||||
p = cache_y[y] * width + cache_x[x];
|
||||
|
||||
if( A[q] ) {
|
||||
Y[q] = magicmirrorbuf[0][p];
|
||||
@@ -275,12 +278,12 @@ void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(y=1; y < h-1; y++)
|
||||
for(y=1; y < height-1; y++)
|
||||
{
|
||||
for(x=1; x < w-1; x++)
|
||||
for(x=1; x < width-1; x++)
|
||||
{
|
||||
q = y * w + x;
|
||||
p = cache_y[y] * w + cache_x[x];
|
||||
q = y * width + x;
|
||||
p = cache_y[y] * width + cache_x[x];
|
||||
|
||||
Y[q] = magicmirrorbuf[0][p];
|
||||
Cb[q] = magicmirrorbuf[1][p];
|
||||
|
||||
@@ -20,13 +20,8 @@
|
||||
|
||||
#ifndef MAGICMIRROR_H
|
||||
#define MAGICMIRROR_H
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *magicmirror_init(int w, int h);
|
||||
int magicmirror_malloc(int w, int h);
|
||||
void magicmirror_apply( VJFrame *frame, int width, int height, int a, int b, int na, int nb, int alpha);
|
||||
void magicmirror_apply( VJFrame *frame, int a, int b, int na, int nb, int alpha);
|
||||
void magicmirror_free();
|
||||
#endif
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include "pencilsketch.h"
|
||||
#include "common.h"
|
||||
#include "pencilsketch.h"
|
||||
|
||||
extern int vj_task_available();
|
||||
|
||||
@@ -152,18 +153,12 @@ typedef uint8_t (*_pcbcr) (uint8_t a, uint8_t b);
|
||||
}
|
||||
|
||||
|
||||
void pencilsketch_apply(
|
||||
VJFrame *frame,
|
||||
int width,
|
||||
int height,
|
||||
int type,
|
||||
int threshold_min,
|
||||
int threshold_max,
|
||||
int mode
|
||||
)
|
||||
void pencilsketch_apply(VJFrame *frame, int type, int threshold_min,
|
||||
int threshold_max, int mode)
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int len = frame->len;
|
||||
const unsigned int width = frame->width;
|
||||
const unsigned int uv_len = (frame->ssm ?frame->len : frame->uv_len);
|
||||
int m,d;
|
||||
uint8_t y,yb;
|
||||
|
||||
@@ -20,12 +20,7 @@
|
||||
|
||||
#ifndef PENCILSKETCH_EFFECT_H
|
||||
#define PENCILSKETCH_EFFECT_H
|
||||
#include <libvje/vje.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *pencilsketch_init();
|
||||
void pencilsketch_apply(VJFrame *frame, int w, int h, int type, int threshold, int opacity,int mode);
|
||||
|
||||
void pencilsketch_apply(VJFrame *frame, int type, int threshold, int opacity,int mode);
|
||||
void pencilsketch_free();
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include "pixelate.h"
|
||||
|
||||
@@ -58,11 +59,11 @@ vj_effect *pixelate_init(int width, int height)
|
||||
return ve;
|
||||
}
|
||||
|
||||
void pixelate_apply( VJFrame *frame, int w, int h , int vv )
|
||||
void pixelate_apply( VJFrame *frame, int vv )
|
||||
{
|
||||
unsigned int i,j ;
|
||||
unsigned int len = frame->len;
|
||||
const unsigned int v = values[vv];
|
||||
const unsigned int v = values[vv];
|
||||
const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len);
|
||||
unsigned int u_v = v >> (frame->ssm ? frame->shift_h: 1 );
|
||||
if( u_v == 0 )
|
||||
@@ -76,7 +77,7 @@ void pixelate_apply( VJFrame *frame, int w, int h , int vv )
|
||||
for(j=0; j < v; j++)
|
||||
{
|
||||
Y[i+j] = Y[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < uv_len; i+=u_v) {
|
||||
@@ -85,6 +86,6 @@ void pixelate_apply( VJFrame *frame, int w, int h , int vv )
|
||||
Cb[i+j] = Cb[i];
|
||||
Cr[i+j] = Cr[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#ifndef PIXELATE_H
|
||||
#define PIXELATE_H
|
||||
#include <libvje/vje.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *pixelate_init(int w, int h);
|
||||
void pixelate_apply( VJFrame *frame, int width, int height, int val);
|
||||
void pixelate_apply( VJFrame *frame, int val);
|
||||
#endif
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA.
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include "raster.h"
|
||||
#include "common.h"
|
||||
#include <math.h>
|
||||
#include "raster.h"
|
||||
|
||||
vj_effect *raster_init(int w, int h)
|
||||
{
|
||||
@@ -51,34 +50,37 @@ vj_effect *raster_init(int w, int h)
|
||||
return ve;
|
||||
}
|
||||
|
||||
void raster_apply(VJFrame *frame, int w, int h, int val, int mode)
|
||||
void raster_apply(VJFrame *frame, int val, int mode)
|
||||
{
|
||||
int x,y;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb= frame->data[1];
|
||||
uint8_t *Cr= frame->data[2];
|
||||
const unsigned int width = frame->width;
|
||||
const unsigned int height = frame->height;
|
||||
|
||||
if(val == 0 )
|
||||
return;
|
||||
|
||||
uint8_t pixel_color = mode ? pixel_Y_hi_ : pixel_Y_lo_;
|
||||
|
||||
for(y=0; y < h; y++)
|
||||
for(y=0; y < height; y++)
|
||||
{
|
||||
for(x=0; x < w; x++)
|
||||
for(x=0; x < width; x++)
|
||||
{
|
||||
Y[y*w+x] = ((x%val>1)? ((y%val>1) ? Y[y*w+x]: pixel_color):pixel_color);
|
||||
Y[y*width+x] = ((x%val>1)? ((y%val>1) ? Y[y*width+x]: pixel_color):pixel_color);
|
||||
}
|
||||
}
|
||||
w= frame->uv_width;
|
||||
h= frame->uv_height;
|
||||
|
||||
for(y=0; y < h; y++)
|
||||
const unsigned int uv_width= frame->uv_width;
|
||||
const unsigned int uv_height= frame->uv_height;
|
||||
|
||||
for(y=0; y < uv_height; y++)
|
||||
{
|
||||
for(x=0; x < w; x++)
|
||||
for(x=0; x < uv_width; x++)
|
||||
{
|
||||
Cb[y*w+x] = ((x%val>1)? ((y%val>1) ? Cb[y*w+x]:128):128);
|
||||
Cr[y*w+x] = ((x%val>1)? ((y%val>1) ? Cr[y*w+x]:128):128);
|
||||
Cb[y*uv_width+x] = ((x%val>1)? ((y%val>1) ? Cb[y*uv_width+x]:128):128);
|
||||
Cr[y*uv_width+x] = ((x%val>1)? ((y%val>1) ? Cr[y*uv_width+x]:128):128);
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#ifndef RASTER_H
|
||||
#define RASTER_H
|
||||
#include <libvje/vje.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *raster_init(int w, int h);
|
||||
void raster_apply( VJFrame *frame, int width, int height, int val, int mode);
|
||||
void raster_apply( VJFrame *frame, int val, int mode);
|
||||
#endif
|
||||
|
||||
@@ -17,12 +17,13 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA.
|
||||
*/
|
||||
#include <config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include "smear.h"
|
||||
#include "common.h"
|
||||
#include "smear.h"
|
||||
|
||||
vj_effect *smear_init(int w, int h)
|
||||
{
|
||||
@@ -51,15 +52,17 @@ vj_effect *smear_init(int w, int h)
|
||||
|
||||
return ve;
|
||||
}
|
||||
|
||||
static void _smear_apply_x(VJFrame *frame, int width, int height, int val)
|
||||
{
|
||||
unsigned int j;
|
||||
unsigned int x,y;
|
||||
unsigned int j;
|
||||
unsigned int x,y;
|
||||
uint8_t *Y = frame->data[0];
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
for(y=0; y < height-1; y++)
|
||||
{
|
||||
|
||||
for(y=0; y < height-1; y++)
|
||||
{
|
||||
for(x=0; x < width; x++)
|
||||
{
|
||||
j = Y[y*width+x];
|
||||
@@ -70,8 +73,9 @@ static void _smear_apply_x(VJFrame *frame, int width, int height, int val)
|
||||
Cr[y*width+x] = Cr[y*width+x+j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _smear_apply_x_avg(VJFrame *frame, int width, int height, int val)
|
||||
{
|
||||
unsigned int j;
|
||||
@@ -93,6 +97,7 @@ static void _smear_apply_x_avg(VJFrame *frame, int width, int height, int val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _smear_apply_y_avg(VJFrame *frame, int width, int height, int val)
|
||||
{
|
||||
unsigned int i,j;
|
||||
@@ -117,6 +122,7 @@ static void _smear_apply_y_avg(VJFrame *frame, int width, int height, int val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _smear_apply_y(VJFrame *frame, int width, int height, int val)
|
||||
{
|
||||
unsigned int i,j;
|
||||
@@ -146,44 +152,43 @@ static void _smear_apply_y(VJFrame *frame, int width, int height, int val)
|
||||
static int n__ = 0;
|
||||
static int N__ = 0;
|
||||
|
||||
void smear_apply( VJFrame *frame, int width, int height,int mode, int val)
|
||||
void smear_apply( VJFrame *frame,int mode, int val)
|
||||
{
|
||||
int interpolate = 1;
|
||||
int tmp1 = mode;
|
||||
int tmp2 = val;
|
||||
int motion = 0;
|
||||
if(motionmap_active())
|
||||
{
|
||||
motionmap_scale_to( 255, 3, 0, 0, &tmp2, &tmp1, &n__, &N__ );
|
||||
motion = 1;
|
||||
}
|
||||
int interpolate = 1;
|
||||
int tmp1 = mode;
|
||||
int tmp2 = val;
|
||||
int motion = 0;
|
||||
const unsigned int width = frame->width;
|
||||
const unsigned int height = frame->height;
|
||||
|
||||
if(motionmap_active())
|
||||
{
|
||||
motionmap_scale_to( 255, 3, 0, 0, &tmp2, &tmp1, &n__, &N__ );
|
||||
motion = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
N__ = 0;
|
||||
n__ = 0;
|
||||
}
|
||||
|
||||
if( n__ == N__ || n__ == 0 )
|
||||
interpolate = 0;
|
||||
if( n__ == N__ || n__ == 0 )
|
||||
interpolate = 0;
|
||||
|
||||
switch(mode)
|
||||
{
|
||||
{
|
||||
case 0: _smear_apply_x(frame,width,height,tmp2); break;
|
||||
case 1: _smear_apply_x_avg(frame,width,height,tmp2); break;
|
||||
case 2: _smear_apply_y(frame,width,height,tmp2); break;
|
||||
case 3: _smear_apply_y_avg(frame,width,height,tmp2); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if( interpolate )
|
||||
{
|
||||
motionmap_interpolate_frame( frame, N__,n__ );
|
||||
}
|
||||
if( interpolate )
|
||||
motionmap_interpolate_frame( frame, N__,n__ );
|
||||
|
||||
if(motion)
|
||||
{
|
||||
motionmap_store_frame( frame );
|
||||
}
|
||||
if(motion)
|
||||
motionmap_store_frame( frame );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#ifndef SMEAR_H
|
||||
#define SMEAR_H
|
||||
#include <libvje/vje.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *smear_init(int w, int h);
|
||||
void smear_apply(VJFrame *frame, int width, int height,int mode, int val);
|
||||
void smear_apply(VJFrame *frame, int mode, int val);
|
||||
#endif
|
||||
|
||||
@@ -22,20 +22,14 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA.
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <libvje/vje.h>
|
||||
#include <libvjmem/vjmem.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
#include "rippletv.h"
|
||||
#include "softblur.h"
|
||||
#include "water.h"
|
||||
|
||||
typedef struct {
|
||||
uint8_t *ripple_data[4];
|
||||
@@ -502,7 +496,8 @@ static void raindrop(water_t *w)
|
||||
period--;
|
||||
}
|
||||
|
||||
void water_apply(void *user_data, VJFrame *frame, VJFrame *frame2, int width, int height, int fresh_rate, int loopnum, int decay, int mode, int threshold )
|
||||
void water_apply(void *user_data, VJFrame *frame, VJFrame *frame2, int fresh_rate,
|
||||
int loopnum, int decay, int mode, int threshold )
|
||||
{
|
||||
int x, y, i;
|
||||
int dx, dy;
|
||||
@@ -621,8 +616,8 @@ void water_apply(void *user_data, VJFrame *frame, VJFrame *frame2, int width, in
|
||||
vp+=2;
|
||||
}
|
||||
|
||||
hi = height;
|
||||
wi = width;
|
||||
hi = frame->height;
|
||||
wi = frame->width;
|
||||
vp = w->vtable;
|
||||
|
||||
for(y=0; y<hi; y+=2) {
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA.
|
||||
*/
|
||||
|
||||
#ifndef RIPPLETV_H
|
||||
#define RIPPLETV_H
|
||||
vj_effect* water_init(int width, int height);
|
||||
int water_malloc(void **d,int w, int h);
|
||||
void water_free(void *d);
|
||||
void water_apply(void *user_data, VJFrame *frame, VJFrame *frame2, int width, int height,int fresh, int loopnum, int decay, int mode, int threshold );
|
||||
#ifndef WATERRIPPLE_H
|
||||
#define WATERRIPPLE_H
|
||||
vj_effect *water_init(int width, int height);
|
||||
int water_malloc(void **d, int width, int height);
|
||||
void water_apply(void *user_data, VJFrame *frame, VJFrame *frame2, int fresh_rate,
|
||||
int loopnum, int decay, int mode, int threshold );
|
||||
void water_free(void *ud);
|
||||
#endif
|
||||
@@ -421,25 +421,17 @@ extern void perspective_apply( VJFrame *frame, int x1, int y1, int x2, int y2,
|
||||
extern void deinterlace_apply(VJFrame *frame, int val);
|
||||
//extern void simplematte_apply(VJFrame *frame, int threshold, int invert);
|
||||
extern void crosspixel_apply(VJFrame *frame,int type, int val);
|
||||
|
||||
extern void color_apply(VJFrame *frame, int w, int h, int a,int b, int c);
|
||||
|
||||
extern void color_apply(VJFrame *frame, int a, int b, int c);
|
||||
//extern void water_apply(VJFrame *frame, int w, int h, int val, int l, int d);
|
||||
extern void water_apply(void *user_data, VJFrame *frame, VJFrame *frame2, int width, int height, int fresh,int loopnum, int decay, int mode, int threshold);
|
||||
|
||||
extern void pencilsketch_apply(VJFrame *frame, int w, int h, int type, int threshold, int opacity, int mode);
|
||||
|
||||
extern void pixelate_apply(VJFrame *frame, int w, int h, int v );
|
||||
|
||||
extern void water_apply(void *user_data, VJFrame *frame, VJFrame *frame2,
|
||||
int fresh,int loopnum, int decay, int mode, int threshold);
|
||||
extern void pencilsketch_apply(VJFrame *frame, int type, int threshold, int opacity, int mode);
|
||||
extern void pixelate_apply(VJFrame *frame, int v );
|
||||
extern void bgpush_apply( VJFrame *frame );
|
||||
|
||||
extern void magicmirror_apply(VJFrame *frame, int w, int h, int x, int y, int d, int n, int alpha );
|
||||
|
||||
extern void lumamask_apply(VJFrame *frame,VJFrame *frame2, int w, int h, int n, int m, int border, int alpha);
|
||||
|
||||
extern void smear_apply(VJFrame *frame, int w, int h, int n, int m);
|
||||
|
||||
extern void raster_apply(VJFrame *frame, int w, int h, int v, int mode);
|
||||
extern void magicmirror_apply(VJFrame *frame, int x, int y, int d, int n, int alpha );
|
||||
extern void lumamask_apply(VJFrame *frame,VJFrame *frame2, int n, int m, int border, int alpha);
|
||||
extern void smear_apply(VJFrame *frame, int n, int m);
|
||||
extern void raster_apply(VJFrame *frame, int v, int mode);
|
||||
|
||||
extern void fisheye_apply(VJFrame *frame, int w, int h, int v, int alpha );
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
#include "effects/sinoids.h"
|
||||
#include "effects/average.h"
|
||||
#include "effects/ripple.h"
|
||||
#include "effects/rippletv.h"
|
||||
#include "effects/water.h"
|
||||
#include "effects/waterrippletv.h"
|
||||
#include "effects/bathroom.h"
|
||||
#include "effects/slicer.h"
|
||||
|
||||
@@ -126,7 +126,7 @@ static void vj_effman_apply_image_effect(
|
||||
waterrippletv_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_PENCILSKETCH:
|
||||
pencilsketch_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3]);
|
||||
pencilsketch_apply(frames[0],arg[0],arg[1],arg[2],arg[3]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_NOISEPENCIL:
|
||||
noisepencil_apply(frames[0], arg[0], arg[1], arg[2], arg[3]);
|
||||
@@ -197,10 +197,10 @@ static void vj_effman_apply_image_effect(
|
||||
mirrors_apply(frames[0], arg[0], arg[1]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_MAGICMIRROR:
|
||||
magicmirror_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3],arg[4]);
|
||||
magicmirror_apply(frames[0],arg[0],arg[1],arg[2],arg[3],arg[4]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_RASTER:
|
||||
raster_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1]);
|
||||
raster_apply(frames[0], arg[0], arg[1]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_SWIRL:
|
||||
swirl_apply(frames[0],frames[0]->width,frames[0]->height,arg[0]);
|
||||
@@ -212,7 +212,7 @@ static void vj_effman_apply_image_effect(
|
||||
fisheye_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_PIXELSMEAR:
|
||||
smear_apply(frames[0], frames[0]->width, frames[0]->height,arg[0],arg[1]);
|
||||
smear_apply(frames[0], arg[0], arg[1]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_UVCORRECT:
|
||||
uvcorrect_apply(frames[0], frames[0]->width, frames[0]->height,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
|
||||
@@ -313,7 +313,7 @@ static void vj_effman_apply_image_effect(
|
||||
dices_apply(vj_effects[entry], frames[0], arg[0]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_COLORTEST:
|
||||
color_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2]);
|
||||
color_apply(frames[0], arg[0], arg[1], arg[2]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_RAWMAN:
|
||||
rawman_apply(frames[0], arg[0], arg[1]);
|
||||
@@ -415,7 +415,7 @@ static void vj_effman_apply_image_effect(
|
||||
alphaselect2_apply(frames[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_PIXELATE:
|
||||
pixelate_apply(frames[0],frames[0]->width,frames[0]->height,arg[0]);
|
||||
pixelate_apply(frames[0],arg[0]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_ALPHANEGATE:
|
||||
alphanegate_apply(frames[0],frames[0]->width,frames[0]->height,arg[0]);
|
||||
@@ -487,7 +487,7 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in
|
||||
simplemask_apply(frames[0], frames[1], arg[0], arg[1]);
|
||||
break;
|
||||
case VJ_VIDEO_EFFECT_LUMAMASK:
|
||||
lumamask_apply(frames[0], frames[1], frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3]);
|
||||
lumamask_apply(frames[0], frames[1], arg[0],arg[1],arg[2],arg[3]);
|
||||
break;
|
||||
case VJ_VIDEO_EFFECT_DISSOLVE:
|
||||
dissolve_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0]);break;
|
||||
@@ -619,7 +619,7 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in
|
||||
arg[0], arg[1], arg[2], arg[3] );
|
||||
break;
|
||||
case VJ_VIDEO_EFFECT_RIPPLETV:
|
||||
water_apply( vj_effects[entry]->user_data,frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3],arg[4] );
|
||||
water_apply( vj_effects[entry]->user_data,frames[0],frames[1],arg[0],arg[1],arg[2],arg[3],arg[4] );
|
||||
|
||||
break;
|
||||
case VJ_VIDEO_EFFECT_RADIOACTIVE:
|
||||
|
||||
Reference in New Issue
Block a user