37 template <
typename ImageT>
39 return binImage(in, binsize, binsize, flags);
42 template <
typename ImageT>
49 if (binX <= 0 || binY <= 0) {
54 int const outWidth = in.getWidth() / binX;
55 int const outHeight = in.getHeight() / binY;
59 out->setXY0(in.getXY0());
60 *out =
typename ImageT::SinglePixel(0);
62 for (
int oy = 0, iy = 0; oy < out->getHeight(); ++oy) {
63 for (
int i = 0; i != binY; ++i, ++iy) {
64 typename ImageT::x_iterator optr = out->row_begin(oy);
65 for (
typename ImageT::x_iterator iptr = in.row_begin(iy), iend = iptr + binX * outWidth;
67 typename ImageT::SinglePixel
val = *iptr;
69 for (
int j = 1; j != binX; ++j, ++iptr) {
76 for (
typename ImageT::x_iterator
ptr = out->row_begin(oy),
end = out->row_end(oy);
ptr !=
end;
89 #define INSTANTIATE(TYPE) \ 90 template std::shared_ptr<image::Image<TYPE>> binImage(image::Image<TYPE> const&, int, \ 91 lsst::afw::math::Property const); \ 92 template std::shared_ptr<image::Image<TYPE>> binImage(image::Image<TYPE> const&, int, int, \ 93 lsst::afw::math::Property const); \ 94 template std::shared_ptr<image::MaskedImage<TYPE>> binImage(image::MaskedImage<TYPE> const&, int, \ 95 lsst::afw::math::Property const); \ 96 template std::shared_ptr<image::MaskedImage<TYPE>> binImage(image::MaskedImage<TYPE> const&, int, int, \ 97 lsst::afw::math::Property const);
Reports arguments outside the domain of an operation.
A base class for image defects.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Reports invalid arguments.
Property
control what is calculated
#define INSTANTIATE(FROMSYS, TOSYS)
std::shared_ptr< ImageT > binImage(ImageT const &inImage, int const binX, int const binY, lsst::afw::math::Property const flags=lsst::afw::math::MEAN)