25 #if !defined(LSST_AFW_IMAGE_SLICE_H) 26 #define LSST_AFW_IMAGE_SLICE_H 45 template <
typename PixelT>
72 template <
typename PixelT>
74 PixelT
operator()(PixelT
const imgPix, PixelT
const slcPix) {
return imgPix + slcPix; }
76 template <
typename PixelT>
78 PixelT
operator()(PixelT
const imgPix, PixelT
const slcPix) {
return imgPix - slcPix; }
80 template <
typename PixelT>
82 PixelT
operator()(PixelT
const imgPix, PixelT
const slcPix) {
return imgPix * slcPix; }
84 template <
typename PixelT>
86 PixelT
operator()(PixelT
const imgPix, PixelT
const slcPix) {
return imgPix / slcPix; }
93 template <
typename OperatorT,
typename PixelT>
99 for (
int y = 0; y < img.
getHeight(); ++y) {
102 pImg !=
end; ++pImg, ++pSlc) {
103 *pImg = op(*pImg, *pSlc);
108 for (
int y = 0; y < img.
getHeight(); ++y, ++pSlc) {
110 pImg !=
end; ++pImg) {
111 *pImg = op(*pImg, *pSlc);
128 template <
typename PixelT>
139 template <
typename PixelT>
150 template <
typename PixelT>
163 template <
typename PixelT>
174 template <
typename PixelT>
187 template <
typename PixelT>
198 template <
typename PixelT>
209 template <
typename PixelT>
222 template <
typename PixelT>
233 template <
typename PixelT>
std::shared_ptr< Image< PixelT > > operator+(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator+()
ImageSliceType getImageSliceType() const
ImageSlice(Image< PixelT > const &img)
Constructor for ImageSlice.
int getHeight() const
Return the number of rows in the image.
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
std::shared_ptr< Image< PixelT > > operator/(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator/()
x_iterator row_begin(int y) const
Return an x_iterator to the start of the y'th row.
PixelT operator()(PixelT const imgPix, PixelT const slcPix)
Image & operator+=(PixelT const rhs)
Add scalar rhs to lhs.
std::shared_ptr< Image< PixelT > > operator*(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator*()
y_iterator col_begin(int x) const
Return an y_iterator to the start of the y'th row.
Image & operator-=(PixelT const rhs)
Subtract scalar rhs from lhs.
A base class for image defects.
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.
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
PixelT operator()(PixelT const imgPix, PixelT const slcPix)
std::shared_ptr< Image< PixelT > > operator-(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator-()
Image & operator/=(PixelT const rhs)
Divide lhs by scalar rhs.
iterator end() const
Return an STL compliant iterator to the end of the image.
PixelT operator()(PixelT const imgPix, PixelT const slcPix)
x_iterator row_end(int y) const
Return an x_iterator to the end of the y'th row.
Image & operator*=(PixelT const rhs)
Multiply lhs by scalar rhs.
A class to represent a 2-dimensional array of pixels.
PixelT operator()(PixelT const imgPix, PixelT const slcPix)
A class to specify a slice of an image.