CvBitfield::SetBit(uint, bool)
- Defined in
- CvBitfield.h, line 34
- Class
- CvBitfield
- Not a hook point
- written in a header
Code
33 /// Set a bit on/off34 void SetBit(uint uiIndex, bool bValue)35 {36 uint uiByteIndex = uiIndex >> 3;37 if (uiByteIndex < m_uiByteSize)38 {39 if (bValue)40 m_pBits[uiByteIndex] |= (1 << (uiIndex&0x7));41 else42 m_pBits[uiByteIndex] &= ~(1 << (uiIndex&0x7));43 }44 else45 if (bValue) // Only resize if setting the value46 {47 SetSize(uiIndex + 1);48 m_pBits[uiByteIndex] |= (1 << (uiIndex&0x7));49 }50 }