mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-23 16:20:03 +01:00
Libvje / refactor : contrast
* frame->h , frame->w
This commit is contained in:
@@ -56,11 +56,13 @@ vj_effect *contrast_init(int w, int h)
|
||||
}
|
||||
|
||||
/* also from yuvdenoise */
|
||||
static void contrast_cb_apply(VJFrame *frame, int width,int height, int *s) {
|
||||
static void contrast_cb_apply(VJFrame *frame, int *s) {
|
||||
unsigned int r;
|
||||
register int cb;
|
||||
register int cr;
|
||||
const unsigned int uv_len = (frame->ssm ? frame->len: frame->uv_len);
|
||||
const int width = frame->width;
|
||||
const int height = frame->height;
|
||||
uint8_t *Cb = frame->data[1];
|
||||
uint8_t *Cr = frame->data[2];
|
||||
|
||||
@@ -82,10 +84,12 @@ static void contrast_cb_apply(VJFrame *frame, int width,int height, int *s) {
|
||||
}
|
||||
}
|
||||
|
||||
static void contrast_y_apply(VJFrame *frame, int width, int height, int *s) {
|
||||
static void contrast_y_apply(VJFrame *frame, int *s) {
|
||||
unsigned int r;
|
||||
register int m;
|
||||
const int len = frame->len;
|
||||
const int width = frame->width;
|
||||
const int height = frame->height;
|
||||
uint8_t *Y = frame->data[0];
|
||||
|
||||
for(r=0; r < len; r++) {
|
||||
@@ -99,19 +103,20 @@ static void contrast_y_apply(VJFrame *frame, int width, int height, int *s) {
|
||||
|
||||
}
|
||||
|
||||
void contrast_apply(VJFrame *frame, int width, int height, int *s ) {
|
||||
|
||||
switch(s[0]) {
|
||||
case 0:
|
||||
contrast_y_apply(frame, width,height, s);
|
||||
break;
|
||||
case 1:
|
||||
contrast_cb_apply(frame,width,height,s);
|
||||
break;
|
||||
void contrast_apply(VJFrame *frame,int *s )
|
||||
{
|
||||
switch(s[0])
|
||||
{
|
||||
case 0:
|
||||
contrast_y_apply(frame, s);
|
||||
break;
|
||||
case 1:
|
||||
contrast_cb_apply(frame, s);
|
||||
break;
|
||||
case 2:
|
||||
contrast_y_apply(frame,width,height,s);
|
||||
contrast_cb_apply(frame,width,height,s);
|
||||
break;
|
||||
contrast_y_apply(frame, s);
|
||||
contrast_cb_apply(frame, s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
vj_effect *contrast_init();
|
||||
|
||||
|
||||
void contrast_apply(VJFrame *frame, int w, int h, int *t);
|
||||
void contrast_apply(VJFrame *frame, int *t);
|
||||
|
||||
void contrast_free();
|
||||
#endif
|
||||
|
||||
@@ -402,8 +402,7 @@ extern void complexthreshold_apply(VJFrame *frame, VJFrame *frame2, int angle,
|
||||
int r, int g, int b, int level, int threshold);
|
||||
extern void complexsync_apply(VJFrame *frame, VJFrame *frame2, int val );
|
||||
extern void enhancemask_apply(VJFrame *frame, int *t);
|
||||
|
||||
extern void contrast_apply(VJFrame *frame, int w, int h, int *t);
|
||||
extern void contrast_apply(VJFrame *frame, int *t);
|
||||
|
||||
extern void noiseadd_apply(VJFrame *frame, int w , int h , int t, int n);
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ static void vj_effman_apply_image_effect(
|
||||
noiseadd_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1]);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_CONTRAST:
|
||||
contrast_apply(frames[0], frames[0]->width, frames[0]->height,arg);
|
||||
contrast_apply(frames[0], arg);
|
||||
break;
|
||||
case VJ_IMAGE_EFFECT_ENHANCEMASK:
|
||||
enhancemask_apply(frames[0],arg);
|
||||
|
||||
Reference in New Issue
Block a user