-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.h
64 lines (50 loc) · 1.41 KB
/
constants.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "assert.h"
#include "pthread.h"
typedef unsigned char u8;
typedef unsigned u32;
typedef unsigned long long u64;
typedef unsigned __int128 u128;
typedef __int128 s128;
//"Machine epsilon" values for hardware float types
//Assume values near 1 can't differ by less than this
#define EPS_32 (1e-07)
#define EPS_64 (1e-15)
#define EPS_80 (1e-19)
// 2^maxExpo - 1 is the max value of FP
// Should be big enough to hold the width of image
#define maxExpo 12
#ifndef __cplusplus
#define max(a, b) (a < b ? b : a)
#define min(a, b) (a < b ? a : b)
#endif
//Special iter values
#define NOT_COMPUTED -2
#define BLANK -3
#define OUTSIDE_IMAGE -4
// How many points with high iter value to choose in getInterestingLocation
// frame, which are then selected among randomly to get next frame's center
#define GIL_CANDIDATES 2
//gives pretty good values even for bad rand
#define mrand (rand() >> 4)
#define CRASH(msg) {printf("Error: " msg " in file " __FILE__ ", line %i\n", __LINE__); exit(1);}
extern float* iters;
extern unsigned* frameBuf;
extern int winw;
extern int winh;
extern int maxiter;
extern int prec;
extern int numThreads;
extern int pixelsComputed;
extern float iterScale;
extern float getPixelConvRate(int x, int y);
#ifdef __cplusplus
#define MANDELBROT_API extern "C"
#else
#define MANDELBROT_API
#endif
#endif