29 #ifndef LSST_AFW_MATH_WARPEXPOSURE_H
30 #define LSST_AFW_MATH_WARPEXPOSURE_H
35 #include "lsst/base.h"
36 #include "lsst/pex/exceptions.h"
73 virtual std::shared_ptr<Kernel>
clone()
const;
100 virtual std::shared_ptr<Kernel>
clone()
const;
136 virtual std::string
toString(std::string
const & =
"")
const;
158 virtual std::shared_ptr<Kernel>
clone()
const;
194 virtual std::string
toString(std::string
const & =
"")
const;
243 std::string
const &warpingKernelName,
244 std::string
const &maskWarpingKernelName =
"",
251 int interpLength = 0,
257 _maskWarpingKernelPtr(),
258 _cacheSize(cacheSize),
259 _interpLength(interpLength),
260 _growFullMask(growFullMask) {
281 _cacheSize = cacheSize;
299 _interpLength = interpLength;
357 _growFullMask = growFullMask;
371 std::shared_ptr<SeparableKernel> _warpingKernelPtr;
372 std::shared_ptr<SeparableKernel> _maskWarpingKernelPtr;
383 template <
typename DestExposureT,
typename SrcExposureT>
385 DestExposureT &destExposure,
386 SrcExposureT
const &srcExposure,
389 WarpingControl
const &control,
390 typename DestExposureT::MaskedImageT::SinglePixel padValue =
391 lsst::afw::math::edgePixel<typename DestExposureT::MaskedImageT>(
393 typename DestExposureT::MaskedImageT>::image_category())
437 template <
typename DestImageT,
typename SrcImageT>
440 SrcImageT
const &srcImage,
442 WarpingControl
const &control,
443 typename DestImageT::SinglePixel padValue = lsst::afw::math::edgePixel<DestImageT>(
452 template <
typename DestImageT,
typename SrcImageT>
454 SrcImageT
const &srcImage,
456 WarpingControl
const &control,
458 typename DestImageT::SinglePixel padValue = lsst::afw::math::edgePixel<DestImageT>(
477 template <
typename DestImageT,
typename SrcImageT>
479 SrcImageT
const &srcImage,
481 WarpingControl
const &control,
482 typename DestImageT::SinglePixel padValue = lsst::afw::math::edgePixel<DestImageT>(
492 template <
typename DestImageT,
typename SrcImageT>
494 DestImageT &destImage,
495 SrcImageT
const &srcImage,
498 WarpingControl
const &control,
499 typename DestImageT::SinglePixel padValue = lsst::afw::math::edgePixel<DestImageT>(
505 template <
typename A,
typename B>
510 template <
typename A>
519 #endif // !defined(LSST_AFW_MATH_WARPEXPOSURE_H)
virtual ~BilinearFunction1()
virtual void setKernelParameter(unsigned int ind, double value) const
Set one kernel parameter.
virtual void setKernelParameter(unsigned int ind, double value) const
Set one kernel parameter.
1-dimensional Lanczos function
virtual std::shared_ptr< Kernel > clone() const
Return a pointer to a deep copy of this kernel.
std::shared_ptr< SeparableKernel > getWarpingKernel() const
get the warping kernel
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
void setWarpingKernelName(std::string const &warpingKernelName)
set the warping kernel by name
Parameters to control convolution.
LanczosWarpingKernel(int order)
Implementation of the WCS standard for a any projection.
void setCacheSize(int cacheSize)
set the cache size for the interpolation kernel(s)
int warpCenteredImage(DestImageT &destImage, SrcImageT const &srcImage, lsst::afw::geom::LinearTransform const &linearTransform, lsst::afw::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.
virtual std::shared_ptr< Kernel > clone() const
Return a pointer to a deep copy of this kernel.
std::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
void setMaskWarpingKernel(SeparableKernel const &maskWarpingKernel)
set the mask warping kernel
int warpImage(DestImageT &destImage, lsst::afw::image::Wcs const &destWcs, SrcImageT const &srcImage, lsst::afw::image::Wcs 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.
virtual Kernel::Pixel operator()(double x) const
Solve bilinear equation.
int getOrder() const
get the order of the kernel
int getInterpLength() const
get the interpolation length (pixels)
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.
std::vector< double > _params
virtual ~WarpingControl()
void setInterpLength(int interpLength)
set the interpolation length
void setGrowFullMask(lsst::afw::image::MaskPixel growFullMask)
set mask bits to grow to full width of image/variance kernel
1-dimensional bilinear interpolation function.
virtual ~LanczosWarpingKernel()
std::shared_ptr< SeparableKernel > getMaskWarpingKernel() const
get the mask warping kernel
void setMaskWarpingKernelName(std::string const &maskWarpingKernelName)
set or clear the mask warping kernel by name
bool isSameObject(A const &, B const &)
A Function taking one argument.
void setWarpingKernel(SeparableKernel const &warpingKernel)
set the warping kernel
table::Key< std::string > name
traits class for image categories
virtual ~NearestFunction1()
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
virtual std::string toString(std::string const &="") const
Return string representation.
virtual ~BilinearWarpingKernel()
Bilinear warping: fast; good for undersampled data.
std::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
virtual std::string toString(std::string const &="") const
Return string representation.
virtual Kernel::Pixel operator()(double x) const
Solve nearest neighbor equation.
virtual ~NearestWarpingKernel()
int getCacheSize() const
get the cache size for the interpolation kernel(s)
virtual void setKernelParameter(unsigned int ind, double value) const
Set one kernel parameter.
bool hasMaskWarpingKernel() const
return true if there is a mask kernel
Nearest neighbor warping: fast; good for undersampled data.
NearestFunction1(double fracPos)
Construct a Nearest interpolation function.
virtual Function1Ptr clone() const
Return a pointer to a deep copy of this function.
BilinearFunction1(double fracPos)
Construct a Bilinear interpolation function.
Lanczos warping: accurate but slow and can introduce ringing artifacts.
ImageT::image_category image_category
1-dimensional nearest neighbor interpolation function.
lsst::afw::image::MaskPixel getGrowFullMask() const
get mask bits to grow to full width of image/variance 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.
Kernels are used for convolution with MaskedImages and (eventually) Images.
virtual Function1Ptr clone() const
Return a pointer to a deep copy of this function.
virtual std::shared_ptr< Kernel > clone() const
Return a pointer to a deep copy of this kernel.