| LSSTApplications
    20.0.0
    LSSTDataManagementBasePackage | 
 
 
 
Go to the documentation of this file.
   25 #ifndef LSST_AFW_MATH_DETAIL_CONVOLVE_H 
   26 #define LSST_AFW_MATH_DETAIL_CONVOLVE_H 
   40 #define IS_INSTANCE(A, B) (dynamic_cast<B const*>(&(A)) != NULL) 
   67 template <
typename OutImageT, 
typename InImageT>
 
   79 template <
typename OutImageT, 
typename InImageT>
 
   80 void basicConvolve(OutImageT& convolvedImage, InImageT 
const& inImage,
 
  105 template <
typename OutImageT, 
typename InImageT>
 
  106 void basicConvolve(OutImageT& convolvedImage, InImageT 
const& inImage,
 
  118 template <
typename OutImageT, 
typename InImageT>
 
  119 void basicConvolve(OutImageT& convolvedImage, InImageT 
const& inImage,
 
  146 template <
typename OutImageT, 
typename InImageT>
 
  288     void _computeImage(
Location location) 
const;
 
  303     void _moveUp(
bool isFirst, 
int newHeight);
 
  306     static inline int _computeNextSubregionLength(
int length, 
int nDivisions);
 
  326     static int const _MinInterpolationSize;
 
  350     RegionList::const_iterator 
begin()
 const { 
return _regionList.
begin(); };
 
  354     RegionList::const_iterator 
end()
 const { 
return _regionList.
end(); };
 
  358     RegionList::iterator 
begin() { 
return _regionList.
begin(); };
 
  362     RegionList::iterator 
end() { 
return _regionList.
end(); };
 
  380     bool hasData()
 const { 
return static_cast<bool>(_regionList[0]); };
 
  410 template <
typename OutImageT, 
typename InImageT>
 
  448 template <
typename OutImageT, 
typename InImageT>
 
  464 inline int KernelImagesForRegion::_computeNextSubregionLength(
 
  468     return static_cast<int>(
 
  469             std::floor(0.5 + (
static_cast<double>(
length) / 
static_cast<double>(nDivisions))));
 
  478 inline void KernelImagesForRegion::_insertImage(Location location,  
 
  482         if (_kernelPtr->
getDimensions() != imagePtr->getDimensions()) {
 
  484             os << 
"image dimensions = ( " << imagePtr->getWidth() << 
", " << imagePtr->getHeight() << 
") != (" 
  485                << _kernelPtr->
getWidth() << 
", " << _kernelPtr->
getHeight() << 
") = kernel dimensions";
 
  488         _imagePtrList[location] = imagePtr;
 
  496 #endif  // !defined(LSST_AFW_MATH_DETAIL_CONVOLVE_H) 
  
std::shared_ptr< KernelImagesForRegion > front()
Return the first region in the list.
A row of KernelImagesForRegion.
lsst::geom::Extent2I const getDimensions() const
Return the Kernel's dimensions (width, height)
A kernel that has only one non-zero pixel (of value 1)
std::shared_ptr< Image > ImagePtr
int getHeight() const
Return the Kernel's height.
lsst::geom::Box2I getBBox() const
Get the bounding box for the region.
KernelConstPtr getKernel() const
Get the kernel (as a shared pointer to const)
RowOfKernelImagesForRegion(int nx, int ny)
Construct a RowOfKernelImagesForRegion.
std::shared_ptr< Image const  > ImageConstPtr
kernel images used by convolveRegionWithInterpolation
lsst::geom::Point2I getPixelIndex(Location location) const
Compute pixel index of a given location, relative to the parent image (thus offset by bottom left cor...
RegionList::iterator end()
Return the end iterator for the list.
Location
locations of various points in the region
RegionList::const_iterator end() const
Return the end iterator for the list.
RegionList::iterator Iterator
static int getMinInterpolationSize()
Get the minInterpolationSize class constant.
RegionList::iterator begin()
Return the begin iterator for the list.
A kernel that is a linear combination of fixed basis kernels.
void convolveWithBruteForce(OutImageT &convolvedImage, InImageT const &inImage, lsst::afw::math::Kernel const &kernel, lsst::afw::math::ConvolutionControl const &convolutionControl)
Convolve an Image or MaskedImage with a Kernel by computing the kernel image at every point.
lsst::afw::image::Image< lsst::afw::math::Kernel::Pixel > Image
RegionList::const_iterator ConstIterator
std::shared_ptr< KernelImagesForRegion > back()
Return the last region in the list.
lsst::afw::image::Image< lsst::afw::math::Kernel::Pixel > Image
RegionList::const_iterator begin() const
Return the begin iterator for the list.
afw::table::PointKey< int > dimensions
int getWidth() const
Return the Kernel's width.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
bool getDoNormalize() const
Get the doNormalize parameter.
ImagePtr getImage(Location location) const
Return the image and sum at the specified location.
lsst::geom::Point2I getXY0() const
Get xy0 of the image.
bool computeNextRow(RowOfKernelImagesForRegion ®ionRow) const
Compute next row of subregions.
Parameters to control convolution.
Reports invalid arguments.
void basicConvolve(OutImageT &convolvedImage, InImageT const &inImage, lsst::afw::math::Kernel const &kernel, lsst::afw::math::ConvolutionControl const &convolutionControl)
Low-level convolution function that does not set edge pixels.
An integer coordinate rectangle.
A collection of Kernel images for special locations on a rectangular region of an image.
KernelImagesForRegion(KernelConstPtr kernelPtr, lsst::geom::Box2I const &bbox, lsst::geom::Point2I const &xy0, bool doNormalize)
Construct a KernelImagesForRegion.
std::shared_ptr< KernelImagesForRegion const  > getRegion(int ind) const
get the specified region (range-checked)
Kernels are used for convolution with MaskedImages and (eventually) Images.
ConvolveWithInterpolationWorkingImages(lsst::geom::Extent2I const &dimensions)
std::shared_ptr< lsst::afw::math::Kernel const  > KernelConstPtr
std::vector< std::shared_ptr< KernelImagesForRegion > > RegionList
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
void convolveRegionWithInterpolation(OutImageT &outImage, InImageT const &inImage, KernelImagesForRegion const ®ion, ConvolveWithInterpolationWorkingImages &workingImages)
Convolve a region of an Image or MaskedImage with a spatially varying Kernel using interpolation.
void convolveWithInterpolation(OutImageT &outImage, InImageT const &inImage, lsst::afw::math::Kernel const &kernel, ConvolutionControl const &convolutionControl)
Convolve an Image or MaskedImage with a spatially varying Kernel using linear interpolation.