35 #ifndef LSST_AFW_MATH_WARPEXPOSURE_H
36 #define LSST_AFW_MATH_WARPEXPOSURE_H
40 #include "boost/shared_ptr.hpp"
131 this->_params[0] = fracPos;
141 virtual std::string
toString(std::string
const& =
"")
const;
187 this->_params[0] = fracPos;
197 virtual std::string
toString(std::string
const& =
"")
const;
255 std::string
const &maskWarpingKernelName =
"",
262 int interpLength = 0,
270 _maskWarpingKernelPtr(),
272 _interpLength(interpLength),
273 _devicePreference(devicePreference),
274 _growFullMask(growFullMask)
276 setMaskWarpingKernelName(maskWarpingKernelName);
277 _testDevicePreference(_devicePreference, _warpingKernelPtr);
285 int interpLength = 0,
293 _maskWarpingKernelPtr(),
295 _interpLength(interpLength),
296 _devicePreference(devicePreference),
297 _growFullMask(lsst::afw::
image::Mask<lsst::afw::
image::
MaskPixel>::getPlaneBitMask(
"EDGE"))
299 _testDevicePreference(_devicePreference, _warpingKernelPtr);
337 ) { _interpLength = interpLength; };
350 _testDevicePreference(devicePreference, _warpingKernelPtr);
351 _devicePreference = devicePreference;
362 void setWarpingKernelName(
371 void setWarpingKernel(
383 bool hasMaskWarpingKernel()
const {
return static_cast<bool>(_maskWarpingKernelPtr); }
388 void setMaskWarpingKernelName(
389 std::string
const &maskWarpingKernelName
398 void setMaskWarpingKernel(
412 ) { _growFullMask = growFullMask; }
421 void _testWarpingKernels(
431 void _testDevicePreference(
450 template<typename DestExposureT, typename SrcExposureT>
452 DestExposureT &destExposure,
453 SrcExposureT const &srcExposure,
456 WarpingControl const &control,
457 typename DestExposureT::MaskedImageT::SinglePixel padValue =
458 lsst::afw::math::
edgePixel<typename DestExposureT::MaskedImageT>(
459 typename lsst::afw::
image::detail::image_traits<
460 typename DestExposureT::MaskedImageT>::image_category())
469 template<typename DestExposureT, typename SrcExposureT>
471 DestExposureT &destExposure,
472 SrcExposureT const &srcExposure,
476 int const interpLength=0,
477 typename DestExposureT::MaskedImageT::SinglePixel padValue =
478 lsst::afw::math::
edgePixel<typename DestExposureT::MaskedImageT>(
479 typename lsst::afw::
image::detail::image_traits<typename DestExposureT::MaskedImageT>::image_category()),
529 template<typename DestImageT, typename SrcImageT>
531 DestImageT &destImage,
532 lsst::afw::
image::
Wcs const &destWcs,
533 SrcImageT const &srcImage,
534 lsst::afw::
image::
Wcs const &srcWcs,
535 WarpingControl const &control,
536 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
537 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
544 template<typename DestImageT, typename SrcImageT>
546 DestImageT &destImage,
547 lsst::afw::
image::
Wcs const &destWcs,
548 SrcImageT const &srcImage,
549 lsst::afw::
image::
Wcs const &srcWcs,
551 int const interpLength=0,
552 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
555 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category()),
557 lsst::afw::gpu::
DevicePreference devPref = lsst::afw::gpu::DEFAULT_DEVICE_PREFERENCE
565 template<typename DestImageT, typename SrcImageT>
567 DestImageT &destImage,
568 SrcImageT const &srcImage,
569 lsst::afw::geom::AffineTransform const &affineTransform,
570 WarpingControl const &control,
571 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
572 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
579 template<typename DestImageT, typename SrcImageT>
581 DestImageT &destImage,
582 SrcImageT const &srcImage,
584 lsst::afw::geom::AffineTransform const &affineTransform,
585 int const interpLength = 0,
586 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
589 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category()),
591 lsst::afw::gpu::
DevicePreference devPref = lsst::afw::gpu::DEFAULT_DEVICE_PREFERENCE
600 template<typename DestImageT, typename SrcImageT>
602 DestImageT &destImage,
603 SrcImageT const &srcImage,
604 lsst::afw::geom::LinearTransform const &linearTransform,
605 lsst::afw::geom::
Point2D const ¢erPosition,
606 WarpingControl const &control,
607 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
608 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
615 template<typename DestImageT, typename SrcImageT>
617 DestImageT &destImage,
618 SrcImageT const &srcImage,
620 lsst::afw::geom::LinearTransform const &linearTransform,
621 lsst::afw::geom::
Point2D const ¢erPosition,
622 int const interpLength = 0,
623 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
626 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category()),
628 lsst::afw::gpu::
DevicePreference devPref = lsst::afw::gpu::DEFAULT_DEVICE_PREFERENCE
633 template <
typename A,
typename B>
636 template <
typename A>
642 #endif // !defined(LSST_AFW_MATH_WARPEXPOSURE_H)
virtual Function1Ptr clone() const
Return a pointer to a deep copy of this function.
virtual int getCacheSize() const
Get the current cache size (0 if none)
boost::uint16_t MaskPixel
void setInterpLength(int interpLength)
set the interpolation length
An include file to include the header files for lsst::afw::geom.
Declare the Kernel class and subclasses.
1-dimensional Lanczos function
LanczosWarpingKernel(int order)
SeparableKernel()
Construct an empty spatially invariant SeparableKernel of size 0x0.
virtual ~BilinearWarpingKernel()
boost::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
lsst::afw::gpu::DevicePreference getDevicePreference() const
get the GPU device preference
Define a collection of useful Functions.
Parameters to control convolution.
void setCacheSize(int cacheSize)
set the cache size for the interpolation kernel(s)
Implementation of the WCS standard for a any projection.
WarpingControl(SeparableKernel &warpingKernel, int interpLength=0, lsst::afw::gpu::DevicePreference devicePreference=lsst::afw::gpu::DEFAULT_DEVICE_PREFERENCE)
This constructor supports the deprecated legacy warping API.
int getCacheSize() const
get 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. This enables warping an image of e...
DevicePreference
A type used to select whether to use CPU or GPU device.
const DevicePreference DEFAULT_DEVICE_PREFERENCE
Default DevicePreference value.
lsst::afw::image::MaskPixel getGrowFullMask() const
get mask bits to grow to full width of image/variance kernel
tbl::Key< int > cacheSize
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. See also convenience function warpExposure() to warp an Ex...
table::Key< table::Array< Kernel::Pixel > > image
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.
boost::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
int getOrder() const
get the order of the kernel
virtual ~WarpingControl()
1-dimensional bilinear interpolation function.
bool isSameObject(A const &, B const &)
A Function taking one argument.
int getInterpLength() const
get the interpolation length (pixels)
Interface for CPU/GPU device selection.
virtual ~BilinearFunction1()
ImageT::SinglePixel edgePixel(lsst::afw::image::detail::Image_tag)
Return an edge pixel appropriate for a given Image type.
virtual ~NearestWarpingKernel()
void setGrowFullMask(lsst::afw::image::MaskPixel growFullMask)
set mask bits to grow to full width of image/variance kernel
Bilinear warping: fast; good for undersampled data.
Convolve and convolveAtAPoint functions for Image and Kernel.
void setDevicePreference(lsst::afw::gpu::DevicePreference devicePreference)
set the GPU device preference
virtual void setKernelParameter(unsigned int ind, double value) const
Set one kernel parameter.
tbl::Key< std::string > warpingKernelName
virtual Function1Ptr clone() const
Return a pointer to a deep copy of this function.
virtual boost::shared_ptr< Kernel > clone() const
Return a pointer to a deep copy of this kernel.
virtual ~NearestFunction1()
virtual ~LanczosWarpingKernel()
Nearest neighbor warping: fast; good for undersampled data.
Define the basic Function classes.
virtual std::string toString(std::string const &prefix="") const
Return a string representation of the kernel.
afw::table::Key< double > b
Lanczos warping: accurate but slow and can introduce ringing artifacts.
Point< double, 2 > Point2D
1-dimensional nearest neighbor interpolation function.
boost::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
Kernels are used for convolution with MaskedImages and (eventually) Images.
Definition of default types for Masks and Variance Images.
WarpingControl(std::string const &warpingKernelName, std::string const &maskWarpingKernelName="", int cacheSize=0, int interpLength=0, lsst::afw::gpu::DevicePreference devicePreference=lsst::afw::gpu::DEFAULT_DEVICE_PREFERENCE, lsst::afw::image::MaskPixel growFullMask=0)
Construct a WarpingControl object.
Include files required for standard LSST Exception handling.