From 6adf7f8e7f8b42b877eb8b97de028915985618cf Mon Sep 17 00:00:00 2001 From: Thibaut Mattern Date: Mon, 17 Feb 2003 00:02:52 +0000 Subject: Better method to fade out a yuv pixel. CVS patchset: 4177 CVS date: 2003/02/17 00:02:52 --- src/post/visualizations/fftscope.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c index e10527def..ad898ed16 100644 --- a/src/post/visualizations/fftscope.c +++ b/src/post/visualizations/fftscope.c @@ -22,7 +22,7 @@ * * FFT code by Steve Haehnichen, originally licensed under GPL v1 * - * $Id: fftscope.c,v 1.9 2003/02/12 00:43:33 tmattern Exp $ + * $Id: fftscope.c,v 1.10 2003/02/17 00:02:52 tmattern Exp $ * */ @@ -250,6 +250,7 @@ static void scale (complex wave[], int bits) * Fade out a YUV pixel */ void fade_out_yuv(uint8_t *y, uint8_t *u, uint8_t *v, float factor) { +#if 0 float r, g, b; /* YUV -> RGB */ @@ -266,6 +267,11 @@ void fade_out_yuv(uint8_t *y, uint8_t *u, uint8_t *v, float factor) { *y = (uint8_t)((0.257 * r) + (0.504 * g) + (0.098 * b) + 16); *u = (uint8_t)(-(0.148 * r) - (0.291 * g) + (0.439 * b) + 128); *v = (uint8_t)((0.439 * r) - (0.368 * g) - (0.071 * b) + 128); +#endif + + *y = (uint8_t)(factor * (*y - 16)) + 16; + *u = (uint8_t)(factor * (*u - 128)) + 128; + *v = (uint8_t)(factor * (*v - 128)) + 128; } -- cgit v1.2.3