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:
authorJacques Lucke <jacques@blender.org>2020-07-10 13:53:50 +0300
committerJacques Lucke <jacques@blender.org>2020-07-10 13:57:28 +0300
commitf62204718bf8efc1661fd61cf85d24bc8268f763 (patch)
tree1b7aeea57b5435fbdab8d3d9bd1141275eaf30ef /source/blender/blenlib/BLI_color.hh
parent8f6c0f224252f722c5cd64db85b425f33ad72182 (diff)
BLI: initial hash function for Color4b and float4x4
Diffstat (limited to 'source/blender/blenlib/BLI_color.hh')
-rw-r--r--source/blender/blenlib/BLI_color.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_color.hh b/source/blender/blenlib/BLI_color.hh
index 1215affe837..265013c0013 100644
--- a/source/blender/blenlib/BLI_color.hh
+++ b/source/blender/blenlib/BLI_color.hh
@@ -118,6 +118,12 @@ struct Color4b {
{
return !(a == b);
}
+
+ uint32_t hash() const
+ {
+ return ((uint32_t)r * 1283591) ^ ((uint32_t)g * 850177) ^ ((uint32_t)b * 735391) ^
+ ((uint32_t)a * 442319);
+ }
};
} // namespace blender