1 /*=========================================================================
2  *
3  *  Copyright Insight Software Consortium
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *         http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkIntTypes_h
19 #define itkIntTypes_h
20 
21 #include "itkMacro.h"
22 
23 #include <cstdint>
24 #include <climits>
25 
26 namespace itk
27 {
28 using int8_t = ::int8_t;
29 using uint8_t = ::uint8_t;
30 using int16_t = ::int16_t;
31 using uint16_t = ::uint16_t;
32 using int32_t = ::int32_t;
33 using uint32_t = ::uint32_t;
34 using int64_t = ::int64_t;
35 using uint64_t = ::uint64_t;
36 
37 using int_least8_t = ::int_least8_t;
38 using uint_least8_t = ::uint_least8_t;
39 using int_least16_t = ::int_least16_t;
40 using uint_least16_t = ::uint_least16_t;
41 using int_least32_t = ::int_least32_t;
42 using uint_least32_t = ::uint_least32_t;
43 using int_least64_t = ::int_least64_t;
44 using uint_least64_t = ::uint_least64_t;
45 
46 using int_fast8_t = ::int_fast8_t;
47 using uint_fast8_t = ::uint_fast8_t;
48 using int_fast16_t = ::int_fast16_t;
49 using uint_fast16_t = ::uint_fast16_t;
50 using int_fast32_t = ::int_fast32_t;
51 using uint_fast32_t = ::uint_fast32_t;
52 using int_fast64_t = ::int_fast64_t;
53 using uint_fast64_t = ::uint_fast64_t;
54 
55 using intmax_t = ::intmax_t;
56 using uintmax_t = ::uintmax_t;
57 
58 using intptr_t = ::intptr_t;
59 using uintptr_t = ::uintptr_t;
60 
61 
62 #if defined(ITK_USE_64BITS_IDS) && ((ULLONG_MAX != ULONG_MAX) || (LLONG_MAX != LONG_MAX))
63 
64 /** Any count of number of items (number of pixels in an image, number of
65  *  points) (it is unsigned) */
66 using SizeValueType = uint64_t;
67 
68 /** Same type as SizeValueType but when used as an Id (pointId, cellId,
69  *  labelObjectId..)(it is unsigned) */
70 using IdentifierType = SizeValueType;
71 
72 /** The components of the Index array (they are signed) */
73 using IndexValueType = int64_t;
74 
75 /** Differences between components of indexes, distance from one pointer
76  *  to the origin of a buffer (it is signed) */
77 using OffsetValueType = int64_t;
78 
79 #else
80 
81 /** Any count of number of items (number of pixels in an image, number of
82  *  points) (it is unsigned) */
83 using SizeValueType = unsigned long;
84 
85 /** Same type as SizeValueType but when used as an Id (pointId, cellId,
86  *  labelObjectId..)(it is unsigned) */
87 using IdentifierType = SizeValueType;
88 
89 /** The components of the Index array (they are signed) */
90 using IndexValueType = signed long;
91 
92 /** Differences between components of indexes, distance from one pointer
93  *  to the origin of a buffer (it is signed) */
94 using OffsetValueType = signed long;
95 
96 #endif
97 
98 /** Type to count and reference number of threads */
99 using ThreadIdType = unsigned int;
100 
101 /** Type to count and reference the modification time of objects */
102 using ModifiedTimeType = SizeValueType;
103 
104 }
105 
106 #endif  /* itkIntTypes_h */
107