Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-02-13 09:47:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-02-13 10:59:56 +0300
commit12b996e61b0b6805d1880ad94fe4e192fc6f41ae (patch)
tree52c44be580f367e0eaed5204c4fe528dab97bf27 /source/blender/blenlib/BLI_bitmap.h
parentc9ef3d1f69acc176f6d0fb3ebbcda3fe2e61d78a (diff)
BLI_bitmap: add flip macro
Diffstat (limited to 'source/blender/blenlib/BLI_bitmap.h')
-rw-r--r--source/blender/blenlib/BLI_bitmap.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index 60fc143a447..82704e95fdd 100644
--- a/source/blender/blenlib/BLI_bitmap.h
+++ b/source/blender/blenlib/BLI_bitmap.h
@@ -86,6 +86,12 @@ typedef unsigned int BLI_bitmap;
((_bitmap)[(_index) >> _BITMAP_POWER] &= \
~(1u << ((_index) & _BITMAP_MASK))))
+/* flip the value of a single bit at '_index' */
+#define BLI_BITMAP_FLIP(_bitmap, _index) \
+ (CHECK_TYPE_ANY(_bitmap, BLI_bitmap *, const BLI_bitmap *), \
+ ((_bitmap)[(_index) >> _BITMAP_POWER] ^= \
+ (1u << ((_index) & _BITMAP_MASK))))
+
/* set or clear the value of a single bit at '_index' */
#define BLI_BITMAP_SET(_bitmap, _index, _set) \
{ \