Libvje / refactor : colormorphology

* w, h
* clean headers
This commit is contained in:
[d.j.a.y] Jerome Blanchi
2016-07-29 17:55:00 +02:00
parent 0407a8372f
commit 38e82d310d
4 changed files with 12 additions and 17 deletions

View File

@@ -17,12 +17,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA.
*/
#include <config.h>
#include <stdio.h>
#include <stdint.h>
#include "common.h"
#include <libvjmem/vjmem.h>
#include "colmorphology.h"
#include "common.h"
typedef uint8_t (*morph_func)(uint8_t *kernel, uint8_t mt[9] );
vj_effect *colmorphology_init(int w, int h)
@@ -92,9 +91,10 @@ static inline uint8_t _erode_kernel3x3( uint8_t *kernel, uint8_t img[9])
return pixel_Y_hi_;
}
void colmorphology_apply( VJFrame *frame, int width, int height, int threshold, int type, int passes )
void colmorphology_apply( VJFrame *frame, int threshold, int type, int passes )
{
unsigned int i,x,y;
const unsigned int width = frame->width;
unsigned int len = frame->len;
uint8_t *Y = frame->data[0];
uint8_t kernels[8][9] ={
@@ -102,8 +102,8 @@ void colmorphology_apply( VJFrame *frame, int width, int height, int threshold,
{ 0,1,0, 1,1,1, 0,1,0 },//1
{ 0,0,0, 1,1,1, 0,0,0 },//2
{ 0,1,0, 0,1,0, 0,1,0 },//3
{ 0,0,1, 0,1,0, 1,0,0 },//4
{ 1,0,0, 0,1,0, 0,0,1 },
{ 0,0,1, 0,1,0, 1,0,0 },//4
{ 1,0,0, 0,1,0, 0,0,1 },
{ 1,1,1, 0,0,0, 0,0,0 },
{ 0,0,0, 0,0,0, 1,1,1 }
};

View File

@@ -20,12 +20,8 @@
#ifndef COLMORPHOLOGY_H
#define COLMORPHOLOGY_H
#include <libvje/vje.h>
#include <sys/types.h>
#include <stdint.h>
vj_effect *colmorphology_init(int w, int h);
void colmorphology_apply( VJFrame *frame, int width, int height, int t, int val, int n);
int colmorphology_malloc(int w, int h);
void colmorphology_free(void);
void colmorphology_apply( VJFrame *frame, int t, int val, int n);
int colmorphology_malloc(int w, int h);
void colmorphology_free(void);
#endif

View File

@@ -458,8 +458,7 @@ extern int bgpush_prepare( VJFrame *frame );
extern void cartonize_apply( VJFrame *frame, int b1, int b2, int b3 );
extern void morphology_apply( VJFrame *frame, int threshold, int kernel, int mode, int channel);
extern void colmorphology_apply( VJFrame *frame, int w, int h, int t, int v, int p);
extern void colmorphology_apply( VJFrame *frame, int t, int v, int p);
extern void blob_apply( VJFrame *frame, int w, int h, int p0,int p1, int p2, int p3);

View File

@@ -241,7 +241,7 @@ static void vj_effman_apply_image_effect(
morphology_apply( frames[0], arg[0],arg[1],arg[2],arg[3] );
break;
case VJ_IMAGE_EFFECT_COLMORPH:
colmorphology_apply( frames[0], frames[0]->width, frames[0]->height,arg[0],arg[1],arg[2]);
colmorphology_apply( frames[0], arg[0], arg[1], arg[2]);
break;
case VJ_IMAGE_EFFECT_NERVOUS:
nervous_apply( frames[0], frames[0]->width, frames[0]->height,