LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
LSST Data Management Base Package
Classes | Functions
lsst::afw::image::pixel Namespace Reference

Classes

class  BinaryExpr
 Class for representing binary operations. More...
 
struct  exprTraits
 A traits class to return the types of the image/mask/variance. More...
 
struct  bitwise_or
 bitwise_or doesn't seem to be in std:: 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...
 
class  SinglePixel
 A single pixel of the same type as a MaskedImage. More...
 
struct  PixelTypeTraits
 Pixel type traits. More...
 
struct  PixelTypeTraits< SinglePixel< _ImagePixelT, _MaskPixelT, _VariancePixelT > >
 Specialization for a pixel of a MaskedImage. More...
 
class  Pixel
 A pixel of a MaskedImage. 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  noop
 A noop functor (useful for e.g. masks and variances when changing the sign of the image) More...
 
struct  variance_plus_covar
 The variance of the sum of a pair of correlated pixels. More...
 
class  UnaryExpr
 Class for representing Unary 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  is_specialization
 Template for (e1 + e2) More...
 
struct  is_specialization< Template< Args... >, Template >
 

Functions

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > makeSinglePixel (ImagePixelT x, MaskPixelT m, VariancePixelT v)
 Return a SinglePixel. More...
 
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. More...
 
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 More...
 
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) More...
 
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) More...
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 operator-= (ExprT1 &e1, ExprT2 e2)
 Template to evaluate e1 -= e2. More...
 
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) More...
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 operator*= (ExprT1 &e1, ExprT2 e2)
 Template to evaluate e1 *= e2. More...
 
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) More...
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 operator/= (ExprT1 &e1, ExprT2 e2)
 Template to evaluate e1 /= e2. More...
 
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::ostreamoperator<< (std::ostream &os, SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > const &v)
 Print a SinglePixel. More...
 
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::ostreamoperator<< (std::ostream &os, Pixel< ImagePixelT, MaskPixelT, VariancePixelT > const &v)
 Print a Pixel. More...
 
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. More...
 
 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  {
143  return SinglePixel<ImagePixelT, MaskPixelT, VariancePixelT>(x, m, v);
144 }
double x
int m
Definition: SpanSet.cc:49

◆ 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.

626  {
627  return BinaryExpr<ExprT1, ExprT2, std::multiplies<typename exprTraits<ExprT1>::ImagePixelT>,
628  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
629  variance_multiplies<typename exprTraits<ExprT1>::VariancePixelT> >(e1, e2);
630 }

◆ operator*=()

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

Template to evaluate e1 *= e2.

Definition at line 634 of file Pixel.h.

634  {
635  e1 = BinaryExpr<ExprT1, ExprT2, std::multiplies<typename exprTraits<ExprT1>::ImagePixelT>,
636  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
637  variance_multiplies<typename exprTraits<ExprT1>::VariancePixelT> >(e1, e2);
638  return e1;
639 }

◆ 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 
)

Definition at line 553 of file Pixel.h.

553  {
554  return BinaryExpr<ExprT1, ExprT2, std::plus<typename exprTraits<ExprT1>::ImagePixelT>,
555  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
556  variance_plus<typename exprTraits<ExprT1>::VariancePixelT> >(e1, e2);
557 }

◆ operator+=()

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

template for e1 += e2

Definition at line 561 of file Pixel.h.

561  {
562  e1 = BinaryExpr<ExprT1, ExprT2, std::plus<typename exprTraits<ExprT1>::ImagePixelT>,
563  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
564  variance_plus<typename exprTraits<ExprT1>::VariancePixelT> >(e1, e2);
565  return e1;
566 }

◆ 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  {
524  return UnaryExpr<ExprT1, std::negate<typename exprTraits<ExprT1>::ImagePixelT>,
525  noop<typename exprTraits<ExprT1>::MaskPixelT>,
526  noop<typename exprTraits<ExprT1>::VariancePixelT> >(e1);
527 }

◆ 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 
)

Template to evaluate (e1 - e2)

Definition at line 605 of file Pixel.h.

605  {
606  return BinaryExpr<ExprT1, ExprT2, std::minus<typename exprTraits<ExprT1>::ImagePixelT>,
607  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
608  variance_plus<typename exprTraits<ExprT1>::VariancePixelT> >(e1, e2);
609 }

◆ operator-=()

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

Template to evaluate e1 -= e2.

Definition at line 613 of file Pixel.h.

613  {
614  e1 = BinaryExpr<ExprT1, ExprT2, std::minus<typename exprTraits<ExprT1>::ImagePixelT>,
615  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
616  variance_plus<typename exprTraits<ExprT1>::VariancePixelT> >(e1, e2);
617  return e1;
618 }

◆ 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.

647  {
648  return BinaryExpr<ExprT1, ExprT2, std::divides<typename exprTraits<ExprT1>::ImagePixelT>,
649  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
650  variance_divides<typename exprTraits<ExprT1>::VariancePixelT> >(e1, e2);
651 }

◆ operator/=()

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

Template to evaluate e1 /= e2.

Definition at line 655 of file Pixel.h.

655  {
656  e1 = BinaryExpr<ExprT1, ExprT2, std::divides<typename exprTraits<ExprT1>::ImagePixelT>,
657  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
658  variance_divides<typename exprTraits<ExprT1>::VariancePixelT> >(e1, e2);
659  return e1;
660 }

◆ 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 }
std::ostream * os
Definition: Schema.cc:746

◆ 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 }

◆ 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 }

◆ 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
Definition: simpleShape.cc:152

◆ 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 }
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition: python.h:242