From: <jo...@us...> - 2012-09-18 18:44:02
|
Revision: 11048 http://octave.svn.sourceforge.net/octave/?rev=11048&view=rev Author: jordigh Date: 2012-09-18 18:43:56 +0000 (Tue, 18 Sep 2012) Log Message: ----------- whitespace fix Modified Paths: -------------- trunk/octave-forge/main/image/src/__bwdist.cc Modified: trunk/octave-forge/main/image/src/__bwdist.cc =================================================================== --- trunk/octave-forge/main/image/src/__bwdist.cc 2012-09-18 15:23:21 UTC (rev 11047) +++ trunk/octave-forge/main/image/src/__bwdist.cc 2012-09-18 18:43:56 UTC (rev 11048) @@ -90,7 +90,7 @@ { const int nargin = args.length(); octave_value_list retval; - + /* Check for proper number of input and output arguments */ if ((nargin < 1) || (nargin>2)) { error ("bwdist accepts only one or two input parameters."); @@ -119,13 +119,13 @@ charMatrix method = args(1).char_matrix_value(); if(method(0) == 'e') caseMethod = 0; // Euclidean; else if (method(0) == 'c') { - if(method(1) == 'h') caseMethod = 1; // chessboard - else if(method(1) == 'i') caseMethod = 2; // cityblock + if(method(1) == 'h') caseMethod = 1; // chessboard + else if(method(1) == 'i') caseMethod = 2; // cityblock } else if(method(0) == 'q') caseMethod = 3; // quasi-Euclidean else { - warning ("unknown metric, using 'euclidean'"); - caseMethod = 0; + warning ("unknown metric, using 'euclidean'"); + caseMethod = 0; } } @@ -141,46 +141,46 @@ switch(caseMethod) { case 1: - chessboard(bw, rows, cols, xdist, ydist); - for(int i=0; i<rows*cols; i++) { - D(i) = DIST_CHESSBOARD(xdist[i], ydist[i]); - } - break; + chessboard(bw, rows, cols, xdist, ydist); + for(int i=0; i<rows*cols; i++) { + D(i) = DIST_CHESSBOARD(xdist[i], ydist[i]); + } + break; case 2: - cityblock(bw, rows, cols, xdist, ydist); - for(int i=0; i<rows*cols; i++) { - D(i) = DIST_CITYBLOCK(xdist[i], ydist[i]); - } - break; + cityblock(bw, rows, cols, xdist, ydist); + for(int i=0; i<rows*cols; i++) { + D(i) = DIST_CITYBLOCK(xdist[i], ydist[i]); + } + break; case 3: - quasi_euclidean(bw, rows, cols, xdist, ydist); - for(int i=0; i<rows*cols; i++) { - D(i) = DIST_QUASI_EUCLIDEAN(xdist[i], ydist[i]); - } - break; + quasi_euclidean(bw, rows, cols, xdist, ydist); + for(int i=0; i<rows*cols; i++) { + D(i) = DIST_QUASI_EUCLIDEAN(xdist[i], ydist[i]); + } + break; case 0: default: - euclidean(bw, rows, cols, xdist, ydist); - /* Remember sqrt() for the final output */ - for(int i=0; i<rows*cols; i++) { - D(i) = sqrt((double)DIST_EUCLIDEAN(xdist[i], ydist[i])); - } - break; + euclidean(bw, rows, cols, xdist, ydist); + /* Remember sqrt() for the final output */ + for(int i=0; i<rows*cols; i++) { + D(i) = sqrt((double)DIST_EUCLIDEAN(xdist[i], ydist[i])); + } + break; } retval(0) = D; if(nargout > 1) { - /* Create a second output array */ - Matrix C (rows, cols); - /* Compute optional 'index to closest object pixel' */ - for(int i=0; i<rows*cols; i++) { - C (i) = i+1 - xdist[i] - ydist[i]*rows; - } - retval(1) = C; + /* Create a second output array */ + Matrix C (rows, cols); + /* Compute optional 'index to closest object pixel' */ + for(int i=0; i<rows*cols; i++) { + C (i) = i+1 - xdist[i] - ydist[i]*rows; + } + retval(1) = C; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |