From: <jo...@us...> - 2012-09-07 15:21:46
|
Revision: 10979 http://octave.svn.sourceforge.net/octave/?rev=10979&view=rev Author: jordigh Date: 2012-09-07 15:21:39 +0000 (Fri, 07 Sep 2012) Log Message: ----------- bwlabeln.cc: Remove dead code, reformat copyright, fix typo in mask8 Modified Paths: -------------- trunk/octave-forge/main/image/src/bwlabeln.cc Modified: trunk/octave-forge/main/image/src/bwlabeln.cc =================================================================== --- trunk/octave-forge/main/image/src/bwlabeln.cc 2012-09-07 15:13:33 UTC (rev 10978) +++ trunk/octave-forge/main/image/src/bwlabeln.cc 2012-09-07 15:21:39 UTC (rev 10979) @@ -1,17 +1,18 @@ -// Copyright (C) 2011 Jordi Gutiérrez Hermoso <jo...@oc...> +// Copyright (C) 2011-2012 Jordi Gutiérrez Hermoso <jo...@oc...> // -// This program is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free Software -// Foundation; either version 3 of the License, or (at your option) any later -// version. +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 3 of the +// License, or (at your option) any later version. // -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -// details. +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. // -// You should have received a copy of the GNU General Public License along with -// this program; if not, see <http://www.gnu.org/licenses/>. +// You should have received a copy of the GNU General Public License +// along with this program; if not, see +// <http://www.gnu.org/licenses/>. // bwlabeln.cc --- @@ -88,20 +89,6 @@ inline coord -operator+ (const coord& a, const coord& b) -{ - octave_idx_type na = a.nelem (); - coord retval( dim_vector(na,1) ); - for (octave_idx_type i = 0; i < na; i++) - { - retval(i) = a(i) + b(i); - } - return retval; -} - - -inline -coord operator- (const coord& a, const coord& b) { octave_idx_type na = a.nelem (); @@ -169,7 +156,7 @@ static bool mask8[] = {1, 1, 1, 1, 0, 1, - 1, 0, 1}; + 1, 1, 1}; static bool mask6[] = {0, 0, 0, 0, 1, 0, @@ -264,6 +251,11 @@ get_padded_index (octave_idx_type r, const dim_vector& dv) { + // This function converts a linear index from the unpadded array + // into a linear index of the array with zero padding around it. I + // worked it out on paper, but if you want me to explain this, I'd + // have to work it out again. ;-) --jgh + octave_idx_type mult = 1; octave_idx_type padded = 0; for (octave_idx_type j = 0; j < dv.length (); j++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |