LCOV - code coverage report
Current view: top level - imageanalysis/ImageAnalysis - ImageMask.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 8 10 80.0 %
Date: 2024-12-11 20:54:31 Functions: 1 3 33.3 %

          Line data    Source code
       1             : //# ImageMask.cc
       2             : //# Copyright (C) 1998,1999,2000,2001
       3             : //# Associated Universities, Inc. Washington DC, USA.
       4             : //#
       5             : //# This library is free software; you can redistribute it and/or modify it
       6             : //# under the terms of the GNU Library General Public License as published by
       7             : //# the Free Software Foundation; either version 2 of the License, or (at your
       8             : //# option) any later version.
       9             : //#
      10             : //# This library is distributed in the hope that it will be useful, but WITHOUT
      11             : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12             : //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
      13             : //# License for more details.
      14             : //#
      15             : //# You should have received a copy of the GNU Library General Public License
      16             : //# along with this library; if not, write to the Free Software Foundation,
      17             : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
      18             : //#
      19             : //# Correspondence concerning AIPS++ should be addressed as follows:
      20             : //#        Internet email: casa-feedback@nrao.edu.
      21             : //#        Postal address: AIPS++ Project Office
      22             : //#                        National Radio Astronomy Observatory
      23             : //#                        520 Edgemont Road
      24             : //#                        Charlottesville, VA 22903-2475 USA
      25             : //#
      26             : 
      27             : #include <imageanalysis/ImageAnalysis/ImageMask.h>
      28             : 
      29             : #include <casacore/lattices/Lattices/MaskedLatticeIterator.h>
      30             : 
      31             : using namespace casacore;
      32             : namespace casa {
      33             : 
      34           0 : ImageMask::~ImageMask() {}
      35             : 
      36         129 : Bool ImageMask::isAllMaskTrue(
      37             :         const Lattice<Bool>& mask
      38             : ) {
      39         129 :         auto cursorShape = mask.niceCursorShape(4096*4096);
      40         129 :         LatticeStepper stepper(mask.shape(), cursorShape, LatticeStepper::RESIZE);
      41         129 :         RO_LatticeIterator<Bool> iter(mask, stepper);
      42         129 :         for (iter.reset(); ! iter.atEnd(); ++iter) {
      43         129 :                 if (! allTrue(iter.cursor())) {
      44         129 :                         return false;
      45             :                 }
      46             :         }
      47           0 :         return true;
      48         129 : }
      49             : 
      50             : }

Generated by: LCOV version 1.16