35 #ifndef LSST_AFW_MATH_WARPEXPOSURE_H
36 #define LSST_AFW_MATH_WARPEXPOSURE_H
130 this->_params[0] = fracPos;
140 virtual std::string
toString(std::string
const& =
"")
const;
186 this->_params[0] = fracPos;
196 virtual std::string
toString(std::string
const& =
"")
const;
254 std::string
const &maskWarpingKernelName =
"",
261 int interpLength = 0,
269 _maskWarpingKernelPtr(),
271 _interpLength(interpLength),
272 _devicePreference(devicePreference),
273 _growFullMask(growFullMask)
275 setMaskWarpingKernelName(maskWarpingKernelName);
276 _testDevicePreference(_devicePreference, _warpingKernelPtr);
314 ) { _interpLength = interpLength; };
327 _testDevicePreference(devicePreference, _warpingKernelPtr);
328 _devicePreference = devicePreference;
339 void setWarpingKernelName(
348 void setWarpingKernel(
360 bool hasMaskWarpingKernel()
const {
return static_cast<bool>(_maskWarpingKernelPtr); }
365 void setMaskWarpingKernelName(
366 std::string
const &maskWarpingKernelName
375 void setMaskWarpingKernel(
389 ) { _growFullMask = growFullMask; }
398 void _testWarpingKernels(
408 void _testDevicePreference(
427 template<typename DestExposureT, typename SrcExposureT>
429 DestExposureT &destExposure,
430 SrcExposureT const &srcExposure,
433 WarpingControl const &control,
434 typename DestExposureT::MaskedImageT::SinglePixel padValue =
435 lsst::afw::math::
edgePixel<typename DestExposureT::MaskedImageT>(
436 typename lsst::afw::
image::detail::image_traits<
437 typename DestExposureT::MaskedImageT>::image_category())
485 template<typename DestImageT, typename SrcImageT>
487 DestImageT &destImage,
488 lsst::afw::
image::
Wcs const &destWcs,
489 SrcImageT const &srcImage,
490 lsst::afw::
image::
Wcs const &srcWcs,
491 WarpingControl const &control,
492 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
493 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
501 template<typename DestImageT, typename SrcImageT>
503 DestImageT &destImage,
504 SrcImageT const &srcImage,
505 lsst::afw::geom::XYTransform const &xyTransform,
506 WarpingControl const &control,
508 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
509 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
518 template<typename DestImageT, typename SrcImageT>
520 DestImageT &destImage,
521 SrcImageT const &srcImage,
522 lsst::afw::geom::LinearTransform const &linearTransform,
523 lsst::afw::geom::
Point2D const ¢erPosition,
524 WarpingControl const &control,
525 typename DestImageT::SinglePixel padValue = lsst::afw::math::
edgePixel<DestImageT>(
526 typename lsst::afw::
image::detail::image_traits<DestImageT>::image_category())
531 template <
typename A,
typename B>
534 template <
typename A>
540 #endif // !defined(LSST_AFW_MATH_WARPEXPOSURE_H)
virtual ~BilinearFunction1()
An include file to include the header files for lsst::afw::geom.
Declare the Kernel class and subclasses.
boost::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
table::Key< std::string > name
1-dimensional Lanczos function
void setDevicePreference(lsst::afw::gpu::DevicePreference devicePreference)
set the GPU device preference
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
Point< double, 2 > Point2D
Define a collection of useful Functions.
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. This enables warping an image of e...
DevicePreference
A type used to select whether to use CPU or GPU device.
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 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.
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.
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()
bool isSameObject(A const &, B const &)
A Function taking one argument.
boost::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
SeparableKernel()
Construct an empty spatially invariant SeparableKernel of size 0x0.
Interface for CPU/GPU device selection.
ImageT::SinglePixel edgePixel(lsst::afw::image::detail::Image_tag)
Return an off-the-edge pixel appropriate for a given Image type.
virtual ~NearestFunction1()
virtual ~BilinearWarpingKernel()
Bilinear warping: fast; good for undersampled data.
Convolve and convolveAtAPoint functions for Image and Kernel.
virtual std::string toString(std::string const &prefix="") const
Return a string representation of the kernel.
tbl::Key< std::string > warpingKernelName
boost::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
virtual ~NearestWarpingKernel()
int getCacheSize() const
get the cache size for the interpolation kernel(s)
const DevicePreference DEFAULT_DEVICE_PREFERENCE
Default DevicePreference value.
virtual void setKernelParameter(unsigned int ind, double value) const
Set one kernel parameter.
Nearest neighbor warping: fast; good for undersampled data.
Define the basic Function classes.
virtual Function1Ptr clone() const
Return a pointer to a deep copy of this function.
afw::table::Key< double > b
Lanczos warping: accurate but slow and can introduce ringing artifacts.
1-dimensional nearest neighbor interpolation function.
lsst::afw::image::MaskPixel getGrowFullMask() const
get mask bits to grow to full width of image/variance kernel
Include files required for standard LSST Exception handling.
lsst::afw::gpu::DevicePreference getDevicePreference() const
get the GPU device preference
virtual boost::shared_ptr< Kernel > clone() const
Return a pointer to a deep copy of this kernel.
Kernels are used for convolution with MaskedImages and (eventually) Images.
Definition of default types for Masks and Variance Images.
virtual Function1Ptr clone() const
Return a pointer to a deep copy of this function.