29 #ifndef LSST_AFW_MATH_WARPEXPOSURE_H
30 #define LSST_AFW_MATH_WARPEXPOSURE_H
268 int interpLength = 0,
273 _maskWarpingKernelPtr(),
275 _interpLength(interpLength),
276 _growFullMask(growFullMask) {
315 _interpLength = interpLength;
373 _growFullMask = growFullMask;
399 template <
typename DestExposureT,
typename SrcExposureT>
401 DestExposureT &destExposure,
404 SrcExposureT
const &srcExposure,
405 WarpingControl
const &control,
406 typename DestExposureT::MaskedImageT::SinglePixel padValue =
407 lsst::afw::math::edgePixel<typename DestExposureT::MaskedImageT>(
409 typename DestExposureT::MaskedImageT>::image_category())
459 template <
typename DestImageT,
typename SrcImageT>
461 geom::SkyWcs
const &destWcs,
462 SrcImageT
const &srcImage,
463 geom::SkyWcs
const &srcWcs,
464 WarpingControl
const &control,
465 typename DestImageT::SinglePixel padValue = lsst::afw::math::edgePixel<DestImageT>(
484 template <
typename DestImageT,
typename SrcImageT>
485 int warpImage(DestImageT &destImage, SrcImageT
const &srcImage,
487 typename DestImageT::SinglePixel padValue = lsst::afw::math::edgePixel<DestImageT>(
495 template <
typename DestImageT,
typename SrcImageT>
497 DestImageT &destImage,
498 SrcImageT
const &srcImage,
501 WarpingControl
const &control,
502 typename DestImageT::SinglePixel padValue = lsst::afw::math::edgePixel<DestImageT>(
table::Key< std::string > name
1-dimensional bilinear interpolation function.
~BilinearFunction1() override
std::string toString(std::string const &="") const override
Return string representation.
std::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
Function1Ptr clone() const override
Return a pointer to a deep copy of this function.
BilinearFunction1(double fracPos)
Construct a Bilinear interpolation function.
Kernel::Pixel operator()(double x) const override
Solve bilinear equation.
Bilinear warping: fast; good for undersampled data.
BilinearWarpingKernel & operator=(BilinearWarpingKernel &&)=delete
BilinearWarpingKernel & operator=(const BilinearWarpingKernel &)=delete
BilinearWarpingKernel(BilinearWarpingKernel &&)=delete
~BilinearWarpingKernel() override=default
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
BilinearWarpingKernel(const BilinearWarpingKernel &)=delete
A Function taking one argument.
std::vector< double > _params
Kernels are used for convolution with MaskedImages and (eventually) Images.
1-dimensional Lanczos function
Lanczos warping: accurate but slow and can introduce ringing artifacts.
int getOrder() const
get the order of the kernel
LanczosWarpingKernel(const LanczosWarpingKernel &)=delete
LanczosWarpingKernel(int order)
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
~LanczosWarpingKernel() override=default
LanczosWarpingKernel & operator=(const LanczosWarpingKernel &)=delete
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
LanczosWarpingKernel & operator=(LanczosWarpingKernel &&)=delete
LanczosWarpingKernel(LanczosWarpingKernel &&)=delete
1-dimensional nearest neighbor interpolation function.
NearestFunction1(double fracPos)
Construct a Nearest interpolation function.
Kernel::Pixel operator()(double x) const override
Solve nearest neighbor equation.
Function1Ptr clone() const override
Return a pointer to a deep copy of this function.
std::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
~NearestFunction1() override
std::string toString(std::string const &="") const override
Return string representation.
Nearest neighbor warping: fast; good for undersampled data.
NearestWarpingKernel(NearestWarpingKernel &&)=delete
NearestWarpingKernel & operator=(NearestWarpingKernel &&)=delete
NearestWarpingKernel(const NearestWarpingKernel &)=delete
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
NearestWarpingKernel & operator=(const NearestWarpingKernel &)=delete
~NearestWarpingKernel() override=default
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
Parameters to control convolution.
bool hasMaskWarpingKernel() const
return true if there is a mask kernel
lsst::afw::image::MaskPixel getGrowFullMask() const
get mask bits to grow to full width of image/variance kernel
void setWarpingKernel(SeparableKernel const &warpingKernel)
set the warping kernel
int getInterpLength() const
get the interpolation length (pixels)
void setWarpingKernelName(std::string const &warpingKernelName)
set the warping kernel by name
void setMaskWarpingKernelName(std::string const &maskWarpingKernelName)
set or clear the mask warping kernel by name
void setCacheSize(int cacheSize)
set the cache size for the interpolation kernel(s)
int getCacheSize() const
get the cache size for the interpolation kernel(s)
void setMaskWarpingKernel(SeparableKernel const &maskWarpingKernel)
set the mask warping kernel
virtual ~WarpingControl()
std::shared_ptr< SeparableKernel > getWarpingKernel() const
get the warping kernel
void setGrowFullMask(lsst::afw::image::MaskPixel growFullMask)
set mask bits to grow to full width of image/variance kernel
void setInterpLength(int interpLength)
set the interpolation length
std::shared_ptr< SeparableKernel > getMaskWarpingKernel() const
get the mask warping kernel
WarpingControl(std::string const &warpingKernelName, std::string const &maskWarpingKernelName="", int cacheSize=0, int interpLength=0, lsst::afw::image::MaskPixel growFullMask=0)
Construct a WarpingControl object.
Transform< Point2Endpoint, Point2Endpoint > TransformPoint2ToPoint2
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
int warpCenteredImage(DestImageT &destImage, SrcImageT const &srcImage, lsst::geom::LinearTransform const &linearTransform, lsst::geom::Point2D const ¢erPosition, WarpingControl const &control, typename DestImageT::SinglePixel padValue=lsst::afw::math::edgePixel< DestImageT >(typename lsst::afw::image::detail::image_traits< DestImageT >::image_category()))
Warp an image with a LinearTranform about a specified point.
int warpImage(DestImageT &destImage, geom::SkyWcs const &destWcs, SrcImageT const &srcImage, geom::SkyWcs const &srcWcs, WarpingControl const &control, typename DestImageT::SinglePixel padValue=lsst::afw::math::edgePixel< DestImageT >(typename lsst::afw::image::detail::image_traits< DestImageT >::image_category()))
Warp an Image or MaskedImage to a new Wcs.
int warpExposure(DestExposureT &destExposure, SrcExposureT const &srcExposure, WarpingControl const &control, typename DestExposureT::MaskedImageT::SinglePixel padValue=lsst::afw::math::edgePixel< typename DestExposureT::MaskedImageT >(typename lsst::afw::image::detail::image_traits< typename DestExposureT::MaskedImageT >::image_category()))
Warp (remap) one exposure to another.
A base class for image defects.
afw::table::Key< int > cacheSize
afw::table::Key< std::string > warpingKernelName
traits class for image categories
ImageT::image_category image_category