From 2944e07fc6dfbd7ace6ed72742a28c00aab4b292 Mon Sep 17 00:00:00 2001
From: Travis CI
Flexibility comes at a price. GIL types can be very long and hard to -read. To address this problem, GIL provides typedefs to refer to any -standard image, pixel iterator, pixel locator, pixel reference or -pixel value. They follow this pattern:
-where ColorSpace also indicates the ordering of components. Examples
-are rgb, bgr, cmyk, rgba. BitDepth can be, for
-example, 8,``16``,``32``. By default the bits are unsigned
-integral type. Append s to the bit depth to indicate signed
-integral, or f to indicate floating point. c indicates object
-whose associated pixel reference is immutable. _planar indicates
-planar organization (as opposed to interleaved). _step indicates
-the type has a dynamic step and ClassType is _image (image,
-using a standard allocator), _view (image view), _loc (pixel
-locator), _ptr (pixel iterator), _ref (pixel reference),
-_pixel (pixel value).
Flexibility comes at a price. GIL types can be very long and hard to read. +To address this problem, GIL provides typedefs to refer to any standard image, +pixel iterator, pixel locator, pixel reference or pixel value.
+They follow this pattern:
+*ColorSpace* + *BitDepth* + ["s|f"] + ["c"] + ["_planar"] + ["_step"] + *ClassType* + "_t"
+where ColorSpace also indicates the ordering of components.
+Examples are rgb, bgr, cmyk, rgba. BitDepth can be, for
+example, 8,``16``,``32``. By default the bits are unsigned integral type.
+Append s to the bit depth to indicate signed integral, or f to
+indicate floating point. c indicates object whose associated pixel
+reference is immutable. _planar indicates planar organization (as opposed
+to interleaved). _step indicates the type has a dynamic step and
+ClassType is _image (image, using a standard allocator), _view
+(image view), _loc (pixel locator), _ptr (pixel iterator), _ref
+(pixel reference), _pixel (pixel value).
Here are examples:
bgr8_image_t i; // 8-bit unsigned (unsigned char) interleaved BGR image
cmyk16_pixel_t; x; // 16-bit unsigned (unsigned short) CMYK pixel value;
@@ -2266,27 +2268,31 @@ locator), _ptr
-.. code-block:: cpp
+template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsMutable=true>
+struct pixel_reference_type { typedef ... type; };
+
+template <typename Channel, typename Layout>
+struct pixel_value_type { typedef ... type; };
+
+template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true>
+struct iterator_type { typedef ... type; };
+
+template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsXStep=false, bool IsMutable=true>
+struct locator_type { typedef ... type; };
+
+template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsXStep=false, bool IsMutable=true>
+struct view_type { typedef ... type; };
+
+template <typename ChannelValue, typename Layout, bool IsPlanar=false, typename Alloc=std::allocator<unsigned char> >
+struct image_type { typedef ... type; };
+
+template <typename BitField, typename ChannelBitSizeVector, typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct packed_image_type { typedef ... type; };
+
+template <typename ChannelBitSizeVector, typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct bit_aligned_image_type { typedef ... type; };
-
-template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsMutable=true>
-struct pixel_reference_type { typedef … type; };
-template <typename Channel, typename Layout>
-struct pixel_value_type { typedef … type; };
-template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true>
-struct iterator_type { typedef … type; };
-template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsXStep=false, bool IsMutable=true>
-struct locator_type { typedef … type; };
-template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsXStep=false, bool IsMutable=true>
-struct view_type { typedef … type; };
-template <typename ChannelValue, typename Layout, bool IsPlanar=false, typename Alloc=std::allocator<unsigned char> >
-struct image_type { typedef … type; };
-template <typename BitField, typename ChannelBitSizeVector, typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct packed_image_type { typedef … type; };
-template <typename ChannelBitSizeVector, typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct bit_aligned_image_type { typedef … type; };
-
There are also helper metafunctions to construct packed and
bit-aligned images with up to five channels:
template <typename BitField, unsigned Size1,