25#if !defined(LSST_AFW_IMAGE_SLICE_H)
26#define LSST_AFW_IMAGE_SLICE_H
45template <
typename PixelT>
72template <
typename PixelT>
74 PixelT
operator()(PixelT
const imgPix, PixelT
const slcPix) {
return imgPix + slcPix; }
76template <
typename PixelT>
78 PixelT
operator()(PixelT
const imgPix, PixelT
const slcPix) {
return imgPix - slcPix; }
80template <
typename PixelT>
82 PixelT
operator()(PixelT
const imgPix, PixelT
const slcPix) {
return imgPix * slcPix; }
84template <
typename PixelT>
86 PixelT
operator()(PixelT
const imgPix, PixelT
const slcPix) {
return imgPix / slcPix; }
93template <
typename OperatorT,
typename PixelT>
102 pImg !=
end; ++pImg, ++pSlc) {
103 *pImg = op(*pImg, *pSlc);
110 pImg !=
end; ++pImg) {
111 *pImg = op(*pImg, *pSlc);
128template <
typename PixelT>
139template <
typename PixelT>
150template <
typename PixelT>
151void operator+=(Image<PixelT> &img, ImageSlice<PixelT>
const &slc);
163template <
typename PixelT>
174template <
typename PixelT>
175void operator-=(Image<PixelT> &img, ImageSlice<PixelT>
const &slc);
187template <
typename PixelT>
198template <
typename PixelT>
209template <
typename PixelT>
210void operator*=(Image<PixelT> &img, ImageSlice<PixelT>
const &slc);
222template <
typename PixelT>
233template <
typename PixelT>
234void operator/=(Image<PixelT> &img, ImageSlice<PixelT>
const &slc);
y_iterator col_begin(int x) const
Return an y_iterator to the start of the y'th row.
typename ndarray::Array< PixelT, 2, 1 > Array
A mutable ndarray representation of the image.
int getHeight() const
Return the number of rows in the image.
x_iterator row_begin(int y) const
Return an x_iterator to the start of the y'th row.
x_iterator row_end(int y) const
Return an x_iterator to the end of the y'th row.
typename _view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
typename _view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
A class to represent a 2-dimensional array of pixels.
A class to specify a slice of an image.
ImageSliceType getImageSliceType() const
ImageSlice(Image< PixelT > const &img)
Constructor for ImageSlice.
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.
std::shared_ptr< Image< PixelT > > operator+(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator+()
Image< LhsPixelT > & operator+=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Add lhs to Image rhs (i.e. pixel-by-pixel addition) where types are different.
Image< LhsPixelT > & operator-=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Subtract lhs from Image rhs (i.e. pixel-by-pixel subtraction) where types are different.
std::shared_ptr< Image< PixelT > > operator*(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator*()
std::shared_ptr< Image< PixelT > > operator/(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator/()
std::shared_ptr< Image< PixelT > > operator-(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator-()
Image< LhsPixelT > & operator/=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Divide lhs by Image rhs (i.e. pixel-by-pixel division) where types are different.
Image< LhsPixelT > & operator*=(Image< LhsPixelT > &lhs, Image< RhsPixelT > const &rhs)
Multiply lhs by Image rhs (i.e. pixel-by-pixel multiplication) where types are different.
PixelT operator()(PixelT const imgPix, PixelT const slcPix)
PixelT operator()(PixelT const imgPix, PixelT const slcPix)
PixelT operator()(PixelT const imgPix, PixelT const slcPix)
PixelT operator()(PixelT const imgPix, PixelT const slcPix)