LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Classes | Namespaces | Functions
Pixel.h File Reference

Classes to provide utility functions for a "Pixel" to get at image/mask/variance operators. More...

#include <cmath>
#include <iostream>
#include <functional>

Go to the source code of this file.

Classes

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

Namespaces

 lsst
 Estimate image backgrounds.
 
 lsst::afw
 
 lsst::afw::image
 
 lsst::afw::image::pixel
 

Functions

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
SinglePixel< ImagePixelT,
MaskPixelT, VariancePixelT > 
lsst::afw::image::pixel::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 > > 
lsst::afw::image::pixel::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 > > 
lsst::afw::image::pixel::operator+ (ExprT1 e1, ExprT2 e2)
 Template for (e1 + e2) More...
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator+= (ExprT1 &e1, ExprT2 e2)
 template for e1 += e2 More...
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::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 > > 
lsst::afw::image::pixel::operator- (ExprT1 e1, ExprT2 e2)
 Template to evaluate (e1 - e2) More...
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::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 > > 
lsst::afw::image::pixel::operator* (ExprT1 e1, ExprT2 e2)
 Template to evaluate (e1 * e2) More...
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::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 > > 
lsst::afw::image::pixel::operator/ (ExprT1 e1, ExprT2 e2)
 Template to evaluate (e1 / e2) More...
 
template<typename ExprT1 , typename ExprT2 >
ExprT1 lsst::afw::image::pixel::operator/= (ExprT1 &e1, ExprT2 e2)
 Template to evaluate e1 /= e2. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

Classes to provide utility functions for a "Pixel" to get at image/mask/variance operators.

These classes allow us to manipulate the tuples returned by MaskedImage iterators/locators as if they were POD. This provides convenient syntactic sugar, but it also permits us to write generic algorithms to manipulate MaskedImages as well as Images

We need SinglePixel as well as Pixel as the latter is just a reference to a pixel in an image, and we need to be able to build temporary values too

We use C++ template expressions to manipulate Pixel and SinglePixel; this permits us to avoid making SinglePixel inherit from Pixel (or vice versa) and allows the compiler to do a much better job of optimising mixed-mode expressions — basically, it no longer needs to create SinglePixels as Pixels that have their own storage but use the reference members of Pixel to get work done. There may be better ways, but this way works, and g++ 4.0.1 (and maybe other compilers/versions) failed to optimise the previous solution very well.

Definition in file Pixel.h.