LSST Applications g0265f82a02+c6dfa2ddaf,g06e71c497f+096b73effd,g1162b98a3f+7357863717,g2079a07aa2+1b2e822518,g24bb6cda20+5d01030798,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g3ddfee87b4+f3fc968792,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+f3fc968792,g5ec818987f+d9e88ddb69,g858d7b2824+8dc8b78d92,g876c692160+77fc37dd95,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+b970a87ef8,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+608c5736b2,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+6424bb6c0b,gba4ed39666+1ac82b564f,gbb8dafda3b+949d6afab0,gbeb006f7da+65ac3eb7b6,gc28159a63d+c6dfa2ddaf,gc86a011abf+8dc8b78d92,gcf0d15dbbd+f3fc968792,gd162630629+ec0ba879d0,gdaeeff99f8+1cafcb7cd4,gdc0c513512+8dc8b78d92,ge79ae78c31+c6dfa2ddaf,gee10cc3b42+90ebb246c7,gf1cff7945b+8dc8b78d92,w.2024.12
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lsst::afw::image::Color Class Referencefinal

Describe the colour of a source. More...

#include <Color.h>

Public Member Functions

 Color (double g_r=std::numeric_limits< double >::quiet_NaN())
 
 Color (Color const &)=default
 
 Color (Color &&)=default
 
Coloroperator= (Color const &)=default
 
Coloroperator= (Color &&)=default
 
 ~Color () noexcept=default
 
bool isIndeterminate () const noexcept
 Whether the color is the special value that indicates that it is unspecified.
 
bool operator== (Color const &other) const noexcept
 Equality comparison for colors.
 
bool operator!= (Color const &other) const noexcept
 
std::size_t hash_value () const noexcept
 Return a hash of this object.
 

Detailed Description

Describe the colour of a source.

We need a concept of colour more general than "g - r" in order to calculate e.g. atmospheric dispersion or a source's PSF

Note
This is very much just a place holder until we work out what we need. A full SED may be required, in which case a constructor from an SED name might be appropriate, or a couple of colours, or ...

Definition at line 25 of file Color.h.

Constructor & Destructor Documentation

◆ Color() [1/3]

lsst::afw::image::Color::Color ( double g_r = std::numeric_limits<double>::quiet_NaN())
inlineexplicit

Definition at line 27 of file Color.h.

27: _g_r(g_r) {}

◆ Color() [2/3]

lsst::afw::image::Color::Color ( Color const & )
default

◆ Color() [3/3]

lsst::afw::image::Color::Color ( Color && )
default

◆ ~Color()

lsst::afw::image::Color::~Color ( )
defaultnoexcept

Member Function Documentation

◆ hash_value()

std::size_t lsst::afw::image::Color::hash_value ( ) const
inlinenoexcept

Return a hash of this object.

Definition at line 56 of file Color.h.

56{ return isIndeterminate() ? 42 : std::hash<double>()(_g_r); }
bool isIndeterminate() const noexcept
Whether the color is the special value that indicates that it is unspecified.
Definition Color.h:36

◆ isIndeterminate()

bool lsst::afw::image::Color::isIndeterminate ( ) const
inlinenoexcept

Whether the color is the special value that indicates that it is unspecified.

Definition at line 36 of file Color.h.

36{ return std::isnan(_g_r); }
T isnan(T... args)

◆ operator!=()

bool lsst::afw::image::Color::operator!= ( Color const & other) const
inlinenoexcept

Definition at line 52 of file Color.h.

52{ return !operator==(other); }
bool operator==(Color const &other) const noexcept
Equality comparison for colors.
Definition Color.h:49

◆ operator=() [1/2]

Color & lsst::afw::image::Color::operator= ( Color && )
default

◆ operator=() [2/2]

Color & lsst::afw::image::Color::operator= ( Color const & )
default

◆ operator==()

bool lsst::afw::image::Color::operator== ( Color const & other) const
inlinenoexcept

Equality comparison for colors.

Just a placeholder like everything else, but we explicitly let indeterminate colors compare as equal.

In the future, we'll probably want some way of doing fuzzy comparisons on colors, but then we'd have to define some kind of "color difference" matric, and it's not worthwhile doing that yet.

Definition at line 49 of file Color.h.

49 {
50 return (isIndeterminate() && other.isIndeterminate()) || other._g_r == _g_r;
51 }

The documentation for this class was generated from the following file: