update dev300-m58
[ooovba.git] / agg / inc / agg_bitset_iterator.h
blob87680b45c80daef6faf2f979672375ec1ab9b92f
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.3
3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
4 //
5 // Permission to copy, use, modify, sell and distribute this software
6 // is granted provided this copyright notice appears in all copies.
7 // This software is provided "as is" without express or implied
8 // warranty, and with no claim as to its suitability for any purpose.
9 //
10 //----------------------------------------------------------------------------
11 // Contact: mcseem@antigrain.com
12 // mcseemagg@yahoo.com
13 // http://www.antigrain.com
14 //----------------------------------------------------------------------------
16 #ifndef AGG_BITSET_ITERATOR_INCLUDED
17 #define AGG_BITSET_ITERATOR_INCLUDED
19 #include "agg_basics.h"
21 namespace agg
24 class bitset_iterator
26 public:
27 bitset_iterator(const int8u* bits, unsigned offset = 0) :
28 m_bits(bits + (offset >> 3)),
29 m_mask(0x80 >> (offset & 7))
32 void operator ++ ()
34 m_mask >>= 1;
35 if(m_mask == 0)
37 ++m_bits;
38 m_mask = 0x80;
42 unsigned bit() const
44 return (*m_bits) & m_mask;
47 private:
48 const int8u* m_bits;
49 int8u m_mask;
54 #endif