2D Amortized Noise Performance Evaluator
A Program to Evaluate the Performance of Amortized Noise
 All Classes Files Functions Variables Macros Pages
Common.h
Go to the documentation of this file.
1 
2 
3 // Copyright Ian Parberry, September 2013.
4 //
5 // This file is made available under the GNU All-Permissive License.
6 //
7 // Copying and distribution of this file, with or without modification,
8 // are permitted in any medium without royalty provided the copyright
9 // notice and this notice are preserved. This file is offered as-is,
10 // without any warranty.
11 
12 // Created by Ian Parberry, September 2013.
13 // Last updated May 6, 2014.
14 
15 #pragma once
16 
17 #pragma once
18 
19 #define MurmurHash3_32 MurmurHash3_x86_32
20 
21 #define B 0x100
22 #define BM 0xff
23 #define N 0x1000
24 
25 #define lerp(t, a, b) (a + t*(b - a))
26 #define s_curve(t) (t * t * (3.0f - 2.0f*t))
27 #define s_curve2(t) (t * t * t * (10.0f + 3.0f * t * (2.0f*t - 5.0f)))
28 
29 
30 #define setup(i,b0,b1,r0,r1)\
31  t = vec[i] + N;\
32  b0 = ((int)t) & BM;\
33  b1 = (b0+1) & BM;\
34  r0 = t - (int)t;\
35  r1 = r0 - 1.0f;
36 
37 #define at2(rx, ry) (rx*q[0] + ry*q[1])
38 
39 unsigned int h2(unsigned int x, unsigned int y);