libcruft-util/noise/rand/permute.cpp
2015-10-06 21:19:17 +11:00

26 lines
1.5 KiB
C++

#include "./permute.hpp"
using util::noise::rand::permute;
// static permutation offsets. consists of numbers [0,255] in a randomised
// pattern. the exact arrangement is irrelevant.
const std::array<uint8_t,256> permute::PERMUTE = {
148, 94, 173, 74, 199, 189, 102, 184, 149, 18, 177, 211, 16, 221, 252, 232,
82, 104, 164, 196, 78, 4, 247, 11, 206, 176, 137, 45, 30, 118, 72, 59,
39, 198, 158, 220, 213, 230, 197, 209, 145, 172, 188, 10, 214, 144, 241, 242,
84, 128, 168, 229, 64, 32, 20, 249, 236, 194, 253, 183, 132, 6, 43, 96,
181, 27, 127, 106, 63, 21, 134, 120, 170, 166, 93, 191, 70, 240, 46, 85,
23, 56, 228, 28, 160, 67, 175, 161, 36, 61, 204, 71, 140, 103, 190, 66,
100, 130, 192, 251, 174, 201, 79, 169, 231, 53, 48, 50, 119, 178, 87, 205,
243, 165, 207, 13, 116, 235, 24, 224, 47, 81, 195, 218, 97, 83, 238, 227,
113, 180, 33, 111, 126, 200, 153, 5, 146, 112, 179, 255, 250, 19, 92, 80,
135, 222, 95, 22, 142, 40, 15, 107, 217, 41, 77, 110, 210, 246, 185, 54,
163, 105, 114, 193, 215, 73, 150, 129, 208, 155, 171, 154, 115, 0, 8, 233,
162, 138, 109, 157, 248, 26, 25, 244, 31, 62, 75, 35, 29, 60, 182, 156,
55, 223, 125, 51, 76, 88, 9, 151, 117, 122, 38, 159, 124, 49, 44, 254,
202, 147, 225, 219, 90, 234, 133, 212, 14, 7, 167, 2, 91, 68, 187, 216,
65, 42, 69, 245, 123, 152, 89, 52, 37, 121, 143, 1, 57, 226, 3, 239,
99, 98, 108, 186, 17, 139, 203, 58, 86, 131, 141, 136, 34, 101, 12, 237
};