40template <
typename PixelT>
43 if (
img.getWidth() != 1 &&
img.getHeight() != 1) {
45 }
else if (
img.getWidth() == 1 &&
img.getHeight() == 1) {
47 "1x1 image ambiguous (could be row or column). "
48 "Perhaps a constant would be better than a slice? ");
49 }
else if (
img.getWidth() == 1 &&
img.getHeight() != 1) {
51 }
else if (
img.getHeight() == 1 &&
img.getWidth() != 1) {
68template <
typename PixelT>
75template <
typename PixelT>
80template <
typename PixelT>
88template <
typename PixelT>
95template <
typename PixelT>
103template <
typename PixelT>
110template <
typename PixelT>
115template <
typename PixelT>
122template <
typename PixelT>
129template <
typename PixelT>
139#define INSTANTIATE_SLICE_OP_SYM(TYPE, OP) \
140 template std::shared_ptr<Image<TYPE>> operator OP(Image<TYPE> const &img, ImageSlice<TYPE> const &slc); \
141 template std::shared_ptr<Image<TYPE>> operator OP(ImageSlice<TYPE> const &slc, Image<TYPE> const &img)
143#define INSTANTIATE_SLICE_OP_ASYM(TYPE, OP) \
144 template std::shared_ptr<Image<TYPE>> operator OP(Image<TYPE> const &img, ImageSlice<TYPE> const &slc)
146#define INSTANTIATE_SLICE_OPEQ(TYPE, OP) \
147 template void operator OP(Image<TYPE> &img, ImageSlice<TYPE> const &slc)
149#define INSTANTIATE_SLICES(TYPE) \
150 template ImageSlice<TYPE>::ImageSlice(Image<TYPE> const &image); \
151 INSTANTIATE_SLICE_OP_SYM(TYPE, +); \
152 INSTANTIATE_SLICE_OP_ASYM(TYPE, -); \
153 INSTANTIATE_SLICE_OP_SYM(TYPE, *); \
154 INSTANTIATE_SLICE_OP_ASYM(TYPE, /); \
155 INSTANTIATE_SLICE_OPEQ(TYPE, +=); \
156 INSTANTIATE_SLICE_OPEQ(TYPE, -=); \
157 INSTANTIATE_SLICE_OPEQ(TYPE, *=); \
158 INSTANTIATE_SLICE_OPEQ(TYPE, /=)
160INSTANTIATE_SLICES(
double);
161INSTANTIATE_SLICES(
float);
#define LSST_EXCEPT(type,...)
typename ndarray::Array< PixelT, 2, 1 > Array
A mutable ndarray representation of the image.
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.
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.