mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT > Struct Template Reference

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
struct mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >

Azimuthally variable boxcar kernel.

Averages the image in a boxcar defined by a radial and azimuthal extent.

Definition at line 139 of file imageFilters.hpp.

#include <improc/imageFilters.hpp>

Public Member Functions

 azBoxKernel (arithT radWidth, arithT azWidth)
 Construct a kernel without an angular-position limit.
 azBoxKernel (arithT radWidth, arithT azWidth, arithT maxAz)
 Construct a kernel with an optional angular-position limit.
void setMaxWidth ()
 Sets the max width based on the configured az and rad widths.
int maxWidth () const
 Get the maximum kernel half-width in either image dimension.
error_t setKernel (arithT x, arithT y, arrayT &kernel) const
 Generate a normalized kernel at the requested image-relative coordinate.

Public Attributes

arithT m_radWidth { 0 }
 the half-width of the averaging box, in the radial direction, in pixels.
arithT m_azWidth { 0 }
 the half-width of the averaging box, in the azimuthal direction, in pixels.
arithT m_maxAz { 0 }
 maximum azimuthal half-width in radians; 0 means no angular limit.
int m_maxWidth { 0 }
 maximum kernel half-width needed to keep every generated kernel in bounds.

Static Public Attributes

static constexpr int kernW = static_cast<int>( _kernW )
 kernel sampling factor.

Constructor & Destructor Documentation

◆ azBoxKernel() [1/2]

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::azBoxKernel ( arithT radWidth,
arithT azWidth )
inline

Construct a kernel without an angular-position limit.

Parameters
[in]radWidththe half-width of the averaging box, in the radial direction, in pixels.
[in]azWidththe half-width of the averaging box, in the azimuthal direction, in pixels.

Definition at line 155 of file imageFilters.hpp.

References m_azWidth, m_radWidth, and setMaxWidth().

◆ azBoxKernel() [2/2]

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::azBoxKernel ( arithT radWidth,
arithT azWidth,
arithT maxAz )
inline

Construct a kernel with an optional angular-position limit.

Parameters
[in]radWidththe half-width of the averaging box, in the radial direction, in pixels.
[in]azWidththe half-width of the averaging box, in the azimuthal direction, in pixels.
[in]maxAzthe maximum half-width of the averaging box in the azimuthal direction, in degrees. >= 0. If 0 or >= 180, then no maximum is enforced.

Definition at line 164 of file imageFilters.hpp.

References mx::math::dtor(), mx::math::isFinite(), m_azWidth, m_maxAz, m_radWidth, and setMaxWidth().

Member Function Documentation

◆ maxWidth()

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
int mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::maxWidth ( ) const
inline

Get the maximum kernel half-width in either image dimension.

Definition at line 209 of file imageFilters.hpp.

References m_maxWidth.

◆ setKernel()

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
error_t mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::setKernel ( arithT x,
arithT y,
arrayT & kernel ) const
inline

Generate a normalized kernel at the requested image-relative coordinate.

Parameters
[in]xx-coordinate relative to image center
[in]yx-coordinate relative to image center
[in]kernelthe array to populate with the kernel, resized

Definition at line 215 of file imageFilters.hpp.

References mx::math::angleDiff(), mx::invalidarg, mx::invalidconfig, mx::math::isFinite(), kernW, m_azWidth, m_maxAz, m_maxWidth, m_radWidth, mx::internal::mxlib_error_report(), mx::noerror, and mx::sizeerr.

◆ setMaxWidth()

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
void mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::setMaxWidth ( )
inline

Sets the max width based on the configured az and rad widths.

Definition at line 187 of file imageFilters.hpp.

References mx::math::isFinite(), kernW, m_azWidth, m_maxWidth, and m_radWidth.

Referenced by azBoxKernel(), and azBoxKernel().

Member Data Documentation

◆ kernW

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
int mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::kernW = static_cast<int>( _kernW )
inlinestaticconstexpr

kernel sampling factor.

Definition at line 144 of file imageFilters.hpp.

Referenced by setKernel(), and setMaxWidth().

◆ m_azWidth

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
arithT mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::m_azWidth { 0 }

the half-width of the averaging box, in the azimuthal direction, in pixels.

Definition at line 149 of file imageFilters.hpp.

Referenced by azBoxKernel(), azBoxKernel(), setKernel(), and setMaxWidth().

◆ m_maxAz

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
arithT mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::m_maxAz { 0 }

maximum azimuthal half-width in radians; 0 means no angular limit.

Definition at line 150 of file imageFilters.hpp.

Referenced by azBoxKernel(), and setKernel().

◆ m_maxWidth

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
int mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::m_maxWidth { 0 }

maximum kernel half-width needed to keep every generated kernel in bounds.

Definition at line 152 of file imageFilters.hpp.

Referenced by maxWidth(), setKernel(), and setMaxWidth().

◆ m_radWidth

template<typename _arrayT, size_t _kernW = 2, class _verboseT = verbose::d>
arithT mx::improc::azBoxKernel< _arrayT, _kernW, _verboseT >::m_radWidth { 0 }

the half-width of the averaging box, in the radial direction, in pixels.

Definition at line 148 of file imageFilters.hpp.

Referenced by azBoxKernel(), azBoxKernel(), setKernel(), and setMaxWidth().


The documentation for this struct was generated from the following file: