Namespace lsst::afw::image::pixel

namespace pixel

Functions

template<typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
SinglePixel<ImagePixelT, MaskPixelT, VariancePixelT> 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()

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

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)

Parameters
  • lhs: Left hand value

  • rhs: Right hand value

  • covariance: Assume that covariance is 2*alpha*sqrt(vx*vy) (if variances are known)

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::ostream &operator<<(std::ostream &os, SinglePixel<ImagePixelT, MaskPixelT, VariancePixelT> const &v)

Print a SinglePixel.

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

Print a Pixel.

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.

template<typename ExprT1, typename ExprT2, typename ImageBinOp, typename MaskBinOp, typename VarianceBinOp>
class BinaryExpr
#include <Pixel.h>

Class for representing binary operations.

template<typename ExprT1, typename ImageBinOp, typename MaskBinOp, typename VarianceBinOp>
class BinaryExpr<ExprT1, double, ImageBinOp, MaskBinOp, VarianceBinOp>
#include <Pixel.h>

Partial specialization of BinaryExpr when ExprT2 is a double (i.e no mask/variance part)

template<typename T1>
struct bitwise_or : public std::binary_function<T1, T1, T1>
#include <Pixel.h>

bitwise_or doesn’t seem to be in std::

Note

We provide a single-operand version for when the right-hand-side of an expression is a scalar, not a masked pixel,

template<typename ExprT>
struct exprTraits
#include <Pixel.h>

A traits class to return the types of the image/mask/variance.

template<>
struct exprTraits<double>
#include <Pixel.h>

A specialisation of exprTraits for double

template<>
struct exprTraits<float>
#include <Pixel.h>

A specialisation of exprTraits for float

template<>
struct exprTraits<int>
#include <Pixel.h>

A specialisation of exprTraits for int

template<>
struct exprTraits<unsigned short>
#include <Pixel.h>

A specialisation of exprTraits for unsigned short

template<typename T1>
struct noop : public std::unary_function<T1, T1>
#include <Pixel.h>

A noop functor (useful for e.g. masks and variances when changing the sign of the image)

template<typename _ImagePixelT, typename _MaskPixelT, typename _VariancePixelT = double>
class Pixel : public lsst::afw::image::detail::MaskedImagePixel_tag
#include <Pixel.h>

A pixel of a MaskedImage.

template<typename PixelT>
struct PixelTypeTraits
#include <Pixel.h>

Pixel type traits.

template<typename _ImagePixelT, typename _MaskPixelT, typename _VariancePixelT>
struct PixelTypeTraits<SinglePixel<_ImagePixelT, _MaskPixelT, _VariancePixelT>>
#include <Pixel.h>

Specialization for a pixel of a MaskedImage.

template<typename _ImagePixelT, typename _MaskPixelT, typename _VariancePixelT = double>
class SinglePixel : public lsst::afw::image::detail::MaskedImagePixel_tag
#include <Pixel.h>

A single pixel of the same type as a MaskedImage.

template<typename ExprT1, typename ImageBinOp, typename MaskBinOp, typename VarianceBinOp>
class UnaryExpr
#include <Pixel.h>

Class for representing Unary operations.

template<typename T1>
struct variance_divides
#include <Pixel.h>

Calculate the variance when we divide two Pixels

Note

We provide a single-operand version for when the right-hand-side of an expression is a scalar, not a masked pixel,

template<typename T1>
struct variance_multiplies
#include <Pixel.h>

Calculate the variance when we multiply two Pixels

Note

We provide a single-operand version for when the right-hand-side of an expression is a scalar, not a masked pixel,

template<typename T1>
struct variance_plus
#include <Pixel.h>

Calculate the variance when we add (or subtract) two Pixels

Note

We provide a single-operand version for when the right-hand-side of an expression is a scalar, not a masked pixel,

template<typename T1>
struct variance_plus_covar
#include <Pixel.h>

The variance of the sum of a pair of correlated pixels

The covariance is modelled as alpha*sqrt(var_x*var_y)

Note

We provide a single-operand version for when the right-hand-side of an expression is a scalar, not a masked pixel,