Bladeren bron

Se cambio debug como if del preprocessor.

Fabian 11 jaren geleden
bovenliggende
commit
0456ab67e8
2 gewijzigde bestanden met toevoegingen van 10 en 10 verwijderingen
  1. 7 4
      filtros/blur_c.c
  2. 3 6
      informe/subBlur.tex

+ 7 - 4
filtros/blur_c.c

@@ -3,7 +3,7 @@
 #include <math.h>
 #define M_PI 3.14159265358979323846
 #include "../tp2.h"
-#define DEBUG 1
+#define DEBUG 0
 /**
 *	Calculo la matriz de convulsión.
 *	Hago el calculo de todos los componentes.
@@ -17,8 +17,9 @@ float* convulcion_matrix(float sigma, int r) {
 	unsigned int tam = diff*largo;
 	float* conv_matrix = malloc(sizeof(float)*tam);
 
-	if (DEBUG)
+	#if DEBUG
 		printf("Sigma: %f | Radio: %d \n", sigma,r);
+	#endif
 	// Recorro cada pixel
 	for (int y = -r; y <= r; y++) {
 		for (int x = -r; x <= r+1; x++) {
@@ -28,12 +29,14 @@ float* convulcion_matrix(float sigma, int r) {
 			} else {
 				conv_matrix[contador] = (1 / (2*M_PI*sigma*sigma)) * exp(- (pow(x,2)+pow(y,2))/(2*sigma*sigma));
 			}
-			if (DEBUG)
+			#if DEBUG
 				printf("%.8f\t", conv_matrix[contador]);
+			#endif
 			contador++;
 		}
-		if (DEBUG)
+		#if DEBUG
 			printf("\n");
+		#endif
 	}
 	return conv_matrix;
 }

File diff suppressed because it is too large
+ 3 - 6
informe/subBlur.tex