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)
lsst::afw::geom::Box2I _bbox
boost::shared_ptr< KernelImagesForRegion const > getRegion(int ind) const
get the specified region (range-checked)
An include file to include the header files for lsst::afw::geom.
Declare the Kernel class and subclasses.
lsst::afw::geom::Box2I getBBox() const
boost::shared_ptr< KernelImagesForRegion > Ptr
boost::shared_ptr< Image > ImagePtr
ImagePtr getImage(Location location) const
lsst::afw::geom::Point2I getXY0() const
RegionList::const_iterator begin() const
Return the begin iterator for the list.
KernelConstPtr _kernelPtr
void _moveUp(bool isFirst, int newHeight)
Move the region up one segment.
std::vector< Location > LocationList
Include files required for standard LSST Exception handling.
additional GPU exceptions
boost::shared_ptr< lsst::afw::math::Kernel const > KernelConstPtr
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< Image const > ImageConstPtr
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
RegionList::iterator Iterator
RegionList::iterator begin()
Return the begin iterator for the list.
RegionList::const_iterator end() const
Return the end iterator for the list.
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...
RegionList::iterator end()
Return the end iterator for the list.
bool getDoNormalize() const
static int const _MinInterpolationSize
static int getMinInterpolationSize()
lsst::afw::geom::Point2I _xy0
An integer coordinate rectangle.
boost::shared_ptr< KernelImagesForRegion > front()
Return the first region in the list.
kernel images used by convolveRegionWithInterpolation
table::Key< table::Array< Kernel::Pixel > > image
RegionList::const_iterator ConstIterator
void _insertImage(Location location, ImagePtr imagePtr) const
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.
lsst::afw::image::Image< lsst::afw::math::Kernel::Pixel > Image
void _computeImage(Location location) const
boost::shared_ptr< KernelImagesForRegion const > ConstPtr
A kernel that is a linear combination of fixed basis kernels.
lsst::afw::geom::Point2I getPixelIndex(Location location) const
std::vector< ImagePtr > _imagePtrList
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.
static std::vector< int > _computeSubregionLengths(int length, int nDivisions)
Convolve and convolveAtAPoint functions for Image and Kernel.
#define LSST_EXCEPT(type,...)
Extent< int, N > floor(Extent< double, N > const &input)
std::vector< boost::shared_ptr< KernelImagesForRegion > > RegionList
ConvolveWithInterpolationWorkingImages(geom::Extent2I const &dimensions)
RowOfKernelImagesForRegion(int nx, int ny)
Construct a RowOfKernelImagesForRegion.
KernelImagesForRegion(KernelConstPtr kernelPtr, lsst::afw::geom::Box2I const &bbox, lsst::afw::geom::Point2I const &xy0, bool doNormalize)
Base class for all persistable classes.
Implementation of the Class MaskedImage.
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
bool computeNextRow(RowOfKernelImagesForRegion ®ionRow) const
Compute next row of subregions.
Kernels are used for convolution with MaskedImages and (eventually) Images.
KernelConstPtr getKernel() const
A kernel that has only one non-zero pixel (of value 1)
boost::shared_ptr< KernelImagesForRegion > back()
Return the last region in the list.
static int _computeNextSubregionLength(int length, int nDivisions)