LCOV - code coverage report
Current view: top level - imageanalysis/ImageAnalysis - ImagePadder.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 6 7 85.7 %
Date: 2024-11-06 17:42:47 Functions: 2 2 100.0 %

          Line data    Source code
       1             : //# tSubImage.cc: Test program for class SubImage
       2             : //# Copyright (C) 1998,1999,2000,2001,2003
       3             : //# Associated Universities, Inc. Washington DC, USA.
       4             : //#
       5             : //# This program is free software; you can redistribute it and/or modify it
       6             : //# under the terms of the GNU General Public License as published by the Free
       7             : //# Software Foundation; either version 2 of the License, or (at your option)
       8             : //# any later version.
       9             : //#
      10             : //# This program 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 General Public License for
      13             : //# more details.
      14             : //#
      15             : //# You should have received a copy of the GNU General Public License along
      16             : //# with this program; if not, write to the Free Software Foundation, Inc.,
      17             : //# 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             : //# $Id: tSubImage.cc 20567 2009-04-09 23:12:39Z gervandiepen $
      27             : 
      28             : #ifndef IMAGES_IMAGEPADDER_H
      29             : #define IMAGES_IMAGEPADDER_H
      30             : 
      31             : #include <imageanalysis/ImageAnalysis/ImageTask.h>
      32             : 
      33             : #include <casacore/casa/namespace.h>
      34             : 
      35             : 
      36             : namespace casacore{
      37             : 
      38             : class MDirection;
      39             : }
      40             : 
      41             : namespace casa {
      42             : 
      43             : class ImagePadder : public ImageTask<casacore::Float> {
      44             :         // <summary>
      45             :         // Top level interface for padding an image in direction space.
      46             :         // </summary>
      47             : 
      48             :         // <reviewed reviewer="" date="" tests="" demos="">
      49             :         // </reviewed>
      50             : 
      51             :         // <prerequisite>
      52             :         // </prerequisite>
      53             : 
      54             :         // <etymology>
      55             :         // Collapses image.
      56             :         // </etymology>
      57             : 
      58             :         // <synopsis>
      59             :         // High level interface for padding an image.
      60             :         // </synopsis>
      61             : 
      62             :         // <example>
      63             :         // <srcblock>
      64             :         // ImagePadder padder();
      65             :         // padder.pad();
      66             :         // </srcblock>
      67             :         // </example>
      68             : 
      69             : public:
      70             :         // <group>
      71             : 
      72             :         ImagePadder(
      73             :                         const SPCIIF  image,
      74             :                 const casacore::Record *const regionRec=0,
      75             :                 const casacore::String& box="", const casacore::String& chanInp="",
      76             :                 const casacore::String& stokes="", const casacore::String& maskInp="",
      77             :                 const casacore::String& outname="", const casacore::Bool overwrite=""
      78             :         );
      79             : 
      80             :         // </group>
      81             : 
      82             :         // destructor
      83             :         ~ImagePadder();
      84             : 
      85             :         // perform the padding. If <src>wantReturn</src> is true, return a pointer to the
      86             :         // padded image. The returned pointer is created via new(); it is the caller's
      87             :         // responsibility to delete the returned pointer. If <src>wantReturn</src> is false,
      88             :         // a NULL pointer is returned and pointer deletion is performed internally.
      89             :         SPIIF pad(const casacore::Bool wantReturn) const;
      90             : 
      91             :         // set the number of pixels to use for padding and their values and if they should be
      92             :         // masked on each edge of the direction plane. <src>good</src>=true means the padding
      93             :         // pixels will not be masked (set to good, mask values = true).
      94             :         void setPaddingPixels(const casacore::uInt nPixels, const casacore::Float value=0, const casacore::Bool good=false);
      95             : 
      96             :         casacore::String getClass() const;
      97             : 
      98             : protected:
      99         127 :         inline  CasacRegionManager::StokesControl _getStokesControl() const {
     100         127 :                 return CasacRegionManager::USE_ALL_STOKES;
     101             :         }
     102             : 
     103         127 :         inline std::vector<casacore::Coordinate::Type> _getNecessaryCoordinates() const {
     104         127 :                 std::vector<casacore::Coordinate::Type> v;
     105         127 :                 v.push_back(casacore::Coordinate::DIRECTION);
     106         127 :                 return v;
     107           0 :         }
     108             : 
     109             : private:
     110             :         casacore::uInt _nPixels;
     111             :         casacore::Float _value;
     112             :         casacore::Bool _good;
     113             :         static const casacore::String _class;
     114             : 
     115             :         // disallow default constructor
     116             :         ImagePadder();
     117             : };
     118             : }
     119             : 
     120             : #endif

Generated by: LCOV version 1.16