SourceXtractorPlusPlus
0.13
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
The object has neighbors, bright and close enough.
SourceXtractor::flags2long
constexpr int64_t flags2long(const Flags &a)
Definition:
SourceFlags.h:67
SourceXtractor::Flags::OUTSIDE
The object is completely outside of the measurement frame.
SourceXtractor::Flags::NONE
No flag is set.
SourceXtractor::operator|
constexpr Flags operator|(const Flags &a, const Flags &b)
Definition:
SourceFlags.h:48
std::int64_t
SourceXtractor::Flags::BOUNDARY
The object is truncated (too close to an image boundary)
SourceXtractor::operator&
constexpr Flags operator&(const Flags &a, const Flags &b)
Definition:
SourceFlags.h:53
SourceXtractor::Flags::BIASED
The object has bad pixels.
std::underlying_type
std::vector
STL class.
SourceXtractor::Flags::INSUFFICIENT_DATA
There are not enough good pixels to fit the parameters.
SourceXtractor::operator*
constexpr Flags operator*(const Flags &a, const bool b)
Definition:
SourceFlags.h:58
SourceXtractor::Flags::SATURATED
At least one pixel of the object is saturated.
SourceXtractor::Flags::PARTIAL_FIT
Some/all of the model parameters could not be fitted.
SourceXtractor::Flags
Flags
Flagging of bad sources.
Definition:
SourceFlags.h:34
SourceXtractor::operator|=
Flags & operator|=(Flags &a, const Flags &b)
Definition:
SourceFlags.h:62
SourceXtractor::Flags::BLENDED
The object was originally blended with another one.
SourceXtractor::Flags::ERROR
Error flag: something bad happened during the measurement, model fitting, etc.
std::vector::emplace_back
T emplace_back(T...args)
Generated by
1.8.5