34 #include "boost/format.hpp"
56 double kSum = kernel.
computeImage(kImage, doNormalize, xPos, yPos);
58 for (
int y = kImage.getHeight() - 1;
y >= 0; --
y) {
60 ptr != kImage.row_end(
y); ++ptr) {
63 std::cout << std::endl;
66 if (doNormalize && std::abs(static_cast<double>(kSum) - 1.0) > 1.0e-5) {
67 std::cout <<
boost::format(
"Warning! Sum of all pixels = %9.5f != 1.0\n") % kSum;
69 std::cout << std::endl;
void printKernel(lsst::afw::math::Kernel const &kernel, bool doNormalize, double x=0, double y=0, std::string pixelFmt="%7.3f")
Print the pixel values of a Kernel to std::cout.
_const_view_t::x_iterator const_x_iterator
A const iterator for traversing the pixels in a row.
geom::Extent2I const getDimensions() const
Return the Kernel's dimensions (width, height)
Kernels are used for convolution with MaskedImages and (eventually) Images.
Utility functions for kernels.
double computeImage(lsst::afw::image::Image< Pixel > &image, bool doNormalize, double x=0.0, double y=0.0) const
Compute an image (pixellized representation of the kernel) in place.