PCL
Defs.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.1.19
6 // ----------------------------------------------------------------------------
7 // pcl/Defs.h - Released 2019-11-07T10:59:34Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2019 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (http://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_Defs_h
53 #define __PCL_Defs_h
54 
56 
144 // ----------------------------------------------------------------------------
145 // General definitions used by all PixInsight modules and programs.
146 // Included directly by PCL API and PixInsight source modules.
147 // ----------------------------------------------------------------------------
148 
149 /*
150  * One and only one platform selection macro has to be defined.
151  */
152 #ifndef __PCL_FREEBSD
153 # ifndef __PCL_LINUX
154 # ifndef __PCL_MACOS
155 # ifndef __PCL_MACOSX
156 # ifndef __PCL_WINDOWS
157 # error No platform selection macro has been defined.
158 # endif
159 # endif
160 # endif
161 # endif
162 #endif
163 
164 /*
165  * __PCL_MACOS and __PCL_MACOSX are synonyms and both always defined on macOS.
166  */
167 #ifdef __PCL_MACOS
168 # ifndef __PCL_MACOSX
169 # define __PCL_MACOSX
170 # endif
171 #endif
172 #ifdef __PCL_MACOSX
173 # ifndef __PCL_MACOS
174 # define __PCL_MACOS
175 # endif
176 #endif
177 
178 /*
179  * Check for conflicting platform selection macros.
180  */
181 #ifdef __PCL_FREEBSD
182 # if defined( __PCL_LINUX ) || defined( __PCL_MACOSX ) || defined( __PCL_WINDOWS )
183 # error Multiple platform selection macros have been defined.
184 # endif
185 #endif
186 #ifdef __PCL_LINUX
187 # if defined( __PCL_FREEBSD ) || defined( __PCL_MACOSX ) || defined( __PCL_WINDOWS )
188 # error Multiple platform selection macros have been defined.
189 # endif
190 #endif
191 #ifdef __PCL_MACOSX
192 # if defined( __PCL_FREEBSD ) || defined( __PCL_LINUX ) || defined( __PCL_WINDOWS )
193 # error Multiple platform selection macros have been defined.
194 # endif
195 #endif
196 #ifdef __PCL_WINDOWS
197 # if defined( __PCL_FREEBSD ) || defined( __PCL_LINUX ) || defined( __PCL_MACOSX )
198 # error Multiple platform selection macros have been defined.
199 # endif
200 #endif
201 
202 /*
203  * __PCL_UNIX is always defined on FreeBSD, Linux and macOS platforms.
204  */
205 #if defined( __PCL_LINUX ) || defined( __PCL_FREEBSD ) || defined( __PCL_MACOSX )
206 # ifndef __PCL_UNIX
207 # define __PCL_UNIX
208 # endif
209 #endif
210 
211 /*
212  * __PCL_X11 is always defined on FreeBSD and Linux platforms.
213  */
214 #if defined( __PCL_LINUX ) || defined( __PCL_FREEBSD )
215 # ifndef __PCL_X11
216 # define __PCL_X11
217 # endif
218 #endif
219 
220 /*
221  * Platform architecture requirements:
222  *
223  * - x86_64 / EM64T / AMD64 architecture.
224  */
225 #ifndef __x86_64__
226 # ifndef __x86_64
227 # ifndef __amd64__
228 # ifndef __amd64
229 # ifndef _M_X64
230 # ifndef _M_AMD64
231 # error This version of PCL requires an x86_64 / EM64T / AMD64 architecture.
232 # endif
233 # endif
234 # endif
235 # endif
236 # endif
237 #endif
238 #ifndef __PCL_X64
239 # define __PCL_X64
240 #endif
241 
242 /*
243  * Compiler requirements:
244  *
245  * - GCC >= 7 on UNIX/Linux
246  * - Clang >= 5 on UNIX/Linux
247  * - MSVC++ >= 15.0 / Visual Studio 2017 on Windows
248  */
249 #ifdef __PCL_WINDOWS
250 # ifdef _MSC_VER
251 # if _MSC_VER < 1910
252 # error This version of PCL requires MSVC++ 15.0 / Visual Studio 2017 or higher on MS Windows platforms.
253 # endif
254 # else
255 # error Unsupported C++ compiler on MS Windows platform.
256 # endif
257 #else
258 # ifdef _MSC_VER
259 # error _MSC_VER should not be #defined on UNIX/Linux platforms.
260 # else
261 # ifdef __clang__
262 # if ( __clang_major__ < 5 )
263 # error This version of PCL requires Clang 5 or higher on UNIX/Linux platforms.
264 # endif
265 # else
266 # ifdef __GNUC__
267 # if ( __GNUC__ < 7 )
268 # error This version of PCL requires GCC 7 or higher on UNIX/Linux platforms.
269 # endif
270 # else
271 # error Unsupported C++ compiler on UNIX/Linux platform.
272 # endif
273 # endif
274 # endif
275 #endif
276 
277 /*
278  * Brain-damaged compilers emit particularly useless warning messages.
279  * N.B.: This must be done *before* including windows.h
280  */
281 #ifndef __PCL_NO_WARNING_MUTE_PRAGMAS
282 # ifdef _MSC_VER
283 # define _CRT_SECURE_NO_DEPRECATE 1 // Deal with MS's attempt at deprecating C standard runtime functions
284 # pragma warning( disable: 4996 ) // ...
285 # pragma warning( disable: 4018 ) // '<' : signed/unsigned mismatch
286 # pragma warning( disable: 4049 ) // More than 64k source lines
287 # pragma warning( disable: 4150 ) // Deletion of pointer to incomplete type 'type'; no destructor called
288 # pragma warning( disable: 4244 ) // Conversion from 'type1' to 'type2', possible loss of data
289 # pragma warning( disable: 4345 ) // Behavior change: an object of POD type constructed...
290 # pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
291 # pragma warning( disable: 4521 ) // Multiple copy constructors defined
292 # pragma warning( disable: 4522 ) // Multiple assignment operators defined
293 # pragma warning( disable: 4710 ) // Function not inlined
294 # pragma warning( disable: 4723 ) // Potential divide by 0
295 # pragma warning( disable: 4800 ) // 'boolean' : forcing value to bool 'true' or 'false' (performance warning)
296 # endif
297 #endif
298 
299 /*
300  * Compiler warning management macros
301  */
302 #ifdef _MSC_VER
303 # define PCL_WARNINGS_PUSH \
304  __pragma(warning(push))
305 #else
306 # define PCL_WARNINGS_PUSH \
307  _Pragma("GCC diagnostic push")
308 #endif
309 
310 #ifdef _MSC_VER
311 # define PCL_WARNINGS_POP \
312  __pragma(warning(pop))
313 #else
314 # define PCL_WARNINGS_POP \
315  _Pragma("GCC diagnostic pop")
316 #endif
317 
318 #ifdef _MSC_VER
319 # define PCL_WARNINGS_DISABLE_UNINITIALIZED_VARIABLE \
320  __pragma(warning( disable: 6001 )) \
321  __pragma(warning( disable: 4700 ))
322 #else
323 # define PCL_WARNINGS_DISABLE_UNINITIALIZED_VARIABLE \
324  _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
325 #endif
326 
327 // Disable C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
328 #ifdef _MSC_VER
329 # define PCL_WARNINGS_DISABLE_SIZE_T_TO_INT_LOSS \
330  __pragma(warning( disable: 4267 ))
331 #endif
332 
333 /*
334  * Disable unused variable warnings. This solution is portable for all
335  * compilers supporting C++11 or newer. The function call should be optimized
336  * away by any reasonable compiler (including MSVC :).
337  */
338 template <typename... Args> inline void __pcl_unused__( Args&&... ) {}
339 #define PCL_UNUSED( x ) __pcl_unused__( x );
340 
341 /*
342  * On Windows/MSVC++, _CRT_RAND_S must be #defined for rand_s() to work:
343  * http://msdn.microsoft.com/en-us/library/sxtz2fa8.aspx
344  */
345 #ifdef _MSC_VER
346 # define _CRT_RAND_S
347 #endif
348 
349 /*
350  * C standard definitions.
351  */
352 #ifndef __stddef_h
353 # include <stddef.h>
354 # ifndef __stddef_h
355 # define __stddef_h
356 # endif
357 #endif
358 
359 /*
360  * C++11: Utility functions.
361  */
362 #ifndef __utility_h
363 # include <utility>
364 # ifndef __utility_h
365 # define __utility_h
366 # endif
367 #endif
368 
369 /*
370  * C++11: Compile-time type information classes.
371  */
372 #ifndef __type_traits_h
373 # include <type_traits>
374 # ifndef __type_traits_h
375 # define __type_traits_h
376 # endif
377 #endif
378 
379 /*
380  * C++11: std::initializer_list.
381  */
382 #ifndef __initializer_list_h
383 # include <initializer_list>
384 # ifndef __initializer_list_h
385 # define __initializer_list_h
386 # endif
387 #endif
388 
389 /*
390  * Macros that control global symbol visibility.
391  *
392  * On UNIX/Linux, compilation with -fvisibility=hidden is required for PCL and
393  * all PixInsight modules and applications.
394  */
395 #ifdef _MSC_VER // Windows
396 # define PCL_EXPORT __declspec(dllexport)
397 # define PCL_MODULE_EXPORT extern "C" PCL_EXPORT
398 # define PCL_IMPORT __declspec(dllimport)
399 # define PCL_LOCAL
400 # define PCL_BEGIN_LOCAL
401 # define PCL_END_LOCAL
402 # define PCL_INTERNAL
403 # define PCL_BEGIN_INTERNAL
404 # define PCL_END_INTERNAL
405 #else // Linux/X11, FreeBSD/X11 and Mac OS X
406 # define PCL_EXPORT __attribute__((visibility ("default")))
407 # if defined( __clang__ ) // Clang does not have the "externally_visible" attribute
408 # define PCL_MODULE_EXPORT extern "C" __attribute__((visibility ("default")))
409 # else
410 # define PCL_MODULE_EXPORT extern "C" __attribute__((visibility ("default"), externally_visible))
411 # endif
412 # define PCL_IMPORT __attribute__((visibility ("default")))
413 # define PCL_LOCAL __attribute__((visibility ("hidden")))
414 # define PCL_BEGIN_LOCAL _Pragma ( "GCC visibility push( hidden )" )
415 # define PCL_END_LOCAL _Pragma ( "GCC visibility pop" )
416 # define PCL_INTERNAL __attribute__((visibility ("internal")))
417 # define PCL_BEGIN_INTERNAL _Pragma ( "GCC visibility push( internal )" )
418 # define PCL_END_INTERNAL _Pragma ( "GCC visibility pop" )
419 #endif
420 #ifdef __PCL_DSO // Using PCL as a dynamic shared object - ### untested/experimental
421 # ifdef __PCL_BUILDING_PCL_DSO // building the PCL DSO
422 # define PCL_PUBLIC PCL_EXPORT
423 # else // linking against the PCL DSO
424 # define PCL_PUBLIC PCL_IMPORT
425 # endif
426 #else // Using PCL as a static library
427 # define PCL_PUBLIC
428 #endif
429 
430 /*
431  * The PCL_CLASS, PCL_FUNC and PCL_DATA macros allow us to modify attributes in
432  * all declarations of PCL API classes, functions and data items, respectively.
433  */
434 #define PCL_CLASS PCL_PUBLIC
435 #define PCL_FUNC PCL_PUBLIC
436 #define PCL_DATA PCL_PUBLIC
437 
438 /*
439  * Fastcall calling convention.
440  */
441 #ifndef __PCL_NO_FASTCALL
442 # ifdef _MSC_VER
443 # define PCL_FASTCALL __fastcall
444 # else
445 # define PCL_FASTCALL __attribute__((fastcall))
446 # endif
447 #else
448 # define PCL_FASTCALL
449 #endif
450 
451 /*
452  * Always inline functions.
453  */
454 #ifndef __PCL_NO_FORCE_INLINE
455 # ifdef _MSC_VER // Visual Studio
456 # define PCL_FORCE_INLINE __forceinline
457 # else
458 # define PCL_FORCE_INLINE inline __attribute__((always_inline))
459 # endif
460 #else
461 # define PCL_FORCE_INLINE
462 #endif
463 
464 /*
465  * Special GCC function optimizations
466  */
467 #ifndef __PCL_NO_HOT_FUNCTIONS
468 # ifdef _MSC_VER
469 # define PCL_HOT_FUNCTION
470 # else
471 # define PCL_HOT_FUNCTION __attribute__((hot))
472 # endif
473 #else
474 # define PCL_HOT_FUNCTION
475 #endif
476 
477 /*
478  * Aligned memory allocation functions.
479  */
480 #ifdef _MSC_VER
481 # define PCL_ALIGNED_MALLOC _aligned_malloc
482 # define PCL_ALIGNED_FREE _aligned_free
483 #else
484 # define PCL_ALIGNED_MALLOC _mm_malloc
485 # define PCL_ALIGNED_FREE _mm_free
486 #endif
487 
488 /*
489  * 16-byte aligned blocks for automatic vectorization.
490  */
491 #ifdef _MSC_VER // Windows
492 # define PCL_ALIGNED16 __declspec(align(16))
493 # define PCL_ASSUME16( x ) x
494 #else // GCC and Clang
495 # define PCL_ALIGNED16 __attribute__((aligned(16)))
496 # define PCL_ASSUME16( x ) __builtin_assume_aligned( x, 16 )
497 #endif
498 
499 /*
500  * Current function name.
501  */
502 #ifdef _MSC_VER
503 # define PCL_FUNCTION_NAME __FUNCTION__
504 #else
505 # define PCL_FUNCTION_NAME __func__
506 #endif
507 
508 /*
509  * Minimum Win32 versions supported.
510  */
511 #ifdef __PCL_WINDOWS
512 # ifndef __PCL_NO_WIN32_MINIMUM_VERSIONS
513 # define WINVER 0x0601 // Windows 7
514 # define _WIN32_WINNT 0x0601
515 # endif
516 #endif
517 
518 /*
519  * C++11 features not supported by Visual Studio 2013.
520  */
521 #ifdef _MSC_VER
522 # if _MSC_VER < 1900
523 # define constexpr
524 # define noexcept
525 # endif
526 #endif
527 
528 /*
529  * Size and distance types.
530  */
531 #ifndef __PCL_NO_SIZE_AND_DISTANCE_TYPES
532 
533 namespace pcl
534 {
543 typedef size_t size_type;
544 
549 typedef ptrdiff_t distance_type;
550 
551 } // pcl
552 
553 #endif // !__PCL_NO_SIZE_AND_DISTANCE_TYPES
554 
555 /*
556  * Portable integer types
557  */
558 #ifndef __PCL_NO_PORTABLE_INTEGER_TYPES
559 
560 namespace pcl
561 {
570 typedef signed char int8;
571 
576 typedef unsigned char uint8;
577 
582 typedef signed short int16;
583 
588 typedef unsigned short uint16;
589 
594 typedef signed int int32;
595 
600 typedef unsigned int uint32;
601 
602 #ifdef _MSC_VER // Valid for MS Visual C++
603 typedef signed __int64 int64;
604 typedef unsigned __int64 uint64;
605 #else // Valid for gcc
606 
610 typedef signed long long int64;
611 
616 typedef unsigned long long uint64;
617 #endif // _MSC_VER
618 
619 struct PCL_AssertScalarSizes
620 {
621  static_assert( sizeof( int8 ) == 1, "Invalid sizeof( int8 )" );
622  static_assert( sizeof( uint8 ) == 1, "Invalid sizeof( uint8 )" );
623  static_assert( sizeof( int16 ) == 2, "Invalid sizeof( int16 )" );
624  static_assert( sizeof( uint16 ) == 2, "Invalid sizeof( uint16 )" );
625  static_assert( sizeof( int32 ) == 4, "Invalid sizeof( int32 )" );
626  static_assert( sizeof( uint32 ) == 4, "Invalid sizeof( uint32 )" );
627  static_assert( sizeof( int64 ) == 8, "Invalid sizeof( int64 )" );
628  static_assert( sizeof( uint64 ) == 8, "Invalid sizeof( uint64 )" );
629  static_assert( sizeof( float ) == sizeof( uint32 ), "Invalid sizeof( float )" );
630  static_assert( sizeof( double ) == sizeof( uint64 ), "Invalid sizeof( double )" );
631 };
632 
633 } // pcl
634 
635 /*
636  * Integer limits
637  */
638 #ifndef __PCL_NO_INTEGER_LIMITS
639 
648 #ifdef _MSC_VER // Valid for MS Visual C++
649 
650 #define int8_min (-127i8-1)
651 #define int8_max 127i8
652 #define int8_ofs 128ui8
653 #define char_min int8_min
654 #define char_max int8_max
655 
656 #define uint8_max 0xffui8
657 
658 #define int16_min (-32767i16-1)
659 #define int16_max 32767i16
660 #define int16_ofs 32768ui16
661 #define short_min int16_min
662 #define short_max int16_max
663 
664 #define uint16_max 0xffffui16
665 #define ushort_max uint16_max
666 
667 #define uint20_max 0xfffffui32
668 
669 #define uint22_max 0x3fffffui32
670 
671 #define uint24_max 0xffffffui32
672 
673 #define int32_min (-2147483647i32-1)
674 #define int32_max 2147483647i32
675 #define int32_ofs 2147483648ui32
676 #define int_min int32_min
677 #define int_max int32_max
678 
679 #define uint32_max 0xffffffffui32
680 #define uint_max uint32_max
681 
682 #define int64_min (-9223372036854775807i64-1)
683 #define int64_max 9223372036854775807i64
684 #define int64_ofs 9223372036854775808ui64
685 #define longlong_min int64_min
686 #define longlong_max int64_max
687 
688 #define uint64_max 0xffffffffffffffffui64
689 #define ulonglong_max uint64_max
690 
691 #define uint8_to_uint16 257ui16
692 #define uint8_to_uint20 4.1120588235294117647058823529412e+03
693 #define uint8_to_uint24 65793ui32
694 #define uint8_to_uint32 16843009ui32
695 #define uint8_to_uint64 72340172838076673ui64
696 
697 #define uint16_to_uint8 3.8910505836575875486381322957198e-03
698 #define uint16_to_uint20 1.6000228885328450446326390478370e+01
699 #define uint16_to_uint24 2.5600389105058365758754863813230e+02
700 #define uint16_to_uint32 65537ui32
701 #define uint16_to_uint64 281479271743489ui64
702 
703 #define uint20_to_uint8 2.4318718260496387955081896860024e-04
704 #define uint20_to_uint16 6.2499105929475717044560474930262e-02
705 #define uint20_to_uint24 1.6000014305128388527287032401116e+01
706 #define uint20_to_uint32 4.0960039053000500679493598455046e+03
707 #define uint20_to_uint64 1.7592202821648000014305128388527e+13
708 
709 #define uint24_to_uint8 1.5199185323666651467481343000015e-05
710 #define uint24_to_uint16 3.9061906281823294271427051510039e-03
711 #define uint24_to_uint20 6.2499944120642192402016663671533e-02
712 #define uint24_to_uint32 2.5600001519918532366665146748134e+02
713 #define uint24_to_uint64 1.0995116933120039061906281823294e+12
714 
715 #define uint32_to_uint8 5.9371814145560333073502484027646e-08
716 #define uint32_to_uint16 1.5258556235409005599890138395105e-05
717 #define uint32_to_uint20 2.4414039222619971079430536152662e-04
718 #define uint32_to_uint24 3.9062497680788509939049489316309e-03
719 #define uint32_to_uint64 4294967297ui64
720 
721 #define uint64_to_uint8 1.3823577699190181534344400859741e-17
722 #define uint64_to_uint16 3.5526594686918766543265110209534e-15
723 #define uint64_to_uint20 5.6843364650699390597549726005894e-14
724 #define uint64_to_uint24 9.0949464756281961368912116576494e-13
725 #define uint64_to_uint32 2.3283064359965952029459655278022e-10
726 
727 #else // Non-MS C++, i.e. GCC or compatible
728 
733 #define int8_min (-int8( 127 )-1)
734 
739 #define int8_max int8( 127 )
740 #define int8_ofs uint8( 128u )
741 #define char_min int8_min
742 #define char_max int8_max
743 
748 #define uint8_max uint8( 0xffu )
749 
754 #define int16_min (-int16( 32767 )-1)
755 
760 #define int16_max int16( 32767 )
761 #define int16_ofs uint16( 32768u )
762 #define short_min int16_min
763 #define short_max int16_max
764 
769 #define uint16_max uint16( 0xffffu )
770 #define ushort_max uint16_max
771 
776 #define uint20_max uint32( 0xfffffu )
777 
782 #define uint22_max uint32( 0x3fffffu )
783 
788 #define uint24_max uint32( 0xffffffu )
789 
794 #define int32_min (-int32( 2147483647 )-1)
795 
800 #define int32_max int32( 2147483647 )
801 #define int32_ofs uint32( 2147483648u )
802 #define int_min int32_min
803 #define int_max int32_max
804 
809 #define uint32_max uint32( 0xffffffffu )
810 #define uint_max uint32_max
811 
816 #define int64_min (-int64( 9223372036854775807ll )-1)
817 
822 #define int64_max int64( 9223372036854775807ll )
823 #define int64_ofs uint64( 9223372036854775808ull )
824 #define longlong_min int64_min
825 #define longlong_max int64_max
826 
831 #define uint64_max uint64( 0xffffffffffffffffull )
832 #define ulonglong_max uint64_max
833 
838 #define uint8_to_uint16 uint16( 257u )
839 
844 #define uint8_to_uint20 4.1120588235294117647058823529412e+03
845 
850 #define uint8_to_uint24 uint32( 65793u )
851 
856 #define uint8_to_uint32 uint32( 16843009u )
857 
862 #define uint8_to_uint64 uint64( 72340172838076673ull )
863 
868 #define uint16_to_uint8 3.8910505836575875486381322957198e-03
869 
874 #define uint16_to_uint20 1.6000228885328450446326390478370e+01
875 
880 #define uint16_to_uint24 2.5600389105058365758754863813230e+02
881 
886 #define uint16_to_uint32 uint32( 65537u )
887 
892 #define uint16_to_uint64 uint64( 281479271743489ull )
893 
898 #define uint20_to_uint8 2.4318718260496387955081896860024e-04
899 
904 #define uint20_to_uint16 6.2499105929475717044560474930262e-02
905 
910 #define uint20_to_uint24 1.6000014305128388527287032401116e+01
911 
916 #define uint20_to_uint32 4.0960039053000500679493598455046e+03
917 
922 #define uint20_to_uint64 1.7592202821648000014305128388527e+13
923 
928 #define uint24_to_uint8 1.5199185323666651467481343000015e-05
929 
934 #define uint24_to_uint16 3.9061906281823294271427051510039e-03
935 
940 #define uint24_to_uint20 6.2499944120642192402016663671533e-02
941 
946 #define uint24_to_uint32 2.5600001519918532366665146748134e+02
947 
952 #define uint24_to_uint64 1.0995116933120039061906281823294e+12
953 
958 #define uint32_to_uint8 5.9371814145560333073502484027646e-08
959 
964 #define uint32_to_uint16 1.5258556235409005599890138395105e-05
965 
970 #define uint32_to_uint20 2.4414039222619971079430536152662e-04
971 
976 #define uint32_to_uint24 3.9062497680788509939049489316309e-03
977 
982 #define uint32_to_uint64 uint64( 4294967297ull )
983 
988 #define uint64_to_uint8 1.3823577699190181534344400859741e-17
989 
994 #define uint64_to_uint16 3.5526594686918766543265110209534e-15
995 
1000 #define uint64_to_uint20 5.6843364650699390597549726005894e-14
1001 
1006 #define uint64_to_uint24 9.0949464756281961368912116576494e-13
1007 
1012 #define uint64_to_uint32 2.3283064359965952029459655278022e-10
1013 
1014 #endif // _MSC_VER
1015 
1016 namespace pcl
1017 {
1018 
1019 inline double BitMin( int n )
1020 {
1021  switch ( n )
1022  {
1023  case 8: return double( int8_min );
1024  case 16: return double( int16_min );
1025  case 32: return double( int32_min );
1026  case 64: return double( int64_min );
1027  default: return -double( (uint64( 1 ) << n) >> 1 );
1028  }
1029 }
1030 
1031 inline double BitMax( int n )
1032 {
1033  switch ( n )
1034  {
1035  case 8: return double( int8_max );
1036  case 16: return double( int16_max );
1037  case 32: return double( int32_max );
1038  case 64: return double( int64_max );
1039  default: return double( ((uint64( 1 ) << n) >> 1) - 1 );
1040  }
1041 }
1042 
1043 inline double UBitMax( int n )
1044 {
1045  switch ( n )
1046  {
1047  case 8: return double( uint8_max );
1048  case 16: return double( uint16_max );
1049  case 32: return double( uint32_max );
1050  case 64: return double( uint64_max );
1051  default: return double( (uint64( 1 ) << n) - 1 );
1052  }
1053 }
1054 
1055 } // pcl
1056 
1057 #endif // !__PCL_NO_INTEGER_LIMITS
1058 
1059 /*
1060  * Unicode character types.
1061  */
1062 #ifndef __PCL_NO_UNICODE_CHARACTER_TYPES
1063 
1064 namespace pcl
1065 {
1066 
1076 
1082 
1083 } // pcl
1084 
1085 #endif // !__PCL_NO_UNICODE_CHARACTER_TYPES
1086 
1087 /*
1088  * File size and position types.
1089  */
1090 #ifndef __PCL_NO_FILE_SIZE_AND_POSITION_TYPES
1091 
1092 #ifndef __PCL_WINDOWS
1093 # ifndef _FILE_OFFSET_BITS
1094 # define _FILE_OFFSET_BITS 64
1095 # endif
1096 # define _LARGEFILE_SOURCE 1
1097 # define _LARGEFILE64_SOURCE 1
1098 #endif
1099 
1100 namespace pcl
1101 {
1102 
1114 
1120 
1121 } // pcl
1122 
1123 #endif // !__PCL_NO_FILE_SIZE_AND_POSITION_TYPES
1124 
1125 #endif // !__PCL_NO_PORTABLE_INTEGER_TYPES
1126 
1127 /*
1128  * Maximum number of processors allowed.
1129  */
1130 #define PCL_MAX_PROCESSORS 1023
1131 #define PCL_MAX_PROCESSORS_BITCOUNT 10
1132 
1133 // ----------------------------------------------------------------------------
1134 
1135 #endif // __PCL_Defs_h
1136 
1137 // ----------------------------------------------------------------------------
1138 // EOF pcl/Defs.h - Released 2019-11-07T10:59:34Z
unsigned char uint8
Definition: Defs.h:576
#define uint16_max
Definition: Defs.h:769
signed short int16
Definition: Defs.h:582
int64 fpos_type
Definition: Defs.h:1113
PCL root namespace.
Definition: AbstractImage.h:76
uint16 char16_type
Definition: Defs.h:1075
#define int8_min
Definition: Defs.h:733
uint32 char32_type
Definition: Defs.h:1081
#define int16_min
Definition: Defs.h:754
#define int16_max
Definition: Defs.h:760
size_t size_type
Definition: Defs.h:543
#define uint64_max
Definition: Defs.h:831
#define uint32_max
Definition: Defs.h:809
unsigned long long uint64
Definition: Defs.h:616
signed char int8
Definition: Defs.h:570
unsigned short uint16
Definition: Defs.h:588
int64 fsize_type
Definition: Defs.h:1119
signed int int32
Definition: Defs.h:594
#define int8_max
Definition: Defs.h:739
#define uint8_max
Definition: Defs.h:748
#define int64_max
Definition: Defs.h:822
#define int32_min
Definition: Defs.h:794
ptrdiff_t distance_type
Definition: Defs.h:549
#define int32_max
Definition: Defs.h:800
unsigned int uint32
Definition: Defs.h:600
signed long long int64
Definition: Defs.h:610
#define int64_min
Definition: Defs.h:816