mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-20 06:40:01 +01:00
safer and faster adding and removing of fx
git-svn-id: svn://code.dyne.org/veejay/trunk@676 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
@@ -23,12 +23,12 @@
|
||||
#include "common.h"
|
||||
vj_effect *average_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = 100;
|
||||
ve->defaults[0] = 1;
|
||||
|
||||
@@ -33,12 +33,12 @@ static uint8_t *bathroom_frame[3];
|
||||
|
||||
vj_effect *bathroom_init(int width,int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 1;
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -56,20 +56,20 @@ vj_effect *bathroom_init(int width,int height)
|
||||
|
||||
int bathroom_malloc(int width, int height)
|
||||
{
|
||||
bathroom_frame[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height);
|
||||
bathroom_frame[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height * 3);
|
||||
if(!bathroom_frame[0]) return 0;
|
||||
bathroom_frame[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height);
|
||||
if(!bathroom_frame[1]) return 0;
|
||||
bathroom_frame[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height);
|
||||
if(!bathroom_frame[2]) return 0;
|
||||
|
||||
bathroom_frame[1] = bathroom_frame[0] + (width * height );
|
||||
bathroom_frame[2] = bathroom_frame[1] + (width * height );
|
||||
return 1;
|
||||
}
|
||||
|
||||
void bathroom_free() {
|
||||
if(bathroom_frame[0]) free(bathroom_frame[0]);
|
||||
if(bathroom_frame[1]) free(bathroom_frame[1]);
|
||||
if(bathroom_frame[2]) free(bathroom_frame[2]);
|
||||
if(bathroom_frame[0])
|
||||
free(bathroom_frame[0]);
|
||||
bathroom_frame[0] = NULL;
|
||||
bathroom_frame[1] = NULL;
|
||||
bathroom_frame[2] = NULL;
|
||||
}
|
||||
|
||||
void bathroom_verti_apply(VJFrame *frame, int width, int height, int val)
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
vj_effect *binaryoverlay_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 0;
|
||||
ve->description = "Binary Overlays";
|
||||
ve->limits[0][0] = 0;
|
||||
|
||||
@@ -78,11 +78,11 @@ static int blob_type_ = 1;
|
||||
|
||||
vj_effect *blob_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = 360; // radius
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -122,12 +122,11 @@ int blob_malloc(int w, int h)
|
||||
blob_ = (uint8_t**) vj_malloc(sizeof(uint8_t*) * blob_dradius_ );
|
||||
for(i = 0; i < blob_dradius_ ; i ++ )
|
||||
{
|
||||
blob_[i] = (uint8_t*) vj_malloc(sizeof(uint8_t) * blob_dradius_ );
|
||||
blob_[i] = (uint8_t*) vj_calloc(sizeof(uint8_t) * blob_dradius_ );
|
||||
if(!blob_[i]) return 0;
|
||||
memset( blob_[i], 0 , blob_dradius_ );
|
||||
}
|
||||
|
||||
blobs_ = (blob_t*) vj_malloc(sizeof(blob_t) * blob_num_ );
|
||||
blobs_ = (blob_t*) vj_calloc(sizeof(blob_t) * blob_num_ );
|
||||
if(!blobs_ ) return 0;
|
||||
|
||||
blob_image_ = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
|
||||
@@ -92,11 +92,11 @@ static int blob_home_radius_= 203;
|
||||
|
||||
vj_effect *boids_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 8;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = w/2; // radius
|
||||
ve->limits[0][1] = 2;
|
||||
@@ -170,14 +170,14 @@ int boids_malloc(int w, int h)
|
||||
blob_ = (uint8_t**) vj_malloc(sizeof(uint8_t*) * blob_dradius_ );
|
||||
for(i = 0; i < blob_dradius_ ; i ++ )
|
||||
{
|
||||
blob_[i] = (uint8_t*) vj_malloc(sizeof(uint8_t) * blob_dradius_ );
|
||||
blob_[i] = (uint8_t*) vj_calloc(sizeof(uint8_t) * blob_dradius_ );
|
||||
if(!blob_[i]) return 0;
|
||||
}
|
||||
|
||||
blobs_ = (blob_t*) vj_malloc(sizeof(blob_t) * blob_num_ );
|
||||
blobs_ = (blob_t*) vj_calloc(sizeof(blob_t) * blob_num_ );
|
||||
if(!blobs_ ) return 0;
|
||||
|
||||
blob_image_ = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
blob_image_ = (uint8_t*) vj_calloc(sizeof(uint8_t) * w * h );
|
||||
if(!blob_image_) return 0;
|
||||
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
vj_effect *borders_init(int width,int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
|
||||
ve->defaults[0] = 41;
|
||||
ve->defaults[1] = 0;
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
vj_effect *bwselect_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 16;
|
||||
ve->defaults[1] = 235;
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *cartonize_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->limits[0][1] = 0;
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
|
||||
vj_effect *chromamagick_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 7;
|
||||
ve->defaults[1] = 150;
|
||||
ve->description = "Chroma Magic";
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
|
||||
vj_effect *chromapalette_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 6;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
//angle,r,g,b,cbc,crc
|
||||
|
||||
ve->limits[0][0] = 1;
|
||||
|
||||
@@ -32,11 +32,11 @@ static VJFrame *_tmp;
|
||||
|
||||
vj_effect *chromascratcher_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 25; /* uses the chromamagick effect for scratchign */
|
||||
ve->limits[0][1] = 0;
|
||||
@@ -62,27 +62,24 @@ vj_effect *chromascratcher_init(int w, int h)
|
||||
int chromascratcher_malloc(int w, int h)
|
||||
{
|
||||
cframe[0] =
|
||||
(uint8_t *) vj_malloc(w * h * sizeof(uint8_t) * 25 );
|
||||
(uint8_t *) vj_malloc(w * h * sizeof(uint8_t) * 25 * 3 );
|
||||
if(!cframe[0]) return 0;
|
||||
memset( cframe[0], 16, w * h * 25);
|
||||
cframe[1] =
|
||||
(uint8_t *) vj_malloc(w * h * sizeof(uint8_t) * 25 );
|
||||
if(!cframe[1]) return 0;
|
||||
memset( cframe[1], 128, w * h * 25);
|
||||
cframe[2] =
|
||||
(uint8_t *) vj_malloc(w * h * sizeof(uint8_t) * 25);
|
||||
if(!cframe[2]) return 0;
|
||||
memset( cframe[2], 128, w * h * 25);
|
||||
_tmp = (VJFrame*) vj_calloc(sizeof(VJFrame));
|
||||
|
||||
cframe[1] = cframe[0] + ( w * h * 25 );
|
||||
cframe[2] = cframe[1] + ( w * h * 25 );
|
||||
|
||||
_tmp = (VJFrame*) vj_malloc(sizeof(VJFrame));
|
||||
return 1;
|
||||
}
|
||||
|
||||
void chromascratcher_free() {
|
||||
if(cframe[0]) free(cframe[0]);
|
||||
if(cframe[1]) free(cframe[1]);
|
||||
if(cframe[2]) free(cframe[2]);
|
||||
if(cframe[0])
|
||||
free(cframe[0]);
|
||||
if(_tmp) free(_tmp);
|
||||
cframe[0] = NULL;
|
||||
cframe[1] = NULL;
|
||||
cframe[2] = NULL;
|
||||
_tmp = NULL;
|
||||
}
|
||||
|
||||
void chromastore_frame(uint8_t * yuv1[3], int w, int h, int n,
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
|
||||
vj_effect *chromium_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 3;
|
||||
ve->defaults[0] = 0;
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include <stdlib.h>
|
||||
vj_effect *color_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 150;
|
||||
ve->defaults[1] = 150;
|
||||
ve->defaults[2] = 150;
|
||||
|
||||
@@ -25,18 +25,25 @@
|
||||
#include "common.h"
|
||||
vj_effect *coloradjust_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = -235;
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
/* ve->limits[0][0] = -235;
|
||||
ve->limits[1][0] = 235;
|
||||
ve->limits[0][1] = 0;
|
||||
ve->limits[1][1] = 36000;
|
||||
ve->defaults[0] = 116;
|
||||
ve->defaults[1] = 4500;
|
||||
ve->description = "Saturation";
|
||||
ve->defaults[1] = 4500;*/
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 360;
|
||||
ve->limits[0][1] = 0;
|
||||
ve->limits[1][1] = 256;
|
||||
ve->defaults[0] = 50;
|
||||
ve->defaults[1] = 50;
|
||||
|
||||
ve->description = "Hue and Saturation";
|
||||
ve->extra_frame = 0;
|
||||
ve->sub_format = 0;
|
||||
ve->has_user = 0;
|
||||
@@ -74,8 +81,31 @@ void coloradjust_apply(VJFrame *frame, int width, int height, int val,
|
||||
const int len = frame->uv_len;
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
//@ Hue, Saturation, copied from AVIDEMUX!
|
||||
//@ the commented out version is the same as the optimized version (?)
|
||||
//
|
||||
|
||||
int cb, cr;
|
||||
float hue = (float) ( (val/180.0) * M_PI);
|
||||
float sat = (float) ( _degrees * 0.01 );
|
||||
|
||||
const int s = (int) rint( sin(hue) * (1<<16) * sat );
|
||||
const int c = (int) rint( cos(hue) * (1<<16) * sat );
|
||||
|
||||
for( i = 0 ; i < len ;i ++ )
|
||||
{
|
||||
const int u = Cb[i] - 128;
|
||||
const int v = Cr[i] - 128;
|
||||
int new_u = (c * u - s * v + (1<<15) + (128<<16)) >> 16;
|
||||
int new_v = (s * u + c * v + (1<<15) + (128<<16)) >> 16;
|
||||
if( new_u & 768 ) new_u = (-new_u) >> 31;
|
||||
if( new_v & 768 ) new_v = (-new_v) >> 31;
|
||||
|
||||
Cb[i] = new_u;
|
||||
Cr[i] = new_v;
|
||||
}
|
||||
|
||||
|
||||
/* int cb, cr;
|
||||
double dsaturation, dcolor;
|
||||
const double degrees = (_degrees / 100.0);
|
||||
double co, si;
|
||||
@@ -99,6 +129,6 @@ void coloradjust_apply(VJFrame *frame, int width, int height, int val,
|
||||
Cr[i] = co * dsaturation + 128;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
void coloradjust_free(){}
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
vj_effect *colorshift_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 5;
|
||||
ve->defaults[1] = 235;
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
vj_effect *complexinvert_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 5;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 300; /* angle */
|
||||
ve->defaults[1] = 255; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
vj_effect *complexopacity_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 5;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 80; /* angle */
|
||||
ve->defaults[1] = 0; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
|
||||
@@ -29,17 +29,17 @@
|
||||
vj_effect *complexsaturation_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 7;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 300; /* angle */
|
||||
ve->defaults[1] = 255; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
ve->defaults[3] = 0; /* b */
|
||||
ve->defaults[4] = -46; /* v_adjust */
|
||||
ve->defaults[5] = 26000; /* degrees */
|
||||
ve->defaults[4] = 50; /* v_adjust */
|
||||
ve->defaults[5] = 50; /* degrees */
|
||||
ve->defaults[6] = 2400; /* noise suppression */
|
||||
ve->limits[0][0] = 5;
|
||||
ve->limits[1][0] = 900;
|
||||
@@ -53,11 +53,11 @@ vj_effect *complexsaturation_init(int w, int h)
|
||||
ve->limits[0][3] = 0;
|
||||
ve->limits[1][3] = 255;
|
||||
|
||||
ve->limits[0][4] = -300;
|
||||
ve->limits[1][4] = 300;
|
||||
ve->limits[0][4] = 0;
|
||||
ve->limits[1][4] = 360;
|
||||
|
||||
ve->limits[0][5] = 1;
|
||||
ve->limits[1][5] = 36000;
|
||||
ve->limits[0][5] = 0;
|
||||
ve->limits[1][5] = 256;
|
||||
|
||||
ve->limits[0][6] = 0;
|
||||
ve->limits[1][6] = 3500;
|
||||
@@ -74,8 +74,13 @@ void complexsaturation_apply(VJFrame *frame, int width,
|
||||
int b, int adjust_v, int adjust_degrees, int i_noise)
|
||||
{
|
||||
double dsaturation,dcolor;
|
||||
double degrees = adjust_degrees * 0.01;
|
||||
double dsat = adjust_v * 0.01;
|
||||
// double degrees = adjust_degrees * 0.01;
|
||||
// double dsat = adjust_v * 0.01;
|
||||
|
||||
|
||||
float hue = (adjust_degrees/180.0)*M_PI;
|
||||
float sat = (adjust_v * 0.01);
|
||||
|
||||
uint8_t *fg_y, *fg_cb, *fg_cr;
|
||||
uint8_t *bg_y, *bg_cb, *bg_cr;
|
||||
int accept_angle_tg, accept_angle_ctg, one_over_kc;
|
||||
@@ -120,7 +125,8 @@ void complexsaturation_apply(VJFrame *frame, int width,
|
||||
bg_y = frame->data[0];
|
||||
bg_cb = frame->data[1];
|
||||
bg_cr = frame->data[2];
|
||||
|
||||
const int s = (int) rint( sin(hue) * (1<<16) * sat );
|
||||
const int c = (int) rint( cos(hue) * (1<<16) * sat );
|
||||
for (pos = 0; pos < frame->len; pos++)
|
||||
{
|
||||
short xx, yy;
|
||||
@@ -191,7 +197,7 @@ void complexsaturation_apply(VJFrame *frame, int width,
|
||||
int _cr = Cr[pos] - 128;
|
||||
if( _cb != 0 && _cr != 0)
|
||||
{
|
||||
double co=0.0,si=0.0;
|
||||
/* double co=0.0,si=0.0;
|
||||
//fast_sqrt( dsaturation, (double) (_cb * cr + _cr * _cr) );
|
||||
dsaturation = ccolor_sqrt( (double) _cb, (double) _cr);
|
||||
dcolor = ccolor_sine( _cb, dsaturation);
|
||||
@@ -202,7 +208,21 @@ void complexsaturation_apply(VJFrame *frame, int width,
|
||||
dsaturation *= dsat;
|
||||
sin_cos( co, si , dcolor );
|
||||
Cb[pos] = si * dsaturation + 128;
|
||||
Cr[pos] = co * dsaturation + 128;
|
||||
const int u = Cb[i] - 128;
|
||||
const int v = Cr[i] - 128;
|
||||
int new_u = (c * u - s * v + (1<<15) + (128<<16)) >> 16;
|
||||
int new_v = (s * u + c * v + (1<<15) + (128<<16)) >> 16;
|
||||
if( new_u & 768 ) new_u = (-new_u) >> 31;
|
||||
if( new_v & 768 ) new_v = (-new_v) >> 31;
|
||||
Cr[pos] = co * dsaturation + 128;*/
|
||||
const int u = Cb[pos] - 128;
|
||||
const int v = Cr[pos] - 128;
|
||||
int new_u = (c * u - s * v + (1<<15) + (128<<16)) >> 16;
|
||||
int new_v = (s * u + c * v + (1<<15) + (128<<16)) >> 16;
|
||||
if( new_u & 768 ) new_u = (-new_u) >> 31;
|
||||
if( new_v & 768 ) new_v = (-new_v) >> 31;
|
||||
Cb[pos] = new_u;
|
||||
Cr[pos] = new_v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ static uint8_t *c_outofsync_buffer[3];
|
||||
|
||||
vj_effect *complexsync_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = height-1;
|
||||
ve->limits[0][1] = 0;
|
||||
@@ -49,23 +49,19 @@ vj_effect *complexsync_init(int width, int height)
|
||||
|
||||
int complexsync_malloc(int width, int height)
|
||||
{
|
||||
c_outofsync_buffer[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height );
|
||||
memset( c_outofsync_buffer[0], 16, (width*height));
|
||||
if(!c_outofsync_buffer[0]) return 0;
|
||||
c_outofsync_buffer[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * (width * height) );
|
||||
memset( c_outofsync_buffer[1], 128, (width*height));
|
||||
if(!c_outofsync_buffer[1]) return 0;
|
||||
c_outofsync_buffer[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * (width * height) );
|
||||
memset( c_outofsync_buffer[2], 128, (width*height));
|
||||
if(!c_outofsync_buffer[2]) return 0;
|
||||
c_outofsync_buffer[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height * 3 );
|
||||
c_outofsync_buffer[1] = c_outofsync_buffer[0] + (width * height );
|
||||
c_outofsync_buffer[2] = c_outofsync_buffer[1] + ( width * height );
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
void complexsync_free() {
|
||||
if(c_outofsync_buffer[0]) free(c_outofsync_buffer[0]);
|
||||
if(c_outofsync_buffer[1]) free(c_outofsync_buffer[1]);
|
||||
if(c_outofsync_buffer[2]) free(c_outofsync_buffer[2]);
|
||||
if(c_outofsync_buffer[0])
|
||||
free(c_outofsync_buffer[0]);
|
||||
c_outofsync_buffer[0] = NULL;
|
||||
c_outofsync_buffer[1] = NULL;
|
||||
c_outofsync_buffer[2] = NULL;
|
||||
}
|
||||
void complexsync_apply(VJFrame *frame, VJFrame *frame2, int width, int height, int val)
|
||||
{
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
vj_effect *complexthreshold_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 6;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 80; /* angle */
|
||||
ve->defaults[1] = 0; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
#include "common.h"
|
||||
vj_effect *constantblend_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 31;
|
||||
ve->limits[0][1] = 0; // scale from 0.0 to 5.0 (only luma)
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include "common.h"
|
||||
vj_effect *contrast_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults[0] = 2; /* type */
|
||||
ve->defaults[1] = 125;
|
||||
ve->defaults[2] = 200;
|
||||
|
||||
@@ -26,12 +26,12 @@ static uint8_t *cross_pixels[3];
|
||||
|
||||
vj_effect *crosspixel_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 1;
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -48,20 +48,18 @@ vj_effect *crosspixel_init(int w, int h)
|
||||
|
||||
int crosspixel_malloc(int w, int h)
|
||||
{
|
||||
cross_pixels[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h);
|
||||
if(!cross_pixels[0]) return 0;
|
||||
cross_pixels[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w *h);
|
||||
if(!cross_pixels[1]) return 0;
|
||||
cross_pixels[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h);
|
||||
if(!cross_pixels[2]) return 0;
|
||||
|
||||
cross_pixels[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h * 3);
|
||||
cross_pixels[1] = cross_pixels[0] + (w * h );
|
||||
cross_pixels[2] = cross_pixels[1] + (w * h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void crosspixel_free() {
|
||||
if(cross_pixels[0]) free(cross_pixels[0]);
|
||||
if(cross_pixels[1]) free(cross_pixels[1]);
|
||||
if(cross_pixels[2]) free(cross_pixels[2]);
|
||||
if(cross_pixels[0])
|
||||
free(cross_pixels[0]);
|
||||
cross_pixels[0] = NULL;
|
||||
cross_pixels[1] = NULL;
|
||||
cross_pixels[2] = NULL;
|
||||
}
|
||||
|
||||
void crosspixel_apply(VJFrame *frame, int w, int h, int t,int v) {
|
||||
|
||||
@@ -32,11 +32,11 @@ static unsigned int frq_cnt;
|
||||
|
||||
vj_effect *cutstop_init(int width , int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 40; // treshold
|
||||
ve->defaults[1] = 50; // hold frame freq
|
||||
ve->defaults[2] = 0; // cut mode
|
||||
@@ -66,19 +66,18 @@ vj_effect *cutstop_init(int width , int height)
|
||||
|
||||
int cutstop_malloc(int width, int height)
|
||||
{
|
||||
vvcutstop_buffer[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height );
|
||||
if(!vvcutstop_buffer[0]) return 0;
|
||||
vvcutstop_buffer[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height );
|
||||
if(!vvcutstop_buffer[1]) return 0;
|
||||
vvcutstop_buffer[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height );
|
||||
if(!vvcutstop_buffer[2]) return 0;
|
||||
vvcutstop_buffer[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height * 3);
|
||||
vvcutstop_buffer[1] = vvcutstop_buffer[0] + (width * height );
|
||||
vvcutstop_buffer[2] = vvcutstop_buffer[1] + (width * height );
|
||||
return 1;
|
||||
}
|
||||
|
||||
void cutstop_free() {
|
||||
if(vvcutstop_buffer[0]) free(vvcutstop_buffer[0]);
|
||||
if(vvcutstop_buffer[1]) free(vvcutstop_buffer[1]);
|
||||
if(vvcutstop_buffer[2]) free(vvcutstop_buffer[2]);
|
||||
if(vvcutstop_buffer[0])
|
||||
free(vvcutstop_buffer[0]);
|
||||
vvcutstop_buffer[0] = NULL;
|
||||
vvcutstop_buffer[1] = NULL;
|
||||
vvcutstop_buffer[2] = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
vj_effect *deinterlace_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->defaults[0] = 0;
|
||||
|
||||
@@ -50,11 +50,11 @@ typedef enum _dice_dir {
|
||||
vj_effect *dices_init(int width, int height)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 4;
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 5;
|
||||
@@ -62,7 +62,7 @@ vj_effect *dices_init(int width, int height)
|
||||
ve->sub_format = 1;
|
||||
ve->extra_frame = 0;
|
||||
ve->has_user = 0;
|
||||
g_dicemap = (uint8_t *) vj_malloc(sizeof(uint8_t) * width * height);
|
||||
g_dicemap = (uint8_t *) vj_calloc(sizeof(uint8_t) * width * height);
|
||||
dice_create_map(width, height);
|
||||
return ve;
|
||||
}
|
||||
@@ -76,7 +76,9 @@ int dices_malloc(int width, int height)
|
||||
}
|
||||
|
||||
void dices_free() {
|
||||
if(g_dicemap) free(g_dicemap);
|
||||
if(g_dicemap)
|
||||
free(g_dicemap);
|
||||
g_dicemap = NULL;
|
||||
}
|
||||
|
||||
unsigned int dices_fastrand_val;
|
||||
@@ -166,6 +168,16 @@ void dices_apply( void* data, VJFrame *frame, int width, int height,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Up:
|
||||
for( dy = 0; dy < g_cube_size ; dy ++ )
|
||||
{
|
||||
i = base + dy * width;
|
||||
for( dx = 0; dx < g_cube_size ; dx ++ )
|
||||
{
|
||||
Y[di] = Y[i]; Cb[di] = Cb[i]; Cr[di] = Cr[i]; i ++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
map_i++;
|
||||
}
|
||||
|
||||
@@ -34,11 +34,11 @@ typedef struct
|
||||
vj_effect *diff_init(int width, int height)
|
||||
{
|
||||
//int i,j;
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 9;
|
||||
ve->limits[0][1] = 0; /* threshold min */
|
||||
@@ -65,14 +65,12 @@ int diff_malloc(void **d, int width, int height)
|
||||
{
|
||||
int i;
|
||||
diff_data *my;
|
||||
*d = (void*) vj_malloc(sizeof(diff_data));
|
||||
*d = (void*) vj_calloc(sizeof(diff_data));
|
||||
my = (diff_data*) *d;
|
||||
my->static_bg[0] = (uint8_t*) vj_malloc(sizeof(uint8_t)* width * height);
|
||||
memset( my->static_bg[0], 0 , (width*height));
|
||||
my->data = (uint8_t*) vj_malloc(sizeof(uint8_t) * width * height );
|
||||
memset(my->data, 0, width * height);
|
||||
my->static_bg[0] = (uint8_t*) vj_calloc(sizeof(uint8_t)* width * height);
|
||||
my->data = (uint8_t*) vj_calloc(sizeof(uint8_t) * width * height );
|
||||
for(i=0; i < 256; i ++)
|
||||
my->sqrt_table[i] = (double*)vj_malloc(sizeof(double)* 256);
|
||||
my->sqrt_table[i] = (double*)vj_calloc(sizeof(double)* 256);
|
||||
|
||||
my->has_bg = 0;
|
||||
return 1;
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
vj_effect *diffimg_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults[0] = 6;/* type */
|
||||
ve->defaults[1] = 15; /* min */
|
||||
ve->defaults[2] = 235; /* max */
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
|
||||
vj_effect *dissolve_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->defaults[0] = 150;
|
||||
|
||||
@@ -31,19 +31,19 @@ static int plasma_pos2 = 0;
|
||||
|
||||
vj_effect *distortion_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
int i;
|
||||
float rad;
|
||||
plasma_table = (int *) vj_malloc(sizeof(int) * 512);
|
||||
plasma_table = (int *) vj_calloc(sizeof(int) * 512);
|
||||
for (i = 0; i < 512; i++) {
|
||||
rad = ((float) i * 0.703125) * 0.0174532;
|
||||
plasma_table[i] = sin(rad) * (1024);
|
||||
}
|
||||
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 5;
|
||||
ve->defaults[1] = 3;
|
||||
ve->limits[0][0] = 0;
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include <stdlib.h>
|
||||
vj_effect *dither_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 2;
|
||||
ve->defaults[1] = 0;
|
||||
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
vj_effect *dummy_init(int w, int h)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
/*
|
||||
ve->param_description = (char**)vj_malloc(sizeof(char)* ve->num_params);
|
||||
ve->param_description = (char**)vj_calloc(sizeof(char)* ve->num_params);
|
||||
for(i=0; i < ve->num_params; i++) {
|
||||
ve->param_description[i] = (char*)vj_malloc(sizeof(char) * 100);
|
||||
ve->param_description[i] = (char*)vj_calloc(sizeof(char) * 100);
|
||||
}
|
||||
sprintf(ve->param_description[0], "Static color");
|
||||
*/
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
|
||||
vj_effect *dupmagic_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 5;
|
||||
ve->description = "Strong Luma Overlay";
|
||||
ve->limits[0][0] = 1;
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
#include "common.h"
|
||||
vj_effect *emboss_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 10;
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 10;
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
#include "common.h"
|
||||
vj_effect *enhancemask_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults[0] = 125; /* type */
|
||||
// ve->defaults[1] = 255; /* yuvdenoise's default sharpen parameter */
|
||||
ve->limits[0][0] = 0;
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
vj_effect *fibdownscale_init(int w, int h)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->description = "Fibonacci Downscaler";
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 0;
|
||||
ve->defaults[1] = 1;
|
||||
ve->limits[0][0] = 0;
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
#include <math.h>
|
||||
vj_effect *fisheye_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = -1000;
|
||||
ve->limits[1][0] = 1000;
|
||||
ve->defaults[0] = 1;
|
||||
@@ -55,21 +55,18 @@ int fisheye_malloc(int w, int h)
|
||||
int w2=w/2;
|
||||
int p =0;
|
||||
|
||||
buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!buf[0]) return -1;
|
||||
buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!buf[1]) return -1;
|
||||
buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * 3 );
|
||||
if(!buf[0]) return 0;
|
||||
buf[1] = buf[0] + (w*h);
|
||||
buf[2] = buf[1] + (w*h);
|
||||
|
||||
buf[2] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!buf[2]) return -1;
|
||||
polar_map = (double*) vj_calloc(sizeof(double) * w* h );
|
||||
if(!polar_map) return 0;
|
||||
fish_angle = (double*) vj_calloc(sizeof(double) * w* h );
|
||||
if(!fish_angle) return 0;
|
||||
|
||||
polar_map = (double*) vj_malloc(sizeof(double) * w* h );
|
||||
if(!polar_map) return -1;
|
||||
fish_angle = (double*) vj_malloc(sizeof(double) * w* h );
|
||||
if(!fish_angle) return -1;
|
||||
|
||||
cached_coords = (int*) vj_malloc(sizeof(int) * w * h);
|
||||
if(!cached_coords) return -1;
|
||||
cached_coords = (int*) vj_calloc(sizeof(int) * w * h);
|
||||
if(!cached_coords) return 0;
|
||||
|
||||
for(y=(-1 *h2); y < (h-h2); y++)
|
||||
{
|
||||
@@ -89,9 +86,11 @@ int fisheye_malloc(int w, int h)
|
||||
|
||||
void fisheye_free()
|
||||
{
|
||||
if(buf[0]) free(buf[0]);
|
||||
if(buf[1]) free(buf[1]);
|
||||
if(buf[2]) free(buf[2]);
|
||||
if(buf[0])
|
||||
free(buf[0]);
|
||||
buf[0] = NULL;
|
||||
buf[1] = NULL;
|
||||
buf[2] = NULL;
|
||||
|
||||
if(polar_map) free(polar_map);
|
||||
if(fish_angle) free(fish_angle);
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
|
||||
vj_effect *flare_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 3;
|
||||
ve->defaults[1] = 25;
|
||||
ve->defaults[2] = 100;
|
||||
@@ -59,15 +59,11 @@ static uint8_t *flare_buf[3];
|
||||
|
||||
int flare_malloc(int w, int h)
|
||||
{
|
||||
flare_buf[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h );
|
||||
flare_buf[0] = (uint8_t*)vj_calloc(sizeof(uint8_t) * w * h * 3 );
|
||||
if(!flare_buf[0])
|
||||
return 0;
|
||||
flare_buf[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!flare_buf[1])
|
||||
return 0;
|
||||
flare_buf[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!flare_buf[2])
|
||||
return 0;
|
||||
flare_buf[1] = flare_buf[0] + (w*h);
|
||||
flare_buf[2] = flare_buf[1] + (w*h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -75,9 +71,7 @@ void flare_free(void)
|
||||
{
|
||||
if(flare_buf[0]) free(flare_buf[0]);
|
||||
flare_buf[0] = NULL;
|
||||
if(flare_buf[1]) free(flare_buf[1]);
|
||||
flare_buf[1] = NULL;
|
||||
if(flare_buf[2]) free(flare_buf[2]);
|
||||
flare_buf[2] = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
vj_effect *flip_init(int w, int h)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 0;
|
||||
|
||||
ve->limits[0][0] = 0;
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
vj_effect *frameborder_init(int width, int height)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = width/8;
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = height / 2;
|
||||
|
||||
@@ -27,11 +27,11 @@ static uint8_t table[256];
|
||||
|
||||
vj_effect *gamma_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 124;
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 500;
|
||||
|
||||
@@ -30,11 +30,11 @@ static int diff_period;
|
||||
|
||||
vj_effect *ghost_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 16;
|
||||
ve->limits[1][0] = 255; // opacity
|
||||
ve->defaults[0] = 134;
|
||||
@@ -58,8 +58,7 @@ int ghost_malloc(int w, int h)
|
||||
return 0;
|
||||
memset( ghost_buf[i], (i ==0 ? 0: 128), len );
|
||||
}
|
||||
diff_map = (uint8_t*) vj_malloc( sizeof(uint8_t) * len);
|
||||
memset( diff_map , 0, len );
|
||||
diff_map = (uint8_t*) vj_calloc( sizeof(uint8_t) * len);
|
||||
diff_period = 0;
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
vj_effect *greyselect_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 300; /* angle */
|
||||
ve->defaults[1] = 255; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
vj_effect *isolate_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 5;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 300; /* angle */
|
||||
ve->defaults[1] = 255; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
vj_effect *keyselect_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 6;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 300; /* angle */
|
||||
ve->defaults[1] = 255; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
vj_effect *killchroma_init(int w, int h)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->sub_format = 0;
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 2;
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
|
||||
vj_effect *lumablend_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0; /* type */
|
||||
ve->limits[1][0] = 2;
|
||||
ve->limits[0][1] = 0; /* threshold 1 */
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
|
||||
vj_effect *lumakey_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 5;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0; /* feather */
|
||||
ve->limits[1][0] = 255;
|
||||
ve->limits[0][1] = 0; /* threshold min */
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
vj_effect *lumamagick_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
//ve->param_description = (char**)vj_malloc(sizeof(char)* ve->num_params);
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
//ve->param_description = (char**)vj_calloc(sizeof(char)* ve->num_params);
|
||||
ve->defaults[0] = 1;
|
||||
ve->defaults[1] = 100;
|
||||
ve->defaults[2] = 100;
|
||||
|
||||
@@ -38,11 +38,11 @@ static uint8_t *buf[3] = { NULL,NULL,NULL };
|
||||
|
||||
vj_effect *lumamask_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = width;
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -60,12 +60,10 @@ vj_effect *lumamask_init(int width, int height)
|
||||
|
||||
int lumamask_malloc(int width, int height)
|
||||
{
|
||||
buf[0] = (uint8_t*)vj_malloc(sizeof(uint8_t)*width*height);
|
||||
buf[0] = (uint8_t*)vj_calloc(sizeof(uint8_t)*width*height*3);
|
||||
if(!buf[0]) return 0;
|
||||
buf[1] = (uint8_t*)vj_malloc(sizeof(uint8_t)*width*height);
|
||||
if(!buf[1]) return 0;
|
||||
buf[2] = (uint8_t*)vj_malloc(sizeof(uint8_t)*width*height);
|
||||
if(!buf[2]) return 0;
|
||||
buf[1] = buf[0] + (width *height);
|
||||
buf[2] = buf[1] + (width *height);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -116,8 +114,6 @@ void lumamask_apply( VJFrame *frame, VJFrame *frame2, int width,
|
||||
void lumamask_free()
|
||||
{
|
||||
if(buf[0]) free(buf[0]);
|
||||
if(buf[1]) free(buf[1]);
|
||||
if(buf[2]) free(buf[2]);
|
||||
buf[0] = NULL;
|
||||
buf[1] = NULL;
|
||||
buf[2] = NULL;
|
||||
|
||||
@@ -32,11 +32,11 @@ static unsigned int last[2] = {0,0};
|
||||
|
||||
vj_effect *magicmirror_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
|
||||
ve->defaults[0] = 76;
|
||||
ve->defaults[1] = 3;
|
||||
@@ -64,33 +64,25 @@ vj_effect *magicmirror_init(int w, int h)
|
||||
int magicmirror_malloc(int w, int h)
|
||||
{
|
||||
unsigned int i;
|
||||
magicmirrorbuf[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h );
|
||||
magicmirrorbuf[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h * 3);
|
||||
if(!magicmirrorbuf[0]) return 0;
|
||||
magicmirrorbuf[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!magicmirrorbuf[1]) return 0;
|
||||
magicmirrorbuf[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!magicmirrorbuf[2]) return 0;
|
||||
magicmirrorbuf[1] = magicmirrorbuf[0] + (w*h);
|
||||
magicmirrorbuf[2] = magicmirrorbuf[1] + (w*h);
|
||||
|
||||
funhouse_x = (double*)vj_malloc(sizeof(double) * w );
|
||||
funhouse_x = (double*)vj_calloc(sizeof(double) * w );
|
||||
if(!funhouse_x) return 0;
|
||||
|
||||
cache_x = (unsigned int *)vj_malloc(sizeof(unsigned int)*w);
|
||||
cache_x = (unsigned int *)vj_calloc(sizeof(unsigned int)*w);
|
||||
if(!cache_x) return 0;
|
||||
|
||||
funhouse_y = (double*)vj_malloc(sizeof(double) * h );
|
||||
funhouse_y = (double*)vj_calloc(sizeof(double) * h );
|
||||
if(!funhouse_y) return 0;
|
||||
|
||||
cache_y = (unsigned int*)vj_malloc(sizeof(unsigned int)*h);
|
||||
cache_y = (unsigned int*)vj_calloc(sizeof(unsigned int)*h);
|
||||
if(!cache_y) return 0;
|
||||
memset(cache_x,0,w);
|
||||
memset(cache_y,0,h);
|
||||
|
||||
for ( i = 0; i < h ; i ++ )
|
||||
funhouse_y[i] = 0.0;
|
||||
|
||||
for ( i = 0; i < w; i ++ )
|
||||
funhouse_x[i] = 0.0;
|
||||
|
||||
memset(magicmirrorbuf[0],16,w*h);
|
||||
memset(magicmirrorbuf[1],128,w*h);
|
||||
memset(magicmirrorbuf[2],128,w*h);
|
||||
@@ -100,12 +92,17 @@ int magicmirror_malloc(int w, int h)
|
||||
void magicmirror_free()
|
||||
{
|
||||
if(magicmirrorbuf[0]) free(magicmirrorbuf[0]);
|
||||
if(magicmirrorbuf[1]) free(magicmirrorbuf[1]);
|
||||
if(magicmirrorbuf[2]) free(magicmirrorbuf[2]);
|
||||
if(funhouse_x) free(funhouse_x);
|
||||
if(funhouse_y) free(funhouse_y);
|
||||
if(cache_x) free(cache_x);
|
||||
if(cache_y) free(cache_y);
|
||||
magicmirrorbuf[0] = NULL;
|
||||
magicmirrorbuf[1] = NULL;
|
||||
magicmirrorbuf[2] = NULL;
|
||||
cache_x = NULL;
|
||||
cache_y = NULL;
|
||||
funhouse_x = NULL;
|
||||
funhouse_y = NULL;
|
||||
}
|
||||
|
||||
void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int n )
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
#include "common.h"
|
||||
vj_effect *overlaymagic_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 7;
|
||||
ve->description = "Overlay Magic";
|
||||
ve->limits[0][0] = 1;
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *photoplay_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2; // divider
|
||||
ve->limits[1][0] = max_power(w);
|
||||
ve->limits[0][1] = 0;
|
||||
|
||||
@@ -28,11 +28,11 @@ static int m_reverse = 0;
|
||||
vj_effect *magicscratcher_init(int w, int h)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 9;
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -52,7 +52,7 @@ vj_effect *magicscratcher_init(int w, int h)
|
||||
int magicscratcher_malloc(int w, int h)
|
||||
{
|
||||
mframe =
|
||||
(uint8_t *) vj_malloc(w * h * sizeof(uint8_t) * MAX_SCRATCH_FRAMES);
|
||||
(uint8_t *) vj_calloc(w * h * sizeof(uint8_t) * MAX_SCRATCH_FRAMES);
|
||||
memset(mframe, 0, w * h * MAX_SCRATCH_FRAMES );
|
||||
if(!mframe) return 0;
|
||||
return 1;
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
|
||||
vj_effect *simplemask_init(int w, int h )
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->limits[0][1] = 0;
|
||||
|
||||
@@ -33,11 +33,11 @@ static unsigned int frq_mask;
|
||||
|
||||
vj_effect *maskstop_init(int width , int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 0; // negate mask
|
||||
ve->defaults[1] = 0; // swap mask/frame
|
||||
ve->defaults[2] = 80; // hold frame freq
|
||||
@@ -69,19 +69,19 @@ vj_effect *maskstop_init(int width , int height)
|
||||
int maskstop_malloc(int width, int height)
|
||||
{
|
||||
int i;
|
||||
for( i = 0; i < 6; i ++ )
|
||||
{
|
||||
vvmaskstop_buffer[i] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height );
|
||||
if(!vvmaskstop_buffer[i]) return 0;
|
||||
}
|
||||
vvmaskstop_buffer[0] = (uint8_t*) vj_malloc( sizeof(uint8_t) * width * height * 6 );
|
||||
for( i = 1; i < 6; i ++ )
|
||||
vvmaskstop_buffer[i] = vvmaskstop_buffer[(i-1)] + (width * height);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void maskstop_free() {
|
||||
if(vvmaskstop_buffer[0])
|
||||
free(vvmaskstop_buffer[0]);
|
||||
int i;
|
||||
for(i = 0 ;i < 6 ; i++)
|
||||
if(vvmaskstop_buffer[i]) free(vvmaskstop_buffer[i]);
|
||||
vvmaskstop_buffer[i] = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
vj_effect *mirrors_init(int width,int height)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 1;
|
||||
ve->defaults[1] = 1;
|
||||
ve->limits[0][0] = 0; /* horizontal or vertical mirror */
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
vj_effect *mirrors2_init(int w, int h)
|
||||
{
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 4;
|
||||
ve->limits[0][0] = 0; /* horizontal or vertical mirror */
|
||||
ve->limits[1][0] = 5;
|
||||
|
||||
@@ -25,12 +25,12 @@ typedef uint8_t (*morph_func)(uint8_t *kernel, uint8_t mt[9] );
|
||||
|
||||
vj_effect *morphology_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0; // threshold
|
||||
ve->limits[1][0] = 255;
|
||||
ve->limits[0][1] = 0; // morpology operator (dilate,erode, ... )
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
static uint8_t *previous_frame[3];
|
||||
vj_effect *motionblur_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 15;
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 1000; /* time in frames */
|
||||
@@ -42,20 +42,19 @@ vj_effect *motionblur_init(int width, int height)
|
||||
|
||||
int motionblur_malloc(int width, int height)
|
||||
{
|
||||
previous_frame[0] = (uint8_t*) vj_malloc( width * height * sizeof(uint8_t));
|
||||
previous_frame[0] = (uint8_t*) vj_calloc( width * height * 3 * sizeof(uint8_t));
|
||||
if(!previous_frame[0]) return 0;
|
||||
previous_frame[1] = (uint8_t*) vj_malloc( width * height * sizeof(uint8_t));
|
||||
if(!previous_frame[1]) return 0;
|
||||
previous_frame[2] = (uint8_t*) vj_malloc( width * height * sizeof(uint8_t));
|
||||
if(!previous_frame[2]) return 0;
|
||||
|
||||
previous_frame[1] = previous_frame[0] + (width * height);
|
||||
previous_frame[2] = previous_frame[1] + (width * height);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void motionblur_free() {
|
||||
if(previous_frame[0]) free(previous_frame[0]);
|
||||
if(previous_frame[1]) free(previous_frame[1]);
|
||||
if(previous_frame[2]) free(previous_frame[2]);
|
||||
if(previous_frame[0])
|
||||
free(previous_frame[0]);
|
||||
previous_frame[0] = NULL;
|
||||
previous_frame[1] = NULL;
|
||||
previous_frame[2] = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,11 +29,11 @@ static int mtrace_counter = 0;
|
||||
|
||||
vj_effect *mtracer_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 30;
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -49,18 +49,16 @@ vj_effect *mtracer_init(int w, int h)
|
||||
// FIXME private
|
||||
void mtracer_free() {
|
||||
if(mtrace_buffer[0]) free(mtrace_buffer[0]);
|
||||
if(mtrace_buffer[1]) free(mtrace_buffer[1]);
|
||||
if(mtrace_buffer[2]) free(mtrace_buffer[2]);
|
||||
mtrace_buffer[0] = NULL;
|
||||
mtrace_buffer[1] = NULL;
|
||||
}
|
||||
|
||||
int mtracer_malloc(int w, int h)
|
||||
{
|
||||
mtrace_buffer[0] = (uint8_t *) vj_malloc(w * h * sizeof(uint8_t));
|
||||
mtrace_buffer[0] = (uint8_t *) vj_malloc(w * h * 3 * sizeof(uint8_t));
|
||||
if(!mtrace_buffer[0]) return 0;
|
||||
mtrace_buffer[1] = (uint8_t *) vj_malloc(w * h * sizeof(uint8_t));
|
||||
if(!mtrace_buffer[1]) return 0;
|
||||
mtrace_buffer[2] = (uint8_t *) vj_malloc(w * h * sizeof(uint8_t));
|
||||
if(!mtrace_buffer[2]) return 0;
|
||||
mtrace_buffer[1] = mtrace_buffer[0] + (w*h);
|
||||
mtrace_buffer[2] = mtrace_buffer[1] + (w*h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *negation_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->defaults[0] = 255;
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *neighbours_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2;
|
||||
ve->limits[1][0] = 16; /* brush size (shape is rectangle)*/
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -55,20 +55,25 @@ static uint8_t *chromacity[2];
|
||||
|
||||
int neighbours_malloc(int w, int h )
|
||||
{
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * 2);
|
||||
if(!tmp_buf[0] ) return 0;
|
||||
tmp_buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[1] = tmp_buf[0] + (w*h);
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h *2);
|
||||
if(!chromacity[0]) return 0;
|
||||
chromacity[1] = chromacity[0] + (w*h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void neighbours_free(void)
|
||||
{
|
||||
if(tmp_buf[0]) free(tmp_buf[0]);
|
||||
if(tmp_buf[1]) free(tmp_buf[1]);
|
||||
if(chromacity[0]) free(chromacity[0]);
|
||||
if(chromacity[1]) free(chromacity[1]);
|
||||
if(tmp_buf[0])
|
||||
free(tmp_buf[0]);
|
||||
if(chromacity[0])
|
||||
free(chromacity[0]);
|
||||
tmp_buf[0] = NULL;
|
||||
tmp_buf[1] = NULL;
|
||||
chromacity[0] = NULL;
|
||||
chromacity[1] = NULL;
|
||||
}
|
||||
|
||||
static inline uint8_t evaluate_pixel(
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *neighbours2_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2;
|
||||
ve->limits[1][0] = 16; /* brush size (shape is rectangle)*/
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -55,20 +55,25 @@ static uint8_t *chromacity[2];
|
||||
|
||||
int neighbours2_malloc(int w, int h )
|
||||
{
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * 2);
|
||||
if(!tmp_buf[0] ) return 0;
|
||||
tmp_buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[1] = tmp_buf[0] + (w*h);
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h *2);
|
||||
if(!chromacity[0]) return 0;
|
||||
chromacity[1] = chromacity[0] + (w*h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void neighbours2_free(void)
|
||||
{
|
||||
if(tmp_buf[0]) free(tmp_buf[0]);
|
||||
if(tmp_buf[1]) free(tmp_buf[1]);
|
||||
if(chromacity[0]) free(chromacity[0]);
|
||||
if(chromacity[1]) free(chromacity[1]);
|
||||
if(tmp_buf[0])
|
||||
free(tmp_buf[0]);
|
||||
if(chromacity[0])
|
||||
free(chromacity[0]);
|
||||
tmp_buf[0] = NULL;
|
||||
tmp_buf[1] = NULL;
|
||||
chromacity[0] = NULL;
|
||||
chromacity[1] = NULL;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *neighbours3_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2;
|
||||
ve->limits[1][0] = 32; /* line size */
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -55,22 +55,26 @@ static uint8_t *chromacity[2];
|
||||
|
||||
int neighbours3_malloc(int w, int h )
|
||||
{
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * 2);
|
||||
if(!tmp_buf[0] ) return 0;
|
||||
tmp_buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[1] = tmp_buf[0] + (w*h);
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h *2);
|
||||
if(!chromacity[0]) return 0;
|
||||
chromacity[1] = chromacity[0] + (w*h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void neighbours3_free(void)
|
||||
{
|
||||
if(tmp_buf[0]) free(tmp_buf[0]);
|
||||
if(tmp_buf[1]) free(tmp_buf[1]);
|
||||
if(chromacity[0]) free(chromacity[0]);
|
||||
if(chromacity[1]) free(chromacity[1]);
|
||||
if(tmp_buf[0])
|
||||
free(tmp_buf[0]);
|
||||
if(chromacity[0])
|
||||
free(chromacity[0]);
|
||||
tmp_buf[0] = NULL;
|
||||
tmp_buf[1] = NULL;
|
||||
chromacity[0] = NULL;
|
||||
chromacity[1] = NULL;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t y;
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *neighbours4_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2;
|
||||
ve->limits[1][0] = 32; /* radius */
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -69,13 +69,16 @@ typedef struct
|
||||
|
||||
static relpoint_t points[2048];
|
||||
|
||||
|
||||
|
||||
int neighbours4_malloc(int w, int h )
|
||||
{
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * 2);
|
||||
if(!tmp_buf[0] ) return 0;
|
||||
tmp_buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[1] = tmp_buf[0] + (w*h);
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h *2);
|
||||
if(!chromacity[0]) return 0;
|
||||
chromacity[1] = chromacity[0] + (w*h);
|
||||
int i;
|
||||
for(i = 0; i < w; i ++ )
|
||||
{
|
||||
@@ -87,10 +90,14 @@ int neighbours4_malloc(int w, int h )
|
||||
|
||||
void neighbours4_free(void)
|
||||
{
|
||||
if(tmp_buf[0]) free(tmp_buf[0]);
|
||||
if(tmp_buf[1]) free(tmp_buf[1]);
|
||||
if(chromacity[0]) free(chromacity[0]);
|
||||
if(chromacity[1]) free(chromacity[1]);
|
||||
if(tmp_buf[0])
|
||||
free(tmp_buf[0]);
|
||||
if(chromacity[0])
|
||||
free(chromacity[0]);
|
||||
tmp_buf[0] = NULL;
|
||||
tmp_buf[1] = NULL;
|
||||
chromacity[0] = NULL;
|
||||
chromacity[1] = NULL;
|
||||
}
|
||||
|
||||
static void create_circle( double radius, int depth, int w )
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *neighbours5_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2;
|
||||
ve->limits[1][0] = 32; /* line size */
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -55,20 +55,25 @@ static uint8_t *chromacity[2];
|
||||
|
||||
int neighbours5_malloc(int w, int h )
|
||||
{
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * 2);
|
||||
if(!tmp_buf[0] ) return 0;
|
||||
tmp_buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
chromacity[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
tmp_buf[1] = tmp_buf[0] + (w*h);
|
||||
chromacity[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h *2);
|
||||
if(!chromacity[0]) return 0;
|
||||
chromacity[1] = chromacity[0] + (w*h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void neighbours5_free(void)
|
||||
{
|
||||
if(tmp_buf[0]) free(tmp_buf[0]);
|
||||
if(tmp_buf[1]) free(tmp_buf[1]);
|
||||
if(chromacity[0]) free(chromacity[0]);
|
||||
if(chromacity[1]) free(chromacity[1]);
|
||||
if(tmp_buf[0])
|
||||
free(tmp_buf[0]);
|
||||
if(chromacity[0])
|
||||
free(chromacity[0]);
|
||||
tmp_buf[0] = NULL;
|
||||
tmp_buf[1] = NULL;
|
||||
chromacity[0] = NULL;
|
||||
chromacity[1] = NULL;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -35,12 +35,12 @@ static int frames_elapsed;
|
||||
|
||||
vj_effect *nervous_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = N_MAX;
|
||||
ve->defaults[0] = N_MAX;
|
||||
@@ -53,12 +53,11 @@ vj_effect *nervous_init(int w, int h)
|
||||
|
||||
int nervous_malloc(int w, int h )
|
||||
{
|
||||
nervous_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * N_MAX);
|
||||
nervous_buf[0] = (uint8_t*) vj_calloc(sizeof(uint8_t) * w * h * N_MAX * 3);
|
||||
|
||||
if(!nervous_buf[0]) return 0;
|
||||
nervous_buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * N_MAX);
|
||||
if(!nervous_buf[1]) return 0;
|
||||
nervous_buf[2] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * N_MAX);
|
||||
if(!nervous_buf[2]) return 0;
|
||||
nervous_buf[1] = nervous_buf[0] + (w*h);
|
||||
nervous_buf[2] = nervous_buf[1] + (w*h);
|
||||
frames_elapsed = 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -66,8 +65,6 @@ int nervous_malloc(int w, int h )
|
||||
void nervous_free(void)
|
||||
{
|
||||
if( nervous_buf[0] ) free(nervous_buf[0]);
|
||||
if( nervous_buf[1] ) free(nervous_buf[1]);
|
||||
if( nervous_buf[2] ) free(nervous_buf[2]);
|
||||
nervous_buf[0] = NULL;
|
||||
nervous_buf[1] = NULL;
|
||||
nervous_buf[2] = NULL;
|
||||
|
||||
@@ -24,11 +24,11 @@ static uint8_t *Yb_frame;
|
||||
|
||||
vj_effect *noiseadd_init(int width , int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults[0] = 0; /* type */
|
||||
ve->defaults[1] = 1000;
|
||||
ve->limits[0][0] = 0;
|
||||
@@ -47,14 +47,14 @@ vj_effect *noiseadd_init(int width , int height)
|
||||
int noiseadd_malloc(int width, int height)
|
||||
{
|
||||
|
||||
Yb_frame = (uint8_t *) vj_malloc( sizeof(uint8_t) * width * height);
|
||||
memset(Yb_frame, 0, width*height);
|
||||
Yb_frame = (uint8_t *) vj_calloc( sizeof(uint8_t) * width * height);
|
||||
if(!Yb_frame) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void noiseadd_free() {
|
||||
if(Yb_frame) free(Yb_frame);
|
||||
Yb_frame = NULL;
|
||||
}
|
||||
|
||||
void noiseblur1x3_maskapply(uint8_t *src[3], int width, int height, int coeef ) {
|
||||
|
||||
@@ -25,11 +25,11 @@ static uint8_t *Yb_frame;
|
||||
|
||||
vj_effect *noisepencil_init(int width , int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults[0] = 0; /* type */
|
||||
ve->defaults[1] = 1000;
|
||||
ve->defaults[2] = 68;
|
||||
@@ -63,6 +63,7 @@ int noisepencil_malloc(int width,int height)
|
||||
|
||||
void noisepencil_free() {
|
||||
if(Yb_frame) free(Yb_frame);
|
||||
Yb_frame = NULL;
|
||||
}
|
||||
|
||||
void noisepencil_1_apply(uint8_t *src[3], int width, int height, int coeef, int min_t, int max_t ) {
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
vj_effect *opacity_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->defaults[0] = 150;
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
vj_effect *opacityadv_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->limits[0][1] = 0;
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
|
||||
vj_effect *opacitythreshold_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->limits[0][1] = 0;
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
|
||||
vj_effect *overclock_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2;
|
||||
ve->limits[1][0] = (h/8);
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -104,20 +104,14 @@ static inline void blur2(uint8_t *dst, uint8_t *src, int w, int radius, int powe
|
||||
int overclock_malloc(int w, int h)
|
||||
{
|
||||
const int len = w* h;
|
||||
oc_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * len );
|
||||
oc_buf[0] = (uint8_t*) vj_calloc(sizeof(uint8_t) * len );
|
||||
if(oc_buf[0]==NULL) return 0;
|
||||
// oc_buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * uv_len);
|
||||
// if(oc_buf[1]==NULL) return 0;
|
||||
// oc_buf[2] = (uint8_t*) vj_malloc(sizeof(uint8_t) * uv_len);
|
||||
// if(oc_buf[2]==NULL) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void overclock_free()
|
||||
{
|
||||
if(oc_buf[0]) free( oc_buf[0] );
|
||||
if(oc_buf[1]) free( oc_buf[1] );
|
||||
if(oc_buf[2]) free( oc_buf[2] );
|
||||
}
|
||||
|
||||
void overclock_apply(VJFrame *frame, int width, int height, int n, int radius )
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
vj_effect *pencilsketch_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults[0] = 0;/* type */
|
||||
ve->defaults[1] = pixel_Y_lo_; /* min */
|
||||
ve->defaults[2] = pixel_Y_hi_; /* max */
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
vj_effect *photoplay_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2; // divider
|
||||
ve->limits[1][0] = max_power(w);
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -56,7 +56,7 @@ static int prepare_filmstrip(int film_length, int w, int h)
|
||||
int picture_width = w / sqrt(film_length);
|
||||
int picture_height = h / sqrt(film_length);
|
||||
|
||||
photo_list = (picture_t**) vj_malloc(sizeof(picture_t*) * (film_length + 1) );
|
||||
photo_list = (picture_t**) vj_calloc(sizeof(picture_t*) * (film_length + 1) );
|
||||
if(!photo_list)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@ typedef struct
|
||||
|
||||
vj_effect *picinpic_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 64; /* width of view port */
|
||||
ve->defaults[1] = 64; /* height of viewport */
|
||||
ve->defaults[2] = 64; /* x1 */
|
||||
@@ -76,12 +76,10 @@ int picinpic_malloc(void **d, int w, int h)
|
||||
{
|
||||
int i;
|
||||
pic_t *my;
|
||||
*d = (void*) vj_malloc(sizeof(pic_t));
|
||||
*d = (void*) vj_calloc(sizeof(pic_t));
|
||||
my = (pic_t*) *d;
|
||||
|
||||
my->scaler = NULL;
|
||||
memset( &(my->frame), 0, sizeof(VJFrame));
|
||||
memset( &(my->template), 0, sizeof(sws_template) );
|
||||
my->template.flags = 1;
|
||||
my->w = 0;
|
||||
my->h = 0;
|
||||
@@ -143,9 +141,9 @@ void picinpic_apply( void *user_data, VJFrame *frame, VJFrame *frame2, int width
|
||||
&(picture->template),
|
||||
yuv_sws_get_cpu_flags()
|
||||
);
|
||||
picture->frame.data[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * len );
|
||||
picture->frame.data[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * len );
|
||||
picture->frame.data[2] = (uint8_t*) vj_malloc(sizeof(uint8_t) * len );
|
||||
picture->frame.data[0] = (uint8_t*) vj_calloc(sizeof(uint8_t) * len );
|
||||
picture->frame.data[1] = (uint8_t*) vj_calloc(sizeof(uint8_t) * len );
|
||||
picture->frame.data[2] = (uint8_t*) vj_calloc(sizeof(uint8_t) * len );
|
||||
|
||||
picture->w = view_width;
|
||||
picture->h = view_height;
|
||||
|
||||
@@ -25,7 +25,7 @@ static uint8_t values[512];
|
||||
|
||||
vj_effect *pixelate_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
int i;
|
||||
int nvalues=0;
|
||||
for(i=1; i < width; i++)
|
||||
@@ -39,9 +39,9 @@ vj_effect *pixelate_init(int width, int height)
|
||||
|
||||
ve->num_params = 1;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = nvalues-2;
|
||||
ve->defaults[0] = 8;
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include <stdlib.h>
|
||||
vj_effect *posterize_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 4;
|
||||
ve->defaults[1] = 16;
|
||||
ve->defaults[2] = 235;
|
||||
|
||||
@@ -51,11 +51,11 @@ static uint8_t *radial_src[3];
|
||||
|
||||
vj_effect *radialblur_init(int w,int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 15;
|
||||
ve->defaults[1] = 0;
|
||||
ve->defaults[2] = 2;
|
||||
@@ -75,12 +75,10 @@ vj_effect *radialblur_init(int w,int h)
|
||||
|
||||
int radialblur_malloc(int w, int h)
|
||||
{
|
||||
radial_src[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
radial_src[0] = (uint8_t*) vj_calloc(sizeof(uint8_t) * w * h * 3 );
|
||||
if(!radial_src[0]) return 0;
|
||||
radial_src[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * ((w*h)));
|
||||
if(!radial_src[1]) return 0;
|
||||
radial_src[2] = (uint8_t*) vj_malloc(sizeof(uint8_t) * ((w*h)));
|
||||
if(!radial_src[2]) return 0;
|
||||
radial_src[1] = radial_src[0] + (w * h);
|
||||
radial_src[2] = radial_src[1] + (w * h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -146,9 +144,8 @@ void radialblur_apply(VJFrame *frame, int width, int height, int radius, int pow
|
||||
|
||||
void radialblur_free()
|
||||
{
|
||||
if( radial_src[0] ) free(radial_src[0]);
|
||||
if( radial_src[1] ) free(radial_src[1]);
|
||||
if( radial_src[2] ) free(radial_src[2]);
|
||||
if( radial_src[0] )
|
||||
free(radial_src[0]);
|
||||
radial_src[0] = NULL;
|
||||
radial_src[1] = NULL;
|
||||
radial_src[2] = NULL;
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
|
||||
vj_effect *raster_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 4;
|
||||
ve->limits[1][0] = h/4;
|
||||
ve->defaults[0] = 4;
|
||||
@@ -95,7 +95,7 @@ void raster_apply(VJFrame *frame, int w, int h, int v )
|
||||
|
||||
if(!buf)
|
||||
{
|
||||
buf = (uint8_t*)vj_malloc(sizeof(uint8_t) * w * h );
|
||||
buf = (uint8_t*)vj_calloc(sizeof(uint8_t) * w * h );
|
||||
if(!buf)return;
|
||||
}
|
||||
memcpy(buf, Y,(w*h));
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include <stdlib.h>
|
||||
vj_effect *rawman_init(int w,int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 0;
|
||||
ve->defaults[1] = 15;
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
#include <math.h>
|
||||
vj_effect *rawval_init(int w,int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 232;
|
||||
ve->defaults[1] = 16;
|
||||
ve->defaults[2] = 16;
|
||||
|
||||
@@ -54,11 +54,11 @@ static uint8_t *reflection_buffer;
|
||||
|
||||
vj_effect *reflection_init(int width,int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 2;
|
||||
ve->defaults[1] = 5;
|
||||
ve->defaults[2] = 1;
|
||||
@@ -107,6 +107,7 @@ int reflection_malloc(int width, int height)
|
||||
|
||||
void reflection_free() {
|
||||
if(reflection_buffer) free(reflection_buffer);
|
||||
reflection_buffer = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
#include <stdlib.h>
|
||||
vj_effect *revtv_init(int max_width, int max_height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 2;
|
||||
ve->defaults[1] = 42;
|
||||
ve->defaults[2] = 201;
|
||||
|
||||
@@ -46,11 +46,11 @@
|
||||
vj_effect *rgbkey_init(int w,int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 6;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 319; /* angle , 45 degrees*/
|
||||
ve->defaults[1] = 0; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
vj_effect *rgbkeysmooth_init(int w,int h)
|
||||
{
|
||||
vj_effect *ve;
|
||||
ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 6;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 290; /* angle */
|
||||
ve->defaults[1] = 255; /* r */
|
||||
ve->defaults[2] = 0; /* g */
|
||||
|
||||
@@ -47,11 +47,11 @@ static int ripple_attn = 0;
|
||||
// FIXME private
|
||||
vj_effect *ripple_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = 3600;
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -73,16 +73,16 @@ int ripple_malloc(int width, int height)
|
||||
int i;
|
||||
ripple_table = (double*) vj_malloc(sizeof(double) * width * height + 16);
|
||||
if(!ripple_table) return 0;
|
||||
ripple_data[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height + 16);
|
||||
ripple_data[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * (width * height * 3) + 64);
|
||||
if(!ripple_data[0]) return 0;
|
||||
ripple_data[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height + 16);
|
||||
if(!ripple_data[1]) return 0;
|
||||
ripple_data[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height + 16);
|
||||
if(!ripple_data[2]) return 0;
|
||||
ripple_data[1] = ripple_data[0] + (width * height);
|
||||
ripple_data[2] = ripple_data[1] + (width * height);
|
||||
|
||||
ripple_sin = (double*) vj_malloc(sizeof(double) * RIPPLE_DEGREES);
|
||||
if(!ripple_sin) return 0;
|
||||
ripple_cos = (double*) vj_malloc(sizeof(double) * RIPPLE_DEGREES);
|
||||
if(!ripple_cos) return 0;
|
||||
|
||||
for(i=0; i < RIPPLE_DEGREES; i++) {
|
||||
ripple_sin[i] = sin ((M_PI * i) / RIPPLE_VAL);
|
||||
ripple_cos[i] = sin ((M_PI * i) / RIPPLE_VAL);
|
||||
@@ -96,9 +96,14 @@ void ripple_free() {
|
||||
if(ripple_table) free(ripple_table);
|
||||
if(ripple_sin) free(ripple_sin);
|
||||
if(ripple_cos) free(ripple_cos);
|
||||
if(ripple_data[0]) free(ripple_data[0]);
|
||||
if(ripple_data[1]) free(ripple_data[1]);
|
||||
if(ripple_data[2]) free(ripple_data[2]);
|
||||
if(ripple_data[0])
|
||||
free(ripple_data[0]);
|
||||
ripple_data[0] = NULL;
|
||||
ripple_data[1] = NULL;
|
||||
ripple_data[2] = NULL;
|
||||
ripple_sin = NULL;
|
||||
ripple_cos = NULL;
|
||||
ripple_table = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,11 +38,11 @@ vj_effect *rotozoom_init(int width, int height)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 4;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 0;
|
||||
ve->defaults[1] = 1;
|
||||
ve->defaults[2] = 1;
|
||||
@@ -129,20 +129,21 @@ int rotozoom_malloc(int width, int height)
|
||||
{
|
||||
|
||||
|
||||
rotobuffer[0] = (uint8_t *) vj_malloc(sizeof(uint8_t) * width * height );
|
||||
if(!rotobuffer[0]) return 0;
|
||||
rotobuffer[1] = (uint8_t *) vj_malloc(sizeof(uint8_t) * width * height );
|
||||
if(!rotobuffer[1]) return 0;
|
||||
rotobuffer[2] = (uint8_t *) vj_malloc(sizeof(uint8_t) * width * height );
|
||||
if(!rotobuffer[2]) return 0;
|
||||
rotobuffer[0] = (uint8_t *) vj_calloc(sizeof(uint8_t) * width * height * 3);
|
||||
if(!rotobuffer[0])
|
||||
return 0;
|
||||
rotobuffer[1] = rotobuffer[0] + (width * height);
|
||||
rotobuffer[2] = rotobuffer[1] + (width * height);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
void rotozoom_free() {
|
||||
if(rotobuffer[0]) free(rotobuffer[0]);
|
||||
if(rotobuffer[1]) free(rotobuffer[1]);
|
||||
if(rotobuffer[2]) free(rotobuffer[2]);
|
||||
if(rotobuffer[0])
|
||||
free(rotobuffer[0]);
|
||||
rotobuffer[0] = NULL;
|
||||
rotobuffer[1] = NULL;
|
||||
rotobuffer[2] = NULL;
|
||||
}
|
||||
|
||||
/* rotozoomer, from the demo effects collection, works in supersampled YCbCr space.
|
||||
|
||||
@@ -30,11 +30,11 @@ static int nreverse = 0;
|
||||
|
||||
vj_effect *scratcher_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 3;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -55,26 +55,28 @@ vj_effect *scratcher_init(int w, int h)
|
||||
//FIXME private
|
||||
|
||||
void scratcher_free() {
|
||||
if(frame[0]) free(frame[0]);
|
||||
if(frame[1]) free(frame[1]);
|
||||
if(frame[2]) free(frame[2]);
|
||||
|
||||
if(frame[0])
|
||||
free(frame[0]);
|
||||
frame[0] = NULL;
|
||||
frame[1] = NULL;
|
||||
frame[2] = NULL;
|
||||
}
|
||||
|
||||
int scratcher_malloc(int w, int h)
|
||||
{
|
||||
/* need memory for bounce mode ... */
|
||||
frame[0] =
|
||||
(uint8_t *) vj_malloc(w * h * sizeof(uint8_t) * MAX_SCRATCH_FRAMES);
|
||||
(uint8_t *) vj_malloc(w * h * 2 * sizeof(uint8_t) * MAX_SCRATCH_FRAMES);
|
||||
if(!frame[0]) return 0;
|
||||
|
||||
memset( frame[0], pixel_Y_lo_, w * h * MAX_SCRATCH_FRAMES );
|
||||
|
||||
frame[1] =
|
||||
(uint8_t *) vj_malloc( ((w * h)/4) * sizeof(uint8_t) * MAX_SCRATCH_FRAMES);
|
||||
if(!frame[1]) return 0;
|
||||
memset( frame[1], 128, ((w * h) / 4 ) * MAX_SCRATCH_FRAMES);
|
||||
frame[0] + ( w * h * MAX_SCRATCH_FRAMES );
|
||||
frame[2] =
|
||||
(uint8_t *) vj_malloc( ((w * h)/4) * sizeof(uint8_t) * MAX_SCRATCH_FRAMES);
|
||||
if(!frame[2]) return 0;
|
||||
frame[1] + ( ((w*h)/4) * MAX_SCRATCH_FRAMES );
|
||||
|
||||
memset( frame[1], 128, ((w * h)/4 ) * MAX_SCRATCH_FRAMES);
|
||||
memset( frame[2], 128, ((w * h)/4) * MAX_SCRATCH_FRAMES);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ static uint8_t *sinoid_frame[3];
|
||||
|
||||
vj_effect *sinoids_init(int width, int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 1;
|
||||
ve->defaults[1] = 70;
|
||||
ve->limits[0][0] = 0;
|
||||
@@ -51,31 +51,33 @@ vj_effect *sinoids_init(int width, int height)
|
||||
int sinoids_malloc(int width, int height)
|
||||
{
|
||||
int i = 0;
|
||||
sinoids_X = (int*) vj_malloc(sizeof(int) * width);
|
||||
sinoids_X = (int*) vj_calloc(sizeof(int) * width);
|
||||
if(!sinoids_X) return 0;
|
||||
sinoid_frame[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * height * width);
|
||||
|
||||
sinoid_frame[0] = (uint8_t*)vj_calloc(sizeof(uint8_t) * 3 * height * width);
|
||||
|
||||
if(!sinoid_frame[0]) return 0;
|
||||
sinoid_frame[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * height * width);
|
||||
if(!sinoid_frame[1]) return 0;
|
||||
sinoid_frame[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * height * width);
|
||||
if(!sinoid_frame[2]) return 0;
|
||||
|
||||
sinoid_frame[1] = sinoid_frame[0] + (width * height);
|
||||
sinoid_frame[2] = sinoid_frame[1] + (width * height);
|
||||
|
||||
|
||||
for(i=0; i < width; i++ ) {
|
||||
//double si;
|
||||
//fast_sin( si, ( ((double)i/(double)width)*2*3.1415926));
|
||||
sinoids_X[i] = (int) ( sin( ((double)i/(double)width) * 2 * 3.1415926) * 1);
|
||||
//sinoids_X[i] = (int) si;
|
||||
sinoids_X[i] *= 4;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
void sinoids_free() {
|
||||
if(sinoids_X) free(sinoids_X);
|
||||
if(sinoid_frame[0]) free(sinoid_frame[0]);
|
||||
if(sinoid_frame[1]) free(sinoid_frame[1]);
|
||||
if(sinoid_frame[2]) free(sinoid_frame[2]);
|
||||
if(sinoid_frame[0])
|
||||
free(sinoid_frame[0]);
|
||||
sinoid_frame[0] = NULL;
|
||||
sinoid_frame[1] = NULL;
|
||||
sinoid_frame[2] = NULL;
|
||||
}
|
||||
|
||||
void sinoids_recalc(int width, int z) {
|
||||
|
||||
@@ -30,12 +30,12 @@ void slice_recalc(int width, int height, int val);
|
||||
|
||||
vj_effect *slice_init(int width,int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 2;
|
||||
ve->limits[1][0] = 128;
|
||||
ve->limits[0][1] = 0;
|
||||
@@ -52,12 +52,11 @@ vj_effect *slice_init(int width,int height)
|
||||
|
||||
int slice_malloc(int width, int height)
|
||||
{
|
||||
slice_frame[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height);
|
||||
if(!slice_frame[0]) return 0;
|
||||
slice_frame[1] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height);
|
||||
if(!slice_frame[1]) return 0;
|
||||
slice_frame[2] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height);
|
||||
if(!slice_frame[2]) return 0;
|
||||
slice_frame[0] = (uint8_t*)vj_malloc(sizeof(uint8_t) * width * height * 3);
|
||||
if(!slice_frame[0])
|
||||
return 0;
|
||||
slice_frame[1] = slice_frame[0] + (width * height);
|
||||
slice_frame[2] = slice_frame[1] + (width * height);
|
||||
slice_xshift = (int*) vj_malloc(sizeof(int) * height);
|
||||
if(!slice_xshift) return 0;
|
||||
slice_yshift = (int*) vj_malloc(sizeof(int) * width);
|
||||
@@ -69,11 +68,17 @@ int slice_malloc(int width, int height)
|
||||
|
||||
|
||||
void slice_free() {
|
||||
if(slice_frame[0]) free(slice_frame[0]);
|
||||
if(slice_frame[1]) free(slice_frame[1]);
|
||||
if(slice_frame[2]) free(slice_frame[2]);
|
||||
if(slice_xshift) free(slice_xshift);
|
||||
if(slice_yshift) free(slice_yshift);
|
||||
if(slice_frame[0])
|
||||
free(slice_frame[0]);
|
||||
slice_frame[0] = NULL;
|
||||
slice_frame[1] = NULL;
|
||||
slice_frame[2] = NULL;
|
||||
if(slice_xshift)
|
||||
free(slice_xshift);
|
||||
if(slice_yshift)
|
||||
free(slice_yshift);
|
||||
slice_yshift = NULL;
|
||||
slice_xshift = NULL;
|
||||
}
|
||||
|
||||
/* much like the bathroom window, width height indicate block size within frame */
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
|
||||
vj_effect *smear_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 3;
|
||||
ve->limits[0][1] = 0;
|
||||
|
||||
@@ -27,11 +27,11 @@ static int smuck_rand_val;
|
||||
|
||||
vj_effect *smuck_init(int w,int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 1;
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 14;
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
vj_effect *softblur_init(int w,int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 0;
|
||||
|
||||
ve->limits[0][0] = 0;
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include <stdlib.h>
|
||||
vj_effect *solarize_init(int w,int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params);
|
||||
ve->defaults[0] = 16;
|
||||
|
||||
ve->limits[0][0] = 1; /* threshold */
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
static uint8_t *split_fixme[3];
|
||||
vj_effect *split_init(int width,int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 8;
|
||||
ve->defaults[1] = 1;
|
||||
|
||||
@@ -41,11 +41,11 @@ vj_effect *split_init(int width,int height)
|
||||
}
|
||||
int split_malloc(int width, int height)
|
||||
{
|
||||
split_fixme[0] = (uint8_t *) vj_malloc(sizeof(uint8_t) * width * height + 1);
|
||||
split_fixme[0] = (uint8_t *) vj_calloc(sizeof(uint8_t) * width * height + 1);
|
||||
if(!split_fixme[0]) return 0;
|
||||
split_fixme[1] = (uint8_t *) vj_malloc(sizeof(uint8_t) * width * height );
|
||||
split_fixme[1] = (uint8_t *) vj_calloc(sizeof(uint8_t) * width * height );
|
||||
if(!split_fixme[1]) return 0;
|
||||
split_fixme[2] = (uint8_t *) vj_malloc(sizeof(uint8_t) * width * height);
|
||||
split_fixme[2] = (uint8_t *) vj_calloc(sizeof(uint8_t) * width * height);
|
||||
if(!split_fixme[2]) return 0;
|
||||
return 1;
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
|
||||
vj_effect *swirl_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 1;
|
||||
ve->limits[1][0] = 360;
|
||||
ve->defaults[0] = 250;
|
||||
@@ -55,21 +55,18 @@ int swirl_malloc(int w, int h)
|
||||
int w2=w/2;
|
||||
int p = 0;
|
||||
|
||||
buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!buf[0]) return -1;
|
||||
buf[1] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!buf[1]) return -1;
|
||||
buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * 3);
|
||||
if(!buf[0]) return 0;
|
||||
buf[1] = buf[0] + (w * h);
|
||||
buf[2] = buf[1] + (w * h);
|
||||
|
||||
buf[2] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h );
|
||||
if(!buf[2]) return -1;
|
||||
polar_map = (double*) vj_calloc(sizeof(double) * w* h );
|
||||
if(!polar_map) return 0;
|
||||
fish_angle = (double*) vj_calloc(sizeof(double) * w* h );
|
||||
if(!fish_angle) return 0;
|
||||
|
||||
polar_map = (double*) vj_malloc(sizeof(double) * w* h );
|
||||
if(!polar_map) return -1;
|
||||
fish_angle = (double*) vj_malloc(sizeof(double) * w* h );
|
||||
if(!fish_angle) return -1;
|
||||
|
||||
cached_coords = (int*) vj_malloc(sizeof(int) * w * h );
|
||||
if(!cached_coords) return -1;
|
||||
cached_coords = (int*) vj_calloc(sizeof(int) * w * h );
|
||||
if(!cached_coords) return 0;
|
||||
|
||||
for(y=(-1 *h2); y < (h-h2); y++)
|
||||
{
|
||||
@@ -86,14 +83,15 @@ int swirl_malloc(int w, int h)
|
||||
|
||||
void swirl_free()
|
||||
{
|
||||
if(buf[0]) free(buf[0]);
|
||||
if(buf[1]) free(buf[1]);
|
||||
if(buf[2]) free(buf[2]);
|
||||
|
||||
if(polar_map) free(polar_map);
|
||||
if(fish_angle) free(fish_angle);
|
||||
|
||||
if(buf[0])
|
||||
free(buf[0]);
|
||||
buf[1] = NULL;
|
||||
buf[2] = NULL;
|
||||
|
||||
if(polar_map)
|
||||
free(polar_map);
|
||||
if(fish_angle)
|
||||
free(fish_angle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ static int trace_counter = 0;
|
||||
|
||||
vj_effect *tracer_init(int w, int h)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 2;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->limits[0][0] = 0;
|
||||
ve->limits[1][0] = 255;
|
||||
ve->limits[0][1] = 1;
|
||||
@@ -46,19 +46,20 @@ vj_effect *tracer_init(int w, int h)
|
||||
|
||||
int tracer_malloc(int w, int h)
|
||||
{
|
||||
trace_buffer[0] = (uint8_t *) vj_malloc(w * h * sizeof(uint8_t));
|
||||
trace_buffer[0] = (uint8_t *) vj_malloc(w * h * 3* sizeof(uint8_t));
|
||||
if(!trace_buffer[0]) return 0;
|
||||
trace_buffer[1] = (uint8_t *) vj_malloc( ((w * h)) * sizeof(uint8_t));
|
||||
if(!trace_buffer[1]) return 0;
|
||||
trace_buffer[2] = (uint8_t *) vj_malloc( ((w * h)) * sizeof(uint8_t));
|
||||
if(!trace_buffer[2]) return 0;
|
||||
trace_buffer[1] = trace_buffer[0] + ( w * h );
|
||||
trace_buffer[2] = trace_buffer[1] + ( w * h );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void tracer_free() {
|
||||
if(trace_buffer[0]) free(trace_buffer[0]);
|
||||
if(trace_buffer[1]) free(trace_buffer[1]);
|
||||
if(trace_buffer[2]) free(trace_buffer[2]);
|
||||
if(trace_buffer[0])
|
||||
free(trace_buffer[0]);
|
||||
trace_buffer[0] = NULL;
|
||||
trace_buffer[1] = NULL;
|
||||
trace_buffer[2] = NULL;
|
||||
}
|
||||
|
||||
void tracer_apply(VJFrame *frame, VJFrame *frame2,
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
vj_effect *transform_init(int width,int height)
|
||||
{
|
||||
vj_effect *ve = (vj_effect *) vj_malloc(sizeof(vj_effect));
|
||||
vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect));
|
||||
ve->num_params = 1;
|
||||
ve->defaults = (int *) vj_malloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_malloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); /* default values */
|
||||
ve->limits[0] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* min */
|
||||
ve->limits[1] = (int *) vj_calloc(sizeof(int) * ve->num_params); /* max */
|
||||
ve->defaults[0] = 5;
|
||||
//ve->defaults[1] = 1;
|
||||
ve->limits[0][0] = 1;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user