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") |
300 _testDevicePreference(_devicePreference, _warpingKernelPtr);
338 ) { _interpLength = interpLength; };
351 _testDevicePreference(devicePreference, _warpingKernelPtr);
352 _devicePreference = devicePreference;
363 void setWarpingKernelName(
372 void setWarpingKernel(
384 bool hasMaskWarpingKernel()
const {
return static_cast<bool>(_maskWarpingKernelPtr); }
389 void setMaskWarpingKernelName(
390 std::string
const &maskWarpingKernelName
399 void setMaskWarpingKernel(
413 ) { _growFullMask = growFullMask; }
422 void _testWarpingKernels(
432 void _testDevicePreference(
451 template<typename DestExposureT, typename SrcExposureT>
453 DestExposureT &destExposure,
454 SrcExposureT const &srcExposure,
457 WarpingControl const &control,
458 typename DestExposureT::MaskedImageT::SinglePixel padValue =
459 lsst::afw::math::
edgePixel<typename DestExposureT::MaskedImageT>(
460 typename lsst::afw::
image::detail::image_traits<
461 typename DestExposureT::MaskedImageT>::image_category())
470 template<typename DestExposureT, typename SrcExposureT>
472 DestExposureT &destExposure,
473 SrcExposureT const &srcExposure,
477 int const interpLength=0,
478 typename DestExposureT::MaskedImageT::SinglePixel padValue =
479 lsst::afw::math::
edgePixel<typename DestExposureT::MaskedImageT>(
480 typename lsst::afw::
image::detail::image_traits<typename DestExposureT::MaskedImageT>::image_category()),
530 template<typename DestImageT, typename SrcImageT>
532 DestImageT &destImage,
533 lsst::afw::
image::
Wcs const &destWcs,
534 SrcImageT const &srcImage,
535 lsst::afw::
image::
Wcs const &srcWcs,
536 WarpingControl const &control,
537 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
538 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
545 template<typename DestImageT, typename SrcImageT>
547 DestImageT &destImage,
548 lsst::afw::
image::
Wcs const &destWcs,
549 SrcImageT const &srcImage,
550 lsst::afw::
image::
Wcs const &srcWcs,
552 int const interpLength=0,
553 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
556 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category()),
558 lsst::afw::gpu::
DevicePreference devPref = lsst::afw::gpu::DEFAULT_DEVICE_PREFERENCE
566 template<typename DestImageT, typename SrcImageT>
568 DestImageT &destImage,
569 SrcImageT const &srcImage,
570 lsst::afw::geom::AffineTransform const &affineTransform,
571 WarpingControl const &control,
572 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
573 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
580 template<typename DestImageT, typename SrcImageT>
582 DestImageT &destImage,
583 SrcImageT const &srcImage,
585 lsst::afw::geom::AffineTransform const &affineTransform,
586 int const interpLength = 0,
587 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
590 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category()),
592 lsst::afw::gpu::
DevicePreference devPref = lsst::afw::gpu::DEFAULT_DEVICE_PREFERENCE
601 template<typename DestImageT, typename SrcImageT>
603 DestImageT &destImage,
604 SrcImageT const &srcImage,
605 lsst::afw::geom::LinearTransform const &linearTransform,
606 lsst::afw::geom::
Point2D const ¢erPosition,
607 WarpingControl const &control,
608 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
609 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
616 template<typename DestImageT, typename SrcImageT>
618 DestImageT &destImage,
619 SrcImageT const &srcImage,
621 lsst::afw::geom::LinearTransform const &linearTransform,
622 lsst::afw::geom::
Point2D const ¢erPosition,
623 int const interpLength = 0,
624 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
627 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category()),
629 lsst::afw::gpu::
DevicePreference devPref = lsst::afw::gpu::DEFAULT_DEVICE_PREFERENCE
634 template <
typename A,
typename B>
637 template <
typename A>
643 #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.
table::Key< std::string > name
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 off-the-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.