LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Classes | Functions
lsst::afw::image::details Namespace Reference

Classes

struct  Plus
 
struct  Minus
 
struct  Mult
 
struct  Div
 

Functions

template<typename OperatorT , typename PixelT >
void operate (Image< PixelT > &img, ImageSlice< PixelT > const &slc, typename ImageSlice< PixelT >::ImageSliceType sliceType)
 A function to loop over pixels and perform the requested operation. More...
 

Function Documentation

template<typename OperatorT , typename PixelT >
void lsst::afw::image::details::operate ( Image< PixelT > &  img,
ImageSlice< PixelT > const &  slc,
typename ImageSlice< PixelT >::ImageSliceType  sliceType 
)

A function to loop over pixels and perform the requested operation.

Definition at line 92 of file ImageSlice.h.

93  {
94 
95  OperatorT op;
96 
97  if (sliceType == ImageSlice<PixelT>::ROW) {
98  for (int y = 0; y < img.getHeight(); ++y) {
99  typename ImageSlice<PixelT>::x_iterator pSlc = slc.row_begin(0);
100  for (typename Image<PixelT>::x_iterator pImg = img.row_begin(y), end = img.row_end(y);
101  pImg != end; ++pImg, ++pSlc) {
102  *pImg = op(*pImg, *pSlc);
103  }
104  }
105  } else if (sliceType == ImageSlice<PixelT>::COLUMN) {
106 
107  typename ImageSlice<PixelT>::y_iterator pSlc = slc.col_begin(0);
108  for (int y = 0; y < img.getHeight(); ++y, ++pSlc) {
109  for (typename Image<PixelT>::x_iterator pImg = img.row_begin(y), end = img.row_end(y);
110  pImg != end; ++pImg) {
111  *pImg = op(*pImg, *pSlc);
112  }
113  }
114  }
115 
116 }
int y