43template <
typename ImageT>
56 throw LSST_EXCEPT(ex::InvalidParameterError,
"Image contains no pixels");
61 throw LSST_EXCEPT(lsst::pex::exceptions::OverflowError,
62 str(boost::format(
"Image %dx%d has more pixels than fit in an int (%d)") %
63 _imgBBox.getWidth() % _imgBBox.getHeight() % std::numeric_limits<int>::max()));
81 throw LSST_EXCEPT(ex::InvalidParameterError,
"Image contains no pixels");
86 throw LSST_EXCEPT(lsst::pex::exceptions::OverflowError,
87 str(boost::format(
"Image %dx%d has more pixels than fit in an int (%d)") %
88 _imgBBox.getWidth() % _imgBBox.getHeight() % std::numeric_limits<int>::max()));
94void Background::_setCenOrigSize(
int const width,
int const height,
int const nxSample,
int const nySample) {
102 for (
int iX = 0; iX < nxSample; ++iX) {
103 const int endx =
std::min(((iX + 1) * width + nxSample / 2) / nxSample, width);
109 for (
int iY = 0; iY < nySample; ++iY) {
110 const int endy =
std::min(((iY + 1) * height + nySample / 2) / nySample, height);
119 if (undersampleStrings.
size() == 0) {
125 if (undersampleStrings.
find(style) == undersampleStrings.
end()) {
128 return undersampleStrings[style];
135#define INSTANTIATE_BACKGROUND(TYPE) \
136 template Background::Background(image::Image<TYPE> const& img, BackgroundControl const& bgCtrl); \
137 template Background::Background(image::MaskedImage<TYPE> const& img, BackgroundControl const& bgCtrl); \
138 template std::shared_ptr<image::Image<TYPE>> Background::getImage<TYPE>(Interpolate::Style const, \
139 UndersampleStyle const) const;
141INSTANTIATE_BACKGROUND(
float)
#define LSST_EXCEPT(type,...)
Pass parameters to a Background object.
std::vector< double > _ycen
y center ...
std::vector< double > _xcen
x center pix coords of sub images
Background(ImageT const &img, BackgroundControl const &bgCtrl)
Constructor for Background.
std::vector< int > _xsize
x size of sub images
lsst::geom::Box2I _imgBBox
size and origin of input image
std::vector< int > _xorig
x origin pix coords of sub images
UndersampleStyle _asUsedUndersampleStyle
the undersampleStyle we actually used
std::vector< int > _ysize
y size ...
std::vector< int > _yorig
y origin ...
Interpolate::Style _asUsedInterpStyle
the style we actually used
std::shared_ptr< BackgroundControl > _bctrl
control info set by user.
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.