LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+ffe7eabc7e,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g36da64cc00+ea84795170,g3ddfee87b4+955a963fd8,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+955a963fd8,g591dd9f2cf+bac198a2cb,g5ec818987f+420292cfeb,g858d7b2824+d6c9a0a3b8,g876c692160+aabc49a3c3,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+e6cd765486,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+acd47f83f4,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+12c8382528,gba4ed39666+1ac82b564f,gbb8dafda3b+0574160a1f,gbeb006f7da+dea2fbb49f,gc28159a63d+c6dfa2ddaf,gc86a011abf+d6c9a0a3b8,gcf0d15dbbd+955a963fd8,gdaeeff99f8+1cafcb7cd4,gdc0c513512+d6c9a0a3b8,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,gee10cc3b42+90ebb246c7,gf1cff7945b+d6c9a0a3b8,w.2024.13
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Functions
lsst::afw::image::pixel Namespace Reference

Classes

class  BinaryExpr
 Class for representing binary operations. More...
 
class  BinaryExpr< ExprT1, double, ImageBinOp, MaskBinOp, VarianceBinOp >
 Partial specialization of BinaryExpr when ExprT2 is a double (i.e no mask/variance part) More...
 
struct  bitwise_or
 bitwise_or doesn't seem to be in std:: More...
 
struct  exprTraits
 A traits class to return the types of the image/mask/variance. More...
 
struct  exprTraits< double >
 A specialisation of exprTraits for double More...
 
struct  exprTraits< float >
 A specialisation of exprTraits for float More...
 
struct  exprTraits< int >
 A specialisation of exprTraits for int More...
 
struct  exprTraits< unsigned short >
 A specialisation of exprTraits for unsigned short More...
 
struct  is_specialization
 Template for (e1 + e2) More...
 
struct  is_specialization< Template< Args... >, Template >
 
struct  noop
 A noop functor (useful for e.g. masks and variances when changing the sign of the image) More...
 
class  Pixel
 A pixel of a MaskedImage. More...
 
struct  PixelTypeTraits
 Pixel type traits. More...
 
struct  PixelTypeTraits< SinglePixel< _ImagePixelT, _MaskPixelT, _VariancePixelT > >
 Specialization for a pixel of a MaskedImage. More...
 
class  SinglePixel
 A single pixel of the same type as a MaskedImage. More...
 
class  UnaryExpr
 Class for representing Unary operations. More...
 
struct  variance_divides
 Calculate the variance when we divide two Pixels. More...
 
struct  variance_multiplies
 Calculate the variance when we multiply two Pixels. More...
 
struct  variance_plus
 Calculate the variance when we add (or subtract) two Pixels. More...
 
struct  variance_plus_covar
 The variance of the sum of a pair of correlated pixels. More...
 

Functions

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > makeSinglePixel (ImagePixelT x, MaskPixelT m, VariancePixelT v)
 Return a SinglePixel.
 
template<typename ExprT1 >
UnaryExpr< ExprT1, std::negate< typename exprTraits< ExprT1 >::ImagePixelT >, noop< typename exprTraits< ExprT1 >::MaskPixelT >, noop< typename exprTraits< ExprT1 >::VariancePixelT > > operator- (ExprT1 e1)
 Template for -e1.
 
template<typename ExprT1 , typename ExprT2 , typename = std::enable_if_t < ( std::is_integral<ExprT1>::value || is_specialization<ExprT1,BinaryExpr>{} || is_specialization<ExprT1,SinglePixel>{} || is_specialization<ExprT1,Pixel>{}) && ( std::is_integral<ExprT2>::value || is_specialization<ExprT2,BinaryExpr>{} || is_specialization<ExprT2,SinglePixel>{} || is_specialization<ExprT2,Pixel>{} ) >>
BinaryExpr< ExprT1, ExprT2, std::plus< typename exprTraits< ExprT1 >::ImagePixelT >, bitwise_or< typename exprTraits< ExprT1 >::MaskPixelT >, variance_plus< typename exprTraits< ExprT1 >::VariancePixelT > > operator+ (ExprT1 e1, ExprT2 e2)
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 operator+= (ExprT1 &e1, ExprT2 e2)
 template for e1 += e2
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 plus (ExprT1 &lhs, ExprT2 const &rhs, float covariance)
 Like operator+(), but assume that covariance's 2*alpha*sqrt(vx*vy)
 
template<typename ExprT1 , typename ExprT2 >
BinaryExpr< ExprT1, ExprT2, std::minus< typename exprTraits< ExprT1 >::ImagePixelT >, bitwise_or< typename exprTraits< ExprT1 >::MaskPixelT >, variance_plus< typename exprTraits< ExprT1 >::VariancePixelT > > operator- (ExprT1 e1, ExprT2 e2)
 Template to evaluate (e1 - e2)
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 operator-= (ExprT1 &e1, ExprT2 e2)
 Template to evaluate e1 -= e2.
 
template<typename ExprT1 , typename ExprT2 >
BinaryExpr< ExprT1, ExprT2, std::multiplies< typename exprTraits< ExprT1 >::ImagePixelT >, bitwise_or< typename exprTraits< ExprT1 >::MaskPixelT >, variance_multiplies< typename exprTraits< ExprT1 >::VariancePixelT > > operator* (ExprT1 e1, ExprT2 e2)
 Template to evaluate (e1 * e2)
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 operator*= (ExprT1 &e1, ExprT2 e2)
 Template to evaluate e1 *= e2.
 
template<typename ExprT1 , typename ExprT2 >
BinaryExpr< ExprT1, ExprT2, std::divides< typename exprTraits< ExprT1 >::ImagePixelT >, bitwise_or< typename exprTraits< ExprT1 >::MaskPixelT >, variance_divides< typename exprTraits< ExprT1 >::VariancePixelT > > operator/ (ExprT1 e1, ExprT2 e2)
 Template to evaluate (e1 / e2)
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 operator/= (ExprT1 &e1, ExprT2 e2)
 Template to evaluate e1 /= e2.
 
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::ostreamoperator<< (std::ostream &os, SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > const &v)
 Print a SinglePixel.
 
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::ostreamoperator<< (std::ostream &os, Pixel< ImagePixelT, MaskPixelT, VariancePixelT > const &v)
 Print a Pixel.
 
template<typename ExprT1 , typename ExprT2 , typename BinOp , typename MaskBinOp , typename VarBinOp >
std::ostreamoperator<< (std::ostream &os, BinaryExpr< ExprT1, ExprT2, BinOp, MaskBinOp, VarBinOp > const &v)
 Evaluate and print a BinaryExpr.
 
 PYBIND11_MODULE (_pixel, mod)
 

Function Documentation

◆ makeSinglePixel()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > lsst::afw::image::pixel::makeSinglePixel ( ImagePixelT x,
MaskPixelT m,
VariancePixelT v )

Return a SinglePixel.

This function is useful as function overloading will choose the correct return type (cf. std::make_pair()

Definition at line 141 of file Pixel.h.

142 {
144}
int m
Definition SpanSet.cc:48
A single pixel of the same type as a MaskedImage.
Definition Pixel.h:73

◆ operator*()

template<typename ExprT1 , typename ExprT2 >
BinaryExpr< ExprT1, ExprT2, std::multiplies< typename exprTraits< ExprT1 >::ImagePixelT >, bitwise_or< typename exprTraits< ExprT1 >::MaskPixelT >, variance_multiplies< typename exprTraits< ExprT1 >::VariancePixelT > > lsst::afw::image::pixel::operator* ( ExprT1 e1,
ExprT2 e2 )

Template to evaluate (e1 * e2)

Definition at line 626 of file Pixel.h.

◆ operator*=()

template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator*= ( ExprT1 & e1,
ExprT2 e2 )

◆ operator+()

template<typename ExprT1 , typename ExprT2 , typename = std::enable_if_t < ( std::is_integral<ExprT1>::value || is_specialization<ExprT1,BinaryExpr>{} || is_specialization<ExprT1,SinglePixel>{} || is_specialization<ExprT1,Pixel>{}) && ( std::is_integral<ExprT2>::value || is_specialization<ExprT2,BinaryExpr>{} || is_specialization<ExprT2,SinglePixel>{} || is_specialization<ExprT2,Pixel>{} ) >>
BinaryExpr< ExprT1, ExprT2, std::plus< typename exprTraits< ExprT1 >::ImagePixelT >, bitwise_or< typename exprTraits< ExprT1 >::MaskPixelT >, variance_plus< typename exprTraits< ExprT1 >::VariancePixelT > > lsst::afw::image::pixel::operator+ ( ExprT1 e1,
ExprT2 e2 )

◆ operator+=()

template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator+= ( ExprT1 & e1,
ExprT2 e2 )

◆ operator-() [1/2]

template<typename ExprT1 >
UnaryExpr< ExprT1, std::negate< typename exprTraits< ExprT1 >::ImagePixelT >, noop< typename exprTraits< ExprT1 >::MaskPixelT >, noop< typename exprTraits< ExprT1 >::VariancePixelT > > lsst::afw::image::pixel::operator- ( ExprT1 e1)

Template for -e1.

Definition at line 523 of file Pixel.h.

523 {
527}
Class for representing Unary operations.
Definition Pixel.h:420
A noop functor (useful for e.g. masks and variances when changing the sign of the image)
Definition Pixel.h:338

◆ operator-() [2/2]

template<typename ExprT1 , typename ExprT2 >
BinaryExpr< ExprT1, ExprT2, std::minus< typename exprTraits< ExprT1 >::ImagePixelT >, bitwise_or< typename exprTraits< ExprT1 >::MaskPixelT >, variance_plus< typename exprTraits< ExprT1 >::VariancePixelT > > lsst::afw::image::pixel::operator- ( ExprT1 e1,
ExprT2 e2 )

◆ operator-=()

template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator-= ( ExprT1 & e1,
ExprT2 e2 )

◆ operator/()

template<typename ExprT1 , typename ExprT2 >
BinaryExpr< ExprT1, ExprT2, std::divides< typename exprTraits< ExprT1 >::ImagePixelT >, bitwise_or< typename exprTraits< ExprT1 >::MaskPixelT >, variance_divides< typename exprTraits< ExprT1 >::VariancePixelT > > lsst::afw::image::pixel::operator/ ( ExprT1 e1,
ExprT2 e2 )

Template to evaluate (e1 / e2)

Definition at line 647 of file Pixel.h.

◆ operator/=()

template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator/= ( ExprT1 & e1,
ExprT2 e2 )

◆ operator<<() [1/3]

template<typename ExprT1 , typename ExprT2 , typename BinOp , typename MaskBinOp , typename VarBinOp >
std::ostream & lsst::afw::image::pixel::operator<< ( std::ostream & os,
BinaryExpr< ExprT1, ExprT2, BinOp, MaskBinOp, VarBinOp > const & v )

Evaluate and print a BinaryExpr.

Definition at line 676 of file Pixel.h.

676 {
677 return os << "(" << v.image() << ", " << v.mask() << ", " << v.variance() << ")";
678}
ImagePixelT image() const
evaluate the image part of the expression
Definition Pixel.h:464
VariancePixelT variance() const
evaluate the variance part of the expression
Definition Pixel.h:470
MaskPixelT mask() const
evaluate the mask part of the expression
Definition Pixel.h:467

◆ operator<<() [2/3]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::ostream & lsst::afw::image::pixel::operator<< ( std::ostream & os,
Pixel< ImagePixelT, MaskPixelT, VariancePixelT > const & v )

Print a Pixel.

Definition at line 670 of file Pixel.h.

670 {
671 return os << "(" << v.image() << ", " << v.mask() << ", " << v.variance() << ")";
672}
MaskPixelT mask() const
Return the mask part of a Pixel.
Definition Pixel.h:219
ImagePixelT image() const
Return the image part of a Pixel.
Definition Pixel.h:217
VariancePixelT variance() const
Return the variance part of a Pixel.
Definition Pixel.h:221

◆ operator<<() [3/3]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::ostream & lsst::afw::image::pixel::operator<< ( std::ostream & os,
SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > const & v )

Print a SinglePixel.

Definition at line 664 of file Pixel.h.

664 {
665 return os << "(" << v.image() << ", " << v.mask() << ", " << v.variance() << ")";
666}
VariancePixelT variance() const
Definition Pixel.h:96
ImagePixelT image() const
Definition Pixel.h:94

◆ plus()

template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::plus ( ExprT1 & lhs,
ExprT2 const & rhs,
float covariance )
inline

Like operator+(), but assume that covariance's 2*alpha*sqrt(vx*vy)

Parameters
lhsLeft hand value
rhsRight hand value
covarianceAssume that covariance is 2*alpha*sqrt(vx*vy) (if variances are known)

Definition at line 591 of file Pixel.h.

595 {
596 return doPlus(lhs, rhs, covariance, typename std::is_arithmetic<ExprT1>::type());
597}
MatrixQ covariance

◆ PYBIND11_MODULE()

lsst::afw::image::pixel::PYBIND11_MODULE ( _pixel ,
mod  )

Definition at line 65 of file _pixel.cc.

65 {
66 lsst::utils::python::WrapperCollection wrappers(mod, "lsst.afw.image.pixel");
67 declareSinglePixel<float>(wrappers, "SinglePixelF");
68 declareSinglePixel<double>(wrappers, "SinglePixelD");
69 declareSinglePixel<int>(wrappers, "SinglePixelI");
70 declareSinglePixel<std::uint16_t>(wrappers, "SinglePixelU");
71 declareSinglePixel<std::uint64_t>(wrappers, "SinglePixelL");
72 wrappers.finish();
73}