LSST Applications g011c388f00+f985364e28,g0265f82a02+cefac37fe7,g16a3bce237+cefac37fe7,g2079a07aa2+b9108c1c87,g2bbee38e9b+cefac37fe7,g337abbeb29+cefac37fe7,g3ddfee87b4+425a3f5e02,g4cf46543a9+2ef32aa566,g50ff169b8f+8309cf5058,g52b1c1532d+43dac7135f,g5d89126706+46afc7f72d,g83996f0134+2fb8039c37,g858d7b2824+59f22cc8bb,g87e100324b+59f22cc8bb,g8a8a8dda67+43dac7135f,g99855d9996+1ea0a8cf94,g9d147d8712+4559cd7206,g9ddcbc5298+389b8f2b7e,ga1e77700b3+4bafba478f,ga8c6da7877+1b58c58f75,gae46bcf261+cefac37fe7,gb700894bec+f0b514b300,gb8350603e9+4979c46fed,gba4ed39666+fb465f0d3e,gbeb006f7da+bf3b4a8997,gc86a011abf+59f22cc8bb,gcf0d15dbbd+425a3f5e02,gd162630629+d0c22ff203,gd44f2fa1a7+91fd017016,gdaeeff99f8+6b435c3f92,ge79ae78c31+cefac37fe7,ge9008a0c34+425a3f5e02,gee10cc3b42+43dac7135f,gf041782ebf+713927f999,gf1cff7945b+59f22cc8bb,w.2024.07
LSST Data Management Base Package
Loading...
Searching...
No Matches
FindSetBits.h
Go to the documentation of this file.
1// -*- lsst-c++ -*-
2
3/*
4 * LSST Data Management System
5 * Copyright 2008, 2009, 2010 LSST Corporation.
6 *
7 * This product includes software developed by the
8 * LSST Project (http://www.lsst.org/).
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the LSST License Statement and
21 * the GNU General Public License along with this program. If not,
22 * see <http://www.lsstcorp.org/LegalNotices/>.
23 */
24
35#ifndef LSST_IP_DIFFIM_FINDSETBITS_H
36#define LSST_IP_DIFFIM_FINDSETBITS_H
37
38#include "lsst/afw/image.h"
39
40namespace lsst {
41namespace ip {
42namespace diffim {
43
44
52 template <typename MaskT>
54 public:
55 typedef typename MaskT::x_iterator x_iterator;
56
58 _bits(0) {;}
59 virtual ~FindSetBits() {} ;
60
61 // Clear the accumulators
62 void reset() { _bits = 0;}
63
64 // Return the bits set
65 typename MaskT::Pixel getBits() const { return _bits; }
66
67 // Work your magic
68 void apply(MaskT const& mask) {
69 reset();
70 for (int y = 0; y != mask.getHeight(); ++y) {
71 for (x_iterator ptr = mask.row_begin(y), end = mask.row_end(y); ptr != end; ++ptr) {
72 _bits |= (*ptr);
73 }
74 }
75 }
76
77 private:
78 typename MaskT::Pixel _bits;
79 };
80
81}}} // end of namespace lsst::ip::diffim
82
83
84#endif
int end
uint64_t * ptr
Definition RangeSet.cc:95
int y
Definition SpanSet.cc:48
Class to accumulate Mask bits.
Definition FindSetBits.h:53
void apply(MaskT const &mask)
Definition FindSetBits.h:68
MaskT::x_iterator x_iterator
Definition FindSetBits.h:55
MaskT::Pixel getBits() const
Definition FindSetBits.h:65