9 #ifndef BOOST_GIL_TYPEDEFS_HPP
10 #define BOOST_GIL_TYPEDEFS_HPP
12 #include <boost/gil/cmyk.hpp>
13 #include <boost/gil/device_n.hpp>
14 #include <boost/gil/gray.hpp>
15 #include <boost/gil/point.hpp>
16 #include <boost/gil/rgb.hpp>
17 #include <boost/gil/rgba.hpp>
21 #if !defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
22 # include <memory_resource>
27 #define BOOST_GIL_DEFINE_BASE_TYPEDEFS_INTERNAL(B, CM, CS, LAYOUT) \
28 template <typename, typename> \
30 template <typename, typename> \
31 struct planar_pixel_reference; \
32 template <typename, typename> \
33 struct planar_pixel_iterator; \
35 class memory_based_step_iterator; \
39 class memory_based_2d_locator; \
42 template <typename, bool, typename> \
44 using CS##B##_pixel_t = pixel<CM, LAYOUT>; \
45 using CS##B##c_pixel_t = pixel<CM, LAYOUT> const; \
46 using CS##B##_ref_t = pixel<CM, LAYOUT>&; \
47 using CS##B##c_ref_t = pixel<CM, LAYOUT> const&; \
48 using CS##B##_ptr_t = CS##B##_pixel_t*; \
49 using CS##B##c_ptr_t = CS##B##c_pixel_t*; \
50 using CS##B##_step_ptr_t = memory_based_step_iterator<CS##B##_ptr_t>; \
51 using CS##B##c_step_ptr_t = memory_based_step_iterator<CS##B##c_ptr_t>; \
52 using CS##B##_loc_t = memory_based_2d_locator<memory_based_step_iterator<CS##B##_ptr_t>>; \
53 using CS##B##c_loc_t = memory_based_2d_locator<memory_based_step_iterator<CS##B##c_ptr_t>>; \
54 using CS##B##_step_loc_t \
55 = memory_based_2d_locator<memory_based_step_iterator<CS##B##_step_ptr_t>>; \
56 using CS##B##c_step_loc_t \
57 = memory_based_2d_locator<memory_based_step_iterator<CS##B##c_step_ptr_t>>; \
58 using CS##B##_view_t = image_view<CS##B##_loc_t>; \
59 using CS##B##c_view_t = image_view<CS##B##c_loc_t>; \
60 using CS##B##_step_view_t = image_view<CS##B##_step_loc_t>; \
61 using CS##B##c_step_view_t = image_view<CS##B##c_step_loc_t>; \
62 using CS##B##_image_t = image<CS##B##_pixel_t, false, std::allocator<unsigned char>>;
64 #define BOOST_GIL_DEFINE_BASE_PMR_TYPEDEFS_INTERNAL(B, CM, CS, LAYOUT) \
66 using CS##B##_image_t \
67 = image<CS##B##_pixel_t, false, std::pmr::polymorphic_allocator<unsigned char>>; \
71 #define BOOST_GIL_DEFINE_ALL_TYPEDEFS_INTERNAL(B, CM, CS, CS_FULL, LAYOUT) \
72 BOOST_GIL_DEFINE_BASE_TYPEDEFS_INTERNAL(B, CM, CS, LAYOUT) \
73 using CS##B##_planar_ref_t = planar_pixel_reference<CM&, CS_FULL>; \
74 using CS##B##c_planar_ref_t = planar_pixel_reference<CM const&, CS_FULL>; \
75 using CS##B##_planar_ptr_t = planar_pixel_iterator<CM*, CS_FULL>; \
76 using CS##B##c_planar_ptr_t = planar_pixel_iterator<CM const*, CS_FULL>; \
77 using CS##B##_planar_step_ptr_t = memory_based_step_iterator<CS##B##_planar_ptr_t>; \
78 using CS##B##c_planar_step_ptr_t = memory_based_step_iterator<CS##B##c_planar_ptr_t>; \
79 using CS##B##_planar_loc_t \
80 = memory_based_2d_locator<memory_based_step_iterator<CS##B##_planar_ptr_t>>; \
81 using CS##B##c_planar_loc_t \
82 = memory_based_2d_locator<memory_based_step_iterator<CS##B##c_planar_ptr_t>>; \
83 using CS##B##_planar_step_loc_t \
84 = memory_based_2d_locator<memory_based_step_iterator<CS##B##_planar_step_ptr_t>>; \
85 using CS##B##c_planar_step_loc_t \
86 = memory_based_2d_locator<memory_based_step_iterator<CS##B##c_planar_step_ptr_t>>; \
87 using CS##B##_planar_view_t = image_view<CS##B##_planar_loc_t>; \
88 using CS##B##c_planar_view_t = image_view<CS##B##c_planar_loc_t>; \
89 using CS##B##_planar_step_view_t = image_view<CS##B##_planar_step_loc_t>; \
90 using CS##B##c_planar_step_view_t = image_view<CS##B##c_planar_step_loc_t>; \
91 using CS##B##_planar_image_t = image<CS##B##_pixel_t, true, std::allocator<unsigned char>>;
93 #define BOOST_GIL_DEFINE_ALL_PMR_TYPEDEFS_INTERNAL(B, CM, CS, CS_FULL, LAYOUT) \
94 BOOST_GIL_DEFINE_BASE_PMR_TYPEDEFS_INTERNAL(B, CM, CS, LAYOUT) \
96 using CS##B##_planar_image_t \
97 = image<CS##B##_pixel_t, true, std::pmr::polymorphic_allocator<unsigned char>>; \
100 #if defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
101 # define BOOST_GIL_DEFINE_BASE_TYPEDEFS(B, CM, CS) \
102 BOOST_GIL_DEFINE_BASE_TYPEDEFS_INTERNAL(B, CM, CS, CS##_layout_t)
104 # define BOOST_GIL_DEFINE_ALL_TYPEDEFS(B, CM, CS) \
105 BOOST_GIL_DEFINE_ALL_TYPEDEFS_INTERNAL(B, CM, CS, CS##_t, CS##_layout_t)
107 # define BOOST_GIL_DEFINE_BASE_TYPEDEFS(B, CM, CS) \
108 BOOST_GIL_DEFINE_BASE_TYPEDEFS_INTERNAL(B, CM, CS, CS##_layout_t) \
109 BOOST_GIL_DEFINE_BASE_PMR_TYPEDEFS_INTERNAL(B, CM, CS, CS##_layout_t)
111 # define BOOST_GIL_DEFINE_ALL_TYPEDEFS(B, CM, CS) \
112 BOOST_GIL_DEFINE_ALL_TYPEDEFS_INTERNAL(B, CM, CS, CS##_t, CS##_layout_t) \
113 BOOST_GIL_DEFINE_ALL_PMR_TYPEDEFS_INTERNAL(B, CM, CS, CS##_t, CS##_layout_t)
116 namespace boost {
namespace gil {
119 template <
typename B,
typename Mn,
typename Mx>
struct scoped_channel_value;
120 template <
typename T>
struct float_point_zero;
121 template <
typename T>
struct float_point_one;
153 using float32_t = scoped_channel_value<float, float_point_zero<float>, float_point_one<float>>;
157 using float64_t = scoped_channel_value<double, float_point_zero<double>, float_point_one<double>>;
159 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8, uint8_t, gray)
160 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8s, int8_t, gray)
161 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16, uint16_t, gray)
162 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16s, int16_t, gray)
163 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32, uint32_t, gray)
164 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32s, int32_t, gray)
165 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32f,
float32_t, gray)
167 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8, uint8_t, bgr)
168 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8s, int8_t, bgr)
169 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16, uint16_t, bgr)
170 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16s, int16_t, bgr)
171 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32, uint32_t, bgr)
172 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32s, int32_t, bgr)
173 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32f,
float32_t, bgr)
175 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8, uint8_t, argb)
176 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8s, int8_t, argb)
177 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16, uint16_t, argb)
178 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16s, int16_t, argb)
179 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32, uint32_t, argb)
180 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32s, int32_t, argb)
181 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32f,
float32_t, argb)
183 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8, uint8_t, abgr)
184 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8s, int8_t, abgr)
185 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16, uint16_t, abgr)
186 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16s, int16_t, abgr)
187 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32, uint32_t, abgr)
188 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32s, int32_t, abgr)
189 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32f,
float32_t, abgr)
191 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8, uint8_t, bgra)
192 BOOST_GIL_DEFINE_BASE_TYPEDEFS(8s, int8_t, bgra)
193 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16, uint16_t, bgra)
194 BOOST_GIL_DEFINE_BASE_TYPEDEFS(16s, int16_t, bgra)
195 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32, uint32_t, bgra)
196 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32s, int32_t, bgra)
197 BOOST_GIL_DEFINE_BASE_TYPEDEFS(32f,
float32_t, bgra)
199 BOOST_GIL_DEFINE_ALL_TYPEDEFS(8, uint8_t, rgb)
200 BOOST_GIL_DEFINE_ALL_TYPEDEFS(8s, int8_t, rgb)
201 BOOST_GIL_DEFINE_ALL_TYPEDEFS(16, uint16_t, rgb)
202 BOOST_GIL_DEFINE_ALL_TYPEDEFS(16s, int16_t, rgb)
203 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32, uint32_t, rgb)
204 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32s, int32_t, rgb)
205 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32f,
float32_t, rgb)
207 BOOST_GIL_DEFINE_ALL_TYPEDEFS(8, uint8_t, rgba)
208 BOOST_GIL_DEFINE_ALL_TYPEDEFS(8s, int8_t, rgba)
209 BOOST_GIL_DEFINE_ALL_TYPEDEFS(16, uint16_t, rgba)
210 BOOST_GIL_DEFINE_ALL_TYPEDEFS(16s, int16_t, rgba)
211 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32, uint32_t, rgba)
212 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32s, int32_t, rgba)
213 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32f,
float32_t, rgba)
215 BOOST_GIL_DEFINE_ALL_TYPEDEFS(8, uint8_t, cmyk)
216 BOOST_GIL_DEFINE_ALL_TYPEDEFS(8s, int8_t, cmyk)
217 BOOST_GIL_DEFINE_ALL_TYPEDEFS(16, uint16_t, cmyk)
218 BOOST_GIL_DEFINE_ALL_TYPEDEFS(16s, int16_t, cmyk)
219 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32, uint32_t, cmyk)
220 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32s, int32_t, cmyk)
221 BOOST_GIL_DEFINE_ALL_TYPEDEFS(32f,
float32_t, cmyk)
scoped_channel_value< double, float_point_zero< double >, float_point_one< double > > float64_t
64-bit floating point channel type with range [0.0f ... 1.0f]. Models ChannelValueConcept
Definition: typedefs.hpp:157
scoped_channel_value< float, float_point_zero< float >, float_point_one< float > > float32_t
32-bit floating point channel type with range [0.0f ... 1.0f]. Models ChannelValueConcept
Definition: typedefs.hpp:153
defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
Definition: algorithm.hpp:36
unnamed color layout of up to five channels
Definition: device_n.hpp:56
Unnamed color space of 1, 2, 3, 4, or 5 channels.
Definition: device_n.hpp:40