29#ifndef LSST_AFW_MATH_WARPEXPOSURE_H
30#define LSST_AFW_MATH_WARPEXPOSURE_H
299 _maskWarpingKernelPtr(),
432template <typename DestExposureT, typename SrcExposureT>
434 DestExposureT &destExposure,
438 SrcExposureT const &srcExposure,
440 typename DestExposureT::MaskedImageT::SinglePixel padValue =
443 typename DestExposureT::MaskedImageT>::image_category())
493template <typename DestImageT, typename SrcImageT>
494int warpImage(DestImageT &destImage,
495 geom::SkyWcs const &destWcs,
496 SrcImageT const &srcImage,
497 geom::SkyWcs const &srcWcs,
499 typename DestImageT::SinglePixel padValue =
lsst::
afw::math::
edgePixel<DestImageT>(
500 typename
lsst::
afw::
image::detail::image_traits<DestImageT>::image_category())
518template <typename DestImageT, typename SrcImageT>
519int warpImage(DestImageT &destImage, SrcImageT const &srcImage,
521 typename DestImageT::SinglePixel padValue =
lsst::
afw::math::
edgePixel<DestImageT>(
522 typename
lsst::
afw::
image::detail::image_traits<DestImageT>::image_category()));
529template <typename DestImageT, typename SrcImageT>
531 DestImageT &destImage,
532 SrcImageT const &srcImage,
533 lsst::
geom::LinearTransform const &linearTransform,
534 lsst::
geom::Point2D const ¢erPosition,
536 typename DestImageT::SinglePixel padValue =
lsst::
afw::math::
edgePixel<DestImageT>(
537 typename
lsst::
afw::
image::detail::image_traits<DestImageT>::image_category())
1-dimensional bilinear interpolation function.
~BilinearFunction1() override
std::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
std::string toString(std::string const &="") const override
Return string representation.
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.
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
BilinearWarpingKernel & operator=(const BilinearWarpingKernel &)=delete
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
BilinearWarpingKernel(BilinearWarpingKernel &&)=delete
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
~BilinearWarpingKernel() override=default
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
BilinearWarpingKernel & operator=(BilinearWarpingKernel &&)=delete
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)
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
~LanczosWarpingKernel() override=default
LanczosWarpingKernel & operator=(LanczosWarpingKernel &&)=delete
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
LanczosWarpingKernel & operator=(const 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(const NearestWarpingKernel &)=delete
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
~NearestWarpingKernel() override=default
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
NearestWarpingKernel & operator=(NearestWarpingKernel &&)=delete
NearestWarpingKernel & operator=(const NearestWarpingKernel &)=delete
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
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)
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
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)
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
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 write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
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.
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
A CRTP facade class for subclasses of Persistable.
A base class for objects that can be persisted via afw::table::io Archive classes.
io::OutputArchiveHandle OutputArchiveHandle
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.
ImageT::SinglePixel edgePixel(lsst::afw::image::detail::Image_tag)
Return an off-the-edge pixel appropriate for a given Image type.
afw::table::Key< std::string > warpingKernelName
table::Key< int > interpLength
table::Key< image::MaskPixel > growFullMask
table::Key< int > cacheSize