LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
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
x_iterator row_begin(int y) const
Definition: Image.h:319
x_iterator row_end(int y) const
Return an x_iterator to the end of the y&#39;th row.
Definition: Image.h:324
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition: Image.h:151
int getHeight() const
Return the number of rows in the image.
Definition: Image.h:239