diff options
Diffstat (limited to 'source/blender/blenlib/BLI_hash.h')
-rw-r--r-- | source/blender/blenlib/BLI_hash.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_hash.h b/source/blender/blenlib/BLI_hash.h index d687e805323..cfd39ea3cf8 100644 --- a/source/blender/blenlib/BLI_hash.h +++ b/source/blender/blenlib/BLI_hash.h @@ -90,6 +90,16 @@ BLI_INLINE unsigned int BLI_hash_string(const char *str) return i; } +BLI_INLINE float BLI_hash_int_2d_to_float(uint32_t kx, uint32_t ky) +{ + return (float)BLI_hash_int_2d(kx, ky) / (float)0xFFFFFFFFu; +} + +BLI_INLINE float BLI_hash_int_3d_to_float(uint32_t kx, uint32_t ky, uint32_t kz) +{ + return (float)BLI_hash_int_3d(kx, ky, kz) / (float)0xFFFFFFFFu; +} + BLI_INLINE unsigned int BLI_hash_int(unsigned int k) { return BLI_hash_int_2d(k, 0); |