38 namespace ex = pex::exceptions;
43 template <
typename ImageT>
45 :
lsst::daf::
base::Citizen(typeid(this)),
46 _imgBBox(img.getBBox()),
96 void Background::_setCenOrigSize(
int const width,
int const height,
int const nxSample,
int const nySample) {
104 for (
int iX = 0; iX < nxSample; ++iX) {
105 const int endx =
std::min(((iX + 1) * width + nxSample / 2) / nxSample, width);
111 for (
int iY = 0; iY < nySample; ++iY) {
112 const int endy =
std::min(((iY + 1) * height + nySample / 2) / nySample, height);
121 if (undersampleStrings.
size() == 0) {
127 if (undersampleStrings.
find(style) == undersampleStrings.
end()) {
130 return undersampleStrings[style];
137 #define INSTANTIATE_BACKGROUND(TYPE) \ 138 template Background::Background(image::Image<TYPE> const& img, BackgroundControl const& bgCtrl); \ 139 template Background::Background(image::MaskedImage<TYPE> const& img, BackgroundControl const& bgCtrl); \ 140 template std::shared_ptr<image::Image<TYPE>> Background::getImage<TYPE>(Interpolate::Style const, \ 141 UndersampleStyle const) const; 143 INSTANTIATE_BACKGROUND(
float)
std::vector< int > _xsize
x size of sub images
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.
std::vector< double > _xcen
x center pix coords of sub images
std::vector< int > _yorig
y origin ...
int getHeight() const noexcept
Background(ImageT const &img, BackgroundControl const &bgCtrl)
Constructor for Background.
lsst::geom::Box2I _imgBBox
size and origin of input image
bool isEmpty() const noexcept
Return true if the box contains no points.
std::vector< double > _ycen
y center ...
Pass parameters to a Background object.
Interpolate::Style _asUsedInterpStyle
the style we actually used
A base class for image defects.
Reports when the result of an arithmetic operation is too large for the destination type...
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
int getWidth() const noexcept
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Citizen(const std::type_info &)
std::vector< int > _xorig
x origin pix coords of sub images
std::shared_ptr< BackgroundControl > _bctrl
control info set by user.
std::vector< int > _ysize
y size ...
UndersampleStyle _asUsedUndersampleStyle
the undersampleStyle we actually used
Reports invalid arguments.
An integer coordinate rectangle.