LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
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 >
 

Functions

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
SinglePixel< ImagePixelT,
MaskPixelT, VariancePixelT > 
makeSinglePixel (ImagePixelT x, MaskPixelT m, VariancePixelT v)
 
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 >
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 for (e1 + e2) More...
 
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::ostream & operator<< (std::ostream &os, SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > const &v)
 Print a SinglePixel. More...
 
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
std::ostream & operator<< (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::ostream & operator<< (std::ostream &os, BinaryExpr< ExprT1, ExprT2, BinOp, MaskBinOp, VarBinOp > const &v)
 Evaluate and print a BinaryExpr. More...
 

Function Documentation

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 131 of file Pixel.h.

131  {
132  return SinglePixel<ImagePixelT, MaskPixelT, VariancePixelT>(x, m, v);
133 }
int x
tuple m
Definition: lsstimport.py:48
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 625 of file Pixel.h.

625  {
626  return BinaryExpr<ExprT1, ExprT2,
627  std::multiplies<typename exprTraits<ExprT1>::ImagePixelT>,
628  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
629  variance_multiplies<typename exprTraits<ExprT1>::VariancePixelT> >(e1,e2);
630 }
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,
636  std::multiplies<typename exprTraits<ExprT1>::ImagePixelT>,
637  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
638  variance_multiplies<typename exprTraits<ExprT1>::VariancePixelT> >(e1,e2);
639  return e1;
640 }
template<typename ExprT1 , typename ExprT2 >
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 
)

Template for (e1 + e2)

Definition at line 544 of file Pixel.h.

544  {
545  return BinaryExpr<ExprT1, ExprT2,
546  std::plus<typename exprTraits<ExprT1>::ImagePixelT>,
547  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
548  variance_plus<typename exprTraits<ExprT1>::VariancePixelT> >(e1,e2);
549 }
template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator+= ( ExprT1 &  e1,
ExprT2  e2 
)

template for e1 += e2

Definition at line 553 of file Pixel.h.

553  {
554  e1 = BinaryExpr<ExprT1, ExprT2,
555  std::plus<typename exprTraits<ExprT1>::ImagePixelT>,
556  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
557  variance_plus<typename exprTraits<ExprT1>::VariancePixelT> >(e1,e2);
558  return e1;
559 }
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 531 of file Pixel.h.

531  {
532  return UnaryExpr<ExprT1,
533  std::negate<typename exprTraits<ExprT1>::ImagePixelT>,
534  noop<typename exprTraits<ExprT1>::MaskPixelT>,
535  noop<typename exprTraits<ExprT1>::VariancePixelT> >(e1);
536 }
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 602 of file Pixel.h.

602  {
603  return BinaryExpr<ExprT1, ExprT2,
604  std::minus<typename exprTraits<ExprT1>::ImagePixelT>,
605  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
606  variance_plus<typename exprTraits<ExprT1>::VariancePixelT> >(e1,e2);
607 }
template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator-= ( ExprT1 &  e1,
ExprT2  e2 
)

Template to evaluate e1 -= e2.

Definition at line 611 of file Pixel.h.

611  {
612  e1 = BinaryExpr<ExprT1, ExprT2,
613  std::minus<typename exprTraits<ExprT1>::ImagePixelT>,
614  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
615  variance_plus<typename exprTraits<ExprT1>::VariancePixelT> >(e1,e2);
616  return e1;
617 }
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 648 of file Pixel.h.

648  {
649  return BinaryExpr<ExprT1, ExprT2,
650  std::divides<typename exprTraits<ExprT1>::ImagePixelT>,
651  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
652  variance_divides<typename exprTraits<ExprT1>::VariancePixelT> >(e1,e2);
653 }
template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator/= ( ExprT1 &  e1,
ExprT2  e2 
)

Template to evaluate e1 /= e2.

Definition at line 657 of file Pixel.h.

657  {
658  e1 = BinaryExpr<ExprT1, ExprT2,
659  std::divides<typename exprTraits<ExprT1>::ImagePixelT>,
660  bitwise_or<typename exprTraits<ExprT1>::MaskPixelT>,
661  variance_divides<typename exprTraits<ExprT1>::VariancePixelT> >(e1,e2);
662  return e1;
663 }
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 668 of file Pixel.h.

668  {
669  return os << "(" << v.image() << ", " << v.mask() << ", " << v.variance() << ")";
670 }
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 674 of file Pixel.h.

674  {
675  return os << "(" << v.image() << ", " << v.mask() << ", " << v.variance() << ")";
676 }
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 680 of file Pixel.h.

680  {
681  return os << "(" << v.image() << ", " << v.mask() << ", " << v.variance() << ")";
682 }
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 589 of file Pixel.h.

592  {
593  return doPlus(lhs, rhs, covariance, typename boost::is_arithmetic<ExprT1>::type());
594 }