SourceXtractorPlusPlus
0.11
Please provide a description of the project.
SEFramework
SEFramework
Source
SourceFlags.h
Go to the documentation of this file.
1
17
/*
18
* SourceFlags.h
19
*
20
* Created on: Oct 19, 2018
21
* Author: Alejandro Alvarez Ayllon
22
*/
23
24
#ifndef _SEFRAMEWORK_SOURCE_SOURCEFLAGS_H_
25
#define _SEFRAMEWORK_SOURCE_SOURCEFLAGS_H_
26
27
#include <type_traits>
28
#include <vector>
29
#include <stdint.h>
30
31
namespace
SourceXtractor
{
32
34
enum class
Flags
:
int64_t
{
35
NONE
= 0,
36
BIASED
= 1ll << 0,
37
BLENDED
= 1ll << 1,
38
SATURATED
= 1ll << 2,
39
BOUNDARY
= 1ll << 3,
40
NEIGHBORS
= 1ll << 4,
41
OUTSIDE
= 1ll << 5,
42
PARTIAL_FIT
= 1ll << 6,
43
INSUFFICIENT_DATA
= 1ll << 7,
44
ERROR
= 1ll << 10,
45
};
46
47
48
constexpr
inline
Flags
operator|
(
const
Flags
&a,
const
Flags
&b) {
49
typedef
typename
std::underlying_type<Flags>::type
base_int_t;
50
return
static_cast<
Flags
>
(
static_cast<
base_int_t
>
(a) |
static_cast<
base_int_t
>
(b));
51
}
52
53
constexpr
inline
Flags
operator&
(
const
Flags
&a,
const
Flags
&b) {
54
typedef
typename
std::underlying_type<Flags>::type
base_int_t;
55
return
static_cast<
Flags
>
(
static_cast<
base_int_t
>
(a) &
static_cast<
base_int_t
>
(b));
56
}
57
58
constexpr
Flags
operator*
(
const
Flags
&a,
const
bool
b) {
59
return
b ? a :
Flags::NONE
;
60
}
61
62
inline
Flags
&
operator|=
(
Flags
&a,
const
Flags
&b) {
63
a = a | b;
64
return
a;
65
}
66
67
constexpr
inline
int64_t
flags2long
(
const
Flags
&a) {
68
return
static_cast<
int64_t
>
(a);
69
}
70
71
inline
std::vector<int64_t>
flags2long
(
const
std::vector<Flags>
&v) {
72
std::vector<int64_t>
vl;
73
for
(
auto
a : v) {
74
vl.
emplace_back
(
flags2long
(a));
75
}
76
return
vl;
77
}
78
79
}
// end SourceXtractor
80
81
#endif // _SEFRAMEWORK_SOURCE_SOURCEFLAGS_H_
SourceXtractor::Flags::NEIGHBORS
@ NEIGHBORS
The object has neighbors, bright and close enough.
std::vector
STL class.
SourceXtractor::Flags::ERROR
@ ERROR
Error flag: something bad happened during the measurement, model fitting, etc.
SourceXtractor::Flags
Flags
Flagging of bad sources.
Definition:
SourceFlags.h:34
SourceXtractor::Flags::BOUNDARY
@ BOUNDARY
The object is truncated (too close to an image boundary)
SourceXtractor::Flags::PARTIAL_FIT
@ PARTIAL_FIT
Some/all of the model parameters could not be fitted.
std::underlying_type
SourceXtractor::Flags::SATURATED
@ SATURATED
At least one pixel of the object is saturated.
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::operator|=
Flags & operator|=(Flags &a, const Flags &b)
Definition:
SourceFlags.h:62
SourceXtractor::operator*
constexpr Flags operator*(const Flags &a, const bool b)
Definition:
SourceFlags.h:58
std::int64_t
SourceXtractor::Flags::INSUFFICIENT_DATA
@ INSUFFICIENT_DATA
There are not enough good pixels to fit the parameters.
SourceXtractor::Flags::NONE
@ NONE
No flag is set.
std::vector::emplace_back
T emplace_back(T... args)
SourceXtractor::Flags::OUTSIDE
@ OUTSIDE
The object is completely outside of the measurement frame.
SourceXtractor::Flags::BIASED
@ BIASED
The object has bad pixels.
SourceXtractor::flags2long
constexpr int64_t flags2long(const Flags &a)
Definition:
SourceFlags.h:67
SourceXtractor::Flags::BLENDED
@ BLENDED
The object was originally blended with another one.
SourceXtractor::operator&
constexpr Flags operator&(const Flags &a, const Flags &b)
Definition:
SourceFlags.h:53
SourceXtractor::operator|
constexpr Flags operator|(const Flags &a, const Flags &b)
Definition:
SourceFlags.h:48
Generated by
1.8.18