25 #ifndef LSST_AFW_MATH_DETAIL_CONVOLVE_H
26 #define LSST_AFW_MATH_DETAIL_CONVOLVE_H
38 #include "boost/shared_ptr.hpp"
48 #define IS_INSTANCE(A, B) (dynamic_cast<B const*>(&(A)) != NULL)
55 template <
typename OutImageT,
typename InImageT>
57 OutImageT& convolvedImage,
58 InImageT
const& inImage,
62 template <
typename OutImageT,
typename InImageT>
64 OutImageT& convolvedImage,
65 InImageT
const& inImage,
69 template <
typename OutImageT,
typename InImageT>
71 OutImageT& convolvedImage,
72 InImageT
const& inImage,
76 template <
typename OutImageT,
typename InImageT>
78 OutImageT& convolvedImage,
79 InImageT
const& inImage,
83 template <
typename OutImageT,
typename InImageT>
85 OutImageT &convolvedImage,
86 InImageT
const& inImage,
91 class RowOfKernelImagesForRegion;
184 void _moveUp(
bool isFirst,
int newHeight);
256 template <
typename OutImageT,
typename InImageT>
259 InImageT
const &inImage,
285 template <
typename OutImageT,
typename InImageT>
288 InImageT
const &inImage,
309 (static_cast<double>(length) / static_cast<double>(nDivisions))));
323 if (_kernelPtr->getDimensions() != imagePtr->getDimensions()) {
324 std::ostringstream os;
325 os <<
"image dimensions = ( "
326 << imagePtr->getWidth() <<
", " << imagePtr->getHeight()
327 <<
") != (" << _kernelPtr->getWidth() <<
", " << _kernelPtr->getHeight()
328 <<
") = kernel dimensions";
329 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError, os.str());
331 _imagePtrList[location] = imagePtr;
335 #endif // !defined(LSST_AFW_MATH_DETAIL_CONVOLVE_H)
std::vector< Location > LocationList
An include file to include the header files for lsst::afw::geom.
Declare the Kernel class and subclasses.
KernelConstPtr _kernelPtr
KernelConstPtr getKernel() const
boost::shared_ptr< KernelImagesForRegion > back()
Return the last region in the list.
static int const _MinInterpolationSize
boost::shared_ptr< Image > ImagePtr
boost::shared_ptr< KernelImagesForRegion const > ConstPtr
additional GPU exceptions
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...
Parameters to control convolution.
boost::shared_ptr< lsst::afw::math::Kernel const > KernelConstPtr
lsst::afw::geom::Box2I getBBox() const
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
ImagePtr getImage(Location location) const
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...
boost::shared_ptr< KernelImagesForRegion > front()
Return the first region in the list.
std::vector< ImagePtr > _imagePtrList
An integer coordinate rectangle.
kernel images used by convolveRegionWithInterpolation
lsst::afw::image::Image< lsst::afw::math::Kernel::Pixel > Image
table::Key< table::Array< Kernel::Pixel > > image
static int getMinInterpolationSize()
RegionList::iterator Iterator
afw::table::PointKey< int > dimensions
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.
RegionList::const_iterator end() const
Return the end iterator for the list.
std::vector< boost::shared_ptr< KernelImagesForRegion > > RegionList
lsst::afw::geom::Box2I _bbox
boost::shared_ptr< Persistable > Ptr
void _computeImage(Location location) const
lsst::afw::geom::Point2I getXY0() const
A kernel that is a linear combination of fixed basis kernels.
void _moveUp(bool isFirst, int newHeight)
Move the region up one segment.
static std::vector< int > _computeSubregionLengths(int length, int nDivisions)
A row of KernelImagesForRegion.
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.
bool computeNextRow(RowOfKernelImagesForRegion ®ionRow) const
Compute next row of subregions.
static int _computeNextSubregionLength(int length, int nDivisions)
Convolve and convolveAtAPoint functions for Image and Kernel.
bool getDoNormalize() const
#define LSST_EXCEPT(type,...)
RegionList::const_iterator begin() const
Return the begin iterator for the list.
Extent< int, N > floor(Extent< double, N > const &input)
lsst::afw::geom::Point2I getPixelIndex(Location location) const
boost::shared_ptr< KernelImagesForRegion const > getRegion(int ind) const
get the specified region (range-checked)
ConvolveWithInterpolationWorkingImages(geom::Extent2I const &dimensions)
Base class for all persistable classes.
Implementation of the Class MaskedImage.
RegionList::const_iterator ConstIterator
void _insertImage(Location location, ImagePtr imagePtr) const
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
RegionList::iterator begin()
Return the begin iterator for the list.
KernelImagesForRegion(KernelConstPtr kernelPtr, lsst::afw::geom::Box2I const &bbox, lsst::afw::geom::Point2I const &xy0, bool doNormalize)
Kernels are used for convolution with MaskedImages and (eventually) Images.
RowOfKernelImagesForRegion(int nx, int ny)
Construct a RowOfKernelImagesForRegion.
A kernel that has only one non-zero pixel (of value 1)
boost::shared_ptr< Image const > ImageConstPtr
RegionList::iterator end()
Return the end iterator for the list.
Include files required for standard LSST Exception handling.
lsst::afw::geom::Point2I _xy0