Openholo  v2.1
Open Source Digital Holographic Library
define.h
Go to the documentation of this file.
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install, copy or use the software.
7 //
8 //
9 // License Agreement
10 // For Open Source Digital Holographic Library
11 //
12 // Openholo library is free software;
13 // you can redistribute it and/or modify it under the terms of the BSD 2-Clause license.
14 //
15 // Copyright (C) 2017-2024, Korea Electronics Technology Institute. All rights reserved.
16 // E-mail : contact.openholo@gmail.com
17 // Web : http://www.openholo.org
18 //
19 // Redistribution and use in source and binary forms, with or without modification,
20 // are permitted provided that the following conditions are met:
21 //
22 // 1. Redistribution's of source code must retain the above copyright notice,
23 // this list of conditions and the following disclaimer.
24 //
25 // 2. Redistribution's in binary form must reproduce the above copyright notice,
26 // this list of conditions and the following disclaimer in the documentation
27 // and/or other materials provided with the distribution.
28 //
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the copyright holder or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
39 //
40 // This software contains opensource software released under GNU Generic Public License,
41 // NVDIA Software License Agreement, or CUDA supplement to Software License Agreement.
42 // Check whether software you use contains licensed software.
43 //
44 //M*/
45 
46 #ifndef __define_h
47 #define __define_h
48 
49 namespace oph
50 {
51 #ifndef M_PI
52 #define M_PI 3.141592653589793238462643383279502884197169399375105820974944592308
53 #endif
54 
55 #ifndef M_PI_F
56 #define M_PI_F 3.14159265358979323846f
57 #endif
58 
59 //Convert Angle double
60 #define RADIAN(theta) (theta*M_PI)/180.0
61 #define DEGREE(theta) (theta*180.0)/M_PI
62 //- float
63 #define RADIAN_F(theta) (theta*M_PI_F)/180.f
64 #define DEGREE_F(theta) (theta*180.f)/M_PI_F
65 
66 #define OPH_FORWARD (-1)
67 #define OPH_BACKWARD (1)
68 
69 #define OPH_MEASURE (0U)
70 #define OPH_DESTROY_INPUT (1U << 0)
71 #define OPH_UNALIGNED (1U << 1)
72 #define OPH_CONSERVE_MEMORY (1U << 2)
73 #define OPH_EXHAUSTIVE (1U << 3)
74 #define OPH_PRESERVE_INPUT (1U << 4)
75 #define OPH_PATIENT (1U << 5)
76 #define OPH_ESTIMATE (1U << 6)
77 #define OPH_WISDOM_ONLY (1U << 21)
78 
79 #ifndef _X
80 #define _X 0
81 #endif
82 
83 #ifndef _Y
84 #define _Y 1
85 #endif
86 
87 #ifndef _Z
88 #define _Z 2
89 #endif
90 
91 #ifndef _W
92 #define _W 3
93 #endif
94 
95 #ifndef _R
96 #define _R 0
97 #endif
98 
99 #ifndef _G
100 #define _G 1
101 #endif
102 
103 #ifndef _B
104 #define _B 2
105 #endif
106 
107 #ifndef _COL
108 #define _COL 0
109 #endif
110 
111 #ifndef _ROW
112 #define _ROW 1
113 #endif
114 
115 #ifndef _MAT
116 #define _MAT 2
117 #endif
118 
119 #ifndef MAX_FLOAT
120 #define MAX_FLOAT ((float)3.40282347e+38)
121 #endif
122 
123 #ifndef MAX_DOUBLE
124 #define MAX_DOUBLE ((double)1.7976931348623158e+308)
125 #endif
126 
127 #ifndef MIN_FLOAT
128 #define MIN_FLOAT ((float)1.17549435e-38)
129 #endif
130 
131 #ifndef MIN_DOUBLE
132 #define MIN_DOUBLE ((double)2.2250738585072014e-308)
133 #endif
134 
135 #define MIN_REAL MIN_DOUBLE;
136 #define MAX_REAL MAX_DOUBLE;
137 
138 //Mode Flag
139 #define MODE_CPU 0
140 #define MODE_GPU 1
141 #define MODE_DOUBLE 0 // default
142 #define MODE_FLOAT 2
143 #define MODE_FASTMATH 4
144 
145 #define WIDTHBYTES(bits) (((bits)+31)/32*4)
146 
147 #define OPH_PLANES 1
148 #define OPH_COMPRESSION 0
149 #define X_PIXEL_PER_METER 0x130B //2835 , 72 DPI X (4875)
150 #define Y_PIXEL_PER_METER 0x130B //2835 , 72 DPI X (4875)
151 }
152 
153 #endif // !__define_h
Definition: Bitmap.h:49