diff --git a/html/.buildinfo b/html/.buildinfo index 2050d294f..d07fc17e0 100644 --- a/html/.buildinfo +++ b/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 6f83b3eca4f2e6ae920b02542b56c522 +config: 3c80a7bd1b3bbfa9e4f46fda58b1f148 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/html/_downloads/22415bc21655eea6105744ecdce0536e/affine.cpp b/html/_downloads/22415bc21655eea6105744ecdce0536e/affine.cpp index a078d17a2..69a8fa947 100644 --- a/html/_downloads/22415bc21655eea6105744ecdce0536e/affine.cpp +++ b/html/_downloads/22415bc21655eea6105744ecdce0536e/affine.cpp @@ -15,7 +15,7 @@ // This example relies on the matrices and functions available in GIL to define the operation, // in include/boost/gil/extension/numeric/affine.hpp -// and calls resample_pixels(), avaiable in the numeric extension, to apply it +// and calls resample_pixels(), available in the numeric extension, to apply it. int main() { diff --git a/html/_sources/design/channel.rst.txt b/html/_sources/design/channel.rst.txt index bbcc025fe..75608c3f7 100644 --- a/html/_sources/design/channel.rst.txt +++ b/html/_sources/design/channel.rst.txt @@ -26,7 +26,7 @@ value. GIL channels model the following concept: static const bool is_mutable; // use channel_traits::is_mutable to access it static T min_value(); // use channel_traits::min_value to access it - static T max_value(); // use channel_traits::min_value to access it + static T max_value(); // use channel_traits::max_value to access it }; concept MutableChannelConcept : Swappable, Assignable {}; @@ -182,7 +182,7 @@ transformation between the ranges of the source and destination channel. It maps precisely the minimum to the minimum and the maximum to the maximum. (For example, to convert from uint8_t to uint16_t GIL does not do a bit shift because it will not properly match the maximum values. Instead GIL multiplies -the source by 257). +the source by 257.) All channel models that GIL provides are convertible from/to an integral or floating point type. Thus they support arithmetic operations. Here are the diff --git a/html/_sources/design/examples.rst.txt b/html/_sources/design/examples.rst.txt index c64ad74e2..a8d2ad441 100644 --- a/html/_sources/design/examples.rst.txt +++ b/html/_sources/design/examples.rst.txt @@ -116,7 +116,7 @@ is how to simplify this code using the ``copy_pixels`` algorithm: } (Note also that ``image::recreate`` is more efficient than ``operator=``, as -the latter will do an unnecessary copy construction). Not only does the above +the latter will do an unnecessary copy construction.) Not only does the above example work for planar and interleaved images of any color space and pixel depth; it is also optimized. GIL overrides ``std::copy`` - when called on two identical interleaved images with no padding at the end of rows, it simply @@ -124,7 +124,7 @@ does a ``memmove``. For planar images it does ``memmove`` for each channel. If one of the images has padding, (as in our case) it will try to do ``memmove`` for each row. When an image has no padding, it will use its lightweight horizontal iterator (as opposed to the more complex 1D image -iterator that has to check for the end of rows). It choses the fastest method, +iterator that has to check for the end of rows). It chooses the fastest method, taking into account both static and run-time parameters. Histogram diff --git a/html/_sources/design/extending.rst.txt b/html/_sources/design/extending.rst.txt index 88669b894..8870eb8d3 100644 --- a/html/_sources/design/extending.rst.txt +++ b/html/_sources/design/extending.rst.txt @@ -161,6 +161,6 @@ from the source view: (The actual color convert view transformation is slightly more complicated, as it takes an optional color conversion object, which -allows users to specify their own color conversion methods). See the +allows users to specify their own color conversion methods.) See the GIL tutorial for an example of creating a virtual image view that defines the Mandelbrot set. diff --git a/html/_sources/design/image.rst.txt b/html/_sources/design/image.rst.txt index d62ac2eec..d1451ee75 100644 --- a/html/_sources/design/image.rst.txt +++ b/html/_sources/design/image.rst.txt @@ -8,7 +8,7 @@ Image Overview -------- -An image is a container that owns the pixels of a given image view +An image is a container that owns the pixels of a given image view. It allocates them in its constructor and deletes them in the destructor. It has a deep assignment operator and copy constructor. Images are used rarely, just when data ownership is important. Most STL algorithms operate on diff --git a/html/_sources/design/image_view.rst.txt b/html/_sources/design/image_view.rst.txt index c40d2ab85..9a82c30c8 100644 --- a/html/_sources/design/image_view.rst.txt +++ b/html/_sources/design/image_view.rst.txt @@ -165,7 +165,7 @@ Models GIL provides a model for ``ImageViewConcept`` called ``image_view``. It is templated over a model of ``PixelLocatorConcept``. (If instantiated with a model of ``MutablePixelLocatorConcept``, it models -``MutableImageViewConcept``). Synopsis: +``MutableImageViewConcept``.) Synopsis: .. code-block:: cpp @@ -183,7 +183,7 @@ model of ``MutablePixelLocatorConcept``, it models }; Image views are lightweight objects. A regular interleaved view is typically -16 bytes long - two integers for the width and height (inside dimensions) one +16 bytes long - two integers for the width and height (inside dimensions), one for the number of bytes between adjacent rows (inside the locator) and one pointer to the beginning of the pixel block. @@ -253,7 +253,7 @@ to get the derived types: typedef ... type; }; -GIL Provides the following view transformations: +GIL provides the following view transformations: .. code-block:: cpp diff --git a/html/_sources/design/metafunctions.rst.txt b/html/_sources/design/metafunctions.rst.txt index 21a9a55bd..92d6a03a0 100644 --- a/html/_sources/design/metafunctions.rst.txt +++ b/html/_sources/design/metafunctions.rst.txt @@ -19,7 +19,7 @@ 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. +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 @@ -33,9 +33,9 @@ Here are examples: .. code-block:: cpp bgr8_image_t i; // 8-bit unsigned (unsigned char) interleaved BGR image - cmyk16_pixel_t; x; // 16-bit unsigned (unsigned short) CMYK pixel value; - cmyk16sc_planar_ref_t p(x); // const reference to a 16-bit signed integral (signed short) planar CMYK pixel x. - rgb32f_planar_step_ptr_t ii; // step iterator to a floating point 32-bit (float) planar RGB pixel. + cmyk16_pixel_t; x; // 16-bit unsigned (unsigned short) CMYK pixel value + cmyk16sc_planar_ref_t p(x); // const reference to a 16-bit signed integral (signed short) planar CMYK pixel x + rgb32f_planar_step_ptr_t ii; // step iterator to a floating point 32-bit (float) planar RGB pixel Homogeneous memory-based images ------------------------------- diff --git a/html/_sources/design/pixel_locator.rst.txt b/html/_sources/design/pixel_locator.rst.txt index dfad531e9..30eb263c4 100644 --- a/html/_sources/design/pixel_locator.rst.txt +++ b/html/_sources/design/pixel_locator.rst.txt @@ -177,7 +177,7 @@ GIL provides two models of ``PixelLocatorConcept`` - a memory-based locator, The ``memory_based_2d_locator`` is a locator over planar or interleaved images that have their pixels in memory. It takes a model of ``StepIteratorConcept`` over pixels as a template parameter. (When instantiated with a model of -``MutableStepIteratorConcept``, it models ``MutablePixelLocatorConcept``). +``MutableStepIteratorConcept``, it models ``MutablePixelLocatorConcept``.) .. code-block:: cpp @@ -200,7 +200,7 @@ choices: - ``pixel*`` - for interleaved images - ``planar_pixel_iterator`` - for planar images - ``memory_based_step_iterator*>`` - for interleaved images with - non-standard step) + non-standard step - ``memory_based_step_iterator >`` - for planar images with non-standard step @@ -223,7 +223,7 @@ a 2D pixel locator, as the diagram indicates: The ``memory_based_2d_locator`` also offers `cached_location_t` as mechanism to store relative locations for optimized repeated access of neighborhood pixels. The 2D coordinates of relative locations are cached as 1-dimensional -raw byte offsets. This provides efficient access if a neighboring locations +raw byte offsets. This provides efficient access if neighboring locations relative to a given locator are read or written frequently (e.g. in filters). The ``virtual_2d_locator`` is a locator that is instantiated with a function @@ -299,5 +299,5 @@ row. For fast operations, such as pixel copy, this second check adds about GIL overrides some STL algorithms, such as ``std::copy`` and ``std::fill``, when invoked with ``iterator_from_2d``-s, to go through each row using their base x-iterators, and, if the image has no padding (i.e. -``iterator_from_2d::is_1d_traversable()`` returns true) to simply iterate +``iterator_from_2d::is_1d_traversable()`` returns true), to simply iterate using the x-iterators directly. diff --git a/html/_sources/histogram/cumulative.rst.txt b/html/_sources/histogram/cumulative.rst.txt index a769f9ddd..29c088207 100644 --- a/html/_sources/histogram/cumulative.rst.txt +++ b/html/_sources/histogram/cumulative.rst.txt @@ -8,7 +8,7 @@ Overview A cumulative histogram is a histogram in which each bin stores the count / frequency of itself as well as all the bins with keys 'smaller' than the particular bin. -As such, a notion of ordering among its keys should be existant in the histogram. +As such, a notion of ordering among its keys should be existent in the histogram. The GIL histogram class has the ability to convert itself into its cumulative version. diff --git a/html/_sources/histogram/extend.rst.txt b/html/_sources/histogram/extend.rst.txt index 3197af784..4a9393791 100644 --- a/html/_sources/histogram/extend.rst.txt +++ b/html/_sources/histogram/extend.rst.txt @@ -10,8 +10,8 @@ Extending the class User defined Axes ----------------- -In case you need a histogram with an axes of an arbitrary type that is not identified by -the C++ Standard Library, you need to provide a overload for the hashing function that is +In case you need a histogram with an axis of an arbitrary type that is not identified by +the C++ Standard Library, you need to provide an overload for the hashing function that is used in the histogram class. GIL's histogram class uses ``boost::hash_combine`` in a sub routine to generate a hash from @@ -47,14 +47,14 @@ For example, let's consider you need a histogram with an axis over class Test. } } -Now lets get to the usage example. +Now let's get to the usage example. .. code-block:: cpp #include #include #include - // Mind the order of include i.e. test.hpp before boost/gil.hpp + // Mind the order of include, i.e. test.hpp before boost/gil.hpp using namespace boost::gil; diff --git a/html/_sources/histogram/overview.rst.txt b/html/_sources/histogram/overview.rst.txt index 8b222659e..cb2d04560 100644 --- a/html/_sources/histogram/overview.rst.txt +++ b/html/_sources/histogram/overview.rst.txt @@ -9,7 +9,7 @@ Description ----------- The histogram class is built on top of std::unordered_map to keep it compatible with other -STL algorithms. It can support any number of axes (known at compile time i.e. during class +STL algorithms. It can support any number of axes (known at compile time, i.e. during class instantiation). Suitable conversion routines from GIL image constructs to the histogram bin key are shipped with the class itself. diff --git a/html/_sources/image_processing/affine-region-detectors.rst.txt b/html/_sources/image_processing/affine-region-detectors.rst.txt index 3ecb69aae..ab7d1ccc7 100644 --- a/html/_sources/image_processing/affine-region-detectors.rst.txt +++ b/html/_sources/image_processing/affine-region-detectors.rst.txt @@ -28,7 +28,7 @@ Algorithm steps Harris and Hessian ^^^^^^^^^^^^^^^^^^ -Both are derived from a concept called Moravec window. Lets have a look +Both are derived from a concept called Moravec window. Let's have a look at the image below: .. figure:: ./Moravec-window-corner.png @@ -37,7 +37,7 @@ at the image below: Moravec window corner case As can be noticed, moving the yellow window in any direction will cause -very big change in intensity. Now, lets have a look at the edge case: +very big change in intensity. Now, let's have a look at the edge case: .. figure:: ./Moravec-window-edge.png :alt: Moravec window edge case @@ -54,7 +54,7 @@ The algorithms have the same structure: 1. Compute image derivatives -2. Compute Weighted sum +2. Compute weighted sum 3. Compute response @@ -103,7 +103,7 @@ Harris it will be in order of 100000000 and for Hessian will be in order of 10000. For simpler images values in order of 100s and 1000s should be enough. The numbers assume ``uint8_t`` gray image. -To get deeper explanation please refer to following **paper**: +To get a deeper explanation please refer to the following **papers**: `Harris, Christopher G., and Mike Stephens. "A combined corner and edge detector." In Alvey vision conference, vol. 15, no. 50, pp. 10-5244. diff --git a/html/_sources/image_processing/basics.rst.txt b/html/_sources/image_processing/basics.rst.txt index bbec6271c..15ff3546b 100644 --- a/html/_sources/image_processing/basics.rst.txt +++ b/html/_sources/image_processing/basics.rst.txt @@ -18,7 +18,7 @@ Filters, kernels, weights Those three words usually mean the same thing, unless context is clear about a different usage. Simply put, they are matrices, that are used to -achieve certain effects on the image. Lets consider a simple one, 3 by 3 +achieve certain effects on the image. Let's consider a simple one, 3 by 3 Scharr filter ``ScharrX = [1,0,-1][1,0,-1][1,0,-1]`` @@ -46,9 +46,9 @@ Curvature The word, when used alone, will mean the curvature that would be generated if values of an image would be plotted in 3D graph. X and Z -axises (which form horizontal plane) will correspond to X and Y indices +axes (which form horizontal plane) will correspond to X and Y indices of an image, and Y axis will correspond to value at that pixel. By -little stretch of an imagination, filters (another names are kernels, +little stretch of an imagination, filters (other names are kernels, weights) could be considered an image (or any 2D matrix). A mean filter would draw a flat plane, whereas Gaussian filter would draw a hill that -gets sharper depending on it's sigma value. +gets sharper depending on its sigma value. diff --git a/html/_sources/image_processing/contrast_enhancement/overview.rst.txt b/html/_sources/image_processing/contrast_enhancement/overview.rst.txt index 467705511..aa7d2a13e 100644 --- a/html/_sources/image_processing/contrast_enhancement/overview.rst.txt +++ b/html/_sources/image_processing/contrast_enhancement/overview.rst.txt @@ -3,11 +3,11 @@ Overview Contrast Enhancement is a significant part of image processing algorithms. Too dark or too light images don't look good to the human eyes. Hence while the primary focus of these -algorithms is to enhance visual beauty, some applications of this in medical research is also +algorithms is to enhance visual beauty, some applications of this in medical research are also prevalent. We have a few contrast enhancement algorithms in the GIL image processing suite as well. -These include : +These include: #. :ref:`he` #. :ref:`hm` #. :ref:`ahe` diff --git a/html/_sources/installation.rst.txt b/html/_sources/installation.rst.txt index 41b910d3c..716cfc7e1 100644 --- a/html/_sources/installation.rst.txt +++ b/html/_sources/installation.rst.txt @@ -24,7 +24,7 @@ compiler with complete C++14 support. .. note:: - Boost.GIL requires C++14 compiler since ince Boost 1.80. + Boost.GIL requires C++14 compiler since Boost 1.80. For the actual list of currently tested compilers, check results of the library CI builds linked from the `README.md `_ diff --git a/html/_sources/io.rst.txt b/html/_sources/io.rst.txt index 6f4737167..9dded9671 100644 --- a/html/_sources/io.rst.txt +++ b/html/_sources/io.rst.txt @@ -76,7 +76,7 @@ then the above call would look as follows:: ); The image_read_settings class will provide the user with image format -independent reading setting but can also serves as a pointer for format +independent reading setting but can also serve as a pointer for format dependent settings. Please see the specific image format sections [link gil.io.using_io.supported_image_formats Supported Image Formats] @@ -151,7 +151,7 @@ Reading and writing in-memory buffers are supported as well. See as follows:: write_view( out, view( dst ), tiff_tag() ); In case the user is using his own stream classes he has to make sure it -has the common interface read, write, seek, close, etc. Interface. +has the common interface read, write, seek, close, etc. interface. Using IO -------- @@ -218,11 +218,11 @@ The second parameter is either an image or view type depending on the The third and last parameter is either an instance of the ``image_read_settings`` or just the ``FormatTag``. The settings can be various depending on the format which is being read. -But the all share settings for reading a partial image area. +But they all share settings for reading a partial image area. The first point describes the top left image coordinate whereas the second are the dimensions in x and y directions. -Here an example of setting up partial read:: +Here is an example of setting up partial read:: read_image( filename , img @@ -312,7 +312,7 @@ unless ``BOOST_GIL_IO_USE_BOOST_FILESYSTEM`` macro is defined that forces preference of the Boost.Filesystem. Devices could be ``FILE*``, ``std::ifstream``, and ``TIFF*`` for TIFF images. -The second parameter is an view object to image being written. +The second parameter is a view object to image being written. The third and last parameter is either a tag or an ``image_write_info`` object containing more settings. One example for instance is the JPEG quality. @@ -373,14 +373,14 @@ For a general overview of the BMP image file format go to the following BMP_Wiki_. Please note, the code has not been tested on X Windows System variations -of the BMP format which are usually referred to XBM and XPM formats. +of the BMP format which are usually referred to as XBM and XPM formats. Here, only the MS Windows and OS/2 format is relevant. Currently the code is able to read and write the following image types: -:Read: ``gray1_image_t``, ``gray4_image_t``, ``gray8_image_t``, ``rgb8_image_t`` and, ``rgba8_image_t`` -:Write: ``rgb8_image_t`` and, ``rgba8_image_t`` +:Read: ``gray1_image_t``, ``gray4_image_t``, ``gray8_image_t``, ``rgb8_image_t`` and ``rgba8_image_t`` +:Write: ``rgb8_image_t`` and ``rgba8_image_t`` The lack of having an indexed image type in gil restricts the current interface to only write out non-indexed images. @@ -408,7 +408,7 @@ Currently the code is able to read and write the following image types: Reading YCbCr or YCCK images is possible but might result in inaccuracies since both color spaces aren't available yet for gil. -For now these color space are read as rgb images. +For now these color spaces are read as rgb images. This is subject to change soon. PNG @@ -498,7 +498,7 @@ For a complete set of options please consult the following websites: The author of this extension is not claiming all tiff formats are supported. This extension is likely to be a moving target adding new features with each -new milestone. Here is an incomplete lists: +new milestone. Here is an incomplete list: * Multi-page TIFF - read only * Strip TIFF - read and write support @@ -521,8 +521,8 @@ straightforward. Before adding I would recommend to have a look at existing implementations and then trying to follow a couple of guidelines: * Create the following files for your new xxx format - * ``xxx_read.hpp`` - Only includes read code - * ``xxx_write.hpp`` - Only includes write code + * ``xxx_read.hpp`` - only includes read code + * ``xxx_write.hpp`` - only includes write code * ``xxx_all.hpp`` - includes xxx_read.hpp and xxx_write.hpp * Add the code to the ``boost::gil::detail`` namespace * Create a tag type for the new format. Like this:: @@ -530,13 +530,13 @@ implementations and then trying to follow a couple of guidelines: struct xxx_tag : format_tag {}; * Create the image_read_info for the new format. It contains all the - information that are necessary to read an image. It should be filled + information that is necessary to read an image. It should be filled and returned by the ``get_info`` member of the reader class. See below:: template<> struct image_read_info< xxx_tag > {}; * Create the image_write_info for the new format. It contains all the - information that are necessary to write an image:: + information that is necessary to write an image:: template<> struct image_write_info< xxx_tag > {}; diff --git a/html/_sources/naming.rst.txt b/html/_sources/naming.rst.txt index 509f70d35..08f74487f 100644 --- a/html/_sources/naming.rst.txt +++ b/html/_sources/naming.rst.txt @@ -17,7 +17,7 @@ where: For example, ``rgb``, ``bgr``, ``cmyk``, ``rgba``. - ``BitDepth`` indicates the bit depth of the color channel. - For example, ``8``,``16``,``32``. + For example, ``8``, ``16``, ``32``. - By default, type of channel is unsigned integral. The ``s`` tag indicates signed integral. @@ -29,14 +29,14 @@ where: - ``_planar`` indicates planar organization (as opposed to interleaved). - ``_step`` indicates special image views, locators and iterators which - traverse the data in non-trivial way. For example, backwards or every other + traverse the data in a non-trivial way. For example, backwards or every other pixel. - ``ClassType`` is ``_image`` (image), ``_view`` (image view), ``_loc`` (pixel 2D locator) ``_ptr`` (pixel iterator), ``_ref`` (pixel reference), ``_pixel`` (pixel value). -- ``_t`` suffix indicaes it is a name of a type. +- ``_t`` suffix indicates it is a name of a type. For example: diff --git a/html/_sources/tutorial/gradient.rst.txt b/html/_sources/tutorial/gradient.rst.txt index 8d44d3ff2..f1dabc9d0 100644 --- a/html/_sources/tutorial/gradient.rst.txt +++ b/html/_sources/tutorial/gradient.rst.txt @@ -114,7 +114,7 @@ given location and we set it to the half-difference of its left and right neighbors. ``operator()`` returns a reference to a grayscale pixel. A grayscale pixel is convertible to its channel type (``unsigned char`` for ``src``) and it can be copy-constructed from a channel. -(This is only true for grayscale pixels). +(This is only true for grayscale pixels.) While the above code is easy to read, it is not very fast, because the binary ``operator()`` computes the location of the pixel in a 2D grid, which involves @@ -308,7 +308,7 @@ second one is mutable and that their color spaces are compatible GIL does not require using its own built-in constructs. You are free to use your own channels, color spaces, iterators, locators, views and images. However, to work with the rest of GIL they have to satisfy a -set of requirements; in other words, they have to \e model the +set of requirements; in other words, they have to \emph model the corresponding GIL *concept*. GIL's concepts are defined in the user guide. @@ -602,7 +602,7 @@ instead of references to pixels, pass to the generic function pixel locators. This allows for more powerful functions that can use the pixel neighbors through the passed locators. GIL algorithms iterate through the pixels using the more efficient two nested loops (as -opposed to the single loop using 1-D iterators) +opposed to the single loop using 1-D iterators). Color Conversion ---------------- @@ -610,7 +610,7 @@ Color Conversion Instead of computing the gradient of each color plane of an image, we often want to compute the gradient of the luminosity. In other words, we want to convert the color image to grayscale and compute the -gradient of the result. Here how to compute the luminosity gradient of +gradient of the result. Here is how to compute the luminosity gradient of a 32-bit float RGB image: .. code-block:: cpp @@ -866,7 +866,7 @@ view transformation functions also work with run-time instantiated image views and binary algorithms, such as ``copy_pixels`` can have either or both arguments be variants. -Lets make our ``x_luminosity_gradient`` algorithm take a variant image +Let's make our ``x_luminosity_gradient`` algorithm take a variant image view. For simplicity, let's assume that only the source view can be a variant. As an example of using multiple variants, see GIL's image view algorithm overloads taking multiple variants. @@ -952,7 +952,7 @@ view, whereas for image variants it returns a view variant. For example, the return type of ``view(runtime_image)`` is ``any_image_view`` where ``Views`` enumerates four views corresponding to the four image types. ``const_view(runtime_image)`` -returns a ``any_image_view`` of the four read-only view types, etc. +returns an ``any_image_view`` of the four read-only view types, etc. A warning about using variants: instantiating an algorithm with a variant effectively instantiates it with every possible type the diff --git a/html/_sources/tutorial/histogram.rst.txt b/html/_sources/tutorial/histogram.rst.txt index 4ce849edd..582eb432e 100644 --- a/html/_sources/tutorial/histogram.rst.txt +++ b/html/_sources/tutorial/histogram.rst.txt @@ -6,8 +6,8 @@ Tutorial: Histogram :depth: 1 This is a short tutorial presenting an example of a very simple sample of code -from an existing code base that calculates histogram of an image. -Next, the program is rewritten using GIL featres. +from an existing code base that calculates the histogram of an image. +Next, the program is rewritten using GIL features. Original implementation ----------------------- @@ -58,7 +58,7 @@ GIL implementation grayimage_histogram(color_converted_view(img),hist); } -Using the Boost.Lambda library (or C++11 lambda) features it can written +Using the Boost.Lambda library (or C++11 lambda) features it can be written even simpler: .. code-block:: cpp diff --git a/html/_static/basic.css b/html/_static/basic.css index 603f6a879..30fee9d0f 100644 --- a/html/_static/basic.css +++ b/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -222,7 +222,7 @@ table.modindextable td { /* -- general body styles --------------------------------------------------- */ div.body { - min-width: 450px; + min-width: 360px; max-width: 800px; } @@ -237,14 +237,8 @@ a.headerlink { visibility: hidden; } -a.brackets:before, -span.brackets > a:before{ - content: "["; -} - -a.brackets:after, -span.brackets > a:after { - content: "]"; +a:visited { + color: #551A8B; } h1:hover > a.headerlink, @@ -335,12 +329,16 @@ p.sidebar-title { font-weight: bold; } +nav.contents, +aside.topic, div.admonition, div.topic, blockquote { clear: left; } /* -- topics ---------------------------------------------------------------- */ +nav.contents, +aside.topic, div.topic { border: 1px solid #ccc; padding: 7px; @@ -379,6 +377,8 @@ div.body p.centered { div.sidebar > :last-child, aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, div.topic > :last-child, div.admonition > :last-child { margin-bottom: 0; @@ -386,6 +386,8 @@ div.admonition > :last-child { div.sidebar::after, aside.sidebar::after, +nav.contents::after, +aside.topic::after, div.topic::after, div.admonition::after, blockquote::after { @@ -428,10 +430,6 @@ table.docutils td, table.docutils th { border-bottom: 1px solid #aaa; } -table.footnote td, table.footnote th { - border: 0 !important; -} - th { text-align: left; padding-right: 5px; @@ -615,19 +613,26 @@ ul.simple p { margin-bottom: 0; } -dl.footnote > dt, -dl.citation > dt { +aside.footnote > span, +div.citation > span { float: left; - margin-right: 0.5em; } - -dl.footnote > dd, -dl.citation > dd { +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { margin-bottom: 0em; } - -dl.footnote > dd:after, -dl.citation > dd:after { +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { content: ""; clear: both; } @@ -644,10 +649,6 @@ dl.field-list > dt { padding-right: 5px; } -dl.field-list > dt:after { - content: ":"; -} - dl.field-list > dd { padding-left: 0.5em; margin-top: 0em; @@ -673,6 +674,16 @@ dd { margin-left: 30px; } +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + dl > dd:last-child, dl > dd:last-child > :last-child { margin-bottom: 0; @@ -741,6 +752,14 @@ abbr, acronym { cursor: help; } +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + /* -- code displays --------------------------------------------------------- */ pre { @@ -757,6 +776,7 @@ span.pre { -ms-hyphens: none; -webkit-hyphens: none; hyphens: none; + white-space: nowrap; } div[class*="highlight-"] { diff --git a/html/_static/classic.css b/html/_static/classic.css index dcae94623..9ad992b8a 100644 --- a/html/_static/classic.css +++ b/html/_static/classic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- classic theme. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -28,6 +28,7 @@ body { } div.document { + display: flex; background-color: #1c4e63; } @@ -128,7 +129,7 @@ a { } a:visited { - color: #355f7c; + color: #551a8b; text-decoration: none; } @@ -205,6 +206,8 @@ div.seealso { border: 1px solid #ff6; } +nav.contents, +aside.topic, div.topic { background-color: #eee; } diff --git a/html/_static/doctools.js b/html/_static/doctools.js index 8cbf1b161..d06a71d75 100644 --- a/html/_static/doctools.js +++ b/html/_static/doctools.js @@ -2,322 +2,155 @@ * doctools.js * ~~~~~~~~~~~ * - * Sphinx JavaScript utilities for all documentation. + * Base JavaScript utilities for all Sphinx HTML documentation. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ +"use strict"; -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - * - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL - */ -jQuery.urldecode = function(x) { - if (!x) { - return x +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); } - return decodeURIComponent(x.replace(/\+/g, ' ')); }; -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s === 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node, addItems) { - if (node.nodeType === 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this, addItems); - }); - } - } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); - }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - /** * Small JavaScript module for the documentation. */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { - this.initOnKeyListeners(); - } +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); }, /** * i18n support */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, - LOCALE : 'unknown', + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", // gettext and ngettext don't access this so that the functions // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated === 'undefined') - return string; - return (typeof translated === 'string') ? translated : translated[0]; + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } }, - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated === 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; }, - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; }, /** - * add context elements like header anchor links + * helper function to focus on search bar */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); }, /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 + * Initialise the domain index toggle buttons */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); }, - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) === 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this === '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keydown(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box, textarea, dropdown or button - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' - && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey - && !event.shiftKey) { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); } break; - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); } break; } } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } }); - } + }, }; // quick alias for translations -_ = Documentation.gettext; +const _ = Documentation.gettext; -$(document).ready(function() { - Documentation.init(); -}); +_ready(Documentation.init); diff --git a/html/_static/documentation_options.js b/html/_static/documentation_options.js index 2fa8c97fe..7e4c114f2 100644 --- a/html/_static/documentation_options.js +++ b/html/_static/documentation_options.js @@ -1,12 +1,13 @@ -var DOCUMENTATION_OPTIONS = { - URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), +const DOCUMENTATION_OPTIONS = { VERSION: '', - LANGUAGE: 'None', + LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', FILE_SUFFIX: '.html', LINK_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, }; \ No newline at end of file diff --git a/html/_static/jquery.js b/html/_static/jquery.js deleted file mode 100644 index 624bca829..000000000 --- a/html/_static/jquery.js +++ /dev/null @@ -1,10879 +0,0 @@ -/*! - * jQuery JavaScript Library v3.6.0 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); -} : function( array ) { - return arr.concat.apply( [], array ); -}; - - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 - // Plus for old WebKit, typeof returns "function" for HTML collections - // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) - return typeof obj === "function" && typeof obj.nodeType !== "number" && - typeof obj.item !== "function"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - -var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.6.0", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), - function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); - } ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.6 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2021-02-16 - */ -( function( window ) { -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ( {} ).hasOwnProperty, - arr = [], - pop = arr.pop, - pushNative = arr.push, - push = arr.push, - slice = arr.slice, - - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[ i ] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + - "ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] - // or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + - whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + - "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - return nonHex ? - - // Strip the backslash prefix from a non-hex escape sequence - nonHex : - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + - ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android<4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - - // Can't trust NodeList.length - while ( ( target[ j++ ] = els[ i++ ] ) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - - // Support: IE 8 only - // Exclude object elements - ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split( "|" ), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[ i ] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( ( cur = cur.nextSibling ) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return ( name === "input" || name === "button" ) && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - var namespace = elem && elem.namespaceURI, - docElem = elem && ( elem.ownerDocument || elem ).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, - // Safari 4 - 5 only, Opera <=11.6 - 12.x only - // IE/Edge & older browsers don't support the :scope pseudo-class. - // Support: Safari 6.0 only - // Safari 6.0 supports :scope but it's an alias of :root there. - support.scope = assert( function( el ) { - docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); - return typeof el.querySelectorAll !== "undefined" && - !el.querySelectorAll( ":scope fieldset div" ).length; - } ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert( function( el ) { - el.className = "i"; - return !el.getAttribute( "className" ); - } ); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert( function( el ) { - el.appendChild( document.createComment( "" ) ); - return !el.getElementsByTagName( "*" ).length; - } ); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find[ "TAG" ] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Firefox <=3.6 - 5 only - // Old Firefox doesn't throw on a badly-escaped identifier. - el.querySelectorAll( "\\\f" ); - rbuggyQSA.push( "[\\r\\n\\f]" ); - } ); - - assert( function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll( "[name=d]" ).length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: Opera 10 - 11 only - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll( "*,:x" ); - rbuggyQSA.push( ",.*:" ); - } ); - } - - if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector ) ) ) ) { - - assert( function( el ) { - - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - } ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); - } : - function( a, b ) { - if ( b ) { - while ( ( b = b.parentNode ) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a == document || a.ownerDocument == preferredDoc && - contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b == document || b.ownerDocument == preferredDoc && - contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - return a == document ? -1 : - b == document ? 1 : - /* eslint-enable eqeqeq */ - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( ( cur = cur.parentNode ) ) { - ap.unshift( cur ); - } - cur = b; - while ( ( cur = cur.parentNode ) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[ i ] === bp[ i ] ) { - i++; - } - - return i ? - - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[ i ], bp[ i ] ) : - - // Otherwise nodes in our document sort first - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - ap[ i ] == preferredDoc ? -1 : - bp[ i ] == preferredDoc ? 1 : - /* eslint-enable eqeqeq */ - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || - match[ 5 ] || "" ).replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + - ")" + className + "(" + whitespace + "|$)" ) ) && classCache( - className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - /* eslint-disable max-len */ - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - /* eslint-enable max-len */ - - }; - }, - - "CHILD": function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - "not": markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element (issue #299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - "has": markFunction( function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - } ), - - "contains": markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && - ( !document.hasFocus || document.hasFocus() ) && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return ( nodeName === "input" && !!elem.checked ) || - ( nodeName === "option" && !!elem.selected ); - }, - - "selected": function( elem ) { - - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos[ "empty" ]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo( function() { - return [ 0 ]; - } ), - - "last": createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - "even": createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "odd": createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? - argument + length : - argument > length ? - length : - argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } -}; - -Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rcombinators.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || - ( outerCache[ elem.uniqueID ] = {} ); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = uniqueCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[ i ], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( - selector || "*", - context.nodeType ? [ context ] : context, - [] - ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens - .slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( - selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) - ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find[ "ID" ]( token.matches[ 0 ] - .replace( runescape, funescape ), context ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || - context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; -} ); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert( function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute( "href" ) === "#"; -} ) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - } ); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert( function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -} ) ) { - addHandle( "value", function( elem, _name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - } ); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert( function( el ) { - return el.getAttribute( "disabled" ) == null; -} ) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - } - } ); -} - -return Sizzle; - -} )( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -} -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the primary Deferred - primary = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - primary.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( primary.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return primary.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); - } - - return primary.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - - -// Matches dashed string for camelizing -var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() -function fcamelCase( _all, letter ) { - return letter.toUpperCase(); -} - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (#9572) -function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); -} -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - -var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; -} )(); - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: IE <=9 only -if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; -} - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 - 11+ -// focus() and blur() are asynchronous, except when they are no-op. -// So expect focus to be synchronous when the element is already active, -// and blur to be synchronous when the element is not already active. -// (focus and blur are always synchronous in other supported browsers, -// this just defines when we can count on it). -function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); -} - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. -function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - - // Support: Chrome 86+ - // In Chrome, if an element having a focusout handler is blurred by - // clicking outside of it, it invokes the handler synchronously. If - // that handler calls `.remove()` on the element, the data is cleared, - // leaving `result` undefined. We need to guard against this. - return result && result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); -} - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - which: true -}, jQuery.event.addProp ); - -jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - // Suppress native focus or blur as it's already being fired - // in leverageNative. - _default: function() { - return true; - }, - - delegateType: delegateType - }; -} ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - -var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - -var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - // - // Support: Firefox 70+ - // Only Firefox includes border widths - // in computed dimensions. (gh-4529) - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; - tr.style.cssText = "border:1px solid"; - - // Support: Chrome 86+ - // Height set through cssText does not get applied. - // Computed height then comes back as 0. - tr.style.height = "1px"; - trChild.style.height = "9px"; - - // Support: Android 8 Chrome 86+ - // In our bodyBackground.html iframe, - // display for all div elements is set to "inline", - // which causes a problem only in Android 8 Chrome 86. - // Ensuring the div is display: block - // gets around this issue. - trChild.style.display = "block"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + - parseInt( trStyle.borderTopWidth, 10 ) + - parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined -function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property -function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - -function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; -} - -function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -support.focusin = "onfocusin" in window; - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = { guid: Date.now() }; - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml, parserErrorElem; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) {} - - parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; - if ( !xml || parserErrorElem ) { - jQuery.error( "Invalid XML: " + ( - parserErrorElem ? - jQuery.map( parserErrorElem.childNodes, function( el ) { - return el.textContent; - } ).join( "\n" ) : - data - ) ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ).filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ).map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - -originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script but not if jsonp - if ( !isSuccess && - jQuery.inArray( "script", s.dataTypes ) > -1 && - jQuery.inArray( "json", s.dataTypes ) < 0 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - -jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } -} ); - - -jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
-

Basics

+

Basics

Images are essential in any image processing, vision and video project, and yet the variability in image representations makes it difficult to write imaging algorithms that are both generic and efficient. In this section we @@ -118,8 +117,8 @@ read the sections in order.

\ No newline at end of file diff --git a/html/design/channel.html b/html/design/channel.html index ba6cad271..244671304 100644 --- a/html/design/channel.html +++ b/html/design/channel.html @@ -5,7 +5,7 @@ - + Channel - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,24 +70,24 @@
-

Channel

- +
-

Overview

+

Overview

A channel indicates the intensity of a color component (for example, the red channel in an RGB pixel). Typical channel operations are getting, comparing and setting the channel values. Channels have associated minimum and maximum value. GIL channels model the following concept:

-
concept ChannelConcept<typename T> : EqualityComparable<T>
-{
+
concept ChannelConcept<typename T> : EqualityComparable<T>
+{
     typename value_type      = T;        // use channel_traits<T>::value_type to access it
-    where ChannelValueConcept<value_type>;
+    where ChannelValueConcept<value_type>;
     typename reference       = T&;       // use channel_traits<T>::reference to access it
     typename pointer         = T*;       // use channel_traits<T>::pointer to access it
     typename const_reference = const T&; // use channel_traits<T>::const_reference to access it
@@ -96,44 +95,44 @@ value. GIL channels model the following concept:

static const bool is_mutable; // use channel_traits<T>::is_mutable to access it static T min_value(); // use channel_traits<T>::min_value to access it - static T max_value(); // use channel_traits<T>::min_value to access it -}; + static T max_value(); // use channel_traits<T>::max_value to access it +}; -concept MutableChannelConcept<ChannelConcept T> : Swappable<T>, Assignable<T> {}; +concept MutableChannelConcept<ChannelConcept T> : Swappable<T>, Assignable<T> {}; -concept ChannelValueConcept<ChannelConcept T> : Regular<T> {}; +concept ChannelValueConcept<ChannelConcept T> : Regular<T> {};

GIL allows built-in integral and floating point types to be channels. Therefore the associated types and range information are defined in channel_traits with the following default implementation:

-
template <typename T>
-struct channel_traits
-{
-    typedef T         value_type;
-    typedef T&        reference;
-    typedef T*        pointer;
-    typedef T& const  const_reference;
-    typedef T* const  const_pointer;
+
template <typename T>
+struct channel_traits
+{
+    typedef T         value_type;
+    typedef T&        reference;
+    typedef T*        pointer;
+    typedef T& const  const_reference;
+    typedef T* const  const_pointer;
 
-    static value_type min_value() { return std::numeric_limits<T>::min(); }
-    static value_type max_value() { return std::numeric_limits<T>::max(); }
-};
+    static value_type min_value() { return std::numeric_limits<T>::min(); }
+    static value_type max_value() { return std::numeric_limits<T>::max(); }
+};
 

Two channel types are compatible if they have the same value type:

-
concept ChannelsCompatibleConcept<ChannelConcept T1, ChannelConcept T2>
-{
-    where SameType<T1::value_type, T2::value_type>;
-};
+
concept ChannelsCompatibleConcept<ChannelConcept T1, ChannelConcept T2>
+{
+    where SameType<T1::value_type, T2::value_type>;
+};
 

A channel may be convertible to another channel:

-
template <ChannelConcept Src, ChannelValueConcept Dst>
-concept ChannelConvertibleConcept
-{
-    Dst channel_convert(Src);
-};
+
template <ChannelConcept Src, ChannelValueConcept Dst>
+concept ChannelConvertibleConcept
+{
+    Dst channel_convert(Src);
+};
 

Note that ChannelConcept and MutableChannelConcept do not require a @@ -159,7 +158,7 @@ such as support for arithmetic operations.

-

Models

+

Models

All C++11 fundamental integer and float point types are valid channels.

The minimum and maximum values of a channel modeled by a built-in type correspond to the minimum and maximum physical range of the built-in type, as @@ -167,25 +166,25 @@ specified by its st appropriate. GIL provides scoped_channel_value, a model for a channel adapter that allows for specifying a custom range. We use it to define a [0..1] floating point channel type as follows:

-
struct float_zero { static float apply() { return 0.0f; } };
-struct float_one  { static float apply() { return 1.0f; } };
-typedef scoped_channel_value<float,float_zero,float_one> bits32f;
+
struct float_zero { static float apply() { return 0.0f; } };
+struct float_one  { static float apply() { return 1.0f; } };
+typedef scoped_channel_value<float,float_zero,float_one> bits32f;
 

GIL also provides models for channels corresponding to ranges of bits:

// Value of a channel defined over NumBits bits. Models ChannelValueConcept
-template <int NumBits> class packed_channel_value;
+template <int NumBits> class packed_channel_value;
 
 // Reference to a channel defined over NumBits bits. Models ChannelConcept
-template <int FirstBit,
+template <int FirstBit,
         int NumBits,       // Defines the sequence of bits in the data value that contain the channel
         bool Mutable>      // true if the reference is mutable
-class packed_channel_reference;
+class packed_channel_reference;
 
 // Reference to a channel defined over NumBits bits. Its FirstBit is a run-time parameter. Models ChannelConcept
 template <int NumBits,       // Defines the sequence of bits in the data value that contain the channel
         bool Mutable>      // true if the reference is mutable
-class packed_dynamic_channel_reference;
+class packed_dynamic_channel_reference;
 

Note that there are two models of a reference proxy which differ based on @@ -195,39 +194,39 @@ second model is more flexible. For example, the second model allows us to construct an iterator over bit range channels.

-

Algorithms

+

Algorithms

Here is how to construct the three channels of a 16-bit “565” pixel and set them to their maximum value:

-
using channel16_0_5_reference_t  = packed_channel_reference<0, 5, true>;
-using channel16_5_6_reference_t  = packed_channel_reference<5, 6, true>;
-using channel16_11_5_reference_t = packed_channel_reference<11, 5, true>;
+
using channel16_0_5_reference_t  = packed_channel_reference<0, 5, true>;
+using channel16_5_6_reference_t  = packed_channel_reference<5, 6, true>;
+using channel16_11_5_reference_t = packed_channel_reference<11, 5, true>;
 
-std::uint16_t data=0;
-channel16_0_5_reference_t  channel1(&data);
-channel16_5_6_reference_t  channel2(&data);
-channel16_11_5_reference_t channel3(&data);
+std::uint16_t data=0;
+channel16_0_5_reference_t  channel1(&data);
+channel16_5_6_reference_t  channel2(&data);
+channel16_11_5_reference_t channel3(&data);
 
-channel1 = channel_traits<channel16_0_5_reference_t>::max_value();
-channel2 = channel_traits<channel16_5_6_reference_t>::max_value();
-channel3 = channel_traits<channel16_11_5_reference_t>::max_value();
-assert(data == 65535);
+channel1 = channel_traits<channel16_0_5_reference_t>::max_value();
+channel2 = channel_traits<channel16_5_6_reference_t>::max_value();
+channel3 = channel_traits<channel16_11_5_reference_t>::max_value();
+assert(data == 65535);
 

Assignment, equality comparison and copy construction are defined only between compatible channels:

-
packed_channel_value<5> channel_6bit = channel1;
-channel_6bit = channel3;
+
packed_channel_value<5> channel_6bit = channel1;
+channel_6bit = channel3;
 
 // compile error: Assignment between incompatible channels
 //channel_6bit = channel2;
 

All channel models provided by GIL are pairwise convertible:

-
channel1 = channel_traits<channel16_0_5_reference_t>::max_value();
-assert(channel1 == 31);
+
channel1 = channel_traits<channel16_0_5_reference_t>::max_value();
+assert(channel1 == 31);
 
-bits16 chan16 = channel_convert<bits16>(channel1);
-assert(chan16 == 65535);
+bits16 chan16 = channel_convert<bits16>(channel1);
+assert(chan16 == 65535);
 

Channel conversion is a lossy operation. GIL’s channel conversion is a linear @@ -235,22 +234,22 @@ transformation between the ranges of the source and destination channel. It maps precisely the minimum to the minimum and the maximum to the maximum. (For example, to convert from uint8_t to uint16_t GIL does not do a bit shift because it will not properly match the maximum values. Instead GIL multiplies -the source by 257).

+the source by 257.)

All channel models that GIL provides are convertible from/to an integral or floating point type. Thus they support arithmetic operations. Here are the channel-level algorithms that GIL provides:

// Converts a source channel value into a destination channel.
 // Linearly maps the value of the source into the range of the destination.
-template <typename DstChannel, typename SrcChannel>
-typename channel_traits<DstChannel>::value_type channel_convert(SrcChannel src);
+template <typename DstChannel, typename SrcChannel>
+typename channel_traits<DstChannel>::value_type channel_convert(SrcChannel src);
 
 // returns max_value - x + min_value
-template <typename Channel>
-typename channel_traits<Channel>::value_type channel_invert(Channel x);
+template <typename Channel>
+typename channel_traits<Channel>::value_type channel_invert(Channel x);
 
 // returns a * b / max_value
-template <typename Channel>
-typename channel_traits<Channel>::value_type channel_multiply(Channel a, Channel b);
+template <typename Channel>
+typename channel_traits<Channel>::value_type channel_multiply(Channel a, Channel b);
 
@@ -267,8 +266,8 @@ channel-level algorithms that GIL provides:

\ No newline at end of file diff --git a/html/design/color_base.html b/html/design/color_base.html index ea99816b1..b0118a701 100644 --- a/html/design/color_base.html +++ b/html/design/color_base.html @@ -5,7 +5,7 @@ - + Color Base - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,16 +70,16 @@
-

Color Base

-
+

Color Base

+
+
-

Overview

+

Overview

A color base is a container of color elements. The most common use of color base is in the implementation of a pixel, in which case the color elements are channel values. The color base concept, however, can be used in other @@ -89,72 +88,72 @@ memory. Its reference is a proxy class that uses a color base whose elements are channel references. Its iterator uses a color base whose elements are channel iterators.

Color base models must satisfy the following concepts:

-
concept ColorBaseConcept<typename T>
-    : CopyConstructible<T>, EqualityComparable<T>
-{
+
concept ColorBaseConcept<typename T>
+    : CopyConstructible<T>, EqualityComparable<T>
+{
   // a GIL layout (the color space and element permutation)
-  typename layout_t;
+  typename layout_t;
 
   // The type of K-th element
-  template <int K> struct kth_element_type;
-      where Metafunction<kth_element_type>;
+  template <int K> struct kth_element_type;
+      where Metafunction<kth_element_type>;
 
   // The result of at_c
-  template <int K> struct kth_element_const_reference_type;
-      where Metafunction<kth_element_const_reference_type>;
+  template <int K> struct kth_element_const_reference_type;
+      where Metafunction<kth_element_const_reference_type>;
 
-  template <int K> kth_element_const_reference_type<T,K>::type at_c(T);
+  template <int K> kth_element_const_reference_type<T,K>::type at_c(T);
 
-  template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
-      T::T(T2);
-  template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
-      bool operator==(const T&, const T2&);
-  template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
-      bool operator!=(const T&, const T2&);
+  template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
+      T::T(T2);
+  template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
+      bool operator==(const T&, const T2&);
+  template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
+      bool operator!=(const T&, const T2&);
 
-};
+};
 
-concept MutableColorBaseConcept<ColorBaseConcept T>
-    : Assignable<T>, Swappable<T>
-{
-  template <int K> struct kth_element_reference_type;
-      where Metafunction<kth_element_reference_type>;
+concept MutableColorBaseConcept<ColorBaseConcept T>
+    : Assignable<T>, Swappable<T>
+{
+  template <int K> struct kth_element_reference_type;
+      where Metafunction<kth_element_reference_type>;
 
-  template <int K> kth_element_reference_type<T,K>::type at_c(T);
+  template <int K> kth_element_reference_type<T,K>::type at_c(T);
 
-  template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
-      T& operator=(T&, const T2&);
-};
+  template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
+      T& operator=(T&, const T2&);
+};
 
-concept ColorBaseValueConcept<typename T> : MutableColorBaseConcept<T>, Regular<T>
-{
-};
+concept ColorBaseValueConcept<typename T> : MutableColorBaseConcept<T>, Regular<T>
+{
+};
 
-concept HomogeneousColorBaseConcept<ColorBaseConcept CB>
-{
+concept HomogeneousColorBaseConcept<ColorBaseConcept CB>
+{
   // For all K in [0 ... size<C1>::value-1):
   //     where SameType<kth_element_type<K>::type, kth_element_type<K+1>::type>;
-  kth_element_const_reference_type<0>::type dynamic_at_c(const CB&, std::size_t n) const;
-};
+  kth_element_const_reference_type<0>::type dynamic_at_c(const CB&, std::size_t n) const;
+};
 
-concept MutableHomogeneousColorBaseConcept<MutableColorBaseConcept CB>
-    : HomogeneousColorBaseConcept<CB>
-{
-  kth_element_reference_type<0>::type dynamic_at_c(const CB&, std::size_t n);
-};
+concept MutableHomogeneousColorBaseConcept<MutableColorBaseConcept CB>
+    : HomogeneousColorBaseConcept<CB>
+{
+  kth_element_reference_type<0>::type dynamic_at_c(const CB&, std::size_t n);
+};
 
-concept HomogeneousColorBaseValueConcept<typename T>
-    : MutableHomogeneousColorBaseConcept<T>, Regular<T>
-{
-};
+concept HomogeneousColorBaseValueConcept<typename T>
+    : MutableHomogeneousColorBaseConcept<T>, Regular<T>
+{
+};
 
-concept ColorBasesCompatibleConcept<ColorBaseConcept C1, ColorBaseConcept C2>
-{
-  where SameType<C1::layout_t::color_space_t, C2::layout_t::color_space_t>;
+concept ColorBasesCompatibleConcept<ColorBaseConcept C1, ColorBaseConcept C2>
+{
+  where SameType<C1::layout_t::color_space_t, C2::layout_t::color_space_t>;
   // also, for all K in [0 ... size<C1>::value):
   //     where Convertible<kth_semantic_element_type<C1,K>::type, kth_semantic_element_type<C2,K>::type>;
   //     where Convertible<kth_semantic_element_type<C2,K>::type, kth_semantic_element_type<C1,K>::type>;
-};
+};
 

A color base must have an associated layout (which consists of a color space, @@ -174,14 +173,14 @@ corresponding semantic element.

elements (paired semantically) are convertible to each other.

-

Models

+

Models

GIL provides a model for a homogeneous color base (a color base whose elements all have the same type).

-
namespace detail
-{
-  template <typename Element, typename Layout, int K>
-  struct homogeneous_color_base;
-}
+
namespace detail
+{
+  template <typename Element, typename Layout, int K>
+  struct homogeneous_color_base;
+}
 

It is used in the implementation of GIL’s pixel, planar pixel reference and @@ -190,78 +189,78 @@ planar pixel iterator. Another model of Pixel section for more.

-

Algorithms

+

Algorithms

GIL provides the following functions and metafunctions operating on color bases:

// Metafunction returning an integral constant equal to the number of elements in the color base
-template <class ColorBase> struct size;
+template <class ColorBase> struct size;
 
 // Returns the type of the return value of semantic_at_c<K>(color_base)
-template <class ColorBase, int K> struct kth_semantic_element_reference_type;
-template <class ColorBase, int K> struct kth_semantic_element_const_reference_type;
+template <class ColorBase, int K> struct kth_semantic_element_reference_type;
+template <class ColorBase, int K> struct kth_semantic_element_const_reference_type;
 
 // Returns a reference to the element with K-th semantic index.
-template <class ColorBase, int K>
-typename kth_semantic_element_reference_type<ColorBase,K>::type       semantic_at_c(ColorBase& p)
-template <class ColorBase, int K>
-typename kth_semantic_element_const_reference_type<ColorBase,K>::type semantic_at_c(const ColorBase& p)
+template <class ColorBase, int K>
+typename kth_semantic_element_reference_type<ColorBase,K>::type       semantic_at_c(ColorBase& p)
+template <class ColorBase, int K>
+typename kth_semantic_element_const_reference_type<ColorBase,K>::type semantic_at_c(const ColorBase& p)
 
 // Returns the type of the return value of get_color<Color>(color_base)
-template <typename Color, typename ColorBase> struct color_reference_t;
-template <typename Color, typename ColorBase> struct color_const_reference_t;
+template <typename Color, typename ColorBase> struct color_reference_t;
+template <typename Color, typename ColorBase> struct color_const_reference_t;
 
 // Returns a reference to the element corresponding to the given color
-template <typename ColorBase, typename Color>
-typename color_reference_t<Color,ColorBase>::type get_color(ColorBase& cb, Color=Color());
-template <typename ColorBase, typename Color>
-typename color_const_reference_t<Color,ColorBase>::type get_color(const ColorBase& cb, Color=Color());
+template <typename ColorBase, typename Color>
+typename color_reference_t<Color,ColorBase>::type get_color(ColorBase& cb, Color=Color());
+template <typename ColorBase, typename Color>
+typename color_const_reference_t<Color,ColorBase>::type get_color(const ColorBase& cb, Color=Color());
 
 // Returns the element type of the color base. Defined for homogeneous color bases only
-template <typename ColorBase> struct element_type;
-template <typename ColorBase> struct element_reference_type;
-template <typename ColorBase> struct element_const_reference_type;
+template <typename ColorBase> struct element_type;
+template <typename ColorBase> struct element_reference_type;
+template <typename ColorBase> struct element_const_reference_type;
 

GIL also provides the following algorithms which operate on color bases. Note that they all pair the elements semantically:

// Equivalents to std::equal, std::copy, std::fill, std::generate
-template <typename CB1,typename CB2>   bool static_equal(const CB1& p1, const CB2& p2);
-template <typename Src,typename Dst>   void static_copy(const Src& src, Dst& dst);
-template <typename CB, typename Op>    void static_generate(CB& dst,Op op);
+template <typename CB1,typename CB2>   bool static_equal(const CB1& p1, const CB2& p2);
+template <typename Src,typename Dst>   void static_copy(const Src& src, Dst& dst);
+template <typename CB, typename Op>    void static_generate(CB& dst,Op op);
 
 // Equivalents to std::transform
-template <typename CB ,             typename Dst,typename Op> Op static_transform(      CB&,Dst&,Op);
-template <typename CB ,             typename Dst,typename Op> Op static_transform(const CB&,Dst&,Op);
-template <typename CB1,typename CB2,typename Dst,typename Op> Op static_transform(      CB1&,      CB2&,Dst&,Op);
-template <typename CB1,typename CB2,typename Dst,typename Op> Op static_transform(const CB1&,      CB2&,Dst&,Op);
-template <typename CB1,typename CB2,typename Dst,typename Op> Op static_transform(      CB1&,const CB2&,Dst&,Op);
-template <typename CB1,typename CB2,typename Dst,typename Op> Op static_transform(const CB1&,const CB2&,Dst&,Op);
+template <typename CB ,             typename Dst,typename Op> Op static_transform(      CB&,Dst&,Op);
+template <typename CB ,             typename Dst,typename Op> Op static_transform(const CB&,Dst&,Op);
+template <typename CB1,typename CB2,typename Dst,typename Op> Op static_transform(      CB1&,      CB2&,Dst&,Op);
+template <typename CB1,typename CB2,typename Dst,typename Op> Op static_transform(const CB1&,      CB2&,Dst&,Op);
+template <typename CB1,typename CB2,typename Dst,typename Op> Op static_transform(      CB1&,const CB2&,Dst&,Op);
+template <typename CB1,typename CB2,typename Dst,typename Op> Op static_transform(const CB1&,const CB2&,Dst&,Op);
 
 // Equivalents to std::for_each
-template <typename CB1,                          typename Op> Op static_for_each(      CB1&,Op);
-template <typename CB1,                          typename Op> Op static_for_each(const CB1&,Op);
-template <typename CB1,typename CB2,             typename Op> Op static_for_each(      CB1&,      CB2&,Op);
-template <typename CB1,typename CB2,             typename Op> Op static_for_each(      CB1&,const CB2&,Op);
-template <typename CB1,typename CB2,             typename Op> Op static_for_each(const CB1&,      CB2&,Op);
-template <typename CB1,typename CB2,             typename Op> Op static_for_each(const CB1&,const CB2&,Op);
-template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(      CB1&,      CB2&,      CB3&,Op);
-template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(      CB1&,      CB2&,const CB3&,Op);
-template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(      CB1&,const CB2&,      CB3&,Op);
-template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(      CB1&,const CB2&,const CB3&,Op);
-template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(const CB1&,      CB2&,      CB3&,Op);
-template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(const CB1&,      CB2&,const CB3&,Op);
-template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(const CB1&,const CB2&,      CB3&,Op);
-template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(const CB1&,const CB2&,const CB3&,Op);
+template <typename CB1,                          typename Op> Op static_for_each(      CB1&,Op);
+template <typename CB1,                          typename Op> Op static_for_each(const CB1&,Op);
+template <typename CB1,typename CB2,             typename Op> Op static_for_each(      CB1&,      CB2&,Op);
+template <typename CB1,typename CB2,             typename Op> Op static_for_each(      CB1&,const CB2&,Op);
+template <typename CB1,typename CB2,             typename Op> Op static_for_each(const CB1&,      CB2&,Op);
+template <typename CB1,typename CB2,             typename Op> Op static_for_each(const CB1&,const CB2&,Op);
+template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(      CB1&,      CB2&,      CB3&,Op);
+template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(      CB1&,      CB2&,const CB3&,Op);
+template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(      CB1&,const CB2&,      CB3&,Op);
+template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(      CB1&,const CB2&,const CB3&,Op);
+template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(const CB1&,      CB2&,      CB3&,Op);
+template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(const CB1&,      CB2&,const CB3&,Op);
+template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(const CB1&,const CB2&,      CB3&,Op);
+template <typename CB1,typename CB2,typename CB3,typename Op> Op static_for_each(const CB1&,const CB2&,const CB3&,Op);
 
 // The following algorithms are only defined for homogeneous color bases:
 // Equivalent to std::fill
-template <typename HCB, typename Element> void static_fill(HCB& p, const Element& v);
+template <typename HCB, typename Element> void static_fill(HCB& p, const Element& v);
 
 // Equivalents to std::min_element and std::max_element
-template <typename HCB> typename element_const_reference_type<HCB>::type static_min(const HCB&);
-template <typename HCB> typename element_reference_type<HCB>::type       static_min(      HCB&);
-template <typename HCB> typename element_const_reference_type<HCB>::type static_max(const HCB&);
-template <typename HCB> typename element_reference_type<HCB>::type       static_max(      HCB&);
+template <typename HCB> typename element_const_reference_type<HCB>::type static_min(const HCB&);
+template <typename HCB> typename element_reference_type<HCB>::type       static_min(      HCB&);
+template <typename HCB> typename element_const_reference_type<HCB>::type static_max(const HCB&);
+template <typename HCB> typename element_reference_type<HCB>::type       static_max(      HCB&);
 

These algorithms are designed after the corresponding STL algorithms, except @@ -270,30 +269,30 @@ In addition, they are implemented with a compile-time recursion (thus the prefix “static_”). Finally, they pair the elements semantically instead of based on their physical order in memory.

For example, here is the implementation of static_equal:

-
namespace detail
-{
-  template <int K> struct element_recursion
-  {
-    template <typename P1,typename P2>
-    static bool static_equal(const P1& p1, const P2& p2)
-    {
-      return element_recursion<K-1>::static_equal(p1,p2) &&
-             semantic_at_c<K-1>(p1)==semantic_at_c<N-1>(p2);
-    }
-  };
-  template <> struct element_recursion<0>
-  {
-    template <typename P1,typename P2>
-    static bool static_equal(const P1&, const P2&) { return true; }
-  };
-}
+
namespace detail
+{
+  template <int K> struct element_recursion
+  {
+    template <typename P1,typename P2>
+    static bool static_equal(const P1& p1, const P2& p2)
+    {
+      return element_recursion<K-1>::static_equal(p1,p2) &&
+             semantic_at_c<K-1>(p1)==semantic_at_c<N-1>(p2);
+    }
+  };
+  template <> struct element_recursion<0>
+  {
+    template <typename P1,typename P2>
+    static bool static_equal(const P1&, const P2&) { return true; }
+  };
+}
 
-template <typename P1,typename P2>
-bool static_equal(const P1& p1, const P2& p2)
-{
-  gil_function_requires<ColorSpacesCompatibleConcept<P1::layout_t::color_space_t,P2::layout_t::color_space_t> >();
-  return detail::element_recursion<size<P1>::value>::static_equal(p1,p2);
-}
+template <typename P1,typename P2>
+bool static_equal(const P1& p1, const P2& p2)
+{
+  gil_function_requires<ColorSpacesCompatibleConcept<P1::layout_t::color_space_t,P2::layout_t::color_space_t> >();
+  return detail::element_recursion<size<P1>::value>::static_equal(p1,p2);
+}
 

This algorithm is used when invoking operator== on two pixels, for @@ -314,8 +313,8 @@ color base require that they all have the same color space.

\ No newline at end of file diff --git a/html/design/color_space.html b/html/design/color_space.html index 91b6279c8..aa811caa6 100644 --- a/html/design/color_space.html +++ b/html/design/color_space.html @@ -5,7 +5,7 @@ - + Color Space and Layout - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,15 +70,15 @@
-

Color Space and Layout

-
+

Color Space and Layout

+
+
-

Overview

+

Overview

A color space captures the set and interpretation of channels comprising a pixel. In Boost.GIL, color space is defined as an MPL random access sequence containing the types of all elements in the color space.

@@ -95,7 +94,7 @@ same set of colors in the same order).

-

Models

+

Models

GIL currently provides the following color spaces:

  • gray_t

  • @@ -118,11 +117,11 @@ same set of colors in the same order).

  • argb_layout_t

As an example, here is how GIL defines the RGBA color space:

-
struct red_t {};
-struct green_t {};
-struct blue_t {};
-struct alpha_t {};
-rgba_t = using mp11::mp_list<red_t, green_t, blue_t, alpha_t>;
+
struct red_t {};
+struct green_t {};
+struct blue_t {};
+struct alpha_t {};
+rgba_t = using mp11::mp_list<red_t, green_t, blue_t, alpha_t>;
 

The ordering of the channels in the color space definition specifies their @@ -133,23 +132,23 @@ color space, channels may vary in their physical ordering in memory.

an MPL random access sequence of integral types. A color space and its associated mapping are often used together.

Thus they are grouped in GIL’s layout:

-
template
-<
-    typename ColorSpace,
-    typename ChannelMapping = mp11::make_integer_sequence<int, mp11::mp_size<ColorSpace>::value>
->
-struct layout
-{
-  using color_space_t = ColorSpace;
-  using channel_mapping_t = ChannelMapping;
-};
+
template
+<
+    typename ColorSpace,
+    typename ChannelMapping = mp11::make_integer_sequence<int, mp11::mp_size<ColorSpace>::value>
+>
+struct layout
+{
+  using color_space_t = ColorSpace;
+  using channel_mapping_t = ChannelMapping;
+};
 

Here is how to create layouts for the RGBA color space:

using rgba_layout_t = layout<rgba_t>; // default ordering is 0,1,2,3...
-using bgra_layout_t = layout<rgba_t, mp11::mp_list_c<int,2,1,0,3>>;
-using argb_layout_t = layout<rgba_t, mp11::mp_list_c<int,1,2,3,0>>;
-using abgr_layout_t = layout<rgba_t, mp11::mp_list_c<int,3,2,1,0>>;
+using bgra_layout_t = layout<rgba_t, mp11::mp_list_c<int,2,1,0,3>>;
+using argb_layout_t = layout<rgba_t, mp11::mp_list_c<int,1,2,3,0>>;
+using abgr_layout_t = layout<rgba_t, mp11::mp_list_c<int,3,2,1,0>>;
 
@@ -166,8 +165,8 @@ A color space and its associated mapping are often used together.

\ No newline at end of file diff --git a/html/design/concepts.html b/html/design/concepts.html index 9b8edd6ef..99bb1588b 100644 --- a/html/design/concepts.html +++ b/html/design/concepts.html @@ -5,7 +5,7 @@ - + Concepts - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
-

Concepts

+

Concepts

All constructs in GIL are models of GIL concepts. A concept is a set of requirements that a type (or a set of related types) must fulfill to be used correctly in generic algorithms. The requirements include syntactic and @@ -87,51 +86,51 @@ in the C++ standard proposal paper

Here are some common concepts that will be used in GIL. Most of them are defined at the ConceptC++ Concept Web:

-
auto concept DefaultConstructible<typename T>
-{
-    T::T();
-};
+
auto concept DefaultConstructible<typename T>
+{
+    T::T();
+};
 
-auto concept CopyConstructible<typename T>
-{
-    T::T(T);
-    T::~T();
-};
+auto concept CopyConstructible<typename T>
+{
+    T::T(T);
+    T::~T();
+};
 
-auto concept Assignable<typename T, typename U = T>
-{
-    typename result_type;
-    result_type operator=(T&, U);
-};
+auto concept Assignable<typename T, typename U = T>
+{
+    typename result_type;
+    result_type operator=(T&, U);
+};
 
-auto concept EqualityComparable<typename T, typename U = T>
-{
-    bool operator==(T x, U y);
-    bool operator!=(T x, U y) { return !(x==y); }
-};
+auto concept EqualityComparable<typename T, typename U = T>
+{
+    bool operator==(T x, U y);
+    bool operator!=(T x, U y) { return !(x==y); }
+};
 
-concept SameType<typename T, typename U> { /* unspecified */ };
-template<typename T> concept_map SameType<T, T> { /* unspecified */ };
+concept SameType<typename T, typename U> { /* unspecified */ };
+template<typename T> concept_map SameType<T, T> { /* unspecified */ };
 
-auto concept Swappable<typename T>
-{
-    void swap(T& t, T& u);
-};
+auto concept Swappable<typename T>
+{
+    void swap(T& t, T& u);
+};
 

Here are some additional basic concepts that GIL needs:

-
auto concept Regular<typename T> :
-    DefaultConstructible<T>,
-    CopyConstructible<T>,
-    EqualityComparable<T>,
-    Assignable<T>,
-    Swappable<T>
-{};
+
auto concept Regular<typename T> :
+    DefaultConstructible<T>,
+    CopyConstructible<T>,
+    EqualityComparable<T>,
+    Assignable<T>,
+    Swappable<T>
+{};
 
-auto concept Metafunction<typename T>
-{
-    typename type;
-};
+auto concept Metafunction<typename T>
+{
+    typename type;
+};
 
@@ -147,8 +146,8 @@ Most of them are defined at the \ No newline at end of file diff --git a/html/design/conclusions.html b/html/design/conclusions.html index d0c824d09..c972c419a 100644 --- a/html/design/conclusions.html +++ b/html/design/conclusions.html @@ -5,7 +5,7 @@ - + Conclusions - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,8 +70,8 @@
-

Conclusions

-
+

Conclusions

+
+

The Generic Image Library is designed with the following five goals in mind:

-

Generality

+

Generality

Abstracts image representations from algorithms on images. It allows for writing code once and have it work for any image type.

-

Performance

+

Performance

Speed has been instrumental to the design of the library. The generic algorithms provided in the library are in many cases comparable in speed to hand-coding the algorithm for a specific image type.

-

Flexibility

+

Flexibility

Compile-type parameter resolution results in faster code, but severely limits code flexibility. The library allows for any image parameter to be specified at run time, at a minor performance cost.

-

Extensibility

+

Extensibility

Virtually every construct in GIL can be extended - new channel types, color spaces, layouts, iterators, locators, image views and images can be provided by modeling the corresponding GIL concepts.

-

Compatibility

+

Compatibility

The library is designed as an STL complement. Generic STL algorithms can be used for pixel manipulation, and they are specifically targeted for optimization. The library works with existing @@ -125,8 +124,8 @@ raw pixel data from another image library.

\ No newline at end of file diff --git a/html/design/dynamic_image.html b/html/design/dynamic_image.html index 863e4e321..1213fd92b 100644 --- a/html/design/dynamic_image.html +++ b/html/design/dynamic_image.html @@ -5,7 +5,7 @@ - + Dynamic images and image views - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
-

Dynamic images and image views

+

Dynamic images and image views

The GIL extension called dynamic_image allows for images, image views or any GIL constructs to have their parameters defined at run time.

The color space, channel depth, channel ordering, and interleaved/planar @@ -82,30 +81,30 @@ at a given file path, rotates it and saves it back in its original color space and channel depth. How can we possibly write this using our generic image? What type is the image loading code supposed to return?

Here is an example:

-
#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
-using namespace boost;
+
#include <boost/gil/extension/dynamic_image/dynamic_image_all.hpp>
+using namespace boost;
 
 #define ASSERT_SAME(A,B) static_assert(is_same< A,B >::value, "")
 
 // Create any_image class (or any_image_view) class with a set of allowed images
-typedef any_image<rgb8_image_t, cmyk16_planar_image_t> my_any_image_t;
+typedef any_image<rgb8_image_t, cmyk16_planar_image_t> my_any_image_t;
 
 // Associated view types are available (equivalent to the ones in image_t)
-typedef any_image_view<rgb8_view_t, cmyk16_planar_view_t> AV;
-ASSERT_SAME(my_any_image_t::view_t, AV);
+typedef any_image_view<rgb8_view_t, cmyk16_planar_view_t> AV;
+ASSERT_SAME(my_any_image_t::view_t, AV);
 
-typedef any_image_view<rgb8c_view_t, cmyk16c_planar_view_t>> CAV;
-ASSERT_SAME(my_any_image_t::const_view_t, CAV);
-ASSERT_SAME(my_any_image_t::const_view_t, my_any_image_t::view_t::const_t);
+typedef any_image_view<rgb8c_view_t, cmyk16c_planar_view_t>> CAV;
+ASSERT_SAME(my_any_image_t::const_view_t, CAV);
+ASSERT_SAME(my_any_image_t::const_view_t, my_any_image_t::view_t::const_t);
 
-typedef any_image_view<rgb8_step_view_t, cmyk16_planar_step_view_t> SAV;
-ASSERT_SAME(typename dynamic_x_step_type<my_any_image_t::view_t>::type, SAV);
+typedef any_image_view<rgb8_step_view_t, cmyk16_planar_step_view_t> SAV;
+ASSERT_SAME(typename dynamic_x_step_type<my_any_image_t::view_t>::type, SAV);
 
 // Assign it a concrete image at run time:
-my_any_image_t myImg = my_any_image_t(rgb8_image_t(100,100));
+my_any_image_t myImg = my_any_image_t(rgb8_image_t(100,100));
 
 // Change it to another at run time. The previous image gets destroyed
-myImg = cmyk16_planar_image_t(200,100);
+myImg = cmyk16_planar_image_t(200,100);
 
 // Assigning to an image not in the allowed set throws an exception
 myImg = gray8_image_t();        // will throw std::bad_cast
@@ -114,57 +113,57 @@ What type is the image loading code supposed to return?

The any_image and any_image_view subclass from Boost.Variant2 variant class, a never valueless variant type, compatible with std::variant in C++17.

GIL any_image_view and any_image are subclasses of variant:

-
template <typename ...ImageViewTypes>
-class any_image_view : public variant<ImageViewTypes...>
-{
-public:
+
template <typename ...ImageViewTypes>
+class any_image_view : public variant<ImageViewTypes...>
+{
+public:
   typedef ... const_t; // immutable equivalent of this
-  typedef std::ptrdiff_t x_coord_t;
-  typedef std::ptrdiff_t y_coord_t;
-  typedef point<std::ptrdiff_t> point_t;
-  using size_type = std::size_t;
+  typedef std::ptrdiff_t x_coord_t;
+  typedef std::ptrdiff_t y_coord_t;
+  typedef point<std::ptrdiff_t> point_t;
+  using size_type = std::size_t;
 
-  any_image_view();
-  template <typename T> explicit any_image_view(const T& obj);
-  any_image_view(const any_image_view& v);
+  any_image_view();
+  template <typename T> explicit any_image_view(const T& obj);
+  any_image_view(const any_image_view& v);
 
-  template <typename T> any_image_view& operator=(const T& obj);
-  any_image_view&                       operator=(const any_image_view& v);
+  template <typename T> any_image_view& operator=(const T& obj);
+  any_image_view&                       operator=(const any_image_view& v);
 
   // parameters of the currently instantiated view
-  std::size_t num_channels()  const;
-  point_t     dimensions()    const;
-  size_type   size()          const;
-  x_coord_t   width()         const;
-  y_coord_t   height()        const;
-};
+  std::size_t num_channels()  const;
+  point_t     dimensions()    const;
+  size_type   size()          const;
+  x_coord_t   width()         const;
+  y_coord_t   height()        const;
+};
 
-template <typename ...ImageTypes>
-class any_image : public variant<ImageTypes...>
-{
-public:
-  typedef ... const_view_t;
-  typedef ... view_t;
-  typedef std::ptrdiff_t x_coord_t;
-  typedef std::ptrdiff_t y_coord_t;
-  typedef point<std::ptrdiff_t> point_t;
+template <typename ...ImageTypes>
+class any_image : public variant<ImageTypes...>
+{
+public:
+  typedef ... const_view_t;
+  typedef ... view_t;
+  typedef std::ptrdiff_t x_coord_t;
+  typedef std::ptrdiff_t y_coord_t;
+  typedef point<std::ptrdiff_t> point_t;
 
-  any_image();
-  template <typename T> explicit any_image(const T& obj);
-  template <typename T> explicit any_image(T& obj, bool do_swap);
-  any_image(const any_image& v);
+  any_image();
+  template <typename T> explicit any_image(const T& obj);
+  template <typename T> explicit any_image(T& obj, bool do_swap);
+  any_image(const any_image& v);
 
-  template <typename T> any_image& operator=(const T& obj);
-  any_image&                       operator=(const any_image& v);
+  template <typename T> any_image& operator=(const T& obj);
+  any_image&                       operator=(const any_image& v);
 
-  void recreate(const point_t& dims, unsigned alignment=1);
-  void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1);
+  void recreate(const point_t& dims, unsigned alignment=1);
+  void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1);
 
-  std::size_t num_channels()  const;
-  point_t     dimensions()    const;
-  x_coord_t   width()         const;
-  y_coord_t   height()        const;
-};
+  std::size_t num_channels()  const;
+  point_t     dimensions()    const;
+  x_coord_t   width()         const;
+  y_coord_t   height()        const;
+};
 

Operations are invoked on variants via variant2::visit passing a @@ -202,13 +201,13 @@ have overloads operating on // Copies the pixels from v1 into v2. // If the pixels are incompatible triggers compile error -copy_pixels(v1,v2); +copy_pixels(v1,v2); // The source or destination (or both) may be run-time instantiated. // If they happen to be incompatible, throws std::bad_cast -copy_pixels(v1, av); -copy_pixels(av, v2); -copy_pixels(av, av); +copy_pixels(v1, av); +copy_pixels(av, v2); +copy_pixels(av, av);

By having algorithm overloads supporting dynamic constructs, we create @@ -216,15 +215,15 @@ a base upon which it is possible to write algorithms that can work with either compile-time or runtime images or views. The following code, for example, uses the GIL I/O extension to turn an image on disk upside down:

-
#include <boost\gil\extension\io\jpeg.hpp>
+
#include <boost\gil\extension\io\jpeg.hpp>
 
 template <typename Image>    // Could be rgb8_image_t or any_image<...>
-void save_180rot(const std::string& file_name)
-{
-  Image img;
-  read_image(file_name, img, jpeg_tag());
-  write_view(file_name, rotated180_view(view(img)), jpeg_tag());
-}
+void save_180rot(const std::string& file_name)
+{
+  Image img;
+  read_image(file_name, img, jpeg_tag());
+  write_view(file_name, rotated180_view(view(img)), jpeg_tag());
+}
 

It can be instantiated with either a compile-time or a runtime image @@ -232,29 +231,29 @@ because all functions it uses have overloads taking runtime constructs. For example, here is how rotated180_view is implemented:

// implementation using templated view
-template <typename View>
-typename dynamic_xy_step_type<View>::type rotated180_view(const View& src) { ... }
+template <typename View>
+typename dynamic_xy_step_type<View>::type rotated180_view(const View& src) { ... }
 
-namespace detail {
+namespace detail {
   // the function, wrapped inside a function object
-  template <typename Result> struct rotated180_view_fn
-  {
-      typedef Result result_type;
-      template <typename View> result_type operator()(const View& src) const
-      {
-          return result_type(rotated180_view(src));
-      }
-  };
-}
+  template <typename Result> struct rotated180_view_fn
+  {
+      typedef Result result_type;
+      template <typename View> result_type operator()(const View& src) const
+      {
+          return result_type(rotated180_view(src));
+      }
+  };
+}
 
 // overloading of the function using variant. Takes and returns run-time bound view.
 // The returned view has a dynamic step
-template <typename ...ViewTypes> inline
-typename dynamic_xy_step_type<any_image_view<ViewTypes...>>::type rotated180_view(const any_image_view<ViewTypes...>& src)
-{
-  using result_view_t = typename dynamic_xy_step_type<any_image_view<ViewTypes...>>::type;
-  return variant2::visit(detail::rotated180_view_fn<result_view_t>(), src);
-}
+template <typename ...ViewTypes> inline
+typename dynamic_xy_step_type<any_image_view<ViewTypes...>>::type rotated180_view(const any_image_view<ViewTypes...>& src)
+{
+  using result_view_t = typename dynamic_xy_step_type<any_image_view<ViewTypes...>>::type;
+  return variant2::visit(detail::rotated180_view_fn<result_view_t>(), src);
+}
 

Variants should be used with caution (especially algorithms that take @@ -278,8 +277,8 @@ uniformly as a collection and store them in the same container.

\ No newline at end of file diff --git a/html/design/examples.html b/html/design/examples.html index 98dda8866..2899be059 100644 --- a/html/design/examples.html +++ b/html/design/examples.html @@ -5,7 +5,7 @@ - + Examples - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,17 +70,17 @@
-

Examples

- +
-

Pixel-level Operations

+

Pixel-level Operations

Here are some operations you can do with pixel values, pixel pointers and pixel references:

rgb8_pixel_t p1(255,0,0);     // make a red RGB pixel
@@ -91,9 +90,9 @@ pixel references:

assert(semantic_at_c<0>(p1)==semantic_at_c<0>(p2)); // this is how to compare the two red channels get_color(p1,green_t()) = get_color(p2,blue_t()); // channels can also be accessed by name -const unsigned char* r; -const unsigned char* g; -const unsigned char* b; +const unsigned char* r; +const unsigned char* g; +const unsigned char* b; rgb8c_planar_ptr_t ptr(r,g,b); // constructing const planar pointer from const pointers to each plane rgb8c_planar_ref_t ref=*ptr; // just like built-in reference, dereferencing a planar pointer returns a planar reference @@ -109,35 +108,35 @@ pixel references:

Here is how to use pixels in generic code:

-
template <typename GrayPixel, typename RGBPixel>
-void gray_to_rgb(const GrayPixel& src, RGBPixel& dst)
-{
-  gil_function_requires<PixelConcept<GrayPixel> >();
-  gil_function_requires<MutableHomogeneousPixelConcept<RGBPixel> >();
+
template <typename GrayPixel, typename RGBPixel>
+void gray_to_rgb(const GrayPixel& src, RGBPixel& dst)
+{
+  gil_function_requires<PixelConcept<GrayPixel> >();
+  gil_function_requires<MutableHomogeneousPixelConcept<RGBPixel> >();
 
-  typedef typename color_space_type<GrayPixel>::type gray_cs_t;
-  static_assert(boost::is_same<gray_cs_t,gray_t>::value, "");
+  typedef typename color_space_type<GrayPixel>::type gray_cs_t;
+  static_assert(boost::is_same<gray_cs_t,gray_t>::value, "");
 
-  typedef typename color_space_type<RGBPixel>::type  rgb_cs_t;
-  static_assert(boost::is_same<rgb_cs_t,rgb_t>::value, "");
+  typedef typename color_space_type<RGBPixel>::type  rgb_cs_t;
+  static_assert(boost::is_same<rgb_cs_t,rgb_t>::value, "");
 
-  typedef typename channel_type<GrayPixel>::type gray_channel_t;
-  typedef typename channel_type<RGBPixel>::type  rgb_channel_t;
+  typedef typename channel_type<GrayPixel>::type gray_channel_t;
+  typedef typename channel_type<RGBPixel>::type  rgb_channel_t;
 
-  gray_channel_t gray = get_color(src,gray_color_t());
-  static_fill(dst, channel_convert<rgb_channel_t>(gray));
-}
+  gray_channel_t gray = get_color(src,gray_color_t());
+  static_fill(dst, channel_convert<rgb_channel_t>(gray));
+}
 
 // example use patterns:
 
 // converting gray l-value to RGB and storing at (5,5) in a 16-bit BGR interleaved image:
-bgr16_view_t b16(...);
-gray_to_rgb(gray8_pixel_t(33), b16(5,5));
+bgr16_view_t b16(...);
+gray_to_rgb(gray8_pixel_t(33), b16(5,5));
 
 // storing the first pixel of an 8-bit grayscale image as the 5-th pixel of 32-bit planar RGB image:
-rgb32f_planar_view_t rpv32;
-gray8_view_t gv8(...);
-gray_to_rgb(*gv8.begin(), rpv32[5]);
+rgb32f_planar_view_t rpv32;
+gray8_view_t gv8(...);
+gray_to_rgb(*gv8.begin(), rpv32[5]);
 

As the example shows, both the source and the destination can be references or @@ -145,7 +144,7 @@ values, planar or interleaved, as long as they model MutablePixelConcept respectively.

-

Resizing image canvas

+

Resizing image canvas

Resizing an image canvas means adding a buffer of pixels around existing pixels. Size of canvas of an image can never be smaller than the image itself.

Suppose we want to convolve an image with multiple kernels, the largest of @@ -153,16 +152,16 @@ which is 2K+1 x 2K+1 pixels. It may be worth creating a margin of K pixels around the image borders. Here is how to do it:

template <typename SrcView,   // Models ImageViewConcept (the source view)
         typename DstImage>  // Models ImageConcept     (the returned image)
-void create_with_margin(const SrcView& src, int k, DstImage& result)
-{
-  gil_function_requires<ImageViewConcept<SrcView> >();
-  gil_function_requires<ImageConcept<DstImage> >();
-  gil_function_requires<ViewsCompatibleConcept<SrcView, typename DstImage::view_t> >();
+void create_with_margin(const SrcView& src, int k, DstImage& result)
+{
+  gil_function_requires<ImageViewConcept<SrcView> >();
+  gil_function_requires<ImageConcept<DstImage> >();
+  gil_function_requires<ViewsCompatibleConcept<SrcView, typename DstImage::view_t> >();
 
-  result=DstImage(src.width()+2*k, src.height()+2*k);
-  typename DstImage::view_t centerImg=subimage_view(view(result), k,k,src.width(),src.height());
-  std::copy(src.begin(), src.end(), centerImg.begin());
-}
+  result=DstImage(src.width()+2*k, src.height()+2*k);
+  typename DstImage::view_t centerImg=subimage_view(view(result), k,k,src.width(),src.height());
+  std::copy(src.begin(), src.end(), centerImg.begin());
+}
 

We allocated a larger image, then we used subimage_view to create a @@ -170,16 +169,16 @@ shallow image of its center area of top left corner at (k,k) and of identical size as src, and finally we copied src into that center image. If the margin needs initialization, we could have done it with fill_pixels. Here is how to simplify this code using the copy_pixels algorithm:

-
template <typename SrcView, typename DstImage>
-void create_with_margin(const SrcView& src, int k, DstImage& result)
-{
-  result.recreate(src.width()+2*k, src.height()+2*k);
-  copy_pixels(src, subimage_view(view(result), k,k,src.width(),src.height()));
-}
+
template <typename SrcView, typename DstImage>
+void create_with_margin(const SrcView& src, int k, DstImage& result)
+{
+  result.recreate(src.width()+2*k, src.height()+2*k);
+  copy_pixels(src, subimage_view(view(result), k,k,src.width(),src.height()));
+}
 

(Note also that image::recreate is more efficient than operator=, as -the latter will do an unnecessary copy construction). Not only does the above +the latter will do an unnecessary copy construction.) Not only does the above example work for planar and interleaved images of any color space and pixel depth; it is also optimized. GIL overrides std::copy - when called on two identical interleaved images with no padding at the end of rows, it simply @@ -187,50 +186,50 @@ does a memmovememmove for each row. When an image has no padding, it will use its lightweight horizontal iterator (as opposed to the more complex 1D image -iterator that has to check for the end of rows). It choses the fastest method, +iterator that has to check for the end of rows). It chooses the fastest method, taking into account both static and run-time parameters.

-

Histogram

+

Histogram

The histogram can be computed by counting the number of pixel values that fall in each bin. The following method takes a grayscale (one-dimensional) image view, since only grayscale pixels are convertible to integers:

-
template <typename GrayView, typename R>
-void grayimage_histogram(const GrayView& img, R& hist)
-{
-  for (typename GrayView::iterator it=img.begin(); it!=img.end(); ++it)
-      ++hist[*it];
-}
+
template <typename GrayView, typename R>
+void grayimage_histogram(const GrayView& img, R& hist)
+{
+  for (typename GrayView::iterator it=img.begin(); it!=img.end(); ++it)
+      ++hist[*it];
+}
 

Using boost::lambda and GIL’s for_each_pixel algorithm, we can write this more compactly:

-
template <typename GrayView, typename R>
-void grayimage_histogram(const GrayView& v, R& hist)
-{
-  for_each_pixel(v, ++var(hist)[_1]);
-}
+
template <typename GrayView, typename R>
+void grayimage_histogram(const GrayView& v, R& hist)
+{
+  for_each_pixel(v, ++var(hist)[_1]);
+}
 

Where for_each_pixel invokes std::for_each and var and _1 are boost::lambda constructs. To compute the luminosity histogram, we call the above method using the grayscale view of an image:

-
template <typename View, typename R>
-void luminosity_histogram(const View& v, R& hist)
-{
-  grayimage_histogram(color_converted_view<gray8_pixel_t>(v),hist);
-}
+
template <typename View, typename R>
+void luminosity_histogram(const View& v, R& hist)
+{
+  grayimage_histogram(color_converted_view<gray8_pixel_t>(v),hist);
+}
 

This is how to invoke it:

-
unsigned char hist[256];
-std::fill(hist,hist+256,0);
-luminosity_histogram(my_view,hist);
+
unsigned char hist[256];
+std::fill(hist,hist+256,0);
+luminosity_histogram(my_view,hist);
 

If we want to view the histogram of the second channel of the image in the top left 100x100 area, we call:

-
grayimage_histogram(nth_channel_view(subimage_view(img,0,0,100,100),1),hist);
+
grayimage_histogram(nth_channel_view(subimage_view(img,0,0,100,100),1),hist);
 

No pixels are copied and no extra memory is allocated - the code operates @@ -238,15 +237,15 @@ directly on the source pixels, which could be in any supported color space and channel depth. They could be either planar or interleaved.

-

Using image views

+

Using image views

The following code illustrates the power of using image views:

-
jpeg_read_image("monkey.jpg", img);
-step1=view(img);
-step2=subimage_view(step1, 200,300, 150,150);
-step3=color_converted_view<rgb8_view_t,gray8_pixel_t>(step2);
-step4=rotated180_view(step3);
-step5=subsampled_view(step4, 2,1);
-jpeg_write_view("monkey_transform.jpg", step5);
+
jpeg_read_image("monkey.jpg", img);
+step1=view(img);
+step2=subimage_view(step1, 200,300, 150,150);
+step3=color_converted_view<rgb8_view_t,gray8_pixel_t>(step2);
+step4=rotated180_view(step3);
+step5=subsampled_view(step4, 2,1);
+jpeg_write_view("monkey_transform.jpg", step5);
 

The intermediate images are shown here:

@@ -268,8 +267,8 @@ channel depth. They could be either planar or interleaved.

\ No newline at end of file diff --git a/html/design/extending.html b/html/design/extending.html index b765f4543..d105c1198 100644 --- a/html/design/extending.html +++ b/html/design/extending.html @@ -5,7 +5,7 @@ - + Extending - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,8 +70,8 @@
-

Extending

- +
-

Overview

+

Overview

You can define your own pixel iterators, locators, image views, images, channel types, color spaces and algorithms. You can make virtual images that live on the disk, inside a jpeg file, somewhere on @@ -92,7 +91,7 @@ will work with any existing GIL code. Most such extensions require no changes to the library and can thus be supplied in another module.

-

Defining new color spaces

+

Defining new color spaces

Each color space is in a separate file. To add a new color space, just copy one of the existing ones (like rgb.hpp) and change it accordingly. If you want color conversion support, you will have to @@ -102,7 +101,7 @@ typedefs for pixels, pointers, references and images with the new color space (see typedefs.h).

-

Defining new channel types

+

Defining new channel types

Most of the time you don’t need to do anything special to use a new channel type. You can just use it:

typedef pixel<double,rgb_layout_t>   rgb64_pixel_t;    // 64 bit RGB pixel
@@ -116,7 +115,7 @@ want to do conversion between your and existing channel types, you
 will need to provide an overload of channel_convert.

-

Overloading color conversion

+

Overloading color conversion

Suppose you want to provide your own color conversion. For example, you may want to implement higher quality color conversion using color profiles. Typically you may want to redefine color conversion only in @@ -125,44 +124,44 @@ cases. Here is, for example, how to overload color conversion so that color conversion to gray inverts the result but everything else remains the same:

// make the default use GIL's default
-template <typename SrcColorSpace, typename DstColorSpace>
-struct my_color_converter_impl
-: public default_color_converter_impl<SrcColorSpace,DstColorSpace> {};
+template <typename SrcColorSpace, typename DstColorSpace>
+struct my_color_converter_impl
+: public default_color_converter_impl<SrcColorSpace,DstColorSpace> {};
 
 // provide specializations only for cases you care about
 // (in this case, if the destination is grayscale, invert it)
-template <typename SrcColorSpace>
-struct my_color_converter_impl<SrcColorSpace,gray_t>
-{
+template <typename SrcColorSpace>
+struct my_color_converter_impl<SrcColorSpace,gray_t>
+{
   template <typename SrcP, typename DstP>  // Model PixelConcept
-  void operator()(const SrcP& src, DstP& dst) const
-  {
-      default_color_converter_impl<SrcColorSpace,gray_t>()(src,dst);
-      get_color(dst,gray_color_t())=channel_invert(get_color(dst,gray_color_t()));
-  }
-};
+  void operator()(const SrcP& src, DstP& dst) const
+  {
+      default_color_converter_impl<SrcColorSpace,gray_t>()(src,dst);
+      get_color(dst,gray_color_t())=channel_invert(get_color(dst,gray_color_t()));
+  }
+};
 
 // create a color converter object that dispatches to your own implementation
-struct my_color_converter
-{
+struct my_color_converter
+{
   template <typename SrcP, typename DstP>  // Model PixelConcept
-  void operator()(const SrcP& src,DstP& dst) const
-  {
-      typedef typename color_space_type<SrcP>::type SrcColorSpace;
-      typedef typename color_space_type<DstP>::type DstColorSpace;
-      my_color_converter_impl<SrcColorSpace,DstColorSpace>()(src,dst);
-  }
-};
+  void operator()(const SrcP& src,DstP& dst) const
+  {
+      typedef typename color_space_type<SrcP>::type SrcColorSpace;
+      typedef typename color_space_type<DstP>::type DstColorSpace;
+      my_color_converter_impl<SrcColorSpace,DstColorSpace>()(src,dst);
+  }
+};
 

GIL color conversion functions take the color converter as an optional parameter. You can pass your own color converter:

-
color_converted_view<gray8_pixel_t>(img_view,my_color_converter());
+
color_converted_view<gray8_pixel_t>(img_view,my_color_converter());
 
-

Defining new image views

+

Defining new image views

You can provide your own pixel iterators, locators and views, overriding either the mechanism for getting from one pixel to the next or doing an arbitrary pixel transformation on dereference. For @@ -175,53 +174,53 @@ called when we dereference a pixel iterator. It will call color_convert to convert to the destination pixel type:

template <typename SrcConstRefP,  // const reference to the source pixel
         typename DstP>          // Destination pixel value (models PixelValueConcept)
-class color_convert_deref_fn
-{
-public:
-  typedef color_convert_deref_fn const_t;
-  typedef DstP                value_type;
+class color_convert_deref_fn
+{
+public:
+  typedef color_convert_deref_fn const_t;
+  typedef DstP                value_type;
   typedef value_type          reference;      // read-only dereferencing
-  typedef const value_type&   const_reference;
-  typedef SrcConstRefP        argument_type;
-  typedef reference           result_type;
-  static bool constexpr is_mutable = false;
+  typedef const value_type&   const_reference;
+  typedef SrcConstRefP        argument_type;
+  typedef reference           result_type;
+  static bool constexpr is_mutable = false;
 
-  result_type operator()(argument_type srcP) const {
-      result_type dstP;
-      color_convert(srcP,dstP);
-      return dstP;
-  }
-};
+  result_type operator()(argument_type srcP) const {
+      result_type dstP;
+      color_convert(srcP,dstP);
+      return dstP;
+  }
+};
 

We then use the add_deref member struct of image views to construct the type of a view that invokes a given function object (deref_t) upon dereferencing. In our case, it performs color conversion:

-
template <typename SrcView, typename DstP>
-struct color_converted_view_type
-{
-private:
+
template <typename SrcView, typename DstP>
+struct color_converted_view_type
+{
+private:
   typedef typename SrcView::const_t::reference src_pix_ref;  // const reference to pixel in SrcView
   typedef color_convert_deref_fn<src_pix_ref, DstP> deref_t; // the dereference adaptor that performs color conversion
-  typedef typename SrcView::template add_deref<deref_t> add_ref_t;
-public:
+  typedef typename SrcView::template add_deref<deref_t> add_ref_t;
+public:
   typedef typename add_ref_t::type type; // the color converted view type
-  static type make(const SrcView& sv) { return add_ref_t::make(sv, deref_t()); }
-};
+  static type make(const SrcView& sv) { return add_ref_t::make(sv, deref_t()); }
+};
 

Finally our color_converted_view code simply creates color-converted view from the source view:

-
template <typename DstP, typename View> inline
-typename color_converted_view_type<View,DstP>::type color_convert_view(const View& src)
-{
-  return color_converted_view_type<View,DstP>::make(src);
-}
+
template <typename DstP, typename View> inline
+typename color_converted_view_type<View,DstP>::type color_convert_view(const View& src)
+{
+  return color_converted_view_type<View,DstP>::make(src);
+}
 

(The actual color convert view transformation is slightly more complicated, as it takes an optional color conversion object, which -allows users to specify their own color conversion methods). See the +allows users to specify their own color conversion methods.) See the GIL tutorial for an example of creating a virtual image view that defines the Mandelbrot set.

@@ -238,8 +237,8 @@ defines the Mandelbrot set.

\ No newline at end of file diff --git a/html/design/image.html b/html/design/image.html index f81a48f04..e3dc23630 100644 --- a/html/design/image.html +++ b/html/design/image.html @@ -5,7 +5,7 @@ - + Image - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,16 +70,16 @@
-

Image

-
+

Image

+
+
-

Overview

-

An image is a container that owns the pixels of a given image view +

Overview

+

An image is a container that owns the pixels of a given image view. It allocates them in its constructor and deletes them in the destructor. It has a deep assignment operator and copy constructor. Images are used rarely, just when data ownership is important. Most STL algorithms operate on @@ -88,49 +87,49 @@ ranges, not containers. Similarly most GIL algorithms operate on image views (which images provide).

In the most general form images are N-dimensional and satisfy the following concept:

-
concept RandomAccessNDImageConcept<typename Img> : Regular<Img>
-{
-  typename view_t; where MutableRandomAccessNDImageViewConcept<view_t>;
-  typename const_view_t = view_t::const_t;
-  typename point_t      = view_t::point_t;
-  typename value_type   = view_t::value_type;
-  typename allocator_type;
+
concept RandomAccessNDImageConcept<typename Img> : Regular<Img>
+{
+  typename view_t; where MutableRandomAccessNDImageViewConcept<view_t>;
+  typename const_view_t = view_t::const_t;
+  typename point_t      = view_t::point_t;
+  typename value_type   = view_t::value_type;
+  typename allocator_type;
 
-  Img::Img(point_t dims, std::size_t alignment=0);
-  Img::Img(point_t dims, value_type fill_value, std::size_t alignment);
+  Img::Img(point_t dims, std::size_t alignment=0);
+  Img::Img(point_t dims, value_type fill_value, std::size_t alignment);
 
-  void Img::recreate(point_t new_dims, std::size_t alignment=0);
-  void Img::recreate(point_t new_dims, value_type fill_value, std::size_t alignment);
+  void Img::recreate(point_t new_dims, std::size_t alignment=0);
+  void Img::recreate(point_t new_dims, value_type fill_value, std::size_t alignment);
 
-  const point_t&        Img::dimensions() const;
-  const const_view_t&   const_view(const Img&);
-  const view_t&         view(Img&);
-};
+  const point_t&        Img::dimensions() const;
+  const const_view_t&   const_view(const Img&);
+  const view_t&         view(Img&);
+};
 

Two-dimensional images have additional requirements:

-
concept RandomAccess2DImageConcept<RandomAccessNDImageConcept Img>
-{
-  typename x_coord_t = const_view_t::x_coord_t;
-  typename y_coord_t = const_view_t::y_coord_t;
+
concept RandomAccess2DImageConcept<RandomAccessNDImageConcept Img>
+{
+  typename x_coord_t = const_view_t::x_coord_t;
+  typename y_coord_t = const_view_t::y_coord_t;
 
-  Img::Img(x_coord_t width, y_coord_t height, std::size_t alignment=0);
-  Img::Img(x_coord_t width, y_coord_t height, value_type fill_value, std::size_t alignment);
+  Img::Img(x_coord_t width, y_coord_t height, std::size_t alignment=0);
+  Img::Img(x_coord_t width, y_coord_t height, value_type fill_value, std::size_t alignment);
 
-  x_coord_t Img::width() const;
-  y_coord_t Img::height() const;
+  x_coord_t Img::width() const;
+  y_coord_t Img::height() const;
 
-  void Img::recreate(x_coord_t width, y_coord_t height, std::size_t alignment=1);
-  void Img::recreate(x_coord_t width, y_coord_t height, value_type fill_value, std::size_t alignment);
-};
+  void Img::recreate(x_coord_t width, y_coord_t height, std::size_t alignment=1);
+  void Img::recreate(x_coord_t width, y_coord_t height, value_type fill_value, std::size_t alignment);
+};
 

GIL images have views that model ImageViewConcept and operate on pixels.

-
concept ImageConcept<RandomAccess2DImageConcept Img>
-{
-  where MutableImageViewConcept<view_t>;
-  typename coord_t  = view_t::coord_t;
-};
+
concept ImageConcept<RandomAccess2DImageConcept Img>
+{
+  where MutableImageViewConcept<view_t>;
+  typename coord_t  = view_t::coord_t;
+};
 

Images, unlike locators and image views, don’t have ‘mutable’ set of concepts @@ -145,16 +144,16 @@ because immutable images are not very useful.

-

Models

+

Models

GIL provides a class, image, which is templated over the value type (the pixel) and models ImageConcept:

-
 template
- <
+
 template
+ <
      typename Pixel, // Models PixelValueConcept
      bool IsPlanar,  // planar or interleaved image
-     typename A=std::allocator<unsigned char>
- >
-class image;
+     typename A=std::allocator<unsigned char>
+ >
+class image;
 

The image constructor takes an alignment parameter which allows for @@ -179,8 +178,8 @@ there are no padding bits at the end of rows of packed images.

\ No newline at end of file diff --git a/html/design/image_view.html b/html/design/image_view.html index 4442f972a..1fcde8ae4 100644 --- a/html/design/image_view.html +++ b/html/design/image_view.html @@ -5,7 +5,7 @@ - + Image View - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,8 +70,8 @@
-

Image View

-
+

Image View

+
+
-

Overview

+

Overview

An image view is a generalization of STL range concept to multiple dimensions. Similar to ranges (and iterators), image views are shallow, don’t own the underlying data and don’t propagate their constness over the data. @@ -94,8 +93,8 @@ For example, a constant image view cannot be resized, but may allow modifying the pixels. For pixel-immutable operations, use constant-value image view (also called non-mutable image view). Most general N-dimensional views satisfy the following concept:

-
concept RandomAccessNDImageViewConcept<Regular View>
-{
+
concept RandomAccessNDImageViewConcept<Regular View>
+{
   typename value_type;      // for pixel-based views, the pixel type
   typename reference;       // result of dereferencing
   typename difference_type; // result of operator-(iterator,iterator) (1-dimensional!)
@@ -103,117 +102,117 @@ the following concept:

typename point_t; where PointNDConcept<point_t>; // N-dimensional point typename locator; where RandomAccessNDLocatorConcept<locator>; // N-dimensional locator. typename iterator; where RandomAccessTraversalConcept<iterator>; // 1-dimensional iterator over all values - typename reverse_iterator; where RandomAccessTraversalConcept<reverse_iterator>; + typename reverse_iterator; where RandomAccessTraversalConcept<reverse_iterator>; typename size_type; // the return value of size() // Equivalent to RandomAccessNDLocatorConcept::axis - template <size_t D> struct axis { - typename coord_t = point_t::axis<D>::coord_t; + template <size_t D> struct axis { + typename coord_t = point_t::axis<D>::coord_t; typename iterator; where RandomAccessTraversalConcept<iterator>; // iterator along D-th axis. - where SameType<coord_t, iterator::difference_type>; - where SameType<iterator::value_type,value_type>; - }; + where SameType<coord_t, iterator::difference_type>; + where SameType<iterator::value_type,value_type>; + }; // Defines the type of a view similar to this type, except it invokes Deref upon dereferencing - template <PixelDereferenceAdaptorConcept Deref> struct add_deref { - typename type; where RandomAccessNDImageViewConcept<type>; - static type make(const View& v, const Deref& deref); - }; + template <PixelDereferenceAdaptorConcept Deref> struct add_deref { + typename type; where RandomAccessNDImageViewConcept<type>; + static type make(const View& v, const Deref& deref); + }; - static const size_t num_dimensions = point_t::num_dimensions; + static const size_t num_dimensions = point_t::num_dimensions; // Create from a locator at the top-left corner and dimensions - View::View(const locator&, const point_type&); + View::View(const locator&, const point_type&); size_type View::size() const; // total number of elements reference operator[](View, const difference_type&) const; // 1-dimensional reference - iterator View::begin() const; - iterator View::end() const; - reverse_iterator View::rbegin() const; - reverse_iterator View::rend() const; - iterator View::at(const point_t&); + iterator View::begin() const; + iterator View::end() const; + reverse_iterator View::rbegin() const; + reverse_iterator View::rend() const; + iterator View::at(const point_t&); point_t View::dimensions() const; // number of elements along each dimension bool View::is_1d_traversable() const; // Does an iterator over the first dimension visit each value? // iterator along a given dimension starting at a given point - template <size_t D> View::axis<D>::iterator View::axis_iterator(const point_t&) const; + template <size_t D> View::axis<D>::iterator View::axis_iterator(const point_t&) const; - reference operator()(View,const point_t&) const; -}; + reference operator()(View,const point_t&) const; +}; -concept MutableRandomAccessNDImageViewConcept<RandomAccessNDImageViewConcept View> -{ - where Mutable<reference>; -}; +concept MutableRandomAccessNDImageViewConcept<RandomAccessNDImageViewConcept View> +{ + where Mutable<reference>; +};

Two-dimensional image views have the following extra requirements:

-
concept RandomAccess2DImageViewConcept<RandomAccessNDImageViewConcept View>
-{
-  where num_dimensions==2;
+
concept RandomAccess2DImageViewConcept<RandomAccessNDImageViewConcept View>
+{
+  where num_dimensions==2;
 
-  typename x_iterator = axis<0>::iterator;
-  typename y_iterator = axis<1>::iterator;
-  typename x_coord_t  = axis<0>::coord_t;
-  typename y_coord_t  = axis<1>::coord_t;
-  typename xy_locator = locator;
+  typename x_iterator = axis<0>::iterator;
+  typename y_iterator = axis<1>::iterator;
+  typename x_coord_t  = axis<0>::coord_t;
+  typename y_coord_t  = axis<1>::coord_t;
+  typename xy_locator = locator;
 
-  x_coord_t View::width()  const;
-  y_coord_t View::height() const;
+  x_coord_t View::width()  const;
+  y_coord_t View::height() const;
 
   // X-navigation
-  x_iterator View::x_at(const point_t&) const;
-  x_iterator View::row_begin(y_coord_t) const;
-  x_iterator View::row_end  (y_coord_t) const;
+  x_iterator View::x_at(const point_t&) const;
+  x_iterator View::row_begin(y_coord_t) const;
+  x_iterator View::row_end  (y_coord_t) const;
 
   // Y-navigation
-  y_iterator View::y_at(const point_t&) const;
-  y_iterator View::col_begin(x_coord_t) const;
-  y_iterator View::col_end  (x_coord_t) const;
+  y_iterator View::y_at(const point_t&) const;
+  y_iterator View::col_begin(x_coord_t) const;
+  y_iterator View::col_end  (x_coord_t) const;
 
   // navigating in 2D
-  xy_locator View::xy_at(const point_t&) const;
+  xy_locator View::xy_at(const point_t&) const;
 
   // (x,y) versions of all methods taking point_t
-  View::View(x_coord_t,y_coord_t,const locator&);
-  iterator View::at(x_coord_t,y_coord_t) const;
-  reference operator()(View,x_coord_t,y_coord_t) const;
-  xy_locator View::xy_at(x_coord_t,y_coord_t) const;
-  x_iterator View::x_at(x_coord_t,y_coord_t) const;
-  y_iterator View::y_at(x_coord_t,y_coord_t) const;
-};
+  View::View(x_coord_t,y_coord_t,const locator&);
+  iterator View::at(x_coord_t,y_coord_t) const;
+  reference operator()(View,x_coord_t,y_coord_t) const;
+  xy_locator View::xy_at(x_coord_t,y_coord_t) const;
+  x_iterator View::x_at(x_coord_t,y_coord_t) const;
+  y_iterator View::y_at(x_coord_t,y_coord_t) const;
+};
 
-concept MutableRandomAccess2DImageViewConcept<RandomAccess2DImageViewConcept View>
-  : MutableRandomAccessNDImageViewConcept<View> {};
+concept MutableRandomAccess2DImageViewConcept<RandomAccess2DImageViewConcept View>
+  : MutableRandomAccessNDImageViewConcept<View> {};
 

Image views that GIL typically uses operate on value types that model PixelValueConcept and have some additional requirements:

-
concept ImageViewConcept<RandomAccess2DImageViewConcept View>
-{
-  where PixelValueConcept<value_type>;
-  where PixelIteratorConcept<x_iterator>;
-  where PixelIteratorConcept<y_iterator>;
-  where x_coord_t == y_coord_t;
+
concept ImageViewConcept<RandomAccess2DImageViewConcept View>
+{
+  where PixelValueConcept<value_type>;
+  where PixelIteratorConcept<x_iterator>;
+  where PixelIteratorConcept<y_iterator>;
+  where x_coord_t == y_coord_t;
 
-  typename coord_t = x_coord_t;
+  typename coord_t = x_coord_t;
 
-  std::size_t View::num_channels() const;
-};
+  std::size_t View::num_channels() const;
+};
 
 
-concept MutableImageViewConcept<ImageViewConcept View>
-  : MutableRandomAccess2DImageViewConcept<View>
-{};
+concept MutableImageViewConcept<ImageViewConcept View>
+  : MutableRandomAccess2DImageViewConcept<View>
+{};
 

Two image views are compatible if they have compatible pixels and the same number of dimensions:

-
concept ViewsCompatibleConcept<ImageViewConcept V1, ImageViewConcept V2>
-{
-  where PixelsCompatibleConcept<V1::value_type, V2::value_type>;
-  where V1::num_dimensions == V2::num_dimensions;
-};
+
concept ViewsCompatibleConcept<ImageViewConcept V1, ImageViewConcept V2>
+{
+  where PixelsCompatibleConcept<V1::value_type, V2::value_type>;
+  where V1::num_dimensions == V2::num_dimensions;
+};
 

Compatible views must also have the same dimensions (i.e. the same width and @@ -233,125 +232,125 @@ compatible.

-

Models

+

Models

GIL provides a model for ImageViewConcept called image_view. It is templated over a model of PixelLocatorConcept. (If instantiated with a model of MutablePixelLocatorConcept, it models -MutableImageViewConcept). Synopsis:

+MutableImageViewConcept.) Synopsis:

// Locator models PixelLocatorConcept, could be MutablePixelLocatorConcept
-template <typename Locator>
-class image_view
-{
-public:
-  typedef Locator xy_locator;
-  typedef iterator_from_2d<Locator> iterator;
-  ...
-private:
+template <typename Locator>
+class image_view
+{
+public:
+  typedef Locator xy_locator;
+  typedef iterator_from_2d<Locator> iterator;
+  ...
+private:
   xy_locator _pixels;     // 2D pixel locator at the top left corner of the image view range
   point_t    _dimensions; // width and height
-};
+};
 

Image views are lightweight objects. A regular interleaved view is typically -16 bytes long - two integers for the width and height (inside dimensions) one +16 bytes long - two integers for the width and height (inside dimensions), one for the number of bytes between adjacent rows (inside the locator) and one pointer to the beginning of the pixel block.

-

Algorithms

+

Algorithms

GIL provides algorithms constructing views from raw data or other views.

-

Creating Views from Raw Pixels

+

Creating Views from Raw Pixels

Standard image views can be constructed from raw data of any supported color space, bit depth, channel ordering or planar vs. interleaved structure. Interleaved views are constructed using interleaved_view, supplying the image dimensions, number of bytes per row, and a pointer to the first pixel:

// Iterator models pixel iterator (e.g. rgb8_ptr_t or rgb8c_ptr_t)
-template <typename Iterator>
-image_view<...> interleaved_view(ptrdiff_t width, ptrdiff_t height, Iterator pixels, ptrdiff_t rowsize)
+template <typename Iterator>
+image_view<...> interleaved_view(ptrdiff_t width, ptrdiff_t height, Iterator pixels, ptrdiff_t rowsize)
 

Planar views are defined for every color space and take each plane separately. Here is the RGB one:

// Iterator models channel iterator (e.g. bits8* or bits8 const*)
-template <typename Iterator>
-image_view<...> planar_rgb_view(
-    ptrdiff_t width, ptrdiff_t height,
-    IC r, IC g, IC b, ptrdiff_t rowsize);
+template <typename Iterator>
+image_view<...> planar_rgb_view(
+    ptrdiff_t width, ptrdiff_t height,
+    IC r, IC g, IC b, ptrdiff_t rowsize);
 

Note that the supplied pixel/channel iterators could be constant (read-only), in which case the returned view is a constant-value (immutable) view.

-

Creating Image Views from Other Image Views

+

Creating Image Views from Other Image Views

It is possible to construct one image view from another by changing some policy of how image data is interpreted. The result could be a view whose type is derived from the type of the source. GIL uses the following metafunctions to get the derived types:

// Some result view types
-template <typename View>
-struct dynamic_xy_step_type : public dynamic_y_step_type<typename dynamic_x_step_type<View>::type> {};
+template <typename View>
+struct dynamic_xy_step_type : public dynamic_y_step_type<typename dynamic_x_step_type<View>::type> {};
 
-template <typename View>
-struct dynamic_xy_step_transposed_type : public dynamic_xy_step_type<typename transposed_type<View>::type> {};
+template <typename View>
+struct dynamic_xy_step_transposed_type : public dynamic_xy_step_type<typename transposed_type<View>::type> {};
 
 // color and bit depth converted view to match pixel type P
 template <typename SrcView, // Models ImageViewConcept
         typename DstP,    // Models PixelConcept
-        typename ColorConverter=gil::default_color_converter>
-struct color_converted_view_type
-{
+        typename ColorConverter=gil::default_color_converter>
+struct color_converted_view_type
+{
   typedef ... type;     // image view adaptor with value type DstP, over SrcView
-};
+};
 
 // single-channel view of the N-th channel of a given view
-template <typename SrcView>
-struct nth_channel_view_type
-{
-  typedef ... type;
-};
+template <typename SrcView>
+struct nth_channel_view_type
+{
+  typedef ... type;
+};
 
-

GIL Provides the following view transformations:

+

GIL provides the following view transformations:

// flipped upside-down, left-to-right, transposed view
-template <typename View> typename dynamic_y_step_type<View>::type             flipped_up_down_view(const View& src);
-template <typename View> typename dynamic_x_step_type<View>::type             flipped_left_right_view(const View& src);
-template <typename View> typename dynamic_xy_step_transposed_type<View>::type transposed_view(const View& src);
+template <typename View> typename dynamic_y_step_type<View>::type             flipped_up_down_view(const View& src);
+template <typename View> typename dynamic_x_step_type<View>::type             flipped_left_right_view(const View& src);
+template <typename View> typename dynamic_xy_step_transposed_type<View>::type transposed_view(const View& src);
 
 // rotations
-template <typename View> typename dynamic_xy_step_type<View>::type            rotated180_view(const View& src);
-template <typename View> typename dynamic_xy_step_transposed_type<View>::type rotated90cw_view(const View& src);
-template <typename View> typename dynamic_xy_step_transposed_type<View>::type rotated90ccw_view(const View& src);
+template <typename View> typename dynamic_xy_step_type<View>::type            rotated180_view(const View& src);
+template <typename View> typename dynamic_xy_step_transposed_type<View>::type rotated90cw_view(const View& src);
+template <typename View> typename dynamic_xy_step_transposed_type<View>::type rotated90ccw_view(const View& src);
 
 // view of an axis-aligned rectangular area within an image
-template <typename View> View                                                 subimage_view(const View& src,
-           const View::point_t& top_left, const View::point_t& dimensions);
+template <typename View> View                                                 subimage_view(const View& src,
+           const View::point_t& top_left, const View::point_t& dimensions);
 
 // subsampled view (skipping pixels in X and Y)
-template <typename View> typename dynamic_xy_step_type<View>::type            subsampled_view(const View& src,
-           const View::point_t& step);
+template <typename View> typename dynamic_xy_step_type<View>::type            subsampled_view(const View& src,
+           const View::point_t& step);
 
-template <typename View, typename P>
-color_converted_view_type<View,P>::type                                       color_converted_view(const View& src);
+template <typename View, typename P>
+color_converted_view_type<View,P>::type                                       color_converted_view(const View& src);
 template <typename View, typename P, typename CCV> // with a custom color converter
-color_converted_view_type<View,P,CCV>::type                                   color_converted_view(const View& src);
+color_converted_view_type<View,P,CCV>::type                                   color_converted_view(const View& src);
 
-template <typename View>
-nth_channel_view_type<View>::view_t                                           nth_channel_view(const View& view, int n);
+template <typename View>
+nth_channel_view_type<View>::view_t                                           nth_channel_view(const View& view, int n);
 

The implementations of most of these view factory methods are straightforward. Here is, for example, how the flip views are implemented. The flip upside-down view creates a view whose first pixel is the bottom left pixel of the original view and whose y-step is the negated step of the source.

-
template <typename View>
-typename dynamic_y_step_type<View>::type flipped_up_down_view(const View& src)
-{
-  gil_function_requires<ImageViewConcept<View> >();
-  typedef typename dynamic_y_step_type<View>::type RView;
-  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1));
-}
+
template <typename View>
+typename dynamic_y_step_type<View>::type flipped_up_down_view(const View& src)
+{
+  gil_function_requires<ImageViewConcept<View> >();
+  typedef typename dynamic_y_step_type<View>::type RView;
+  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1));
+}
 

The call to gil_function_requires ensures (at compile time) that the @@ -368,10 +367,10 @@ explanation of the typedefs

rgb16_image_t img(100,100);    // an RGB interleaved image
 
 // grayscale view over the green (index 1) channel of img
-gray16_step_view_t green=nth_channel_view(view(img),1);
+gray16_step_view_t green=nth_channel_view(view(img),1);
 
 // 50x50 view of the green channel of img, upside down and taking every other pixel in X and in Y
-gray16_step_view_t ud_fud=flipped_up_down_view(subsampled_view(green,2,2));
+gray16_step_view_t ud_fud=flipped_up_down_view(subsampled_view(green,2,2));
 

As previously stated, image views are fast, constant-time, shallow views over @@ -379,7 +378,7 @@ the pixel data. The above code does not copy any pixels; it operates on the pixel data allocated when img was created.

-

STL-Style Algorithms on Image Views

+

STL-Style Algorithms on Image Views

Image views provide 1D iteration of their pixels via begin() and end() methods, which makes it possible to use STL algorithms with them. However, using nested loops over X and Y is in many cases more efficient. @@ -387,41 +386,41 @@ The algorithms in this section resemble STL algorithms, but they abstract away the nested loops and take views (as opposed to ranges) as input.

// Equivalents of std::copy and std::uninitialized_copy
 // where ImageViewConcept<V1>, MutableImageViewConcept<V2>, ViewsCompatibleConcept<V1,V2>
-template <typename V1, typename V2>
-void copy_pixels(const V1& src, const V2& dst);
-template <typename V1, typename V2>
-void uninitialized_copy_pixels(const V1& src, const V2& dst);
+template <typename V1, typename V2>
+void copy_pixels(const V1& src, const V2& dst);
+template <typename V1, typename V2>
+void uninitialized_copy_pixels(const V1& src, const V2& dst);
 
 // Equivalents of std::fill and std::uninitialized_fill
 // where MutableImageViewConcept<V>, PixelConcept<Value>, PixelsCompatibleConcept<Value,V::value_type>
-template <typename V, typename Value>
-void fill_pixels(const V& dst, const Value& val);
-template <typename V, typename Value>
-void uninitialized_fill_pixels(const V& dst, const Value& val);
+template <typename V, typename Value>
+void fill_pixels(const V& dst, const Value& val);
+template <typename V, typename Value>
+void uninitialized_fill_pixels(const V& dst, const Value& val);
 
 // Equivalent of std::for_each
 // where ImageViewConcept<V>, boost::UnaryFunctionConcept<F>
 // where PixelsCompatibleConcept<V::reference, F::argument_type>
-template <typename V, typename F>
-F for_each_pixel(const V& view, F fun);
-template <typename V, typename F>
-F for_each_pixel_position(const V& view, F fun);
+template <typename V, typename F>
+F for_each_pixel(const V& view, F fun);
+template <typename V, typename F>
+F for_each_pixel_position(const V& view, F fun);
 
 // Equivalent of std::generate
 // where MutableImageViewConcept<V>, boost::UnaryFunctionConcept<F>
 // where PixelsCompatibleConcept<V::reference, F::argument_type>
-template <typename V, typename F>
-void generate_pixels(const V& dst, F fun);
+template <typename V, typename F>
+void generate_pixels(const V& dst, F fun);
 
 // Equivalent of std::transform with one source
 // where ImageViewConcept<V1>, MutableImageViewConcept<V2>
 // where boost::UnaryFunctionConcept<F>
 // where PixelsCompatibleConcept<V1::const_reference, F::argument_type>
 // where PixelsCompatibleConcept<F::result_type, V2::reference>
-template <typename V1, typename V2, typename F>
-F transform_pixels(const V1& src, const V2& dst, F fun);
-template <typename V1, typename V2, typename F>
-F transform_pixel_positions(const V1& src, const V2& dst, F fun);
+template <typename V1, typename V2, typename F>
+F transform_pixels(const V1& src, const V2& dst, F fun);
+template <typename V1, typename V2, typename F>
+F transform_pixel_positions(const V1& src, const V2& dst, F fun);
 
 // Equivalent of std::transform with two sources
 // where ImageViewConcept<V1>, ImageViewConcept<V2>, MutableImageViewConcept<V3>
@@ -429,23 +428,23 @@ the nested loops and take views (as opposed to ranges) as input.

// where PixelsCompatibleConcept<V1::const_reference, F::first_argument_type> // where PixelsCompatibleConcept<V2::const_reference, F::second_argument_type> // where PixelsCompatibleConcept<F::result_type, V3::reference> -template <typename V1, typename V2, typename V3, typename F> -F transform_pixels(const V1& src1, const V2& src2, const V3& dst, F fun); -template <typename V1, typename V2, typename V3, typename F> -F transform_pixel_positions(const V1& src1, const V2& src2, const V3& dst, F fun); +template <typename V1, typename V2, typename V3, typename F> +F transform_pixels(const V1& src1, const V2& src2, const V3& dst, F fun); +template <typename V1, typename V2, typename V3, typename F> +F transform_pixel_positions(const V1& src1, const V2& src2, const V3& dst, F fun); // Copies a view into another, color converting the pixels if needed, with the default or user-defined color converter // where ImageViewConcept<V1>, MutableImageViewConcept<V2> // V1::value_type must be convertible to V2::value_type. -template <typename V1, typename V2> -void copy_and_convert_pixels(const V1& src, const V2& dst); -template <typename V1, typename V2, typename ColorConverter> -void copy_and_convert_pixels(const V1& src, const V2& dst, ColorConverter ccv); +template <typename V1, typename V2> +void copy_and_convert_pixels(const V1& src, const V2& dst); +template <typename V1, typename V2, typename ColorConverter> +void copy_and_convert_pixels(const V1& src, const V2& dst, ColorConverter ccv); // Equivalent of std::equal // where ImageViewConcept<V1>, ImageViewConcept<V2>, ViewsCompatibleConcept<V1,V2> -template <typename V1, typename V2> -bool equal_pixels(const V1& view1, const V2& view2); +template <typename V1, typename V2> +bool equal_pixels(const V1& view1, const V2& view2);

Algorithms that take multiple views require that they have the same @@ -491,8 +490,8 @@ development and is not optimized for speed

\ No newline at end of file diff --git a/html/design/index.html b/html/design/index.html index dad5f089b..7b2cd6da7 100644 --- a/html/design/index.html +++ b/html/design/index.html @@ -5,7 +5,7 @@ - + Design Guide - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -38,7 +37,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -69,7 +68,7 @@
-

Design Guide

+

Design Guide

The sections listed below are dedicated to describe the design, structure and basic elements of the Generic Image Library (GIL).

@@ -106,8 +105,8 @@ structure and basic elements of the Generic Image Library (GIL).

\ No newline at end of file diff --git a/html/design/metafunctions.html b/html/design/metafunctions.html index 70b844f8f..d2f4600c2 100644 --- a/html/design/metafunctions.html +++ b/html/design/metafunctions.html @@ -5,7 +5,7 @@ - + Metafunctions - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,8 +70,8 @@
-

Metafunctions

- +
-

Overview

+

Overview

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"
+
*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. +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 @@ -104,188 +103,188 @@ to interleaved). _s (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;
-cmyk16sc_planar_ref_t      p(x);  // const reference to a 16-bit signed integral (signed short) planar CMYK pixel x.
-rgb32f_planar_step_ptr_t   ii;    // step iterator to a floating point 32-bit (float) planar RGB pixel.
+cmyk16_pixel_t;            x;     // 16-bit unsigned (unsigned short) CMYK pixel value
+cmyk16sc_planar_ref_t      p(x);  // const reference to a 16-bit signed integral (signed short) planar CMYK pixel x
+rgb32f_planar_step_ptr_t   ii;    // step iterator to a floating point 32-bit (float) planar RGB pixel
 
-

Homogeneous memory-based images

+

Homogeneous memory-based images

GIL provides the metafunctions that return the types of standard homogeneous memory-based GIL constructs given a channel type, a layout, and whether the construct is planar, has a step along the X direction, and is mutable:

-
template <typename ChannelValue, typename Layout, bool IsPlanar=false, bool IsMutable=true>
-struct pixel_reference_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 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 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 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, 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 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 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 ChannelBitSizeVector, typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct bit_aligned_image_type { typedef ... type; };
 
-

Packed and bit-aligned images

+

Packed and bit-aligned images

There are also helper metafunctions to construct packed and bit-aligned images with up to five channels:

-
template <typename BitField, unsigned Size1,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct packed_image1_type { typedef ... type; };
+
template <typename BitField, unsigned Size1,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct packed_image1_type { typedef ... type; };
 
-template <typename BitField, unsigned Size1, unsigned Size2,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct packed_image2_type { typedef ... type; };
+template <typename BitField, unsigned Size1, unsigned Size2,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct packed_image2_type { typedef ... type; };
 
-template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct packed_image3_type { typedef ... type; };
+template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct packed_image3_type { typedef ... type; };
 
-template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct packed_image4_type { typedef ... type; };
+template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct packed_image4_type { typedef ... type; };
 
-template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct packed_image5_type { typedef ... type; };
+template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct packed_image5_type { typedef ... type; };
 
-template <unsigned Size1,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct bit_aligned_image1_type { typedef ... type; };
+template <unsigned Size1,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct bit_aligned_image1_type { typedef ... type; };
 
-template <unsigned Size1, unsigned Size2,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct bit_aligned_image2_type { typedef ... type; };
+template <unsigned Size1, unsigned Size2,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct bit_aligned_image2_type { typedef ... type; };
 
-template <unsigned Size1, unsigned Size2, unsigned Size3,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct bit_aligned_image3_type { typedef ... type; };
+template <unsigned Size1, unsigned Size2, unsigned Size3,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct bit_aligned_image3_type { typedef ... type; };
 
-template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct bit_aligned_image4_type { typedef ... type; };
+template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct bit_aligned_image4_type { typedef ... type; };
 
-template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5,
-        typename Layout, typename Alloc=std::allocator<unsigned char> >
-struct bit_aligned_image5_type { typedef ... type; };
+template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5,
+        typename Layout, typename Alloc=std::allocator<unsigned char> >
+struct bit_aligned_image5_type { typedef ... type; };
 
-

Iterators and views

+

Iterators and views

Here ChannelValue models ChannelValueConcept. We don’t need IsYStep because GIL’s memory-based locator and view already allow the vertical step to be specified dynamically. Iterators and views can be constructed from a pixel type:

-
template <typename Pixel, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true>
-struct iterator_type_from_pixel { typedef ... type; };
+
template <typename Pixel, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true>
+struct iterator_type_from_pixel { typedef ... type; };
 
-template <typename Pixel, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true>
-struct view_type_from_pixel { typedef ... type; };
+template <typename Pixel, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true>
+struct view_type_from_pixel { typedef ... type; };
 

Using a heterogeneous pixel type will result in heterogeneous iterators and views. Types can also be constructed from horizontal iterator:

-
template <typename XIterator>
-struct type_from_x_iterator
-{
-  typedef ... step_iterator_t;
-  typedef ... xy_locator_t;
-  typedef ... view_t;
-};
+
template <typename XIterator>
+struct type_from_x_iterator
+{
+  typedef ... step_iterator_t;
+  typedef ... xy_locator_t;
+  typedef ... view_t;
+};
 
-

Pixel components

+

Pixel components

You can get pixel-related types of any pixel-based GIL constructs (pixels, iterators, locators and views) using the following metafunctions provided by PixelBasedConcept, HomogeneousPixelBasedConcept and metafunctions built on top of them:

-
template <typename T> struct color_space_type { typedef ... type; };
-template <typename T> struct channel_mapping_type { typedef ... type; };
-template <typename T> struct is_planar { typedef ... type; };
+
template <typename T> struct color_space_type { typedef ... type; };
+template <typename T> struct channel_mapping_type { typedef ... type; };
+template <typename T> struct is_planar { typedef ... type; };
 
 // Defined by homogeneous constructs
-template <typename T> struct channel_type { typedef ... type; };
-template <typename T> struct num_channels { typedef ... type; };
+template <typename T> struct channel_type { typedef ... type; };
+template <typename T> struct num_channels { typedef ... type; };
 
-

Deriving and manipulating existing types

+

Deriving and manipulating existing types

There are metafunctions to construct the type of a construct from an existing type by changing one or more of its properties:

-
template <typename PixelReference,
-        typename ChannelValue, typename Layout, typename IsPlanar, typename IsMutable>
-struct derived_pixel_reference_type
-{
+
template <typename PixelReference,
+        typename ChannelValue, typename Layout, typename IsPlanar, typename IsMutable>
+struct derived_pixel_reference_type
+{
   typedef ... type;  // Models PixelConcept
-};
+};
 
-template <typename Iterator,
-        typename ChannelValue, typename Layout, typename IsPlanar, typename IsStep, typename IsMutable>
-struct derived_iterator_type
-{
+template <typename Iterator,
+        typename ChannelValue, typename Layout, typename IsPlanar, typename IsStep, typename IsMutable>
+struct derived_iterator_type
+{
   typedef ... type;  // Models PixelIteratorConcept
-};
+};
 
-template <typename View,
-        typename ChannelValue, typename Layout, typename IsPlanar, typename IsXStep, typename IsMutable>
-struct derived_view_type
-{
+template <typename View,
+        typename ChannelValue, typename Layout, typename IsPlanar, typename IsXStep, typename IsMutable>
+struct derived_view_type
+{
   typedef ... type;  // Models ImageViewConcept
-};
+};
 
-template <typename Image,
-        typename ChannelValue, typename Layout, typename IsPlanar>
-struct derived_image_type
-{
+template <typename Image,
+        typename ChannelValue, typename Layout, typename IsPlanar>
+struct derived_image_type
+{
   typedef ... type;  // Models ImageConcept
-};
+};
 

You can replace one or more of its properties and use boost::use_default for the rest. In this case IsPlanar, IsStep and IsMutable are MPL boolean constants. For example, here is how to create the type of a view just like View, but being grayscale and planar:

-
using VT = typename derived_view_type<View, boost::use_default, gray_t, mp11::mp_true>::type;
+
using VT = typename derived_view_type<View, boost::use_default, gray_t, mp11::mp_true>::type;
 
-

Type traits

+

Type traits

These are metafunctions, some of which return integral types which can be evaluated like this:

-
static_assert(is_planar<rgb8_planar_view_t>::value == true, "");
+
static_assert(is_planar<rgb8_planar_view_t>::value == true, "");
 

GIL also supports type analysis metafunctions of the form:

-
[pixel_reference/iterator/locator/view/image] + "_is_" + [basic/mutable/step]
+
[pixel_reference/iterator/locator/view/image] + "_is_" + [basic/mutable/step]
 

For example:

-
if (view_is_mutable<View>::value)
-{
- ...
-}
+
if (view_is_mutable<View>::value)
+{
+ ...
+}
 

A basic GIL construct is a memory-based construct that uses the built-in GIL @@ -306,8 +305,8 @@ is basic, but a color converted view or a virtual view is not.

\ No newline at end of file diff --git a/html/design/pixel.html b/html/design/pixel.html index 40e0fc995..5bb21f913 100644 --- a/html/design/pixel.html +++ b/html/design/pixel.html @@ -5,7 +5,7 @@ - + Pixel - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,16 +70,16 @@
-

Pixel

- +
-

Overview

+

Overview

A pixel is a set of channels defining the color at a given point in an image. Conceptually, a pixel is little more than a color base whose elements model ChannelConcept. All properties of pixels inherit @@ -99,72 +98,72 @@ compatible pixels.

iterators, locators, views and images) must provide metafunctions to access their color space, channel mapping, number of channels, and (for homogeneous pixels) the channel type:

-
concept PixelBasedConcept<typename T>
-{
-  typename color_space_type<T>;
-      where Metafunction<color_space_type<T> >;
-      where ColorSpaceConcept<color_space_type<T>::type>;
-  typename channel_mapping_type<T>;
-      where Metafunction<channel_mapping_type<T> >;
-      where ChannelMappingConcept<channel_mapping_type<T>::type>;
-  typename is_planar<T>;
-      where Metafunction<is_planar<T> >;
-      where SameType<is_planar<T>::type, bool>;
-};
+
concept PixelBasedConcept<typename T>
+{
+  typename color_space_type<T>;
+      where Metafunction<color_space_type<T> >;
+      where ColorSpaceConcept<color_space_type<T>::type>;
+  typename channel_mapping_type<T>;
+      where Metafunction<channel_mapping_type<T> >;
+      where ChannelMappingConcept<channel_mapping_type<T>::type>;
+  typename is_planar<T>;
+      where Metafunction<is_planar<T> >;
+      where SameType<is_planar<T>::type, bool>;
+};
 
-concept HomogeneousPixelBasedConcept<PixelBasedConcept T>
-{
-  typename channel_type<T>;
-      where Metafunction<channel_type<T> >;
-      where ChannelConcept<channel_type<T>::type>;
-};
+concept HomogeneousPixelBasedConcept<PixelBasedConcept T>
+{
+  typename channel_type<T>;
+      where Metafunction<channel_type<T> >;
+      where ChannelConcept<channel_type<T>::type>;
+};
 

Pixels model the following concepts:

-
concept PixelConcept<typename P> : ColorBaseConcept<P>, PixelBasedConcept<P>
-{
-  where is_pixel<P>::value==true;
+
concept PixelConcept<typename P> : ColorBaseConcept<P>, PixelBasedConcept<P>
+{
+  where is_pixel<P>::value==true;
   // where for each K [0..size<P>::value-1]:
   //      ChannelConcept<kth_element_type<K> >;
 
-  typename value_type;       where PixelValueConcept<value_type>;
-  typename reference;        where PixelConcept<reference>;
-  typename const_reference;  where PixelConcept<const_reference>;
-  static const bool P::is_mutable;
+  typename value_type;       where PixelValueConcept<value_type>;
+  typename reference;        where PixelConcept<reference>;
+  typename const_reference;  where PixelConcept<const_reference>;
+  static const bool P::is_mutable;
 
-  template <PixelConcept P2> where { PixelConcept<P,P2> }
-      P::P(P2);
-  template <PixelConcept P2> where { PixelConcept<P,P2> }
-      bool operator==(const P&, const P2&);
-  template <PixelConcept P2> where { PixelConcept<P,P2> }
-      bool operator!=(const P&, const P2&);
-};
+  template <PixelConcept P2> where { PixelConcept<P,P2> }
+      P::P(P2);
+  template <PixelConcept P2> where { PixelConcept<P,P2> }
+      bool operator==(const P&, const P2&);
+  template <PixelConcept P2> where { PixelConcept<P,P2> }
+      bool operator!=(const P&, const P2&);
+};
 
-concept MutablePixelConcept<typename P> : PixelConcept<P>, MutableColorBaseConcept<P>
-{
-  where is_mutable==true;
-};
+concept MutablePixelConcept<typename P> : PixelConcept<P>, MutableColorBaseConcept<P>
+{
+  where is_mutable==true;
+};
 
-concept HomogeneousPixelConcept<PixelConcept P> : HomogeneousColorBaseConcept<P>, HomogeneousPixelBasedConcept<P>
-{
-  P::template element_const_reference_type<P>::type operator[](P p, std::size_t i) const { return dynamic_at_c(P,i); }
-};
+concept HomogeneousPixelConcept<PixelConcept P> : HomogeneousColorBaseConcept<P>, HomogeneousPixelBasedConcept<P>
+{
+  P::template element_const_reference_type<P>::type operator[](P p, std::size_t i) const { return dynamic_at_c(P,i); }
+};
 
-concept MutableHomogeneousPixelConcept<MutablePixelConcept P> : MutableHomogeneousColorBaseConcept<P>
-{
-  P::template element_reference_type<P>::type operator[](P p, std::size_t i) { return dynamic_at_c(p,i); }
-};
+concept MutableHomogeneousPixelConcept<MutablePixelConcept P> : MutableHomogeneousColorBaseConcept<P>
+{
+  P::template element_reference_type<P>::type operator[](P p, std::size_t i) { return dynamic_at_c(p,i); }
+};
 
-concept PixelValueConcept<typename P> : PixelConcept<P>, Regular<P>
-{
-  where SameType<value_type,P>;
-};
+concept PixelValueConcept<typename P> : PixelConcept<P>, Regular<P>
+{
+  where SameType<value_type,P>;
+};
 
-concept PixelsCompatibleConcept<PixelConcept P1, PixelConcept P2> : ColorBasesCompatibleConcept<P1,P2>
-{
+concept PixelsCompatibleConcept<PixelConcept P1, PixelConcept P2> : ColorBasesCompatibleConcept<P1,P2>
+{
   // where for each K [0..size<P1>::value):
   //    ChannelsCompatibleConcept<kth_semantic_element_type<P1,K>::type, kth_semantic_element_type<P2,K>::type>;
-};
+};
 

A pixel is convertible to a second pixel if it is possible to @@ -172,11 +171,11 @@ approximate its color in the form of the second pixel. Conversion is an explicit, non-symmetric and often lossy operation (due to both channel and color space approximation). Convertibility requires modeling the following concept:

-
template <PixelConcept SrcPixel, MutablePixelConcept DstPixel>
-concept PixelConvertibleConcept
-{
-  void color_convert(const SrcPixel&, DstPixel&);
-};
+
template <PixelConcept SrcPixel, MutablePixelConcept DstPixel>
+concept PixelConvertibleConcept
+{
+  void color_convert(const SrcPixel&, DstPixel&);
+};
 

The distinction between PixelConcept and PixelValueConcept is @@ -198,16 +197,16 @@ both, but only pixel values model the latter.

-

Models

+

Models

The most commonly used pixel is a homogeneous pixel whose values are together in memory. For this purpose GIL provides the struct pixel, templated over the channel value and layout:

// models HomogeneousPixelValueConcept
-template <typename ChannelValue, typename Layout> struct pixel;
+template <typename ChannelValue, typename Layout> struct pixel;
 
 // Those typedefs are already provided by GIL
-typedef pixel<bits8, rgb_layout_t> rgb8_pixel_t;
-typedef pixel<bits8, bgr_layout_t> bgr8_pixel_t;
+typedef pixel<bits8, rgb_layout_t> rgb8_pixel_t;
+typedef pixel<bits8, bgr_layout_t> bgr8_pixel_t;
 
 bgr8_pixel_t bgr8(255,0,0);     // pixels can be initialized with the channels directly
 rgb8_pixel_t rgb8(bgr8);        // compatible pixels can also be copy-constructed
@@ -216,8 +215,8 @@ together in memory. For this purpose GIL provides the struct
 assert(rgb8 == bgr8);   // assignment and equality operate on the semantic channels
 
 // The first physical channels of the two pixels are different
-assert(at_c<0>(rgb8) != at_c<0>(bgr8));
-assert(dynamic_at_c(bgr8,0) != dynamic_at_c(rgb8,0));
+assert(at_c<0>(rgb8) != at_c<0>(bgr8));
+assert(dynamic_at_c(bgr8,0) != dynamic_at_c(rgb8,0));
 assert(rgb8[0] != bgr8[0]); // same as above (but operator[] is defined for pixels only)
 
@@ -226,11 +225,11 @@ same value type (pi proxy class containing references to each of the channels. This is implemented with the struct planar_pixel_reference:

// models HomogeneousPixel
-template <typename ChannelReference, typename ColorSpace> struct planar_pixel_reference;
+template <typename ChannelReference, typename ColorSpace> struct planar_pixel_reference;
 
 // Define the type of a mutable and read-only reference. (These typedefs are already provided by GIL)
-typedef planar_pixel_reference<      bits8&,rgb_t> rgb8_planar_ref_t;
-typedef planar_pixel_reference<const bits8&,rgb_t> rgb8c_planar_ref_t;
+typedef planar_pixel_reference<      bits8&,rgb_t> rgb8_planar_ref_t;
+typedef planar_pixel_reference<const bits8&,rgb_t> rgb8c_planar_ref_t;
 

Note that, unlike the pixel struct, planar pixel references are templated @@ -242,18 +241,18 @@ pixel in ‘5-5-6’ format is a 16-bit pixel whose red, green and blue channels occupy bits [0..4],[5..9] and [10..15] respectively. GIL provides a model for such packed pixel formats:

// define an rgb565 pixel
-typedef packed_pixel_type<uint16_t, mp11::mp_list_c<unsigned,5,6,5>, rgb_layout_t>::type rgb565_pixel_t;
+typedef packed_pixel_type<uint16_t, mp11::mp_list_c<unsigned,5,6,5>, rgb_layout_t>::type rgb565_pixel_t;
 
-function_requires<PixelValueConcept<rgb565_pixel_t> >();
-static_assert(sizeof(rgb565_pixel_t) == 2, "");
+function_requires<PixelValueConcept<rgb565_pixel_t> >();
+static_assert(sizeof(rgb565_pixel_t) == 2, "");
 
 // define a bgr556 pixel
-typedef packed_pixel_type<uint16_t, mp11::mp_list_c<unsigned,5,6,5>, bgr_layout_t>::type bgr556_pixel_t;
+typedef packed_pixel_type<uint16_t, mp11::mp_list_c<unsigned,5,6,5>, bgr_layout_t>::type bgr556_pixel_t;
 
-function_requires<PixelValueConcept<bgr556_pixel_t> >();
+function_requires<PixelValueConcept<bgr556_pixel_t> >();
 
 // rgb565 is compatible with bgr556.
-function_requires<PixelsCompatibleConcept<rgb565_pixel_t,bgr556_pixel_t> >();
+function_requires<PixelsCompatibleConcept<rgb565_pixel_t,bgr556_pixel_t> >();
 

In some cases, the pixel itself may not be byte aligned. For example, @@ -268,52 +267,52 @@ and iterator class (bit_aligned_pixel_iterator). The value type of bit-aligned pixels is a packed_pixel. Here is how to use bit_aligned pixels and pixel iterators:

// Mutable reference to a BGR232 pixel
-typedef const bit_aligned_pixel_reference<unsigned char, mp11::mp_list_c<unsigned,2,3,2>, bgr_layout_t, true>  bgr232_ref_t;
+typedef const bit_aligned_pixel_reference<unsigned char, mp11::mp_list_c<unsigned,2,3,2>, bgr_layout_t, true>  bgr232_ref_t;
 
 // A mutable iterator over BGR232 pixels
-typedef bit_aligned_pixel_iterator<bgr232_ref_t> bgr232_ptr_t;
+typedef bit_aligned_pixel_iterator<bgr232_ref_t> bgr232_ptr_t;
 
 // BGR232 pixel value. It is a packed_pixel of size 1 byte. (The last bit is unused)
-typedef std::iterator_traits<bgr232_ptr_t>::value_type bgr232_pixel_t;
-static_assert(sizeof(bgr232_pixel_t) == 1, "");
+typedef std::iterator_traits<bgr232_ptr_t>::value_type bgr232_pixel_t;
+static_assert(sizeof(bgr232_pixel_t) == 1, "");
 
 bgr232_pixel_t red(0,0,3); // = 0RRGGGBB, = 01100000 = 0x60
 
 // a buffer of 7 bytes fits exactly 8 BGR232 pixels.
-unsigned char pix_buffer[7];
-std::fill(pix_buffer,pix_buffer+7,0);
+unsigned char pix_buffer[7];
+std::fill(pix_buffer,pix_buffer+7,0);
 
 // Fill the 8 pixels with red
 bgr232_ptr_t pix_it(&pix_buffer[0],0);  // start at bit 0 of the first pixel
-for (int i=0; i<8; ++i)
-{
-  *pix_it++ = red;
-}
+for (int i=0; i<8; ++i)
+{
+  *pix_it++ = red;
+}
 // Result: 0x60 0x30 0x11 0x0C 0x06 0x83 0xC1
 
-

Algorithms

+

Algorithms

Since pixels model ColorBaseConcept and PixelBasedConcept all algorithms and metafunctions of color bases can work with them as well:

// This is how to access the first semantic channel (red)
-assert(semantic_at_c<0>(rgb8) == semantic_at_c<0>(bgr8));
+assert(semantic_at_c<0>(rgb8) == semantic_at_c<0>(bgr8));
 
 // This is how to access the red channel by name
-assert(get_color<red_t>(rgb8) == get_color<red_t>(bgr8));
+assert(get_color<red_t>(rgb8) == get_color<red_t>(bgr8));
 
 // This is another way of doing it (some compilers don't like the first one)
-assert(get_color(rgb8,red_t()) == get_color(bgr8,red_t()));
+assert(get_color(rgb8,red_t()) == get_color(bgr8,red_t()));
 
 // This is how to use the PixelBasedConcept metafunctions
-BOOST_MPL_ASSERT(num_channels<rgb8_pixel_t>::value == 3);
-BOOST_MPL_ASSERT((is_same<channel_type<rgb8_pixel_t>::type, bits8>));
-BOOST_MPL_ASSERT((is_same<color_space_type<bgr8_pixel_t>::type, rgb_t> ));
-BOOST_MPL_ASSERT((is_same<channel_mapping_type<bgr8_pixel_t>::type, mp11::mp_list_c<int,2,1,0> > ));
+BOOST_MPL_ASSERT(num_channels<rgb8_pixel_t>::value == 3);
+BOOST_MPL_ASSERT((is_same<channel_type<rgb8_pixel_t>::type, bits8>));
+BOOST_MPL_ASSERT((is_same<color_space_type<bgr8_pixel_t>::type, rgb_t> ));
+BOOST_MPL_ASSERT((is_same<channel_mapping_type<bgr8_pixel_t>::type, mp11::mp_list_c<int,2,1,0> > ));
 
 // Pixels contain just the three channels and nothing extra
-BOOST_MPL_ASSERT(sizeof(rgb8_pixel_t)==3);
+BOOST_MPL_ASSERT(sizeof(rgb8_pixel_t)==3);
 
 rgb8_planar_ref_t ref(bgr8);    // copy construction is allowed from a compatible mutable pixel type
 
@@ -321,21 +320,21 @@ algorithms and metafunctions of color bases can work with them as well:

assert(get_color<red_t>(bgr8)==10); // references modify the value they are bound to // Create a zero packed pixel and a full regular unpacked pixel. -rgb565_pixel_t r565; -rgb8_pixel_t rgb_full(255,255,255); +rgb565_pixel_t r565; +rgb8_pixel_t rgb_full(255,255,255); // Convert all channels of the unpacked pixel to the packed one & assert the packed one is full -get_color(r565,red_t()) = channel_convert<rgb565_channel0_t>(get_color(rgb_full,red_t())); -get_color(r565,green_t()) = channel_convert<rgb565_channel1_t>(get_color(rgb_full,green_t())); -get_color(r565,blue_t()) = channel_convert<rgb565_channel2_t>(get_color(rgb_full,blue_t())); -assert(r565 == rgb565_pixel_t((uint16_t)65535)); +get_color(r565,red_t()) = channel_convert<rgb565_channel0_t>(get_color(rgb_full,red_t())); +get_color(r565,green_t()) = channel_convert<rgb565_channel1_t>(get_color(rgb_full,green_t())); +get_color(r565,blue_t()) = channel_convert<rgb565_channel2_t>(get_color(rgb_full,blue_t())); +assert(r565 == rgb565_pixel_t((uint16_t)65535));

GIL also provides the color_convert algorithm to convert between pixels of different color spaces and channel types:

-
rgb8_pixel_t red_in_rgb8(255,0,0);
-cmyk16_pixel_t red_in_cmyk16;
-color_convert(red_in_rgb8,red_in_cmyk16);
+
rgb8_pixel_t red_in_rgb8(255,0,0);
+cmyk16_pixel_t red_in_cmyk16;
+color_convert(red_in_rgb8,red_in_cmyk16);
 
@@ -352,8 +351,8 @@ different color spaces and channel types:

\ No newline at end of file diff --git a/html/design/pixel_iterator.html b/html/design/pixel_iterator.html index 9bf978228..6e1e3055b 100644 --- a/html/design/pixel_iterator.html +++ b/html/design/pixel_iterator.html @@ -5,7 +5,7 @@ - + Pixel Iterator - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,8 +70,8 @@
-

Pixel Iterator

-
+

Pixel Iterator

+
+
-

Overview

+

Overview

Pixel iterators are random traversal iterators whose value_type models PixelValueConcept.

-

Fundamental Iterator

+

Fundamental Iterator

Pixel iterators provide metafunctions to determine whether they are mutable (i.e. whether they allow for modifying the pixel they refer to), to get the immutable (read-only) type of the iterator, and to determine whether they are plain iterators or adaptors over another pixel iterator:

-
concept PixelIteratorConcept<RandomAccessTraversalIteratorConcept Iterator>
-    : PixelBasedConcept<Iterator>
-{
-  where PixelValueConcept<value_type>;
-  typename const_iterator_type<It>::type;
-      where PixelIteratorConcept<const_iterator_type<It>::type>;
-  static const bool  iterator_is_mutable<It>::value;
+
concept PixelIteratorConcept<RandomAccessTraversalIteratorConcept Iterator>
+    : PixelBasedConcept<Iterator>
+{
+  where PixelValueConcept<value_type>;
+  typename const_iterator_type<It>::type;
+      where PixelIteratorConcept<const_iterator_type<It>::type>;
+  static const bool  iterator_is_mutable<It>::value;
   static const bool  is_iterator_adaptor<It>::value;   // is it an iterator adaptor
-};
+};
 
-template <typename Iterator>
-concept MutablePixelIteratorConcept : PixelIteratorConcept<Iterator>, MutableRandomAccessIteratorConcept<Iterator> {};
+template <typename Iterator>
+concept MutablePixelIteratorConcept : PixelIteratorConcept<Iterator>, MutableRandomAccessIteratorConcept<Iterator> {};
 
@@ -130,7 +129,7 @@ plain iterators or adaptors over another pixel iterator:

-

Models

+

Models

A built-in pointer to pixel, pixel<ChannelValue,Layout>*, is GIL model for pixel iterator over interleaved homogeneous pixels. Similarly, packed_pixel<PixelData,ChannelRefVec,Layout>* is GIL model for an iterator @@ -139,12 +138,12 @@ over interleaved packed pixels.

planar_pixel_iterator, templated over a channel iterator and color space. Here is how the standard mutable and read-only planar RGB iterators over unsigned char are defined:

-
template <typename ChannelPtr, typename ColorSpace>
-struct planar_pixel_iterator;
+
template <typename ChannelPtr, typename ColorSpace>
+struct planar_pixel_iterator;
 
 // GIL provided typedefs
-typedef planar_pixel_iterator<const bits8*, rgb_t> rgb8c_planar_ptr_t;
-typedef planar_pixel_iterator<      bits8*, rgb_t> rgb8_planar_ptr_t;
+typedef planar_pixel_iterator<const bits8*, rgb_t> rgb8c_planar_ptr_t;
+typedef planar_pixel_iterator<      bits8*, rgb_t> rgb8_planar_ptr_t;
 

planar_pixel_iterator also models HomogeneousColorBaseConcept (it @@ -152,19 +151,19 @@ subclasses from hom algorithms apply to it. The element type of its color base is a channel iterator. For example, GIL implements operator++ of planar iterators approximately like this:

-
template <typename T>
-struct inc : public std::unary_function<T,T>
-{
-  T operator()(T x) const { return ++x; }
-};
+
template <typename T>
+struct inc : public std::unary_function<T,T>
+{
+  T operator()(T x) const { return ++x; }
+};
 
-template <typename ChannelPtr, typename ColorSpace>
-planar_pixel_iterator<ChannelPtr,ColorSpace>&
-planar_pixel_iterator<ChannelPtr,ColorSpace>::operator++()
-{
-  static_transform(*this,*this,inc<ChannelPtr>());
-  return *this;
-}
+template <typename ChannelPtr, typename ColorSpace>
+planar_pixel_iterator<ChannelPtr,ColorSpace>&
+planar_pixel_iterator<ChannelPtr,ColorSpace>::operator++()
+{
+  static_transform(*this,*this,inc<ChannelPtr>());
+  return *this;
+}
 

Since static_transform uses compile-time recursion, incrementing an @@ -175,29 +174,29 @@ byte and the bit offset.

-

Iterator Adaptor

+

Iterator Adaptor

Iterator adaptor is an iterator that wraps around another iterator. Its is_iterator_adaptor metafunction must evaluate to true, and it needs to provide a member method to return the base iterator, a metafunction to get its type, and a metafunction to rebind to another base iterator:

-
concept IteratorAdaptorConcept<RandomAccessTraversalIteratorConcept Iterator>
-{
-  where SameType<is_iterator_adaptor<Iterator>::type, mp11::mp_true>;
+
concept IteratorAdaptorConcept<RandomAccessTraversalIteratorConcept Iterator>
+{
+  where SameType<is_iterator_adaptor<Iterator>::type, mp11::mp_true>;
 
-  typename iterator_adaptor_get_base<Iterator>;
-      where Metafunction<iterator_adaptor_get_base<Iterator> >;
-      where boost_concepts::ForwardTraversalConcept<iterator_adaptor_get_base<Iterator>::type>;
+  typename iterator_adaptor_get_base<Iterator>;
+      where Metafunction<iterator_adaptor_get_base<Iterator> >;
+      where boost_concepts::ForwardTraversalConcept<iterator_adaptor_get_base<Iterator>::type>;
 
-  typename another_iterator;
-  typename iterator_adaptor_rebind<Iterator,another_iterator>::type;
-      where boost_concepts::ForwardTraversalConcept<another_iterator>;
-      where IteratorAdaptorConcept<iterator_adaptor_rebind<Iterator,another_iterator>::type>;
+  typename another_iterator;
+  typename iterator_adaptor_rebind<Iterator,another_iterator>::type;
+      where boost_concepts::ForwardTraversalConcept<another_iterator>;
+      where IteratorAdaptorConcept<iterator_adaptor_rebind<Iterator,another_iterator>::type>;
 
-  const iterator_adaptor_get_base<Iterator>::type& Iterator::base() const;
-};
+  const iterator_adaptor_get_base<Iterator>::type& Iterator::base() const;
+};
 
-template <boost_concepts::Mutable_ForwardIteratorConcept Iterator>
-concept MutableIteratorAdaptorConcept : IteratorAdaptorConcept<Iterator> {};
+template <boost_concepts::Mutable_ForwardIteratorConcept Iterator>
+concept MutableIteratorAdaptorConcept : IteratorAdaptorConcept<Iterator> {};
 
@@ -208,7 +207,7 @@ type, and a metafunction to rebind to another base iterator:

-

Models

+

Models

GIL provides several models of IteratorAdaptorConcept:

  • memory_based_step_iterator<Iterator>: An iterator adaptor that changes @@ -224,28 +223,28 @@ model PixelDerefere

-

Pixel Dereference Adaptor

+

Pixel Dereference Adaptor

Pixel dereference adaptor is a unary function that can be applied upon dereferencing a pixel iterator. Its argument type could be anything (usually a PixelConcept) and the result type must be convertible to PixelConcept:

-
template <boost::UnaryFunctionConcept D>
-concept PixelDereferenceAdaptorConcept:
-    DefaultConstructibleConcept<D>,
-    CopyConstructibleConcept<D>,
-    AssignableConcept<D>
-{
-  typename const_t;         where PixelDereferenceAdaptorConcept<const_t>;
-  typename value_type;      where PixelValueConcept<value_type>;
+
template <boost::UnaryFunctionConcept D>
+concept PixelDereferenceAdaptorConcept:
+    DefaultConstructibleConcept<D>,
+    CopyConstructibleConcept<D>,
+    AssignableConcept<D>
+{
+  typename const_t;         where PixelDereferenceAdaptorConcept<const_t>;
+  typename value_type;      where PixelValueConcept<value_type>;
   typename reference;       where PixelConcept<remove_reference<reference>::type>;  // may be mutable
   typename const_reference;   // must not be mutable
-  static const bool D::is_mutable;
+  static const bool D::is_mutable;
 
-  where Convertible<value_type, result_type>;
-};
+  where Convertible<value_type, result_type>;
+};
 
-

Models

+

Models

GIL provides several models of PixelDereferenceAdaptorConcept:

  • color_convert_deref_fn: a function object that performs color conversion

  • @@ -266,7 +265,7 @@ adaptor Fn
-

Step Iterator

+

Step Iterator

Sometimes we want to traverse pixels with a unit step other than the one provided by the fundamental pixel iterators. Examples where this would be useful:

@@ -279,14 +278,14 @@ useful:

Step iterators are forward traversal iterators that allow changing the step between adjacent values:

-
concept StepIteratorConcept<boost_concepts::ForwardTraversalConcept Iterator>
-{
-  template <Integral D> void Iterator::set_step(D step);
-};
+
concept StepIteratorConcept<boost_concepts::ForwardTraversalConcept Iterator>
+{
+  template <Integral D> void Iterator::set_step(D step);
+};
 
-concept MutableStepIteratorConcept<boost_concepts::Mutable_ForwardIteratorConcept Iterator>
-    : StepIteratorConcept<Iterator>
-{};
+concept MutableStepIteratorConcept<boost_concepts::Mutable_ForwardIteratorConcept Iterator>
+    : StepIteratorConcept<Iterator>
+{};
 

GIL currently provides a step iterator whose value_type models @@ -304,28 +303,28 @@ in memunits away. It must also supply a function that advances an iterator a given distance in memory units. memunit_advanced and memunit_advanced_ref have a default implementation but some iterators may supply a more efficient version:

-
concept MemoryBasedIteratorConcept
-<
-    boost_concepts::RandomAccessTraversalConcept Iterator
->
-{
-  typename byte_to_memunit<Iterator>; where metafunction<byte_to_memunit<Iterator> >;
-  std::ptrdiff_t      memunit_step(const Iterator&);
-  std::ptrdiff_t      memunit_distance(const Iterator& , const Iterator&);
-  void                memunit_advance(Iterator&, std::ptrdiff_t diff);
-  Iterator            memunit_advanced(const Iterator& p, std::ptrdiff_t diff) { Iterator tmp; memunit_advance(tmp,diff); return tmp; }
-  Iterator::reference memunit_advanced_ref(const Iterator& p, std::ptrdiff_t diff) { return *memunit_advanced(p,diff); }
-};
+
concept MemoryBasedIteratorConcept
+<
+    boost_concepts::RandomAccessTraversalConcept Iterator
+>
+{
+  typename byte_to_memunit<Iterator>; where metafunction<byte_to_memunit<Iterator> >;
+  std::ptrdiff_t      memunit_step(const Iterator&);
+  std::ptrdiff_t      memunit_distance(const Iterator& , const Iterator&);
+  void                memunit_advance(Iterator&, std::ptrdiff_t diff);
+  Iterator            memunit_advanced(const Iterator& p, std::ptrdiff_t diff) { Iterator tmp; memunit_advance(tmp,diff); return tmp; }
+  Iterator::reference memunit_advanced_ref(const Iterator& p, std::ptrdiff_t diff) { return *memunit_advanced(p,diff); }
+};
 

It is useful to be able to construct a step iterator over another iterator. More generally, given a type, we want to be able to construct an equivalent type that allows for dynamically specified horizontal step:

-
concept HasDynamicXStepTypeConcept<typename T>
-{
-  typename dynamic_x_step_type<T>;
-      where Metafunction<dynamic_x_step_type<T> >;
-};
+
concept HasDynamicXStepTypeConcept<typename T>
+{
+  typename dynamic_x_step_type<T>;
+      where Metafunction<dynamic_x_step_type<T> >;
+};
 

All models of pixel iterators, locators and image views that GIL provides @@ -340,7 +339,7 @@ support HasDynamicX

-

Models

+

Models

All standard memory-based iterators GIL currently provides model MemoryBasedIteratorConcept. GIL provides the class memory_based_step_iterator which models PixelIteratorConcept, @@ -352,8 +351,8 @@ number of memory units (bytes or bits) to skip for a unit step. It may also be used with a negative number. GIL provides a function to create a step iterator from a base iterator and a step:

// Iterator models MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
-template <typename Iterator>
-typename dynamic_x_step_type<Iterator>::type make_step_iterator(Iterator const& it, std::ptrdiff_t step);
+template <typename Iterator>
+typename dynamic_x_step_type<Iterator>::type make_step_iterator(Iterator const& it, std::ptrdiff_t step);
 

GIL also provides a model of an iterator over a virtual array of pixels, @@ -376,8 +375,8 @@ but not MemoryBased

\ No newline at end of file diff --git a/html/design/pixel_locator.html b/html/design/pixel_locator.html index 4717eb7ec..6fe67f398 100644 --- a/html/design/pixel_locator.html +++ b/html/design/pixel_locator.html @@ -5,7 +5,7 @@ - + Pixel Locator - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

C++ Boost

+ alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,84 +70,84 @@
-

Pixel Locator

- +
-

Overview

+

Overview

A Locator allows for navigation in two or more dimensions. Locators are N-dimensional iterators in spirit, but we use a different name because they don’t satisfy all the requirements of iterators. For example, they don’t supply increment and decrement operators because it is unclear which dimension the operators should advance along. N-dimensional locators model the following concept:

-
concept RandomAccessNDLocatorConcept<Regular Loc>
-{
+
concept RandomAccessNDLocatorConcept<Regular Loc>
+{
   typename value_type;        // value over which the locator navigates
   typename reference;         // result of dereferencing
   typename difference_type; where PointNDConcept<difference_type>; // return value of operator-.
   typename const_t;           // same as Loc, but operating over immutable values
   typename cached_location_t; // type to store relative location (for efficient repeated access)
-  typename point_t  = difference_type;
+  typename point_t  = difference_type;
 
   static const size_t num_dimensions; // dimensionality of the locator
-  where num_dimensions = point_t::num_dimensions;
+  where num_dimensions = point_t::num_dimensions;
 
   // The difference_type and iterator type along each dimension. The iterators may only differ in
   // difference_type. Their value_type must be the same as Loc::value_type
-  template <size_t D> struct axis {
-      typename coord_t = point_t::axis<D>::coord_t;
+  template <size_t D> struct axis {
+      typename coord_t = point_t::axis<D>::coord_t;
       typename iterator; where RandomAccessTraversalConcept<iterator>; // iterator along D-th axis.
-      where iterator::value_type == value_type;
-  };
+      where iterator::value_type == value_type;
+  };
 
   // Defines the type of a locator similar to this type, except it invokes Deref upon dereferencing
-  template <PixelDereferenceAdaptorConcept Deref> struct add_deref {
-      typename type;        where RandomAccessNDLocatorConcept<type>;
-      static type make(const Loc& loc, const Deref& deref);
-  };
+  template <PixelDereferenceAdaptorConcept Deref> struct add_deref {
+      typename type;        where RandomAccessNDLocatorConcept<type>;
+      static type make(const Loc& loc, const Deref& deref);
+  };
 
-  Loc& operator+=(Loc&, const difference_type&);
-  Loc& operator-=(Loc&, const difference_type&);
-  Loc operator+(const Loc&, const difference_type&);
-  Loc operator-(const Loc&, const difference_type&);
+  Loc& operator+=(Loc&, const difference_type&);
+  Loc& operator-=(Loc&, const difference_type&);
+  Loc operator+(const Loc&, const difference_type&);
+  Loc operator-(const Loc&, const difference_type&);
 
-  reference operator*(const Loc&);
-  reference operator[](const Loc&, const difference_type&);
+  reference operator*(const Loc&);
+  reference operator[](const Loc&, const difference_type&);
 
   // Storing relative location for faster repeated access and accessing it
-  cached_location_t Loc::cache_location(const difference_type&) const;
-  reference operator[](const Loc&,const cached_location_t&);
+  cached_location_t Loc::cache_location(const difference_type&) const;
+  reference operator[](const Loc&,const cached_location_t&);
 
   // Accessing iterators along a given dimension at the current location or at a given offset
-  template <size_t D> axis<D>::iterator&       Loc::axis_iterator();
-  template <size_t D> axis<D>::iterator const& Loc::axis_iterator() const;
-  template <size_t D> axis<D>::iterator        Loc::axis_iterator(const difference_type&) const;
-};
+  template <size_t D> axis<D>::iterator&       Loc::axis_iterator();
+  template <size_t D> axis<D>::iterator const& Loc::axis_iterator() const;
+  template <size_t D> axis<D>::iterator        Loc::axis_iterator(const difference_type&) const;
+};
 
-template <typename Loc>
-concept MutableRandomAccessNDLocatorConcept
-    : RandomAccessNDLocatorConcept<Loc>
-{
-  where Mutable<reference>;
-};
+template <typename Loc>
+concept MutableRandomAccessNDLocatorConcept
+    : RandomAccessNDLocatorConcept<Loc>
+{
+  where Mutable<reference>;
+};
 

Two-dimensional locators have additional requirements:

-
concept RandomAccess2DLocatorConcept<RandomAccessNDLocatorConcept Loc>
-{
-  where num_dimensions==2;
-  where Point2DConcept<point_t>;
+
concept RandomAccess2DLocatorConcept<RandomAccessNDLocatorConcept Loc>
+{
+  where num_dimensions==2;
+  where Point2DConcept<point_t>;
 
-  typename x_iterator = axis<0>::iterator;
-  typename y_iterator = axis<1>::iterator;
-  typename x_coord_t  = axis<0>::coord_t;
-  typename y_coord_t  = axis<1>::coord_t;
+  typename x_iterator = axis<0>::iterator;
+  typename y_iterator = axis<1>::iterator;
+  typename x_coord_t  = axis<0>::coord_t;
+  typename y_coord_t  = axis<1>::coord_t;
 
   // Only available to locators that have dynamic step in Y
   //Loc::Loc(const Loc& loc, y_coord_t);
@@ -156,38 +155,38 @@ N-dimensional locators model the following concept:

// Only available to locators that have dynamic step in X and Y //Loc::Loc(const Loc& loc, x_coord_t, y_coord_t, bool transposed=false); - x_iterator& Loc::x(); - x_iterator const& Loc::x() const; - y_iterator& Loc::y(); - y_iterator const& Loc::y() const; + x_iterator& Loc::x(); + x_iterator const& Loc::x() const; + y_iterator& Loc::y(); + y_iterator const& Loc::y() const; - x_iterator Loc::x_at(const difference_type&) const; - y_iterator Loc::y_at(const difference_type&) const; - Loc Loc::xy_at(const difference_type&) const; + x_iterator Loc::x_at(const difference_type&) const; + y_iterator Loc::y_at(const difference_type&) const; + Loc Loc::xy_at(const difference_type&) const; // x/y versions of all methods that can take difference type - x_iterator Loc::x_at(x_coord_t, y_coord_t) const; - y_iterator Loc::y_at(x_coord_t, y_coord_t) const; - Loc Loc::xy_at(x_coord_t, y_coord_t) const; - reference operator()(const Loc&, x_coord_t, y_coord_t); - cached_location_t Loc::cache_location(x_coord_t, y_coord_t) const; + x_iterator Loc::x_at(x_coord_t, y_coord_t) const; + y_iterator Loc::y_at(x_coord_t, y_coord_t) const; + Loc Loc::xy_at(x_coord_t, y_coord_t) const; + reference operator()(const Loc&, x_coord_t, y_coord_t); + cached_location_t Loc::cache_location(x_coord_t, y_coord_t) const; - bool Loc::is_1d_traversable(x_coord_t width) const; - y_coord_t Loc::y_distance_to(const Loc& loc2, x_coord_t x_diff) const; -}; + bool Loc::is_1d_traversable(x_coord_t width) const; + y_coord_t Loc::y_distance_to(const Loc& loc2, x_coord_t x_diff) const; +}; -concept MutableRandomAccess2DLocatorConcept<RandomAccess2DLocatorConcept Loc> - : MutableRandomAccessNDLocatorConcept<Loc> {}; +concept MutableRandomAccess2DLocatorConcept<RandomAccess2DLocatorConcept Loc> + : MutableRandomAccessNDLocatorConcept<Loc> {};

2D locators can have a dynamic step not just horizontally, but vertically. This gives rise to the Y equivalent of HasDynamicXStepTypeConcept:

-
concept HasDynamicYStepTypeConcept<typename T>
-{
-  typename dynamic_y_step_type<T>;
-      where Metafunction<dynamic_y_step_type<T> >;
-};
+
concept HasDynamicYStepTypeConcept<typename T>
+{
+  typename dynamic_y_step_type<T>;
+      where Metafunction<dynamic_y_step_type<T> >;
+};
 

All locators and image views that GIL provides model @@ -195,27 +194,27 @@ vertically. This gives rise to the Y equivalent of

Sometimes it is necessary to swap the meaning of X and Y for a given locator or image view type (for example, GIL provides a function to transpose an image view). Such locators and views must be transposable:

-
concept HasTransposedTypeConcept<typename T>
-{
-  typename transposed_type<T>;
-      where Metafunction<transposed_type<T> >;
-};
+
concept HasTransposedTypeConcept<typename T>
+{
+  typename transposed_type<T>;
+      where Metafunction<transposed_type<T> >;
+};
 

All GIL provided locators and views model HasTransposedTypeConcept.

The locators GIL uses operate over models of PixelConcept and their x and y dimension types are the same. They model the following concept:

-
concept PixelLocatorConcept<RandomAccess2DLocatorConcept Loc>
-{
-  where PixelValueConcept<value_type>;
-  where PixelIteratorConcept<x_iterator>;
-  where PixelIteratorConcept<y_iterator>;
-  where x_coord_t == y_coord_t;
+
concept PixelLocatorConcept<RandomAccess2DLocatorConcept Loc>
+{
+  where PixelValueConcept<value_type>;
+  where PixelIteratorConcept<x_iterator>;
+  where PixelIteratorConcept<y_iterator>;
+  where x_coord_t == y_coord_t;
 
-  typename coord_t = x_coord_t;
-};
+  typename coord_t = x_coord_t;
+};
 
-concept MutablePixelLocatorConcept<PixelLocatorConcept Loc> : MutableRandomAccess2DLocatorConcept<Loc> {};
+concept MutablePixelLocatorConcept<PixelLocatorConcept Loc> : MutableRandomAccess2DLocatorConcept<Loc> {};
 
@@ -233,16 +232,16 @@ y dimension types are the same. They model the following concept:

-

Models

+

Models

GIL provides two models of PixelLocatorConcept - a memory-based locator, memory_based_2d_locator and a virtual locator virtual_2d_locator.

The memory_based_2d_locator is a locator over planar or interleaved images that have their pixels in memory. It takes a model of StepIteratorConcept over pixels as a template parameter. (When instantiated with a model of -MutableStepIteratorConcept, it models MutablePixelLocatorConcept).

+MutableStepIteratorConcept, it models MutablePixelLocatorConcept.)

// StepIterator models StepIteratorConcept, MemoryBasedIteratorConcept
-template <typename StepIterator>
-class memory_based_2d_locator;
+template <typename StepIterator>
+class memory_based_2d_locator;
 

The step of StepIterator must be the number of memory units (bytes or @@ -259,7 +258,7 @@ choices:

  • pixel<T,C>* - for interleaved images

  • planar_pixel_iterator<T*,C> - for planar images

  • memory_based_step_iterator<pixel<T,C>*> - for interleaved images with -non-standard step)

  • +non-standard step

  • memory_based_step_iterator<planar_pixel_iterator<T*,C> > - for planar images with non-standard step

  • @@ -278,7 +277,7 @@ a 2D pixel locator, as the diagram indicates:

    The memory_based_2d_locator also offers cached_location_t as mechanism to store relative locations for optimized repeated access of neighborhood pixels. The 2D coordinates of relative locations are cached as 1-dimensional -raw byte offsets. This provides efficient access if a neighboring locations +raw byte offsets. This provides efficient access if neighboring locations relative to a given locator are read or written frequently (e.g. in filters).

    The virtual_2d_locator is a locator that is instantiated with a function object invoked upon dereferencing a pixel. It returns the value of a pixel @@ -292,7 +291,7 @@ they need to provide other models of

    Here is some sample code using locators:

    loc=img.xy_at(10,10);            // start at pixel (x=10,y=10)
     above=loc.cache_location(0,-1);  // remember relative locations of neighbors above and below
    -below=loc.cache_location(0, 1);
    +below=loc.cache_location(0, 1);
     ++loc.x();                       // move to (11,10)
     loc.y()+=15;                     // move to (11,25)
     loc-=point<std::ptrdiff_t>(1,1);// move to (10,24)
    @@ -312,7 +311,7 @@ In the above example 
    -

    Iterator over 2D image

    +

    Iterator over 2D image

    Sometimes we want to perform the same, location-independent operation over all pixels of an image. In such a case it is useful to represent the pixels as a one-dimensional array. GIL’s iterator_from_2d is a @@ -322,18 +321,18 @@ top-to-bottom. It takes a locator, the width of the image and the current X position. This is sufficient information for it to determine when to do a “carriage return”. Synopsis:

    template <typename Locator>  // Models PixelLocatorConcept
    -class iterator_from_2d
    -{
    -public:
    -  iterator_from_2d(const Locator& loc, int x, int width);
    +class iterator_from_2d
    +{
    +public:
    +  iterator_from_2d(const Locator& loc, int x, int width);
     
       iterator_from_2d& operator++(); // if (++_x<_width) ++_p.x(); else _p+=point_t(-_width,1);
     
    -  ...
    -private:
    -  int _x, _width;
    -  Locator _p;
    -};
    +  ...
    +private:
    +  int _x, _width;
    +  Locator _p;
    +};
     

    Iterating through the pixels in an image using iterator_from_2d is slower @@ -346,7 +345,7 @@ row. For fast operations, such as pixel copy, this second check adds about GIL overrides some STL algorithms, such as std::copy and std::fill, when invoked with iterator_from_2d-s, to go through each row using their base x-iterators, and, if the image has no padding (i.e. -iterator_from_2d::is_1d_traversable() returns true) to simply iterate +iterator_from_2d::is_1d_traversable() returns true), to simply iterate using the x-iterators directly.

    @@ -362,8 +361,8 @@ using the x-iterators directly.

    \ No newline at end of file diff --git a/html/design/point.html b/html/design/point.html index f3383e4f6..aa5597c94 100644 --- a/html/design/point.html +++ b/html/design/point.html @@ -5,7 +5,7 @@ - + Point - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

    C++ Boost

    + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,45 +70,45 @@
    -

    Point

    -
    +

    Point

    +
    +
    -

    Overview

    +

    Overview

    A point defines the location of a pixel inside an image. It can also be used to describe the dimensions of an image. In most general terms, points are N-dimensional and model the following concept:

    -
    concept PointNDConcept<typename T> : Regular<T>
    -{
    +
    concept PointNDConcept<typename T> : Regular<T>
    +{
         // the type of a coordinate along each axis
    -    template <size_t K> struct axis; where Metafunction<axis>;
    +    template <size_t K> struct axis; where Metafunction<axis>;
     
    -    const size_t num_dimensions;
    +    const size_t num_dimensions;
     
         // accessor/modifier of the value of each axis.
    -    template <size_t K> const typename axis<K>::type& T::axis_value() const;
    -    template <size_t K>       typename axis<K>::type& T::axis_value();
    -};
    +    template <size_t K> const typename axis<K>::type& T::axis_value() const;
    +    template <size_t K>       typename axis<K>::type& T::axis_value();
    +};
     

    GIL uses a two-dimensional point, which is a refinement of PointNDConcept in which both dimensions are of the same type:

    -
    concept Point2DConcept<typename T> : PointNDConcept<T>
    -{
    -    where num_dimensions == 2;
    -    where SameType<axis<0>::type, axis<1>::type>;
    +
    concept Point2DConcept<typename T> : PointNDConcept<T>
    +{
    +    where num_dimensions == 2;
    +    where SameType<axis<0>::type, axis<1>::type>;
     
    -    typename value_type = axis<0>::type;
    +    typename value_type = axis<0>::type;
     
    -    const value_type& operator[](const T&, size_t i);
    -          value_type& operator[](      T&, size_t i);
    +    const value_type& operator[](const T&, size_t i);
    +          value_type& operator[](      T&, size_t i);
     
    -    value_type x,y;
    -};
    +    value_type x,y;
    +};
     
    @@ -121,7 +120,7 @@ in which both dimensions are of the same type:

    -

    Models

    +

    Models

    GIL provides a model of Point2DConcept, point<T> where T is the coordinate type.

    @@ -138,8 +137,8 @@ coordinate type.

    \ No newline at end of file diff --git a/html/design/technicalities.html b/html/design/technicalities.html index 5f78c8158..592bf7b0e 100644 --- a/html/design/technicalities.html +++ b/html/design/technicalities.html @@ -5,7 +5,7 @@ - + Technicalities - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

    C++ Boost

    + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,33 +70,33 @@
    -

    Technicalities

    -
    +

    Technicalities

    +
    +
    -

    Creating a reference proxy

    +

    Creating a reference proxy

    Sometimes it is necessary to create a proxy class that represents a reference to a given object. Examples of these are GIL’s reference to a planar pixel (planar_pixel_reference) and GIL’s sub-byte channel references. Writing a reference proxy class can be tricky. One problem is that the proxy reference is constructed as a temporary object and returned by value upon dereferencing the iterator:

    -
    struct rgb_planar_pixel_iterator
    -{
    - typedef my_reference_proxy<T> reference;
    - reference operator*() const { return reference(red,green,blue); }
    -};
    +
    struct rgb_planar_pixel_iterator
    +{
    + typedef my_reference_proxy<T> reference;
    + reference operator*() const { return reference(red,green,blue); }
    +};
     

    The problem arises when an iterator is dereferenced directly into a function that takes a mutable pixel:

    template <typename Pixel>    // Models MutablePixelConcept
    -void invert_pixel(Pixel& p);
    +void invert_pixel(Pixel& p);
     
    -rgb_planar_pixel_iterator myIt;
    +rgb_planar_pixel_iterator myIt;
     invert_pixel(*myIt);        // compile error!
     
    @@ -106,13 +105,13 @@ reference. The solution is to:

    • Use const qualifier on all members of the reference proxy object:

    -
    template <typename T>
    -struct my_reference_proxy
    -{
    -  const my_reference_proxy& operator=(const my_reference_proxy& p) const;
    -  const my_reference_proxy* operator->() const { return this; }
    -  ...
    -};
    +
    template <typename T>
    +struct my_reference_proxy
    +{
    +  const my_reference_proxy& operator=(const my_reference_proxy& p) const;
    +  const my_reference_proxy* operator->() const { return this; }
    +  ...
    +};
     
      @@ -120,10 +119,10 @@ reference. The solution is to:

      (maybe based on the constness of the template parameter)

    • Define the reference type of your iterator with const qualifier:

    -
    struct iterator_traits<rgb_planar_pixel_iterator>
    -{
    -  typedef const my_reference_proxy<T> reference;
    -};
    +
    struct iterator_traits<rgb_planar_pixel_iterator>
    +{
    +  typedef const my_reference_proxy<T> reference;
    +};
     

    A second important issue is providing an overload for swap for @@ -133,16 +132,16 @@ complication is that in some implementations of the STL the std::swap. The only way for these STL algorithms to use your overload is if you define it in the std namespace:

    -
    namespace std
    -{
    - template <typename T>
    - void swap(my_reference_proxy<T>& x, my_reference_proxy<T>& y)
    - {
    -    my_value<T> tmp=x;
    -    x=y;
    -    y=tmp;
    - }
    -}
    +
    namespace std
    +{
    + template <typename T>
    + void swap(my_reference_proxy<T>& x, my_reference_proxy<T>& y)
    + {
    +    my_value<T> tmp=x;
    +    x=y;
    +    y=tmp;
    + }
    +}
     

    Lastly, remember that constructors and copy-constructors of proxy @@ -163,8 +162,8 @@ suggesting the above solution.

    \ No newline at end of file diff --git a/html/genindex.html b/html/genindex.html index 3c7615c11..52eba2a87 100644 --- a/html/genindex.html +++ b/html/genindex.html @@ -18,9 +18,8 @@ }; - - + @@ -78,8 +77,8 @@
    \ No newline at end of file diff --git a/html/histogram/create.html b/html/histogram/create.html index 3d240093d..54e4f6a40 100644 --- a/html/histogram/create.html +++ b/html/histogram/create.html @@ -5,7 +5,7 @@ - + Create a histogram - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

    C++ Boost

    + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,16 +70,16 @@
    -

    Create a histogram

    +

    Create a histogram

    Method 1 - Using the histogram constructor

    Syntax:

    -
    histogram<Type1, Type2, Type3,... TypeN>
    +
    histogram<Type1, Type2, Type3,... TypeN>
     

    Type1 .. TypeN correspond to the axis type of the N axes in the histogram

    Example: If we want a 3D histogram of Axis1 of type int, Axis2 of type float and Axis3 of type std::string we would do it this way:

    -
    histogram<int, float, std::string> h;
    +
    histogram<int, float, std::string> h;
     

    And done.

    @@ -92,7 +91,7 @@ histogram with GIL images, since it creates a histogram with axes configured to match the GIL image.

    Also it is easier than method-1.

    Syntax:

    -
    auto h = make_histogram(view(image));
    +
    auto h = make_histogram(view(image));
     

    where image could be a gray8_image_t/rgb8_image_t object read from source.

    @@ -109,8 +108,8 @@ to match the GIL image.

    \ No newline at end of file diff --git a/html/histogram/cumulative.html b/html/histogram/cumulative.html index f91e7b008..50447b2e5 100644 --- a/html/histogram/cumulative.html +++ b/html/histogram/cumulative.html @@ -5,7 +5,7 @@ - + Making a cumulative histogram - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

    C++ Boost

    + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,22 +70,22 @@
    -

    Making a cumulative histogram

    +

    Making a cumulative histogram

    -

    Overview

    +

    Overview

    A cumulative histogram is a histogram in which each bin stores the count / frequency of itself as well as all the bins with keys ‘smaller’ than the particular bin. -As such, a notion of ordering among its keys should be existant in the histogram.

    +As such, a notion of ordering among its keys should be existent in the histogram.

    The GIL histogram class has the ability to convert itself into its cumulative version.

    Since the container needs to first get an ordering over the keys a key sorting takes place before calculating the cumulative histogram.

    Example:

    -
    histogram<int, float> h;
    +
    histogram<int, float> h;
     /*
     Fill histogram ...
    -*/
    -auto h1 = cumulative_histogram(h);
    +*/
    +auto h1 = cumulative_histogram(h);
     
    @@ -106,8 +105,8 @@ and then call the function.

    \ No newline at end of file diff --git a/html/histogram/extend.html b/html/histogram/extend.html index a539eded6..139391568 100644 --- a/html/histogram/extend.html +++ b/html/histogram/extend.html @@ -5,7 +5,7 @@ - + Extending the class - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

    C++ Boost

    + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,61 +70,61 @@
    -

    Extending the class

    -
    +

    Extending the class

    +
    +
    -

    User defined Axes

    -

    In case you need a histogram with an axes of an arbitrary type that is not identified by -the C++ Standard Library, you need to provide a overload for the hashing function that is +

    User defined Axes

    +

    In case you need a histogram with an axis of an arbitrary type that is not identified by +the C++ Standard Library, you need to provide an overload for the hashing function that is used in the histogram class.

    GIL’s histogram class uses boost::hash_combine in a sub routine to generate a hash from the key.

    So we need to provide an overload of boost::hash_combine for the purpose.

    For example, let’s consider you need a histogram with an axis over class Test.

    // File : ./test.hpp
    -#include <cstddef>
    -#include <functional>
    +#include <cstddef>
    +#include <functional>
     
    -struct Test
    -{
    -    int a{0};
    -    Test() = default;
    -    Test(int c) : a(c) {}
    -    bool operator==(Test const& other) const
    -    {
    -        return (a == other.a);
    -    }
    -};
    +struct Test
    +{
    +    int a{0};
    +    Test() = default;
    +    Test(int c) : a(c) {}
    +    bool operator==(Test const& other) const
    +    {
    +        return (a == other.a);
    +    }
    +};
     
    -namespace boost {
    -    std::size_t hash_value(Test const& t)
    -    {
    +namespace boost {
    +    std::size_t hash_value(Test const& t)
    +    {
             // Replace with your hashing code
    -        std::hash<int> hasher;
    -        return hasher(t.a);
    -    }
    -}
    +        std::hash<int> hasher;
    +        return hasher(t.a);
    +    }
    +}
     
    -

    Now lets get to the usage example.

    -
    #include <test.hpp>
    -#include <boost/gil.hpp>
    -#include <iostream>
    -// Mind the order of include i.e. test.hpp before boost/gil.hpp
    +

    Now let’s get to the usage example.

    +
    #include <test.hpp>
    +#include <boost/gil.hpp>
    +#include <iostream>
    +// Mind the order of include, i.e. test.hpp before boost/gil.hpp
     
    -using namespace boost::gil;
    +using namespace boost::gil;
     
    -int main()
    -{
    -    boost::gil::histogram<Test> h;
    -    Test t(1);
    -    h(t) = 1;
    -    std::cout<<h(t);
    -}
    +int main()
    +{
    +    boost::gil::histogram<Test> h;
    +    Test t(1);
    +    h(t) = 1;
    +    std::cout<<h(t);
    +}
     
    @@ -142,8 +141,8 @@ the key.

    \ No newline at end of file diff --git a/html/histogram/extension/index.html b/html/histogram/extension/index.html index 579d03544..2046b6bc4 100644 --- a/html/histogram/extension/index.html +++ b/html/histogram/extension/index.html @@ -5,7 +5,7 @@ - + Extensions - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

    C++ Boost

    + alt="C++ Boost" src="../../../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
    -

    Extensions

    +

    Extensions

    The GIL documentation sections listed below are dedicated to describe the usage of external containers as histograms for GIL images.

    @@ -94,8 +93,8 @@ usage of external containers as histograms for GIL images.

    \ No newline at end of file diff --git a/html/histogram/extension/overview.html b/html/histogram/extension/overview.html index d1cb73950..dbfa21a5a 100644 --- a/html/histogram/extension/overview.html +++ b/html/histogram/extension/overview.html @@ -5,7 +5,7 @@ - + Overview - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

    C++ Boost

    + alt="C++ Boost" src="../../../../_static/gil.png" border="0"> @@ -71,22 +70,22 @@
    -

    Overview

    - +
    -

    Description

    +

    Description

    Apart from the default class supplied by Boost.GIL, there are also provisions to use external containers like from std::vector, std::map, boost::histogram etc. These are provided as extensions.

    -

    Extensions

    +

    Extensions

    Currently the following are available:
    1. std::vector (1D histogram support)

    2. @@ -99,7 +98,7 @@ are provided as extensions.

    -

    Adding an external container

    +

    Adding an external container

    The workflow should be:
    1. Provide overloads for fill_histogram(must), make_histogram(optional) etc. in a new file preferably named after the container type in extensions/histogram/.

    2. @@ -123,8 +122,8 @@ are provided as extensions.

      \ No newline at end of file diff --git a/html/histogram/extension/std.html b/html/histogram/extension/std.html index 509bf09f4..c8b89e2d6 100644 --- a/html/histogram/extension/std.html +++ b/html/histogram/extension/std.html @@ -5,7 +5,7 @@ - + STD extension - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

      C++ Boost

      + alt="C++ Boost" src="../../../../_static/gil.png" border="0"> @@ -71,9 +70,9 @@
      -

      STD extension

      +

      STD extension

      -

      Supported Types:

      +

      Supported Types:

      1. std::vector (1D)

      2. std::map (1D)

      3. @@ -82,17 +81,17 @@
      -

      Usage

      +

      Usage

      1. fill_histogram()

        // Demo for std::vector
        -std::vector<int> v;
        -gil::gray8_image_t img;
        +std::vector<int> v;
        +gil::gray8_image_t img;
         /*
         Fill image ...
        -*/
        -gil::fill_histogram(view(img), v, false);
        +*/
        +gil::fill_histogram(view(img), v, false);
         
        @@ -100,11 +99,11 @@
      2. cumulative_histogram()

        // Demo for std::vector
        -std::vector<int> v;
        +std::vector<int> v;
         /*
         Fill vector...
        -*/
        -gil::cumulative_histogram(v);
        +*/
        +gil::cumulative_histogram(v);
         
        @@ -124,8 +123,8 @@ \ No newline at end of file diff --git a/html/histogram/fill.html b/html/histogram/fill.html index cc5b5455a..89088ffff 100644 --- a/html/histogram/fill.html +++ b/html/histogram/fill.html @@ -5,7 +5,7 @@ - + Fill histogram - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

        C++ Boost

        + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,27 +70,27 @@
        -

        Fill histogram

        -
        +

        Fill histogram

        +
        +
        -

        Overview

        +

        Overview

        We will demonstrate the available options for filling an instance of the histogram class with values that cater from the most simplest to the complex needs that might arise.

        -

        Basic

        +

        Basic

        1. Use operator()

          Task - Add value to a particular cell / key / bin in histogram

          -
          histogram<int, int> h;
          -h(1, 2) = 1;
          +
          histogram<int, int> h;
          +h(1, 2) = 1;
           
          @@ -101,8 +100,8 @@ values that cater from the most simplest to the complex needs that might arise.<

          This requires to input the indices in a format the histogram internally stores its keys, which is of std::tuple due to its simple interface.

          Task - Output value of a bin

          -
          histogram<int, int> h;
          -h(1, 2) = 1;
          +
          histogram<int, int> h;
          +h(1, 2) = 1;
           h[{1, 2}] += 1; // Note the curly braces reqd. to construct a tuple
           std::cout<<h[{1, 2}]; // Output - 2
           
          @@ -112,12 +111,12 @@ which is of std::tu
        2. Use another histogram (copy constructor or assignment)

          Task - Fill a histogram using another

          -
          histogram<int, int> A;
          +
          histogram<int, int> A;
           /*
           Fill value in A
          -*/
          -histogram<int, int> B(A), C;
          -C = A;
          +*/
          +histogram<int, int> B(A), C;
          +C = A;
           
          @@ -126,12 +125,12 @@ which is of std::tu

          You can also use GIL images to directly fill histograms.

          Task - Fill histogram using GIL image view

          -
          gil::gray8_image_t img;
          +
          gil::gray8_image_t img;
           /*
           Fill img ...
          -*/
          -histogram<int> h;
          -h.fill(view(img));
          +*/
          +histogram<int> h;
          +h.fill(view(img));
           // OR
           gil::fill_histogram(view(img), h, false); // false if histogram needs to be cleared before filling
           
          @@ -141,16 +140,16 @@ which is of std::tu
        -

        Advanced

        +

        Advanced

        1. Fill histogram using only a few dimensions of image

          Task - Make an histogram over Red and Blue channel of an rgb image

          -
          gil::rgb8_image_t img;
          +
          gil::rgb8_image_t img;
           /*
           Fill img ...
          -*/
          -histogram<int, int> h;
          +*/
          +histogram<int, int> h;
           fill_histogram<0, 2>(view(img), h, false); // 0 - red, 1 - green, 2 - blue
           
          @@ -159,14 +158,14 @@ which is of std::tu
        2. Fill histogram using GIL pixel

          Task - Fill histogram bin using pixel construct in GIL

          -
          gil::gray8_image_t img;
          +
          gil::gray8_image_t img;
           /*
           Fill img ...
          -*/
          -histogram<int> h;
          -gil::for_each_pixel(view(img), [](gil::gray8_pixel_t const& p){
          -    ++h[h.key_from_pixel(p)];
          -});
          +*/
          +histogram<int> h;
          +gil::for_each_pixel(view(img), [](gil::gray8_pixel_t const& p){
          +    ++h[h.key_from_pixel(p)];
          +});
           
          @@ -186,8 +185,8 @@ which is of std::tu
        3. \ No newline at end of file diff --git a/html/histogram/index.html b/html/histogram/index.html index 2c9656467..8e827a0af 100644 --- a/html/histogram/index.html +++ b/html/histogram/index.html @@ -5,7 +5,7 @@ - + Histogram - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -38,7 +37,7 @@

          C++ Boost

          + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -69,7 +68,7 @@
          -

          Histogram

          +

          Histogram

          The GIL documentation sections listed below are dedicated to describe the histogram class and functions used in many image processing algorithms.

          @@ -99,8 +98,8 @@ histogram class and functions used in many image processing algorithms.

          \ No newline at end of file diff --git a/html/histogram/limitations.html b/html/histogram/limitations.html index c3878ec43..e88c09220 100644 --- a/html/histogram/limitations.html +++ b/html/histogram/limitations.html @@ -5,7 +5,7 @@ - + Limitations - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

          C++ Boost

          + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
          -

          Limitations

          +

          Limitations

          TODO

          @@ -86,8 +85,8 @@ \ No newline at end of file diff --git a/html/histogram/overview.html b/html/histogram/overview.html index 17502de3a..7cc5121ae 100644 --- a/html/histogram/overview.html +++ b/html/histogram/overview.html @@ -5,7 +5,7 @@ - + Overview - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

          C++ Boost

          + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,22 +70,22 @@
          -

          Overview

          -
          +

          Overview

          +
          +
          -

          Description

          +

          Description

          The histogram class is built on top of std::unordered_map to keep it compatible with other -STL algorithms. It can support any number of axes (known at compile time i.e. during class +STL algorithms. It can support any number of axes (known at compile time, i.e. during class instantiation). Suitable conversion routines from GIL image constructs to the histogram bin key are shipped with the class itself.

          -

          Tutorials

          +

          Tutorials

          The following flow is recommended:
          1. Create a histogram

          2. @@ -117,8 +116,8 @@ key are shipped with the class itself.

            \ No newline at end of file diff --git a/html/histogram/stl_compatibility.html b/html/histogram/stl_compatibility.html index 153c5f5a7..8e13febbe 100644 --- a/html/histogram/stl_compatibility.html +++ b/html/histogram/stl_compatibility.html @@ -5,7 +5,7 @@ - + STL compatibility - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

            C++ Boost

            + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
            -

            STL compatibility

            +

            STL compatibility

            TODO

            @@ -86,8 +85,8 @@ \ No newline at end of file diff --git a/html/histogram/subhistogram.html b/html/histogram/subhistogram.html index 716f30d54..f8f157c0d 100644 --- a/html/histogram/subhistogram.html +++ b/html/histogram/subhistogram.html @@ -5,7 +5,7 @@ - + Making a sub-histogram - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

            C++ Boost

            + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,9 +70,9 @@
            -

            Making a sub-histogram

            +

            Making a sub-histogram

            -

            Overview

            +

            Overview

            Sub-histogram is a subset of a histogram or one that is formed by masking out a few axis of the parent histogram.

            GIL class histogram provides these functions as members and returns an instance of @@ -82,20 +81,20 @@ the desired sub-class.

          3. Histogram over fewer axes

            Task - Get a 2D histogram from a 3D RGB histogram over red and green axes

            -
            histogram<int, int, int> h;
            -gil::rgb8_image_t img;
            +
            histogram<int, int, int> h;
            +gil::rgb8_image_t img;
             /*
             Fill img ...
            -*/
            -fill_histogram(view(img), h, false);
            +*/
            +fill_histogram(view(img), h, false);
             auto sub_h = h.sub_histogram<0, 1>(); // sub_h is a 2D histogram
             

            Demo output:

            -
            h is {{1, 2, 3} : 1,
            -      {1, 4, 3} : 2,
            -      {1, 2, 5} : 3}
            -sub_h would be {{1, 2} : 4, {1, 4} : 2}
            +
            h is {{1, 2, 3} : 1,
            +      {1, 4, 3} : 2,
            +      {1, 2, 5} : 3}
            +sub_h would be {{1, 2} : 4, {1, 4} : 2}
             
            @@ -104,24 +103,24 @@ the desired sub-class.

            Task - Get a 2D histogram from a 3D RGB histogram for bins whose red color lie between 10 - 20 and blue color lie between 2 - 10

            -
            histogram<int, int, int> h;
            -gil::rgb8_image_t img;
            +
            histogram<int, int, int> h;
            +gil::rgb8_image_t img;
             /*
             Fill img ...
            -*/
            -fill_histogram(view(img), h, false);
            -std::tuple<int, int, int> low, high;
            +*/
            +fill_histogram(view(img), h, false);
            +std::tuple<int, int, int> low, high;
             low = {10, 0, 2} // Since no check over blue channel pass any dummy value
             high = {20, 0, 10} // Since no check over blue channel pass any dummy value
             auto sub_h = h.sub_histogram<0, 2>(low, high); // In angle brackets pass the relevant dimensions in order
             

            Demo Output:

            -
            h is {{11, 2, 3 } : 1,
            -      {1 , 4, 11} : 2,
            -      {1 , 2, 1 } : 3,
            -      {11, 3, 3 } : 4}
            -sub_h would be {{11, 2, 3} : 1, {11, 3, 3} : 4}
            +
            h is {{11, 2, 3 } : 1,
            +      {1 , 4, 11} : 2,
            +      {1 , 2, 1 } : 3,
            +      {11, 3, 3 } : 4}
            +sub_h would be {{11, 2, 3} : 1, {11, 3, 3} : 4}
             
            @@ -141,8 +140,8 @@ and blue color lie between 2 - 10

            \ No newline at end of file diff --git a/html/histogram/utilities.html b/html/histogram/utilities.html index f789e3752..8cc14cded 100644 --- a/html/histogram/utilities.html +++ b/html/histogram/utilities.html @@ -5,7 +5,7 @@ - + Utilities - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

            C++ Boost

            + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
            -

            Utilities

            +

            Utilities

            TODO

            @@ -86,8 +85,8 @@ \ No newline at end of file diff --git a/html/image_processing/affine-region-detectors.html b/html/image_processing/affine-region-detectors.html index c60956837..e96d8533c 100644 --- a/html/image_processing/affine-region-detectors.html +++ b/html/image_processing/affine-region-detectors.html @@ -5,7 +5,7 @@ - + Affine region detectors - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

            C++ Boost

            + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,9 +70,9 @@
            -

            Affine region detectors

            +

            Affine region detectors

            -

            What is being detected?

            +

            What is being detected?

            Affine region is basically any region of the image that is stable under affine transformations. It can be edges under affinity conditions, corners (small patch of an image) @@ -81,7 +80,7 @@ or any other stable features.


            -

            Available detectors

            +

            Available detectors

            At the moment, the following detectors are implemented

            • Harris detector

            • @@ -90,23 +89,23 @@ or any other stable features.


            -

            Algorithm steps

            +

            Algorithm steps

            -

            Harris and Hessian

            -

            Both are derived from a concept called Moravec window. Lets have a look +

            Harris and Hessian

            +

            Both are derived from a concept called Moravec window. Let’s have a look at the image below:

            Moravec window corner case
            -

            Moravec window corner case

            +

            Moravec window corner case

            As can be noticed, moving the yellow window in any direction will cause -very big change in intensity. Now, lets have a look at the edge case:

            +very big change in intensity. Now, let’s have a look at the edge case:

            Moravec window edge case
            -

            Moravec window edge case

            +

            Moravec window edge case

            In this case, intensity change will happen only when moving in @@ -116,7 +115,7 @@ work.

            The algorithms have the same structure:

            1. Compute image derivatives

            2. -
            3. Compute Weighted sum

            4. +
            5. Compute weighted sum

            6. Compute response

            7. Threshold (optional)

            @@ -149,7 +148,7 @@ extremely noisy. For complex images, like the ones of outdoors, for Harris it will be in order of 100000000 and for Hessian will be in order of 10000. For simpler images values in order of 100s and 1000s should be enough. The numbers assume uint8_t gray image.

            -

            To get deeper explanation please refer to following paper:

            +

            To get a deeper explanation please refer to the following papers:

            Harris, Christopher G., and Mike Stephens. “A combined corner and edge detector.” In Alvey vision conference, vol. 15, no. 50, pp. 10-5244. 1988.

            @@ -170,8 +169,8 @@ detector.” In Alvey vision conference, vol. 15, no. 50, pp. 10-5244. \ No newline at end of file diff --git a/html/image_processing/basics.html b/html/image_processing/basics.html index 0b28d7ad5..c0fad7971 100644 --- a/html/image_processing/basics.html +++ b/html/image_processing/basics.html @@ -5,7 +5,7 @@ - + Basics - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

            C++ Boost

            + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,21 +70,21 @@
            -

            Basics

            +

            Basics

            Here are basic concepts that might help to understand documentation written in this folder:

            -

            Convolution

            +

            Convolution

            The simplest way to look at this is “tweaking the input so that it would look like the shape provided”. What exact tweaking is applied depends on the kernel.


            -

            Filters, kernels, weights

            +

            Filters, kernels, weights

            Those three words usually mean the same thing, unless context is clear about a different usage. Simply put, they are matrices, that are used to -achieve certain effects on the image. Lets consider a simple one, 3 by 3 +achieve certain effects on the image. Let’s consider a simple one, 3 by 3 Scharr filter

            ScharrX = [1,0,-1][1,0,-1][1,0,-1]

            The filter above, when convolved with a single channel image @@ -97,22 +96,22 @@ array).


            -

            Derivatives

            +

            Derivatives

            A derivative of an image is a gradient in one of two directions: x (horizontal) and y (vertical). To compute a derivative, one can use Scharr, Sobel and other gradient filters.


            -

            Curvature

            +

            Curvature

            The word, when used alone, will mean the curvature that would be generated if values of an image would be plotted in 3D graph. X and Z -axises (which form horizontal plane) will correspond to X and Y indices +axes (which form horizontal plane) will correspond to X and Y indices of an image, and Y axis will correspond to value at that pixel. By -little stretch of an imagination, filters (another names are kernels, +little stretch of an imagination, filters (other names are kernels, weights) could be considered an image (or any 2D matrix). A mean filter would draw a flat plane, whereas Gaussian filter would draw a hill that -gets sharper depending on it’s sigma value.

            +gets sharper depending on its sigma value.

            @@ -127,8 +126,8 @@ gets sharper depending on it’s sigma value.

            \ No newline at end of file diff --git a/html/image_processing/contrast_enhancement/histogram_equalization.html b/html/image_processing/contrast_enhancement/histogram_equalization.html index e48244a5a..d22375551 100644 --- a/html/image_processing/contrast_enhancement/histogram_equalization.html +++ b/html/image_processing/contrast_enhancement/histogram_equalization.html @@ -5,7 +5,7 @@ - + Histogram Equalization - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -36,7 +35,7 @@

            C++ Boost

            + alt="C++ Boost" src="../../../../_static/gil.png" border="0"> @@ -65,9 +64,9 @@
            -

            Histogram Equalization

            +

            Histogram Equalization

            -

            Description

            +

            Description

            Histogram equalization also known as histogram flattening, is a non-linear image enhancement algorithm that follows the idea that not only should an image cover the entire grayscale space but also be uniformly distributed over that range.

            @@ -80,12 +79,12 @@ the image contrast.

            Could not load image.
            -

            Pixels concentrated in an interval spread out.

            +

            Pixels concentrated in an interval spread out.

            -

            Algorithm

            +

            Algorithm

            1. First calculate the histogram corresponding to input image.

            2. If it is a multi channeled image (e.g. RGB), convert it to a independent color space @@ -108,7 +107,7 @@ the cumulative histogram of the image to the cumulative histogram of a flat hist

        -

        Results

        +

        Results

        The algorithm is applied on a few standard images. One of the transformations in shown below:

        Grayscale Image

        @@ -120,18 +119,18 @@ the cumulative histogram of the image to the cumulative histogram of a flat hist
        -

        Demo

        +

        Demo

        Usage Syntax:

        -
        gray8_image_t inp_img;
        -read_image("your_image.png", inp_img, png_tag{});
        -gray8_image_t dst_img(inp_img.dimensions());
        -histogram_equalization(view(inp_img), view(dst_img));
        +
        gray8_image_t inp_img;
        +read_image("your_image.png", inp_img, png_tag{});
        +gray8_image_t dst_img(inp_img.dimensions());
        +histogram_equalization(view(inp_img), view(dst_img));
         
         // To specify mask over input image
         
        -vector<vector<bool>> mask(inp_img.height(), vector<bool>(inp_img.width(), true));
        -histogram_equalization(view(inp_img), view(dst_img), true, mask);
        +vector<vector<bool>> mask(inp_img.height(), vector<bool>(inp_img.width(), true));
        +histogram_equalization(view(inp_img), view(dst_img), true, mask);
         
        @@ -151,8 +150,8 @@ before trying the histogram equalization algorithm.

        \ No newline at end of file diff --git a/html/image_processing/contrast_enhancement/histogram_matching.html b/html/image_processing/contrast_enhancement/histogram_matching.html index 333f28fc4..14a921a35 100644 --- a/html/image_processing/contrast_enhancement/histogram_matching.html +++ b/html/image_processing/contrast_enhancement/histogram_matching.html @@ -5,7 +5,7 @@ - + Histogram Matching - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -36,7 +35,7 @@

        C++ Boost

        + alt="C++ Boost" src="../../../../_static/gil.png" border="0"> @@ -65,9 +64,9 @@
        -

        Histogram Matching

        +

        Histogram Matching

        -

        Description

        +

        Description

        Histogram Matching is a technique to match the histograms of two images.

        One use case of this would be when two images of the same location have been taken under the same local illumination but with different sensors, bringing out different @@ -76,7 +75,7 @@ features in either image.

        is expected to have a uniform histogram.

        -

        Algorithm

        +

        Algorithm

        1. Calculate the histogram corresponding to input image and reference image.

        2. If it is a multi channeled image (e.g. RGB), convert both to an independent color space @@ -98,7 +97,7 @@ the cumulative histogram of the image to the cumulative histogram of the referen

        -

        Results

        +

        Results

        The algorithm is applied on a few standard images. One of the transformations in shown below:

        Original Image(left) & Reference Image(right)

        @@ -110,19 +109,19 @@ the cumulative histogram of the image to the cumulative histogram of the referen
        -

        Demo

        +

        Demo

        Usage Syntax:

        -
        gray8_image_t inp_img, ref_img;
        -read_image("your_image.png", inp_img, png_tag{});
        -read_image("your_ref_image.png", ref_img, png_tag{});
        -gray8_image_t dst_img(inp_img.dimensions());
        -histogram_matching(view(inp_img), view(ref_image), view(dst_img));
        +
        gray8_image_t inp_img, ref_img;
        +read_image("your_image.png", inp_img, png_tag{});
        +read_image("your_ref_image.png", ref_img, png_tag{});
        +gray8_image_t dst_img(inp_img.dimensions());
        +histogram_matching(view(inp_img), view(ref_image), view(dst_img));
         
         // To specify mask over input image
         
        -vector<vector<bool>> mask(inp_img.height(), vector<bool>(inp_img.width(), true));
        -histogram_matching(view(inp_img), view(ref_image), view(dst_img), true, mask);
        +vector<vector<bool>> mask(inp_img.height(), vector<bool>(inp_img.width(), true));
        +histogram_matching(view(inp_img), view(ref_image), view(dst_img), true, mask);
         
        @@ -142,8 +141,8 @@ before trying the histogram matching algorithm.

        \ No newline at end of file diff --git a/html/image_processing/contrast_enhancement/index.html b/html/image_processing/contrast_enhancement/index.html index ece5e402d..3eece9005 100644 --- a/html/image_processing/contrast_enhancement/index.html +++ b/html/image_processing/contrast_enhancement/index.html @@ -5,7 +5,7 @@ - + Contrast Enhancement - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

        C++ Boost

        + alt="C++ Boost" src="../../../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
        -

        Contrast Enhancement

        +

        Contrast Enhancement

        The GIL documentation sections listed below are dedicated to describe image processing algorithms used for contrast enhancement.

        @@ -93,8 +92,8 @@ processing algorithms used for contrast enhancement.

        \ No newline at end of file diff --git a/html/image_processing/contrast_enhancement/overview.html b/html/image_processing/contrast_enhancement/overview.html index ff01c2d6c..fb9ad3f00 100644 --- a/html/image_processing/contrast_enhancement/overview.html +++ b/html/image_processing/contrast_enhancement/overview.html @@ -5,7 +5,7 @@ - + Overview - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

        C++ Boost

        + alt="C++ Boost" src="../../../../_static/gil.png" border="0"> @@ -71,13 +70,13 @@
        -

        Overview

        +

        Overview

        Contrast Enhancement is a significant part of image processing algorithms. Too dark or too light images don’t look good to the human eyes. Hence while the primary focus of these -algorithms is to enhance visual beauty, some applications of this in medical research is also +algorithms is to enhance visual beauty, some applications of this in medical research are also prevalent.

        We have a few contrast enhancement algorithms in the GIL image processing suite as well. -These include :

        +These include:

        1. Histogram Equalization

        2. @@ -99,8 +98,8 @@ These include :

        \ No newline at end of file diff --git a/html/image_processing/index.html b/html/image_processing/index.html index 8960dbcfb..7287fd822 100644 --- a/html/image_processing/index.html +++ b/html/image_processing/index.html @@ -5,7 +5,7 @@ - + Image Processing - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -38,7 +37,7 @@

        C++ Boost

        + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -69,7 +68,7 @@
        -

        Image Processing

        +

        Image Processing

        The GIL documentation sections listed below are dedicated to describe the library features, structures and algorithms, for image processing and analysis.

        @@ -107,8 +106,8 @@ features, structures and algorithms, for image processing and analysis.

        \ No newline at end of file diff --git a/html/image_processing/overview.html b/html/image_processing/overview.html index b85350367..1c636138b 100644 --- a/html/image_processing/overview.html +++ b/html/image_processing/overview.html @@ -5,7 +5,7 @@ - + Overview - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -39,7 +38,7 @@

        C++ Boost

        + alt="C++ Boost" src="../../_static/gil.png" border="0"> @@ -71,7 +70,7 @@
        -

        Overview

        +

        Overview

        Development of the image processing features was initiated during two Boost projects run in frame of the Google Summer of Code 2019:

          @@ -92,8 +91,8 @@ projects run in frame of the Google Summer of Code 2019:

          \ No newline at end of file diff --git a/html/index.html b/html/index.html index e6ce74ffa..07e734c0a 100644 --- a/html/index.html +++ b/html/index.html @@ -5,7 +5,7 @@ - + Boost Generic Image Library - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -67,13 +66,13 @@
          -

          Boost Generic Image Library

          +

          Boost Generic Image Library

          The Generic Image Library (GIL) is a C++14 header-only library that abstracts image representations from algorithms and allows writing code that can work on a variety of images with performance similar to hand-writing for a specific image type.

          -

          Quickstart

          +

          Quickstart

          -

          Core Library Documentation

          +

          Core Library Documentation

          -

          Extensions Documentation

          +

          Extensions Documentation

          -

          Examples

          +

          Examples

          • x_gradient.cpp: Writing an algorithm that operates on generic images

          • @@ -201,8 +200,8 @@ Blurring images (requires the optional Numeric extension)

            \ No newline at end of file diff --git a/html/installation.html b/html/installation.html index 811b67bd1..5f9297307 100644 --- a/html/installation.html +++ b/html/installation.html @@ -5,7 +5,7 @@ - + Installation - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -69,7 +68,7 @@
            -

            Installation

            +

            Installation

            The latest version of Boost.GIL can be downloaded from https://github.com/boostorg/gil.

            The Boost.GIL is a header-only library. Meaning, it consists of header files only, it does not require Boost to be built and it does not require any libraries @@ -83,12 +82,12 @@ like libpng, libjpeg, etc.

            In order to use Boost.GIL, including boost/gil.hpp and telling your compiler where to find Boost and GIL headers should be sufficient for most projects.

            -

            Compiling

            +

            Compiling

            The Boost.GIL library source code should successfully compile with any compiler with complete C++14 support.

            Note

            -

            Boost.GIL requires C++14 compiler since ince Boost 1.80.

            +

            Boost.GIL requires C++14 compiler since Boost 1.80.

            For the actual list of currently tested compilers, check results of the library CI builds linked from the README.md @@ -107,8 +106,8 @@ of the library repository.

            \ No newline at end of file diff --git a/html/io.html b/html/io.html index d5e7c9731..223ac0a4a 100644 --- a/html/io.html +++ b/html/io.html @@ -5,7 +5,7 @@ - + IO extensions - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -69,9 +68,9 @@
            -

            IO extensions

            +

            IO extensions

            -

            Overview

            +

            Overview

            This extension to boost::gil provides an easy to use interface for reading and writing various image formats. It also includes a framework for adding new formats.

            @@ -83,7 +82,7 @@ Furthermore the GIL extension Toolbox is used.

            [link gil.io.using_io.extending_gil__io_with_new_formats Extending GIL::IO with new Formats].

            -

            Supported Platforms

            +

            Supported Platforms

            All platforms supported by Boost which have a decent C++ compiler. Depending on the image format one or more of the following image libraries might be needed:

            @@ -102,7 +101,7 @@ dependencies. Please see section [link gil.io.using_io.supported_image_formats Supported Image Formats].

            -

            Tutorial

            +

            Tutorial

            Thanks to modern C++ programming techniques the interface for this library is rather small and easy to use. In this tutorial I’ll give you a short walk-around on how to use this boost::gil extension. @@ -111,11 +110,11 @@ For more details please refer to section 3.

            For instance, include boost/gil/extension/io/tiff.hpp to be able to read or write TIFF files.

            -

            Reading An Image

            +

            Reading An Image

            Probably the most common case to read a tiff image can be done as follows:

            -
            std::string filename( "image.tif" );
            -rgb8_image_t img;
            -read_image( filename, img, tiff_tag() );
            +
            std::string filename( "image.tif" );
            +rgb8_image_t img;
            +read_image( filename, img, tiff_tag() );
             

            The code would be same for all other image formats. The only thing that needs @@ -128,90 +127,90 @@ memory needed for the read operation. There are read_and_convert_view counterparts, if the memory is already allocated.

            Sometimes the user only wants to read a sub-part of an image, then the above call would look as follows:

            -
            read_image( filename
            -          , img
            -          , image_read_settings< tiff_tag >( point_t( 0, 0 ), point_t( 50, 50 ) )
            -          );
            +
            read_image( filename
            +          , img
            +          , image_read_settings< tiff_tag >( point_t( 0, 0 ), point_t( 50, 50 ) )
            +          );
             

            The image_read_settings class will provide the user with image format -independent reading setting but can also serves as a pointer for format +independent reading setting but can also serve as a pointer for format dependent settings. Please see the specific image format sections [link gil.io.using_io.supported_image_formats Supported Image Formats] for more details.

            -

            Writing An Image

            +

            Writing An Image

            Besides reading the information also writing is the second part of this Boost.GIL extension. Writing is a lot simpler than reading since an existing image view contains all the information.

            For instance writing an image can be done as follows:

            -
            std::string filename( "image.tif" );
            -rgb8_image_t img( 640, 480 );
            +
            std::string filename( "image.tif" );
            +rgb8_image_t img( 640, 480 );
             
             // write data into image
             
            -write_view( filename
            -          , view( img )
            -          , tiff_tag()
            -          );
            +write_view( filename
            +          , view( img )
            +          , tiff_tag()
            +          );
             

            The interface is similar to reading an image. To add image format specific parameter the user can use image_write_info class. For instance, a user can specify the JPEG quality when writing like this:

            -
            std::string filename( "image.jpg" );
            -rgb8_image_t img( 640, 480 );
            +
            std::string filename( "image.jpg" );
            +rgb8_image_t img( 640, 480 );
             
             // write data into image
             
            -write_view( filename
            -          , view( img )
            -          , image_write_info< jpeg_tag >( 95 )
            -          );
            +write_view( filename
            +          , view( img )
            +          , image_write_info< jpeg_tag >( 95 )
            +          );
             

            The above example will write an image where the jpeg quality is set to 95 percent.

            -

            Reading And Writing In-Memory Buffers

            +

            Reading And Writing In-Memory Buffers

            Reading and writing in-memory buffers are supported as well. See as follows:

            // 1. Read an image.
            -ifstream in( "test.tif", ios::binary );
            +ifstream in( "test.tif", ios::binary );
             
            -rgb8_image_t img;
            -read_image( in, img, tiff_tag() );
            +rgb8_image_t img;
            +read_image( in, img, tiff_tag() );
             
             // 2. Write image to in-memory buffer.
            -stringstream out_buffer( ios_base::out | ios_base::binary );
            +stringstream out_buffer( ios_base::out | ios_base::binary );
             
            -rgb8_image_t src;
            -write_view( out_buffer, view( src ), tiff_tag() );
            +rgb8_image_t src;
            +write_view( out_buffer, view( src ), tiff_tag() );
             
             // 3. Copy in-memory buffer to another.
            -stringstream in_buffer( ios_base::in | ios_base::binary );
            -in_buffer << out_buffer.rdbuf();
            +stringstream in_buffer( ios_base::in | ios_base::binary );
            +in_buffer << out_buffer.rdbuf();
             
             // 4. Read in-memory buffer to gil image
            -rgb8_image_t dst;
            -read_image( in_buffer, dst, tag_t() );
            +rgb8_image_t dst;
            +read_image( in_buffer, dst, tag_t() );
             
             // 5. Write out image.
            -string filename( "out.tif" );
            -ofstream out( filename.c_str(), ios_base::binary );
            -write_view( out, view( dst ), tiff_tag() );
            +string filename( "out.tif" );
            +ofstream out( filename.c_str(), ios_base::binary );
            +write_view( out, view( dst ), tiff_tag() );
             

            In case the user is using his own stream classes he has to make sure it -has the common interface read, write, seek, close, etc. Interface.

            +has the common interface read, write, seek, close, etc. interface.

            -

            Using IO

            +

            Using IO

            -

            General Overview

            +

            General Overview

            The tutorial pointed out some use cases for reading and writing images in various image formats. This section will provide a more thorough overview.

            The next sections will introduce the Read and Write interface. But it might be @@ -221,24 +220,24 @@ interface is rather small and hopefully easy to understand.

            directly with the underlying image format. For that each reader or writer provides access to the so-called backend.

            For instance:

            -
            typedef bmp_tag tag_t;
            +
            typedef bmp_tag tag_t;
             
            -typedef get_reader_backend< const std::string
            -                          , tag_t
            -                          >::type backend_t;
            +typedef get_reader_backend< const std::string
            +                          , tag_t
            +                          >::type backend_t;
             
            -backend_t backend = read_image_info( bmp_filename
            -                                   , tag_t()
            -                                   );
            +backend_t backend = read_image_info( bmp_filename
            +                                   , tag_t()
            +                                   );
             
            -BOOST_CHECK_EQUAL( backend._info._width , 127 );
            -BOOST_CHECK_EQUAL( backend._info._height, 64 );
            +BOOST_CHECK_EQUAL( backend._info._width , 127 );
            +BOOST_CHECK_EQUAL( backend._info._height, 64 );
             

            Of course, the typedef can be removed when using c++11’s auto feature.

            -

            Read Interface

            +

            Read Interface

            As the Tutorial demonstrated there are a few ways to read images. Here is an enumeration of all read functions with a short description:

              @@ -265,22 +264,22 @@ Devices could be a The third and last parameter is either an instance of the image_read_settings<FormatTag> or just the FormatTag. The settings can be various depending on the format which is being read. -But the all share settings for reading a partial image area. +But they all share settings for reading a partial image area. The first point describes the top left image coordinate whereas the second are the dimensions in x and y directions.

              -

              Here an example of setting up partial read:

              -
              read_image( filename
              -          , img
              -          , image_read_settings< tiff_tag >( point_t( 0, 0 ), point_t( 50, 50 ) )
              -          );
              +

              Here is an example of setting up partial read:

              +
              read_image( filename
              +          , img
              +          , image_read_settings< tiff_tag >( point_t( 0, 0 ), point_t( 50, 50 ) )
              +          );
               

              Each format supports reading just the header information, using read_image_info. Please refer to the format specific sections under 3.3. A basic example follows:

              -
              image_read_info< tiff_t > info = read_image_info( filename
              -                                                , tiff_t()
              -                                                );
              +
              image_read_info< tiff_t > info = read_image_info( filename
              +                                                , tiff_t()
              +                                                );
               

              GIL also comes with a dynamic image extension. @@ -288,16 +287,16 @@ In the context of GIL.IO a user can define an

              any_image< gray8_image_t
              -         , gray16_image_t
              -         , rgb8_image_t
              -         , rgba8_image_t
              -         > runtime_image;
              +
              any_image< gray8_image_t
              +         , gray16_image_t
              +         , rgb8_image_t
              +         , rgba8_image_t
              +         > runtime_image;
               
              -read_image( filename
              -          , runtime_image
              -          , tiff_tag()
              -          );
              +read_image( filename
              +          , runtime_image
              +          , tiff_tag()
              +          );
               

              During the review it became clear that there is a need to read big images @@ -305,48 +304,48 @@ scanline by scanline. To support such use case a scanline_read_iterators will then allow to traverse through the image. The following code sample shows the usage:

              -
              typedef tiff_tag tag_t;
              +
              typedef tiff_tag tag_t;
               
              -typedef scanline_reader< typename get_read_device< const char*
              -                                                 , tag_t
              -                                                 >::type
              -                        , tag_t
              -                        > reader_t;
              +typedef scanline_reader< typename get_read_device< const char*
              +                                                 , tag_t
              +                                                 >::type
              +                        , tag_t
              +                        > reader_t;
               
              -reader_t reader = make_scanline_reader( "C:/boost/libs/gil/test/extension/io/images/tiff/test.tif", tag_t() );
              +reader_t reader = make_scanline_reader( "C:/boost/libs/gil/test/extension/io/images/tiff/test.tif", tag_t() );
               
              -typedef rgba8_image_t image_t;
              +typedef rgba8_image_t image_t;
               
              -image_t dst( reader._info._width, reader._info._height );
              -fill_pixels( view(dst), image_t::value_type() );
              +image_t dst( reader._info._width, reader._info._height );
              +fill_pixels( view(dst), image_t::value_type() );
               
              -typedef reader_t::iterator_t iterator_t;
              +typedef reader_t::iterator_t iterator_t;
               
              -iterator_t it  = reader.begin();
              -iterator_t end = reader.end();
              +iterator_t it  = reader.begin();
              +iterator_t end = reader.end();
               
              -for( int row = 0; it != end; ++it, ++row )
              -{
              -    copy_pixels( interleaved_view( reader._info._width
              -                                    , 1
              -                                    , ( image_t::view_t::x_iterator ) *it
              -                                    , reader._scanline_length
              -                                    )
              -                , subimage_view( view( dst )
              -                                , 0
              -                                , row
              -                                , reader._info._width
              -                                , 1
              -                                )
              -                );
              -}
              +for( int row = 0; it != end; ++it, ++row )
              +{
              +    copy_pixels( interleaved_view( reader._info._width
              +                                    , 1
              +                                    , ( image_t::view_t::x_iterator ) *it
              +                                    , reader._scanline_length
              +                                    )
              +                , subimage_view( view( dst )
              +                                , 0
              +                                , row
              +                                , reader._info._width
              +                                , 1
              +                                )
              +                );
              +}
               

              There are many ways to traverse an image but for as of now only by scanline is supported.

            -

            Write Interface

            +

            Write Interface

            There is only one function for writing out images, write_view. Similar to reading the first parameter is either a filename or a device. The filename can be anything from a C-string, std::string, @@ -355,37 +354,33 @@ The availability of the BOOST_GIL_IO_USE_BOOST_FILESYSTEM macro is defined that forces preference of the Boost.Filesystem. Devices could be FILE*, std::ifstream, and TIFF* for TIFF images.

            -

            The second parameter is an view object to image being written. +

            The second parameter is a view object to image being written. The third and last parameter is either a tag or an image_write_info<FormatTag> object containing more settings. One example for instance is the JPEG quality. Refer to the format specific sections under 3.3. to have a list of all the possible settings.

            Writing an any_image<…> is supported. See the following example:

            -
            any_image< gray8_image_t
            -         , gray16_image_t
            -         , rgb8_image_t
            -         , rgba8_image_t
            -         > runtime_image;
            +
            any_image< gray8_image_t
            +         , gray16_image_t
            +         , rgb8_image_t
            +         , rgba8_image_t
            +         > runtime_image;
             
             // fill any_image
             
            -write_view( filename
            -          , view( runtime_image )
            -          , tiff_tag()
            -          );
            +write_view( filename
            +          , view( runtime_image )
            +          , tiff_tag()
            +          );
             
            -

            Compiler Symbols

            +

            Compiler Symbols

            The following table gives an overview of all supported compiler symbols that can be set by the user:

            ---- @@ -444,21 +439,21 @@ that can be set by the user:

            Symbol

            Description

            -

            Supported Image Formats

            +

            Supported Image Formats

            -

            BMP

            +

            BMP

            For a general overview of the BMP image file format go to the following BMP_Wiki.

            Please note, the code has not been tested on X Windows System variations -of the BMP format which are usually referred to XBM and XPM formats.

            +of the BMP format which are usually referred to as XBM and XPM formats.

            Here, only the MS Windows and OS/2 format is relevant.

            Currently the code is able to read and write the following image types:

            -
            Read
            -

            gray1_image_t, gray4_image_t, gray8_image_t, rgb8_image_t and, rgba8_image_t

            +
            Read:
            +

            gray1_image_t, gray4_image_t, gray8_image_t, rgb8_image_t and rgba8_image_t

            -
            Write
            -

            rgb8_image_t and, rgba8_image_t

            +
            Write:
            +

            rgb8_image_t and rgba8_image_t

            The lack of having an indexed image type in gil restricts the current @@ -466,7 +461,7 @@ interface to only write out non-indexed images. This is subject to change soon.

            -

            JPEG

            +

            JPEG

            For a general overview of the JPEG image file format go to the following JPEG_Wiki.

            This jpeg extension is based on the libjpeg library which can be @@ -477,20 +472,20 @@ I strongly recommend the user to build the library yourself. It could potentially save you a lot of trouble.

            Currently the code is able to read and write the following image types:

            -
            Read
            +
            Read:

            gray8_image_t, rgb8_image_t, cmyk8_image_t

            -
            Write
            +
            Write:

            gray8_image_t, rgb8_image_t, cmyk8_image_t

            Reading YCbCr or YCCK images is possible but might result in inaccuracies since both color spaces aren’t available yet for gil. -For now these color space are read as rgb images. +For now these color spaces are read as rgb images. This is subject to change soon.

            -

            PNG

            +

            PNG

            For a general overview of the PNG image file format go to the following PNG_Wiki.

            This png extension is based on the libpng, which can be found @@ -501,10 +496,10 @@ I strongly recommend the user to build the library yourself. It could potentially save you a lot of trouble.

            Currently the code is able to read and write the following image types:

            -
            Read
            +
            Read:

            gray1, gray2, gray4, gray8, gray16, gray_alpha_8, gray_alpha_16, rgb8, rgb16, rgba8, rgba16

            -
            Write
            +
            Write:

            gray1, gray2, gray4, gray8, gray16, gray_alpha_8, gray_alpha_16, rgb8, rgb16, rgba8, rgba16

            @@ -512,37 +507,37 @@ It could potentially save you a lot of trouble.

            macro defined. This color space is defined in the toolbox by using gray_alpha.hpp.

            -

            PNM

            +

            PNM

            For a general overview of the PNM image file format go to the following PNM_Wiki. No external library is needed for the pnm format.

            The extension can read images in both flavours of the formats, ASCII and binary, that is types from P1 through P6; can write only binary formats.

            Currently the code is able to read and write the following image types:

            -
            Read
            +
            Read:

            gray1, gray8, rgb8

            -
            Write
            +
            Write:

            gray1, gray8, rgb8

            When reading a mono text image the data is read as a gray8 image.

            -

            RAW

            +

            RAW

            For a general overview see RAW_Wiki.

            Currently the extension is only able to read rgb8 images.

            -

            TARGA

            +

            TARGA

            For a general overview of the BMP image file format go to the following TARGA_Wiki.

            Currently the code is able to read and write the following image types:

            -
            Read
            +
            Read:

            rgb8_image_t and rgba8_image_t

            -
            Write
            +
            Write:

            rgb8_image_t and rgba8_image_t

            @@ -551,7 +546,7 @@ interface to only write out non-indexed images. This is subject to change soon.

            -

            TIFF

            +

            TIFF

            For a general overview of the TIFF image file format go to the following TIFF_Wiki.

            This tiff extension is based on the libtiff, which can be found, TIFF_Lib.

            @@ -570,7 +565,7 @@ formats, like integer values or floating point values.

          The author of this extension is not claiming all tiff formats are supported. This extension is likely to be a moving target adding new features with each -new milestone. Here is an incomplete lists:

          +new milestone. Here is an incomplete list:

          • Multi-page TIFF - read only

          • Strip TIFF - read and write support

          • @@ -586,15 +581,15 @@ It’s advisable to use ImageMagick test viewer to display images.

          -

          Extending GIL::IO with new Formats

          +

          Extending GIL::IO with new Formats

          Extending the gil::io with new formats is meant to be simple and straightforward. Before adding I would recommend to have a look at existing implementations and then trying to follow a couple of guidelines:

          • Create the following files for your new xxx format
              -
            • xxx_read.hpp - Only includes read code

            • -
            • xxx_write.hpp - Only includes write code

            • +
            • xxx_read.hpp - only includes read code

            • +
            • xxx_write.hpp - only includes write code

            • xxx_all.hpp - includes xxx_read.hpp and xxx_write.hpp

            @@ -602,93 +597,93 @@ implementations and then trying to follow a couple of guidelines:

          • Add the code to the boost::gil::detail namespace

          • Create a tag type for the new format. Like this:

            -
            struct xxx_tag : format_tag {};
            +
            struct xxx_tag : format_tag {};
             
          • Create the image_read_info for the new format. It contains all the -information that are necessary to read an image. It should be filled +information that is necessary to read an image. It should be filled and returned by the get_info member of the reader class. See below:

            -
            template<> struct image_read_info< xxx_tag > {};
            +
            template<> struct image_read_info< xxx_tag > {};
             
          • Create the image_write_info for the new format. It contains all the -information that are necessary to write an image:

            -
            template<> struct image_write_info< xxx_tag > {};
            +information that is necessary to write an image:

            +
            template<> struct image_write_info< xxx_tag > {};
             
          • Use the following reader skeleton as a start:

            -
            template< typename Device
            -        , typename ConversionPolicy
            -        >
            -class reader< Device
            -            , xxx_tag
            -            , ConversionPolicy
            -            >
            -            : public reader_base< xxx_tag
            -                                , ConversionPolicy
            -                                >
            -{
            -private:
            +
            template< typename Device
            +        , typename ConversionPolicy
            +        >
            +class reader< Device
            +            , xxx_tag
            +            , ConversionPolicy
            +            >
            +            : public reader_base< xxx_tag
            +                                , ConversionPolicy
            +                                >
            +{
            +private:
             
            -    typedef typename ConversionPolicy::color_converter_type cc_t;
            +    typedef typename ConversionPolicy::color_converter_type cc_t;
             
            -public:
            +public:
             
            -    reader( Device& device )
            -    : _io_dev( device )
            -    {}
            +    reader( Device& device )
            +    : _io_dev( device )
            +    {}
             
            -    reader( Device&     device
            -          , const cc_t& cc
            -          )
            -    : _io_dev( device )
            -    , reader_base< xxx_tag
            -                 , ConversionPolicy
            -                 >( cc )
            -    {}
            +    reader( Device&     device
            +          , const cc_t& cc
            +          )
            +    : _io_dev( device )
            +    , reader_base< xxx_tag
            +                 , ConversionPolicy
            +                 >( cc )
            +    {}
             
            -    image_read_info< xxx_tag > get_info()
            -    {
            +    image_read_info< xxx_tag > get_info()
            +    {
                     // your implementation here
            -    }
            +    }
             
            -    template< typename View >
            -    void apply( const View& dst_view )
            -    {
            +    template< typename View >
            +    void apply( const View& dst_view )
            +    {
                     // your implementation here
            -    }
            -};
            +    }
            +};
             
          • The writer skeleton:

            -
            template< typename Device >
            -class writer< Device
            -            , xxx_tag
            -            >
            -{
            -public:
            +
            template< typename Device >
            +class writer< Device
            +            , xxx_tag
            +            >
            +{
            +public:
             
            -    writer( Device & file )
            -    : out(file)
            -    {}
            +    writer( Device & file )
            +    : out(file)
            +    {}
             
            -    template<typename View>
            -    void apply( const View& view )
            -    {
            +    template<typename View>
            +    void apply( const View& view )
            +    {
                     // your implementation here
            -    }
            +    }
             
            -    template<typename View>
            -    void apply( const View&                        view
            -              , const image_write_info< xxx_tag >& info )
            -    {
            +    template<typename View>
            +    void apply( const View&                        view
            +              , const image_write_info< xxx_tag >& info )
            +    {
                     // your implementation here
            -    }
            -};
            +    }
            +};
             
          • @@ -696,7 +691,7 @@ information that are necessary to write an image:

        -

        Running gil::io tests

        +

        Running gil::io tests

        gil::io comes with a large suite of test cases which reads and writes various file formats. It uses some test image suites which can be found online or which can be demanded from me by sending me an email.

        @@ -707,19 +702,19 @@ To enable unit tests which make use of them set the following compiler options

        The following list provides all links to the image suites the compiler symbol to enable the tests:

        -
        BMP
        +
        BMP:

        BMP_TEST_FILES – BOOST_GIL_IO_USE_BMP_TEST_SUITE_IMAGES

        -
        PNG
        +
        PNG:

        PNG_TEST_FILES – BOOST_GIL_IO_USE_PNG_TEST_SUITE_IMAGES

        -
        PNM
        +
        PNM:

        request files from me – BOOST_GIL_IO_USE_PNM_TEST_SUITE_IMAGES

        -
        TIFF
        +
        TIFF:

        TIFF_LIB_TIFF_TEST_FILES – BOOST_GIL_IO_USE_TIFF_LIBTIFF_TEST_SUITE_IMAGES

        -
        TIFF
        +
        TIFF:

        TIFF_GRAPHICSMAGICK_TEST_FILES – BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES

        @@ -736,8 +731,8 @@ to enable the tests:

        \ No newline at end of file diff --git a/html/naming.html b/html/naming.html index 7efaa40c6..ca67bdf73 100644 --- a/html/naming.html +++ b/html/naming.html @@ -5,7 +5,7 @@ - + Naming Conventions - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -69,13 +68,13 @@
        -

        Naming Conventions

        +

        Naming Conventions

        Description of established naming conventions used in source code of GIL, tests and examples.

        -

        Concrete Types

        +

        Concrete Types

        Concrete (non-generic) GIL types follow this naming convention:

        -
        ColorSpace + BitDepth + [f | s]+ [c] + [_planar] + [_step] + ClassType + _t
        +
        ColorSpace + BitDepth + [f | s]+ [c] + [_planar] + [_step] + ClassType + _t
         

        where:

        @@ -83,7 +82,7 @@ tests and examples.

      3. ColorSpace indicates layout and ordering of components. For example, rgb, bgr, cmyk, rgba.

      4. BitDepth indicates the bit depth of the color channel. -For example, 8,``16``,``32``.

      5. +For example, 8, 16, 32.

      6. By default, type of channel is unsigned integral. The s tag indicates signed integral. The f tag indicates a floating point type, which is always signed.

      7. @@ -91,12 +90,12 @@ The f The c tag indicates object operating over immutable pixels.

      8. _planar indicates planar organization (as opposed to interleaved).

      9. _step indicates special image views, locators and iterators which -traverse the data in non-trivial way. For example, backwards or every other +traverse the data in a non-trivial way. For example, backwards or every other pixel.

      10. ClassType is _image (image), _view (image view), _loc (pixel 2D locator) _ptr (pixel iterator), _ref (pixel reference), _pixel (pixel value).

      11. -
      12. _t suffix indicaes it is a name of a type.

      13. +
      14. _t suffix indicates it is a name of a type.

      15. For example:

        bgr8_image_t             a;    // 8-bit interleaved BGR image
        @@ -118,8 +117,8 @@ pixel.

        \ No newline at end of file diff --git a/html/numeric.html b/html/numeric.html index 5a0cdab05..0d6527cd8 100644 --- a/html/numeric.html +++ b/html/numeric.html @@ -5,7 +5,7 @@ - + Numeric extension - Boost.GIL documentation @@ -19,9 +19,8 @@ }; - - + @@ -67,9 +66,9 @@
        -

        Numeric extension

        +

        Numeric extension

        -

        Overview

        +

        Overview

        TODO

        @@ -83,8 +82,8 @@ \ No newline at end of file diff --git a/html/reference/adaptive__histogram__equalization_8hpp_source.html b/html/reference/adaptive__histogram__equalization_8hpp_source.html index 792bd2f62..0ac5ecbd3 100644 --- a/html/reference/adaptive__histogram__equalization_8hpp_source.html +++ b/html/reference/adaptive__histogram__equalization_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: adaptive_histogram_equalization.hpp Source File @@ -27,296 +27,301 @@
        - + +/* @license-end */ + +
        -
        -
        adaptive_histogram_equalization.hpp
        +
        adaptive_histogram_equalization.hpp
        -
        1 //
        -
        2 // Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
        -
        3 //
        -
        4 // Use, modification and distribution are subject to the Boost Software License,
        -
        5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt)
        -
        7 //
        -
        8 
        -
        9 #ifndef BOOST_GIL_IMAGE_PROCESSING_ADAPTIVE_HISTOGRAM_EQUALIZATION_HPP
        -
        10 #define BOOST_GIL_IMAGE_PROCESSING_ADAPTIVE_HISTOGRAM_EQUALIZATION_HPP
        -
        11 
        -
        12 #include <boost/gil/algorithm.hpp>
        -
        13 #include <boost/gil/histogram.hpp>
        -
        14 #include <boost/gil/image.hpp>
        -
        15 #include <boost/gil/image_processing/histogram_equalization.hpp>
        -
        16 #include <boost/gil/image_view_factory.hpp>
        -
        17 
        -
        18 #include <cmath>
        -
        19 #include <map>
        -
        20 #include <vector>
        -
        21 
        -
        22 namespace boost { namespace gil {
        -
        23 
        -
        36 
        -
        37 namespace detail {
        -
        38 
        -
        41 
        -
        48 template <typename SrcHist>
        -
        49 double actual_clip_limit(SrcHist const& src_hist, double cliplimit = 0.03)
        -
        50 {
        -
        51  double epsilon = 1.0;
        -
        52  using value_t = typename SrcHist::value_type;
        -
        53  double sum = src_hist.sum();
        -
        54  std::size_t num_bins = src_hist.size();
        -
        55 
        -
        56  cliplimit = sum * cliplimit;
        -
        57  long low = 0, high = cliplimit, middle = low;
        -
        58  while (high - low >= 1)
        -
        59  {
        -
        60  middle = (low + high + 1) >> 1;
        -
        61  long excess = 0;
        -
        62  std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        -
        63  if (v.second > middle)
        -
        64  excess += v.second - middle;
        -
        65  });
        -
        66  if (std::abs(excess - (cliplimit - middle) * num_bins) < epsilon)
        -
        67  break;
        -
        68  else if (excess > (cliplimit - middle) * num_bins)
        -
        69  high = middle - 1;
        -
        70  else
        -
        71  low = middle + 1;
        -
        72  }
        -
        73  return middle / sum;
        -
        74 }
        -
        75 
        -
        83 template <typename SrcHist, typename DstHist>
        -
        84 void clip_and_redistribute(SrcHist const& src_hist, DstHist& dst_hist, double clip_limit = 0.03)
        -
        85 {
        -
        86  using value_t = typename SrcHist::value_type;
        -
        87  double sum = src_hist.sum();
        -
        88  double actual_clip_value = detail::actual_clip_limit(src_hist, clip_limit);
        -
        89  // double actual_clip_value = clip_limit;
        -
        90  long actual_clip_limit = actual_clip_value * sum;
        -
        91  double excess = 0;
        -
        92  std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        -
        93  if (v.second > actual_clip_limit)
        -
        94  excess += v.second - actual_clip_limit;
        -
        95  });
        -
        96  std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        -
        97  if (v.second >= actual_clip_limit)
        -
        98  dst_hist[dst_hist.key_from_tuple(v.first)] = clip_limit * sum;
        -
        99  else
        -
        100  dst_hist[dst_hist.key_from_tuple(v.first)] = v.second + excess / src_hist.size();
        -
        101  });
        -
        102  long rem = long(excess) % src_hist.size();
        -
        103  if (rem == 0)
        -
        104  return;
        -
        105  long period = round(src_hist.size() / rem);
        -
        106  std::size_t index = 0;
        -
        107  while (rem)
        -
        108  {
        -
        109  if (dst_hist(index) >= clip_limit * sum)
        -
        110  {
        -
        111  index = (index + 1) % src_hist.size();
        -
        112  }
        -
        113  dst_hist(index)++;
        -
        114  rem--;
        -
        115  index = (index + period) % src_hist.size();
        -
        116  }
        -
        117 }
        -
        118 
        -
        119 } // namespace detail
        -
        120 
        -
        136 template <typename SrcView, typename DstView>
        -
        137 void non_overlapping_interpolated_clahe(
        -
        138  SrcView const& src_view,
        -
        139  DstView const& dst_view,
        -
        140  std::ptrdiff_t tile_width_x = 20,
        -
        141  std::ptrdiff_t tile_width_y = 20,
        -
        142  double clip_limit = 0.03,
        -
        143  std::size_t bin_width = 1.0,
        -
        144  bool mask = false,
        -
        145  std::vector<std::vector<bool>> src_mask = {})
        -
        146 {
        -
        147  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        148  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        149 
        -
        150  static_assert(
        -
        151  color_spaces_are_compatible<
        -
        152  typename color_space_type<SrcView>::type,
        -
        153  typename color_space_type<DstView>::type>::value,
        -
        154  "Source and destination views must have same color space");
        -
        155 
        -
        156  using source_channel_t = typename channel_type<SrcView>::type;
        -
        157  using dst_channel_t = typename channel_type<DstView>::type;
        -
        158  using coord_t = typename SrcView::x_coord_t;
        -
        159 
        -
        160  std::size_t const channels = num_channels<SrcView>::value;
        -
        161  coord_t const width = src_view.width();
        -
        162  coord_t const height = src_view.height();
        -
        163 
        -
        164  // Find control points
        -
        165 
        -
        166  std::vector<coord_t> sample_x;
        -
        167  coord_t sample_x1 = tile_width_x / 2;
        -
        168  coord_t sample_y1 = tile_width_y / 2;
        -
        169 
        -
        170  auto extend_left = tile_width_x;
        -
        171  auto extend_top = tile_width_y;
        -
        172  auto extend_right = (tile_width_x - width % tile_width_x) % tile_width_x + tile_width_x;
        -
        173  auto extend_bottom = (tile_width_y - height % tile_width_y) % tile_width_y + tile_width_y;
        -
        174 
        -
        175  auto new_width = width + extend_left + extend_right;
        -
        176  auto new_height = height + extend_top + extend_bottom;
        -
        177 
        -
        178  image<typename SrcView::value_type> padded_img(new_width, new_height);
        -
        179 
        -
        180  auto top_left_x = tile_width_x;
        -
        181  auto top_left_y = tile_width_y;
        -
        182  auto bottom_right_x = tile_width_x + width;
        -
        183  auto bottom_right_y = tile_width_y + height;
        -
        184 
        -
        185  copy_pixels(src_view, subimage_view(view(padded_img), top_left_x, top_left_y, width, height));
        -
        186 
        -
        187  for (std::size_t k = 0; k < channels; k++)
        -
        188  {
        -
        189  std::vector<histogram<source_channel_t>> prev_row(new_width / tile_width_x),
        -
        190  next_row((new_width / tile_width_x));
        -
        191  std::vector<std::map<source_channel_t, source_channel_t>> prev_map(
        -
        192  new_width / tile_width_x),
        -
        193  next_map((new_width / tile_width_x));
        -
        194 
        -
        195  coord_t prev = 0, next = 1;
        -
        196  auto channel_view = nth_channel_view(view(padded_img), k);
        -
        197 
        -
        198  for (std::ptrdiff_t i = top_left_y; i < bottom_right_y; ++i)
        -
        199  {
        -
        200  if ((i - sample_y1) / tile_width_y >= next || i == top_left_y)
        -
        201  {
        -
        202  if (i != top_left_y)
        -
        203  {
        -
        204  prev = next;
        -
        205  next++;
        -
        206  }
        -
        207  prev_row = next_row;
        -
        208  prev_map = next_map;
        -
        209  for (std::ptrdiff_t j = sample_x1; j < new_width; j += tile_width_x)
        -
        210  {
        -
        211  auto img_view = subimage_view(
        -
        212  channel_view, j - sample_x1, next * tile_width_y,
        -
        213  std::max<int>(
        -
        214  std::min<int>(tile_width_x + j - sample_x1, bottom_right_x) -
        -
        215  (j - sample_x1),
        -
        216  0),
        -
        217  std::max<int>(
        -
        218  std::min<int>((next + 1) * tile_width_y, bottom_right_y) -
        -
        219  next * tile_width_y,
        -
        220  0));
        -
        221 
        -
        222  fill_histogram(
        -
        223  img_view, next_row[(j - sample_x1) / tile_width_x], bin_width, false,
        -
        224  false);
        -
        225 
        -
        226  detail::clip_and_redistribute(
        -
        227  next_row[(j - sample_x1) / tile_width_x],
        -
        228  next_row[(j - sample_x1) / tile_width_x], clip_limit);
        -
        229 
        -
        230  next_map[(j - sample_x1) / tile_width_x] =
        -
        231  histogram_equalization(next_row[(j - sample_x1) / tile_width_x]);
        -
        232  }
        -
        233  }
        -
        234  bool prev_row_mask = 1, next_row_mask = 1;
        -
        235  if (prev == 0)
        -
        236  prev_row_mask = false;
        -
        237  else if (next + 1 == new_height / tile_width_y)
        -
        238  next_row_mask = false;
        -
        239  for (std::ptrdiff_t j = top_left_x; j < bottom_right_x; ++j)
        -
        240  {
        -
        241  bool prev_col_mask = true, next_col_mask = true;
        -
        242  if ((j - sample_x1) / tile_width_x == 0)
        -
        243  prev_col_mask = false;
        -
        244  else if ((j - sample_x1) / tile_width_x + 1 == new_width / tile_width_x - 1)
        -
        245  next_col_mask = false;
        -
        246 
        -
        247  // Bilinear interpolation
        -
        248  point_t top_left(
        -
        249  (j - sample_x1) / tile_width_x * tile_width_x + sample_x1,
        -
        250  prev * tile_width_y + sample_y1);
        -
        251  point_t top_right(top_left.x + tile_width_x, top_left.y);
        -
        252  point_t bottom_left(top_left.x, top_left.y + tile_width_y);
        -
        253  point_t bottom_right(top_left.x + tile_width_x, top_left.y + tile_width_y);
        -
        254 
        -
        255  long double x_diff = top_right.x - top_left.x;
        -
        256  long double y_diff = bottom_left.y - top_left.y;
        -
        257 
        -
        258  long double x1 = (j - top_left.x) / x_diff;
        -
        259  long double x2 = (top_right.x - j) / x_diff;
        -
        260  long double y1 = (i - top_left.y) / y_diff;
        -
        261  long double y2 = (bottom_left.y - i) / y_diff;
        -
        262 
        -
        263  if (prev_row_mask == 0)
        -
        264  y1 = 1;
        -
        265  else if (next_row_mask == 0)
        -
        266  y2 = 1;
        -
        267  if (prev_col_mask == 0)
        -
        268  x1 = 1;
        -
        269  else if (next_col_mask == 0)
        -
        270  x2 = 1;
        -
        271 
        -
        272  long double numerator =
        -
        273  ((prev_row_mask & prev_col_mask) * x2 *
        -
        274  prev_map[(top_left.x - sample_x1) / tile_width_x][channel_view(j, i)] +
        -
        275  (prev_row_mask & next_col_mask) * x1 *
        -
        276  prev_map[(top_right.x - sample_x1) / tile_width_x][channel_view(j, i)]) *
        -
        277  y2 +
        -
        278  ((next_row_mask & prev_col_mask) * x2 *
        -
        279  next_map[(bottom_left.x - sample_x1) / tile_width_x][channel_view(j, i)] +
        -
        280  (next_row_mask & next_col_mask) * x1 *
        -
        281  next_map[(bottom_right.x - sample_x1) / tile_width_x][channel_view(j, i)]) *
        -
        282  y1;
        -
        283 
        -
        284  if (mask && !src_mask[i - top_left_y][j - top_left_x])
        -
        285  {
        -
        286  dst_view(j - top_left_x, i - top_left_y) =
        -
        287  channel_convert<dst_channel_t>(
        -
        288  static_cast<source_channel_t>(channel_view(i, j)));
        -
        289  }
        -
        290  else
        -
        291  {
        -
        292  dst_view(j - top_left_x, i - top_left_y) =
        -
        293  channel_convert<dst_channel_t>(static_cast<source_channel_t>(numerator));
        -
        294  }
        -
        295  }
        -
        296  }
        -
        297  }
        -
        298 }
        -
        299 
        -
        300 }} //namespace boost::gil
        -
        301 
        -
        302 #endif
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition: algorithm.hpp:292
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
        +
        3//
        +
        4// Use, modification and distribution are subject to the Boost Software License,
        +
        5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt)
        +
        7//
        +
        8
        +
        9#ifndef BOOST_GIL_IMAGE_PROCESSING_ADAPTIVE_HISTOGRAM_EQUALIZATION_HPP
        +
        10#define BOOST_GIL_IMAGE_PROCESSING_ADAPTIVE_HISTOGRAM_EQUALIZATION_HPP
        +
        11
        +
        12#include <boost/gil/algorithm.hpp>
        +
        13#include <boost/gil/histogram.hpp>
        +
        14#include <boost/gil/image.hpp>
        +
        15#include <boost/gil/image_processing/histogram_equalization.hpp>
        +
        16#include <boost/gil/image_view_factory.hpp>
        +
        17
        +
        18#include <cmath>
        +
        19#include <map>
        +
        20#include <vector>
        +
        21
        +
        22namespace boost { namespace gil {
        +
        23
        +
        36
        +
        37namespace detail {
        +
        38
        +
        41
        +
        48template <typename SrcHist>
        +
        49double actual_clip_limit(SrcHist const& src_hist, double cliplimit = 0.03)
        +
        50{
        +
        51 double epsilon = 1.0;
        +
        52 using value_t = typename SrcHist::value_type;
        +
        53 double sum = src_hist.sum();
        +
        54 std::size_t num_bins = src_hist.size();
        +
        55
        +
        56 cliplimit = sum * cliplimit;
        +
        57 long low = 0, high = cliplimit, middle = low;
        +
        58 while (high - low >= 1)
        +
        59 {
        +
        60 middle = (low + high + 1) >> 1;
        +
        61 long excess = 0;
        +
        62 std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        +
        63 if (v.second > middle)
        +
        64 excess += v.second - middle;
        +
        65 });
        +
        66 if (std::abs(excess - (cliplimit - middle) * num_bins) < epsilon)
        +
        67 break;
        +
        68 else if (excess > (cliplimit - middle) * num_bins)
        +
        69 high = middle - 1;
        +
        70 else
        +
        71 low = middle + 1;
        +
        72 }
        +
        73 return middle / sum;
        +
        74}
        +
        75
        +
        83template <typename SrcHist, typename DstHist>
        +
        84void clip_and_redistribute(SrcHist const& src_hist, DstHist& dst_hist, double clip_limit = 0.03)
        +
        85{
        +
        86 using value_t = typename SrcHist::value_type;
        +
        87 double sum = src_hist.sum();
        +
        88 double actual_clip_value = detail::actual_clip_limit(src_hist, clip_limit);
        +
        89 // double actual_clip_value = clip_limit;
        +
        90 long actual_clip_limit = actual_clip_value * sum;
        +
        91 double excess = 0;
        +
        92 std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        +
        93 if (v.second > actual_clip_limit)
        +
        94 excess += v.second - actual_clip_limit;
        +
        95 });
        +
        96 std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        +
        97 if (v.second >= actual_clip_limit)
        +
        98 dst_hist[dst_hist.key_from_tuple(v.first)] = clip_limit * sum;
        +
        99 else
        +
        100 dst_hist[dst_hist.key_from_tuple(v.first)] = v.second + excess / src_hist.size();
        +
        101 });
        +
        102 long rem = long(excess) % src_hist.size();
        +
        103 if (rem == 0)
        +
        104 return;
        +
        105 long period = round(src_hist.size() / rem);
        +
        106 std::size_t index = 0;
        +
        107 while (rem)
        +
        108 {
        +
        109 if (dst_hist(index) >= clip_limit * sum)
        +
        110 {
        +
        111 index = (index + 1) % src_hist.size();
        +
        112 }
        +
        113 dst_hist(index)++;
        +
        114 rem--;
        +
        115 index = (index + period) % src_hist.size();
        +
        116 }
        +
        117}
        +
        118
        +
        119} // namespace detail
        +
        120
        +
        136template <typename SrcView, typename DstView>
        +
        137void non_overlapping_interpolated_clahe(
        +
        138 SrcView const& src_view,
        +
        139 DstView const& dst_view,
        +
        140 std::ptrdiff_t tile_width_x = 20,
        +
        141 std::ptrdiff_t tile_width_y = 20,
        +
        142 double clip_limit = 0.03,
        +
        143 std::size_t bin_width = 1.0,
        +
        144 bool mask = false,
        +
        145 std::vector<std::vector<bool>> src_mask = {})
        +
        146{
        +
        147 gil_function_requires<ImageViewConcept<SrcView>>();
        +
        148 gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        149
        +
        150 static_assert(
        +
        151 color_spaces_are_compatible<
        +
        152 typename color_space_type<SrcView>::type,
        +
        153 typename color_space_type<DstView>::type>::value,
        +
        154 "Source and destination views must have same color space");
        +
        155
        +
        156 using source_channel_t = typename channel_type<SrcView>::type;
        +
        157 using dst_channel_t = typename channel_type<DstView>::type;
        +
        158 using coord_t = typename SrcView::x_coord_t;
        +
        159
        +
        160 std::size_t const channels = num_channels<SrcView>::value;
        +
        161 coord_t const width = src_view.width();
        +
        162 coord_t const height = src_view.height();
        +
        163
        +
        164 // Find control points
        +
        165
        +
        166 std::vector<coord_t> sample_x;
        +
        167 coord_t sample_x1 = tile_width_x / 2;
        +
        168 coord_t sample_y1 = tile_width_y / 2;
        +
        169
        +
        170 auto extend_left = tile_width_x;
        +
        171 auto extend_top = tile_width_y;
        +
        172 auto extend_right = (tile_width_x - width % tile_width_x) % tile_width_x + tile_width_x;
        +
        173 auto extend_bottom = (tile_width_y - height % tile_width_y) % tile_width_y + tile_width_y;
        +
        174
        +
        175 auto new_width = width + extend_left + extend_right;
        +
        176 auto new_height = height + extend_top + extend_bottom;
        +
        177
        +
        178 image<typename SrcView::value_type> padded_img(new_width, new_height);
        +
        179
        +
        180 auto top_left_x = tile_width_x;
        +
        181 auto top_left_y = tile_width_y;
        +
        182 auto bottom_right_x = tile_width_x + width;
        +
        183 auto bottom_right_y = tile_width_y + height;
        +
        184
        +
        185 copy_pixels(src_view, subimage_view(view(padded_img), top_left_x, top_left_y, width, height));
        +
        186
        +
        187 for (std::size_t k = 0; k < channels; k++)
        +
        188 {
        +
        189 std::vector<histogram<source_channel_t>> prev_row(new_width / tile_width_x),
        +
        190 next_row((new_width / tile_width_x));
        +
        191 std::vector<std::map<source_channel_t, source_channel_t>> prev_map(
        +
        192 new_width / tile_width_x),
        +
        193 next_map((new_width / tile_width_x));
        +
        194
        +
        195 coord_t prev = 0, next = 1;
        +
        196 auto channel_view = nth_channel_view(view(padded_img), k);
        +
        197
        +
        198 for (std::ptrdiff_t i = top_left_y; i < bottom_right_y; ++i)
        +
        199 {
        +
        200 if ((i - sample_y1) / tile_width_y >= next || i == top_left_y)
        +
        201 {
        +
        202 if (i != top_left_y)
        +
        203 {
        +
        204 prev = next;
        +
        205 next++;
        +
        206 }
        +
        207 prev_row = next_row;
        +
        208 prev_map = next_map;
        +
        209 for (std::ptrdiff_t j = sample_x1; j < new_width; j += tile_width_x)
        +
        210 {
        +
        211 auto img_view = subimage_view(
        +
        212 channel_view, j - sample_x1, next * tile_width_y,
        +
        213 std::max<int>(
        +
        214 std::min<int>(tile_width_x + j - sample_x1, bottom_right_x) -
        +
        215 (j - sample_x1),
        +
        216 0),
        +
        217 std::max<int>(
        +
        218 std::min<int>((next + 1) * tile_width_y, bottom_right_y) -
        +
        219 next * tile_width_y,
        +
        220 0));
        +
        221
        +
        222 fill_histogram(
        +
        223 img_view, next_row[(j - sample_x1) / tile_width_x], bin_width, false,
        +
        224 false);
        +
        225
        +
        226 detail::clip_and_redistribute(
        +
        227 next_row[(j - sample_x1) / tile_width_x],
        +
        228 next_row[(j - sample_x1) / tile_width_x], clip_limit);
        +
        229
        +
        230 next_map[(j - sample_x1) / tile_width_x] =
        +
        231 histogram_equalization(next_row[(j - sample_x1) / tile_width_x]);
        +
        232 }
        +
        233 }
        +
        234 bool prev_row_mask = 1, next_row_mask = 1;
        +
        235 if (prev == 0)
        +
        236 prev_row_mask = false;
        +
        237 else if (next + 1 == new_height / tile_width_y)
        +
        238 next_row_mask = false;
        +
        239 for (std::ptrdiff_t j = top_left_x; j < bottom_right_x; ++j)
        +
        240 {
        +
        241 bool prev_col_mask = true, next_col_mask = true;
        +
        242 if ((j - sample_x1) / tile_width_x == 0)
        +
        243 prev_col_mask = false;
        +
        244 else if ((j - sample_x1) / tile_width_x + 1 == new_width / tile_width_x - 1)
        +
        245 next_col_mask = false;
        +
        246
        +
        247 // Bilinear interpolation
        +
        248 point_t top_left(
        +
        249 (j - sample_x1) / tile_width_x * tile_width_x + sample_x1,
        +
        250 prev * tile_width_y + sample_y1);
        +
        251 point_t top_right(top_left.x + tile_width_x, top_left.y);
        +
        252 point_t bottom_left(top_left.x, top_left.y + tile_width_y);
        +
        253 point_t bottom_right(top_left.x + tile_width_x, top_left.y + tile_width_y);
        +
        254
        +
        255 long double x_diff = top_right.x - top_left.x;
        +
        256 long double y_diff = bottom_left.y - top_left.y;
        +
        257
        +
        258 long double x1 = (j - top_left.x) / x_diff;
        +
        259 long double x2 = (top_right.x - j) / x_diff;
        +
        260 long double y1 = (i - top_left.y) / y_diff;
        +
        261 long double y2 = (bottom_left.y - i) / y_diff;
        +
        262
        +
        263 if (prev_row_mask == 0)
        +
        264 y1 = 1;
        +
        265 else if (next_row_mask == 0)
        +
        266 y2 = 1;
        +
        267 if (prev_col_mask == 0)
        +
        268 x1 = 1;
        +
        269 else if (next_col_mask == 0)
        +
        270 x2 = 1;
        +
        271
        +
        272 long double numerator =
        +
        273 ((prev_row_mask & prev_col_mask) * x2 *
        +
        274 prev_map[(top_left.x - sample_x1) / tile_width_x][channel_view(j, i)] +
        +
        275 (prev_row_mask & next_col_mask) * x1 *
        +
        276 prev_map[(top_right.x - sample_x1) / tile_width_x][channel_view(j, i)]) *
        +
        277 y2 +
        +
        278 ((next_row_mask & prev_col_mask) * x2 *
        +
        279 next_map[(bottom_left.x - sample_x1) / tile_width_x][channel_view(j, i)] +
        +
        280 (next_row_mask & next_col_mask) * x1 *
        +
        281 next_map[(bottom_right.x - sample_x1) / tile_width_x][channel_view(j, i)]) *
        +
        282 y1;
        +
        283
        +
        284 if (mask && !src_mask[i - top_left_y][j - top_left_x])
        +
        285 {
        +
        286 dst_view(j - top_left_x, i - top_left_y) =
        +
        287 channel_convert<dst_channel_t>(
        +
        288 static_cast<source_channel_t>(channel_view(i, j)));
        +
        289 }
        +
        290 else
        +
        291 {
        +
        292 dst_view(j - top_left_x, i - top_left_y) =
        +
        293 channel_convert<dst_channel_t>(static_cast<source_channel_t>(numerator));
        +
        294 }
        +
        295 }
        +
        296 }
        +
        297 }
        +
        298}
        +
        299
        +
        300}} //namespace boost::gil
        +
        301
        +
        302#endif
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition algorithm.hpp:292
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/algorithm_8hpp_source.html b/html/reference/algorithm_8hpp_source.html index 307f36753..1bdb53529 100644 --- a/html/reference/algorithm_8hpp_source.html +++ b/html/reference/algorithm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: algorithm.hpp Source File @@ -27,1434 +27,1494 @@

        - + +/* @license-end */ + +
        -
        -
        algorithm.hpp
        +
        algorithm.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_ALGORITHM_HPP
        -
        10 #define BOOST_GIL_ALGORITHM_HPP
        -
        11 
        -
        12 #include <boost/gil/metafunctions.hpp>
        -
        13 #include <boost/gil/pixel_iterator.hpp>
        -
        14 #include <boost/gil/pixel_numeric_operations.hpp>
        -
        15 #include <boost/gil/image.hpp>
        -
        16 #include <boost/gil/bit_aligned_pixel_iterator.hpp>
        -
        17 #include <boost/gil/color_base_algorithm.hpp>
        -
        18 #include <boost/gil/concepts.hpp>
        -
        19 #include <boost/gil/image_view.hpp>
        -
        20 #include <boost/gil/image_view_factory.hpp>
        -
        21 #include <boost/gil/detail/mp11.hpp>
        -
        22 #include <boost/gil/detail/type_traits.hpp>
        -
        23 
        -
        24 #include <boost/assert.hpp>
        -
        25 #include <boost/config.hpp>
        -
        26 
        -
        27 #include <algorithm>
        -
        28 #include <cstddef>
        -
        29 #include <cstring>
        -
        30 #include <iterator>
        -
        31 #include <memory>
        -
        32 #include <type_traits>
        -
        33 #include <typeinfo>
        -
        34 #include <numeric>
        -
        35 
        -
        36 namespace boost { namespace gil {
        -
        37 
        -
        38 //forward declarations
        -
        39 template <typename ChannelPtr, typename ColorSpace>
        -
        40 struct planar_pixel_iterator;
        -
        41 template <typename Iterator>
        -
        42 class memory_based_step_iterator;
        -
        43 template <typename StepIterator>
        -
        44 class memory_based_2d_locator;
        -
        45 
        -
        46 // a tag denoting incompatible arguments
        -
        47 struct error_t {};
        -
        48 
        -
        73 
        -
        77 
        -
        86 template <typename Derived, typename Result=void>
        - -
        88 {
        -
        89  using result_type = Result;
        -
        90 
        -
        91  template <typename V1, typename V2> BOOST_FORCEINLINE
        -
        92  auto operator()(const std::pair<const V1*,const V2*>& p) const -> result_type {
        -
        93  return apply(*p.first, *p.second, typename views_are_compatible<V1,V2>::type());
        -
        94  }
        -
        95 
        -
        96  template <typename V1, typename V2> BOOST_FORCEINLINE
        -
        97  auto operator()(const V1& v1, const V2& v2) const -> result_type {
        -
        98  return apply(v1, v2, typename views_are_compatible<V1,V2>::type());
        -
        99  }
        -
        100 
        -
        101  auto operator()(const error_t&) const -> result_type { throw std::bad_cast(); }
        -
        102 private:
        -
        103 
        -
        104  // dispatch from apply overload to a function with distinct name
        -
        105  template <typename V1, typename V2>
        -
        106  BOOST_FORCEINLINE
        -
        107  auto apply(V1 const& v1, V2 const& v2, std::false_type) const -> result_type
        -
        108  {
        -
        109  return ((const Derived*)this)->apply_incompatible(v1, v2);
        -
        110  }
        -
        111 
        -
        112  // dispatch from apply overload to a function with distinct name
        -
        113  template <typename V1, typename V2>
        -
        114  BOOST_FORCEINLINE
        -
        115  auto apply(V1 const& v1, V2 const& v2, std::true_type) const -> result_type
        -
        116  {
        -
        117  return ((const Derived*)this)->apply_compatible(v1, v2);
        -
        118  }
        -
        119 
        -
        120  // function with distinct name - it can be overloaded by subclasses
        -
        121  template <typename V1, typename V2>
        -
        122  BOOST_FORCEINLINE
        -
        123  auto apply_incompatible(V1 const& /*v1*/, V2 const& /*v2*/) const -> result_type
        -
        124  {
        -
        125  throw std::bad_cast();
        -
        126  }
        -
        127 };
        -
        128 
        -
        129 }} // namespace boost::gil
        -
        130 
        -
        132 // std::copy and gil::copy_pixels
        -
        134 
        -
        138 
        -
        139 namespace std {
        -
        140 
        -
        143 template<typename T, typename CS>
        -
        144 BOOST_FORCEINLINE
        -
        145 auto copy(
        - - - - -
        150 {
        -
        151  auto p = std::copy((unsigned char*)first, (unsigned char*)last, (unsigned char*)dst);
        -
        152  return reinterpret_cast<boost::gil::pixel<T, CS>*>(p);
        -
        153 }
        -
        154 
        -
        157 template<typename T, typename CS>
        -
        158 BOOST_FORCEINLINE
        -
        159 auto copy(const boost::gil::pixel<T,CS>* first, const boost::gil::pixel<T,CS>* last,
        - -
        161 {
        -
        162  return (boost::gil::pixel<T,CS>*)std::copy((unsigned char*)first,(unsigned char*)last, (unsigned char*)dst);
        -
        163 }
        -
        164 } // namespace std
        -
        165 
        -
        166 namespace boost { namespace gil {
        -
        167 namespace detail {
        -
        168 template <typename I, typename O> struct copy_fn {
        -
        169  BOOST_FORCEINLINE I operator()(I first, I last, O dst) const { return std::copy(first,last,dst); }
        -
        170 };
        -
        171 } // namespace detail
        -
        172 } } // namespace boost::gil
        -
        173 
        -
        174 namespace std {
        -
        177 template<typename CS, typename IC1, typename IC2> BOOST_FORCEINLINE
        - -
        179 {
        -
        180  boost::gil::gil_function_requires<boost::gil::ChannelsCompatibleConcept<typename std::iterator_traits<IC1>::value_type,typename std::iterator_traits<IC2>::value_type>>();
        -
        181  static_for_each(first,last,dst,boost::gil::detail::copy_fn<IC1,IC2>());
        -
        182  return dst+(last-first);
        -
        183 }
        -
        184 } // namespace std
        -
        185 
        -
        186 namespace boost { namespace gil {
        -
        187 namespace detail {
        -
        190 template <typename I, typename O>
        -
        191 struct copier_n {
        -
        192  BOOST_FORCEINLINE void operator()(I src, typename std::iterator_traits<I>::difference_type n, O dst) const { std::copy(src,src+n, dst); }
        -
        193 };
        -
        194 
        -
        196 template <typename IL, typename O> // IL Models ConstPixelLocatorConcept, O Models PixelIteratorConcept
        -
        197 struct copier_n<iterator_from_2d<IL>,O> {
        -
        198  using diff_t = typename std::iterator_traits<iterator_from_2d<IL>>::difference_type;
        -
        199  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, O dst) const {
        -
        200  gil_function_requires<PixelLocatorConcept<IL>>();
        -
        201  gil_function_requires<MutablePixelIteratorConcept<O>>();
        -
        202  while (n>0) {
        -
        203  diff_t l=src.width()-src.x_pos();
        -
        204  diff_t numToCopy=(n<l ? n:l);
        -
        205  detail::copy_n(src.x(), numToCopy, dst);
        -
        206  dst+=numToCopy;
        -
        207  src+=numToCopy;
        -
        208  n-=numToCopy;
        -
        209  }
        -
        210  }
        -
        211 };
        -
        212 
        -
        214 template <typename I, typename OL> // I Models ConstPixelIteratorConcept, OL Models PixelLocatorConcept
        -
        215 struct copier_n<I,iterator_from_2d<OL>> {
        -
        216  using diff_t = typename std::iterator_traits<I>::difference_type;
        -
        217  BOOST_FORCEINLINE void operator()(I src, diff_t n, iterator_from_2d<OL> dst) const {
        -
        218  gil_function_requires<PixelIteratorConcept<I>>();
        -
        219  gil_function_requires<MutablePixelLocatorConcept<OL>>();
        -
        220  while (n>0) {
        -
        221  diff_t l=dst.width()-dst.x_pos();
        -
        222  diff_t numToCopy=(n<l ? n:l);
        -
        223  detail::copy_n(src, numToCopy, dst.x());
        -
        224  dst+=numToCopy;
        -
        225  src+=numToCopy;
        -
        226  n-=numToCopy;
        -
        227  }
        -
        228  }
        -
        229 };
        -
        230 
        -
        232 template <typename IL, typename OL>
        - -
        234  using diff_t = typename iterator_from_2d<IL>::difference_type;
        -
        235  BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, iterator_from_2d<OL> dst) const {
        -
        236  gil_function_requires<PixelLocatorConcept<IL>>();
        -
        237  gil_function_requires<MutablePixelLocatorConcept<OL>>();
        -
        238  if (src.x_pos()!=dst.x_pos() || src.width()!=dst.width()) {
        -
        239  while(n-->0) {
        -
        240  *dst++=*src++;
        -
        241  }
        -
        242  }
        -
        243  while (n>0) {
        -
        244  diff_t l=dst.width()-dst.x_pos();
        -
        245  diff_t numToCopy=(n<l ? n : l);
        -
        246  detail::copy_n(src.x(), numToCopy, dst.x());
        -
        247  dst+=numToCopy;
        -
        248  src+=numToCopy;
        -
        249  n-=numToCopy;
        -
        250  }
        -
        251  }
        -
        252 };
        -
        253 
        -
        254 template <typename SrcIterator, typename DstIterator>
        -
        255 BOOST_FORCEINLINE auto copy_with_2d_iterators(SrcIterator first, SrcIterator last, DstIterator dst) -> DstIterator {
        -
        256  using src_x_iterator = typename SrcIterator::x_iterator;
        -
        257  using dst_x_iterator = typename DstIterator::x_iterator;
        -
        258 
        -
        259  typename SrcIterator::difference_type n = last - first;
        -
        260 
        -
        261  if (first.is_1d_traversable()) {
        -
        262  if (dst.is_1d_traversable())
        -
        263  copier_n<src_x_iterator,dst_x_iterator>()(first.x(),n, dst.x());
        -
        264  else
        -
        265  copier_n<src_x_iterator,DstIterator >()(first.x(),n, dst);
        -
        266  } else {
        -
        267  if (dst.is_1d_traversable())
        -
        268  copier_n<SrcIterator,dst_x_iterator>()(first,n, dst.x());
        -
        269  else
        -
        270  copier_n<SrcIterator,DstIterator>()(first,n,dst);
        -
        271  }
        -
        272  return dst+n;
        -
        273 }
        -
        274 } // namespace detail
        -
        275 } } // namespace boost::gil
        -
        276 
        -
        277 namespace std {
        -
        280 template <typename IL, typename OL>
        - -
        282 {
        -
        283  return boost::gil::detail::copy_with_2d_iterators(first,last,dst);
        -
        284 }
        -
        285 
        -
        286 } // namespace std
        -
        287 
        -
        288 namespace boost { namespace gil {
        -
        291 template <typename View1, typename View2> BOOST_FORCEINLINE
        -
        292 void copy_pixels(const View1& src, const View2& dst)
        -
        293 {
        -
        294  BOOST_ASSERT(src.dimensions() == dst.dimensions());
        -
        295  detail::copy_with_2d_iterators(src.begin(),src.end(),dst.begin());
        -
        296 }
        -
        297 
        -
        299 // copy_and_convert_pixels
        -
        301 
        -
        307 
        -
        308 namespace detail {
        -
        309 template <typename CC>
        -
        310 class copy_and_convert_pixels_fn : public binary_operation_obj<copy_and_convert_pixels_fn<CC>>
        -
        311 {
        -
        312 private:
        -
        313  CC _cc;
        -
        314 public:
        -
        315  using result_type = typename binary_operation_obj<copy_and_convert_pixels_fn<default_color_converter>>::result_type;
        -
        316  copy_and_convert_pixels_fn() {}
        -
        317  copy_and_convert_pixels_fn(CC cc_in) : _cc(cc_in) {}
        -
        318  // when the two color spaces are incompatible, a color conversion is performed
        -
        319  template <typename V1, typename V2> BOOST_FORCEINLINE
        -
        320  auto apply_incompatible(const V1& src, const V2& dst) const -> result_type {
        -
        321  copy_pixels(color_converted_view<typename V2::value_type>(src,_cc),dst);
        -
        322  }
        -
        323 
        -
        324  // If the two color spaces are compatible, copy_and_convert is just copy
        -
        325  template <typename V1, typename V2> BOOST_FORCEINLINE
        -
        326  auto apply_compatible(const V1& src, const V2& dst) const -> result_type {
        -
        327  copy_pixels(src,dst);
        -
        328  }
        -
        329 };
        -
        330 } // namespace detail
        -
        331 
        -
        333 template <typename V1, typename V2,typename CC>
        -
        334 BOOST_FORCEINLINE
        -
        335 void copy_and_convert_pixels(const V1& src, const V2& dst,CC cc) {
        -
        336  detail::copy_and_convert_pixels_fn<CC> ccp(cc);
        -
        337  ccp(src,dst);
        -
        338 }
        -
        339 
        -
        340 struct default_color_converter;
        -
        341 
        -
        343 template <typename View1, typename View2>
        -
        344 BOOST_FORCEINLINE
        -
        345 void copy_and_convert_pixels(const View1& src, const View2& dst) {
        -
        346  detail::copy_and_convert_pixels_fn<default_color_converter> ccp;
        -
        347  ccp(src,dst);
        -
        348 }
        -
        349 } } // namespace boost::gil
        -
        350 
        -
        352 // std::fill and gil::fill_pixels
        -
        354 
        -
        358 
        -
        359 namespace std {
        -
        368 template <typename IL, typename V>
        - -
        370  boost::gil::gil_function_requires<boost::gil::MutablePixelLocatorConcept<IL>>();
        -
        371  if (first.is_1d_traversable()) {
        -
        372  std::fill(first.x(), last.x(), val);
        -
        373  } else {
        -
        374  // fill row by row
        -
        375  std::ptrdiff_t n=last-first;
        -
        376  while (n>0) {
        -
        377  std::ptrdiff_t numToDo=std::min<const std::ptrdiff_t>(n,(std::ptrdiff_t)(first.width()-first.x_pos()));
        -
        378  std::fill_n(first.x(), numToDo, val);
        -
        379  first+=numToDo;
        -
        380  n-=numToDo;
        -
        381  }
        -
        382  }
        -
        383 }
        -
        384 } // namespace std
        -
        385 
        -
        386 namespace boost { namespace gil {
        -
        387 
        -
        388 namespace detail {
        -
        389 
        -
        391 struct std_fill_t {
        -
        392  template <typename It, typename P>
        -
        393  void operator()(It first, It last, const P& p_in) {
        -
        394  std::fill(first,last,p_in);
        -
        395  }
        -
        396 };
        -
        397 
        -
        399 template <typename It, typename P>
        -
        400 BOOST_FORCEINLINE
        -
        401 void fill_aux(It first, It last, P const& p, std::true_type)
        -
        402 {
        -
        403  static_for_each(first, last, p, std_fill_t());
        -
        404 }
        -
        405 
        -
        407 template <typename It, typename P>
        -
        408 BOOST_FORCEINLINE
        -
        409 void fill_aux(It first, It last, P const& p, std::false_type)
        -
        410 {
        -
        411  std::fill(first, last, p);
        -
        412 }
        -
        413 
        -
        414 } // namespace detail
        -
        415 
        -
        418 template <typename View, typename Value>
        -
        419 BOOST_FORCEINLINE
        -
        420 void fill_pixels(View const& view, Value const& value)
        -
        421 {
        -
        422  if (view.is_1d_traversable())
        -
        423  {
        -
        424  detail::fill_aux(
        -
        425  view.begin().x(), view.end().x(), value, is_planar<View>());
        -
        426  }
        -
        427  else
        -
        428  {
        -
        429  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        -
        430  detail::fill_aux(
        -
        431  view.row_begin(y), view.row_end(y), value, is_planar<View>());
        -
        432  }
        -
        433 }
        -
        434 
        -
        436 // destruct_pixels
        -
        438 
        -
        442 
        -
        443 namespace detail {
        -
        444 template <typename Iterator>
        -
        445 BOOST_FORCEINLINE
        -
        446 void destruct_range_impl(Iterator first, Iterator last,
        -
        447  typename std::enable_if
        -
        448  <
        -
        449  mp11::mp_and
        -
        450  <
        -
        451  std::is_pointer<Iterator>,
        -
        452  mp11::mp_not
        -
        453  <
        -
        454  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
        -
        455  >
        -
        456  >::value
        -
        457  >::type* /*ptr*/ = 0)
        -
        458 {
        -
        459  while (first != last)
        -
        460  {
        -
        461  first->~value_t();
        -
        462  ++first;
        -
        463  }
        -
        464 }
        -
        465 
        -
        466 template <typename Iterator>
        -
        467 BOOST_FORCEINLINE
        -
        468 void destruct_range_impl(Iterator /*first*/, Iterator /*last*/,
        -
        469  typename std::enable_if
        -
        470  <
        -
        471  mp11::mp_or
        -
        472  <
        -
        473  mp11::mp_not<std::is_pointer<Iterator>>,
        -
        474  detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
        -
        475  >::value
        -
        476  >::type* /* ptr */ = nullptr)
        -
        477 {
        -
        478 }
        -
        479 
        -
        480 template <typename Iterator>
        -
        481 BOOST_FORCEINLINE
        -
        482 void destruct_range(Iterator first, Iterator last)
        -
        483 {
        -
        484  destruct_range_impl(first, last);
        -
        485 }
        -
        486 
        -
        487 struct std_destruct_t
        -
        488 {
        -
        489  template <typename Iterator>
        -
        490  void operator()(Iterator first, Iterator last) const
        -
        491  {
        -
        492  destruct_range(first,last);
        -
        493  }
        -
        494 };
        -
        495 
        -
        497 template <typename It>
        -
        498 BOOST_FORCEINLINE
        -
        499 void destruct_aux(It first, It last, std::true_type)
        -
        500 {
        -
        501  static_for_each(first,last,std_destruct_t());
        -
        502 }
        -
        503 
        -
        505 template <typename It>
        -
        506 BOOST_FORCEINLINE
        -
        507 void destruct_aux(It first, It last, std::false_type)
        -
        508 {
        -
        509  destruct_range(first,last);
        -
        510 }
        -
        511 
        -
        512 } // namespace detail
        -
        513 
        -
        516 template <typename View>
        -
        517 BOOST_FORCEINLINE
        -
        518 void destruct_pixels(View const& view)
        -
        519 {
        -
        520  if (view.is_1d_traversable())
        -
        521  {
        -
        522  detail::destruct_aux(
        -
        523  view.begin().x(), view.end().x(), is_planar<View>());
        -
        524  }
        -
        525  else
        -
        526  {
        -
        527  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        -
        528  detail::destruct_aux(
        -
        529  view.row_begin(y), view.row_end(y), is_planar<View>());
        -
        530  }
        -
        531 }
        -
        532 
        -
        534 // uninitialized_fill_pixels
        -
        536 
        -
        540 
        -
        541 namespace detail {
        -
        542 
        -
        545 template <typename It, typename P>
        -
        546 BOOST_FORCEINLINE
        -
        547 void uninitialized_fill_aux(It first, It last, P const& p, std::true_type)
        -
        548 {
        -
        549  std::size_t channel = 0;
        -
        550  try
        -
        551  {
        -
        552  using pixel_t = typename std::iterator_traits<It>::value_type;
        -
        553  while (channel < num_channels<pixel_t>::value)
        -
        554  {
        -
        555  std::uninitialized_fill(
        -
        556  dynamic_at_c(first,channel),
        -
        557  dynamic_at_c(last,channel),
        -
        558  dynamic_at_c(p,channel));
        -
        559 
        -
        560  ++channel;
        -
        561  }
        -
        562  }
        -
        563  catch (...)
        -
        564  {
        -
        565  for (std::size_t c = 0; c < channel; ++c)
        -
        566  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
        -
        567  throw;
        -
        568  }
        -
        569 }
        -
        570 
        -
        573 template <typename It, typename P>
        -
        574 BOOST_FORCEINLINE
        -
        575 void uninitialized_fill_aux(It first, It last, P const& p, std::false_type)
        -
        576 {
        -
        577  std::uninitialized_fill(first,last,p);
        -
        578 }
        -
        579 
        -
        580 } // namespace detail
        -
        581 
        -
        586 template <typename View, typename Value>
        -
        587 void uninitialized_fill_pixels(const View& view, const Value& val) {
        -
        588  if (view.is_1d_traversable())
        -
        589  detail::uninitialized_fill_aux(view.begin().x(), view.end().x(),
        -
        590  val,is_planar<View>());
        -
        591  else {
        -
        592  typename View::y_coord_t y = 0;
        -
        593  try {
        -
        594  for (y=0; y<view.height(); ++y)
        -
        595  detail::uninitialized_fill_aux(view.row_begin(y),view.row_end(y),
        -
        596  val,is_planar<View>());
        -
        597  } catch(...) {
        -
        598  for (typename View::y_coord_t y0=0; y0<y; ++y0)
        -
        599  detail::destruct_aux(view.row_begin(y0),view.row_end(y0), is_planar<View>());
        -
        600  throw;
        -
        601  }
        -
        602  }
        -
        603 }
        -
        604 
        -
        606 // default_construct_pixels
        -
        608 
        -
        612 
        -
        613 namespace detail {
        -
        614 template <typename It> BOOST_FORCEINLINE
        -
        615 void default_construct_range_impl(It first, It last, std::true_type)
        -
        616 {
        -
        617  It first1 = first;
        -
        618  try
        -
        619  {
        -
        620  using value_t = typename std::iterator_traits<It>::value_type;
        -
        621  while (first != last)
        -
        622  {
        -
        623  new (first) value_t();
        -
        624  ++first;
        -
        625  }
        -
        626  }
        -
        627  catch (...)
        -
        628  {
        -
        629  destruct_range(first1, first);
        -
        630  throw;
        -
        631  }
        -
        632 }
        -
        633 
        -
        634 template <typename It>
        -
        635 BOOST_FORCEINLINE
        -
        636 void default_construct_range_impl(It, It, std::false_type) {}
        -
        637 
        -
        638 template <typename It>
        -
        639 BOOST_FORCEINLINE
        -
        640 void default_construct_range(It first, It last)
        -
        641 {
        -
        642  default_construct_range_impl(first, last, typename std::is_pointer<It>::type());
        -
        643 }
        -
        644 
        -
        646 template <typename It>
        -
        647 BOOST_FORCEINLINE
        -
        648 void default_construct_aux(It first, It last, std::true_type)
        -
        649 {
        -
        650  std::size_t channel = 0;
        -
        651  try
        -
        652  {
        -
        653  using pixel_t = typename std::iterator_traits<It>::value_type;
        -
        654  while (channel < num_channels<pixel_t>::value)
        -
        655  {
        -
        656  default_construct_range(dynamic_at_c(first, channel), dynamic_at_c(last, channel));
        -
        657  ++channel;
        -
        658  }
        -
        659  }
        -
        660  catch (...)
        -
        661  {
        -
        662  for (std::size_t c = 0; c < channel; ++c)
        -
        663  destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
        -
        664  throw;
        -
        665  }
        -
        666 }
        -
        667 
        -
        669 template <typename It>
        -
        670 BOOST_FORCEINLINE
        -
        671 void default_construct_aux(It first, It last, std::false_type)
        -
        672 {
        -
        673  default_construct_range(first, last);
        -
        674 }
        -
        675 
        -
        676 template <typename View, bool IsPlanar>
        -
        677 struct has_trivial_pixel_constructor
        -
        678  : detail::is_trivially_default_constructible<typename View::value_type>
        -
        679 {};
        -
        680 
        -
        681 template <typename View>
        -
        682 struct has_trivial_pixel_constructor<View, true>
        -
        683  : detail::is_trivially_default_constructible<typename channel_type<View>::type>
        -
        684 {};
        -
        685 
        -
        686 template<typename View, bool IsTriviallyConstructible>
        -
        687 BOOST_FORCEINLINE
        -
        688 void default_construct_pixels_impl(
        -
        689  View const& view,
        -
        690  std::enable_if<!IsTriviallyConstructible>* /*ptr*/ = nullptr)
        -
        691 {
        -
        692  if (view.is_1d_traversable())
        -
        693  {
        -
        694  detail::default_construct_aux(
        -
        695  view.begin().x(), view.end().x(), is_planar<View>());
        -
        696  }
        -
        697  else
        -
        698  {
        -
        699  typename View::y_coord_t y = 0;
        -
        700  try
        -
        701  {
        -
        702  for( y = 0; y < view.height(); ++y )
        -
        703  detail::default_construct_aux(
        -
        704  view.row_begin(y), view.row_end(y), is_planar<View>());
        -
        705  }
        -
        706  catch(...)
        -
        707  {
        -
        708  for (typename View::y_coord_t y0 = 0; y0 < y; ++y0 )
        -
        709  detail::destruct_aux(
        -
        710  view.row_begin(y0), view.row_end(y0), is_planar<View>());
        -
        711 
        -
        712  throw;
        -
        713  }
        -
        714  }
        -
        715 }
        -
        716 
        -
        717 } // namespace detail
        -
        718 
        -
        723 template <typename View>
        - -
        725 {
        -
        726  detail::default_construct_pixels_impl
        -
        727  <
        -
        728  View,
        -
        729  detail::has_trivial_pixel_constructor
        -
        730  <
        -
        731  View,
        -
        732  is_planar<View>::value
        -
        733  >::value
        -
        734  >(view);
        -
        735 }
        -
        736 
        -
        738 // uninitialized_copy_pixels
        -
        740 
        -
        744 
        -
        745 namespace detail {
        -
        746 
        -
        747 enum class copy_planarity_condition
        -
        748 {
        -
        749  planar_to_planar,
        -
        750  interleaved_to_planar,
        -
        751  mixed_to_interleaved
        -
        752 };
        -
        753 
        -
        754 using planar_to_planar_type =
        -
        755  std::integral_constant
        -
        756  <
        -
        757  copy_planarity_condition, copy_planarity_condition::planar_to_planar
        -
        758  >;
        -
        759 using interleaved_to_planar_type =
        -
        760  std::integral_constant
        -
        761  <
        -
        762  copy_planarity_condition, copy_planarity_condition::interleaved_to_planar
        -
        763  >;
        -
        764 using mixed_to_interleaved_type =
        -
        765  std::integral_constant
        -
        766  <
        -
        767  copy_planarity_condition, copy_planarity_condition::mixed_to_interleaved
        -
        768  >;
        -
        769 
        -
        771 template <typename It1, typename It2>
        -
        772 BOOST_FORCEINLINE
        -
        773 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2 last2, planar_to_planar_type)
        -
        774 {
        -
        775  std::size_t channel=0;
        -
        776  try {
        -
        777  using pixel_t = typename std::iterator_traits<It1>::value_type;
        -
        778  while (channel < num_channels<pixel_t>::value)
        -
        779  {
        -
        780  std::uninitialized_copy(
        -
        781  dynamic_at_c(first1, channel),
        -
        782  dynamic_at_c(last1, channel),
        -
        783  dynamic_at_c(first2, channel));
        -
        784  ++channel;
        -
        785  }
        -
        786  }
        -
        787  catch (...)
        -
        788  {
        -
        789  It2 last2 = first2;
        -
        790  std::advance(last2, std::distance(first1, last1));
        -
        791  for (std::size_t c = 0; c < channel; ++c)
        -
        792  destruct_range(dynamic_at_c(first2, c), dynamic_at_c(last2, c));
        -
        793  throw;
        -
        794  }
        -
        795 }
        -
        796 
        -
        798 template <typename It1, typename It2>
        -
        799 BOOST_FORCEINLINE
        -
        800 void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2, mixed_to_interleaved_type)
        -
        801 {
        -
        802  std::uninitialized_copy(first1, last1, first2);
        -
        803 }
        -
        804 
        -
        806 template <typename It1, typename It2>
        -
        807 BOOST_FORCEINLINE
        -
        808 void uninitialized_copy_aux(It1 first1, It1, It2 first2, It2 last2,
        -
        809 interleaved_to_planar_type)
        -
        810 {
        -
        811  default_construct_aux(first2, last2, std::true_type());
        -
        812 
        -
        813  typename It2::difference_type n = last2 - first2;
        -
        814  copier_n<It1,It2>()(first1, n, first2);
        -
        815 }
        -
        816 } // namespace detail
        -
        817 
        -
        822 template <typename View1, typename View2>
        -
        823 void uninitialized_copy_pixels(View1 const& view1, View2 const& view2)
        -
        824 {
        -
        825  using copy_planarity_condition = detail::copy_planarity_condition;
        -
        826  using copy_planarity_condition_type =
        -
        827  std::integral_constant
        -
        828  <
        -
        829  copy_planarity_condition,
        -
        830  !is_planar<View2>::value
        -
        831  ? copy_planarity_condition::mixed_to_interleaved
        -
        832  : (is_planar<View1>::value
        -
        833  ? copy_planarity_condition::planar_to_planar
        -
        834  : copy_planarity_condition::interleaved_to_planar)
        -
        835  >;
        -
        836  BOOST_ASSERT(view1.dimensions() == view2.dimensions());
        -
        837 
        -
        838  if (view1.is_1d_traversable() && view2.is_1d_traversable())
        -
        839  {
        -
        840  detail::uninitialized_copy_aux(
        -
        841  view1.begin().x(), view1.end().x(), view2.begin().x(), view2.end().x(),
        -
        842  copy_planarity_condition_type());
        -
        843  }
        -
        844  else
        -
        845  {
        -
        846  typename View1::y_coord_t y = 0;
        -
        847  try
        -
        848  {
        -
        849  for (y = 0; y < view1.height(); ++y)
        -
        850  detail::uninitialized_copy_aux(
        -
        851  view1.row_begin(y), view1.row_end(y), view2.row_begin(y), view2.row_end(y),
        -
        852  copy_planarity_condition_type());
        -
        853  }
        -
        854  catch(...)
        -
        855  {
        -
        856  for (typename View1::y_coord_t y0 = 0; y0 < y; ++y0)
        -
        857  detail::destruct_aux(view2.row_begin(y0), view2.row_end(y0), is_planar<View2>());
        -
        858  throw;
        -
        859  }
        -
        860  }
        -
        861 }
        -
        862 
        -
        864 // for_each_pixel
        -
        866 
        -
        875 
        -
        877 template <typename View, typename F>
        -
        878 F for_each_pixel(View const& view, F fun)
        -
        879 {
        -
        880  if (view.is_1d_traversable())
        -
        881  {
        -
        882  return std::for_each(view.begin().x(), view.end().x(), fun);
        -
        883  }
        -
        884  else
        -
        885  {
        -
        886  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        -
        887  for (auto begin = view.row_begin(y), end = view.row_end(y); begin != end; ++begin)
        -
        888  fun(*begin);
        -
        889  return fun;
        -
        890  }
        -
        891 }
        -
        892 
        -
        896 
        -
        898 template <typename View, typename F>
        -
        899 F for_each_pixel_position(View const& view, F fun)
        -
        900 {
        -
        901  typename View::xy_locator loc = view.xy_at(0, 0);
        -
        902  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        -
        903  {
        -
        904  for (std::ptrdiff_t x = 0; x < view.width(); ++x, ++loc.x())
        -
        905  fun(loc);
        -
        906  loc.x() -= view.width(); ++loc.y();
        -
        907  }
        -
        908  return fun;
        -
        909 }
        -
        910 
        -
        912 // generate_pixels
        -
        914 
        -
        918 
        -
        921 template <typename View, typename F>
        -
        922 void generate_pixels(View const& view, F fun)
        -
        923 {
        -
        924  if (view.is_1d_traversable())
        -
        925  {
        -
        926  std::generate(view.begin().x(), view.end().x(), fun);
        -
        927  }
        -
        928  else
        -
        929  {
        -
        930  for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        -
        931  std::generate(view.row_begin(y), view.row_end(y), fun);
        -
        932  }
        -
        933 }
        -
        934 
        -
        936 // std::equal and gil::equal_pixels for GIL constructs
        -
        938 
        -
        942 
        -
        943 template <typename I1, typename I2>
        -
        944 BOOST_FORCEINLINE
        -
        945 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2);
        -
        946 
        -
        947 namespace detail {
        -
        948 
        -
        949 template <typename I1, typename I2>
        -
        950 struct equal_n_fn
        -
        951 {
        -
        952  BOOST_FORCEINLINE
        -
        953  bool operator()(I1 i1, std::ptrdiff_t n, I2 i2) const
        -
        954  {
        -
        955  return std::equal(i1, i1 + n, i2);
        -
        956  }
        -
        957 };
        -
        958 
        -
        961 template<typename T, typename CS>
        -
        962 struct equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
        -
        963 {
        -
        964  BOOST_FORCEINLINE
        -
        965  bool operator()(pixel<T, CS> const* i1, std::ptrdiff_t n, pixel<T, CS> const* i2) const
        -
        966  {
        -
        967  return memcmp(i1, i2, n * sizeof(pixel<T, CS>)) == 0;
        -
        968  }
        -
        969 };
        -
        970 
        -
        971 template<typename T, typename CS>
        -
        972 struct equal_n_fn<pixel<T, CS>*, pixel<T, CS>*>
        -
        973  : equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
        -
        974 {};
        -
        975 
        -
        979 template<typename IC, typename CS>
        -
        980 struct equal_n_fn<planar_pixel_iterator<IC, CS>, planar_pixel_iterator<IC, CS>>
        -
        981 {
        -
        982  BOOST_FORCEINLINE
        -
        983  bool operator()(planar_pixel_iterator<IC, CS> const i1, std::ptrdiff_t n, planar_pixel_iterator<IC, CS> const i2) const
        -
        984  {
        -
        985  // FIXME: ptrdiff_t vs size_t
        -
        986  constexpr std::ptrdiff_t byte_size = n * sizeof(typename std::iterator_traits<IC>::value_type);
        -
        987  for (std::ptrdiff_t i = 0; i < mp11::mp_size<CS>::value; ++i)
        -
        988  {
        -
        989  if (memcmp(dynamic_at_c(i1, i), dynamic_at_c(i2, i), byte_size) != 0)
        -
        990  return false;
        -
        991  }
        -
        992  return true;
        -
        993  }
        -
        994 };
        -
        995 
        -
        999 template <typename Loc, typename It>
        -
        1000 struct equal_n_fn<boost::gil::iterator_from_2d<Loc>, It>
        -
        1001 {
        -
        1002  BOOST_FORCEINLINE
        -
        1003  bool operator()(boost::gil::iterator_from_2d<Loc> i1, std::ptrdiff_t n, It i2) const
        -
        1004  {
        -
        1005  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
        -
        1006  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
        -
        1007  while (n > 0)
        -
        1008  {
        -
        1009  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i1.width() - i1.x_pos());
        -
        1010  if (!equal_n(i1.x(), num, i2))
        -
        1011  return false;
        -
        1012  i1 += num;
        -
        1013  i2 += num;
        -
        1014  n -= num;
        -
        1015  }
        -
        1016  return true;
        -
        1017  }
        -
        1018 };
        -
        1019 
        -
        1023 template <typename It, typename Loc>
        -
        1024 struct equal_n_fn<It, boost::gil::iterator_from_2d<Loc>>
        -
        1025 {
        -
        1026  BOOST_FORCEINLINE
        -
        1027  bool operator()(It i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc> i2) const
        -
        1028  {
        -
        1029  gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
        -
        1030  gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
        -
        1031  while (n > 0)
        -
        1032  {
        -
        1033  std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i2.width() - i2.x_pos());
        -
        1034  if (!equal_n(i1, num, i2.x()))
        -
        1035  return false;
        -
        1036  i1 += num;
        -
        1037  i2 += num;
        -
        1038  n -= num;
        -
        1039  }
        -
        1040  return true;
        -
        1041  }
        -
        1042 };
        -
        1043 
        -
        1045 template <typename Loc1, typename Loc2>
        - -
        1047  BOOST_FORCEINLINE bool operator()(boost::gil::iterator_from_2d<Loc1> i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc2> i2) const {
        -
        1048  gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
        -
        1049  gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
        -
        1050  if (i1.x_pos()!=i2.x_pos() || i1.width()!=i2.width()) {
        -
        1051  while(n-->0) {
        -
        1052  if (*i1++!=*i2++) return false;
        -
        1053  }
        -
        1054  }
        -
        1055  while (n>0) {
        -
        1056  std::ptrdiff_t num=std::min<const std::ptrdiff_t>(n,i2.width()-i2.x_pos());
        -
        1057  if (!equal_n(i1.x(), num, i2.x()))
        -
        1058  return false;
        -
        1059  i1+=num;
        -
        1060  i2+=num;
        -
        1061  n-=num;
        -
        1062  }
        -
        1063  return true;
        -
        1064  }
        -
        1065 };
        -
        1066 } // namespace detail
        -
        1067 
        -
        1068 template <typename I1, typename I2> BOOST_FORCEINLINE
        -
        1069 bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2) {
        -
        1070  return detail::equal_n_fn<I1,I2>()(i1,n,i2);
        -
        1071 }
        -
        1072 } } // namespace boost::gil
        -
        1073 
        -
        1074 namespace std {
        -
        1086 template <typename Loc1, typename Loc2> BOOST_FORCEINLINE
        - -
        1088  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
        -
        1089  boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
        -
        1090  std::ptrdiff_t n=last-first;
        -
        1091  if (first.is_1d_traversable()) {
        -
        1092  if (first2.is_1d_traversable())
        -
        1093  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,typename Loc2::x_iterator>()(first.x(),n, first2.x());
        -
        1094  else
        -
        1095  return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,boost::gil::iterator_from_2d<Loc2>>()(first.x(),n, first2);
        -
        1096  } else {
        -
        1097  if (first2.is_1d_traversable())
        -
        1098  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,typename Loc2::x_iterator>()(first,n, first2.x());
        -
        1099  else
        -
        1100  return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>>()(first,n,first2);
        -
        1101  }
        -
        1102 }
        -
        1103 } // namespace std
        -
        1104 
        -
        1105 namespace boost { namespace gil {
        -
        1108 template <typename View1, typename View2> BOOST_FORCEINLINE
        -
        1109 bool equal_pixels(const View1& v1, const View2& v2) {
        -
        1110  BOOST_ASSERT(v1.dimensions() == v2.dimensions());
        -
        1111  return std::equal(v1.begin(),v1.end(),v2.begin()); // std::equal has overloads with GIL iterators for optimal performance
        -
        1112 }
        -
        1113 
        -
        1119 
        -
        1123 
        -
        1126 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
        -
        1127 F transform_pixels(const View1& src,const View2& dst, F fun) {
        -
        1128  BOOST_ASSERT(src.dimensions() == dst.dimensions());
        -
        1129  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
        -
        1130  typename View1::x_iterator srcIt=src.row_begin(y);
        -
        1131  typename View2::x_iterator dstIt=dst.row_begin(y);
        -
        1132  for (std::ptrdiff_t x=0; x<src.width(); ++x)
        -
        1133  dstIt[x]=fun(srcIt[x]);
        -
        1134  }
        -
        1135  return fun;
        -
        1136 }
        -
        1137 
        -
        1140 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
        -
        1141 F transform_pixels(const View1& src1, const View2& src2,const View3& dst, F fun) {
        -
        1142  for (std::ptrdiff_t y=0; y<dst.height(); ++y) {
        -
        1143  typename View1::x_iterator srcIt1=src1.row_begin(y);
        -
        1144  typename View2::x_iterator srcIt2=src2.row_begin(y);
        -
        1145  typename View3::x_iterator dstIt=dst.row_begin(y);
        -
        1146  for (std::ptrdiff_t x=0; x<dst.width(); ++x)
        -
        1147  dstIt[x]=fun(srcIt1[x],srcIt2[x]);
        -
        1148  }
        -
        1149  return fun;
        -
        1150 }
        -
        1151 
        -
        1155 
        -
        1158 template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
        -
        1159 F transform_pixel_positions(const View1& src,const View2& dst, F fun) {
        -
        1160  BOOST_ASSERT(src.dimensions() == dst.dimensions());
        -
        1161  typename View1::xy_locator loc=src.xy_at(0,0);
        -
        1162  for (std::ptrdiff_t y=0; y<src.height(); ++y) {
        -
        1163  typename View2::x_iterator dstIt=dst.row_begin(y);
        -
        1164  for (std::ptrdiff_t x=0; x<src.width(); ++x, ++loc.x())
        -
        1165  dstIt[x]=fun(loc);
        -
        1166  loc.x()-=src.width(); ++loc.y();
        -
        1167  }
        -
        1168  return fun;
        -
        1169 }
        -
        1170 
        -
        1173 template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
        -
        1174 F transform_pixel_positions(const View1& src1,const View2& src2,const View3& dst, F fun) {
        -
        1175  BOOST_ASSERT(src1.dimensions() == dst.dimensions());
        -
        1176  BOOST_ASSERT(src2.dimensions() == dst.dimensions());
        -
        1177  typename View1::xy_locator loc1=src1.xy_at(0,0);
        -
        1178  typename View2::xy_locator loc2=src2.xy_at(0,0);
        -
        1179  for (std::ptrdiff_t y=0; y<src1.height(); ++y) {
        -
        1180  typename View3::x_iterator dstIt=dst.row_begin(y);
        -
        1181  for (std::ptrdiff_t x=0; x<src1.width(); ++x, ++loc1.x(), ++loc2.x())
        -
        1182  dstIt[x]=fun(loc1,loc2);
        -
        1183  loc1.x()-=src1.width(); ++loc1.y();
        -
        1184  loc2.x()-=src2.width(); ++loc2.y();
        -
        1185  }
        -
        1186  return fun;
        -
        1187 }
        -
        1188 
        -
        1189 
        -
        1190 // Code below this line is moved here from <boost/gil/extension/numeric/algorithm.hpp>
        -
        1191 
        -
        1196 template <typename T>
        -
        1197 struct pixel_proxy : std::remove_reference<typename T::reference> {};
        -
        1198 
        -
        1200 template <typename Iterator1, typename Iterator2, typename BinaryFunction>
        -
        1201 BinaryFunction for_each(Iterator1 first1, Iterator1 last1, Iterator2 first2, BinaryFunction f)
        -
        1202 {
        -
        1203  while (first1 != last1)
        -
        1204  f(*first1++, *first2++);
        -
        1205  return f;
        -
        1206 }
        -
        1207 
        -
        1208 template <typename SrcIterator, typename DstIterator>
        -
        1209 inline
        -
        1210 auto assign_pixels(SrcIterator src, SrcIterator src_end, DstIterator dst) -> DstIterator
        -
        1211 {
        -
        1212  for_each(src, src_end, dst,
        -
        1213  pixel_assigns_t
        -
        1214  <
        -
        1215  typename pixel_proxy<typename std::iterator_traits<SrcIterator>::value_type>::type,
        -
        1216  typename pixel_proxy<typename std::iterator_traits<DstIterator>::value_type>::type
        -
        1217  >());
        -
        1218  return dst + (src_end - src);
        -
        1219 }
        -
        1220 
        -
        1221 namespace detail {
        -
        1222 
        -
        1223 template <std::size_t Size>
        -
        1224 struct inner_product_k_t
        -
        1225 {
        -
        1226  template
        -
        1227  <
        -
        1228  class InputIterator1,
        -
        1229  class InputIterator2,
        -
        1230  class T,
        -
        1231  class BinaryOperation1,
        -
        1232  class BinaryOperation2
        -
        1233  >
        -
        1234  static T apply(
        -
        1235  InputIterator1 first1,
        -
        1236  InputIterator2 first2, T init,
        -
        1237  BinaryOperation1 binary_op1,
        -
        1238  BinaryOperation2 binary_op2)
        -
        1239  {
        -
        1240  init = binary_op1(init, binary_op2(*first1, *first2));
        -
        1241  return inner_product_k_t<Size - 1>::template apply(
        -
        1242  first1 + 1, first2 + 1, init, binary_op1, binary_op2);
        -
        1243  }
        -
        1244 };
        -
        1245 
        -
        1246 template <>
        -
        1247 struct inner_product_k_t<0>
        -
        1248 {
        -
        1249  template
        -
        1250  <
        -
        1251  class InputIterator1,
        -
        1252  class InputIterator2,
        -
        1253  class T,
        -
        1254  class BinaryOperation1,
        -
        1255  class BinaryOperation2
        -
        1256  >
        -
        1257  static T apply(
        -
        1258  InputIterator1 first1,
        -
        1259  InputIterator2 first2,
        -
        1260  T init,
        -
        1261  BinaryOperation1 binary_op1,
        -
        1262  BinaryOperation2 binary_op2)
        -
        1263  {
        -
        1264  return init;
        -
        1265  }
        -
        1266 };
        -
        1267 
        -
        1268 } // namespace detail
        -
        1269 
        -
        1271 template
        -
        1272 <
        -
        1273  std::size_t Size,
        -
        1274  class InputIterator1,
        -
        1275  class InputIterator2,
        -
        1276  class T,
        -
        1277  class BinaryOperation1,
        -
        1278  class BinaryOperation2
        -
        1279 >
        -
        1280 BOOST_FORCEINLINE
        -
        1281 T inner_product_k(
        -
        1282  InputIterator1 first1,
        -
        1283  InputIterator2 first2,
        -
        1284  T init,
        -
        1285  BinaryOperation1 binary_op1,
        -
        1286  BinaryOperation2 binary_op2)
        -
        1287 {
        -
        1288  return detail::inner_product_k_t<Size>::template apply(
        -
        1289  first1, first2, init, binary_op1, binary_op2);
        -
        1290 }
        -
        1291 
        -
        1293 template
        -
        1294 <
        -
        1295  typename PixelAccum,
        -
        1296  typename SrcIterator,
        -
        1297  typename KernelIterator,
        -
        1298  typename Size,
        -
        1299  typename DstIterator
        -
        1300 >
        -
        1301 inline
        -
        1302 auto correlate_pixels_n(
        -
        1303  SrcIterator src_begin,
        -
        1304  SrcIterator src_end,
        -
        1305  KernelIterator kernel_begin,
        -
        1306  Size kernel_size,
        -
        1307  DstIterator dst_begin)
        -
        1308  -> DstIterator
        -
        1309 {
        -
        1310  using src_pixel_ref_t = typename pixel_proxy
        -
        1311  <
        -
        1312  typename std::iterator_traits<SrcIterator>::value_type
        -
        1313  >::type;
        -
        1314  using dst_pixel_ref_t = typename pixel_proxy
        -
        1315  <
        -
        1316  typename std::iterator_traits<DstIterator>::value_type
        -
        1317  >::type;
        -
        1318  using kernel_value_t = typename std::iterator_traits<KernelIterator>::value_type;
        -
        1319 
        -
        1320  PixelAccum accum_zero;
        -
        1321  pixel_zeros_t<PixelAccum>()(accum_zero);
        -
        1322  while (src_begin != src_end)
        -
        1323  {
        -
        1324  pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
        -
        1325  std::inner_product(
        -
        1326  src_begin,
        -
        1327  src_begin + kernel_size,
        -
        1328  kernel_begin,
        -
        1329  accum_zero,
        -
        1330  pixel_plus_t<PixelAccum, PixelAccum, PixelAccum>(),
        -
        1331  pixel_multiplies_scalar_t<src_pixel_ref_t, kernel_value_t, PixelAccum>()),
        -
        1332  *dst_begin);
        -
        1333 
        -
        1334  ++src_begin;
        -
        1335  ++dst_begin;
        -
        1336  }
        -
        1337  return dst_begin;
        -
        1338 }
        -
        1339 
        -
        1341 template
        -
        1342 <
        -
        1343  std::size_t Size,
        -
        1344  typename PixelAccum,
        -
        1345  typename SrcIterator,
        -
        1346  typename KernelIterator,
        -
        1347  typename DstIterator
        -
        1348 >
        -
        1349 inline
        -
        1350 auto correlate_pixels_k(
        -
        1351  SrcIterator src_begin,
        -
        1352  SrcIterator src_end,
        -
        1353  KernelIterator kernel_begin,
        -
        1354  DstIterator dst_begin)
        -
        1355  -> DstIterator
        -
        1356 {
        -
        1357  using src_pixel_ref_t = typename pixel_proxy
        -
        1358  <
        -
        1359  typename std::iterator_traits<SrcIterator>::value_type
        -
        1360  >::type;
        -
        1361  using dst_pixel_ref_t = typename pixel_proxy
        -
        1362  <
        -
        1363  typename std::iterator_traits<DstIterator>::value_type
        -
        1364  >::type;
        -
        1365  using kernel_type = typename std::iterator_traits<KernelIterator>::value_type;
        -
        1366 
        -
        1367  PixelAccum accum_zero;
        -
        1368  pixel_zeros_t<PixelAccum>()(accum_zero);
        -
        1369  while (src_begin != src_end)
        -
        1370  {
        -
        1371  pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
        -
        1372  inner_product_k<Size>(
        -
        1373  src_begin,
        -
        1374  kernel_begin,
        -
        1375  accum_zero,
        -
        1376  pixel_plus_t<PixelAccum, PixelAccum, PixelAccum>(),
        -
        1377  pixel_multiplies_scalar_t<src_pixel_ref_t, kernel_type, PixelAccum>()),
        -
        1378  *dst_begin);
        -
        1379 
        -
        1380  ++src_begin;
        -
        1381  ++dst_begin;
        -
        1382  }
        -
        1383  return dst_begin;
        -
        1384 }
        -
        1385 
        -
        1390 template <typename PixelAccum, typename SrcView, typename Scalar, typename DstView>
        -
        1391 inline
        -
        1392 void view_multiplies_scalar(SrcView const& src_view, Scalar const& scalar, DstView const& dst_view)
        -
        1393 {
        -
        1394  static_assert(std::is_scalar<Scalar>::value, "Scalar is not scalar");
        -
        1395  BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
        -
        1396  using src_pixel_ref_t = typename pixel_proxy<typename SrcView::value_type>::type;
        -
        1397  using dst_pixel_ref_t = typename pixel_proxy<typename DstView::value_type>::type;
        -
        1398  using y_coord_t = typename SrcView::y_coord_t;
        -
        1399 
        -
        1400  y_coord_t const height = src_view.height();
        -
        1401  for (y_coord_t y = 0; y < height; ++y)
        -
        1402  {
        -
        1403  typename SrcView::x_iterator it_src = src_view.row_begin(y);
        -
        1404  typename DstView::x_iterator it_dst = dst_view.row_begin(y);
        -
        1405  typename SrcView::x_iterator it_src_end = src_view.row_end(y);
        -
        1406  while (it_src != it_src_end)
        -
        1407  {
        -
        1408  pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
        -
        1409  pixel_multiplies_scalar_t<src_pixel_ref_t, Scalar, PixelAccum>()(*it_src, scalar),
        -
        1410  *it_dst);
        -
        1411 
        -
        1412  ++it_src;
        -
        1413  ++it_dst;
        -
        1414  }
        -
        1415  }
        -
        1416 }
        -
        1417 
        -
        1418 
        -
        1421 enum class boundary_option
        -
        1422 {
        -
        1423  output_ignore,
        -
        1424  output_zero,
        -
        1425  extend_padded,
        -
        1426  extend_zero,
        -
        1427  extend_constant
        -
        1428 };
        -
        1429 
        -
        1430 namespace detail
        -
        1431 {
        -
        1432 
        -
        1433 template <typename SrcView, typename RltView>
        -
        1434 void extend_row_impl(
        -
        1435  SrcView const& src_view,
        -
        1436  RltView result_view,
        -
        1437  std::size_t extend_count,
        -
        1438  boundary_option option)
        -
        1439 {
        -
        1440  std::ptrdiff_t extend_count_ = static_cast<std::ptrdiff_t>(extend_count);
        -
        1441 
        -
        1442  if (option == boundary_option::extend_constant)
        -
        1443  {
        -
        1444  for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
        -
        1445  {
        -
        1446  if(i >= extend_count_ && i < extend_count_ + src_view.height())
        -
        1447  {
        -
        1448  assign_pixels(
        -
        1449  src_view.row_begin(i - extend_count_),
        -
        1450  src_view.row_end(i - extend_count_),
        -
        1451  result_view.row_begin(i)
        -
        1452  );
        -
        1453  }
        -
        1454  else if(i < extend_count_)
        -
        1455  {
        -
        1456  assign_pixels(src_view.row_begin(0), src_view.row_end(0), result_view.row_begin(i));
        -
        1457  }
        -
        1458  else
        -
        1459  {
        -
        1460  assign_pixels(
        -
        1461  src_view.row_begin(src_view.height() - 1),
        -
        1462  src_view.row_end(src_view.height() - 1),
        -
        1463  result_view.row_begin(i)
        -
        1464  );
        -
        1465  }
        -
        1466 
        -
        1467  }
        -
        1468  }
        -
        1469  else if (option == boundary_option::extend_zero)
        -
        1470  {
        -
        1471  typename SrcView::value_type acc_zero;
        -
        1472  pixel_zeros_t<typename SrcView::value_type>()(acc_zero);
        -
        1473 
        -
        1474  for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
        -
        1475  {
        -
        1476  if (i >= extend_count_ && i < extend_count_ + src_view.height())
        -
        1477  {
        -
        1478  assign_pixels(
        -
        1479  src_view.row_begin(i - extend_count_),
        -
        1480  src_view.row_end(i - extend_count_),
        -
        1481  result_view.row_begin(i)
        -
        1482  );
        -
        1483  }
        -
        1484  else
        -
        1485  {
        -
        1486  std::fill_n(result_view.row_begin(i), result_view.width(), acc_zero);
        -
        1487  }
        -
        1488  }
        -
        1489  }
        -
        1490  else if (option == boundary_option::extend_padded)
        -
        1491  {
        -
        1492  auto original_view = subimage_view(
        -
        1493  src_view,
        -
        1494  0,
        -
        1495  -extend_count,
        -
        1496  src_view.width(),
        -
        1497  src_view.height() + (2 * extend_count)
        -
        1498  );
        -
        1499  for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
        -
        1500  {
        -
        1501  assign_pixels(
        -
        1502  original_view.row_begin(i),
        -
        1503  original_view.row_end(i),
        -
        1504  result_view.row_begin(i)
        -
        1505  );
        -
        1506  }
        -
        1507  }
        -
        1508  else
        -
        1509  {
        -
        1510  BOOST_ASSERT_MSG(false, "Invalid boundary option");
        -
        1511  }
        -
        1512 }
        -
        1513 
        -
        1514 } //namespace detail
        -
        1515 
        -
        1516 
        -
        1523 template <typename SrcView>
        -
        1524 auto extend_row(
        -
        1525  SrcView const& src_view,
        -
        1526  std::size_t extend_count,
        -
        1527  boundary_option option
        -
        1528 ) -> typename gil::image<typename SrcView::value_type>
        -
        1529 {
        -
        1530  typename gil::image<typename SrcView::value_type>
        -
        1531  result_img(src_view.width(), src_view.height() + (2 * extend_count));
        -
        1532 
        -
        1533  auto result_view = view(result_img);
        -
        1534  detail::extend_row_impl(src_view, result_view, extend_count, option);
        -
        1535  return result_img;
        -
        1536 }
        -
        1537 
        -
        1538 
        -
        1545 template <typename SrcView>
        -
        1546 auto extend_col(
        -
        1547  SrcView const& src_view,
        -
        1548  std::size_t extend_count,
        -
        1549  boundary_option option
        -
        1550 ) -> typename gil::image<typename SrcView::value_type>
        -
        1551 {
        -
        1552  auto src_view_rotate = rotated90cw_view(src_view);
        -
        1553 
        -
        1554  typename gil::image<typename SrcView::value_type>
        -
        1555  result_img(src_view.width() + (2 * extend_count), src_view.height());
        -
        1556 
        -
        1557  auto result_view = rotated90cw_view(view(result_img));
        -
        1558  detail::extend_row_impl(src_view_rotate, result_view, extend_count, option);
        -
        1559  return result_img;
        -
        1560 }
        -
        1561 
        -
        1568 template <typename SrcView>
        -
        1569 auto extend_boundary(
        -
        1570  SrcView const& src_view,
        -
        1571  std::size_t extend_count,
        -
        1572  boundary_option option
        -
        1573 ) -> typename gil::image<typename SrcView::value_type>
        -
        1574 {
        -
        1575  if (option == boundary_option::extend_padded)
        -
        1576  {
        -
        1577  typename gil::image<typename SrcView::value_type>
        -
        1578  result_img(src_view.width()+(2 * extend_count), src_view.height()+(2 * extend_count));
        -
        1579  typename gil::image<typename SrcView::value_type>::view_t result_view = view(result_img);
        -
        1580 
        -
        1581  auto original_view = subimage_view(
        -
        1582  src_view,
        -
        1583  -extend_count,
        -
        1584  -extend_count,
        -
        1585  src_view.width() + (2 * extend_count),
        -
        1586  src_view.height() + (2 * extend_count)
        -
        1587  );
        -
        1588 
        -
        1589  for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
        -
        1590  {
        -
        1591  assign_pixels(
        -
        1592  original_view.row_begin(i),
        -
        1593  original_view.row_end(i),
        -
        1594  result_view.row_begin(i)
        -
        1595  );
        -
        1596  }
        -
        1597 
        -
        1598  return result_img;
        -
        1599  }
        -
        1600 
        -
        1601  auto auxilary_img = extend_col(src_view, extend_count, option);
        -
        1602  return extend_row(view(auxilary_img), extend_count, option);
        -
        1603 }
        -
        1604 
        -
        1605 } } // namespace boost::gil
        -
        1606 
        -
        1607 #endif
        -
        Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
        Definition: iterator_from_2d.hpp:46
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition: algorithm.hpp:292
        -
        void default_construct_pixels(View const &view)
        Invokes the in-place default constructor on every pixel of the (uninitialized) view....
        Definition: algorithm.hpp:724
        -
        BOOST_FORCEINLINE void destruct_pixels(View const &view)
        Invokes the in-place destructor on every pixel of the view.
        Definition: algorithm.hpp:518
        -
        BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
        std::equal for image views
        Definition: algorithm.hpp:1109
        -
        BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
        std::fill for image views
        Definition: algorithm.hpp:420
        -
        void generate_pixels(View const &view, F fun)
        std::generate for image views
        Definition: algorithm.hpp:922
        -
        BOOST_FORCEINLINE F transform_pixel_positions(const View1 &src1, const View2 &src2, const View3 &dst, F fun)
        transform_pixel_positions with two sources
        Definition: algorithm.hpp:1174
        -
        BOOST_FORCEINLINE F transform_pixels(const View1 &src1, const View2 &src2, const View3 &dst, F fun)
        transform_pixels with two sources
        Definition: algorithm.hpp:1141
        -
        void uninitialized_copy_pixels(View1 const &view1, View2 const &view2)
        std::uninitialized_copy for image views. Does not support planar heterogeneous views....
        Definition: algorithm.hpp:823
        -
        void uninitialized_fill_pixels(const View &view, const Value &val)
        std::uninitialized_fill for image views. Does not support planar heterogeneous views....
        Definition: algorithm.hpp:587
        -
        BOOST_FORCEINLINE auto copy1(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst) -> boost::gil::iterator_from_2d< OL >
        std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition: algorithm.hpp:281
        -
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition: algorithm.hpp:1087
        -
        void fill(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
        std::fill(I,I,V) with I being a iterator_from_2d
        Definition: algorithm.hpp:369
        -
        BOOST_FORCEINLINE auto copy(boost::gil::planar_pixel_iterator< IC1, CS > first, boost::gil::planar_pixel_iterator< IC1, CS > last, boost::gil::planar_pixel_iterator< IC2, CS > dst) -> boost::gil::planar_pixel_iterator< IC2, CS >
        Copy when both src and dst are planar pointers is copy for each channel.
        Definition: algorithm.hpp:178
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        A generic binary operation on views.
        Definition: algorithm.hpp:88
        -
        Definition: algorithm.hpp:191
        -
        struct to do std::fill
        Definition: algorithm.hpp:391
        -
        Reference proxy associated with a type that has a "reference" member type alias.
        Definition: algorithm.hpp:1197
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: pixel.hpp:106
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: planar_pixel_iterator.hpp:58
        -
        Returns whether two views are compatible.
        Definition: concepts/image_view.hpp:524
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_ALGORITHM_HPP
        +
        10#define BOOST_GIL_ALGORITHM_HPP
        +
        11
        +
        12#include <boost/gil/metafunctions.hpp>
        +
        13#include <boost/gil/pixel_iterator.hpp>
        +
        14#include <boost/gil/pixel_numeric_operations.hpp>
        +
        15#include <boost/gil/image.hpp>
        +
        16#include <boost/gil/bit_aligned_pixel_iterator.hpp>
        +
        17#include <boost/gil/color_base_algorithm.hpp>
        +
        18#include <boost/gil/concepts.hpp>
        +
        19#include <boost/gil/image_view.hpp>
        +
        20#include <boost/gil/image_view_factory.hpp>
        +
        21#include <boost/gil/detail/mp11.hpp>
        +
        22#include <boost/gil/detail/type_traits.hpp>
        +
        23
        +
        24#include <boost/assert.hpp>
        +
        25#include <boost/config.hpp>
        +
        26
        +
        27#include <algorithm>
        +
        28#include <cstddef>
        +
        29#include <cstring>
        +
        30#include <iterator>
        +
        31#include <memory>
        +
        32#include <type_traits>
        +
        33#include <typeinfo>
        +
        34#include <numeric>
        +
        35
        +
        +
        36namespace boost { namespace gil {
        +
        37
        +
        38//forward declarations
        +
        39template <typename ChannelPtr, typename ColorSpace>
        +
        40struct planar_pixel_iterator;
        +
        41template <typename Iterator>
        +
        42class memory_based_step_iterator;
        +
        43template <typename StepIterator>
        +
        44class memory_based_2d_locator;
        +
        45
        +
        46// a tag denoting incompatible arguments
        +
        47struct error_t {};
        +
        48
        +
        73
        +
        77
        +
        86template <typename Derived, typename Result=void>
        +
        + +
        88{
        +
        89 using result_type = Result;
        +
        90
        +
        91 template <typename V1, typename V2> BOOST_FORCEINLINE
        +
        92 auto operator()(const std::pair<const V1*,const V2*>& p) const -> result_type {
        +
        93 return apply(*p.first, *p.second, typename views_are_compatible<V1,V2>::type());
        +
        94 }
        +
        95
        +
        96 template <typename V1, typename V2> BOOST_FORCEINLINE
        +
        97 auto operator()(const V1& v1, const V2& v2) const -> result_type {
        +
        98 return apply(v1, v2, typename views_are_compatible<V1,V2>::type());
        +
        99 }
        +
        100
        +
        101 auto operator()(const error_t&) const -> result_type { throw std::bad_cast(); }
        +
        102private:
        +
        103
        +
        104 // dispatch from apply overload to a function with distinct name
        +
        105 template <typename V1, typename V2>
        +
        106 BOOST_FORCEINLINE
        +
        107 auto apply(V1 const& v1, V2 const& v2, std::false_type) const -> result_type
        +
        108 {
        +
        109 return ((const Derived*)this)->apply_incompatible(v1, v2);
        +
        110 }
        +
        111
        +
        112 // dispatch from apply overload to a function with distinct name
        +
        113 template <typename V1, typename V2>
        +
        114 BOOST_FORCEINLINE
        +
        115 auto apply(V1 const& v1, V2 const& v2, std::true_type) const -> result_type
        +
        116 {
        +
        117 return ((const Derived*)this)->apply_compatible(v1, v2);
        +
        118 }
        +
        119
        +
        120 // function with distinct name - it can be overloaded by subclasses
        +
        121 template <typename V1, typename V2>
        +
        122 BOOST_FORCEINLINE
        +
        123 auto apply_incompatible(V1 const& /*v1*/, V2 const& /*v2*/) const -> result_type
        +
        124 {
        +
        125 throw std::bad_cast();
        +
        126 }
        +
        127};
        +
        +
        128
        +
        129}} // namespace boost::gil
        +
        +
        130
        +
        132// std::copy and gil::copy_pixels
        +
        134
        +
        138
        +
        139namespace std {
        +
        140
        +
        143template<typename T, typename CS>
        +
        144BOOST_FORCEINLINE
        +
        145auto copy(
        + + + + +
        150{
        +
        151 auto p = std::copy((unsigned char*)first, (unsigned char*)last, (unsigned char*)dst);
        +
        152 return reinterpret_cast<boost::gil::pixel<T, CS>*>(p);
        +
        153}
        +
        154
        +
        157template<typename T, typename CS>
        +
        158BOOST_FORCEINLINE
        +
        159auto copy(const boost::gil::pixel<T,CS>* first, const boost::gil::pixel<T,CS>* last,
        + +
        161{
        +
        162 return (boost::gil::pixel<T,CS>*)std::copy((unsigned char*)first,(unsigned char*)last, (unsigned char*)dst);
        +
        163}
        +
        164} // namespace std
        +
        165
        +
        166namespace boost { namespace gil {
        +
        167namespace detail {
        +
        168template <typename I, typename O> struct copy_fn {
        +
        169 BOOST_FORCEINLINE I operator()(I first, I last, O dst) const { return std::copy(first,last,dst); }
        +
        170};
        +
        171} // namespace detail
        +
        172} } // namespace boost::gil
        +
        173
        +
        174namespace std {
        +
        177template<typename CS, typename IC1, typename IC2> BOOST_FORCEINLINE
        +
        + +
        179{
        +
        180 boost::gil::gil_function_requires<boost::gil::ChannelsCompatibleConcept<typename std::iterator_traits<IC1>::value_type,typename std::iterator_traits<IC2>::value_type>>();
        +
        181 static_for_each(first,last,dst,boost::gil::detail::copy_fn<IC1,IC2>());
        +
        182 return dst+(last-first);
        +
        183}
        +
        +
        184} // namespace std
        +
        185
        +
        186namespace boost { namespace gil {
        +
        187namespace detail {
        +
        190template <typename I, typename O>
        +
        +
        191struct copier_n {
        +
        192 BOOST_FORCEINLINE void operator()(I src, typename std::iterator_traits<I>::difference_type n, O dst) const { std::copy(src,src+n, dst); }
        +
        193};
        +
        +
        194
        +
        196template <typename IL, typename O> // IL Models ConstPixelLocatorConcept, O Models PixelIteratorConcept
        +
        + +
        198 using diff_t = typename std::iterator_traits<iterator_from_2d<IL>>::difference_type;
        +
        199 BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, O dst) const {
        +
        200 gil_function_requires<PixelLocatorConcept<IL>>();
        +
        201 gil_function_requires<MutablePixelIteratorConcept<O>>();
        +
        202 while (n>0) {
        +
        203 diff_t l=src.width()-src.x_pos();
        +
        204 diff_t numToCopy=(n<l ? n:l);
        +
        205 detail::copy_n(src.x(), numToCopy, dst);
        +
        206 dst+=numToCopy;
        +
        207 src+=numToCopy;
        +
        208 n-=numToCopy;
        +
        209 }
        +
        210 }
        +
        211};
        +
        +
        212
        +
        214template <typename I, typename OL> // I Models ConstPixelIteratorConcept, OL Models PixelLocatorConcept
        +
        + +
        216 using diff_t = typename std::iterator_traits<I>::difference_type;
        +
        217 BOOST_FORCEINLINE void operator()(I src, diff_t n, iterator_from_2d<OL> dst) const {
        +
        218 gil_function_requires<PixelIteratorConcept<I>>();
        +
        219 gil_function_requires<MutablePixelLocatorConcept<OL>>();
        +
        220 while (n>0) {
        +
        221 diff_t l=dst.width()-dst.x_pos();
        +
        222 diff_t numToCopy=(n<l ? n:l);
        +
        223 detail::copy_n(src, numToCopy, dst.x());
        +
        224 dst+=numToCopy;
        +
        225 src+=numToCopy;
        +
        226 n-=numToCopy;
        +
        227 }
        +
        228 }
        +
        229};
        +
        +
        230
        +
        232template <typename IL, typename OL>
        +
        + +
        234 using diff_t = typename iterator_from_2d<IL>::difference_type;
        +
        235 BOOST_FORCEINLINE void operator()(iterator_from_2d<IL> src, diff_t n, iterator_from_2d<OL> dst) const {
        +
        236 gil_function_requires<PixelLocatorConcept<IL>>();
        +
        237 gil_function_requires<MutablePixelLocatorConcept<OL>>();
        +
        238 if (src.x_pos()!=dst.x_pos() || src.width()!=dst.width()) {
        +
        239 while(n-->0) {
        +
        240 *dst++=*src++;
        +
        241 }
        +
        242 }
        +
        243 while (n>0) {
        +
        244 diff_t l=dst.width()-dst.x_pos();
        +
        245 diff_t numToCopy=(n<l ? n : l);
        +
        246 detail::copy_n(src.x(), numToCopy, dst.x());
        +
        247 dst+=numToCopy;
        +
        248 src+=numToCopy;
        +
        249 n-=numToCopy;
        +
        250 }
        +
        251 }
        +
        252};
        +
        +
        253
        +
        254template <typename SrcIterator, typename DstIterator>
        +
        255BOOST_FORCEINLINE auto copy_with_2d_iterators(SrcIterator first, SrcIterator last, DstIterator dst) -> DstIterator {
        +
        256 using src_x_iterator = typename SrcIterator::x_iterator;
        +
        257 using dst_x_iterator = typename DstIterator::x_iterator;
        +
        258
        +
        259 typename SrcIterator::difference_type n = last - first;
        +
        260
        +
        261 if (first.is_1d_traversable()) {
        +
        262 if (dst.is_1d_traversable())
        +
        263 copier_n<src_x_iterator,dst_x_iterator>()(first.x(),n, dst.x());
        +
        264 else
        +
        265 copier_n<src_x_iterator,DstIterator >()(first.x(),n, dst);
        +
        266 } else {
        +
        267 if (dst.is_1d_traversable())
        +
        268 copier_n<SrcIterator,dst_x_iterator>()(first,n, dst.x());
        +
        269 else
        +
        270 copier_n<SrcIterator,DstIterator>()(first,n,dst);
        +
        271 }
        +
        272 return dst+n;
        +
        273}
        +
        274} // namespace detail
        +
        275} } // namespace boost::gil
        +
        276
        +
        277namespace std {
        +
        280template <typename IL, typename OL>
        +
        + +
        282{
        +
        283 return boost::gil::detail::copy_with_2d_iterators(first,last,dst);
        +
        284}
        +
        +
        285
        +
        286} // namespace std
        +
        287
        +
        288namespace boost { namespace gil {
        +
        291template <typename View1, typename View2> BOOST_FORCEINLINE
        +
        +
        292void copy_pixels(const View1& src, const View2& dst)
        +
        293{
        +
        294 BOOST_ASSERT(src.dimensions() == dst.dimensions());
        +
        295 detail::copy_with_2d_iterators(src.begin(),src.end(),dst.begin());
        +
        296}
        +
        +
        297
        +
        299// copy_and_convert_pixels
        +
        301
        +
        307
        +
        308namespace detail {
        +
        309template <typename CC>
        +
        310class copy_and_convert_pixels_fn : public binary_operation_obj<copy_and_convert_pixels_fn<CC>>
        +
        311{
        +
        312private:
        +
        313 CC _cc;
        +
        314public:
        +
        315 using result_type = typename binary_operation_obj<copy_and_convert_pixels_fn<default_color_converter>>::result_type;
        +
        316 copy_and_convert_pixels_fn() {}
        +
        317 copy_and_convert_pixels_fn(CC cc_in) : _cc(cc_in) {}
        +
        318 // when the two color spaces are incompatible, a color conversion is performed
        +
        319 template <typename V1, typename V2> BOOST_FORCEINLINE
        +
        320 auto apply_incompatible(const V1& src, const V2& dst) const -> result_type {
        +
        321 copy_pixels(color_converted_view<typename V2::value_type>(src,_cc),dst);
        +
        322 }
        +
        323
        +
        324 // If the two color spaces are compatible, copy_and_convert is just copy
        +
        325 template <typename V1, typename V2> BOOST_FORCEINLINE
        +
        326 auto apply_compatible(const V1& src, const V2& dst) const -> result_type {
        +
        327 copy_pixels(src,dst);
        +
        328 }
        +
        329};
        +
        330} // namespace detail
        +
        331
        +
        333template <typename V1, typename V2,typename CC>
        +
        334BOOST_FORCEINLINE
        +
        335void copy_and_convert_pixels(const V1& src, const V2& dst,CC cc) {
        +
        336 detail::copy_and_convert_pixels_fn<CC> ccp(cc);
        +
        337 ccp(src,dst);
        +
        338}
        +
        339
        +
        340struct default_color_converter;
        +
        341
        +
        343template <typename View1, typename View2>
        +
        344BOOST_FORCEINLINE
        +
        345void copy_and_convert_pixels(const View1& src, const View2& dst) {
        +
        346 detail::copy_and_convert_pixels_fn<default_color_converter> ccp;
        +
        347 ccp(src,dst);
        +
        348}
        +
        349} } // namespace boost::gil
        +
        350
        +
        352// std::fill and gil::fill_pixels
        +
        354
        +
        358
        +
        359namespace std {
        +
        368template <typename IL, typename V>
        +
        + +
        370 boost::gil::gil_function_requires<boost::gil::MutablePixelLocatorConcept<IL>>();
        +
        371 if (first.is_1d_traversable()) {
        +
        372 std::fill(first.x(), last.x(), val);
        +
        373 } else {
        +
        374 // fill row by row
        +
        375 std::ptrdiff_t n=last-first;
        +
        376 while (n>0) {
        +
        377 std::ptrdiff_t numToDo=std::min<const std::ptrdiff_t>(n,(std::ptrdiff_t)(first.width()-first.x_pos()));
        +
        378 std::fill_n(first.x(), numToDo, val);
        +
        379 first+=numToDo;
        +
        380 n-=numToDo;
        +
        381 }
        +
        382 }
        +
        383}
        +
        +
        384} // namespace std
        +
        385
        +
        386namespace boost { namespace gil {
        +
        387
        +
        388namespace detail {
        +
        389
        +
        + +
        392 template <typename It, typename P>
        +
        393 void operator()(It first, It last, const P& p_in) {
        +
        394 std::fill(first,last,p_in);
        +
        395 }
        +
        396};
        +
        +
        397
        +
        399template <typename It, typename P>
        +
        400BOOST_FORCEINLINE
        +
        401void fill_aux(It first, It last, P const& p, std::true_type)
        +
        402{
        +
        403 static_for_each(first, last, p, std_fill_t());
        +
        404}
        +
        405
        +
        407template <typename It, typename P>
        +
        408BOOST_FORCEINLINE
        +
        409void fill_aux(It first, It last, P const& p, std::false_type)
        +
        410{
        +
        411 std::fill(first, last, p);
        +
        412}
        +
        413
        +
        414} // namespace detail
        +
        415
        +
        418template <typename View, typename Value>
        +
        419BOOST_FORCEINLINE
        +
        +
        420void fill_pixels(View const& view, Value const& value)
        +
        421{
        +
        422 if (view.is_1d_traversable())
        +
        423 {
        +
        424 detail::fill_aux(
        +
        425 view.begin().x(), view.end().x(), value, is_planar<View>());
        +
        426 }
        +
        427 else
        +
        428 {
        +
        429 for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        +
        430 detail::fill_aux(
        +
        431 view.row_begin(y), view.row_end(y), value, is_planar<View>());
        +
        432 }
        +
        433}
        +
        +
        434
        +
        436// destruct_pixels
        +
        438
        +
        442
        +
        443namespace detail {
        +
        444template <typename Iterator>
        +
        445BOOST_FORCEINLINE
        +
        446void destruct_range_impl(Iterator first, Iterator last,
        +
        447 typename std::enable_if
        +
        448 <
        +
        449 mp11::mp_and
        +
        450 <
        +
        451 std::is_pointer<Iterator>,
        +
        452 mp11::mp_not
        +
        453 <
        +
        454 detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
        +
        455 >
        +
        456 >::value
        +
        457 >::type* /*ptr*/ = 0)
        +
        458{
        +
        459 while (first != last)
        +
        460 {
        +
        461 first->~value_t();
        +
        462 ++first;
        +
        463 }
        +
        464}
        +
        465
        +
        466template <typename Iterator>
        +
        467BOOST_FORCEINLINE
        +
        468void destruct_range_impl(Iterator /*first*/, Iterator /*last*/,
        +
        469 typename std::enable_if
        +
        470 <
        +
        471 mp11::mp_or
        +
        472 <
        +
        473 mp11::mp_not<std::is_pointer<Iterator>>,
        +
        474 detail::is_trivially_destructible<typename std::iterator_traits<Iterator>::value_type>
        +
        475 >::value
        +
        476 >::type* /* ptr */ = nullptr)
        +
        477{
        +
        478}
        +
        479
        +
        480template <typename Iterator>
        +
        481BOOST_FORCEINLINE
        +
        482void destruct_range(Iterator first, Iterator last)
        +
        483{
        +
        484 destruct_range_impl(first, last);
        +
        485}
        +
        486
        +
        487struct std_destruct_t
        +
        488{
        +
        489 template <typename Iterator>
        +
        490 void operator()(Iterator first, Iterator last) const
        +
        491 {
        +
        492 destruct_range(first,last);
        +
        493 }
        +
        494};
        +
        495
        +
        497template <typename It>
        +
        498BOOST_FORCEINLINE
        +
        499void destruct_aux(It first, It last, std::true_type)
        +
        500{
        +
        501 static_for_each(first,last,std_destruct_t());
        +
        502}
        +
        503
        +
        505template <typename It>
        +
        506BOOST_FORCEINLINE
        +
        507void destruct_aux(It first, It last, std::false_type)
        +
        508{
        +
        509 destruct_range(first,last);
        +
        510}
        +
        511
        +
        512} // namespace detail
        +
        513
        +
        516template <typename View>
        +
        517BOOST_FORCEINLINE
        +
        +
        518void destruct_pixels(View const& view)
        +
        519{
        +
        520 if (view.is_1d_traversable())
        +
        521 {
        +
        522 detail::destruct_aux(
        +
        523 view.begin().x(), view.end().x(), is_planar<View>());
        +
        524 }
        +
        525 else
        +
        526 {
        +
        527 for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        +
        528 detail::destruct_aux(
        +
        529 view.row_begin(y), view.row_end(y), is_planar<View>());
        +
        530 }
        +
        531}
        +
        +
        532
        +
        534// uninitialized_fill_pixels
        +
        536
        +
        540
        +
        541namespace detail {
        +
        542
        +
        545template <typename It, typename P>
        +
        546BOOST_FORCEINLINE
        +
        547void uninitialized_fill_aux(It first, It last, P const& p, std::true_type)
        +
        548{
        +
        549 std::size_t channel = 0;
        +
        550 try
        +
        551 {
        +
        552 using pixel_t = typename std::iterator_traits<It>::value_type;
        +
        553 while (channel < num_channels<pixel_t>::value)
        +
        554 {
        +
        555 std::uninitialized_fill(
        +
        556 dynamic_at_c(first,channel),
        +
        557 dynamic_at_c(last,channel),
        +
        558 dynamic_at_c(p,channel));
        +
        559
        +
        560 ++channel;
        +
        561 }
        +
        562 }
        +
        563 catch (...)
        +
        564 {
        +
        565 for (std::size_t c = 0; c < channel; ++c)
        +
        566 destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
        +
        567 throw;
        +
        568 }
        +
        569}
        +
        570
        +
        573template <typename It, typename P>
        +
        574BOOST_FORCEINLINE
        +
        575void uninitialized_fill_aux(It first, It last, P const& p, std::false_type)
        +
        576{
        +
        577 std::uninitialized_fill(first,last,p);
        +
        578}
        +
        579
        +
        580} // namespace detail
        +
        581
        +
        586template <typename View, typename Value>
        +
        +
        587void uninitialized_fill_pixels(const View& view, const Value& val) {
        +
        588 if (view.is_1d_traversable())
        +
        589 detail::uninitialized_fill_aux(view.begin().x(), view.end().x(),
        +
        590 val,is_planar<View>());
        +
        591 else {
        +
        592 typename View::y_coord_t y = 0;
        +
        593 try {
        +
        594 for (y=0; y<view.height(); ++y)
        +
        595 detail::uninitialized_fill_aux(view.row_begin(y),view.row_end(y),
        +
        596 val,is_planar<View>());
        +
        597 } catch(...) {
        +
        598 for (typename View::y_coord_t y0=0; y0<y; ++y0)
        +
        599 detail::destruct_aux(view.row_begin(y0),view.row_end(y0), is_planar<View>());
        +
        600 throw;
        +
        601 }
        +
        602 }
        +
        603}
        +
        +
        604
        +
        606// default_construct_pixels
        +
        608
        +
        612
        +
        613namespace detail {
        +
        614template <typename It> BOOST_FORCEINLINE
        +
        615void default_construct_range_impl(It first, It last, std::true_type)
        +
        616{
        +
        617 It first1 = first;
        +
        618 try
        +
        619 {
        +
        620 using value_t = typename std::iterator_traits<It>::value_type;
        +
        621 while (first != last)
        +
        622 {
        +
        623 new (first) value_t();
        +
        624 ++first;
        +
        625 }
        +
        626 }
        +
        627 catch (...)
        +
        628 {
        +
        629 destruct_range(first1, first);
        +
        630 throw;
        +
        631 }
        +
        632}
        +
        633
        +
        634template <typename It>
        +
        635BOOST_FORCEINLINE
        +
        636void default_construct_range_impl(It, It, std::false_type) {}
        +
        637
        +
        638template <typename It>
        +
        639BOOST_FORCEINLINE
        +
        640void default_construct_range(It first, It last)
        +
        641{
        +
        642 default_construct_range_impl(first, last, typename std::is_pointer<It>::type());
        +
        643}
        +
        644
        +
        646template <typename It>
        +
        647BOOST_FORCEINLINE
        +
        648void default_construct_aux(It first, It last, std::true_type)
        +
        649{
        +
        650 std::size_t channel = 0;
        +
        651 try
        +
        652 {
        +
        653 using pixel_t = typename std::iterator_traits<It>::value_type;
        +
        654 while (channel < num_channels<pixel_t>::value)
        +
        655 {
        +
        656 default_construct_range(dynamic_at_c(first, channel), dynamic_at_c(last, channel));
        +
        657 ++channel;
        +
        658 }
        +
        659 }
        +
        660 catch (...)
        +
        661 {
        +
        662 for (std::size_t c = 0; c < channel; ++c)
        +
        663 destruct_range(dynamic_at_c(first, c), dynamic_at_c(last, c));
        +
        664 throw;
        +
        665 }
        +
        666}
        +
        667
        +
        669template <typename It>
        +
        670BOOST_FORCEINLINE
        +
        671void default_construct_aux(It first, It last, std::false_type)
        +
        672{
        +
        673 default_construct_range(first, last);
        +
        674}
        +
        675
        +
        676template <typename View, bool IsPlanar>
        +
        677struct has_trivial_pixel_constructor
        +
        678 : detail::is_trivially_default_constructible<typename View::value_type>
        +
        679{};
        +
        680
        +
        681template <typename View>
        +
        682struct has_trivial_pixel_constructor<View, true>
        +
        683 : detail::is_trivially_default_constructible<typename channel_type<View>::type>
        +
        684{};
        +
        685
        +
        686template<typename View, bool IsTriviallyConstructible>
        +
        687BOOST_FORCEINLINE
        +
        688void default_construct_pixels_impl(
        +
        689 View const& view,
        +
        690 std::enable_if<!IsTriviallyConstructible>* /*ptr*/ = nullptr)
        +
        691{
        +
        692 if (view.is_1d_traversable())
        +
        693 {
        +
        694 detail::default_construct_aux(
        +
        695 view.begin().x(), view.end().x(), is_planar<View>());
        +
        696 }
        +
        697 else
        +
        698 {
        +
        699 typename View::y_coord_t y = 0;
        +
        700 try
        +
        701 {
        +
        702 for( y = 0; y < view.height(); ++y )
        +
        703 detail::default_construct_aux(
        +
        704 view.row_begin(y), view.row_end(y), is_planar<View>());
        +
        705 }
        +
        706 catch(...)
        +
        707 {
        +
        708 for (typename View::y_coord_t y0 = 0; y0 < y; ++y0 )
        +
        709 detail::destruct_aux(
        +
        710 view.row_begin(y0), view.row_end(y0), is_planar<View>());
        +
        711
        +
        712 throw;
        +
        713 }
        +
        714 }
        +
        715}
        +
        716
        +
        717} // namespace detail
        +
        718
        +
        723template <typename View>
        +
        + +
        725{
        +
        726 detail::default_construct_pixels_impl
        +
        727 <
        +
        728 View,
        +
        729 detail::has_trivial_pixel_constructor
        +
        730 <
        +
        731 View,
        +
        732 is_planar<View>::value
        +
        733 >::value
        +
        734 >(view);
        +
        735}
        +
        +
        736
        +
        738// uninitialized_copy_pixels
        +
        740
        +
        744
        +
        745namespace detail {
        +
        746
        +
        747enum class copy_planarity_condition
        +
        748{
        +
        749 planar_to_planar,
        +
        750 interleaved_to_planar,
        +
        751 mixed_to_interleaved
        +
        752};
        +
        753
        +
        754using planar_to_planar_type =
        +
        755 std::integral_constant
        +
        756 <
        +
        757 copy_planarity_condition, copy_planarity_condition::planar_to_planar
        +
        758 >;
        +
        759using interleaved_to_planar_type =
        +
        760 std::integral_constant
        +
        761 <
        +
        762 copy_planarity_condition, copy_planarity_condition::interleaved_to_planar
        +
        763 >;
        +
        764using mixed_to_interleaved_type =
        +
        765 std::integral_constant
        +
        766 <
        +
        767 copy_planarity_condition, copy_planarity_condition::mixed_to_interleaved
        +
        768 >;
        +
        769
        +
        771template <typename It1, typename It2>
        +
        772BOOST_FORCEINLINE
        +
        773void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2 last2, planar_to_planar_type)
        +
        774{
        +
        775 std::size_t channel=0;
        +
        776 try {
        +
        777 using pixel_t = typename std::iterator_traits<It1>::value_type;
        +
        778 while (channel < num_channels<pixel_t>::value)
        +
        779 {
        +
        780 std::uninitialized_copy(
        +
        781 dynamic_at_c(first1, channel),
        +
        782 dynamic_at_c(last1, channel),
        +
        783 dynamic_at_c(first2, channel));
        +
        784 ++channel;
        +
        785 }
        +
        786 }
        +
        787 catch (...)
        +
        788 {
        +
        789 It2 last2 = first2;
        +
        790 std::advance(last2, std::distance(first1, last1));
        +
        791 for (std::size_t c = 0; c < channel; ++c)
        +
        792 destruct_range(dynamic_at_c(first2, c), dynamic_at_c(last2, c));
        +
        793 throw;
        +
        794 }
        +
        795}
        +
        796
        +
        798template <typename It1, typename It2>
        +
        799BOOST_FORCEINLINE
        +
        800void uninitialized_copy_aux(It1 first1, It1 last1, It2 first2, It2, mixed_to_interleaved_type)
        +
        801{
        +
        802 std::uninitialized_copy(first1, last1, first2);
        +
        803}
        +
        804
        +
        806template <typename It1, typename It2>
        +
        807BOOST_FORCEINLINE
        +
        808void uninitialized_copy_aux(It1 first1, It1, It2 first2, It2 last2,
        +
        809interleaved_to_planar_type)
        +
        810{
        +
        811 default_construct_aux(first2, last2, std::true_type());
        +
        812
        +
        813 typename It2::difference_type n = last2 - first2;
        +
        814 copier_n<It1,It2>()(first1, n, first2);
        +
        815}
        +
        816} // namespace detail
        +
        817
        +
        822template <typename View1, typename View2>
        +
        +
        823void uninitialized_copy_pixels(View1 const& view1, View2 const& view2)
        +
        824{
        +
        825 using copy_planarity_condition = detail::copy_planarity_condition;
        +
        826 using copy_planarity_condition_type =
        +
        827 std::integral_constant
        +
        828 <
        +
        829 copy_planarity_condition,
        +
        830 !is_planar<View2>::value
        +
        831 ? copy_planarity_condition::mixed_to_interleaved
        +
        832 : (is_planar<View1>::value
        +
        833 ? copy_planarity_condition::planar_to_planar
        +
        834 : copy_planarity_condition::interleaved_to_planar)
        +
        835 >;
        +
        836 BOOST_ASSERT(view1.dimensions() == view2.dimensions());
        +
        837
        +
        838 if (view1.is_1d_traversable() && view2.is_1d_traversable())
        +
        839 {
        +
        840 detail::uninitialized_copy_aux(
        +
        841 view1.begin().x(), view1.end().x(), view2.begin().x(), view2.end().x(),
        +
        842 copy_planarity_condition_type());
        +
        843 }
        +
        844 else
        +
        845 {
        +
        846 typename View1::y_coord_t y = 0;
        +
        847 try
        +
        848 {
        +
        849 for (y = 0; y < view1.height(); ++y)
        +
        850 detail::uninitialized_copy_aux(
        +
        851 view1.row_begin(y), view1.row_end(y), view2.row_begin(y), view2.row_end(y),
        +
        852 copy_planarity_condition_type());
        +
        853 }
        +
        854 catch(...)
        +
        855 {
        +
        856 for (typename View1::y_coord_t y0 = 0; y0 < y; ++y0)
        +
        857 detail::destruct_aux(view2.row_begin(y0), view2.row_end(y0), is_planar<View2>());
        +
        858 throw;
        +
        859 }
        +
        860 }
        +
        861}
        +
        +
        862
        +
        864// for_each_pixel
        +
        866
        +
        875
        +
        877template <typename View, typename F>
        +
        878F for_each_pixel(View const& view, F fun)
        +
        879{
        +
        880 if (view.is_1d_traversable())
        +
        881 {
        +
        882 return std::for_each(view.begin().x(), view.end().x(), fun);
        +
        883 }
        +
        884 else
        +
        885 {
        +
        886 for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        +
        887 for (auto begin = view.row_begin(y), end = view.row_end(y); begin != end; ++begin)
        +
        888 fun(*begin);
        +
        889 return fun;
        +
        890 }
        +
        891}
        +
        892
        +
        896
        +
        898template <typename View, typename F>
        +
        899F for_each_pixel_position(View const& view, F fun)
        +
        900{
        +
        901 typename View::xy_locator loc = view.xy_at(0, 0);
        +
        902 for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        +
        903 {
        +
        904 for (std::ptrdiff_t x = 0; x < view.width(); ++x, ++loc.x())
        +
        905 fun(loc);
        +
        906 loc.x() -= view.width(); ++loc.y();
        +
        907 }
        +
        908 return fun;
        +
        909}
        +
        910
        +
        912// generate_pixels
        +
        914
        +
        918
        +
        921template <typename View, typename F>
        +
        +
        922void generate_pixels(View const& view, F fun)
        +
        923{
        +
        924 if (view.is_1d_traversable())
        +
        925 {
        +
        926 std::generate(view.begin().x(), view.end().x(), fun);
        +
        927 }
        +
        928 else
        +
        929 {
        +
        930 for (std::ptrdiff_t y = 0; y < view.height(); ++y)
        +
        931 std::generate(view.row_begin(y), view.row_end(y), fun);
        +
        932 }
        +
        933}
        +
        +
        934
        +
        936// std::equal and gil::equal_pixels for GIL constructs
        +
        938
        +
        942
        +
        943template <typename I1, typename I2>
        +
        944BOOST_FORCEINLINE
        +
        945bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2);
        +
        946
        +
        947namespace detail {
        +
        948
        +
        949template <typename I1, typename I2>
        +
        950struct equal_n_fn
        +
        951{
        +
        952 BOOST_FORCEINLINE
        +
        953 bool operator()(I1 i1, std::ptrdiff_t n, I2 i2) const
        +
        954 {
        +
        955 return std::equal(i1, i1 + n, i2);
        +
        956 }
        +
        957};
        +
        958
        +
        961template<typename T, typename CS>
        +
        +
        962struct equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
        +
        963{
        +
        964 BOOST_FORCEINLINE
        +
        965 bool operator()(pixel<T, CS> const* i1, std::ptrdiff_t n, pixel<T, CS> const* i2) const
        +
        966 {
        +
        967 return memcmp(i1, i2, n * sizeof(pixel<T, CS>)) == 0;
        +
        968 }
        +
        969};
        +
        +
        970
        +
        971template<typename T, typename CS>
        +
        972struct equal_n_fn<pixel<T, CS>*, pixel<T, CS>*>
        +
        973 : equal_n_fn<pixel<T, CS> const*, pixel<T, CS> const*>
        +
        974{};
        +
        975
        +
        979template<typename IC, typename CS>
        +
        +
        980struct equal_n_fn<planar_pixel_iterator<IC, CS>, planar_pixel_iterator<IC, CS>>
        +
        981{
        +
        982 BOOST_FORCEINLINE
        +
        983 bool operator()(planar_pixel_iterator<IC, CS> const i1, std::ptrdiff_t n, planar_pixel_iterator<IC, CS> const i2) const
        +
        984 {
        +
        985 // FIXME: ptrdiff_t vs size_t
        +
        986 constexpr std::ptrdiff_t byte_size = n * sizeof(typename std::iterator_traits<IC>::value_type);
        +
        987 for (std::ptrdiff_t i = 0; i < mp11::mp_size<CS>::value; ++i)
        +
        988 {
        +
        989 if (memcmp(dynamic_at_c(i1, i), dynamic_at_c(i2, i), byte_size) != 0)
        +
        990 return false;
        +
        991 }
        +
        992 return true;
        +
        993 }
        +
        994};
        +
        +
        995
        +
        999template <typename Loc, typename It>
        +
        +
        1000struct equal_n_fn<boost::gil::iterator_from_2d<Loc>, It>
        +
        1001{
        +
        1002 BOOST_FORCEINLINE
        +
        1003 bool operator()(boost::gil::iterator_from_2d<Loc> i1, std::ptrdiff_t n, It i2) const
        +
        1004 {
        +
        1005 gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
        +
        1006 gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
        +
        1007 while (n > 0)
        +
        1008 {
        +
        1009 std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i1.width() - i1.x_pos());
        +
        1010 if (!equal_n(i1.x(), num, i2))
        +
        1011 return false;
        +
        1012 i1 += num;
        +
        1013 i2 += num;
        +
        1014 n -= num;
        +
        1015 }
        +
        1016 return true;
        +
        1017 }
        +
        1018};
        +
        +
        1019
        +
        1023template <typename It, typename Loc>
        +
        +
        1024struct equal_n_fn<It, boost::gil::iterator_from_2d<Loc>>
        +
        1025{
        +
        1026 BOOST_FORCEINLINE
        +
        1027 bool operator()(It i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc> i2) const
        +
        1028 {
        +
        1029 gil_function_requires<boost::gil::PixelIteratorConcept<It>>();
        +
        1030 gil_function_requires<boost::gil::PixelLocatorConcept<Loc>>();
        +
        1031 while (n > 0)
        +
        1032 {
        +
        1033 std::ptrdiff_t const num = std::min<std::ptrdiff_t>(n, i2.width() - i2.x_pos());
        +
        1034 if (!equal_n(i1, num, i2.x()))
        +
        1035 return false;
        +
        1036 i1 += num;
        +
        1037 i2 += num;
        +
        1038 n -= num;
        +
        1039 }
        +
        1040 return true;
        +
        1041 }
        +
        1042};
        +
        +
        1043
        +
        1045template <typename Loc1, typename Loc2>
        +
        + +
        1047 BOOST_FORCEINLINE bool operator()(boost::gil::iterator_from_2d<Loc1> i1, std::ptrdiff_t n, boost::gil::iterator_from_2d<Loc2> i2) const {
        +
        1048 gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
        +
        1049 gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
        +
        1050 if (i1.x_pos()!=i2.x_pos() || i1.width()!=i2.width()) {
        +
        1051 while(n-->0) {
        +
        1052 if (*i1++!=*i2++) return false;
        +
        1053 }
        +
        1054 }
        +
        1055 while (n>0) {
        +
        1056 std::ptrdiff_t num=std::min<const std::ptrdiff_t>(n,i2.width()-i2.x_pos());
        +
        1057 if (!equal_n(i1.x(), num, i2.x()))
        +
        1058 return false;
        +
        1059 i1+=num;
        +
        1060 i2+=num;
        +
        1061 n-=num;
        +
        1062 }
        +
        1063 return true;
        +
        1064 }
        +
        1065};
        +
        +
        1066} // namespace detail
        +
        1067
        +
        1068template <typename I1, typename I2> BOOST_FORCEINLINE
        +
        1069bool equal_n(I1 i1, std::ptrdiff_t n, I2 i2) {
        +
        1070 return detail::equal_n_fn<I1,I2>()(i1,n,i2);
        +
        1071}
        +
        1072} } // namespace boost::gil
        +
        1073
        +
        1074namespace std {
        +
        1086template <typename Loc1, typename Loc2> BOOST_FORCEINLINE
        +
        + +
        1088 boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc1>>();
        +
        1089 boost::gil::gil_function_requires<boost::gil::PixelLocatorConcept<Loc2>>();
        +
        1090 std::ptrdiff_t n=last-first;
        +
        1091 if (first.is_1d_traversable()) {
        +
        1092 if (first2.is_1d_traversable())
        +
        1093 return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,typename Loc2::x_iterator>()(first.x(),n, first2.x());
        +
        1094 else
        +
        1095 return boost::gil::detail::equal_n_fn<typename Loc1::x_iterator,boost::gil::iterator_from_2d<Loc2>>()(first.x(),n, first2);
        +
        1096 } else {
        +
        1097 if (first2.is_1d_traversable())
        +
        1098 return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,typename Loc2::x_iterator>()(first,n, first2.x());
        +
        1099 else
        +
        1100 return boost::gil::detail::equal_n_fn<boost::gil::iterator_from_2d<Loc1>,boost::gil::iterator_from_2d<Loc2>>()(first,n,first2);
        +
        1101 }
        +
        1102}
        +
        +
        1103} // namespace std
        +
        1104
        +
        1105namespace boost { namespace gil {
        +
        1108template <typename View1, typename View2> BOOST_FORCEINLINE
        +
        +
        1109bool equal_pixels(const View1& v1, const View2& v2) {
        +
        1110 BOOST_ASSERT(v1.dimensions() == v2.dimensions());
        +
        1111 return std::equal(v1.begin(),v1.end(),v2.begin()); // std::equal has overloads with GIL iterators for optimal performance
        +
        1112}
        +
        +
        1113
        +
        1119
        +
        1123
        +
        1126template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
        +
        +
        1127F transform_pixels(const View1& src,const View2& dst, F fun) {
        +
        1128 BOOST_ASSERT(src.dimensions() == dst.dimensions());
        +
        1129 for (std::ptrdiff_t y=0; y<src.height(); ++y) {
        +
        1130 typename View1::x_iterator srcIt=src.row_begin(y);
        +
        1131 typename View2::x_iterator dstIt=dst.row_begin(y);
        +
        1132 for (std::ptrdiff_t x=0; x<src.width(); ++x)
        +
        1133 dstIt[x]=fun(srcIt[x]);
        +
        1134 }
        +
        1135 return fun;
        +
        1136}
        +
        +
        1137
        +
        1140template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
        +
        +
        1141F transform_pixels(const View1& src1, const View2& src2,const View3& dst, F fun) {
        +
        1142 for (std::ptrdiff_t y=0; y<dst.height(); ++y) {
        +
        1143 typename View1::x_iterator srcIt1=src1.row_begin(y);
        +
        1144 typename View2::x_iterator srcIt2=src2.row_begin(y);
        +
        1145 typename View3::x_iterator dstIt=dst.row_begin(y);
        +
        1146 for (std::ptrdiff_t x=0; x<dst.width(); ++x)
        +
        1147 dstIt[x]=fun(srcIt1[x],srcIt2[x]);
        +
        1148 }
        +
        1149 return fun;
        +
        1150}
        +
        +
        1151
        +
        1155
        +
        1158template <typename View1, typename View2, typename F> BOOST_FORCEINLINE
        +
        +
        1159F transform_pixel_positions(const View1& src,const View2& dst, F fun) {
        +
        1160 BOOST_ASSERT(src.dimensions() == dst.dimensions());
        +
        1161 typename View1::xy_locator loc=src.xy_at(0,0);
        +
        1162 for (std::ptrdiff_t y=0; y<src.height(); ++y) {
        +
        1163 typename View2::x_iterator dstIt=dst.row_begin(y);
        +
        1164 for (std::ptrdiff_t x=0; x<src.width(); ++x, ++loc.x())
        +
        1165 dstIt[x]=fun(loc);
        +
        1166 loc.x()-=src.width(); ++loc.y();
        +
        1167 }
        +
        1168 return fun;
        +
        1169}
        +
        +
        1170
        +
        1173template <typename View1, typename View2, typename View3, typename F> BOOST_FORCEINLINE
        +
        +
        1174F transform_pixel_positions(const View1& src1,const View2& src2,const View3& dst, F fun) {
        +
        1175 BOOST_ASSERT(src1.dimensions() == dst.dimensions());
        +
        1176 BOOST_ASSERT(src2.dimensions() == dst.dimensions());
        +
        1177 typename View1::xy_locator loc1=src1.xy_at(0,0);
        +
        1178 typename View2::xy_locator loc2=src2.xy_at(0,0);
        +
        1179 for (std::ptrdiff_t y=0; y<src1.height(); ++y) {
        +
        1180 typename View3::x_iterator dstIt=dst.row_begin(y);
        +
        1181 for (std::ptrdiff_t x=0; x<src1.width(); ++x, ++loc1.x(), ++loc2.x())
        +
        1182 dstIt[x]=fun(loc1,loc2);
        +
        1183 loc1.x()-=src1.width(); ++loc1.y();
        +
        1184 loc2.x()-=src2.width(); ++loc2.y();
        +
        1185 }
        +
        1186 return fun;
        +
        1187}
        +
        +
        1188
        +
        1189
        +
        1190// Code below this line is moved here from <boost/gil/extension/numeric/algorithm.hpp>
        +
        1191
        +
        1196template <typename T>
        +
        1197struct pixel_proxy : std::remove_reference<typename T::reference> {};
        +
        1198
        +
        1200template <typename Iterator1, typename Iterator2, typename BinaryFunction>
        +
        1201BinaryFunction for_each(Iterator1 first1, Iterator1 last1, Iterator2 first2, BinaryFunction f)
        +
        1202{
        +
        1203 while (first1 != last1)
        +
        1204 f(*first1++, *first2++);
        +
        1205 return f;
        +
        1206}
        +
        1207
        +
        1208template <typename SrcIterator, typename DstIterator>
        +
        1209inline
        +
        1210auto assign_pixels(SrcIterator src, SrcIterator src_end, DstIterator dst) -> DstIterator
        +
        1211{
        +
        1212 for_each(src, src_end, dst,
        +
        1213 pixel_assigns_t
        +
        1214 <
        +
        1215 typename pixel_proxy<typename std::iterator_traits<SrcIterator>::value_type>::type,
        +
        1216 typename pixel_proxy<typename std::iterator_traits<DstIterator>::value_type>::type
        +
        1217 >());
        +
        1218 return dst + (src_end - src);
        +
        1219}
        +
        1220
        +
        1221namespace detail {
        +
        1222
        +
        1223template <std::size_t Size>
        +
        1224struct inner_product_k_t
        +
        1225{
        +
        1226 template
        +
        1227 <
        +
        1228 class InputIterator1,
        +
        1229 class InputIterator2,
        +
        1230 class T,
        +
        1231 class BinaryOperation1,
        +
        1232 class BinaryOperation2
        +
        1233 >
        +
        1234 static T apply(
        +
        1235 InputIterator1 first1,
        +
        1236 InputIterator2 first2, T init,
        +
        1237 BinaryOperation1 binary_op1,
        +
        1238 BinaryOperation2 binary_op2)
        +
        1239 {
        +
        1240 init = binary_op1(init, binary_op2(*first1, *first2));
        +
        1241 return inner_product_k_t<Size - 1>::apply(
        +
        1242 first1 + 1, first2 + 1, init, binary_op1, binary_op2);
        +
        1243 }
        +
        1244};
        +
        1245
        +
        1246template <>
        +
        1247struct inner_product_k_t<0>
        +
        1248{
        +
        1249 template
        +
        1250 <
        +
        1251 class InputIterator1,
        +
        1252 class InputIterator2,
        +
        1253 class T,
        +
        1254 class BinaryOperation1,
        +
        1255 class BinaryOperation2
        +
        1256 >
        +
        1257 static T apply(
        +
        1258 InputIterator1 first1,
        +
        1259 InputIterator2 first2,
        +
        1260 T init,
        +
        1261 BinaryOperation1 binary_op1,
        +
        1262 BinaryOperation2 binary_op2)
        +
        1263 {
        +
        1264 return init;
        +
        1265 }
        +
        1266};
        +
        1267
        +
        1268} // namespace detail
        +
        1269
        +
        1271template
        +
        1272<
        +
        1273 std::size_t Size,
        +
        1274 class InputIterator1,
        +
        1275 class InputIterator2,
        +
        1276 class T,
        +
        1277 class BinaryOperation1,
        +
        1278 class BinaryOperation2
        +
        1279>
        +
        1280BOOST_FORCEINLINE
        +
        1281T inner_product_k(
        +
        1282 InputIterator1 first1,
        +
        1283 InputIterator2 first2,
        +
        1284 T init,
        +
        1285 BinaryOperation1 binary_op1,
        +
        1286 BinaryOperation2 binary_op2)
        +
        1287{
        +
        1288 return detail::inner_product_k_t<Size>::apply(
        +
        1289 first1, first2, init, binary_op1, binary_op2);
        +
        1290}
        +
        1291
        +
        1293template
        +
        1294<
        +
        1295 typename PixelAccum,
        +
        1296 typename SrcIterator,
        +
        1297 typename KernelIterator,
        +
        1298 typename Size,
        +
        1299 typename DstIterator
        +
        1300>
        +
        1301inline
        +
        1302auto correlate_pixels_n(
        +
        1303 SrcIterator src_begin,
        +
        1304 SrcIterator src_end,
        +
        1305 KernelIterator kernel_begin,
        +
        1306 Size kernel_size,
        +
        1307 DstIterator dst_begin)
        +
        1308 -> DstIterator
        +
        1309{
        +
        1310 using src_pixel_ref_t = typename pixel_proxy
        +
        1311 <
        +
        1312 typename std::iterator_traits<SrcIterator>::value_type
        +
        1313 >::type;
        +
        1314 using dst_pixel_ref_t = typename pixel_proxy
        +
        1315 <
        +
        1316 typename std::iterator_traits<DstIterator>::value_type
        +
        1317 >::type;
        +
        1318 using kernel_value_t = typename std::iterator_traits<KernelIterator>::value_type;
        +
        1319
        +
        1320 PixelAccum accum_zero;
        +
        1321 pixel_zeros_t<PixelAccum>()(accum_zero);
        +
        1322 while (src_begin != src_end)
        +
        1323 {
        +
        1324 pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
        +
        1325 std::inner_product(
        +
        1326 src_begin,
        +
        1327 src_begin + kernel_size,
        +
        1328 kernel_begin,
        +
        1329 accum_zero,
        +
        1330 pixel_plus_t<PixelAccum, PixelAccum, PixelAccum>(),
        +
        1331 pixel_multiplies_scalar_t<src_pixel_ref_t, kernel_value_t, PixelAccum>()),
        +
        1332 *dst_begin);
        +
        1333
        +
        1334 ++src_begin;
        +
        1335 ++dst_begin;
        +
        1336 }
        +
        1337 return dst_begin;
        +
        1338}
        +
        1339
        +
        1341template
        +
        1342<
        +
        1343 std::size_t Size,
        +
        1344 typename PixelAccum,
        +
        1345 typename SrcIterator,
        +
        1346 typename KernelIterator,
        +
        1347 typename DstIterator
        +
        1348>
        +
        1349inline
        +
        1350auto correlate_pixels_k(
        +
        1351 SrcIterator src_begin,
        +
        1352 SrcIterator src_end,
        +
        1353 KernelIterator kernel_begin,
        +
        1354 DstIterator dst_begin)
        +
        1355 -> DstIterator
        +
        1356{
        +
        1357 using src_pixel_ref_t = typename pixel_proxy
        +
        1358 <
        +
        1359 typename std::iterator_traits<SrcIterator>::value_type
        +
        1360 >::type;
        +
        1361 using dst_pixel_ref_t = typename pixel_proxy
        +
        1362 <
        +
        1363 typename std::iterator_traits<DstIterator>::value_type
        +
        1364 >::type;
        +
        1365 using kernel_type = typename std::iterator_traits<KernelIterator>::value_type;
        +
        1366
        +
        1367 PixelAccum accum_zero;
        +
        1368 pixel_zeros_t<PixelAccum>()(accum_zero);
        +
        1369 while (src_begin != src_end)
        +
        1370 {
        +
        1371 pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
        +
        1372 inner_product_k<Size>(
        +
        1373 src_begin,
        +
        1374 kernel_begin,
        +
        1375 accum_zero,
        +
        1376 pixel_plus_t<PixelAccum, PixelAccum, PixelAccum>(),
        +
        1377 pixel_multiplies_scalar_t<src_pixel_ref_t, kernel_type, PixelAccum>()),
        +
        1378 *dst_begin);
        +
        1379
        +
        1380 ++src_begin;
        +
        1381 ++dst_begin;
        +
        1382 }
        +
        1383 return dst_begin;
        +
        1384}
        +
        1385
        +
        1390template <typename PixelAccum, typename SrcView, typename Scalar, typename DstView>
        +
        1391inline
        +
        1392void view_multiplies_scalar(SrcView const& src_view, Scalar const& scalar, DstView const& dst_view)
        +
        1393{
        +
        1394 static_assert(std::is_scalar<Scalar>::value, "Scalar is not scalar");
        +
        1395 BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
        +
        1396 using src_pixel_ref_t = typename pixel_proxy<typename SrcView::value_type>::type;
        +
        1397 using dst_pixel_ref_t = typename pixel_proxy<typename DstView::value_type>::type;
        +
        1398 using y_coord_t = typename SrcView::y_coord_t;
        +
        1399
        +
        1400 y_coord_t const height = src_view.height();
        +
        1401 for (y_coord_t y = 0; y < height; ++y)
        +
        1402 {
        +
        1403 typename SrcView::x_iterator it_src = src_view.row_begin(y);
        +
        1404 typename DstView::x_iterator it_dst = dst_view.row_begin(y);
        +
        1405 typename SrcView::x_iterator it_src_end = src_view.row_end(y);
        +
        1406 while (it_src != it_src_end)
        +
        1407 {
        +
        1408 pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(
        +
        1409 pixel_multiplies_scalar_t<src_pixel_ref_t, Scalar, PixelAccum>()(*it_src, scalar),
        +
        1410 *it_dst);
        +
        1411
        +
        1412 ++it_src;
        +
        1413 ++it_dst;
        +
        1414 }
        +
        1415 }
        +
        1416}
        +
        1417
        +
        1418
        +
        1421enum class boundary_option
        +
        1422{
        +
        1423 output_ignore,
        +
        1424 output_zero,
        +
        1425 extend_padded,
        +
        1426 extend_zero,
        +
        1427 extend_constant
        +
        1428};
        +
        1429
        +
        1430namespace detail
        +
        1431{
        +
        1432
        +
        1433template <typename SrcView, typename RltView>
        +
        1434void extend_row_impl(
        +
        1435 SrcView const& src_view,
        +
        1436 RltView result_view,
        +
        1437 std::size_t extend_count,
        +
        1438 boundary_option option)
        +
        1439{
        +
        1440 std::ptrdiff_t extend_count_ = static_cast<std::ptrdiff_t>(extend_count);
        +
        1441
        +
        1442 if (option == boundary_option::extend_constant)
        +
        1443 {
        +
        1444 for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
        +
        1445 {
        +
        1446 if(i >= extend_count_ && i < extend_count_ + src_view.height())
        +
        1447 {
        +
        1448 assign_pixels(
        +
        1449 src_view.row_begin(i - extend_count_),
        +
        1450 src_view.row_end(i - extend_count_),
        +
        1451 result_view.row_begin(i)
        +
        1452 );
        +
        1453 }
        +
        1454 else if(i < extend_count_)
        +
        1455 {
        +
        1456 assign_pixels(src_view.row_begin(0), src_view.row_end(0), result_view.row_begin(i));
        +
        1457 }
        +
        1458 else
        +
        1459 {
        +
        1460 assign_pixels(
        +
        1461 src_view.row_begin(src_view.height() - 1),
        +
        1462 src_view.row_end(src_view.height() - 1),
        +
        1463 result_view.row_begin(i)
        +
        1464 );
        +
        1465 }
        +
        1466
        +
        1467 }
        +
        1468 }
        +
        1469 else if (option == boundary_option::extend_zero)
        +
        1470 {
        +
        1471 typename SrcView::value_type acc_zero;
        +
        1472 pixel_zeros_t<typename SrcView::value_type>()(acc_zero);
        +
        1473
        +
        1474 for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
        +
        1475 {
        +
        1476 if (i >= extend_count_ && i < extend_count_ + src_view.height())
        +
        1477 {
        +
        1478 assign_pixels(
        +
        1479 src_view.row_begin(i - extend_count_),
        +
        1480 src_view.row_end(i - extend_count_),
        +
        1481 result_view.row_begin(i)
        +
        1482 );
        +
        1483 }
        +
        1484 else
        +
        1485 {
        +
        1486 std::fill_n(result_view.row_begin(i), result_view.width(), acc_zero);
        +
        1487 }
        +
        1488 }
        +
        1489 }
        +
        1490 else if (option == boundary_option::extend_padded)
        +
        1491 {
        +
        1492 auto original_view = subimage_view(
        +
        1493 src_view,
        +
        1494 0,
        +
        1495 -extend_count,
        +
        1496 src_view.width(),
        +
        1497 src_view.height() + (2 * extend_count)
        +
        1498 );
        +
        1499 for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
        +
        1500 {
        +
        1501 assign_pixels(
        +
        1502 original_view.row_begin(i),
        +
        1503 original_view.row_end(i),
        +
        1504 result_view.row_begin(i)
        +
        1505 );
        +
        1506 }
        +
        1507 }
        +
        1508 else
        +
        1509 {
        +
        1510 BOOST_ASSERT_MSG(false, "Invalid boundary option");
        +
        1511 }
        +
        1512}
        +
        1513
        +
        1514} //namespace detail
        +
        1515
        +
        1516
        +
        1523template <typename SrcView>
        +
        1524auto extend_row(
        +
        1525 SrcView const& src_view,
        +
        1526 std::size_t extend_count,
        +
        1527 boundary_option option
        +
        1528) -> typename gil::image<typename SrcView::value_type>
        +
        1529{
        +
        1530 typename gil::image<typename SrcView::value_type>
        +
        1531 result_img(src_view.width(), src_view.height() + (2 * extend_count));
        +
        1532
        +
        1533 auto result_view = view(result_img);
        +
        1534 detail::extend_row_impl(src_view, result_view, extend_count, option);
        +
        1535 return result_img;
        +
        1536}
        +
        1537
        +
        1538
        +
        1545template <typename SrcView>
        +
        1546auto extend_col(
        +
        1547 SrcView const& src_view,
        +
        1548 std::size_t extend_count,
        +
        1549 boundary_option option
        +
        1550) -> typename gil::image<typename SrcView::value_type>
        +
        1551{
        +
        1552 auto src_view_rotate = rotated90cw_view(src_view);
        +
        1553
        +
        1554 typename gil::image<typename SrcView::value_type>
        +
        1555 result_img(src_view.width() + (2 * extend_count), src_view.height());
        +
        1556
        +
        1557 auto result_view = rotated90cw_view(view(result_img));
        +
        1558 detail::extend_row_impl(src_view_rotate, result_view, extend_count, option);
        +
        1559 return result_img;
        +
        1560}
        +
        1561
        +
        1568template <typename SrcView>
        +
        1569auto extend_boundary(
        +
        1570 SrcView const& src_view,
        +
        1571 std::size_t extend_count,
        +
        1572 boundary_option option
        +
        1573) -> typename gil::image<typename SrcView::value_type>
        +
        1574{
        +
        1575 if (option == boundary_option::extend_padded)
        +
        1576 {
        +
        1577 typename gil::image<typename SrcView::value_type>
        +
        1578 result_img(src_view.width()+(2 * extend_count), src_view.height()+(2 * extend_count));
        +
        1579 typename gil::image<typename SrcView::value_type>::view_t result_view = view(result_img);
        +
        1580
        +
        1581 auto original_view = subimage_view(
        +
        1582 src_view,
        +
        1583 -extend_count,
        +
        1584 -extend_count,
        +
        1585 src_view.width() + (2 * extend_count),
        +
        1586 src_view.height() + (2 * extend_count)
        +
        1587 );
        +
        1588
        +
        1589 for (std::ptrdiff_t i = 0; i < result_view.height(); i++)
        +
        1590 {
        +
        1591 assign_pixels(
        +
        1592 original_view.row_begin(i),
        +
        1593 original_view.row_end(i),
        +
        1594 result_view.row_begin(i)
        +
        1595 );
        +
        1596 }
        +
        1597
        +
        1598 return result_img;
        +
        1599 }
        +
        1600
        +
        1601 auto auxilary_img = extend_col(src_view, extend_count, option);
        +
        1602 return extend_row(view(auxilary_img), extend_count, option);
        +
        1603}
        +
        1604
        +
        1605} } // namespace boost::gil
        +
        1606
        +
        1607#endif
        +
        Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
        Definition iterator_from_2d.hpp:46
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition algorithm.hpp:292
        +
        void default_construct_pixels(View const &view)
        Invokes the in-place default constructor on every pixel of the (uninitialized) view....
        Definition algorithm.hpp:724
        +
        BOOST_FORCEINLINE void destruct_pixels(View const &view)
        Invokes the in-place destructor on every pixel of the view.
        Definition algorithm.hpp:518
        +
        BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
        std::equal for image views
        Definition algorithm.hpp:1109
        +
        BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
        std::fill for image views
        Definition algorithm.hpp:420
        +
        void generate_pixels(View const &view, F fun)
        std::generate for image views
        Definition algorithm.hpp:922
        +
        BOOST_FORCEINLINE F transform_pixel_positions(const View1 &src, const View2 &dst, F fun)
        Like transform_pixels but passes to the function object pixel locators instead of pixel references.
        Definition algorithm.hpp:1159
        +
        BOOST_FORCEINLINE F transform_pixels(const View1 &src, const View2 &dst, F fun)
        std::transform for image views
        Definition algorithm.hpp:1127
        +
        void uninitialized_copy_pixels(View1 const &view1, View2 const &view2)
        std::uninitialized_copy for image views. Does not support planar heterogeneous views....
        Definition algorithm.hpp:823
        +
        void uninitialized_fill_pixels(const View &view, const Value &val)
        std::uninitialized_fill for image views. Does not support planar heterogeneous views....
        Definition algorithm.hpp:587
        +
        void fill(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
        std::fill(I,I,V) with I being a iterator_from_2d
        Definition algorithm.hpp:369
        +
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition algorithm.hpp:1087
        +
        BOOST_FORCEINLINE auto copy1(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst) -> boost::gil::iterator_from_2d< OL >
        std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition algorithm.hpp:281
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        A generic binary operation on views.
        Definition algorithm.hpp:88
        +
        Definition algorithm.hpp:191
        +
        struct to do std::fill
        Definition algorithm.hpp:391
        +
        Reference proxy associated with a type that has a "reference" member type alias.
        Definition algorithm.hpp:1197
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition pixel.hpp:106
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition planar_pixel_iterator.hpp:58
        +
        Returns whether two views are compatible.
        Definition concepts/image_view.hpp:524
        diff --git a/html/reference/annotated.html b/html/reference/annotated.html index f80e8aa0e..cb0212b9e 100644 --- a/html/reference/annotated.html +++ b/html/reference/annotated.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class List @@ -27,326 +27,326 @@

        - + +/* @license-end */ +
        -
        -
        Class List
        +
        Class List
        Here are the classes, structs, unions and interfaces with brief descriptions:
        [detail level 12345]
        - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
         NboostDefined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
         Ngil
         Ngil
        @@ -355,7 +355,7 @@ $(function() { diff --git a/html/reference/any__image_8hpp_source.html b/html/reference/any__image_8hpp_source.html index 9f8b625b5..3cc05a3a9 100644 --- a/html/reference/any__image_8hpp_source.html +++ b/html/reference/any__image_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: any_image.hpp Source File @@ -27,199 +27,210 @@
        - + +/* @license-end */ + +
        -
        -
        any_image.hpp
        +
        any_image.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2020 Samuel Debionne
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_HPP
        -
        10 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_HPP
        -
        11 
        -
        12 #include <boost/gil/extension/dynamic_image/any_image_view.hpp>
        -
        13 
        -
        14 #include <boost/gil/image.hpp>
        -
        15 #include <boost/gil/detail/mp11.hpp>
        -
        16 
        -
        17 #include <boost/config.hpp>
        -
        18 #include <boost/variant2/variant.hpp>
        -
        19 
        -
        20 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        21 #pragma warning(push)
        -
        22 #pragma warning(disable:4512) //assignment operator could not be generated
        -
        23 #endif
        -
        24 
        -
        25 namespace boost { namespace gil {
        -
        26 
        -
        27 namespace detail {
        -
        28 
        -
        29 template <typename T>
        -
        30 using get_view_t = typename T::view_t;
        -
        31 
        -
        32 template <typename Images>
        -
        33 using images_get_views_t = mp11::mp_transform<get_view_t, Images>;
        -
        34 
        -
        35 template <typename T>
        -
        36 using get_const_view_t = typename T::const_view_t;
        -
        37 
        -
        38 template <typename Images>
        -
        39 using images_get_const_views_t = mp11::mp_transform<get_const_view_t, Images>;
        -
        40 
        -
        41 struct recreate_image_fnobj
        -
        42 {
        -
        43  using result_type = void;
        -
        44  point<std::ptrdiff_t> const& _dimensions;
        -
        45  unsigned _alignment;
        -
        46 
        -
        47  recreate_image_fnobj(point<std::ptrdiff_t> const& dims, unsigned alignment)
        -
        48  : _dimensions(dims), _alignment(alignment)
        -
        49  {}
        -
        50 
        -
        51  template <typename Image>
        -
        52  result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); }
        -
        53 };
        -
        54 
        -
        55 template <typename AnyView> // Models AnyViewConcept
        -
        56 struct any_image_get_view
        -
        57 {
        -
        58  using result_type = AnyView;
        -
        59  template <typename Image>
        -
        60  result_type operator()(Image& img) const
        -
        61  {
        -
        62  return result_type(view(img));
        -
        63  }
        -
        64 };
        -
        65 
        -
        66 template <typename AnyConstView> // Models AnyConstViewConcept
        -
        67 struct any_image_get_const_view
        -
        68 {
        -
        69  using result_type = AnyConstView;
        -
        70  template <typename Image>
        -
        71  result_type operator()(Image const& img) const { return result_type{const_view(img)}; }
        -
        72 };
        -
        73 
        -
        74 } // namespce detail
        -
        75 
        -
        86 
        -
        87 template <typename ...Images>
        -
        88 class any_image : public variant2::variant<Images...>
        -
        89 {
        -
        90  using parent_t = variant2::variant<Images...>;
        -
        91 
        -
        92 public:
        -
        93  using view_t = mp11::mp_rename<detail::images_get_views_t<any_image>, any_image_view>;
        -
        94  using const_view_t = mp11::mp_rename<detail::images_get_const_views_t<any_image>, any_image_view>;
        -
        95  using x_coord_t = std::ptrdiff_t;
        -
        96  using y_coord_t = std::ptrdiff_t;
        - -
        98 
        -
        99  using parent_t::parent_t;
        -
        100 
        -
        101  any_image& operator=(any_image const& img)
        -
        102  {
        -
        103  parent_t::operator=((parent_t const&)img);
        -
        104  return *this;
        -
        105  }
        -
        106 
        -
        107  template <typename Image>
        -
        108  any_image& operator=(Image const& img)
        -
        109  {
        -
        110  parent_t::operator=(img);
        -
        111  return *this;
        -
        112  }
        -
        113 
        -
        114  template <typename ...OtherImages>
        -
        115  any_image& operator=(any_image<OtherImages...> const& img)
        -
        116  {
        -
        117  parent_t::operator=((typename variant2::variant<OtherImages...> const&)img);
        -
        118  return *this;
        -
        119  }
        -
        120 
        -
        121  void recreate(point_t const& dims, unsigned alignment=1)
        -
        122  {
        -
        123  variant2::visit(detail::recreate_image_fnobj(dims, alignment), *this);
        -
        124  }
        -
        125 
        -
        126  void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1)
        -
        127  {
        -
        128  recreate({ width, height }, alignment);
        -
        129  }
        -
        130 
        -
        131  std::size_t num_channels() const
        -
        132  {
        -
        133  return variant2::visit(detail::any_type_get_num_channels(), *this);
        -
        134  }
        -
        135 
        -
        136  point_t dimensions() const
        -
        137  {
        -
        138  return variant2::visit(detail::any_type_get_dimensions(), *this);
        -
        139  }
        -
        140 
        -
        141  x_coord_t width() const { return dimensions().x; }
        -
        142  y_coord_t height() const { return dimensions().y; }
        -
        143 };
        -
        144 
        -
        148 
        -
        150 
        -
        153 template <typename ...Images>
        -
        154 BOOST_FORCEINLINE
        -
        155 auto view(any_image<Images...>& img) -> typename any_image<Images...>::view_t
        -
        156 {
        -
        157  using view_t = typename any_image<Images...>::view_t;
        -
        158  return variant2::visit(detail::any_image_get_view<view_t>(), img);
        -
        159 }
        -
        160 
        -
        163 template <typename ...Images>
        -
        164 BOOST_FORCEINLINE
        -
        165 auto const_view(any_image<Images...> const& img) -> typename any_image<Images...>::const_view_t
        -
        166 {
        -
        167  using view_t = typename any_image<Images...>::const_view_t;
        -
        168  return variant2::visit(detail::any_image_get_const_view<view_t>(), img);
        -
        169 }
        -
        171 
        -
        172 }} // namespace boost::gil
        -
        173 
        -
        174 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        175 #pragma warning(pop)
        -
        176 #endif
        -
        177 
        -
        178 #endif
        -
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition: any_image_view.hpp:76
        -
        Represents a run-time specified image. Note it does NOT model ImageConcept.
        Definition: any_image.hpp:89
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2020 Samuel Debionne
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_HPP
        +
        10#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_HPP
        +
        11
        +
        12#include <boost/gil/extension/dynamic_image/any_image_view.hpp>
        +
        13
        +
        14#include <boost/gil/image.hpp>
        +
        15#include <boost/gil/detail/mp11.hpp>
        +
        16
        +
        17#include <boost/config.hpp>
        +
        18#include <boost/variant2/variant.hpp>
        +
        19
        +
        20#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        21#pragma warning(push)
        +
        22#pragma warning(disable:4512) //assignment operator could not be generated
        +
        23#endif
        +
        24
        +
        25namespace boost { namespace gil {
        +
        26
        +
        27namespace detail {
        +
        28
        +
        29template <typename T>
        +
        30using get_view_t = typename T::view_t;
        +
        31
        +
        32template <typename Images>
        +
        33using images_get_views_t = mp11::mp_transform<get_view_t, Images>;
        +
        34
        +
        35template <typename T>
        +
        36using get_const_view_t = typename T::const_view_t;
        +
        37
        +
        38template <typename Images>
        +
        39using images_get_const_views_t = mp11::mp_transform<get_const_view_t, Images>;
        +
        40
        +
        41struct recreate_image_fnobj
        +
        42{
        +
        43 using result_type = void;
        +
        44 point<std::ptrdiff_t> const& _dimensions;
        +
        45 unsigned _alignment;
        +
        46
        +
        47 recreate_image_fnobj(point<std::ptrdiff_t> const& dims, unsigned alignment)
        +
        48 : _dimensions(dims), _alignment(alignment)
        +
        49 {}
        +
        50
        +
        51 template <typename Image>
        +
        52 result_type operator()(Image& img) const { img.recreate(_dimensions,_alignment); }
        +
        53};
        +
        54
        +
        55template <typename AnyView> // Models AnyViewConcept
        +
        56struct any_image_get_view
        +
        57{
        +
        58 using result_type = AnyView;
        +
        59 template <typename Image>
        +
        60 result_type operator()(Image& img) const
        +
        61 {
        +
        62 return result_type(view(img));
        +
        63 }
        +
        64};
        +
        65
        +
        66template <typename AnyConstView> // Models AnyConstViewConcept
        +
        67struct any_image_get_const_view
        +
        68{
        +
        69 using result_type = AnyConstView;
        +
        70 template <typename Image>
        +
        71 result_type operator()(Image const& img) const { return result_type{const_view(img)}; }
        +
        72};
        +
        73
        +
        74} // namespce detail
        +
        75
        +
        86
        +
        87template <typename ...Images>
        +
        +
        88class any_image : public variant2::variant<Images...>
        +
        89{
        +
        90 using parent_t = variant2::variant<Images...>;
        +
        91
        +
        92public:
        +
        93 using view_t = mp11::mp_rename<detail::images_get_views_t<any_image>, any_image_view>;
        +
        94 using const_view_t = mp11::mp_rename<detail::images_get_const_views_t<any_image>, any_image_view>;
        +
        95 using x_coord_t = std::ptrdiff_t;
        +
        96 using y_coord_t = std::ptrdiff_t;
        + +
        98
        +
        99 using parent_t::parent_t;
        +
        100
        +
        101 any_image& operator=(any_image const& img)
        +
        102 {
        +
        103 parent_t::operator=((parent_t const&)img);
        +
        104 return *this;
        +
        105 }
        +
        106
        +
        107 template <typename Image>
        +
        108 any_image& operator=(Image const& img)
        +
        109 {
        +
        110 parent_t::operator=(img);
        +
        111 return *this;
        +
        112 }
        +
        113
        +
        114 template <typename ...OtherImages>
        +
        115 any_image& operator=(any_image<OtherImages...> const& img)
        +
        116 {
        +
        117 parent_t::operator=((typename variant2::variant<OtherImages...> const&)img);
        +
        118 return *this;
        +
        119 }
        +
        120
        +
        121 void recreate(point_t const& dims, unsigned alignment=1)
        +
        122 {
        +
        123 variant2::visit(detail::recreate_image_fnobj(dims, alignment), *this);
        +
        124 }
        +
        125
        +
        126 void recreate(x_coord_t width, y_coord_t height, unsigned alignment=1)
        +
        127 {
        +
        128 recreate({ width, height }, alignment);
        +
        129 }
        +
        130
        +
        131 std::size_t num_channels() const
        +
        132 {
        +
        133 return variant2::visit(detail::any_type_get_num_channels(), *this);
        +
        134 }
        +
        135
        +
        136 point_t dimensions() const
        +
        137 {
        +
        138 return variant2::visit(detail::any_type_get_dimensions(), *this);
        +
        139 }
        +
        140
        +
        141 x_coord_t width() const { return dimensions().x; }
        +
        142 y_coord_t height() const { return dimensions().y; }
        +
        143};
        +
        +
        144
        +
        148
        +
        150
        +
        153template <typename ...Images>
        +
        154BOOST_FORCEINLINE
        +
        +
        155auto view(any_image<Images...>& img) -> typename any_image<Images...>::view_t
        +
        156{
        +
        157 using view_t = typename any_image<Images...>::view_t;
        +
        158 return variant2::visit(detail::any_image_get_view<view_t>(), img);
        +
        159}
        +
        +
        160
        +
        163template <typename ...Images>
        +
        164BOOST_FORCEINLINE
        +
        +
        165auto const_view(any_image<Images...> const& img) -> typename any_image<Images...>::const_view_t
        +
        166{
        +
        167 using view_t = typename any_image<Images...>::const_view_t;
        +
        168 return variant2::visit(detail::any_image_get_const_view<view_t>(), img);
        +
        169}
        +
        +
        171
        +
        172}} // namespace boost::gil
        +
        173
        +
        174#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        175#pragma warning(pop)
        +
        176#endif
        +
        177
        +
        178#endif
        +
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition any_image_view.hpp:76
        +
        Represents a run-time specified image. Note it does NOT model ImageConcept.
        Definition any_image.hpp:89
        -
        BOOST_FORCEINLINE auto view(any_image< Images... > &img) -> typename any_image< Images... >::view_t
        Returns the non-constant-pixel view of any image. The returned view is any view.
        Definition: any_image.hpp:155
        -
        BOOST_FORCEINLINE auto const_view(any_image< Images... > const &img) -> typename any_image< Images... >::const_view_t
        Returns the constant-pixel view of any image. The returned view is any view.
        Definition: any_image.hpp:165
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Returns the number of channels of a pixel-based GIL construct.
        Definition: pixel.hpp:54
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        auto const_view(const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
        Returns the constant-pixel view of an image.
        Definition image.hpp:573
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Returns the number of channels of a pixel-based GIL construct.
        Definition pixel.hpp:54
        diff --git a/html/reference/any__image__view_8hpp_source.html b/html/reference/any__image__view_8hpp_source.html index 895933c94..26ded3be5 100644 --- a/html/reference/any__image__view_8hpp_source.html +++ b/html/reference/any__image__view_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: any_image_view.hpp Source File @@ -27,208 +27,215 @@

        - + +/* @license-end */ + +
        -
        -
        any_image_view.hpp
        +
        any_image_view.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2020 Samuel Debionne
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP
        -
        10 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP
        -
        11 
        -
        12 #include <boost/gil/dynamic_step.hpp>
        -
        13 #include <boost/gil/image.hpp>
        -
        14 #include <boost/gil/image_view.hpp>
        -
        15 #include <boost/gil/point.hpp>
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 
        -
        18 #include <boost/variant2/variant.hpp>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        22 template <typename View>
        -
        23 struct dynamic_xy_step_transposed_type;
        -
        24 
        -
        25 namespace detail {
        -
        26 
        -
        27 template <typename View>
        -
        28 using get_const_t = typename View::const_t;
        -
        29 
        -
        30 template <typename Views>
        -
        31 using views_get_const_t = mp11::mp_transform<get_const_t, Views>;
        -
        32 
        -
        33 // works for both image_view and image
        -
        34 struct any_type_get_num_channels
        -
        35 {
        -
        36  using result_type = int;
        -
        37  template <typename T>
        -
        38  result_type operator()(const T&) const { return num_channels<T>::value; }
        -
        39 };
        -
        40 
        -
        41 // works for both image_view and image
        -
        42 struct any_type_get_dimensions
        -
        43 {
        -
        44  using result_type = point<std::ptrdiff_t>;
        -
        45  template <typename T>
        -
        46  result_type operator()(const T& v) const { return v.dimensions(); }
        -
        47 };
        -
        48 
        -
        49 // works for image_view
        -
        50 struct any_type_get_size
        -
        51 {
        -
        52  using result_type = std::size_t;
        -
        53  template <typename T>
        -
        54  result_type operator()(const T& v) const { return v.size(); }
        -
        55 };
        -
        56 
        -
        57 } // namespace detail
        -
        58 
        -
        73 
        -
        74 template <typename ...Views>
        -
        75 class any_image_view : public variant2::variant<Views...>
        -
        76 {
        -
        77  using parent_t = variant2::variant<Views...>;
        -
        78 
        -
        79 public:
        -
        80  using const_t = detail::views_get_const_t<any_image_view>;
        -
        81  using x_coord_t = std::ptrdiff_t;
        -
        82  using y_coord_t = std::ptrdiff_t;
        - -
        84  using size_type = std::size_t;
        -
        85 
        -
        86  using parent_t::parent_t;
        -
        87 
        -
        88  any_image_view& operator=(any_image_view const& view)
        -
        89  {
        -
        90  parent_t::operator=((parent_t const&)view);
        -
        91  return *this;
        -
        92  }
        -
        93 
        -
        94  template <typename View>
        -
        95  any_image_view& operator=(View const& view)
        -
        96  {
        -
        97  parent_t::operator=(view);
        -
        98  return *this;
        -
        99  }
        -
        100 
        -
        101  template <typename ...OtherViews>
        - -
        103  {
        -
        104  parent_t::operator=((variant2::variant<OtherViews...> const&)view);
        -
        105  return *this;
        -
        106  }
        -
        107 
        -
        108  std::size_t num_channels() const { return variant2::visit(detail::any_type_get_num_channels(), *this); }
        -
        109  point_t dimensions() const { return variant2::visit(detail::any_type_get_dimensions(), *this); }
        -
        110  size_type size() const { return variant2::visit(detail::any_type_get_size(), *this); }
        -
        111  x_coord_t width() const { return dimensions().x; }
        -
        112  y_coord_t height() const { return dimensions().y; }
        -
        113 };
        -
        114 
        -
        116 // HasDynamicXStepTypeConcept
        -
        118 
        -
        119 template <typename ...Views>
        -
        120 struct dynamic_x_step_type<any_image_view<Views...>>
        -
        121 {
        -
        122 private:
        -
        123  // FIXME: Remove class name injection with gil:: qualification
        -
        124  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
        -
        125  // in the class definition of the same name as the specialization (Peter Dimov):
        -
        126  // invalid template argument for template parameter 'F', expected a class template
        -
        127  template <typename T>
        -
        128  using dynamic_step_view = typename gil::dynamic_x_step_type<T>::type;
        -
        129 
        -
        130 public:
        -
        131  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
        -
        132 };
        -
        133 
        -
        135 // HasDynamicYStepTypeConcept
        -
        137 
        -
        138 template <typename ...Views>
        -
        139 struct dynamic_y_step_type<any_image_view<Views...>>
        -
        140 {
        -
        141 private:
        -
        142  // FIXME: Remove class name injection with gil:: qualification
        -
        143  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
        -
        144  // in the class definition of the same name as the specialization (Peter Dimov):
        -
        145  // invalid template argument for template parameter 'F', expected a class template
        -
        146  template <typename T>
        -
        147  using dynamic_step_view = typename gil::dynamic_y_step_type<T>::type;
        -
        148 
        -
        149 public:
        -
        150  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
        -
        151 };
        -
        152 
        -
        153 template <typename ...Views>
        -
        154 struct dynamic_xy_step_type<any_image_view<Views...>>
        -
        155 {
        -
        156 private:
        -
        157  // FIXME: Remove class name injection with gil:: qualification
        -
        158  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
        -
        159  // in the class definition of the same name as the specialization (Peter Dimov):
        -
        160  // invalid template argument for template parameter 'F', expected a class template
        -
        161  template <typename T>
        -
        162  using dynamic_step_view = typename gil::dynamic_xy_step_type<T>::type;
        -
        163 
        -
        164 public:
        -
        165  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
        -
        166 };
        -
        167 
        -
        168 template <typename ...Views>
        -
        169 struct dynamic_xy_step_transposed_type<any_image_view<Views...>>
        -
        170 {
        -
        171 private:
        -
        172  // FIXME: Remove class name injection with gil:: qualification
        -
        173  // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
        -
        174  // in the class definition of the same name as the specialization (Peter Dimov):
        -
        175  // invalid template argument for template parameter 'F', expected a class template
        -
        176  template <typename T>
        -
        177  using dynamic_step_view = typename gil::dynamic_xy_step_type<T>::type;
        -
        178 
        -
        179 public:
        -
        180  using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
        -
        181 };
        -
        182 
        -
        183 }} // namespace boost::gil
        -
        184 
        -
        185 #endif
        -
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition: any_image_view.hpp:76
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2020 Samuel Debionne
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP
        +
        10#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ANY_IMAGE_VIEW_HPP
        +
        11
        +
        12#include <boost/gil/dynamic_step.hpp>
        +
        13#include <boost/gil/image.hpp>
        +
        14#include <boost/gil/image_view.hpp>
        +
        15#include <boost/gil/point.hpp>
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17
        +
        18#include <boost/variant2/variant.hpp>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        22template <typename View>
        +
        23struct dynamic_xy_step_transposed_type;
        +
        24
        +
        25namespace detail {
        +
        26
        +
        27template <typename View>
        +
        28using get_const_t = typename View::const_t;
        +
        29
        +
        30template <typename Views>
        +
        31using views_get_const_t = mp11::mp_transform<get_const_t, Views>;
        +
        32
        +
        33// works for both image_view and image
        +
        34struct any_type_get_num_channels
        +
        35{
        +
        36 using result_type = int;
        +
        37 template <typename T>
        +
        38 result_type operator()(const T&) const { return num_channels<T>::value; }
        +
        39};
        +
        40
        +
        41// works for both image_view and image
        +
        42struct any_type_get_dimensions
        +
        43{
        +
        44 using result_type = point<std::ptrdiff_t>;
        +
        45 template <typename T>
        +
        46 result_type operator()(const T& v) const { return v.dimensions(); }
        +
        47};
        +
        48
        +
        49// works for image_view
        +
        50struct any_type_get_size
        +
        51{
        +
        52 using result_type = std::size_t;
        +
        53 template <typename T>
        +
        54 result_type operator()(const T& v) const { return v.size(); }
        +
        55};
        +
        56
        +
        57} // namespace detail
        +
        58
        +
        73
        +
        74template <typename ...Views>
        +
        +
        75class any_image_view : public variant2::variant<Views...>
        +
        76{
        +
        77 using parent_t = variant2::variant<Views...>;
        +
        78
        +
        79public:
        +
        80 using const_t = detail::views_get_const_t<any_image_view>;
        +
        81 using x_coord_t = std::ptrdiff_t;
        +
        82 using y_coord_t = std::ptrdiff_t;
        + +
        84 using size_type = std::size_t;
        +
        85
        +
        86 using parent_t::parent_t;
        +
        87
        +
        88 any_image_view& operator=(any_image_view const& view)
        +
        89 {
        +
        90 parent_t::operator=((parent_t const&)view);
        +
        91 return *this;
        +
        92 }
        +
        93
        +
        94 template <typename View>
        +
        95 any_image_view& operator=(View const& view)
        +
        96 {
        +
        97 parent_t::operator=(view);
        +
        98 return *this;
        +
        99 }
        +
        100
        +
        101 template <typename ...OtherViews>
        + +
        103 {
        +
        104 parent_t::operator=((variant2::variant<OtherViews...> const&)view);
        +
        105 return *this;
        +
        106 }
        +
        107
        +
        108 std::size_t num_channels() const { return variant2::visit(detail::any_type_get_num_channels(), *this); }
        +
        109 point_t dimensions() const { return variant2::visit(detail::any_type_get_dimensions(), *this); }
        +
        110 size_type size() const { return variant2::visit(detail::any_type_get_size(), *this); }
        +
        111 x_coord_t width() const { return dimensions().x; }
        +
        112 y_coord_t height() const { return dimensions().y; }
        +
        113};
        +
        +
        114
        +
        116// HasDynamicXStepTypeConcept
        +
        118
        +
        119template <typename ...Views>
        +
        120struct dynamic_x_step_type<any_image_view<Views...>>
        +
        121{
        +
        122private:
        +
        123 // FIXME: Remove class name injection with gil:: qualification
        +
        124 // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
        +
        125 // in the class definition of the same name as the specialization (Peter Dimov):
        +
        126 // invalid template argument for template parameter 'F', expected a class template
        +
        127 template <typename T>
        +
        128 using dynamic_step_view = typename gil::dynamic_x_step_type<T>::type;
        +
        129
        +
        130public:
        +
        131 using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
        +
        132};
        +
        133
        +
        135// HasDynamicYStepTypeConcept
        +
        137
        +
        138template <typename ...Views>
        +
        139struct dynamic_y_step_type<any_image_view<Views...>>
        +
        140{
        +
        141private:
        +
        142 // FIXME: Remove class name injection with gil:: qualification
        +
        143 // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
        +
        144 // in the class definition of the same name as the specialization (Peter Dimov):
        +
        145 // invalid template argument for template parameter 'F', expected a class template
        +
        146 template <typename T>
        +
        147 using dynamic_step_view = typename gil::dynamic_y_step_type<T>::type;
        +
        148
        +
        149public:
        +
        150 using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
        +
        151};
        +
        152
        +
        153template <typename ...Views>
        +
        154struct dynamic_xy_step_type<any_image_view<Views...>>
        +
        155{
        +
        156private:
        +
        157 // FIXME: Remove class name injection with gil:: qualification
        +
        158 // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
        +
        159 // in the class definition of the same name as the specialization (Peter Dimov):
        +
        160 // invalid template argument for template parameter 'F', expected a class template
        +
        161 template <typename T>
        +
        162 using dynamic_step_view = typename gil::dynamic_xy_step_type<T>::type;
        +
        163
        +
        164public:
        +
        165 using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
        +
        166};
        +
        167
        +
        168template <typename ...Views>
        +
        169struct dynamic_xy_step_transposed_type<any_image_view<Views...>>
        +
        170{
        +
        171private:
        +
        172 // FIXME: Remove class name injection with gil:: qualification
        +
        173 // Required as workaround for Boost.MP11 issue that treats unqualified metafunction
        +
        174 // in the class definition of the same name as the specialization (Peter Dimov):
        +
        175 // invalid template argument for template parameter 'F', expected a class template
        +
        176 template <typename T>
        +
        177 using dynamic_step_view = typename gil::dynamic_xy_step_type<T>::type;
        +
        178
        +
        179public:
        +
        180 using type = mp11::mp_transform<dynamic_step_view, any_image_view<Views...>>;
        +
        181};
        +
        182
        +
        183}} // namespace boost::gil
        +
        184
        +
        185#endif
        +
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition any_image_view.hpp:76
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition: dynamic_step.hpp:17
        -
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition: dynamic_step.hpp:21
        -
        Returns the number of channels of a pixel-based GIL construct.
        Definition: pixel.hpp:54
        -
        Returns an integral constant type specifying the number of elements in a color base.
        Definition: color_base_algorithm.hpp:42
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition dynamic_step.hpp:17
        +
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition dynamic_step.hpp:21
        +
        Returns the number of channels of a pixel-based GIL construct.
        Definition pixel.hpp:54
        +
        Returns an integral constant type specifying the number of elements in a color base.
        Definition color_base_algorithm.hpp:42
        diff --git a/html/reference/apply__operation_8hpp_source.html b/html/reference/apply__operation_8hpp_source.html index 15e856ef1..e4633b35c 100644 --- a/html/reference/apply__operation_8hpp_source.html +++ b/html/reference/apply__operation_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: apply_operation.hpp Source File @@ -27,74 +27,83 @@

        - + +/* @license-end */ + +
        -
        -
        apply_operation.hpp
        +
        apply_operation.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP
        -
        9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP
        -
        10 
        -
        11 #include <boost/variant2/variant.hpp>
        -
        12 
        -
        13 namespace boost { namespace gil {
        -
        14 
        -
        17 template <typename Variant1, typename Visitor>
        -
        18 [[deprecated("Use variant2::visit instead.")]]
        -
        19 BOOST_FORCEINLINE
        -
        20 auto apply_operation(Variant1&& arg1, Visitor&& op)
        -
        21 #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
        -
        22  -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1)))
        -
        23 #endif
        -
        24 {
        -
        25  return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1));
        -
        26 }
        -
        27 
        -
        30 template <typename Variant1, typename Variant2, typename Visitor>
        -
        31 [[deprecated("Use variant2::visit instead.")]]
        -
        32 BOOST_FORCEINLINE
        -
        33 auto apply_operation(Variant1&& arg1, Variant2&& arg2, Visitor&& op)
        -
        34 #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
        -
        35  -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2)))
        -
        36 #endif
        -
        37 {
        -
        38  return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2));
        -
        39 }
        -
        40 
        -
        41 }} // namespace boost::gil
        -
        42 
        -
        43 #endif
        -
        BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Variant2 &&arg2, Visitor &&op)
        Applies the visitor op to the variants.
        Definition: apply_operation.hpp:33
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP
        +
        9#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP
        +
        10
        +
        11#include <boost/variant2/variant.hpp>
        +
        12
        +
        13namespace boost { namespace gil {
        +
        14
        +
        17template <typename Variant1, typename Visitor>
        +
        18[[deprecated("Use variant2::visit instead.")]]
        +
        19BOOST_FORCEINLINE
        +
        +
        20auto apply_operation(Variant1&& arg1, Visitor&& op)
        +
        21#if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
        +
        22 -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1)))
        +
        23#endif
        +
        24{
        +
        25 return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1));
        +
        26}
        +
        +
        27
        +
        30template <typename Variant1, typename Variant2, typename Visitor>
        +
        31[[deprecated("Use variant2::visit instead.")]]
        +
        32BOOST_FORCEINLINE
        +
        +
        33auto apply_operation(Variant1&& arg1, Variant2&& arg2, Visitor&& op)
        +
        34#if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
        +
        35 -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2)))
        +
        36#endif
        +
        37{
        +
        38 return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2));
        +
        39}
        +
        +
        40
        +
        41}} // namespace boost::gil
        +
        42
        +
        43#endif
        +
        BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
        Applies the visitor op to the variants.
        Definition apply_operation.hpp:20
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/base_8hpp_source.html b/html/reference/base_8hpp_source.html index a31a82a36..5fd3f5edb 100644 --- a/html/reference/base_8hpp_source.html +++ b/html/reference/base_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: base.hpp Source File @@ -27,139 +27,144 @@

        - + +/* @license-end */ + +
        -
        -
        base.hpp
        +
        base.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_BASE_HPP
        -
        9 #define BOOST_GIL_IO_BASE_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/toolbox/toolbox.hpp>
        -
        12 
        -
        13 #include <boost/gil/bit_aligned_pixel_reference.hpp>
        -
        14 #include <boost/gil/bit_aligned_pixel_iterator.hpp>
        -
        15 #include <boost/gil/color_convert.hpp>
        -
        16 #include <boost/gil/utilities.hpp>
        -
        17 #include <boost/gil/io/error.hpp>
        -
        18 #include <boost/gil/io/typedefs.hpp>
        -
        19 
        -
        20 #include <istream>
        -
        21 #include <ostream>
        -
        22 #include <type_traits>
        -
        23 #include <vector>
        -
        24 
        -
        25 namespace boost { namespace gil {
        -
        26 
        -
        27 struct format_tag {};
        -
        28 
        -
        29 template< typename Property >
        -
        30 struct property_base
        -
        31 {
        -
        32  using type = Property;
        -
        33 };
        -
        34 
        -
        35 template<typename FormatTag>
        -
        36 struct is_format_tag : std::is_base_of<format_tag, FormatTag> {};
        -
        37 
        -
        38 struct image_read_settings_base
        -
        39 {
        -
        40 protected:
        -
        41 
        -
        42  image_read_settings_base()
        -
        43  : _top_left( 0, 0 )
        -
        44  , _dim ( 0, 0 )
        -
        45  {}
        -
        46 
        -
        47  image_read_settings_base( point_t const& top_left
        -
        48  , point_t const& dim
        -
        49  )
        -
        50  : _top_left( top_left )
        -
        51  , _dim ( dim )
        -
        52  {}
        -
        53 
        -
        54 
        -
        55 public:
        -
        56 
        -
        57  void set( point_t const& top_left
        -
        58  , point_t const& dim
        -
        59  )
        -
        60  {
        -
        61  _top_left = top_left;
        -
        62  _dim = dim;
        -
        63  }
        -
        64 
        -
        65 public:
        -
        66 
        -
        67  point_t _top_left;
        -
        68  point_t _dim;
        -
        69 };
        -
        70 
        -
        76 // Depending on image type the parameter Pixel can be a reference type
        -
        77 // for bit_aligned images or a pixel for byte images.
        -
        78 template< typename Pixel, typename FormatTag > struct is_read_supported {};
        -
        79 template< typename Pixel, typename FormatTag > struct is_write_supported {};
        -
        80 
        -
        81 
        -
        82 namespace detail {
        -
        83 
        -
        84 template< typename Property >
        -
        85 struct property_base
        -
        86 {
        -
        87  using type = Property;
        -
        88 };
        -
        89 
        -
        90 } // namespace detail
        -
        91 
        -
        92 struct read_support_true { static constexpr bool is_supported = true; };
        -
        93 struct read_support_false { static constexpr bool is_supported = false; };
        -
        94 struct write_support_true { static constexpr bool is_supported = true; };
        -
        95 struct write_support_false{ static constexpr bool is_supported = false; };
        -
        96 
        -
        97 class no_log {};
        -
        98 
        -
        99 template< typename Device, typename FormatTag > struct reader_backend;
        -
        100 template< typename Device, typename FormatTag > struct writer_backend;
        -
        101 
        -
        102 template< typename FormatTag > struct image_read_info;
        -
        103 template< typename FormatTag > struct image_read_settings;
        -
        104 template< typename FormatTag, typename Log = no_log > struct image_write_info;
        -
        105 
        -
        106 } // namespace gil
        -
        107 } // namespace boost
        -
        108 
        -
        109 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: base.hpp:78
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_BASE_HPP
        +
        9#define BOOST_GIL_IO_BASE_HPP
        +
        10
        +
        11#include <boost/gil/extension/toolbox/toolbox.hpp>
        +
        12
        +
        13#include <boost/gil/bit_aligned_pixel_reference.hpp>
        +
        14#include <boost/gil/bit_aligned_pixel_iterator.hpp>
        +
        15#include <boost/gil/color_convert.hpp>
        +
        16#include <boost/gil/utilities.hpp>
        +
        17#include <boost/gil/io/error.hpp>
        +
        18#include <boost/gil/io/typedefs.hpp>
        +
        19
        +
        20#include <istream>
        +
        21#include <ostream>
        +
        22#include <type_traits>
        +
        23#include <vector>
        +
        24
        +
        25namespace boost { namespace gil {
        +
        26
        +
        27struct format_tag {};
        +
        28
        +
        29template< typename Property >
        +
        30struct property_base
        +
        31{
        +
        32 using type = Property;
        +
        33};
        +
        34
        +
        35template<typename FormatTag>
        +
        36struct is_format_tag : std::is_base_of<format_tag, FormatTag> {};
        +
        37
        +
        38struct image_read_settings_base
        +
        39{
        +
        40protected:
        +
        41
        +
        42 image_read_settings_base()
        +
        43 : _top_left( 0, 0 )
        +
        44 , _dim ( 0, 0 )
        +
        45 {}
        +
        46
        +
        47 image_read_settings_base( point_t const& top_left
        +
        48 , point_t const& dim
        +
        49 )
        +
        50 : _top_left( top_left )
        +
        51 , _dim ( dim )
        +
        52 {}
        +
        53
        +
        54
        +
        55public:
        +
        56
        +
        57 void set( point_t const& top_left
        +
        58 , point_t const& dim
        +
        59 )
        +
        60 {
        +
        61 _top_left = top_left;
        +
        62 _dim = dim;
        +
        63 }
        +
        64
        +
        65public:
        +
        66
        +
        67 point_t _top_left;
        +
        68 point_t _dim;
        +
        69};
        +
        70
        +
        76// Depending on image type the parameter Pixel can be a reference type
        +
        77// for bit_aligned images or a pixel for byte images.
        +
        78template< typename Pixel, typename FormatTag > struct is_read_supported {};
        +
        79template< typename Pixel, typename FormatTag > struct is_write_supported {};
        +
        80
        +
        81
        +
        82namespace detail {
        +
        83
        +
        84template< typename Property >
        +
        85struct property_base
        +
        86{
        +
        87 using type = Property;
        +
        88};
        +
        89
        +
        90} // namespace detail
        +
        91
        +
        92struct read_support_true { static constexpr bool is_supported = true; };
        +
        93struct read_support_false { static constexpr bool is_supported = false; };
        +
        94struct write_support_true { static constexpr bool is_supported = true; };
        +
        95struct write_support_false{ static constexpr bool is_supported = false; };
        +
        96
        +
        97class no_log {};
        +
        98
        +
        99template< typename Device, typename FormatTag > struct reader_backend;
        +
        100template< typename Device, typename FormatTag > struct writer_backend;
        +
        101
        +
        102template< typename FormatTag > struct image_read_info;
        +
        103template< typename FormatTag > struct image_read_settings;
        +
        104template< typename FormatTag, typename Log = no_log > struct image_write_info;
        +
        105
        +
        106} // namespace gil
        +
        107} // namespace boost
        +
        108
        +
        109#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition base.hpp:78
        diff --git a/html/reference/basic_8hpp_source.html b/html/reference/basic_8hpp_source.html index 9833cdaa4..e23ce898a 100644 --- a/html/reference/basic_8hpp_source.html +++ b/html/reference/basic_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: basic.hpp Source File @@ -27,164 +27,184 @@

        - + +/* @license-end */ + +
        -
        -
        basic.hpp
        +
        basic.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_BASIC_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_BASIC_HPP
        -
        10 
        -
        11 #include <boost/config.hpp>
        -
        12 
        -
        13 #if defined(BOOST_CLANG)
        -
        14 #pragma clang diagnostic push
        -
        15 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        16 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        17 #pragma clang diagnostic ignored "-Wuninitialized"
        -
        18 #endif
        -
        19 
        -
        20 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        21 #pragma GCC diagnostic push
        -
        22 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        23 #pragma GCC diagnostic ignored "-Wuninitialized"
        -
        24 #endif
        -
        25 
        -
        26 #include <boost/gil/concepts/concept_check.hpp>
        -
        27 
        -
        28 #include <type_traits>
        -
        29 #include <utility> // std::swap
        -
        30 
        -
        31 namespace boost { namespace gil {
        -
        32 
        -
        42 template <typename T>
        - -
        44 {
        -
        45  void constraints()
        -
        46  {
        -
        47  function_requires<boost::DefaultConstructibleConcept<T>>();
        -
        48  }
        -
        49 };
        -
        50 
        -
        61 template <typename T>
        - -
        63 {
        -
        64  void constraints()
        -
        65  {
        -
        66  function_requires<boost::CopyConstructibleConcept<T>>();
        -
        67  }
        -
        68 };
        -
        69 
        -
        80 template <typename T>
        -
        81 struct Assignable
        -
        82 {
        -
        83  void constraints()
        -
        84  {
        -
        85  function_requires<boost::AssignableConcept<T>>();
        -
        86  }
        -
        87 };
        -
        88 
        -
        99 template <typename T>
        - -
        101 {
        -
        102  void constraints()
        -
        103  {
        -
        104  function_requires<boost::EqualityComparableConcept<T>>();
        -
        105  }
        -
        106 };
        -
        107 
        -
        117 template <typename T>
        -
        118 struct Swappable
        -
        119 {
        -
        120  void constraints()
        -
        121  {
        -
        122  using std::swap;
        -
        123  swap(x,y);
        -
        124  }
        -
        125  T x,y;
        -
        126 };
        -
        127 
        -
        140 template <typename T>
        -
        141 struct Regular
        -
        142 {
        -
        143  void constraints()
        -
        144  {
        -
        145  gil_function_requires< boost::DefaultConstructibleConcept<T>>();
        -
        146  gil_function_requires< boost::CopyConstructibleConcept<T>>();
        -
        147  gil_function_requires< boost::EqualityComparableConcept<T>>(); // ==, !=
        -
        148  gil_function_requires< boost::AssignableConcept<T>>();
        -
        149  gil_function_requires< Swappable<T>>();
        -
        150  }
        -
        151 };
        -
        152 
        -
        162 template <typename T>
        - -
        164 {
        -
        165  void constraints()
        -
        166  {
        -
        167  using type = typename T::type;
        -
        168  }
        -
        169 };
        -
        170 
        -
        177 template <typename T, typename U>
        -
        178 struct SameType
        -
        179 {
        -
        180  void constraints()
        -
        181  {
        -
        182  static_assert(std::is_same<T, U>::value, "");
        -
        183  }
        -
        184 };
        -
        185 
        -
        186 }} // namespace boost::gil
        -
        187 
        -
        188 #if defined(BOOST_CLANG)
        -
        189 #pragma clang diagnostic pop
        -
        190 #endif
        -
        191 
        -
        192 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        193 #pragma GCC diagnostic pop
        -
        194 #endif
        -
        195 
        -
        196 #endif
        -
        void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
        swap for packed_channel_reference
        Definition: channel.hpp:583
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Concept of copy assignment requirement.
        Definition: basic.hpp:82
        -
        Concept of copy construction requirement.
        Definition: basic.hpp:63
        -
        Concept of default construction requirement.
        Definition: basic.hpp:44
        -
        Concept of == and != comparability requirement.
        Definition: basic.hpp:101
        -
        Concept for type as metafunction requirement.
        Definition: basic.hpp:164
        -
        Concept for type regularity requirement.
        Definition: basic.hpp:142
        -
        Concept of types equivalence requirement.
        Definition: basic.hpp:179
        -
        Concept of swap operation requirement.
        Definition: basic.hpp:119
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_BASIC_HPP
        +
        9#define BOOST_GIL_CONCEPTS_BASIC_HPP
        +
        10
        +
        11#include <boost/config.hpp>
        +
        12
        +
        13#if defined(BOOST_CLANG)
        +
        14#pragma clang diagnostic push
        +
        15#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        16#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        17#pragma clang diagnostic ignored "-Wuninitialized"
        +
        18#endif
        +
        19
        +
        20#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        21#pragma GCC diagnostic push
        +
        22#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        23#pragma GCC diagnostic ignored "-Wuninitialized"
        +
        24#endif
        +
        25
        +
        26#include <boost/gil/concepts/concept_check.hpp>
        +
        27
        +
        28#include <type_traits>
        +
        29#include <utility> // std::swap
        +
        30
        +
        31namespace boost { namespace gil {
        +
        32
        +
        42template <typename T>
        +
        + +
        44{
        +
        45 void constraints()
        +
        46 {
        +
        47 function_requires<boost::DefaultConstructibleConcept<T>>();
        +
        48 }
        +
        49};
        +
        +
        50
        +
        61template <typename T>
        +
        + +
        63{
        +
        64 void constraints()
        +
        65 {
        +
        66 function_requires<boost::CopyConstructibleConcept<T>>();
        +
        67 }
        +
        68};
        +
        +
        69
        +
        80template <typename T>
        +
        + +
        82{
        +
        83 void constraints()
        +
        84 {
        +
        85 function_requires<boost::AssignableConcept<T>>();
        +
        86 }
        +
        87};
        +
        +
        88
        +
        99template <typename T>
        +
        + +
        101{
        +
        102 void constraints()
        +
        103 {
        +
        104 function_requires<boost::EqualityComparableConcept<T>>();
        +
        105 }
        +
        106};
        +
        +
        107
        +
        117template <typename T>
        +
        + +
        119{
        +
        120 void constraints()
        +
        121 {
        +
        122 using std::swap;
        +
        123 swap(x,y);
        +
        124 }
        +
        125 T x,y;
        +
        126};
        +
        +
        127
        +
        140template <typename T>
        +
        + +
        142{
        +
        143 void constraints()
        +
        144 {
        +
        145 gil_function_requires< boost::DefaultConstructibleConcept<T>>();
        +
        146 gil_function_requires< boost::CopyConstructibleConcept<T>>();
        +
        147 gil_function_requires< boost::EqualityComparableConcept<T>>(); // ==, !=
        +
        148 gil_function_requires< boost::AssignableConcept<T>>();
        +
        149 gil_function_requires< Swappable<T>>();
        +
        150 }
        +
        151};
        +
        +
        152
        +
        162template <typename T>
        +
        + +
        164{
        +
        165 void constraints()
        +
        166 {
        +
        167 using type = typename T::type;
        +
        168 }
        +
        169};
        +
        +
        170
        +
        177template <typename T, typename U>
        +
        + +
        179{
        +
        180 void constraints()
        +
        181 {
        +
        182 static_assert(std::is_same<T, U>::value, "");
        +
        183 }
        +
        184};
        +
        +
        185
        +
        186}} // namespace boost::gil
        +
        187
        +
        188#if defined(BOOST_CLANG)
        +
        189#pragma clang diagnostic pop
        +
        190#endif
        +
        191
        +
        192#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        193#pragma GCC diagnostic pop
        +
        194#endif
        +
        195
        +
        196#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Concept of copy assignment requirement.
        Definition basic.hpp:82
        +
        Concept of copy construction requirement.
        Definition basic.hpp:63
        +
        Concept of default construction requirement.
        Definition basic.hpp:44
        +
        Concept of == and != comparability requirement.
        Definition basic.hpp:101
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179
        +
        Concept of swap operation requirement.
        Definition basic.hpp:119
        diff --git a/html/reference/bc_sd.png b/html/reference/bc_sd.png new file mode 100644 index 000000000..31ca888dc Binary files /dev/null and b/html/reference/bc_sd.png differ diff --git a/html/reference/bdwn.png b/html/reference/bdwn.png deleted file mode 100644 index 940a0b950..000000000 Binary files a/html/reference/bdwn.png and /dev/null differ diff --git a/html/reference/bit__aligned__pixel__iterator_8hpp_source.html b/html/reference/bit__aligned__pixel__iterator_8hpp_source.html index 79e6be69d..31a3e3e4b 100644 --- a/html/reference/bit__aligned__pixel__iterator_8hpp_source.html +++ b/html/reference/bit__aligned__pixel__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_iterator.hpp Source File @@ -27,216 +27,221 @@

        - + +/* @license-end */ + +
        -
        -
        bit_aligned_pixel_iterator.hpp
        +
        bit_aligned_pixel_iterator.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_BIT_ALIGNED_PIXEL_ITERATOR_HPP
        -
        9 #define BOOST_GIL_BIT_ALIGNED_PIXEL_ITERATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/bit_aligned_pixel_reference.hpp>
        -
        12 #include <boost/gil/pixel_iterator.hpp>
        -
        13 
        -
        14 #include <boost/config.hpp>
        -
        15 #include <boost/iterator/iterator_facade.hpp>
        -
        16 
        -
        17 #include <functional>
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        24 
        -
        28 
        -
        35 
        -
        36 template <typename NonAlignedPixelReference>
        -
        37 struct bit_aligned_pixel_iterator : public iterator_facade<bit_aligned_pixel_iterator<NonAlignedPixelReference>,
        -
        38  typename NonAlignedPixelReference::value_type,
        -
        39  std::random_access_iterator_tag,
        -
        40  const NonAlignedPixelReference,
        -
        41  typename NonAlignedPixelReference::bit_range_t::difference_type> {
        -
        42 private:
        -
        43  using parent_t = iterator_facade<bit_aligned_pixel_iterator<NonAlignedPixelReference>,
        -
        44  typename NonAlignedPixelReference::value_type,
        -
        45  std::random_access_iterator_tag,
        -
        46  const NonAlignedPixelReference,
        -
        47  typename NonAlignedPixelReference::bit_range_t::difference_type>;
        -
        48  template <typename Ref> friend struct bit_aligned_pixel_iterator;
        -
        49 
        -
        50  using bit_range_t = typename NonAlignedPixelReference::bit_range_t;
        -
        51 public:
        -
        52  using difference_type = typename parent_t::difference_type;
        -
        53  using reference = typename parent_t::reference;
        -
        54 
        - -
        56  bit_aligned_pixel_iterator(const bit_aligned_pixel_iterator& p) : _bit_range(p._bit_range) {}
        -
        57  bit_aligned_pixel_iterator& operator=(const bit_aligned_pixel_iterator& p) { _bit_range=p._bit_range; return *this; }
        -
        58 
        -
        59  template <typename Ref> bit_aligned_pixel_iterator(const bit_aligned_pixel_iterator<Ref>& p) : _bit_range(p._bit_range) {}
        -
        60 
        -
        61  bit_aligned_pixel_iterator(reference* ref) : _bit_range(ref->bit_range()) {}
        -
        62  explicit bit_aligned_pixel_iterator(typename bit_range_t::byte_t* data, int bit_offset=0) : _bit_range(data,bit_offset) {}
        -
        63 
        -
        66  auto operator[](difference_type d) const -> reference { bit_aligned_pixel_iterator it=*this; it.advance(d); return *it; }
        -
        67 
        -
        68  auto operator->() const -> reference { return **this; }
        -
        69  auto bit_range() const -> bit_range_t const& { return _bit_range; }
        -
        70  auto bit_range() -> bit_range_t& { return _bit_range; }
        -
        71 private:
        -
        72  bit_range_t _bit_range;
        -
        73  static constexpr int bit_size = NonAlignedPixelReference::bit_size;
        -
        74 
        -
        75  friend class boost::iterator_core_access;
        -
        76  auto dereference() const -> reference { return NonAlignedPixelReference(_bit_range); }
        -
        77  void increment() { ++_bit_range; }
        -
        78  void decrement() { --_bit_range; }
        -
        79  void advance(difference_type d) { _bit_range.bit_advance(d*bit_size); }
        -
        80 
        -
        81  auto distance_to(bit_aligned_pixel_iterator const& it) const -> difference_type { return _bit_range.bit_distance_to(it._bit_range) / bit_size; }
        -
        82  bool equal(const bit_aligned_pixel_iterator& it) const { return _bit_range==it._bit_range; }
        -
        83 };
        -
        84 
        -
        85 template <typename NonAlignedPixelReference>
        -
        86 struct const_iterator_type<bit_aligned_pixel_iterator<NonAlignedPixelReference>>
        -
        87 {
        -
        88  using type =
        -
        89  bit_aligned_pixel_iterator<typename NonAlignedPixelReference::const_reference>;
        -
        90 };
        -
        91 
        -
        92 template <typename NonAlignedPixelReference>
        -
        93 struct iterator_is_mutable<bit_aligned_pixel_iterator<NonAlignedPixelReference>>
        -
        94  : std::integral_constant<bool, NonAlignedPixelReference::is_mutable>
        -
        95 {};
        -
        96 
        -
        97 template <typename NonAlignedPixelReference>
        -
        98 struct is_iterator_adaptor<bit_aligned_pixel_iterator<NonAlignedPixelReference>>
        -
        99  : std::false_type
        -
        100 {};
        -
        101 
        -
        103 // PixelBasedConcept
        -
        105 
        -
        106 template <typename NonAlignedPixelReference>
        -
        107 struct color_space_type<bit_aligned_pixel_iterator<NonAlignedPixelReference> > : public color_space_type<NonAlignedPixelReference> {};
        -
        108 
        -
        109 template <typename NonAlignedPixelReference>
        -
        110 struct channel_mapping_type<bit_aligned_pixel_iterator<NonAlignedPixelReference> > : public channel_mapping_type<NonAlignedPixelReference> {};
        -
        111 
        -
        112 template <typename NonAlignedPixelReference>
        -
        113 struct is_planar<bit_aligned_pixel_iterator<NonAlignedPixelReference> > : public is_planar<NonAlignedPixelReference> {}; // == false
        -
        114 
        -
        116 // MemoryBasedIteratorConcept
        -
        118 
        -
        119 template <typename NonAlignedPixelReference>
        -
        120 struct byte_to_memunit<bit_aligned_pixel_iterator<NonAlignedPixelReference>>
        -
        121  : std::integral_constant<int, 8>
        -
        122 {};
        -
        123 
        -
        124 template <typename NonAlignedPixelReference>
        -
        125 inline auto memunit_step(const bit_aligned_pixel_iterator<NonAlignedPixelReference>&) -> std::ptrdiff_t
        -
        126 {
        -
        127  return NonAlignedPixelReference::bit_size;
        -
        128 }
        -
        129 
        -
        130 template <typename NonAlignedPixelReference>
        -
        131 inline auto memunit_distance(bit_aligned_pixel_iterator<NonAlignedPixelReference> const& p1, bit_aligned_pixel_iterator<NonAlignedPixelReference> const& p2) -> std::ptrdiff_t
        -
        132 {
        -
        133  return (p2.bit_range().current_byte() - p1.bit_range().current_byte())*8 + p2.bit_range().bit_offset() - p1.bit_range().bit_offset();
        -
        134 }
        -
        135 
        -
        136 template <typename NonAlignedPixelReference>
        -
        137 inline void memunit_advance(bit_aligned_pixel_iterator<NonAlignedPixelReference>& p, std::ptrdiff_t diff) {
        -
        138  p.bit_range().bit_advance(diff);
        -
        139 }
        -
        140 
        -
        141 template <typename NonAlignedPixelReference>
        -
        142 inline auto memunit_advanced(bit_aligned_pixel_iterator<NonAlignedPixelReference> const& p, std::ptrdiff_t diff) -> bit_aligned_pixel_iterator<NonAlignedPixelReference> {
        -
        143  bit_aligned_pixel_iterator<NonAlignedPixelReference> ret=p;
        -
        144  memunit_advance(ret, diff);
        -
        145  return ret;
        -
        146 }
        -
        147 
        -
        148 template <typename NonAlignedPixelReference> inline
        -
        149 auto memunit_advanced_ref(bit_aligned_pixel_iterator<NonAlignedPixelReference> it, std::ptrdiff_t diff) -> NonAlignedPixelReference
        -
        150 {
        -
        151  return *memunit_advanced(it,diff);
        -
        152 }
        -
        154 // HasDynamicXStepTypeConcept
        -
        156 
        -
        157 template <typename NonAlignedPixelReference>
        -
        158 struct dynamic_x_step_type<bit_aligned_pixel_iterator<NonAlignedPixelReference> > {
        -
        159  using type = memory_based_step_iterator<bit_aligned_pixel_iterator<NonAlignedPixelReference> >;
        -
        160 };
        -
        161 
        -
        163 // iterator_type_from_pixel
        -
        165 
        -
        166 template <typename B, typename C, typename L, bool M>
        -
        167 struct iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,false,false,false>
        -
        168 {
        -
        169  using type = bit_aligned_pixel_iterator<bit_aligned_pixel_reference<B,C,L,false>> ;
        -
        170 };
        -
        171 
        -
        172 template <typename B, typename C, typename L, bool M>
        -
        173 struct iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,false,false,true>
        -
        174 {
        -
        175  using type = bit_aligned_pixel_iterator<bit_aligned_pixel_reference<B,C,L,true>>;
        -
        176 };
        -
        177 
        -
        178 template <typename B, typename C, typename L, bool M, bool IsPlanar, bool IsStep, bool IsMutable>
        -
        179 struct iterator_type_from_pixel<bit_aligned_pixel_reference<B,C,L,M>,IsPlanar,IsStep,IsMutable>
        -
        180  : public iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,IsPlanar,IsStep,IsMutable> {};
        -
        181 
        -
        182 } } // namespace boost::gil
        -
        183 
        -
        184 namespace std {
        -
        185 
        -
        186 // It is important to provide an overload of uninitialized_copy for bit_aligned_pixel_iterator. The default STL implementation calls placement new,
        -
        187 // which is not defined for bit_aligned_pixel_iterator.
        -
        188 template <typename NonAlignedPixelReference>
        - - - - -
        193 {
        -
        194  return std::copy(first,last,dst);
        -
        195 }
        -
        196 
        -
        197 } // namespace std
        -
        198 
        -
        199 #endif
        -
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition: algorithm.hpp:1087
        -
        BOOST_FORCEINLINE auto copy(boost::gil::pixel< T, CS > *first, boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
        Copy when both src and dst are interleaved and of the same type can be just memmove.
        Definition: algorithm.hpp:145
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept,...
        Definition: bit_aligned_pixel_iterator.hpp:41
        -
        auto operator[](difference_type d) const -> reference
        Definition: bit_aligned_pixel_iterator.hpp:66
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_BIT_ALIGNED_PIXEL_ITERATOR_HPP
        +
        9#define BOOST_GIL_BIT_ALIGNED_PIXEL_ITERATOR_HPP
        +
        10
        +
        11#include <boost/gil/bit_aligned_pixel_reference.hpp>
        +
        12#include <boost/gil/pixel_iterator.hpp>
        +
        13
        +
        14#include <boost/config.hpp>
        +
        15#include <boost/iterator/iterator_facade.hpp>
        +
        16
        +
        17#include <functional>
        +
        18#include <type_traits>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        24
        +
        28
        +
        35
        +
        36template <typename NonAlignedPixelReference>
        +
        +
        37struct bit_aligned_pixel_iterator : public iterator_facade<bit_aligned_pixel_iterator<NonAlignedPixelReference>,
        +
        38 typename NonAlignedPixelReference::value_type,
        +
        39 std::random_access_iterator_tag,
        +
        40 const NonAlignedPixelReference,
        +
        41 typename NonAlignedPixelReference::bit_range_t::difference_type> {
        +
        42private:
        +
        43 using parent_t = iterator_facade<bit_aligned_pixel_iterator<NonAlignedPixelReference>,
        +
        44 typename NonAlignedPixelReference::value_type,
        +
        45 std::random_access_iterator_tag,
        +
        46 const NonAlignedPixelReference,
        +
        47 typename NonAlignedPixelReference::bit_range_t::difference_type>;
        +
        48 template <typename Ref> friend struct bit_aligned_pixel_iterator;
        +
        49
        +
        50 using bit_range_t = typename NonAlignedPixelReference::bit_range_t;
        +
        51public:
        +
        52 using difference_type = typename parent_t::difference_type;
        +
        53 using reference = typename parent_t::reference;
        +
        54
        + +
        56 bit_aligned_pixel_iterator(const bit_aligned_pixel_iterator& p) : _bit_range(p._bit_range) {}
        +
        57 bit_aligned_pixel_iterator& operator=(const bit_aligned_pixel_iterator& p) { _bit_range=p._bit_range; return *this; }
        +
        58
        +
        59 template <typename Ref> bit_aligned_pixel_iterator(const bit_aligned_pixel_iterator<Ref>& p) : _bit_range(p._bit_range) {}
        +
        60
        +
        61 bit_aligned_pixel_iterator(reference* ref) : _bit_range(ref->bit_range()) {}
        +
        62 explicit bit_aligned_pixel_iterator(typename bit_range_t::byte_t* data, int bit_offset=0) : _bit_range(data,bit_offset) {}
        +
        63
        +
        66 auto operator[](difference_type d) const -> reference { bit_aligned_pixel_iterator it=*this; it.advance(d); return *it; }
        +
        67
        +
        68 auto operator->() const -> reference { return **this; }
        +
        69 auto bit_range() const -> bit_range_t const& { return _bit_range; }
        +
        70 auto bit_range() -> bit_range_t& { return _bit_range; }
        +
        71private:
        +
        72 bit_range_t _bit_range;
        +
        73 static constexpr int bit_size = NonAlignedPixelReference::bit_size;
        +
        74
        +
        75 friend class boost::iterator_core_access;
        +
        76 auto dereference() const -> reference { return NonAlignedPixelReference(_bit_range); }
        +
        77 void increment() { ++_bit_range; }
        +
        78 void decrement() { --_bit_range; }
        +
        79 void advance(difference_type d) { _bit_range.bit_advance(d*bit_size); }
        +
        80
        +
        81 auto distance_to(bit_aligned_pixel_iterator const& it) const -> difference_type { return _bit_range.bit_distance_to(it._bit_range) / bit_size; }
        +
        82 bool equal(const bit_aligned_pixel_iterator& it) const { return _bit_range==it._bit_range; }
        +
        83};
        +
        +
        84
        +
        85template <typename NonAlignedPixelReference>
        +
        86struct const_iterator_type<bit_aligned_pixel_iterator<NonAlignedPixelReference>>
        +
        87{
        +
        88 using type =
        +
        89 bit_aligned_pixel_iterator<typename NonAlignedPixelReference::const_reference>;
        +
        90};
        +
        91
        +
        92template <typename NonAlignedPixelReference>
        +
        93struct iterator_is_mutable<bit_aligned_pixel_iterator<NonAlignedPixelReference>>
        +
        94 : std::integral_constant<bool, NonAlignedPixelReference::is_mutable>
        +
        95{};
        +
        96
        +
        97template <typename NonAlignedPixelReference>
        +
        98struct is_iterator_adaptor<bit_aligned_pixel_iterator<NonAlignedPixelReference>>
        +
        99 : std::false_type
        +
        100{};
        +
        101
        +
        103// PixelBasedConcept
        +
        105
        +
        106template <typename NonAlignedPixelReference>
        +
        107struct color_space_type<bit_aligned_pixel_iterator<NonAlignedPixelReference> > : public color_space_type<NonAlignedPixelReference> {};
        +
        108
        +
        109template <typename NonAlignedPixelReference>
        +
        110struct channel_mapping_type<bit_aligned_pixel_iterator<NonAlignedPixelReference> > : public channel_mapping_type<NonAlignedPixelReference> {};
        +
        111
        +
        112template <typename NonAlignedPixelReference>
        +
        113struct is_planar<bit_aligned_pixel_iterator<NonAlignedPixelReference> > : public is_planar<NonAlignedPixelReference> {}; // == false
        +
        114
        +
        116// MemoryBasedIteratorConcept
        +
        118
        +
        119template <typename NonAlignedPixelReference>
        +
        120struct byte_to_memunit<bit_aligned_pixel_iterator<NonAlignedPixelReference>>
        +
        121 : std::integral_constant<int, 8>
        +
        122{};
        +
        123
        +
        124template <typename NonAlignedPixelReference>
        +
        125inline auto memunit_step(const bit_aligned_pixel_iterator<NonAlignedPixelReference>&) -> std::ptrdiff_t
        +
        126{
        +
        127 return NonAlignedPixelReference::bit_size;
        +
        128}
        +
        129
        +
        130template <typename NonAlignedPixelReference>
        +
        131inline auto memunit_distance(bit_aligned_pixel_iterator<NonAlignedPixelReference> const& p1, bit_aligned_pixel_iterator<NonAlignedPixelReference> const& p2) -> std::ptrdiff_t
        +
        132{
        +
        133 return (p2.bit_range().current_byte() - p1.bit_range().current_byte())*8 + p2.bit_range().bit_offset() - p1.bit_range().bit_offset();
        +
        134}
        +
        135
        +
        136template <typename NonAlignedPixelReference>
        +
        137inline void memunit_advance(bit_aligned_pixel_iterator<NonAlignedPixelReference>& p, std::ptrdiff_t diff) {
        +
        138 p.bit_range().bit_advance(diff);
        +
        139}
        +
        140
        +
        141template <typename NonAlignedPixelReference>
        +
        142inline auto memunit_advanced(bit_aligned_pixel_iterator<NonAlignedPixelReference> const& p, std::ptrdiff_t diff) -> bit_aligned_pixel_iterator<NonAlignedPixelReference> {
        +
        143 bit_aligned_pixel_iterator<NonAlignedPixelReference> ret=p;
        +
        144 memunit_advance(ret, diff);
        +
        145 return ret;
        +
        146}
        +
        147
        +
        148template <typename NonAlignedPixelReference> inline
        +
        149auto memunit_advanced_ref(bit_aligned_pixel_iterator<NonAlignedPixelReference> it, std::ptrdiff_t diff) -> NonAlignedPixelReference
        +
        150{
        +
        151 return *memunit_advanced(it,diff);
        +
        152}
        +
        154// HasDynamicXStepTypeConcept
        +
        156
        +
        157template <typename NonAlignedPixelReference>
        +
        158struct dynamic_x_step_type<bit_aligned_pixel_iterator<NonAlignedPixelReference> > {
        +
        159 using type = memory_based_step_iterator<bit_aligned_pixel_iterator<NonAlignedPixelReference> >;
        +
        160};
        +
        161
        +
        163// iterator_type_from_pixel
        +
        165
        +
        166template <typename B, typename C, typename L, bool M>
        +
        167struct iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,false,false,false>
        +
        168{
        +
        169 using type = bit_aligned_pixel_iterator<bit_aligned_pixel_reference<B,C,L,false>> ;
        +
        170};
        +
        171
        +
        172template <typename B, typename C, typename L, bool M>
        +
        173struct iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,false,false,true>
        +
        174{
        +
        175 using type = bit_aligned_pixel_iterator<bit_aligned_pixel_reference<B,C,L,true>>;
        +
        176};
        +
        177
        +
        178template <typename B, typename C, typename L, bool M, bool IsPlanar, bool IsStep, bool IsMutable>
        +
        179struct iterator_type_from_pixel<bit_aligned_pixel_reference<B,C,L,M>,IsPlanar,IsStep,IsMutable>
        +
        180 : public iterator_type_from_pixel<const bit_aligned_pixel_reference<B,C,L,M>,IsPlanar,IsStep,IsMutable> {};
        +
        181
        +
        182} } // namespace boost::gil
        +
        183
        +
        184namespace std {
        +
        185
        +
        186// It is important to provide an overload of uninitialized_copy for bit_aligned_pixel_iterator. The default STL implementation calls placement new,
        +
        187// which is not defined for bit_aligned_pixel_iterator.
        +
        188template <typename NonAlignedPixelReference>
        + + + + +
        193{
        +
        194 return std::copy(first,last,dst);
        +
        195}
        +
        196
        +
        197} // namespace std
        +
        198
        +
        199#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept,...
        Definition bit_aligned_pixel_iterator.hpp:41
        +
        auto operator[](difference_type d) const -> reference
        Definition bit_aligned_pixel_iterator.hpp:66
        diff --git a/html/reference/bit__aligned__pixel__reference_8hpp_source.html b/html/reference/bit__aligned__pixel__reference_8hpp_source.html index 69ca2ea70..23dcd563d 100644 --- a/html/reference/bit__aligned__pixel__reference_8hpp_source.html +++ b/html/reference/bit__aligned__pixel__reference_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_reference.hpp Source File @@ -27,388 +27,393 @@

        - + +/* @license-end */ + +
        -
        -
        bit_aligned_pixel_reference.hpp
        +
        bit_aligned_pixel_reference.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_BIT_ALIGNED_PIXEL_REFERENCE_HPP
        -
        10 #define BOOST_GIL_BIT_ALIGNED_PIXEL_REFERENCE_HPP
        -
        11 
        -
        12 #include <boost/gil/pixel.hpp>
        -
        13 #include <boost/gil/channel.hpp>
        -
        14 #include <boost/gil/detail/mp11.hpp>
        -
        15 
        -
        16 #include <boost/assert.hpp>
        -
        17 #include <boost/config.hpp>
        -
        18 
        -
        19 #include <functional>
        -
        20 #include <type_traits>
        -
        21 
        -
        22 namespace boost { namespace gil {
        -
        23 
        -
        26 
        -
        28 // bit_range
        -
        29 //
        -
        30 // Represents a range of bits that can span multiple consecutive bytes. The range has a size fixed at compile time, but the offset is specified at run time.
        -
        32 
        -
        33 template <int RangeSize, bool IsMutable>
        -
        34 class bit_range {
        -
        35 public:
        -
        36  using byte_t = mp11::mp_if_c<IsMutable, unsigned char, unsigned char const>;
        -
        37  using difference_type = std::ptrdiff_t;
        -
        38  template <int RS, bool M> friend class bit_range;
        -
        39 private:
        -
        40  byte_t* _current_byte; // the starting byte of the bit range
        -
        41  int _bit_offset; // offset from the beginning of the current byte. 0<=_bit_offset<=7
        -
        42 
        -
        43 public:
        -
        44  bit_range() : _current_byte(nullptr), _bit_offset(0) {}
        -
        45  bit_range(byte_t* current_byte, int bit_offset)
        -
        46  : _current_byte(current_byte)
        -
        47  , _bit_offset(bit_offset)
        -
        48  {
        -
        49  BOOST_ASSERT(bit_offset >= 0 && bit_offset < 8);
        -
        50  }
        -
        51 
        -
        52  bit_range(bit_range const& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {}
        -
        53  template <bool M> bit_range(const bit_range<RangeSize,M>& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {}
        -
        54 
        -
        55  auto operator=(bit_range const& br) -> bit_range& { _current_byte = br._current_byte; _bit_offset=br._bit_offset; return *this; }
        -
        56  bool operator==(bit_range const& br) const { return _current_byte==br._current_byte && _bit_offset==br._bit_offset; }
        -
        57 
        -
        58  auto operator++() -> bit_range& {
        -
        59  _current_byte += (_bit_offset+RangeSize) / 8;
        -
        60  _bit_offset = (_bit_offset+RangeSize) % 8;
        -
        61  return *this;
        -
        62  }
        -
        63  auto operator--() -> bit_range& { bit_advance(-RangeSize); return *this; }
        -
        64 
        -
        65  void bit_advance(difference_type num_bits) {
        -
        66  int new_offset = int(_bit_offset+num_bits);
        -
        67  _current_byte += new_offset / 8;
        -
        68  _bit_offset = new_offset % 8;
        -
        69  if (_bit_offset<0) {
        -
        70  _bit_offset+=8;
        -
        71  --_current_byte;
        -
        72  }
        -
        73  }
        -
        74 
        -
        75  auto bit_distance_to(bit_range const& b) const -> difference_type
        -
        76  {
        -
        77  return (b.current_byte() - current_byte())*8 + b.bit_offset()-bit_offset();
        -
        78  }
        -
        79  auto current_byte() const -> byte_t* { return _current_byte; }
        -
        80  auto bit_offset() const -> int { return _bit_offset; }
        -
        81 };
        -
        82 
        -
        116 template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable>
        -
        117 struct bit_aligned_pixel_reference
        -
        118 {
        -
        119  static constexpr int bit_size =
        -
        120  mp11::mp_fold
        -
        121  <
        -
        122  ChannelBitSizes,
        -
        123  std::integral_constant<int, 0>,
        -
        124  mp11::mp_plus
        -
        125  >::value;
        -
        126 
        -
        127  using bit_range_t = boost::gil::bit_range<bit_size,IsMutable>;
        -
        128  using bitfield_t = BitField;
        -
        129  using data_ptr_t = mp11::mp_if_c<IsMutable, unsigned char*, const unsigned char*>;
        -
        130 
        -
        131  using layout_t = Layout;
        -
        132 
        - -
        134  using reference = const bit_aligned_pixel_reference<BitField, ChannelBitSizes, Layout, IsMutable>;
        -
        135  using const_reference = bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,false> const;
        -
        136 
        -
        137  static constexpr bool is_mutable = IsMutable;
        -
        138 
        -
        139  bit_aligned_pixel_reference(){}
        -
        140  bit_aligned_pixel_reference(data_ptr_t data_ptr, int bit_offset) : _bit_range(data_ptr, bit_offset) {}
        -
        141  explicit bit_aligned_pixel_reference(bit_range_t const& bit_range) : _bit_range(bit_range) {}
        -
        142 
        -
        143  template <bool IsMutable2>
        -
        144  bit_aligned_pixel_reference(bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,IsMutable2> const& p) : _bit_range(p._bit_range) {}
        -
        145 
        -
        146  // Grayscale references can be constructed from the channel reference
        -
        147  explicit bit_aligned_pixel_reference(typename kth_element_type<bit_aligned_pixel_reference,0>::type const channel0)
        -
        148  : _bit_range(static_cast<data_ptr_t>(&channel0), channel0.first_bit())
        -
        149  {
        -
        150  static_assert(num_channels<bit_aligned_pixel_reference>::value == 1, "");
        -
        151  }
        -
        152 
        -
        153  // Construct from another compatible pixel type
        -
        154  bit_aligned_pixel_reference(bit_aligned_pixel_reference const& p)
        -
        155  : _bit_range(p._bit_range) {}
        -
        156 
        -
        157  // TODO: Why p by non-const reference?
        -
        158  template <typename BF, typename CR>
        -
        159  bit_aligned_pixel_reference(packed_pixel<BF, CR, Layout>& p)
        -
        160  : _bit_range(static_cast<data_ptr_t>(&gil::at_c<0>(p)), gil::at_c<0>(p).first_bit())
        -
        161  {
        -
        162  check_compatible<packed_pixel<BF, CR, Layout>>();
        -
        163  }
        -
        164 
        -
        165  auto operator=(bit_aligned_pixel_reference const& p) const
        -
        166  -> bit_aligned_pixel_reference const&
        -
        167  {
        -
        168  static_copy(p, *this);
        -
        169  return *this;
        -
        170  }
        -
        171 
        -
        172  template <typename P>
        -
        173  auto operator=(P const& p) const -> bit_aligned_pixel_reference const&
        -
        174  {
        -
        175  assign(p, is_pixel<P>());
        -
        176  return *this;
        -
        177  }
        -
        178 
        -
        179  template <typename P>
        -
        180  bool operator==(P const& p) const
        -
        181  {
        -
        182  return equal(p, is_pixel<P>());
        -
        183  }
        -
        184 
        -
        185  template <typename P>
        -
        186  bool operator!=(P const& p) const { return !(*this==p); }
        -
        187 
        -
        188  auto operator->() const -> bit_aligned_pixel_reference const* { return this; }
        -
        189 
        -
        190  auto bit_range() const -> bit_range_t const& { return _bit_range; }
        -
        191 
        -
        192 private:
        -
        193  mutable bit_range_t _bit_range;
        -
        194  template <typename B, typename C, typename L, bool M>
        -
        195  friend struct bit_aligned_pixel_reference;
        -
        196 
        -
        197  template <typename Pixel> static void check_compatible() { gil_function_requires<PixelsCompatibleConcept<Pixel,bit_aligned_pixel_reference> >(); }
        -
        198 
        -
        199  template <typename Pixel>
        -
        200  void assign(Pixel const& p, std::true_type) const
        -
        201  {
        -
        202  check_compatible<Pixel>();
        -
        203  static_copy(p, *this);
        -
        204  }
        -
        205 
        -
        206  template <typename Pixel>
        -
        207  bool equal(Pixel const& p, std::true_type) const
        -
        208  {
        -
        209  check_compatible<Pixel>();
        -
        210  return static_equal(*this, p);
        -
        211  }
        -
        212 
        -
        213 private:
        -
        214  static void check_gray()
        -
        215  {
        -
        216  static_assert(std::is_same<typename Layout::color_space_t, gray_t>::value, "");
        -
        217  }
        -
        218 
        -
        219  template <typename Channel>
        -
        220  void assign(Channel const& channel, std::false_type) const
        -
        221  {
        -
        222  check_gray();
        -
        223  gil::at_c<0>(*this) = channel;
        -
        224  }
        -
        225 
        -
        226  template <typename Channel>
        -
        227  bool equal (Channel const& channel, std::false_type) const
        -
        228  {
        -
        229  check_gray();
        -
        230  return gil::at_c<0>(*this) == channel;
        -
        231  }
        -
        232 };
        -
        233 
        -
        235 // ColorBasedConcept
        -
        237 
        -
        238 template <typename BitField, typename ChannelBitSizes, typename L, bool IsMutable, int K>
        -
        239 struct kth_element_type
        -
        240 <
        -
        241  bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>,
        -
        242  K
        -
        243 >
        -
        244 {
        -
        245  using type = packed_dynamic_channel_reference
        -
        246  <
        -
        247  BitField,
        -
        248  mp11::mp_at_c<ChannelBitSizes, K>::value,
        -
        249  IsMutable
        -
        250  > const;
        -
        251 };
        -
        252 
        -
        253 template <typename B, typename C, typename L, bool M, int K>
        -
        254 struct kth_element_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
        -
        255  : public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
        -
        256 
        -
        257 template <typename B, typename C, typename L, bool M, int K>
        -
        258 struct kth_element_const_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
        -
        259  : public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
        -
        260 
        -
        261 namespace detail {
        -
        262 
        -
        263 // returns sum of IntegralVector[0] ... IntegralVector[K-1]
        -
        264 template <typename IntegralVector, int K>
        -
        265 struct sum_k
        -
        266  : mp11::mp_plus
        -
        267  <
        -
        268  sum_k<IntegralVector, K - 1>,
        -
        269  typename mp11::mp_at_c<IntegralVector, K - 1>::type
        -
        270  >
        -
        271 {};
        -
        272 
        -
        273 template <typename IntegralVector>
        -
        274 struct sum_k<IntegralVector, 0> : std::integral_constant<int, 0> {};
        -
        275 
        -
        276 } // namespace detail
        -
        277 
        -
        278 // at_c required by MutableColorBaseConcept
        -
        279 template <int K, typename BitField, typename ChannelBitSizes, typename L, bool IsMutable>
        -
        280 inline
        -
        281 auto at_c(const bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>& p)
        -
        282  -> typename kth_element_reference_type<bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>, K>::type
        -
        283 {
        -
        284  using pixel_t = bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>;
        -
        285  using channel_t = typename kth_element_reference_type<pixel_t, K>::type;
        -
        286  using bit_range_t = typename pixel_t::bit_range_t;
        -
        287 
        -
        288  bit_range_t bit_range(p.bit_range());
        -
        289  bit_range.bit_advance(detail::sum_k<ChannelBitSizes, K>::value);
        -
        290 
        -
        291  return channel_t(bit_range.current_byte(), bit_range.bit_offset());
        -
        292 }
        -
        293 
        -
        295 // PixelConcept
        -
        297 
        -
        299 template <typename B, typename C, typename L, bool M>
        -
        300 struct is_pixel<bit_aligned_pixel_reference<B, C, L, M> > : std::true_type {};
        -
        301 
        -
        303 // PixelBasedConcept
        -
        305 
        -
        306 template <typename B, typename C, typename L, bool M>
        -
        307 struct color_space_type<bit_aligned_pixel_reference<B, C, L, M>>
        -
        308 {
        -
        309  using type = typename L::color_space_t;
        -
        310 };
        -
        311 
        -
        312 template <typename B, typename C, typename L, bool M>
        -
        313 struct channel_mapping_type<bit_aligned_pixel_reference<B, C, L, M>>
        -
        314 {
        -
        315  using type = typename L::channel_mapping_t;
        -
        316 };
        -
        317 
        -
        318 template <typename B, typename C, typename L, bool M>
        -
        319 struct is_planar<bit_aligned_pixel_reference<B, C, L, M>> : std::false_type {};
        -
        320 
        -
        322 // pixel_reference_type
        -
        324 
        -
        325 // Constructs a homogeneous bit_aligned_pixel_reference given a channel reference
        -
        326 template <typename BitField, int NumBits, typename Layout>
        -
        327 struct pixel_reference_type
        -
        328  <
        -
        329  packed_dynamic_channel_reference<BitField, NumBits, false> const,
        -
        330  Layout, false, false
        -
        331  >
        -
        332 {
        -
        333 private:
        -
        334  using channel_bit_sizes_t = mp11::mp_repeat
        -
        335  <
        -
        336  mp11::mp_list<std::integral_constant<unsigned, NumBits>>,
        -
        337  mp11::mp_size<typename Layout::color_space_t>
        -
        338  >;
        -
        339 
        -
        340 public:
        -
        341  using type =
        -
        342  bit_aligned_pixel_reference<BitField, channel_bit_sizes_t, Layout, false>;
        -
        343 };
        -
        344 
        -
        345 // Same but for the mutable case. We cannot combine the mutable
        -
        346 // and read-only cases because this triggers ambiguity
        -
        347 template <typename BitField, int NumBits, typename Layout>
        -
        348 struct pixel_reference_type
        -
        349  <
        -
        350  packed_dynamic_channel_reference<BitField, NumBits, true> const,
        -
        351  Layout, false, true
        -
        352  >
        -
        353 {
        -
        354 private:
        -
        355  using channel_bit_sizes_t = mp11::mp_repeat
        -
        356  <
        -
        357  mp11::mp_list<std::integral_constant<unsigned, NumBits>>,
        -
        358  mp11::mp_size<typename Layout::color_space_t>
        -
        359  >;
        -
        360 
        -
        361 public:
        -
        362  using type = bit_aligned_pixel_reference<BitField, channel_bit_sizes_t, Layout, true>;
        -
        363 };
        -
        364 
        -
        365 } } // namespace boost::gil
        -
        366 
        -
        367 namespace std {
        -
        368 
        -
        369 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
        -
        370 // swap with 'left bias':
        -
        371 // - swap between proxy and anything
        -
        372 // - swap between value type and proxy
        -
        373 // - swap between proxy and proxy
        -
        374 // Having three overloads allows us to swap between different (but compatible) models of PixelConcept
        -
        375 
        -
        376 template <typename B, typename C, typename L, typename R> inline
        -
        377 void swap(boost::gil::bit_aligned_pixel_reference<B,C,L,true> const x, R& y) {
        -
        378  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
        -
        379 }
        -
        380 
        -
        381 
        -
        382 template <typename B, typename C, typename L> inline
        -
        383 void swap(typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type& x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
        -
        384  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
        -
        385 }
        -
        386 
        -
        387 
        -
        388 template <typename B, typename C, typename L> inline
        -
        389 void swap(boost::gil::bit_aligned_pixel_reference<B,C,L,true> const x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
        -
        390  boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
        -
        391 }
        -
        392 
        -
        393 } // namespace std
        -
        394 
        -
        395 #endif
        -
        Definition: bit_aligned_pixel_reference.hpp:34
        -
        auto at_c(detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
        Provides mutable access to the K-th element, in physical order.
        Definition: color_base.hpp:632
        -
        void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
        swap for packed_channel_reference
        Definition: channel.hpp:583
        -
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition: algorithm.hpp:1087
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
        Definition: packed_pixel.hpp:50
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_BIT_ALIGNED_PIXEL_REFERENCE_HPP
        +
        10#define BOOST_GIL_BIT_ALIGNED_PIXEL_REFERENCE_HPP
        +
        11
        +
        12#include <boost/gil/pixel.hpp>
        +
        13#include <boost/gil/channel.hpp>
        +
        14#include <boost/gil/detail/mp11.hpp>
        +
        15
        +
        16#include <boost/assert.hpp>
        +
        17#include <boost/config.hpp>
        +
        18
        +
        19#include <functional>
        +
        20#include <type_traits>
        +
        21
        +
        22namespace boost { namespace gil {
        +
        23
        +
        26
        +
        28// bit_range
        +
        29//
        +
        30// Represents a range of bits that can span multiple consecutive bytes. The range has a size fixed at compile time, but the offset is specified at run time.
        +
        32
        +
        33template <int RangeSize, bool IsMutable>
        +
        +
        34class bit_range {
        +
        35public:
        +
        36 using byte_t = mp11::mp_if_c<IsMutable, unsigned char, unsigned char const>;
        +
        37 using difference_type = std::ptrdiff_t;
        +
        38 template <int RS, bool M> friend class bit_range;
        +
        39private:
        +
        40 byte_t* _current_byte; // the starting byte of the bit range
        +
        41 int _bit_offset; // offset from the beginning of the current byte. 0<=_bit_offset<=7
        +
        42
        +
        43public:
        +
        44 bit_range() : _current_byte(nullptr), _bit_offset(0) {}
        +
        45 bit_range(byte_t* current_byte, int bit_offset)
        +
        46 : _current_byte(current_byte)
        +
        47 , _bit_offset(bit_offset)
        +
        48 {
        +
        49 BOOST_ASSERT(bit_offset >= 0 && bit_offset < 8);
        +
        50 }
        +
        51
        +
        52 bit_range(bit_range const& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {}
        +
        53 template <bool M> bit_range(const bit_range<RangeSize,M>& br) : _current_byte(br._current_byte), _bit_offset(br._bit_offset) {}
        +
        54
        +
        55 auto operator=(bit_range const& br) -> bit_range& { _current_byte = br._current_byte; _bit_offset=br._bit_offset; return *this; }
        +
        56 bool operator==(bit_range const& br) const { return _current_byte==br._current_byte && _bit_offset==br._bit_offset; }
        +
        57
        +
        58 auto operator++() -> bit_range& {
        +
        59 _current_byte += (_bit_offset+RangeSize) / 8;
        +
        60 _bit_offset = (_bit_offset+RangeSize) % 8;
        +
        61 return *this;
        +
        62 }
        +
        63 auto operator--() -> bit_range& { bit_advance(-RangeSize); return *this; }
        +
        64
        +
        65 void bit_advance(difference_type num_bits) {
        +
        66 int new_offset = int(_bit_offset+num_bits);
        +
        67 _current_byte += new_offset / 8;
        +
        68 _bit_offset = new_offset % 8;
        +
        69 if (_bit_offset<0) {
        +
        70 _bit_offset+=8;
        +
        71 --_current_byte;
        +
        72 }
        +
        73 }
        +
        74
        +
        75 auto bit_distance_to(bit_range const& b) const -> difference_type
        +
        76 {
        +
        77 return (b.current_byte() - current_byte())*8 + b.bit_offset()-bit_offset();
        +
        78 }
        +
        79 auto current_byte() const -> byte_t* { return _current_byte; }
        +
        80 auto bit_offset() const -> int { return _bit_offset; }
        +
        81};
        +
        +
        82
        +
        116template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable>
        +
        117struct bit_aligned_pixel_reference
        +
        118{
        +
        119 static constexpr int bit_size =
        +
        120 mp11::mp_fold
        +
        121 <
        +
        122 ChannelBitSizes,
        +
        123 std::integral_constant<int, 0>,
        +
        124 mp11::mp_plus
        +
        125 >::value;
        +
        126
        + +
        128 using bitfield_t = BitField;
        +
        129 using data_ptr_t = mp11::mp_if_c<IsMutable, unsigned char*, const unsigned char*>;
        +
        130
        +
        131 using layout_t = Layout;
        +
        132
        + +
        134 using reference = const bit_aligned_pixel_reference<BitField, ChannelBitSizes, Layout, IsMutable>;
        +
        135 using const_reference = bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,false> const;
        +
        136
        +
        137 static constexpr bool is_mutable = IsMutable;
        +
        138
        +
        139 bit_aligned_pixel_reference(){}
        +
        140 bit_aligned_pixel_reference(data_ptr_t data_ptr, int bit_offset) : _bit_range(data_ptr, bit_offset) {}
        +
        141 explicit bit_aligned_pixel_reference(bit_range_t const& bit_range) : _bit_range(bit_range) {}
        +
        142
        +
        143 template <bool IsMutable2>
        +
        144 bit_aligned_pixel_reference(bit_aligned_pixel_reference<BitField,ChannelBitSizes,Layout,IsMutable2> const& p) : _bit_range(p._bit_range) {}
        +
        145
        +
        146 // Grayscale references can be constructed from the channel reference
        +
        147 explicit bit_aligned_pixel_reference(typename kth_element_type<bit_aligned_pixel_reference,0>::type const channel0)
        +
        148 : _bit_range(static_cast<data_ptr_t>(&channel0), channel0.first_bit())
        +
        149 {
        +
        150 static_assert(num_channels<bit_aligned_pixel_reference>::value == 1, "");
        +
        151 }
        +
        152
        +
        153 // Construct from another compatible pixel type
        +
        154 bit_aligned_pixel_reference(bit_aligned_pixel_reference const& p)
        +
        155 : _bit_range(p._bit_range) {}
        +
        156
        +
        157 // TODO: Why p by non-const reference?
        +
        158 template <typename BF, typename CR>
        +
        159 bit_aligned_pixel_reference(packed_pixel<BF, CR, Layout>& p)
        +
        160 : _bit_range(static_cast<data_ptr_t>(&gil::at_c<0>(p)), gil::at_c<0>(p).first_bit())
        +
        161 {
        +
        162 check_compatible<packed_pixel<BF, CR, Layout>>();
        +
        163 }
        +
        164
        +
        165 auto operator=(bit_aligned_pixel_reference const& p) const
        +
        166 -> bit_aligned_pixel_reference const&
        +
        167 {
        +
        168 static_copy(p, *this);
        +
        169 return *this;
        +
        170 }
        +
        171
        +
        172 template <typename P>
        +
        173 auto operator=(P const& p) const -> bit_aligned_pixel_reference const&
        +
        174 {
        +
        175 assign(p, is_pixel<P>());
        +
        176 return *this;
        +
        177 }
        +
        178
        +
        179 template <typename P>
        +
        180 bool operator==(P const& p) const
        +
        181 {
        +
        182 return equal(p, is_pixel<P>());
        +
        183 }
        +
        184
        +
        185 template <typename P>
        +
        186 bool operator!=(P const& p) const { return !(*this==p); }
        +
        187
        +
        188 auto operator->() const -> bit_aligned_pixel_reference const* { return this; }
        +
        189
        +
        190 auto bit_range() const -> bit_range_t const& { return _bit_range; }
        +
        191
        +
        192private:
        +
        193 mutable bit_range_t _bit_range;
        +
        194 template <typename B, typename C, typename L, bool M>
        +
        195 friend struct bit_aligned_pixel_reference;
        +
        196
        +
        197 template <typename Pixel> static void check_compatible() { gil_function_requires<PixelsCompatibleConcept<Pixel,bit_aligned_pixel_reference> >(); }
        +
        198
        +
        199 template <typename Pixel>
        +
        200 void assign(Pixel const& p, std::true_type) const
        +
        201 {
        +
        202 check_compatible<Pixel>();
        +
        203 static_copy(p, *this);
        +
        204 }
        +
        205
        +
        206 template <typename Pixel>
        +
        207 bool equal(Pixel const& p, std::true_type) const
        +
        208 {
        +
        209 check_compatible<Pixel>();
        +
        210 return static_equal(*this, p);
        +
        211 }
        +
        212
        +
        213private:
        +
        214 static void check_gray()
        +
        215 {
        +
        216 static_assert(std::is_same<typename Layout::color_space_t, gray_t>::value, "");
        +
        217 }
        +
        218
        +
        219 template <typename Channel>
        +
        220 void assign(Channel const& channel, std::false_type) const
        +
        221 {
        +
        222 check_gray();
        +
        223 gil::at_c<0>(*this) = channel;
        +
        224 }
        +
        225
        +
        226 template <typename Channel>
        +
        227 bool equal (Channel const& channel, std::false_type) const
        +
        228 {
        +
        229 check_gray();
        +
        230 return gil::at_c<0>(*this) == channel;
        +
        231 }
        +
        232};
        +
        233
        +
        235// ColorBasedConcept
        +
        237
        +
        238template <typename BitField, typename ChannelBitSizes, typename L, bool IsMutable, int K>
        +
        239struct kth_element_type
        +
        240<
        +
        241 bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>,
        +
        242 K
        +
        243>
        +
        244{
        +
        245 using type = packed_dynamic_channel_reference
        +
        246 <
        +
        247 BitField,
        +
        248 mp11::mp_at_c<ChannelBitSizes, K>::value,
        +
        249 IsMutable
        +
        250 > const;
        +
        251};
        +
        252
        +
        253template <typename B, typename C, typename L, bool M, int K>
        +
        254struct kth_element_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
        +
        255 : public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
        +
        256
        +
        257template <typename B, typename C, typename L, bool M, int K>
        +
        258struct kth_element_const_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>
        +
        259 : public kth_element_type<bit_aligned_pixel_reference<B,C,L,M>, K> {};
        +
        260
        +
        261namespace detail {
        +
        262
        +
        263// returns sum of IntegralVector[0] ... IntegralVector[K-1]
        +
        264template <typename IntegralVector, int K>
        +
        265struct sum_k
        +
        266 : mp11::mp_plus
        +
        267 <
        +
        268 sum_k<IntegralVector, K - 1>,
        +
        269 typename mp11::mp_at_c<IntegralVector, K - 1>::type
        +
        270 >
        +
        271{};
        +
        272
        +
        273template <typename IntegralVector>
        +
        274struct sum_k<IntegralVector, 0> : std::integral_constant<int, 0> {};
        +
        275
        +
        276} // namespace detail
        +
        277
        +
        278// at_c required by MutableColorBaseConcept
        +
        279template <int K, typename BitField, typename ChannelBitSizes, typename L, bool IsMutable>
        +
        280inline
        +
        281auto at_c(const bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>& p)
        +
        282 -> typename kth_element_reference_type<bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>, K>::type
        +
        283{
        +
        284 using pixel_t = bit_aligned_pixel_reference<BitField, ChannelBitSizes, L, IsMutable>;
        +
        285 using channel_t = typename kth_element_reference_type<pixel_t, K>::type;
        +
        286 using bit_range_t = typename pixel_t::bit_range_t;
        +
        287
        +
        288 bit_range_t bit_range(p.bit_range());
        +
        289 bit_range.bit_advance(detail::sum_k<ChannelBitSizes, K>::value);
        +
        290
        +
        291 return channel_t(bit_range.current_byte(), bit_range.bit_offset());
        +
        292}
        +
        293
        +
        295// PixelConcept
        +
        297
        +
        299template <typename B, typename C, typename L, bool M>
        +
        300struct is_pixel<bit_aligned_pixel_reference<B, C, L, M> > : std::true_type {};
        +
        301
        +
        303// PixelBasedConcept
        +
        305
        +
        306template <typename B, typename C, typename L, bool M>
        +
        307struct color_space_type<bit_aligned_pixel_reference<B, C, L, M>>
        +
        308{
        +
        309 using type = typename L::color_space_t;
        +
        310};
        +
        311
        +
        312template <typename B, typename C, typename L, bool M>
        +
        313struct channel_mapping_type<bit_aligned_pixel_reference<B, C, L, M>>
        +
        314{
        +
        315 using type = typename L::channel_mapping_t;
        +
        316};
        +
        317
        +
        318template <typename B, typename C, typename L, bool M>
        +
        319struct is_planar<bit_aligned_pixel_reference<B, C, L, M>> : std::false_type {};
        +
        320
        +
        322// pixel_reference_type
        +
        324
        +
        325// Constructs a homogeneous bit_aligned_pixel_reference given a channel reference
        +
        326template <typename BitField, int NumBits, typename Layout>
        +
        327struct pixel_reference_type
        +
        328 <
        +
        329 packed_dynamic_channel_reference<BitField, NumBits, false> const,
        +
        330 Layout, false, false
        +
        331 >
        +
        332{
        +
        333private:
        +
        334 using channel_bit_sizes_t = mp11::mp_repeat
        +
        335 <
        +
        336 mp11::mp_list<std::integral_constant<unsigned, NumBits>>,
        +
        337 mp11::mp_size<typename Layout::color_space_t>
        +
        338 >;
        +
        339
        +
        340public:
        +
        341 using type =
        +
        342 bit_aligned_pixel_reference<BitField, channel_bit_sizes_t, Layout, false>;
        +
        343};
        +
        344
        +
        345// Same but for the mutable case. We cannot combine the mutable
        +
        346// and read-only cases because this triggers ambiguity
        +
        347template <typename BitField, int NumBits, typename Layout>
        +
        348struct pixel_reference_type
        +
        349 <
        +
        350 packed_dynamic_channel_reference<BitField, NumBits, true> const,
        +
        351 Layout, false, true
        +
        352 >
        +
        353{
        +
        354private:
        +
        355 using channel_bit_sizes_t = mp11::mp_repeat
        +
        356 <
        +
        357 mp11::mp_list<std::integral_constant<unsigned, NumBits>>,
        +
        358 mp11::mp_size<typename Layout::color_space_t>
        +
        359 >;
        +
        360
        +
        361public:
        +
        362 using type = bit_aligned_pixel_reference<BitField, channel_bit_sizes_t, Layout, true>;
        +
        363};
        +
        364
        +
        365} } // namespace boost::gil
        +
        366
        +
        367namespace std {
        +
        368
        +
        369// We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
        +
        370// swap with 'left bias':
        +
        371// - swap between proxy and anything
        +
        372// - swap between value type and proxy
        +
        373// - swap between proxy and proxy
        +
        374// Having three overloads allows us to swap between different (but compatible) models of PixelConcept
        +
        375
        +
        376template <typename B, typename C, typename L, typename R> inline
        +
        377void swap(boost::gil::bit_aligned_pixel_reference<B,C,L,true> const x, R& y) {
        +
        378 boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
        +
        379}
        +
        380
        +
        381
        +
        382template <typename B, typename C, typename L> inline
        +
        383void swap(typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type& x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
        +
        384 boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
        +
        385}
        +
        386
        +
        387
        +
        388template <typename B, typename C, typename L> inline
        +
        389void swap(boost::gil::bit_aligned_pixel_reference<B,C,L,true> const x, const boost::gil::bit_aligned_pixel_reference<B,C,L,true> y) {
        +
        390 boost::gil::swap_proxy<typename boost::gil::bit_aligned_pixel_reference<B,C,L,true>::value_type>(x,y);
        +
        391}
        +
        392
        +
        393} // namespace std
        +
        394
        +
        395#endif
        +
        Definition bit_aligned_pixel_reference.hpp:34
        +
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition algorithm.hpp:1087
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
        Definition packed_pixel.hpp:50
        diff --git a/html/reference/bit__operations_8hpp_source.html b/html/reference/bit__operations_8hpp_source.html index b6995577c..1908fc482 100644 --- a/html/reference/bit__operations_8hpp_source.html +++ b/html/reference/bit__operations_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_operations.hpp Source File @@ -27,231 +27,235 @@

        - + +/* @license-end */ + +
        -
        -
        bit_operations.hpp
        +
        bit_operations.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_BIT_OPERATIONS_HPP
        -
        9 #define BOOST_GIL_IO_BIT_OPERATIONS_HPP
        -
        10 
        -
        11 #include <boost/gil/io/typedefs.hpp>
        -
        12 
        -
        13 #include <array>
        -
        14 #include <cstddef>
        -
        15 #include <type_traits>
        -
        16 
        -
        17 namespace boost { namespace gil { namespace detail {
        -
        18 
        -
        19 // 1110 1100 -> 0011 0111
        -
        20 template <typename Buffer, typename IsBitAligned>
        -
        21 struct mirror_bits
        -
        22 {
        -
        23  mirror_bits(bool) {};
        -
        24 
        -
        25  void operator()(Buffer&) {}
        -
        26  void operator()(byte_t*, std::size_t){}
        -
        27 };
        -
        28 
        -
        29 // The functor will generate a lookup table since the
        -
        30 // mirror operation is quite costly.
        -
        31 template <typename Buffer>
        -
        32 struct mirror_bits<Buffer, std::true_type>
        -
        33 {
        -
        34  mirror_bits(bool apply_operation = true)
        -
        35  : apply_operation_(apply_operation)
        -
        36  {
        -
        37  if(apply_operation_)
        -
        38  {
        -
        39  byte_t i = 0;
        -
        40  do
        -
        41  {
        -
        42  lookup_[i] = mirror(i);
        -
        43  }
        -
        44  while (i++ != 255);
        -
        45  }
        -
        46  }
        -
        47 
        -
        48  void operator()(Buffer& buffer)
        -
        49  {
        -
        50  if (apply_operation_)
        -
        51  for_each(buffer.begin(), buffer.end(), [this](byte_t& c) { lookup(c); });
        -
        52  }
        -
        53 
        -
        54  void operator()(byte_t *dst, std::size_t size)
        -
        55  {
        -
        56  for (std::size_t i = 0; i < size; ++i)
        -
        57  {
        -
        58  lookup(*dst);
        -
        59  ++dst;
        -
        60  }
        -
        61  }
        -
        62 
        -
        63 private:
        -
        64 
        -
        65  void lookup(byte_t& c)
        -
        66  {
        -
        67  c = lookup_[c];
        -
        68  }
        -
        69 
        -
        70  static byte_t mirror(byte_t c)
        -
        71  {
        -
        72  byte_t result = 0;
        -
        73  for (int i = 0; i < 8; ++i)
        -
        74  {
        -
        75  result = result << 1;
        -
        76  result |= (c & 1);
        -
        77  c = c >> 1;
        -
        78  }
        -
        79 
        -
        80  return result;
        -
        81  }
        -
        82 
        -
        83  std::array<byte_t, 256> lookup_;
        -
        84  bool apply_operation_;
        -
        85 
        -
        86 };
        -
        87 
        -
        88 // 0011 1111 -> 1100 0000
        -
        89 template <typename Buffer, typename IsBitAligned>
        -
        90 struct negate_bits
        -
        91 {
        -
        92  void operator()(Buffer&) {};
        -
        93 };
        -
        94 
        -
        95 template <typename Buffer>
        -
        96 struct negate_bits<Buffer, std::true_type>
        -
        97 {
        -
        98  void operator()(Buffer& buffer)
        -
        99  {
        -
        100  for_each(buffer.begin(), buffer.end(),
        -
        101  negate_bits<Buffer, std::true_type>::negate);
        -
        102  }
        -
        103 
        -
        104  void operator()(byte_t* dst, std::size_t size)
        -
        105  {
        -
        106  for (std::size_t i = 0; i < size; ++i)
        -
        107  {
        -
        108  negate(*dst);
        -
        109  ++dst;
        -
        110  }
        -
        111  }
        -
        112 
        -
        113 private:
        -
        114 
        -
        115  static void negate(byte_t& b)
        -
        116  {
        -
        117  b = ~b;
        -
        118  }
        -
        119 };
        -
        120 
        -
        121 // 11101100 -> 11001110
        -
        122 template <typename Buffer, typename IsBitAligned>
        -
        123 struct swap_half_bytes
        -
        124 {
        -
        125  void operator()(Buffer&) {};
        -
        126 };
        -
        127 
        -
        128 template <typename Buffer>
        -
        129 struct swap_half_bytes<Buffer, std::true_type>
        -
        130 {
        -
        131  void operator()(Buffer& buffer)
        -
        132  {
        -
        133  for_each(buffer.begin(), buffer.end(),
        - -
        135  }
        -
        136 
        -
        137  void operator()(byte_t* dst, std::size_t size)
        -
        138  {
        -
        139  for (std::size_t i = 0; i < size; ++i)
        -
        140  {
        -
        141  swap(*dst);
        -
        142  ++dst;
        -
        143  }
        -
        144  }
        -
        145 
        -
        146 private:
        -
        147 
        -
        148  static void swap(byte_t& c)
        -
        149  {
        -
        150  c = ((c << 4) & 0xF0) | ((c >> 4) & 0x0F);
        -
        151  }
        -
        152 };
        -
        153 
        -
        154 template <typename Buffer>
        -
        155 struct do_nothing
        -
        156 {
        -
        157  do_nothing() = default;
        -
        158 
        -
        159  void operator()(Buffer&) {}
        -
        160 };
        -
        161 
        -
        163 template <typename T>
        -
        164 inline unsigned int trailing_zeros(T x) noexcept
        -
        165 {
        -
        166  unsigned int n = 0;
        -
        167 
        -
        168  x = ~x & (x - 1);
        -
        169  while (x)
        -
        170  {
        -
        171  n = n + 1;
        -
        172  x = x >> 1;
        -
        173  }
        -
        174 
        -
        175  return n;
        -
        176 }
        -
        177 
        -
        179 template <typename T>
        -
        180 inline
        -
        181 unsigned int count_ones(T x) noexcept
        -
        182 {
        -
        183  unsigned int n = 0;
        -
        184 
        -
        185  while (x)
        -
        186  {
        -
        187  // clear the least significant bit set
        -
        188  x &= x - 1;
        -
        189  ++n;
        -
        190  }
        -
        191 
        -
        192  return n;
        -
        193 }
        -
        194 
        -
        195 }}} // namespace boost::gil::detail
        -
        196 
        -
        197 #endif
        -
        void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
        swap for packed_channel_reference
        Definition: channel.hpp:583
        -
        BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
        Applies the visitor op to the variants.
        Definition: apply_operation.hpp:20
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_BIT_OPERATIONS_HPP
        +
        9#define BOOST_GIL_IO_BIT_OPERATIONS_HPP
        +
        10
        +
        11#include <boost/gil/io/typedefs.hpp>
        +
        12
        +
        13#include <array>
        +
        14#include <cstddef>
        +
        15#include <type_traits>
        +
        16
        +
        17namespace boost { namespace gil { namespace detail {
        +
        18
        +
        19// 1110 1100 -> 0011 0111
        +
        20template <typename Buffer, typename IsBitAligned>
        +
        21struct mirror_bits
        +
        22{
        +
        23 mirror_bits(bool) {};
        +
        24
        +
        25 void operator()(Buffer&) {}
        +
        26 void operator()(byte_t*, std::size_t){}
        +
        27};
        +
        28
        +
        29// The functor will generate a lookup table since the
        +
        30// mirror operation is quite costly.
        +
        31template <typename Buffer>
        +
        32struct mirror_bits<Buffer, std::true_type>
        +
        33{
        +
        34 mirror_bits(bool apply_operation = true)
        +
        35 : apply_operation_(apply_operation)
        +
        36 {
        +
        37 if(apply_operation_)
        +
        38 {
        +
        39 byte_t i = 0;
        +
        40 do
        +
        41 {
        +
        42 lookup_[i] = mirror(i);
        +
        43 }
        +
        44 while (i++ != 255);
        +
        45 }
        +
        46 }
        +
        47
        +
        48 void operator()(Buffer& buffer)
        +
        49 {
        +
        50 if (apply_operation_)
        +
        51 for_each(buffer.begin(), buffer.end(), [this](byte_t& c) { lookup(c); });
        +
        52 }
        +
        53
        +
        54 void operator()(byte_t *dst, std::size_t size)
        +
        55 {
        +
        56 for (std::size_t i = 0; i < size; ++i)
        +
        57 {
        +
        58 lookup(*dst);
        +
        59 ++dst;
        +
        60 }
        +
        61 }
        +
        62
        +
        63private:
        +
        64
        +
        65 void lookup(byte_t& c)
        +
        66 {
        +
        67 c = lookup_[c];
        +
        68 }
        +
        69
        +
        70 static byte_t mirror(byte_t c)
        +
        71 {
        +
        72 byte_t result = 0;
        +
        73 for (int i = 0; i < 8; ++i)
        +
        74 {
        +
        75 result = result << 1;
        +
        76 result |= (c & 1);
        +
        77 c = c >> 1;
        +
        78 }
        +
        79
        +
        80 return result;
        +
        81 }
        +
        82
        +
        83 std::array<byte_t, 256> lookup_;
        +
        84 bool apply_operation_;
        +
        85
        +
        86};
        +
        87
        +
        88// 0011 1111 -> 1100 0000
        +
        89template <typename Buffer, typename IsBitAligned>
        +
        90struct negate_bits
        +
        91{
        +
        92 void operator()(Buffer&) {};
        +
        93};
        +
        94
        +
        95template <typename Buffer>
        +
        96struct negate_bits<Buffer, std::true_type>
        +
        97{
        +
        98 void operator()(Buffer& buffer)
        +
        99 {
        +
        100 for_each(buffer.begin(), buffer.end(),
        +
        101 negate_bits<Buffer, std::true_type>::negate);
        +
        102 }
        +
        103
        +
        104 void operator()(byte_t* dst, std::size_t size)
        +
        105 {
        +
        106 for (std::size_t i = 0; i < size; ++i)
        +
        107 {
        +
        108 negate(*dst);
        +
        109 ++dst;
        +
        110 }
        +
        111 }
        +
        112
        +
        113private:
        +
        114
        +
        115 static void negate(byte_t& b)
        +
        116 {
        +
        117 b = ~b;
        +
        118 }
        +
        119};
        +
        120
        +
        121// 11101100 -> 11001110
        +
        122template <typename Buffer, typename IsBitAligned>
        +
        123struct swap_half_bytes
        +
        124{
        +
        125 void operator()(Buffer&) {};
        +
        126};
        +
        127
        +
        128template <typename Buffer>
        +
        129struct swap_half_bytes<Buffer, std::true_type>
        +
        130{
        +
        131 void operator()(Buffer& buffer)
        +
        132 {
        +
        133 for_each(buffer.begin(), buffer.end(),
        +
        134 swap_half_bytes<Buffer, std::true_type>::swap);
        +
        135 }
        +
        136
        +
        137 void operator()(byte_t* dst, std::size_t size)
        +
        138 {
        +
        139 for (std::size_t i = 0; i < size; ++i)
        +
        140 {
        +
        141 swap(*dst);
        +
        142 ++dst;
        +
        143 }
        +
        144 }
        +
        145
        +
        146private:
        +
        147
        +
        148 static void swap(byte_t& c)
        +
        149 {
        +
        150 c = ((c << 4) & 0xF0) | ((c >> 4) & 0x0F);
        +
        151 }
        +
        152};
        +
        153
        +
        154template <typename Buffer>
        +
        155struct do_nothing
        +
        156{
        +
        157 do_nothing() = default;
        +
        158
        +
        159 void operator()(Buffer&) {}
        +
        160};
        +
        161
        +
        163template <typename T>
        +
        164inline unsigned int trailing_zeros(T x) noexcept
        +
        165{
        +
        166 unsigned int n = 0;
        +
        167
        +
        168 x = ~x & (x - 1);
        +
        169 while (x)
        +
        170 {
        +
        171 n = n + 1;
        +
        172 x = x >> 1;
        +
        173 }
        +
        174
        +
        175 return n;
        +
        176}
        +
        177
        +
        179template <typename T>
        +
        180inline
        +
        181unsigned int count_ones(T x) noexcept
        +
        182{
        +
        183 unsigned int n = 0;
        +
        184
        +
        185 while (x)
        +
        186 {
        +
        187 // clear the least significant bit set
        +
        188 x &= x - 1;
        +
        189 ++n;
        +
        190 }
        +
        191
        +
        192 return n;
        +
        193}
        +
        194
        +
        195}}} // namespace boost::gil::detail
        +
        196
        +
        197#endif
        +
        BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
        Applies the visitor op to the variants.
        Definition apply_operation.hpp:20
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/bmp_8hpp_source.html b/html/reference/bmp_8hpp_source.html index 09aae67cf..060894fb0 100644 --- a/html/reference/bmp_8hpp_source.html +++ b/html/reference/bmp_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: bmp.hpp Source File @@ -27,47 +27,52 @@

        - + +/* @license-end */ + +
        -
        -
        bmp.hpp
        +
        bmp.hpp
        -
        1 //
        -
        2 // Copyright 2008 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_IO_BMP_HPP
        -
        9 #define BOOST_GIL_EXTENSION_IO_BMP_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/io/bmp/read.hpp>
        -
        12 #include <boost/gil/extension/io/bmp/write.hpp>
        -
        13 
        -
        14 #endif
        +
        1//
        +
        2// Copyright 2008 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_IO_BMP_HPP
        +
        9#define BOOST_GIL_EXTENSION_IO_BMP_HPP
        +
        10
        +
        11#include <boost/gil/extension/io/bmp/read.hpp>
        +
        12#include <boost/gil/extension/io/bmp/write.hpp>
        +
        13
        +
        14#endif
        diff --git a/html/reference/channel_8hpp_source.html b/html/reference/channel_8hpp_source.html index 1643a7e8e..7b3ab39ec 100644 --- a/html/reference/channel_8hpp_source.html +++ b/html/reference/channel_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel.hpp Source File @@ -27,682 +27,700 @@

        - + +/* @license-end */ + +
        -
        -
        channel.hpp
        +
        channel.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CHANNEL_HPP
        -
        9 #define BOOST_GIL_CHANNEL_HPP
        -
        10 
        -
        11 #include <boost/gil/utilities.hpp>
        -
        12 
        -
        13 #include <boost/assert.hpp>
        -
        14 #include <boost/config.hpp>
        -
        15 #include <boost/config/pragma_message.hpp>
        -
        16 #include <boost/integer/integer_mask.hpp>
        -
        17 
        -
        18 #include <cstdint>
        -
        19 #include <limits>
        -
        20 #include <type_traits>
        -
        21 
        -
        22 #ifdef BOOST_GIL_DOXYGEN_ONLY
        -
        30 #define BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS
        -
        31 #endif
        -
        32 
        -
        33 #ifdef BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS
        -
        34 #if defined(sun) || defined(__sun) || \ // SunOS
        -
        35  defined(__osf__) || defined(__osf) || \ // Tru64
        -
        36  defined(_hpux) || defined(hpux) || \ // HP-UX
        -
        37  defined(__arm__) || defined(__ARM_ARCH) || \ // ARM
        -
        38  defined(_AIX) // AIX
        -
        39 #error Unaligned access strictly disabled for some UNIX platforms or ARM architecture
        -
        40 #elif defined(__i386__) || defined(__x86_64__) || defined(__vax__)
        -
        41  // The check for little-endian architectures that tolerate unaligned memory
        -
        42  // accesses is just an optimization. Nothing will break if it fails to detect
        -
        43  // a suitable architecture.
        -
        44  //
        -
        45  // Unfortunately, this optimization may be a C/C++ strict aliasing rules violation
        -
        46  // if accessed data buffer has effective type that cannot be aliased
        -
        47  // without leading to undefined behaviour.
        -
        48 BOOST_PRAGMA_MESSAGE("CAUTION: Unaligned access tolerated on little-endian may cause undefined behaviour")
        -
        49 #else
        -
        50 #error Unaligned access disabled for unknown platforms and architectures
        -
        51 #endif
        -
        52 #endif // defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
        -
        53 
        -
        54 namespace boost { namespace gil {
        -
        55 
        -
        70 
        -
        71 namespace detail {
        -
        72 
        -
        73 template <typename T, bool IsClass>
        -
        74 struct channel_traits_impl;
        -
        75 
        -
        76 // channel traits for custom class
        -
        77 template <typename T>
        -
        78 struct channel_traits_impl<T, true>
        -
        79 {
        -
        80  using value_type = typename T::value_type;
        -
        81  using reference = typename T::reference;
        -
        82  using pointer = typename T::pointer;
        -
        83  using const_reference = typename T::const_reference;
        -
        84  using const_pointer = typename T::const_pointer;
        -
        85  static constexpr bool is_mutable = T::is_mutable;
        -
        86  static value_type min_value() { return T::min_value(); }
        -
        87  static value_type max_value() { return T::max_value(); }
        -
        88 };
        -
        89 
        -
        90 // channel traits implementation for built-in integral or floating point channel type
        -
        91 template <typename T>
        -
        92 struct channel_traits_impl<T, false>
        -
        93 {
        -
        94  using value_type = T;
        -
        95  using reference = T&;
        -
        96  using pointer = T*;
        -
        97  using const_reference = T const&;
        -
        98  using const_pointer = T const*;
        -
        99  static constexpr bool is_mutable = true;
        -
        100  static value_type min_value() { return (std::numeric_limits<T>::min)(); }
        -
        101  static value_type max_value() { return (std::numeric_limits<T>::max)(); }
        -
        102 };
        -
        103 
        -
        104 // channel traits implementation for constant built-in scalar or floating point type
        -
        105 template <typename T>
        -
        106 struct channel_traits_impl<T const, false> : channel_traits_impl<T, false>
        -
        107 {
        -
        108  using reference = T const&;
        -
        109  using pointer = T const*;
        -
        110  static constexpr bool is_mutable = false;
        -
        111 };
        -
        112 
        -
        113 } // namespace detail
        -
        114 
        -
        133 template <typename T>
        -
        134 struct channel_traits : detail::channel_traits_impl<T, std::is_class<T>::value> {};
        -
        135 
        -
        136 // Channel traits for C++ reference type - remove the reference
        -
        137 template <typename T>
        -
        138 struct channel_traits<T&> : channel_traits<T> {};
        -
        139 
        -
        140 // Channel traits for constant C++ reference type
        -
        141 template <typename T>
        -
        142 struct channel_traits<T const&> : channel_traits<T>
        -
        143 {
        -
        144  using reference = typename channel_traits<T>::const_reference;
        -
        145  using pointer = typename channel_traits<T>::const_pointer;
        -
        146  static constexpr bool is_mutable = false;
        -
        147 };
        -
        148 
        -
        152 
        -
        170 
        -
        176 template <typename BaseChannelValue, typename MinVal, typename MaxVal>
        -
        177 struct scoped_channel_value
        -
        178 {
        -
        179  using value_type = scoped_channel_value<BaseChannelValue, MinVal, MaxVal>;
        -
        180  using reference = value_type&;
        -
        181  using pointer = value_type*;
        -
        182  using const_reference = value_type const&;
        -
        183  using const_pointer = value_type const*;
        -
        184  static constexpr bool is_mutable = channel_traits<BaseChannelValue>::is_mutable;
        -
        185 
        -
        186  using base_channel_t = BaseChannelValue;
        -
        187 
        -
        188  static value_type min_value() { return MinVal::apply(); }
        -
        189  static value_type max_value() { return MaxVal::apply(); }
        -
        190 
        -
        191  scoped_channel_value() = default;
        -
        192  scoped_channel_value(scoped_channel_value const& other) : value_(other.value_) {}
        -
        193  scoped_channel_value& operator=(scoped_channel_value const& other) = default;
        -
        194  scoped_channel_value(BaseChannelValue value) : value_(value) {}
        -
        195  scoped_channel_value& operator=(BaseChannelValue value)
        -
        196  {
        -
        197  value_ = value;
        -
        198  return *this;
        -
        199  }
        -
        200 
        -
        201  auto operator++() -> scoped_channel_value& { ++value_; return *this; }
        -
        202  auto operator--() -> scoped_channel_value& { --value_; return *this; }
        -
        203 
        -
        204  auto operator++(int) -> scoped_channel_value
        -
        205  {
        -
        206  scoped_channel_value tmp=*this;
        -
        207  this->operator++(); return tmp;
        -
        208  }
        -
        209 
        -
        210  auto operator--(int) -> scoped_channel_value
        -
        211  {
        -
        212  scoped_channel_value tmp=*this;
        -
        213  this->operator--(); return tmp;
        -
        214  }
        -
        215 
        -
        216  template <typename Scalar2>
        -
        217  auto operator+=(Scalar2 v) -> scoped_channel_value& { value_+=v; return *this; }
        -
        218 
        -
        219  template <typename Scalar2>
        -
        220  auto operator-=(Scalar2 v) -> scoped_channel_value& { value_-=v; return *this; }
        -
        221 
        -
        222  template <typename Scalar2>
        -
        223  auto operator*=(Scalar2 v) -> scoped_channel_value& { value_*=v; return *this; }
        -
        224 
        -
        225  template <typename Scalar2>
        -
        226  auto operator/=(Scalar2 v) -> scoped_channel_value& { value_/=v; return *this; }
        -
        227 
        -
        228  operator BaseChannelValue() const { return value_; }
        -
        229 private:
        -
        230  BaseChannelValue value_{};
        -
        231 };
        -
        232 
        -
        233 template <typename T>
        -
        234 struct float_point_zero
        -
        235 {
        -
        236  static constexpr T apply() { return 0.0f; }
        -
        237 };
        -
        238 
        -
        239 template <typename T>
        -
        240 struct float_point_one
        -
        241 {
        -
        242  static constexpr T apply() { return 1.0f; }
        -
        243 };
        -
        244 
        -
        248 
        -
        249 // It is necessary for packed channels to have their own value type. They cannot simply use an integral large enough to store the data. Here is why:
        -
        250 // - Any operation that requires returning the result by value will otherwise return the built-in integral type, which will have incorrect range
        -
        251 // That means that after getting the value of the channel we cannot properly do channel_convert, channel_invert, etc.
        -
        252 // - Two channels are declared compatible if they have the same value type. That means that a packed channel is incorrectly declared compatible with an integral type
        -
        253 namespace detail {
        -
        254 
        -
        255 // returns the smallest fast unsigned integral type that has at least NumBits bits
        -
        256 template <int NumBits>
        -
        257 struct min_fast_uint :
        -
        258  std::conditional
        -
        259  <
        -
        260  NumBits <= 8,
        -
        261  std::uint_least8_t,
        -
        262  typename std::conditional
        -
        263  <
        -
        264  NumBits <= 16,
        -
        265  std::uint_least16_t,
        -
        266  typename std::conditional
        -
        267  <
        -
        268  NumBits <= 32,
        -
        269  std::uint_least32_t,
        -
        270  std::uintmax_t
        -
        271  >::type
        -
        272  >::type
        -
        273  >
        -
        274 {};
        -
        275 
        -
        276 template <int NumBits>
        -
        277 struct num_value_fn
        -
        278  : std::conditional<NumBits < 32, std::uint32_t, std::uint64_t>
        -
        279 {};
        -
        280 
        -
        281 template <int NumBits>
        -
        282 struct max_value_fn
        -
        283  : std::conditional<NumBits <= 32, std::uint32_t, std::uint64_t>
        -
        284 {};
        -
        285 
        -
        286 } // namespace detail
        -
        287 
        -
        301 
        -
        304 template <int NumBits>
        -
        305 class packed_channel_value
        -
        306 {
        -
        307 public:
        -
        308  using integer_t = typename detail::min_fast_uint<NumBits>::type;
        -
        309 
        -
        310  using value_type = packed_channel_value<NumBits>;
        -
        311  using reference = value_type&;
        -
        312  using const_reference = value_type const&;
        -
        313  using pointer = value_type*;
        -
        314  using const_pointer = value_type const*;
        -
        315  static constexpr bool is_mutable = true;
        -
        316 
        -
        317  static value_type min_value() { return 0; }
        -
        318  static value_type max_value() { return low_bits_mask_t< NumBits >::sig_bits; }
        -
        319 
        -
        320  packed_channel_value() = default;
        -
        321  packed_channel_value(integer_t v)
        -
        322  {
        -
        323  value_ = static_cast<integer_t>(v & low_bits_mask_t<NumBits>::sig_bits_fast);
        -
        324  }
        -
        325 
        -
        326  template <typename Scalar>
        -
        327  packed_channel_value(Scalar v)
        -
        328  {
        -
        329  value_ = packed_channel_value(static_cast<integer_t>(v));
        -
        330  }
        -
        331 
        -
        332  static auto num_bits() -> unsigned int { return NumBits; }
        -
        333 
        -
        334  operator integer_t() const { return value_; }
        -
        335 
        -
        336 private:
        -
        337  integer_t value_{};
        -
        338 };
        -
        339 
        -
        340 namespace detail {
        -
        341 
        -
        342 template <std::size_t K>
        -
        343 struct static_copy_bytes
        -
        344 {
        -
        345  void operator()(unsigned char const* from, unsigned char* to) const
        -
        346  {
        -
        347  *to = *from;
        -
        348  static_copy_bytes<K - 1>()(++from, ++to);
        -
        349  }
        -
        350 };
        -
        351 
        -
        352 template <>
        -
        353 struct static_copy_bytes<0>
        -
        354 {
        -
        355  void operator()(unsigned char const*, unsigned char*) const {}
        -
        356 };
        -
        357 
        -
        358 template <typename Derived, typename BitField, int NumBits, bool IsMutable>
        -
        359 class packed_channel_reference_base
        -
        360 {
        -
        361 protected:
        -
        362  using data_ptr_t = typename std::conditional<IsMutable, void*, void const*>::type;
        -
        363 public:
        -
        364  data_ptr_t _data_ptr; // void* pointer to the first byte of the bit range
        -
        365 
        -
        366  using value_type = packed_channel_value<NumBits>;
        -
        367  using reference = Derived const;
        -
        368  using pointer = value_type*;
        -
        369  using const_pointer = value_type const*;
        -
        370  static constexpr int num_bits = NumBits;
        -
        371  static constexpr bool is_mutable = IsMutable;
        -
        372 
        -
        373  static auto min_value() -> value_type { return channel_traits<value_type>::min_value(); }
        -
        374  static auto max_value() -> value_type { return channel_traits<value_type>::max_value(); }
        -
        375 
        -
        376  using bitfield_t = BitField;
        -
        377  using integer_t = typename value_type::integer_t;
        -
        378 
        -
        379  packed_channel_reference_base(data_ptr_t data_ptr) : _data_ptr(data_ptr) {}
        -
        380  packed_channel_reference_base(packed_channel_reference_base const& ref) : _data_ptr(ref._data_ptr) {}
        -
        381 
        -
        382  auto operator=(integer_t v) const -> Derived const& { set(v); return derived(); }
        -
        383 
        -
        384  auto operator++() const -> Derived const& { set(get()+1); return derived(); }
        -
        385  auto operator--() const -> Derived const& { set(get()-1); return derived(); }
        -
        386 
        -
        387  auto operator++(int) const -> Derived
        -
        388  {
        -
        389  Derived tmp=derived();
        -
        390  this->operator++(); return tmp;
        -
        391  }
        -
        392 
        -
        393  auto operator--(int) const -> Derived
        -
        394  {
        -
        395  Derived tmp=derived();
        -
        396  this->operator--();
        -
        397  return tmp;
        -
        398  }
        -
        399 
        -
        400  template <typename Scalar2>
        -
        401  auto operator+=(Scalar2 v) const -> Derived const&
        -
        402  {
        -
        403  set( static_cast<integer_t>( get() + v ));
        -
        404  return derived();
        -
        405  }
        -
        406 
        -
        407  template <typename Scalar2>
        -
        408  auto operator-=(Scalar2 v) const -> Derived const&
        -
        409  {
        -
        410  set( static_cast<integer_t>( get() - v )); return derived();
        -
        411  }
        -
        412 
        -
        413  template <typename Scalar2>
        -
        414  auto operator*=(Scalar2 v) const -> Derived const&
        -
        415  {
        -
        416  set( static_cast<integer_t>( get() * v ));
        -
        417  return derived();
        -
        418  }
        -
        419 
        -
        420  template <typename Scalar2>
        -
        421  auto operator/=(Scalar2 v) const -> Derived const&
        -
        422  {
        -
        423  set( static_cast<integer_t>( get() / v ));
        -
        424  return derived();
        -
        425  }
        -
        426 
        -
        427  operator integer_t() const { return get(); }
        -
        428  auto operator&() const -> data_ptr_t {return _data_ptr;}
        -
        429 
        -
        430 protected:
        -
        431 
        -
        432  using num_value_t = typename detail::num_value_fn<NumBits>::type;
        -
        433  using max_value_t = typename detail::max_value_fn<NumBits>::type;
        -
        434 
        -
        435  static const num_value_t num_values = static_cast< num_value_t >( 1 ) << NumBits ;
        -
        436  static const max_value_t max_val = static_cast< max_value_t >( num_values - 1 );
        -
        437 
        -
        438 #if defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
        -
        439  const bitfield_t& get_data() const { return *static_cast<const bitfield_t*>(_data_ptr); }
        -
        440  void set_data(const bitfield_t& val) const { *static_cast< bitfield_t*>(_data_ptr) = val; }
        -
        441 #else
        -
        442  auto get_data() const -> bitfield_t
        -
        443  {
        -
        444  bitfield_t ret;
        -
        445  static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(_data_ptr),gil_reinterpret_cast<unsigned char*>(&ret));
        -
        446  return ret;
        -
        447  }
        -
        448 
        -
        449  void set_data(bitfield_t const& val) const
        -
        450  {
        -
        451  static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(&val),gil_reinterpret_cast<unsigned char*>(_data_ptr));
        -
        452  }
        -
        453 #endif
        -
        454 
        -
        455 private:
        -
        456  void set(integer_t value) const { // can this be done faster??
        -
        457  this->derived().set_unsafe(((value % num_values) + num_values) % num_values);
        -
        458  }
        -
        459  auto get() const -> integer_t { return derived().get(); }
        -
        460  auto derived() const -> Derived const& { return static_cast<const Derived&>(*this); }
        -
        461 };
        -
        462 } // namespace detail
        -
        463 
        -
        477 
        -
        481 template <typename BitField, int FirstBit, int NumBits, bool IsMutable>
        -
        482 class packed_channel_reference;
        -
        483 
        -
        487 template <typename BitField, int NumBits, bool IsMutable>
        -
        488 class packed_dynamic_channel_reference;
        -
        489 
        -
        492 template <typename BitField, int FirstBit, int NumBits>
        -
        493 class packed_channel_reference<BitField, FirstBit, NumBits, false>
        -
        494  : public detail::packed_channel_reference_base
        -
        495  <
        -
        496  packed_channel_reference<BitField, FirstBit, NumBits, false>,
        -
        497  BitField,
        -
        498  NumBits,
        -
        499  false
        -
        500  >
        -
        501 {
        -
        502  using parent_t = detail::packed_channel_reference_base
        -
        503  <
        -
        504  packed_channel_reference<BitField, FirstBit, NumBits, false>,
        -
        505  BitField,
        -
        506  NumBits,
        -
        507  false
        -
        508  >;
        -
        509 
        -
        510  friend class packed_channel_reference<BitField, FirstBit, NumBits, true>;
        -
        511 
        -
        512  static const BitField channel_mask = static_cast<BitField>(parent_t::max_val) << FirstBit;
        -
        513 
        -
        514  void operator=(packed_channel_reference const&);
        -
        515 public:
        -
        516  using const_reference = packed_channel_reference<BitField,FirstBit,NumBits,false> const;
        -
        517  using mutable_reference = packed_channel_reference<BitField,FirstBit,NumBits,true> const;
        -
        518  using integer_t = typename parent_t::integer_t;
        -
        519 
        -
        520  explicit packed_channel_reference(const void* data_ptr) : parent_t(data_ptr) {}
        -
        521  packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
        -
        522  packed_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr) {}
        -
        523 
        -
        524  auto first_bit() const -> unsigned int { return FirstBit; }
        -
        525 
        -
        526  auto get() const -> integer_t { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
        -
        527 };
        -
        528 
        -
        531 template <typename BitField, int FirstBit, int NumBits>
        -
        532 class packed_channel_reference<BitField,FirstBit,NumBits,true>
        -
        533  : public detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true>
        -
        534 {
        -
        535  using parent_t = detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true>;
        -
        536  friend class packed_channel_reference<BitField,FirstBit,NumBits,false>;
        -
        537 
        -
        538  static const BitField channel_mask = static_cast< BitField >( parent_t::max_val ) << FirstBit;
        -
        539 
        -
        540 public:
        -
        541  using const_reference = packed_channel_reference<BitField,FirstBit,NumBits,false> const;
        -
        542  using mutable_reference = packed_channel_reference<BitField,FirstBit,NumBits,true> const;
        -
        543  using integer_t = typename parent_t::integer_t;
        -
        544 
        -
        545  explicit packed_channel_reference(void* data_ptr) : parent_t(data_ptr) {}
        -
        546  packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
        -
        547 
        -
        548  packed_channel_reference const& operator=(integer_t value) const
        -
        549  {
        -
        550  BOOST_ASSERT(value <= parent_t::max_val);
        -
        551  set_unsafe(value);
        -
        552  return *this;
        -
        553  }
        -
        554 
        -
        555  auto operator=(mutable_reference const& ref) const -> packed_channel_reference const& { set_from_reference(ref.get_data()); return *this; }
        -
        556  auto operator=(const_reference const& ref) const -> packed_channel_reference const& { set_from_reference(ref.get_data()); return *this; }
        -
        557 
        -
        558  template <bool Mutable1>
        -
        559  auto operator=(packed_dynamic_channel_reference<BitField,NumBits,Mutable1> const& ref) const -> packed_channel_reference const& { set_unsafe(ref.get()); return *this; }
        -
        560 
        -
        561  auto first_bit() const -> unsigned int { return FirstBit; }
        -
        562 
        -
        563  auto get() const -> integer_t { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
        -
        564  void set_unsafe(integer_t value) const { this->set_data((this->get_data() & ~channel_mask) | (( static_cast< BitField >( value )<<FirstBit))); }
        -
        565 
        -
        566 private:
        -
        567  void set_from_reference(const BitField& other_bits) const { this->set_data((this->get_data() & ~channel_mask) | (other_bits & channel_mask)); }
        -
        568 };
        -
        569 
        -
        570 }} // namespace boost::gil
        -
        571 
        -
        572 namespace std {
        -
        573 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
        -
        574 // swap with 'left bias':
        -
        575 // - swap between proxy and anything
        -
        576 // - swap between value type and proxy
        -
        577 // - swap between proxy and proxy
        -
        578 
        -
        581 template <typename BF, int FB, int NB, bool M, typename R>
        -
        582 inline
        -
        583 void swap(boost::gil::packed_channel_reference<BF, FB, NB, M> const x, R& y)
        -
        584 {
        -
        585  boost::gil::swap_proxy
        -
        586  <
        -
        587  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
        -
        588  >(x, y);
        -
        589 }
        -
        590 
        -
        591 
        -
        594 template <typename BF, int FB, int NB, bool M>
        -
        595 inline
        -
        596 void swap(
        -
        597  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type& x,
        -
        598  boost::gil::packed_channel_reference<BF, FB, NB, M> const y)
        -
        599 {
        -
        600  boost::gil::swap_proxy
        -
        601  <
        -
        602  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
        -
        603  >(x,y);
        -
        604 }
        -
        605 
        -
        608 template <typename BF, int FB, int NB, bool M> inline
        -
        609 void swap(
        -
        610  boost::gil::packed_channel_reference<BF, FB, NB, M> const x,
        -
        611  boost::gil::packed_channel_reference<BF, FB, NB, M> const y)
        -
        612 {
        -
        613  boost::gil::swap_proxy
        -
        614  <
        -
        615  typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
        -
        616  >(x,y);
        -
        617 }
        -
        618 
        -
        619 } // namespace std
        -
        620 
        -
        621 namespace boost { namespace gil {
        -
        622 
        -
        637 
        -
        641 template <typename BitField, int NumBits>
        -
        642 class packed_dynamic_channel_reference<BitField,NumBits,false>
        -
        643  : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false>
        -
        644 {
        -
        645  using parent_t = detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false>;
        -
        646  friend class packed_dynamic_channel_reference<BitField,NumBits,true>;
        -
        647 
        -
        648  unsigned _first_bit; // 0..7
        -
        649 
        -
        650  void operator=(const packed_dynamic_channel_reference&);
        -
        651 public:
        -
        652  using const_reference = packed_dynamic_channel_reference<BitField,NumBits,false> const;
        -
        653  using mutable_reference = packed_dynamic_channel_reference<BitField,NumBits,true> const;
        -
        654  using integer_t = typename parent_t::integer_t;
        -
        655 
        -
        656  packed_dynamic_channel_reference(void const* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
        -
        657  packed_dynamic_channel_reference(const_reference const& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
        -
        658  packed_dynamic_channel_reference(mutable_reference const& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
        -
        659 
        -
        660  auto first_bit() const -> unsigned int { return _first_bit; }
        -
        661 
        -
        662  auto get() const -> integer_t
        -
        663  {
        -
        664  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) <<_first_bit;
        -
        665  return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
        -
        666  }
        -
        667 };
        -
        668 
        -
        672 template <typename BitField, int NumBits>
        -
        673 class packed_dynamic_channel_reference<BitField,NumBits,true>
        -
        674  : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true>
        -
        675 {
        -
        676  using parent_t = detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true>;
        -
        677  friend class packed_dynamic_channel_reference<BitField,NumBits,false>;
        -
        678 
        -
        679  unsigned _first_bit;
        -
        680 
        -
        681 public:
        -
        682  using const_reference = packed_dynamic_channel_reference<BitField,NumBits,false> const;
        -
        683  using mutable_reference = packed_dynamic_channel_reference<BitField,NumBits,true> const;
        -
        684  using integer_t = typename parent_t::integer_t;
        -
        685 
        -
        686  packed_dynamic_channel_reference(void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
        -
        687  packed_dynamic_channel_reference(packed_dynamic_channel_reference const& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
        -
        688 
        -
        689  auto operator=(integer_t value) const -> packed_dynamic_channel_reference const&
        -
        690  {
        -
        691  BOOST_ASSERT(value <= parent_t::max_val);
        -
        692  set_unsafe(value);
        -
        693  return *this;
        -
        694  }
        -
        695 
        -
        696  auto operator=(mutable_reference const& ref) const -> packed_dynamic_channel_reference const& { set_unsafe(ref.get()); return *this; }
        -
        697  auto operator=(const_reference const& ref) const -> packed_dynamic_channel_reference const& { set_unsafe(ref.get()); return *this; }
        -
        698 
        -
        699  template <typename BitField1, int FirstBit1, bool Mutable1>
        -
        700  auto operator=(packed_channel_reference<BitField1, FirstBit1, NumBits, Mutable1> const& ref) const -> packed_dynamic_channel_reference const&
        -
        701  {
        -
        702  set_unsafe(ref.get());
        -
        703  return *this;
        -
        704  }
        -
        705 
        -
        706  auto first_bit() const -> unsigned int { return _first_bit; }
        -
        707 
        -
        708  auto get() const -> integer_t
        -
        709  {
        -
        710  BitField const channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
        -
        711  return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
        -
        712  }
        -
        713 
        -
        714  void set_unsafe(integer_t value) const {
        -
        715  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
        -
        716  this->set_data((this->get_data() & ~channel_mask) | value<<_first_bit);
        -
        717  }
        -
        718 };
        -
        719 } } // namespace boost::gil
        -
        720 
        -
        721 namespace std {
        -
        722 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
        -
        723 // swap with 'left bias':
        -
        724 // - swap between proxy and anything
        -
        725 // - swap between value type and proxy
        -
        726 // - swap between proxy and proxy
        -
        727 
        -
        728 
        -
        731 template <typename BF, int NB, bool M, typename R> inline
        -
        732 void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, R& y) {
        -
        733  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
        -
        734 }
        -
        735 
        -
        736 
        -
        739 template <typename BF, int NB, bool M> inline
        -
        740 void swap(typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type& x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
        -
        741  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
        -
        742 }
        -
        743 
        -
        746 template <typename BF, int NB, bool M> inline
        -
        747 void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
        -
        748  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
        -
        749 }
        -
        750 } // namespace std
        -
        751 
        -
        752 // \brief Determines the fundamental type which may be used, e.g., to cast from larger to smaller channel types.
        -
        753 namespace boost { namespace gil {
        -
        754 template <typename T>
        -
        755 struct base_channel_type_impl { using type = T; };
        -
        756 
        -
        757 template <int N>
        -
        758 struct base_channel_type_impl<packed_channel_value<N> >
        -
        759 { using type = typename packed_channel_value<N>::integer_t; };
        -
        760 
        -
        761 template <typename B, int F, int N, bool M>
        -
        762 struct base_channel_type_impl<packed_channel_reference<B, F, N, M> >
        -
        763 {
        -
        764  using type = typename packed_channel_reference<B,F,N,M>::integer_t;
        -
        765 };
        -
        766 
        -
        767 template <typename B, int N, bool M>
        -
        768 struct base_channel_type_impl<packed_dynamic_channel_reference<B, N, M> >
        -
        769 {
        -
        770  using type = typename packed_dynamic_channel_reference<B,N,M>::integer_t;
        -
        771 };
        -
        772 
        -
        773 template <typename ChannelValue, typename MinV, typename MaxV>
        -
        774 struct base_channel_type_impl<scoped_channel_value<ChannelValue, MinV, MaxV> >
        -
        775 { using type = ChannelValue; };
        -
        776 
        -
        777 template <typename T>
        -
        778 struct base_channel_type : base_channel_type_impl<typename std::remove_cv<T>::type> {};
        -
        779 
        -
        780 }} //namespace boost::gil
        -
        781 
        -
        782 #endif
        -
        Models a constant subbyte channel reference whose bit offset is a runtime parameter....
        Definition: channel.hpp:644
        -
        Models a mutable subbyte channel reference whose bit offset is a runtime parameter....
        Definition: channel.hpp:675
        -
        void swap(const boost::gil::packed_dynamic_channel_reference< BF, NB, M > x, const boost::gil::packed_dynamic_channel_reference< BF, NB, M > y)
        swap for packed_dynamic_channel_reference
        Definition: channel.hpp:747
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CHANNEL_HPP
        +
        9#define BOOST_GIL_CHANNEL_HPP
        +
        10
        +
        11#include <boost/gil/utilities.hpp>
        +
        12
        +
        13#include <boost/assert.hpp>
        +
        14#include <boost/config.hpp>
        +
        15#include <boost/config/pragma_message.hpp>
        +
        16#include <boost/integer/integer_mask.hpp>
        +
        17
        +
        18#include <cstdint>
        +
        19#include <limits>
        +
        20#include <type_traits>
        +
        21
        +
        22#ifdef BOOST_GIL_DOXYGEN_ONLY
        +
        30#define BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS
        +
        31#endif
        +
        32
        +
        33#ifdef BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS
        +
        34#if defined(sun) || defined(__sun) || \ // SunOS
        +
        35 defined(__osf__) || defined(__osf) || \ // Tru64
        +
        36 defined(_hpux) || defined(hpux) || \ // HP-UX
        +
        37 defined(__arm__) || defined(__ARM_ARCH) || \ // ARM
        +
        38 defined(_AIX) // AIX
        +
        39#error Unaligned access strictly disabled for some UNIX platforms or ARM architecture
        +
        40#elif defined(__i386__) || defined(__x86_64__) || defined(__vax__)
        +
        41 // The check for little-endian architectures that tolerate unaligned memory
        +
        42 // accesses is just an optimization. Nothing will break if it fails to detect
        +
        43 // a suitable architecture.
        +
        44 //
        +
        45 // Unfortunately, this optimization may be a C/C++ strict aliasing rules violation
        +
        46 // if accessed data buffer has effective type that cannot be aliased
        +
        47 // without leading to undefined behaviour.
        +
        48BOOST_PRAGMA_MESSAGE("CAUTION: Unaligned access tolerated on little-endian may cause undefined behaviour")
        +
        49#else
        +
        50#error Unaligned access disabled for unknown platforms and architectures
        +
        51#endif
        +
        52#endif // defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
        +
        53
        +
        54namespace boost { namespace gil {
        +
        55
        +
        70
        +
        71namespace detail {
        +
        72
        +
        73template <typename T, bool IsClass>
        +
        74struct channel_traits_impl;
        +
        75
        +
        76// channel traits for custom class
        +
        77template <typename T>
        +
        78struct channel_traits_impl<T, true>
        +
        79{
        +
        80 using value_type = typename T::value_type;
        +
        81 using reference = typename T::reference;
        +
        82 using pointer = typename T::pointer;
        +
        83 using const_reference = typename T::const_reference;
        +
        84 using const_pointer = typename T::const_pointer;
        +
        85 static constexpr bool is_mutable = T::is_mutable;
        +
        86 static value_type min_value() { return T::min_value(); }
        +
        87 static value_type max_value() { return T::max_value(); }
        +
        88};
        +
        89
        +
        90// channel traits implementation for built-in integral or floating point channel type
        +
        91template <typename T>
        +
        92struct channel_traits_impl<T, false>
        +
        93{
        +
        94 using value_type = T;
        +
        95 using reference = T&;
        +
        96 using pointer = T*;
        +
        97 using const_reference = T const&;
        +
        98 using const_pointer = T const*;
        +
        99 static constexpr bool is_mutable = true;
        +
        100 static value_type min_value() { return (std::numeric_limits<T>::min)(); }
        +
        101 static value_type max_value() { return (std::numeric_limits<T>::max)(); }
        +
        102};
        +
        103
        +
        104// channel traits implementation for constant built-in scalar or floating point type
        +
        105template <typename T>
        +
        106struct channel_traits_impl<T const, false> : channel_traits_impl<T, false>
        +
        107{
        +
        108 using reference = T const&;
        +
        109 using pointer = T const*;
        +
        110 static constexpr bool is_mutable = false;
        +
        111};
        +
        112
        +
        113} // namespace detail
        +
        114
        +
        133template <typename T>
        +
        134struct channel_traits : detail::channel_traits_impl<T, std::is_class<T>::value> {};
        +
        135
        +
        136// Channel traits for C++ reference type - remove the reference
        +
        137template <typename T>
        +
        138struct channel_traits<T&> : channel_traits<T> {};
        +
        139
        +
        140// Channel traits for constant C++ reference type
        +
        141template <typename T>
        +
        142struct channel_traits<T const&> : channel_traits<T>
        +
        143{
        +
        144 using reference = typename channel_traits<T>::const_reference;
        +
        145 using pointer = typename channel_traits<T>::const_pointer;
        +
        146 static constexpr bool is_mutable = false;
        +
        147};
        +
        148
        +
        152
        +
        170
        +
        176template <typename BaseChannelValue, typename MinVal, typename MaxVal>
        +
        177struct scoped_channel_value
        +
        178{
        +
        179 using value_type = scoped_channel_value<BaseChannelValue, MinVal, MaxVal>;
        +
        180 using reference = value_type&;
        +
        181 using pointer = value_type*;
        +
        182 using const_reference = value_type const&;
        +
        183 using const_pointer = value_type const*;
        +
        184 static constexpr bool is_mutable = channel_traits<BaseChannelValue>::is_mutable;
        +
        185
        +
        186 using base_channel_t = BaseChannelValue;
        +
        187
        +
        188 static value_type min_value() { return MinVal::apply(); }
        +
        189 static value_type max_value() { return MaxVal::apply(); }
        +
        190
        +
        191 scoped_channel_value() = default;
        +
        192 scoped_channel_value(scoped_channel_value const& other) : value_(other.value_) {}
        +
        193 scoped_channel_value& operator=(scoped_channel_value const& other) = default;
        +
        194 scoped_channel_value(BaseChannelValue value) : value_(value) {}
        +
        195 scoped_channel_value& operator=(BaseChannelValue value)
        +
        196 {
        +
        197 value_ = value;
        +
        198 return *this;
        +
        199 }
        +
        200
        +
        201 auto operator++() -> scoped_channel_value& { ++value_; return *this; }
        +
        202 auto operator--() -> scoped_channel_value& { --value_; return *this; }
        +
        203
        +
        204 auto operator++(int) -> scoped_channel_value
        +
        205 {
        +
        206 scoped_channel_value tmp=*this;
        +
        207 this->operator++(); return tmp;
        +
        208 }
        +
        209
        +
        210 auto operator--(int) -> scoped_channel_value
        +
        211 {
        +
        212 scoped_channel_value tmp=*this;
        +
        213 this->operator--(); return tmp;
        +
        214 }
        +
        215
        +
        216 template <typename Scalar2>
        +
        217 auto operator+=(Scalar2 v) -> scoped_channel_value& { value_+=v; return *this; }
        +
        218
        +
        219 template <typename Scalar2>
        +
        220 auto operator-=(Scalar2 v) -> scoped_channel_value& { value_-=v; return *this; }
        +
        221
        +
        222 template <typename Scalar2>
        +
        223 auto operator*=(Scalar2 v) -> scoped_channel_value& { value_*=v; return *this; }
        +
        224
        +
        225 template <typename Scalar2>
        +
        226 auto operator/=(Scalar2 v) -> scoped_channel_value& { value_/=v; return *this; }
        +
        227
        +
        228 operator BaseChannelValue() const { return value_; }
        +
        229private:
        +
        230 BaseChannelValue value_{};
        +
        231};
        +
        232
        +
        233template <typename T>
        +
        234struct float_point_zero
        +
        235{
        +
        236 static constexpr T apply() { return 0.0f; }
        +
        237};
        +
        238
        +
        239template <typename T>
        +
        240struct float_point_one
        +
        241{
        +
        242 static constexpr T apply() { return 1.0f; }
        +
        243};
        +
        244
        +
        248
        +
        249// It is necessary for packed channels to have their own value type. They cannot simply use an integral large enough to store the data. Here is why:
        +
        250// - Any operation that requires returning the result by value will otherwise return the built-in integral type, which will have incorrect range
        +
        251// That means that after getting the value of the channel we cannot properly do channel_convert, channel_invert, etc.
        +
        252// - Two channels are declared compatible if they have the same value type. That means that a packed channel is incorrectly declared compatible with an integral type
        +
        253namespace detail {
        +
        254
        +
        255// returns the smallest fast unsigned integral type that has at least NumBits bits
        +
        256template <int NumBits>
        +
        257struct min_fast_uint :
        +
        258 std::conditional
        +
        259 <
        +
        260 NumBits <= 8,
        +
        261 std::uint_least8_t,
        +
        262 typename std::conditional
        +
        263 <
        +
        264 NumBits <= 16,
        +
        265 std::uint_least16_t,
        +
        266 typename std::conditional
        +
        267 <
        +
        268 NumBits <= 32,
        +
        269 std::uint_least32_t,
        +
        270 std::uintmax_t
        +
        271 >::type
        +
        272 >::type
        +
        273 >
        +
        274{};
        +
        275
        +
        276template <int NumBits>
        +
        277struct num_value_fn
        +
        278 : std::conditional<NumBits < 32, std::uint32_t, std::uint64_t>
        +
        279{};
        +
        280
        +
        281template <int NumBits>
        +
        282struct max_value_fn
        +
        283 : std::conditional<NumBits <= 32, std::uint32_t, std::uint64_t>
        +
        284{};
        +
        285
        +
        286} // namespace detail
        +
        287
        +
        301
        +
        304template <int NumBits>
        +
        305class packed_channel_value
        +
        306{
        +
        307public:
        +
        308 using integer_t = typename detail::min_fast_uint<NumBits>::type;
        +
        309
        +
        310 using value_type = packed_channel_value<NumBits>;
        +
        311 using reference = value_type&;
        +
        312 using const_reference = value_type const&;
        +
        313 using pointer = value_type*;
        +
        314 using const_pointer = value_type const*;
        +
        315 static constexpr bool is_mutable = true;
        +
        316
        +
        317 static value_type min_value() { return 0; }
        +
        318 static value_type max_value() { return low_bits_mask_t< NumBits >::sig_bits; }
        +
        319
        +
        320 packed_channel_value() = default;
        +
        321 packed_channel_value(integer_t v)
        +
        322 {
        +
        323 value_ = static_cast<integer_t>(v & low_bits_mask_t<NumBits>::sig_bits_fast);
        +
        324 }
        +
        325
        +
        326 template <typename Scalar>
        +
        327 packed_channel_value(Scalar v)
        +
        328 {
        +
        329 value_ = packed_channel_value(static_cast<integer_t>(v));
        +
        330 }
        +
        331
        +
        332 static auto num_bits() -> unsigned int { return NumBits; }
        +
        333
        +
        334 operator integer_t() const { return value_; }
        +
        335
        +
        336private:
        +
        337 integer_t value_{};
        +
        338};
        +
        339
        +
        340namespace detail {
        +
        341
        +
        342template <std::size_t K>
        +
        343struct static_copy_bytes
        +
        344{
        +
        345 void operator()(unsigned char const* from, unsigned char* to) const
        +
        346 {
        +
        347 *to = *from;
        +
        348 static_copy_bytes<K - 1>()(++from, ++to);
        +
        349 }
        +
        350};
        +
        351
        +
        352template <>
        +
        353struct static_copy_bytes<0>
        +
        354{
        +
        355 void operator()(unsigned char const*, unsigned char*) const {}
        +
        356};
        +
        357
        +
        358template <typename Derived, typename BitField, int NumBits, bool IsMutable>
        +
        359class packed_channel_reference_base
        +
        360{
        +
        361protected:
        +
        362 using data_ptr_t = typename std::conditional<IsMutable, void*, void const*>::type;
        +
        363public:
        +
        364 data_ptr_t _data_ptr; // void* pointer to the first byte of the bit range
        +
        365
        +
        366 using value_type = packed_channel_value<NumBits>;
        +
        367 using reference = Derived const;
        +
        368 using pointer = value_type*;
        +
        369 using const_pointer = value_type const*;
        +
        370 static constexpr int num_bits = NumBits;
        +
        371 static constexpr bool is_mutable = IsMutable;
        +
        372
        +
        373 static auto min_value() -> value_type { return channel_traits<value_type>::min_value(); }
        +
        374 static auto max_value() -> value_type { return channel_traits<value_type>::max_value(); }
        +
        375
        +
        376 using bitfield_t = BitField;
        +
        377 using integer_t = typename value_type::integer_t;
        +
        378
        +
        379 packed_channel_reference_base(data_ptr_t data_ptr) : _data_ptr(data_ptr) {}
        +
        380 packed_channel_reference_base(packed_channel_reference_base const& ref) : _data_ptr(ref._data_ptr) {}
        +
        381
        +
        382 auto operator=(integer_t v) const -> Derived const& { set(v); return derived(); }
        +
        383
        +
        384 auto operator++() const -> Derived const& { set(get()+1); return derived(); }
        +
        385 auto operator--() const -> Derived const& { set(get()-1); return derived(); }
        +
        386
        +
        387 auto operator++(int) const -> Derived
        +
        388 {
        +
        389 Derived tmp=derived();
        +
        390 this->operator++(); return tmp;
        +
        391 }
        +
        392
        +
        393 auto operator--(int) const -> Derived
        +
        394 {
        +
        395 Derived tmp=derived();
        +
        396 this->operator--();
        +
        397 return tmp;
        +
        398 }
        +
        399
        +
        400 template <typename Scalar2>
        +
        401 auto operator+=(Scalar2 v) const -> Derived const&
        +
        402 {
        +
        403 set( static_cast<integer_t>( get() + v ));
        +
        404 return derived();
        +
        405 }
        +
        406
        +
        407 template <typename Scalar2>
        +
        408 auto operator-=(Scalar2 v) const -> Derived const&
        +
        409 {
        +
        410 set( static_cast<integer_t>( get() - v )); return derived();
        +
        411 }
        +
        412
        +
        413 template <typename Scalar2>
        +
        414 auto operator*=(Scalar2 v) const -> Derived const&
        +
        415 {
        +
        416 set( static_cast<integer_t>( get() * v ));
        +
        417 return derived();
        +
        418 }
        +
        419
        +
        420 template <typename Scalar2>
        +
        421 auto operator/=(Scalar2 v) const -> Derived const&
        +
        422 {
        +
        423 set( static_cast<integer_t>( get() / v ));
        +
        424 return derived();
        +
        425 }
        +
        426
        +
        427 operator integer_t() const { return get(); }
        +
        428 auto operator&() const -> data_ptr_t {return _data_ptr;}
        +
        429
        +
        430protected:
        +
        431
        +
        432 using num_value_t = typename detail::num_value_fn<NumBits>::type;
        +
        433 using max_value_t = typename detail::max_value_fn<NumBits>::type;
        +
        434
        +
        435 static const num_value_t num_values = static_cast< num_value_t >( 1 ) << NumBits ;
        +
        436 static const max_value_t max_val = static_cast< max_value_t >( num_values - 1 );
        +
        437
        +
        438#if defined(BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS)
        +
        439 const bitfield_t& get_data() const { return *static_cast<const bitfield_t*>(_data_ptr); }
        +
        440 void set_data(const bitfield_t& val) const { *static_cast< bitfield_t*>(_data_ptr) = val; }
        +
        441#else
        +
        442 auto get_data() const -> bitfield_t
        +
        443 {
        +
        444 bitfield_t ret;
        +
        445 static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(_data_ptr),gil_reinterpret_cast<unsigned char*>(&ret));
        +
        446 return ret;
        +
        447 }
        +
        448
        +
        449 void set_data(bitfield_t const& val) const
        +
        450 {
        +
        451 static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(&val),gil_reinterpret_cast<unsigned char*>(_data_ptr));
        +
        452 }
        +
        453#endif
        +
        454
        +
        455private:
        +
        456 void set(integer_t value) const { // can this be done faster??
        +
        457 this->derived().set_unsafe(((value % num_values) + num_values) % num_values);
        +
        458 }
        +
        459 auto get() const -> integer_t { return derived().get(); }
        +
        460 auto derived() const -> Derived const& { return static_cast<const Derived&>(*this); }
        +
        461};
        +
        462} // namespace detail
        +
        463
        +
        477
        +
        481template <typename BitField, int FirstBit, int NumBits, bool IsMutable>
        +
        482class packed_channel_reference;
        +
        483
        +
        487template <typename BitField, int NumBits, bool IsMutable>
        +
        488class packed_dynamic_channel_reference;
        +
        489
        +
        492template <typename BitField, int FirstBit, int NumBits>
        +
        493class packed_channel_reference<BitField, FirstBit, NumBits, false>
        +
        494 : public detail::packed_channel_reference_base
        +
        495 <
        +
        496 packed_channel_reference<BitField, FirstBit, NumBits, false>,
        +
        497 BitField,
        +
        498 NumBits,
        +
        499 false
        +
        500 >
        +
        501{
        +
        502 using parent_t = detail::packed_channel_reference_base
        +
        503 <
        +
        504 packed_channel_reference<BitField, FirstBit, NumBits, false>,
        +
        505 BitField,
        +
        506 NumBits,
        +
        507 false
        +
        508 >;
        +
        509
        +
        510 friend class packed_channel_reference<BitField, FirstBit, NumBits, true>;
        +
        511
        +
        512 static const BitField channel_mask = static_cast<BitField>(parent_t::max_val) << FirstBit;
        +
        513
        +
        514 void operator=(packed_channel_reference const&);
        +
        515public:
        +
        516 using const_reference = packed_channel_reference<BitField,FirstBit,NumBits,false> const;
        +
        517 using mutable_reference = packed_channel_reference<BitField,FirstBit,NumBits,true> const;
        +
        518 using integer_t = typename parent_t::integer_t;
        +
        519
        +
        520 explicit packed_channel_reference(const void* data_ptr) : parent_t(data_ptr) {}
        +
        521 packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
        +
        522 packed_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr) {}
        +
        523
        +
        524 auto first_bit() const -> unsigned int { return FirstBit; }
        +
        525
        +
        526 auto get() const -> integer_t { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
        +
        527};
        +
        528
        +
        531template <typename BitField, int FirstBit, int NumBits>
        +
        532class packed_channel_reference<BitField,FirstBit,NumBits,true>
        +
        533 : public detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true>
        +
        534{
        +
        535 using parent_t = detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true>;
        +
        536 friend class packed_channel_reference<BitField,FirstBit,NumBits,false>;
        +
        537
        +
        538 static const BitField channel_mask = static_cast< BitField >( parent_t::max_val ) << FirstBit;
        +
        539
        +
        540public:
        +
        541 using const_reference = packed_channel_reference<BitField,FirstBit,NumBits,false> const;
        +
        542 using mutable_reference = packed_channel_reference<BitField,FirstBit,NumBits,true> const;
        +
        543 using integer_t = typename parent_t::integer_t;
        +
        544
        +
        545 explicit packed_channel_reference(void* data_ptr) : parent_t(data_ptr) {}
        +
        546 packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
        +
        547
        +
        548 packed_channel_reference const& operator=(integer_t value) const
        +
        549 {
        +
        550 BOOST_ASSERT(value <= parent_t::max_val);
        +
        551 set_unsafe(value);
        +
        552 return *this;
        +
        553 }
        +
        554
        +
        555 auto operator=(mutable_reference const& ref) const -> packed_channel_reference const& { set_from_reference(ref.get_data()); return *this; }
        +
        556 auto operator=(const_reference const& ref) const -> packed_channel_reference const& { set_from_reference(ref.get_data()); return *this; }
        +
        557
        +
        558 template <bool Mutable1>
        +
        559 auto operator=(packed_dynamic_channel_reference<BitField,NumBits,Mutable1> const& ref) const -> packed_channel_reference const& { set_unsafe(ref.get()); return *this; }
        +
        560
        +
        561 auto first_bit() const -> unsigned int { return FirstBit; }
        +
        562
        +
        563 auto get() const -> integer_t { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
        +
        564 void set_unsafe(integer_t value) const { this->set_data((this->get_data() & ~channel_mask) | (( static_cast< BitField >( value )<<FirstBit))); }
        +
        565
        +
        566private:
        +
        567 void set_from_reference(const BitField& other_bits) const { this->set_data((this->get_data() & ~channel_mask) | (other_bits & channel_mask)); }
        +
        568};
        +
        569
        +
        570}} // namespace boost::gil
        +
        571
        +
        572namespace std {
        +
        573// We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
        +
        574// swap with 'left bias':
        +
        575// - swap between proxy and anything
        +
        576// - swap between value type and proxy
        +
        577// - swap between proxy and proxy
        +
        578
        +
        581template <typename BF, int FB, int NB, bool M, typename R>
        +
        582inline
        +
        +
        583void swap(boost::gil::packed_channel_reference<BF, FB, NB, M> const x, R& y)
        +
        584{
        +
        585 boost::gil::swap_proxy
        +
        586 <
        +
        587 typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
        +
        588 >(x, y);
        +
        589}
        +
        +
        590
        +
        591
        +
        594template <typename BF, int FB, int NB, bool M>
        +
        595inline
        +
        +
        596void swap(
        +
        597 typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type& x,
        +
        598 boost::gil::packed_channel_reference<BF, FB, NB, M> const y)
        +
        599{
        +
        600 boost::gil::swap_proxy
        +
        601 <
        +
        602 typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
        +
        603 >(x,y);
        +
        604}
        +
        +
        605
        +
        608template <typename BF, int FB, int NB, bool M> inline
        +
        +
        609void swap(
        +
        610 boost::gil::packed_channel_reference<BF, FB, NB, M> const x,
        +
        611 boost::gil::packed_channel_reference<BF, FB, NB, M> const y)
        +
        612{
        +
        613 boost::gil::swap_proxy
        +
        614 <
        +
        615 typename boost::gil::packed_channel_reference<BF, FB, NB, M>::value_type
        +
        616 >(x,y);
        +
        617}
        +
        +
        618
        +
        619} // namespace std
        +
        620
        +
        621namespace boost { namespace gil {
        +
        622
        +
        637
        +
        641template <typename BitField, int NumBits>
        +
        +
        642class packed_dynamic_channel_reference<BitField,NumBits,false>
        +
        643 : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false>
        +
        644{
        +
        645 using parent_t = detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false>;
        +
        646 friend class packed_dynamic_channel_reference<BitField,NumBits,true>;
        +
        647
        +
        648 unsigned _first_bit; // 0..7
        +
        649
        +
        650 void operator=(const packed_dynamic_channel_reference&);
        +
        651public:
        +
        652 using const_reference = packed_dynamic_channel_reference<BitField,NumBits,false> const;
        +
        653 using mutable_reference = packed_dynamic_channel_reference<BitField,NumBits,true> const;
        +
        654 using integer_t = typename parent_t::integer_t;
        +
        655
        +
        656 packed_dynamic_channel_reference(void const* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
        +
        657 packed_dynamic_channel_reference(const_reference const& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
        +
        658 packed_dynamic_channel_reference(mutable_reference const& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
        +
        659
        +
        660 auto first_bit() const -> unsigned int { return _first_bit; }
        +
        661
        +
        662 auto get() const -> integer_t
        +
        663 {
        +
        664 const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) <<_first_bit;
        +
        665 return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
        +
        666 }
        +
        667};
        +
        +
        668
        +
        672template <typename BitField, int NumBits>
        +
        +
        673class packed_dynamic_channel_reference<BitField,NumBits,true>
        +
        674 : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true>
        +
        675{
        +
        676 using parent_t = detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true>;
        +
        677 friend class packed_dynamic_channel_reference<BitField,NumBits,false>;
        +
        678
        +
        679 unsigned _first_bit;
        +
        680
        +
        681public:
        +
        682 using const_reference = packed_dynamic_channel_reference<BitField,NumBits,false> const;
        +
        683 using mutable_reference = packed_dynamic_channel_reference<BitField,NumBits,true> const;
        +
        684 using integer_t = typename parent_t::integer_t;
        +
        685
        +
        686 packed_dynamic_channel_reference(void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
        +
        687 packed_dynamic_channel_reference(packed_dynamic_channel_reference const& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
        +
        688
        +
        689 auto operator=(integer_t value) const -> packed_dynamic_channel_reference const&
        +
        690 {
        +
        691 BOOST_ASSERT(value <= parent_t::max_val);
        +
        692 set_unsafe(value);
        +
        693 return *this;
        +
        694 }
        +
        695
        +
        696 auto operator=(mutable_reference const& ref) const -> packed_dynamic_channel_reference const& { set_unsafe(ref.get()); return *this; }
        +
        697 auto operator=(const_reference const& ref) const -> packed_dynamic_channel_reference const& { set_unsafe(ref.get()); return *this; }
        +
        698
        +
        699 template <typename BitField1, int FirstBit1, bool Mutable1>
        +
        700 auto operator=(packed_channel_reference<BitField1, FirstBit1, NumBits, Mutable1> const& ref) const -> packed_dynamic_channel_reference const&
        +
        701 {
        +
        702 set_unsafe(ref.get());
        +
        703 return *this;
        +
        704 }
        +
        705
        +
        706 auto first_bit() const -> unsigned int { return _first_bit; }
        +
        707
        +
        708 auto get() const -> integer_t
        +
        709 {
        +
        710 BitField const channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
        +
        711 return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
        +
        712 }
        +
        713
        +
        714 void set_unsafe(integer_t value) const {
        +
        715 const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
        +
        716 this->set_data((this->get_data() & ~channel_mask) | value<<_first_bit);
        +
        717 }
        +
        718};
        +
        +
        719} } // namespace boost::gil
        +
        720
        +
        721namespace std {
        +
        722// We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
        +
        723// swap with 'left bias':
        +
        724// - swap between proxy and anything
        +
        725// - swap between value type and proxy
        +
        726// - swap between proxy and proxy
        +
        727
        +
        728
        +
        731template <typename BF, int NB, bool M, typename R> inline
        +
        +
        732void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, R& y) {
        +
        733 boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
        +
        734}
        +
        +
        735
        +
        736
        +
        739template <typename BF, int NB, bool M> inline
        +
        +
        740void swap(typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type& x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
        +
        741 boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
        +
        742}
        +
        +
        743
        +
        746template <typename BF, int NB, bool M> inline
        +
        +
        747void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
        +
        748 boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
        +
        749}
        +
        +
        750} // namespace std
        +
        751
        +
        752// \brief Determines the fundamental type which may be used, e.g., to cast from larger to smaller channel types.
        +
        753namespace boost { namespace gil {
        +
        754template <typename T>
        +
        755struct base_channel_type_impl { using type = T; };
        +
        756
        +
        757template <int N>
        +
        758struct base_channel_type_impl<packed_channel_value<N> >
        +
        759{ using type = typename packed_channel_value<N>::integer_t; };
        +
        760
        +
        761template <typename B, int F, int N, bool M>
        +
        762struct base_channel_type_impl<packed_channel_reference<B, F, N, M> >
        +
        763{
        +
        764 using type = typename packed_channel_reference<B,F,N,M>::integer_t;
        +
        765};
        +
        766
        +
        767template <typename B, int N, bool M>
        +
        768struct base_channel_type_impl<packed_dynamic_channel_reference<B, N, M> >
        +
        769{
        +
        770 using type = typename packed_dynamic_channel_reference<B,N,M>::integer_t;
        +
        771};
        +
        772
        +
        773template <typename ChannelValue, typename MinV, typename MaxV>
        +
        774struct base_channel_type_impl<scoped_channel_value<ChannelValue, MinV, MaxV> >
        +
        775{ using type = ChannelValue; };
        +
        776
        +
        777template <typename T>
        +
        778struct base_channel_type : base_channel_type_impl<typename std::remove_cv<T>::type> {};
        +
        779
        +
        780}} //namespace boost::gil
        +
        781
        +
        782#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/channel__algorithm_8hpp_source.html b/html/reference/channel__algorithm_8hpp_source.html index b766dcbab..12f9da5cc 100644 --- a/html/reference/channel__algorithm_8hpp_source.html +++ b/html/reference/channel__algorithm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_algorithm.hpp Source File @@ -27,543 +27,576 @@

        - + +/* @license-end */ + +
        -
        -
        channel_algorithm.hpp
        +
        channel_algorithm.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_GIL_CHANNEL_ALGORITHM_HPP
        -
        9 #define BOOST_GIL_GIL_CHANNEL_ALGORITHM_HPP
        -
        10 
        -
        11 #include <boost/gil/channel.hpp>
        -
        12 #include <boost/gil/promote_integral.hpp>
        -
        13 #include <boost/gil/typedefs.hpp>
        -
        14 #include <boost/gil/detail/is_channel_integral.hpp>
        -
        15 #include <boost/gil/detail/mp11.hpp>
        -
        16 
        -
        17 #include <limits>
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        22 namespace detail {
        -
        23 
        -
        24 // some forward declarations
        -
        25 template <typename SrcChannelV, typename DstChannelV, bool SrcIsIntegral, bool DstIsIntegral>
        -
        26 struct channel_converter_unsigned_impl;
        -
        27 
        -
        28 template <typename SrcChannelV, typename DstChannelV, bool SrcIsGreater>
        -
        29 struct channel_converter_unsigned_integral;
        -
        30 
        -
        31 template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst, bool SrcDivisible>
        -
        32 struct channel_converter_unsigned_integral_impl;
        -
        33 
        -
        34 template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst, bool CannotFitInInteger>
        -
        35 struct channel_converter_unsigned_integral_nondivisible;
        -
        36 
        -
        41 
        -
        42 template <typename UnsignedIntegralChannel>
        -
        43 struct unsigned_integral_max_value
        -
        44  : std::integral_constant
        -
        45  <
        -
        46  UnsignedIntegralChannel,
        -
        47  (std::numeric_limits<UnsignedIntegralChannel>::max)()
        -
        48  >
        -
        49 {};
        -
        50 
        -
        51 template <>
        -
        52 struct unsigned_integral_max_value<uint8_t>
        -
        53  : std::integral_constant<uint32_t, 0xFF>
        -
        54 {};
        -
        55 
        -
        56 template <>
        -
        57 struct unsigned_integral_max_value<uint16_t>
        -
        58  : std::integral_constant<uint32_t, 0xFFFF>
        -
        59 {};
        -
        60 
        -
        61 template <>
        -
        62 struct unsigned_integral_max_value<uint32_t>
        -
        63  : std::integral_constant<uintmax_t, 0xFFFFFFFF>
        -
        64 {};
        -
        65 
        -
        66 template <int K>
        -
        67 struct unsigned_integral_max_value<packed_channel_value<K>>
        -
        68  : std::integral_constant
        -
        69  <
        -
        70  typename packed_channel_value<K>::integer_t,
        -
        71  (uint64_t(1)<<K)-1
        -
        72  >
        -
        73 {};
        -
        74 
        -
        79 
        -
        80 template <typename UnsignedIntegralChannel>
        -
        81 struct unsigned_integral_num_bits
        -
        82  : std::integral_constant<int, static_cast<int>(sizeof(UnsignedIntegralChannel) * 8)>
        -
        83 {};
        -
        84 
        -
        85 template <int K>
        -
        86 struct unsigned_integral_num_bits<packed_channel_value<K>>
        -
        87  : std::integral_constant<int, K>
        -
        88 {};
        -
        89 
        -
        90 } // namespace detail
        -
        91 
        -
        115 
        -
        121 
        -
        125 
        -
        126 template <typename SrcChannelV, typename DstChannelV> // Model ChannelValueConcept
        -
        127 struct channel_converter_unsigned
        -
        128  : detail::channel_converter_unsigned_impl
        -
        129  <
        -
        130  SrcChannelV,
        -
        131  DstChannelV,
        -
        132  detail::is_channel_integral<SrcChannelV>::value,
        -
        133  detail::is_channel_integral<DstChannelV>::value
        -
        134  >
        -
        135 {};
        -
        136 
        -
        138 template <typename T> struct channel_converter_unsigned<T,T> : public detail::identity<T> {};
        -
        139 
        -
        140 namespace detail {
        -
        141 
        -
        145 
        -
        147 template <typename SrcChannelV, typename DstChannelV, bool SrcIsIntegral, bool DstIsIntegral>
        -
        148 struct channel_converter_unsigned_impl {
        -
        149  using argument_type = SrcChannelV;
        -
        150  using result_type = DstChannelV;
        -
        151  auto operator()(SrcChannelV src) const -> DstChannelV
        -
        152  {
        -
        153  return DstChannelV(channel_traits<DstChannelV>::min_value() +
        -
        154  (src - channel_traits<SrcChannelV>::min_value()) / channel_range<SrcChannelV>() * channel_range<DstChannelV>());
        -
        155  }
        -
        156 
        -
        157 private:
        -
        158  template <typename C>
        -
        159  static auto channel_range() -> double
        -
        160  {
        -
        161  return double(channel_traits<C>::max_value()) - double(channel_traits<C>::min_value());
        -
        162  }
        -
        163 };
        -
        164 
        -
        165 // When both the source and the destination are integral channels, perform a faster conversion
        -
        166 template <typename SrcChannelV, typename DstChannelV>
        -
        167 struct channel_converter_unsigned_impl<SrcChannelV, DstChannelV, true, true>
        -
        168  : channel_converter_unsigned_integral
        -
        169  <
        -
        170  SrcChannelV,
        -
        171  DstChannelV,
        -
        172  mp11::mp_less
        -
        173  <
        -
        174  unsigned_integral_max_value<SrcChannelV>,
        -
        175  unsigned_integral_max_value<DstChannelV>
        -
        176  >::value
        -
        177  >
        -
        178 {};
        -
        179 
        -
        183 
        -
        184 template <typename SrcChannelV, typename DstChannelV>
        -
        185 struct channel_converter_unsigned_integral<SrcChannelV,DstChannelV,true>
        -
        186  : public channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,true,
        -
        187  !(unsigned_integral_max_value<DstChannelV>::value % unsigned_integral_max_value<SrcChannelV>::value) > {};
        -
        188 
        -
        189 template <typename SrcChannelV, typename DstChannelV>
        -
        190 struct channel_converter_unsigned_integral<SrcChannelV,DstChannelV,false>
        -
        191  : public channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,false,
        -
        192  !(unsigned_integral_max_value<SrcChannelV>::value % unsigned_integral_max_value<DstChannelV>::value) > {};
        -
        193 
        -
        194 
        -
        198 
        -
        199 // Both source and destination are unsigned integral channels,
        -
        200 // the src max value is less than the dst max value,
        -
        201 // and the dst max value is divisible by the src max value
        -
        202 template <typename SrcChannelV, typename DstChannelV>
        -
        203 struct channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,true,true> {
        -
        204  auto operator()(SrcChannelV src) const -> DstChannelV
        -
        205  {
        -
        206  using integer_t = typename unsigned_integral_max_value<DstChannelV>::value_type;
        -
        207  static const integer_t mul = unsigned_integral_max_value<DstChannelV>::value / unsigned_integral_max_value<SrcChannelV>::value;
        -
        208  return DstChannelV(src * mul);
        -
        209  }
        -
        210 };
        -
        211 
        -
        212 // Both source and destination are unsigned integral channels,
        -
        213 // the dst max value is less than (or equal to) the src max value,
        -
        214 // and the src max value is divisible by the dst max value
        -
        215 template <typename SrcChannelV, typename DstChannelV>
        -
        216 struct channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,false,true> {
        -
        217  auto operator()(SrcChannelV src) const -> DstChannelV
        -
        218  {
        -
        219  using integer_t = typename unsigned_integral_max_value<SrcChannelV>::value_type;
        -
        220  static const integer_t div = unsigned_integral_max_value<SrcChannelV>::value / unsigned_integral_max_value<DstChannelV>::value;
        -
        221  static const integer_t div2 = div/2;
        -
        222  return DstChannelV((src + div2) / div);
        -
        223  }
        -
        224 };
        -
        225 
        -
        226 // Prevent overflow for the largest integral type
        -
        227 template <typename DstChannelV>
        -
        228 struct channel_converter_unsigned_integral_impl<uintmax_t,DstChannelV,false,true> {
        -
        229  auto operator()(uintmax_t src) const -> DstChannelV
        -
        230  {
        -
        231  static const uintmax_t div = unsigned_integral_max_value<uint32_t>::value / unsigned_integral_max_value<DstChannelV>::value;
        -
        232  static const uintmax_t div2 = div/2;
        -
        233  if (src > unsigned_integral_max_value<uintmax_t>::value - div2)
        -
        234  return unsigned_integral_max_value<DstChannelV>::value;
        -
        235  return DstChannelV((src + div2) / div);
        -
        236  }
        -
        237 };
        -
        238 
        -
        239 // Both source and destination are unsigned integral channels,
        -
        240 // and the dst max value is not divisible by the src max value
        -
        241 // See if you can represent the expression (src * dst_max) / src_max in integral form
        -
        242 template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst>
        -
        243 struct channel_converter_unsigned_integral_impl<SrcChannelV, DstChannelV, SrcLessThanDst, false>
        -
        244  : channel_converter_unsigned_integral_nondivisible
        -
        245  <
        -
        246  SrcChannelV,
        -
        247  DstChannelV,
        -
        248  SrcLessThanDst,
        -
        249  mp11::mp_less
        -
        250  <
        -
        251  unsigned_integral_num_bits<uintmax_t>,
        -
        252  mp11::mp_plus
        -
        253  <
        -
        254  unsigned_integral_num_bits<SrcChannelV>,
        -
        255  unsigned_integral_num_bits<DstChannelV>
        -
        256  >
        -
        257  >::value
        -
        258  >
        -
        259 {};
        -
        260 
        -
        261 // Both source and destination are unsigned integral channels,
        -
        262 // the src max value is less than the dst max value,
        -
        263 // and the dst max value is not divisible by the src max value
        -
        264 // The expression (src * dst_max) / src_max fits in an integer
        -
        265 template <typename SrcChannelV, typename DstChannelV>
        -
        266 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV, DstChannelV, true, false>
        -
        267 {
        -
        268  auto operator()(SrcChannelV src) const -> DstChannelV
        -
        269  {
        -
        270  using dest_t = typename base_channel_type<DstChannelV>::type;
        -
        271  return DstChannelV(
        -
        272  static_cast<dest_t>(src * unsigned_integral_max_value<DstChannelV>::value)
        -
        273  / unsigned_integral_max_value<SrcChannelV>::value);
        -
        274  }
        -
        275 };
        -
        276 
        -
        277 // Both source and destination are unsigned integral channels,
        -
        278 // the src max value is less than the dst max value,
        -
        279 // and the dst max value is not divisible by the src max value
        -
        280 // The expression (src * dst_max) / src_max cannot fit in an integer (overflows). Use a double
        -
        281 template <typename SrcChannelV, typename DstChannelV>
        -
        282 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV, DstChannelV, true, true>
        -
        283 {
        -
        284  auto operator()(SrcChannelV src) const -> DstChannelV
        -
        285  {
        -
        286  static const double mul
        -
        287  = unsigned_integral_max_value<DstChannelV>::value
        -
        288  / double(unsigned_integral_max_value<SrcChannelV>::value);
        -
        289  return DstChannelV(src * mul);
        -
        290  }
        -
        291 };
        -
        292 
        -
        293 // Both source and destination are unsigned integral channels,
        -
        294 // the dst max value is less than (or equal to) the src max value,
        -
        295 // and the src max value is not divisible by the dst max value
        -
        296 template <typename SrcChannelV, typename DstChannelV, bool CannotFit>
        -
        297 struct channel_converter_unsigned_integral_nondivisible<SrcChannelV,DstChannelV,false,CannotFit>
        -
        298 {
        -
        299  auto operator()(SrcChannelV src) const -> DstChannelV
        -
        300  {
        -
        301  using src_integer_t = typename detail::unsigned_integral_max_value<SrcChannelV>::value_type;
        -
        302  using dst_integer_t = typename detail::unsigned_integral_max_value<DstChannelV>::value_type;
        -
        303 
        -
        304  static const double div = unsigned_integral_max_value<SrcChannelV>::value
        -
        305  / static_cast< double >( unsigned_integral_max_value<DstChannelV>::value );
        -
        306 
        -
        307  static const src_integer_t div2 = static_cast< src_integer_t >( div / 2.0 );
        -
        308 
        -
        309  return DstChannelV( static_cast< dst_integer_t >(( static_cast< double >( src + div2 ) / div )));
        -
        310  }
        -
        311 };
        -
        312 
        -
        313 } // namespace detail
        -
        314 
        -
        318 
        -
        319 template <typename DstChannelV> struct channel_converter_unsigned<float32_t,DstChannelV> {
        -
        320  using argument_type = float32_t;
        -
        321  using result_type = DstChannelV;
        -
        322  auto operator()(float32_t x) const -> DstChannelV
        -
        323  {
        -
        324  using dst_integer_t = typename detail::unsigned_integral_max_value<DstChannelV>::value_type;
        -
        325  return DstChannelV( static_cast< dst_integer_t >(x*channel_traits<DstChannelV>::max_value()+0.5f ));
        -
        326  }
        -
        327 };
        -
        328 
        -
        329 template <typename SrcChannelV> struct channel_converter_unsigned<SrcChannelV,float32_t> {
        -
        330  using argument_type = float32_t;
        -
        331  using result_type = SrcChannelV;
        -
        332  auto operator()(SrcChannelV x) const -> float32_t { return float32_t(x/float(channel_traits<SrcChannelV>::max_value())); }
        -
        333 };
        -
        334 
        -
        335 template <> struct channel_converter_unsigned<float32_t,float32_t> {
        -
        336  using argument_type = float32_t;
        -
        337  using result_type = float32_t;
        -
        338  auto operator()(float32_t x) const -> float32_t { return x; }
        -
        339 };
        -
        340 
        -
        341 
        -
        343 template <> struct channel_converter_unsigned<uint32_t,float32_t> {
        -
        344  using argument_type = uint32_t;
        -
        345  using result_type = float32_t;
        -
        346  auto operator()(uint32_t x) const -> float32_t
        -
        347  {
        -
        348  // unfortunately without an explicit check it is possible to get a round-off error. We must ensure that max_value of uint32_t matches max_value of float32_t
        -
        349  if (x>=channel_traits<uint32_t>::max_value()) return channel_traits<float32_t>::max_value();
        -
        350  return float(x) / float(channel_traits<uint32_t>::max_value());
        -
        351  }
        -
        352 };
        -
        354 template <> struct channel_converter_unsigned<float32_t,uint32_t> {
        -
        355  using argument_type = float32_t;
        -
        356  using result_type = uint32_t;
        -
        357  auto operator()(float32_t x) const -> uint32_t
        -
        358  {
        -
        359  // unfortunately without an explicit check it is possible to get a round-off error. We must ensure that max_value of uint32_t matches max_value of float32_t
        -
        360  if (x>=channel_traits<float32_t>::max_value())
        -
        361  return channel_traits<uint32_t>::max_value();
        -
        362 
        -
        363  auto const max_value = channel_traits<uint32_t>::max_value();
        -
        364  auto const result = x * static_cast<float32_t::base_channel_t>(max_value) + 0.5f;
        -
        365  return static_cast<uint32_t>(result);
        -
        366  }
        -
        367 };
        -
        368 
        -
        370 
        -
        371 namespace detail {
        -
        372 // Converting from signed to unsigned integral channel.
        -
        373 // It is both a unary function, and a metafunction (thus requires the 'type' nested alias, which equals result_type)
        -
        374 template <typename ChannelValue> // Model ChannelValueConcept
        -
        375 struct channel_convert_to_unsigned : public detail::identity<ChannelValue> {
        -
        376  using type = ChannelValue;
        -
        377 };
        -
        378 
        -
        379 template <> struct channel_convert_to_unsigned<int8_t> {
        -
        380  using argument_type = int8_t;
        -
        381  using result_type = uint8_t;
        -
        382  using type = uint8_t;
        -
        383  type operator()(int8_t val) const {
        -
        384  return static_cast<uint8_t>(static_cast<uint32_t>(val) + 128u);
        -
        385  }
        -
        386 };
        -
        387 
        -
        388 template <> struct channel_convert_to_unsigned<int16_t> {
        -
        389  using argument_type = int16_t;
        -
        390  using result_type = uint16_t;
        -
        391  using type = uint16_t;
        -
        392  type operator()(int16_t val) const {
        -
        393  return static_cast<uint16_t>(static_cast<uint32_t>(val) + 32768u);
        -
        394  }
        -
        395 };
        -
        396 
        -
        397 template <> struct channel_convert_to_unsigned<int32_t> {
        -
        398  using argument_type = int32_t;
        -
        399  using result_type = uint32_t;
        -
        400  using type = uint32_t;
        -
        401  type operator()(int32_t val) const {
        -
        402  return static_cast<uint32_t>(val)+(1u<<31);
        -
        403  }
        -
        404 };
        -
        405 
        -
        406 
        -
        407 // Converting from unsigned to signed integral channel
        -
        408 // It is both a unary function, and a metafunction (thus requires the 'type' nested alias, which equals result_type)
        -
        409 template <typename ChannelValue> // Model ChannelValueConcept
        -
        410 struct channel_convert_from_unsigned : public detail::identity<ChannelValue> {
        -
        411  using type = ChannelValue;
        -
        412 };
        -
        413 
        -
        414 template <> struct channel_convert_from_unsigned<int8_t> {
        -
        415  using argument_type = uint8_t;
        -
        416  using result_type = int8_t;
        -
        417  using type = int8_t;
        -
        418  type operator()(uint8_t val) const {
        -
        419  return static_cast<int8_t>(static_cast<int32_t>(val) - 128);
        -
        420  }
        -
        421 };
        -
        422 
        -
        423 template <> struct channel_convert_from_unsigned<int16_t> {
        -
        424  using argument_type = uint16_t;
        -
        425  using result_type = int16_t;
        -
        426  using type = int16_t;
        -
        427  type operator()(uint16_t val) const {
        -
        428  return static_cast<int16_t>(static_cast<int32_t>(val) - 32768);
        -
        429  }
        -
        430 };
        -
        431 
        -
        432 template <> struct channel_convert_from_unsigned<int32_t> {
        -
        433  using argument_type = uint32_t;
        -
        434  using result_type = int32_t;
        -
        435  using type = int32_t;
        -
        436  type operator()(uint32_t val) const {
        -
        437  return static_cast<int32_t>(val - (1u<<31));
        -
        438  }
        -
        439 };
        -
        440 
        -
        441 } // namespace detail
        -
        442 
        -
        445 template <typename SrcChannelV, typename DstChannelV> // Model ChannelValueConcept
        - -
        447  using argument_type = SrcChannelV;
        -
        448  using result_type = DstChannelV;
        -
        449  auto operator()(SrcChannelV const& src) const -> DstChannelV
        -
        450  {
        -
        451  using to_unsigned = detail::channel_convert_to_unsigned<SrcChannelV>;
        -
        452  using from_unsigned = detail::channel_convert_from_unsigned<DstChannelV>;
        -
        453  using converter_unsigned = channel_converter_unsigned<typename to_unsigned::result_type, typename from_unsigned::argument_type>;
        -
        454  return from_unsigned()(converter_unsigned()(to_unsigned()(src)));
        -
        455  }
        -
        456 };
        -
        457 
        -
        460 template <typename DstChannel, typename SrcChannel> // Model ChannelConcept (could be channel references)
        -
        461 inline auto channel_convert(SrcChannel const& src) -> typename channel_traits<DstChannel>::value_type
        -
        462 {
        - -
        464  typename channel_traits<DstChannel>::value_type>()(src);
        -
        465 }
        -
        466 
        - -
        472  template <typename Ch1, typename Ch2>
        -
        473  void operator()(Ch1 const& src, Ch2& dst) const
        -
        474  {
        -
        475  dst=channel_convert<Ch2>(src);
        -
        476  }
        -
        477 };
        -
        478 
        -
        479 namespace detail
        -
        480 {
        -
        481  // fast integer division by 255
        -
        482  inline auto div255(uint32_t in) -> uint32_t
        -
        483  {
        -
        484  uint32_t tmp = in + 128;
        -
        485  return (tmp + (tmp >> 8)) >> 8;
        -
        486  }
        -
        487 
        -
        488  // fast integer divison by 32768
        -
        489  inline auto div32768(uint32_t in) -> uint32_t
        -
        490  {
        -
        491  return (in + 16384) >> 15;
        -
        492  }
        -
        493 }
        -
        494 
        -
        507 
        -
        509 template <typename ChannelValue>
        - -
        511  using first_argument_type = ChannelValue;
        -
        512  using second_argument_type = ChannelValue;
        -
        513  using result_type = ChannelValue;
        -
        514  auto operator()(ChannelValue a, ChannelValue b) const -> ChannelValue
        -
        515  {
        -
        516  return ChannelValue(static_cast<typename base_channel_type<ChannelValue>::type>(a / double(channel_traits<ChannelValue>::max_value()) * b));
        -
        517  }
        -
        518 };
        -
        519 
        -
        521 template<> struct channel_multiplier_unsigned<uint8_t> {
        -
        522  using first_argument_type = uint8_t;
        -
        523  using second_argument_type = uint8_t;
        -
        524  using result_type = uint8_t;
        -
        525  auto operator()(uint8_t a, uint8_t b) const -> uint8_t { return uint8_t(detail::div255(uint32_t(a) * uint32_t(b))); }
        -
        526 };
        -
        527 
        -
        529 template<> struct channel_multiplier_unsigned<uint16_t> {
        -
        530  using first_argument_type = uint16_t;
        -
        531  using second_argument_type = uint16_t;
        -
        532  using result_type = uint16_t;
        -
        533  auto operator()(uint16_t a, uint16_t b) const -> uint16_t { return uint16_t((uint32_t(a) * uint32_t(b))/65535); }
        -
        534 };
        -
        535 
        - -
        538  using first_argument_type = float32_t;
        -
        539  using second_argument_type = float32_t;
        -
        540  using result_type = float32_t;
        -
        541  auto operator()(float32_t a, float32_t b) const -> float32_t { return a*b; }
        -
        542 };
        -
        543 
        -
        545 template <typename ChannelValue>
        - -
        547  using first_argument_type = ChannelValue;
        -
        548  using second_argument_type = ChannelValue;
        -
        549  using result_type = ChannelValue;
        -
        550  auto operator()(ChannelValue a, ChannelValue b) const -> ChannelValue
        -
        551  {
        -
        552  using to_unsigned = detail::channel_convert_to_unsigned<ChannelValue>;
        -
        553  using from_unsigned = detail::channel_convert_from_unsigned<ChannelValue>;
        - -
        555  return from_unsigned()(multiplier_unsigned()(to_unsigned()(a), to_unsigned()(b)));
        -
        556  }
        -
        557 };
        -
        558 
        -
        560 template <typename Channel> // Models ChannelConcept (could be a channel reference)
        -
        561 inline auto channel_multiply(Channel a, Channel b) -> typename channel_traits<Channel>::value_type
        -
        562 {
        - -
        564 }
        -
        566 
        -
        578 
        -
        581 template <typename Channel> // Models ChannelConcept (could be a channel reference)
        -
        582 inline auto channel_invert(Channel x) -> typename channel_traits<Channel>::value_type
        -
        583 {
        -
        584  using base_t = typename base_channel_type<Channel>::type;
        -
        585  using promoted_t = typename promote_integral<base_t>::type;
        -
        586  promoted_t const promoted_x = x;
        -
        587  promoted_t const promoted_max = channel_traits<Channel>::max_value();
        -
        588  promoted_t const promoted_min = channel_traits<Channel>::min_value();
        -
        589  promoted_t const promoted_inverted_x = promoted_max - promoted_x + promoted_min;
        -
        590  auto const inverted_x = static_cast<base_t>(promoted_inverted_x);
        -
        591  return inverted_x;
        -
        592 }
        -
        593 
        -
        594 }} // namespace boost::gil
        -
        595 
        -
        596 #endif
        -
        auto channel_convert(SrcChannel const &src) -> typename channel_traits< DstChannel >::value_type
        Converting from one channel type to another.
        Definition: channel_algorithm.hpp:461
        -
        auto channel_invert(Channel x) -> typename channel_traits< Channel >::value_type
        Default implementation. Provide overloads for performance.
        Definition: channel_algorithm.hpp:582
        -
        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
        -
        auto channel_multiply(Channel a, Channel b) -> typename channel_traits< Channel >::value_type
        A function multiplying two channels. result = a * b / max_value.
        Definition: channel_algorithm.hpp:561
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        A unary function object converting between channel types.
        Definition: channel_algorithm.hpp:446
        -
        This is the default implementation. Performance specializatons are provided.
        Definition: channel_algorithm.hpp:510
        -
        A function object to multiply two channels. result = a * b / max_value.
        Definition: channel_algorithm.hpp:546
        -
        Same as channel_converter, except it takes the destination channel by reference, which allows us to m...
        Definition: channel_algorithm.hpp:471
        -
        identity taken from SGI STL.
        Definition: utilities.hpp:211
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_GIL_CHANNEL_ALGORITHM_HPP
        +
        9#define BOOST_GIL_GIL_CHANNEL_ALGORITHM_HPP
        +
        10
        +
        11#include <boost/gil/channel.hpp>
        +
        12#include <boost/gil/promote_integral.hpp>
        +
        13#include <boost/gil/typedefs.hpp>
        +
        14#include <boost/gil/detail/is_channel_integral.hpp>
        +
        15#include <boost/gil/detail/mp11.hpp>
        +
        16
        +
        17#include <limits>
        +
        18#include <type_traits>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        22namespace detail {
        +
        23
        +
        24// some forward declarations
        +
        25template <typename SrcChannelV, typename DstChannelV, bool SrcIsIntegral, bool DstIsIntegral>
        +
        26struct channel_converter_unsigned_impl;
        +
        27
        +
        28template <typename SrcChannelV, typename DstChannelV, bool SrcIsGreater>
        +
        29struct channel_converter_unsigned_integral;
        +
        30
        +
        31template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst, bool SrcDivisible>
        +
        32struct channel_converter_unsigned_integral_impl;
        +
        33
        +
        34template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst, bool CannotFitInInteger>
        +
        35struct channel_converter_unsigned_integral_nondivisible;
        +
        36
        +
        41
        +
        42template <typename UnsignedIntegralChannel>
        +
        43struct unsigned_integral_max_value
        +
        44 : std::integral_constant
        +
        45 <
        +
        46 UnsignedIntegralChannel,
        +
        47 (std::numeric_limits<UnsignedIntegralChannel>::max)()
        +
        48 >
        +
        49{};
        +
        50
        +
        51template <>
        +
        52struct unsigned_integral_max_value<uint8_t>
        +
        53 : std::integral_constant<uint32_t, 0xFF>
        +
        54{};
        +
        55
        +
        56template <>
        +
        57struct unsigned_integral_max_value<uint16_t>
        +
        58 : std::integral_constant<uint32_t, 0xFFFF>
        +
        59{};
        +
        60
        +
        61template <>
        +
        62struct unsigned_integral_max_value<uint32_t>
        +
        63 : std::integral_constant<uintmax_t, 0xFFFFFFFF>
        +
        64{};
        +
        65
        +
        66template <int K>
        +
        67struct unsigned_integral_max_value<packed_channel_value<K>>
        +
        68 : std::integral_constant
        +
        69 <
        +
        70 typename packed_channel_value<K>::integer_t,
        +
        71 (uint64_t(1)<<K)-1
        +
        72 >
        +
        73{};
        +
        74
        +
        79
        +
        80template <typename UnsignedIntegralChannel>
        +
        81struct unsigned_integral_num_bits
        +
        82 : std::integral_constant<int, static_cast<int>(sizeof(UnsignedIntegralChannel) * 8)>
        +
        83{};
        +
        84
        +
        85template <int K>
        +
        86struct unsigned_integral_num_bits<packed_channel_value<K>>
        +
        87 : std::integral_constant<int, K>
        +
        88{};
        +
        89
        +
        90} // namespace detail
        +
        91
        +
        115
        +
        121
        +
        125
        +
        126template <typename SrcChannelV, typename DstChannelV> // Model ChannelValueConcept
        +
        127struct channel_converter_unsigned
        +
        128 : detail::channel_converter_unsigned_impl
        +
        129 <
        +
        130 SrcChannelV,
        +
        131 DstChannelV,
        +
        132 detail::is_channel_integral<SrcChannelV>::value,
        +
        133 detail::is_channel_integral<DstChannelV>::value
        +
        134 >
        +
        135{};
        +
        136
        +
        138template <typename T> struct channel_converter_unsigned<T,T> : public detail::identity<T> {};
        +
        139
        +
        140namespace detail {
        +
        141
        +
        145
        +
        147template <typename SrcChannelV, typename DstChannelV, bool SrcIsIntegral, bool DstIsIntegral>
        +
        +
        148struct channel_converter_unsigned_impl {
        +
        149 using argument_type = SrcChannelV;
        +
        150 using result_type = DstChannelV;
        +
        151 auto operator()(SrcChannelV src) const -> DstChannelV
        +
        152 {
        +
        153 return DstChannelV(channel_traits<DstChannelV>::min_value() +
        +
        154 (src - channel_traits<SrcChannelV>::min_value()) / channel_range<SrcChannelV>() * channel_range<DstChannelV>());
        +
        155 }
        +
        156
        +
        157private:
        +
        158 template <typename C>
        +
        159 static auto channel_range() -> double
        +
        160 {
        +
        161 return double(channel_traits<C>::max_value()) - double(channel_traits<C>::min_value());
        +
        162 }
        +
        163};
        +
        +
        164
        +
        165// When both the source and the destination are integral channels, perform a faster conversion
        +
        166template <typename SrcChannelV, typename DstChannelV>
        +
        167struct channel_converter_unsigned_impl<SrcChannelV, DstChannelV, true, true>
        +
        168 : channel_converter_unsigned_integral
        +
        169 <
        +
        170 SrcChannelV,
        +
        171 DstChannelV,
        +
        172 mp11::mp_less
        +
        173 <
        +
        174 unsigned_integral_max_value<SrcChannelV>,
        +
        175 unsigned_integral_max_value<DstChannelV>
        +
        176 >::value
        +
        177 >
        +
        178{};
        +
        179
        +
        183
        +
        184template <typename SrcChannelV, typename DstChannelV>
        +
        185struct channel_converter_unsigned_integral<SrcChannelV,DstChannelV,true>
        +
        186 : public channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,true,
        +
        187 !(unsigned_integral_max_value<DstChannelV>::value % unsigned_integral_max_value<SrcChannelV>::value) > {};
        +
        188
        +
        189template <typename SrcChannelV, typename DstChannelV>
        +
        190struct channel_converter_unsigned_integral<SrcChannelV,DstChannelV,false>
        +
        191 : public channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,false,
        +
        192 !(unsigned_integral_max_value<SrcChannelV>::value % unsigned_integral_max_value<DstChannelV>::value) > {};
        +
        193
        +
        194
        +
        198
        +
        199// Both source and destination are unsigned integral channels,
        +
        200// the src max value is less than the dst max value,
        +
        201// and the dst max value is divisible by the src max value
        +
        202template <typename SrcChannelV, typename DstChannelV>
        +
        203struct channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,true,true> {
        +
        204 auto operator()(SrcChannelV src) const -> DstChannelV
        +
        205 {
        +
        206 using integer_t = typename unsigned_integral_max_value<DstChannelV>::value_type;
        +
        207 static const integer_t mul = unsigned_integral_max_value<DstChannelV>::value / unsigned_integral_max_value<SrcChannelV>::value;
        +
        208 return DstChannelV(src * mul);
        +
        209 }
        +
        210};
        +
        211
        +
        212// Both source and destination are unsigned integral channels,
        +
        213// the dst max value is less than (or equal to) the src max value,
        +
        214// and the src max value is divisible by the dst max value
        +
        215template <typename SrcChannelV, typename DstChannelV>
        +
        216struct channel_converter_unsigned_integral_impl<SrcChannelV,DstChannelV,false,true> {
        +
        217 auto operator()(SrcChannelV src) const -> DstChannelV
        +
        218 {
        +
        219 using integer_t = typename unsigned_integral_max_value<SrcChannelV>::value_type;
        +
        220 static const integer_t div = unsigned_integral_max_value<SrcChannelV>::value / unsigned_integral_max_value<DstChannelV>::value;
        +
        221 static const integer_t div2 = div/2;
        +
        222 return DstChannelV((src + div2) / div);
        +
        223 }
        +
        224};
        +
        225
        +
        226// Prevent overflow for the largest integral type
        +
        227template <typename DstChannelV>
        +
        228struct channel_converter_unsigned_integral_impl<uintmax_t,DstChannelV,false,true> {
        +
        229 auto operator()(uintmax_t src) const -> DstChannelV
        +
        230 {
        +
        231 static const uintmax_t div = unsigned_integral_max_value<uint32_t>::value / unsigned_integral_max_value<DstChannelV>::value;
        +
        232 static const uintmax_t div2 = div/2;
        +
        233 if (src > unsigned_integral_max_value<uintmax_t>::value - div2)
        +
        234 return unsigned_integral_max_value<DstChannelV>::value;
        +
        235 return DstChannelV((src + div2) / div);
        +
        236 }
        +
        237};
        +
        238
        +
        239// Both source and destination are unsigned integral channels,
        +
        240// and the dst max value is not divisible by the src max value
        +
        241// See if you can represent the expression (src * dst_max) / src_max in integral form
        +
        242template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst>
        +
        243struct channel_converter_unsigned_integral_impl<SrcChannelV, DstChannelV, SrcLessThanDst, false>
        +
        244 : channel_converter_unsigned_integral_nondivisible
        +
        245 <
        +
        246 SrcChannelV,
        +
        247 DstChannelV,
        +
        248 SrcLessThanDst,
        +
        249 mp11::mp_less
        +
        250 <
        +
        251 unsigned_integral_num_bits<uintmax_t>,
        +
        252 mp11::mp_plus
        +
        253 <
        +
        254 unsigned_integral_num_bits<SrcChannelV>,
        +
        255 unsigned_integral_num_bits<DstChannelV>
        +
        256 >
        +
        257 >::value
        +
        258 >
        +
        259{};
        +
        260
        +
        261// Both source and destination are unsigned integral channels,
        +
        262// the src max value is less than the dst max value,
        +
        263// and the dst max value is not divisible by the src max value
        +
        264// The expression (src * dst_max) / src_max fits in an integer
        +
        265template <typename SrcChannelV, typename DstChannelV>
        +
        266struct channel_converter_unsigned_integral_nondivisible<SrcChannelV, DstChannelV, true, false>
        +
        267{
        +
        268 auto operator()(SrcChannelV src) const -> DstChannelV
        +
        269 {
        +
        270 using dest_t = typename base_channel_type<DstChannelV>::type;
        +
        271 return DstChannelV(
        +
        272 static_cast<dest_t>(src * unsigned_integral_max_value<DstChannelV>::value)
        +
        273 / unsigned_integral_max_value<SrcChannelV>::value);
        +
        274 }
        +
        275};
        +
        276
        +
        277// Both source and destination are unsigned integral channels,
        +
        278// the src max value is less than the dst max value,
        +
        279// and the dst max value is not divisible by the src max value
        +
        280// The expression (src * dst_max) / src_max cannot fit in an integer (overflows). Use a double
        +
        281template <typename SrcChannelV, typename DstChannelV>
        +
        282struct channel_converter_unsigned_integral_nondivisible<SrcChannelV, DstChannelV, true, true>
        +
        283{
        +
        284 auto operator()(SrcChannelV src) const -> DstChannelV
        +
        285 {
        +
        286 static const double mul
        +
        287 = unsigned_integral_max_value<DstChannelV>::value
        +
        288 / double(unsigned_integral_max_value<SrcChannelV>::value);
        +
        289 return DstChannelV(src * mul);
        +
        290 }
        +
        291};
        +
        292
        +
        293// Both source and destination are unsigned integral channels,
        +
        294// the dst max value is less than (or equal to) the src max value,
        +
        295// and the src max value is not divisible by the dst max value
        +
        296template <typename SrcChannelV, typename DstChannelV, bool CannotFit>
        +
        297struct channel_converter_unsigned_integral_nondivisible<SrcChannelV,DstChannelV,false,CannotFit>
        +
        298{
        +
        299 auto operator()(SrcChannelV src) const -> DstChannelV
        +
        300 {
        +
        301 using src_integer_t = typename detail::unsigned_integral_max_value<SrcChannelV>::value_type;
        +
        302 using dst_integer_t = typename detail::unsigned_integral_max_value<DstChannelV>::value_type;
        +
        303
        +
        304 static const double div = unsigned_integral_max_value<SrcChannelV>::value
        +
        305 / static_cast< double >( unsigned_integral_max_value<DstChannelV>::value );
        +
        306
        +
        307 static const src_integer_t div2 = static_cast< src_integer_t >( div / 2.0 );
        +
        308
        +
        309 return DstChannelV( static_cast< dst_integer_t >(( static_cast< double >( src + div2 ) / div )));
        +
        310 }
        +
        311};
        +
        312
        +
        313} // namespace detail
        +
        314
        +
        318
        +
        +
        319template <typename DstChannelV> struct channel_converter_unsigned<float32_t,DstChannelV> {
        +
        320 using argument_type = float32_t;
        +
        321 using result_type = DstChannelV;
        +
        322 auto operator()(float32_t x) const -> DstChannelV
        +
        323 {
        +
        324 using dst_integer_t = typename detail::unsigned_integral_max_value<DstChannelV>::value_type;
        +
        325 return DstChannelV( static_cast< dst_integer_t >(x*channel_traits<DstChannelV>::max_value()+0.5f ));
        +
        326 }
        +
        327};
        +
        +
        328
        +
        329template <typename SrcChannelV> struct channel_converter_unsigned<SrcChannelV,float32_t> {
        +
        330 using argument_type = float32_t;
        +
        331 using result_type = SrcChannelV;
        +
        332 auto operator()(SrcChannelV x) const -> float32_t { return float32_t(x/float(channel_traits<SrcChannelV>::max_value())); }
        +
        333};
        +
        334
        +
        335template <> struct channel_converter_unsigned<float32_t,float32_t> {
        +
        336 using argument_type = float32_t;
        +
        337 using result_type = float32_t;
        +
        338 auto operator()(float32_t x) const -> float32_t { return x; }
        +
        339};
        +
        340
        +
        341
        +
        +
        343template <> struct channel_converter_unsigned<uint32_t,float32_t> {
        +
        344 using argument_type = uint32_t;
        +
        345 using result_type = float32_t;
        +
        346 auto operator()(uint32_t x) const -> float32_t
        +
        347 {
        +
        348 // unfortunately without an explicit check it is possible to get a round-off error. We must ensure that max_value of uint32_t matches max_value of float32_t
        +
        349 if (x>=channel_traits<uint32_t>::max_value()) return channel_traits<float32_t>::max_value();
        +
        350 return float(x) / float(channel_traits<uint32_t>::max_value());
        +
        351 }
        +
        352};
        +
        +
        +
        354template <> struct channel_converter_unsigned<float32_t,uint32_t> {
        +
        355 using argument_type = float32_t;
        +
        356 using result_type = uint32_t;
        +
        357 auto operator()(float32_t x) const -> uint32_t
        +
        358 {
        +
        359 // unfortunately without an explicit check it is possible to get a round-off error. We must ensure that max_value of uint32_t matches max_value of float32_t
        +
        360 if (x>=channel_traits<float32_t>::max_value())
        +
        361 return channel_traits<uint32_t>::max_value();
        +
        362
        +
        363 auto const max_value = channel_traits<uint32_t>::max_value();
        +
        364 auto const result = x * static_cast<float32_t::base_channel_t>(max_value) + 0.5f;
        +
        365 return static_cast<uint32_t>(result);
        +
        366 }
        +
        367};
        +
        +
        368
        +
        370
        +
        371namespace detail {
        +
        372// Converting from signed to unsigned integral channel.
        +
        373// It is both a unary function, and a metafunction (thus requires the 'type' nested alias, which equals result_type)
        +
        374template <typename ChannelValue> // Model ChannelValueConcept
        +
        375struct channel_convert_to_unsigned : public detail::identity<ChannelValue> {
        +
        376 using type = ChannelValue;
        +
        377};
        +
        378
        +
        379template <> struct channel_convert_to_unsigned<int8_t> {
        +
        380 using argument_type = int8_t;
        +
        381 using result_type = uint8_t;
        +
        382 using type = uint8_t;
        +
        383 type operator()(int8_t val) const {
        +
        384 return static_cast<uint8_t>(static_cast<uint32_t>(val) + 128u);
        +
        385 }
        +
        386};
        +
        387
        +
        388template <> struct channel_convert_to_unsigned<int16_t> {
        +
        389 using argument_type = int16_t;
        +
        390 using result_type = uint16_t;
        +
        391 using type = uint16_t;
        +
        392 type operator()(int16_t val) const {
        +
        393 return static_cast<uint16_t>(static_cast<uint32_t>(val) + 32768u);
        +
        394 }
        +
        395};
        +
        396
        +
        397template <> struct channel_convert_to_unsigned<int32_t> {
        +
        398 using argument_type = int32_t;
        +
        399 using result_type = uint32_t;
        +
        400 using type = uint32_t;
        +
        401 type operator()(int32_t val) const {
        +
        402 return static_cast<uint32_t>(val)+(1u<<31);
        +
        403 }
        +
        404};
        +
        405
        +
        406
        +
        407// Converting from unsigned to signed integral channel
        +
        408// It is both a unary function, and a metafunction (thus requires the 'type' nested alias, which equals result_type)
        +
        409template <typename ChannelValue> // Model ChannelValueConcept
        +
        410struct channel_convert_from_unsigned : public detail::identity<ChannelValue> {
        +
        411 using type = ChannelValue;
        +
        412};
        +
        413
        +
        414template <> struct channel_convert_from_unsigned<int8_t> {
        +
        415 using argument_type = uint8_t;
        +
        416 using result_type = int8_t;
        +
        417 using type = int8_t;
        +
        418 type operator()(uint8_t val) const {
        +
        419 return static_cast<int8_t>(static_cast<int32_t>(val) - 128);
        +
        420 }
        +
        421};
        +
        422
        +
        423template <> struct channel_convert_from_unsigned<int16_t> {
        +
        424 using argument_type = uint16_t;
        +
        425 using result_type = int16_t;
        +
        426 using type = int16_t;
        +
        427 type operator()(uint16_t val) const {
        +
        428 return static_cast<int16_t>(static_cast<int32_t>(val) - 32768);
        +
        429 }
        +
        430};
        +
        431
        +
        432template <> struct channel_convert_from_unsigned<int32_t> {
        +
        433 using argument_type = uint32_t;
        +
        434 using result_type = int32_t;
        +
        435 using type = int32_t;
        +
        436 type operator()(uint32_t val) const {
        +
        437 return static_cast<int32_t>(val - (1u<<31));
        +
        438 }
        +
        439};
        +
        440
        +
        441} // namespace detail
        +
        442
        +
        445template <typename SrcChannelV, typename DstChannelV> // Model ChannelValueConcept
        +
        + +
        447 using argument_type = SrcChannelV;
        +
        448 using result_type = DstChannelV;
        +
        449 auto operator()(SrcChannelV const& src) const -> DstChannelV
        +
        450 {
        +
        451 using to_unsigned = detail::channel_convert_to_unsigned<SrcChannelV>;
        +
        452 using from_unsigned = detail::channel_convert_from_unsigned<DstChannelV>;
        +
        453 using converter_unsigned = channel_converter_unsigned<typename to_unsigned::result_type, typename from_unsigned::argument_type>;
        +
        454 return from_unsigned()(converter_unsigned()(to_unsigned()(src)));
        +
        455 }
        +
        456};
        +
        +
        457
        +
        460template <typename DstChannel, typename SrcChannel> // Model ChannelConcept (could be channel references)
        +
        +
        461inline auto channel_convert(SrcChannel const& src) -> typename channel_traits<DstChannel>::value_type
        +
        462{
        + +
        464 typename channel_traits<DstChannel>::value_type>()(src);
        +
        465}
        +
        +
        466
        +
        + +
        472 template <typename Ch1, typename Ch2>
        +
        473 void operator()(Ch1 const& src, Ch2& dst) const
        +
        474 {
        +
        475 dst=channel_convert<Ch2>(src);
        +
        476 }
        +
        477};
        +
        +
        478
        +
        479namespace detail
        +
        480{
        +
        481 // fast integer division by 255
        +
        482 inline auto div255(uint32_t in) -> uint32_t
        +
        483 {
        +
        484 uint32_t tmp = in + 128;
        +
        485 return (tmp + (tmp >> 8)) >> 8;
        +
        486 }
        +
        487
        +
        488 // fast integer division by 32768
        +
        489 inline auto div32768(uint32_t in) -> uint32_t
        +
        490 {
        +
        491 return (in + 16384) >> 15;
        +
        492 }
        +
        493}
        +
        494
        +
        507
        +
        509template <typename ChannelValue>
        +
        + +
        511 using first_argument_type = ChannelValue;
        +
        512 using second_argument_type = ChannelValue;
        +
        513 using result_type = ChannelValue;
        +
        514 auto operator()(ChannelValue a, ChannelValue b) const -> ChannelValue
        +
        515 {
        +
        516 return ChannelValue(static_cast<typename base_channel_type<ChannelValue>::type>(a / double(channel_traits<ChannelValue>::max_value()) * b));
        +
        517 }
        +
        518};
        +
        +
        519
        +
        +
        521template<> struct channel_multiplier_unsigned<uint8_t> {
        +
        522 using first_argument_type = uint8_t;
        +
        523 using second_argument_type = uint8_t;
        +
        524 using result_type = uint8_t;
        +
        525 auto operator()(uint8_t a, uint8_t b) const -> uint8_t { return uint8_t(detail::div255(uint32_t(a) * uint32_t(b))); }
        +
        526};
        +
        +
        527
        +
        +
        529template<> struct channel_multiplier_unsigned<uint16_t> {
        +
        530 using first_argument_type = uint16_t;
        +
        531 using second_argument_type = uint16_t;
        +
        532 using result_type = uint16_t;
        +
        533 auto operator()(uint16_t a, uint16_t b) const -> uint16_t { return uint16_t((uint32_t(a) * uint32_t(b))/65535); }
        +
        534};
        +
        +
        535
        +
        + +
        538 using first_argument_type = float32_t;
        +
        539 using second_argument_type = float32_t;
        +
        540 using result_type = float32_t;
        +
        541 auto operator()(float32_t a, float32_t b) const -> float32_t { return a*b; }
        +
        542};
        +
        +
        543
        +
        545template <typename ChannelValue>
        +
        + +
        547 using first_argument_type = ChannelValue;
        +
        548 using second_argument_type = ChannelValue;
        +
        549 using result_type = ChannelValue;
        +
        550 auto operator()(ChannelValue a, ChannelValue b) const -> ChannelValue
        +
        551 {
        +
        552 using to_unsigned = detail::channel_convert_to_unsigned<ChannelValue>;
        +
        553 using from_unsigned = detail::channel_convert_from_unsigned<ChannelValue>;
        + +
        555 return from_unsigned()(multiplier_unsigned()(to_unsigned()(a), to_unsigned()(b)));
        +
        556 }
        +
        557};
        +
        +
        558
        +
        560template <typename Channel> // Models ChannelConcept (could be a channel reference)
        +
        +
        561inline auto channel_multiply(Channel a, Channel b) -> typename channel_traits<Channel>::value_type
        +
        562{
        + +
        564}
        +
        +
        566
        +
        578
        +
        581template <typename Channel> // Models ChannelConcept (could be a channel reference)
        +
        +
        582inline auto channel_invert(Channel x) -> typename channel_traits<Channel>::value_type
        +
        583{
        +
        584 using base_t = typename base_channel_type<Channel>::type;
        +
        585 using promoted_t = typename promote_integral<base_t>::type;
        +
        586 promoted_t const promoted_x = x;
        +
        587 promoted_t const promoted_max = channel_traits<Channel>::max_value();
        +
        588 promoted_t const promoted_min = channel_traits<Channel>::min_value();
        +
        589 promoted_t const promoted_inverted_x = promoted_max - promoted_x + promoted_min;
        +
        590 auto const inverted_x = static_cast<base_t>(promoted_inverted_x);
        +
        591 return inverted_x;
        +
        592}
        +
        +
        593
        +
        594}} // namespace boost::gil
        +
        595
        +
        596#endif
        +
        auto channel_convert(SrcChannel const &src) -> typename channel_traits< DstChannel >::value_type
        Converting from one channel type to another.
        Definition channel_algorithm.hpp:461
        +
        auto channel_invert(Channel x) -> typename channel_traits< Channel >::value_type
        Default implementation. Provide overloads for performance.
        Definition channel_algorithm.hpp:582
        +
        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
        +
        auto channel_multiply(Channel a, Channel b) -> typename channel_traits< Channel >::value_type
        A function multiplying two channels. result = a * b / max_value.
        Definition channel_algorithm.hpp:561
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        A unary function object converting between channel types.
        Definition channel_algorithm.hpp:446
        +
        This is the default implementation. Performance specializatons are provided.
        Definition channel_algorithm.hpp:510
        +
        A function object to multiply two channels. result = a * b / max_value.
        Definition channel_algorithm.hpp:546
        +
        Same as channel_converter, except it takes the destination channel by reference, which allows us to m...
        Definition channel_algorithm.hpp:471
        +
        identity taken from SGI STL.
        Definition utilities.hpp:211
        diff --git a/html/reference/channel__numeric__operations_8hpp_source.html b/html/reference/channel__numeric__operations_8hpp_source.html index 2a7d347a1..639fba5e4 100644 --- a/html/reference/channel__numeric__operations_8hpp_source.html +++ b/html/reference/channel__numeric__operations_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_numeric_operations.hpp Source File @@ -27,257 +27,300 @@

        - + +/* @license-end */ + +
        -
        -
        channel_numeric_operations.hpp
        +
        channel_numeric_operations.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_CHANNEL_NUMERIC_OPERATIONS_HPP
        -
        10 #define BOOST_GIL_CHANNEL_NUMERIC_OPERATIONS_HPP
        -
        11 
        -
        12 #include <boost/gil/channel.hpp>
        -
        13 
        -
        14 namespace boost { namespace gil {
        -
        15 
        -
        16 // Function objects and utilities for channel-wise numeric operations.
        -
        17 //
        -
        18 // List of currently defined functors:
        -
        19 // channel_plus_t (+)
        -
        20 // channel_minus_t (-)
        -
        21 // channel_multiplies_t (*)
        -
        22 // channel_divides_t (/),
        -
        23 // channel_plus_scalar_t (+s)
        -
        24 // channel_minus_scalar_t (-s),
        -
        25 // channel_multiplies_scalar_t (*s)
        -
        26 // channel_divides_scalar_t (/s),
        -
        27 // channel_halves_t (/=2)
        -
        28 // channel_zeros_t (=0)
        -
        29 // channel_assigns_t (=)
        -
        30 
        -
        34 template <typename Channel1, typename Channel2, typename ChannelResult>
        - -
        36 {
        -
        37  using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        -
        38  using ChannelRef2 = typename channel_traits<Channel2>::const_reference;
        -
        39  static_assert(std::is_convertible<ChannelRef1, ChannelResult>::value,
        -
        40  "ChannelRef1 not convertible to ChannelResult");
        -
        41  static_assert(std::is_convertible<ChannelRef2, ChannelResult>::value,
        -
        42  "ChannelRef2 not convertible to ChannelResult");
        -
        43 
        -
        46  auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        -
        47  {
        -
        48  return ChannelResult(ch1) + ChannelResult(ch2);
        -
        49  }
        -
        50 };
        -
        51 
        -
        55 template <typename Channel1, typename Channel2, typename ChannelResult>
        - -
        57 {
        -
        58  using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        -
        59  using ChannelRef2 = typename channel_traits<Channel2>::const_reference;
        -
        60  static_assert(std::is_convertible<ChannelRef1, ChannelResult>::value,
        -
        61  "ChannelRef1 not convertible to ChannelResult");
        -
        62  static_assert(std::is_convertible<ChannelRef2, ChannelResult>::value,
        -
        63  "ChannelRef2 not convertible to ChannelResult");
        -
        64 
        -
        67  auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        -
        68  {
        -
        69  return ChannelResult(ch1) - ChannelResult(ch2);
        -
        70  }
        -
        71 };
        -
        72 
        -
        76 template <typename Channel1, typename Channel2, typename ChannelResult>
        - -
        78 {
        -
        79  using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        -
        80  using ChannelRef2 = typename channel_traits<Channel2>::const_reference;
        -
        81  static_assert(std::is_convertible<ChannelRef1, ChannelResult>::value,
        -
        82  "ChannelRef1 not convertible to ChannelResult");
        -
        83  static_assert(std::is_convertible<ChannelRef2, ChannelResult>::value,
        -
        84  "ChannelRef2 not convertible to ChannelResult");
        -
        85 
        -
        88  auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        -
        89  {
        -
        90  return ChannelResult(ch1) * ChannelResult(ch2);
        -
        91  }
        -
        92 };
        -
        93 
        -
        97 template <typename Channel1, typename Channel2, typename ChannelResult>
        - -
        99 {
        -
        100  using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        -
        101  using ChannelRef2 = typename channel_traits<Channel2>::const_reference;
        -
        102  static_assert(std::is_convertible<ChannelRef1, ChannelResult>::value,
        -
        103  "ChannelRef1 not convertible to ChannelResult");
        -
        104  static_assert(std::is_convertible<ChannelRef2, ChannelResult>::value,
        -
        105  "ChannelRef2 not convertible to ChannelResult");
        -
        106 
        -
        109  auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        -
        110  {
        -
        111  return ChannelResult(ch1) / ChannelResult(ch2);
        -
        112  }
        -
        113 };
        -
        114 
        -
        118 template <typename Channel, typename Scalar, typename ChannelResult>
        - -
        120 {
        -
        121  using ChannelRef = typename channel_traits<Channel>::const_reference;
        -
        122  static_assert(std::is_convertible<ChannelRef, ChannelResult>::value,
        -
        123  "ChannelRef not convertible to ChannelResult");
        -
        124  static_assert(std::is_scalar<Scalar>::value, "Scalar not a scalar");
        -
        125  static_assert(std::is_convertible<Scalar, ChannelResult>::value,
        -
        126  "Scalar not convertible to ChannelResult");
        -
        127 
        -
        128  auto operator()(ChannelRef channel, Scalar const& scalar) const -> ChannelResult
        -
        129  {
        -
        130  return ChannelResult(channel) + ChannelResult(scalar);
        -
        131  }
        -
        132 };
        -
        133 
        -
        137 template <typename Channel, typename Scalar, typename ChannelResult>
        - -
        139 {
        -
        140  using ChannelRef = typename channel_traits<Channel>::const_reference;
        -
        141  static_assert(std::is_convertible<ChannelRef, ChannelResult>::value,
        -
        142  "ChannelRef not convertible to ChannelResult");
        -
        143  static_assert(std::is_scalar<Scalar>::value, "Scalar not a scalar");
        -
        144  static_assert(std::is_convertible<Scalar, ChannelResult>::value,
        -
        145  "Scalar not convertible to ChannelResult");
        -
        146 
        -
        149  auto operator()(ChannelRef channel, Scalar const& scalar) const -> ChannelResult
        -
        150  {
        -
        151  // TODO: Convertion after subtraction vs conversion of operands in channel_minus_t?
        -
        152  return ChannelResult(channel - scalar);
        -
        153  }
        -
        154 };
        -
        155 
        -
        159 template <typename Channel, typename Scalar, typename ChannelResult>
        - -
        161 {
        -
        162  using ChannelRef = typename channel_traits<Channel>::const_reference;
        -
        163  static_assert(std::is_convertible<ChannelRef, ChannelResult>::value,
        -
        164  "ChannelRef not convertible to ChannelResult");
        -
        165  static_assert(std::is_scalar<Scalar>::value, "Scalar not a scalar");
        -
        166  static_assert(std::is_convertible<Scalar, ChannelResult>::value,
        -
        167  "Scalar not convertible to ChannelResult");
        -
        168 
        -
        171  auto operator()(ChannelRef channel, Scalar const& scalar) const -> ChannelResult
        -
        172  {
        -
        173  return ChannelResult(channel) * ChannelResult(scalar);
        -
        174  }
        -
        175 };
        -
        176 
        -
        180 template <typename Channel, typename Scalar, typename ChannelResult>
        - -
        182 {
        -
        183  using ChannelRef = typename channel_traits<Channel>::const_reference;
        -
        184  static_assert(std::is_convertible<ChannelRef, ChannelResult>::value,
        -
        185  "ChannelRef not convertible to ChannelResult");
        -
        186  static_assert(std::is_scalar<Scalar>::value, "Scalar not a scalar");
        -
        187  static_assert(std::is_convertible<Scalar, ChannelResult>::value,
        -
        188  "Scalar not convertible to ChannelResult");
        -
        189 
        -
        192  auto operator()(ChannelRef channel, Scalar const& scalar) const -> ChannelResult
        -
        193  {
        -
        194  return ChannelResult(channel) / ChannelResult(scalar);
        -
        195  }
        -
        196 };
        -
        197 
        -
        201 template <typename Channel>
        - -
        203 {
        -
        204  using ChannelRef = typename channel_traits<Channel>::reference;
        -
        205 
        -
        206  auto operator()(ChannelRef channel) const -> ChannelRef
        -
        207  {
        -
        208  // TODO: Split into steps: extract with explicit conversion to double, divide and assign?
        -
        209  //double const v = ch;
        -
        210  //ch = static_cast<Channel>(v / 2.0);
        -
        211  channel /= 2.0;
        -
        212  return channel;
        -
        213  }
        -
        214 };
        -
        215 
        -
        219 template <typename Channel>
        - -
        221 {
        -
        222  using ChannelRef = typename channel_traits<Channel>::reference;
        -
        223 
        -
        224  auto operator()(ChannelRef channel) const -> ChannelRef
        -
        225  {
        -
        226  channel = Channel(0);
        -
        227  return channel;
        -
        228  }
        -
        229 };
        -
        230 
        -
        234 template <typename Channel1, typename Channel2>
        - -
        236 {
        -
        237  using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        -
        238  using ChannelRef2 = typename channel_traits<Channel2>::reference;
        -
        239  static_assert(std::is_convertible<ChannelRef1, Channel2>::value,
        -
        240  "ChannelRef1 not convertible to Channel2");
        -
        241 
        -
        244  auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelRef2
        -
        245  {
        -
        246  ch2 = Channel2(ch1);
        -
        247  return ch2;
        -
        248  }
        -
        249 };
        -
        250 
        -
        251 }} // namespace boost::gil
        -
        252 
        -
        253 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: channel_numeric_operations.hpp:236
        -
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelRef2
        Definition: channel_numeric_operations.hpp:244
        -
        Arithmetic operation of dividing channel value by scalar.
        Definition: channel_numeric_operations.hpp:182
        -
        auto operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResult
        Definition: channel_numeric_operations.hpp:192
        -
        Arithmetic operation of division of two channel values.
        Definition: channel_numeric_operations.hpp:99
        -
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        Definition: channel_numeric_operations.hpp:109
        -
        Arithmetic operation of dividing channel value by 2.
        Definition: channel_numeric_operations.hpp:203
        -
        Arithmetic operation of subtracting scalar from channel value.
        Definition: channel_numeric_operations.hpp:139
        -
        auto operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResult
        Definition: channel_numeric_operations.hpp:149
        -
        Arithmetic operation of subtraction of two channel values.
        Definition: channel_numeric_operations.hpp:57
        -
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        Definition: channel_numeric_operations.hpp:67
        -
        Arithmetic operation of channel value by a scalar.
        Definition: channel_numeric_operations.hpp:161
        -
        auto operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResult
        Definition: channel_numeric_operations.hpp:171
        -
        Arithmetic operation of multiplication of two channel values.
        Definition: channel_numeric_operations.hpp:78
        -
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        Definition: channel_numeric_operations.hpp:88
        -
        Arithmetic operation of adding scalar to channel value.
        Definition: channel_numeric_operations.hpp:120
        -
        Arithmetic operation of addition of two channel values.
        Definition: channel_numeric_operations.hpp:36
        -
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        Definition: channel_numeric_operations.hpp:46
        -
        Operation of setting channel value to zero.
        Definition: channel_numeric_operations.hpp:221
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_CHANNEL_NUMERIC_OPERATIONS_HPP
        +
        10#define BOOST_GIL_CHANNEL_NUMERIC_OPERATIONS_HPP
        +
        11
        +
        12#include <boost/gil/channel.hpp>
        +
        13
        +
        14namespace boost { namespace gil {
        +
        15
        +
        16// Function objects and utilities for channel-wise numeric operations.
        +
        17//
        +
        18// List of currently defined functors:
        +
        19// channel_plus_t (+)
        +
        20// channel_minus_t (-)
        +
        21// channel_multiplies_t (*)
        +
        22// channel_divides_t (/),
        +
        23// channel_plus_scalar_t (+s)
        +
        24// channel_minus_scalar_t (-s),
        +
        25// channel_multiplies_scalar_t (*s)
        +
        26// channel_divides_scalar_t (/s),
        +
        27// channel_halves_t (/=2)
        +
        28// channel_zeros_t (=0)
        +
        29// channel_assigns_t (=)
        +
        30
        +
        34template <typename Channel1, typename Channel2, typename ChannelResult>
        +
        + +
        36{
        +
        37 using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        +
        38 using ChannelRef2 = typename channel_traits<Channel2>::const_reference;
        +
        39 static_assert(std::is_convertible<ChannelRef1, ChannelResult>::value,
        +
        40 "ChannelRef1 not convertible to ChannelResult");
        +
        41 static_assert(std::is_convertible<ChannelRef2, ChannelResult>::value,
        +
        42 "ChannelRef2 not convertible to ChannelResult");
        +
        43
        +
        +
        46 auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        +
        47 {
        +
        48 return ChannelResult(ch1) + ChannelResult(ch2);
        +
        49 }
        +
        +
        50};
        +
        +
        51
        +
        55template <typename Channel1, typename Channel2, typename ChannelResult>
        +
        + +
        57{
        +
        58 using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        +
        59 using ChannelRef2 = typename channel_traits<Channel2>::const_reference;
        +
        60 static_assert(std::is_convertible<ChannelRef1, ChannelResult>::value,
        +
        61 "ChannelRef1 not convertible to ChannelResult");
        +
        62 static_assert(std::is_convertible<ChannelRef2, ChannelResult>::value,
        +
        63 "ChannelRef2 not convertible to ChannelResult");
        +
        64
        +
        +
        67 auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        +
        68 {
        +
        69 return ChannelResult(ch1) - ChannelResult(ch2);
        +
        70 }
        +
        +
        71};
        +
        +
        72
        +
        76template <typename Channel1, typename Channel2, typename ChannelResult>
        +
        + +
        78{
        +
        79 using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        +
        80 using ChannelRef2 = typename channel_traits<Channel2>::const_reference;
        +
        81 static_assert(std::is_convertible<ChannelRef1, ChannelResult>::value,
        +
        82 "ChannelRef1 not convertible to ChannelResult");
        +
        83 static_assert(std::is_convertible<ChannelRef2, ChannelResult>::value,
        +
        84 "ChannelRef2 not convertible to ChannelResult");
        +
        85
        +
        +
        88 auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        +
        89 {
        +
        90 return ChannelResult(ch1) * ChannelResult(ch2);
        +
        91 }
        +
        +
        92};
        +
        +
        93
        +
        97template <typename Channel1, typename Channel2, typename ChannelResult>
        +
        + +
        99{
        +
        100 using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        +
        101 using ChannelRef2 = typename channel_traits<Channel2>::const_reference;
        +
        102 static_assert(std::is_convertible<ChannelRef1, ChannelResult>::value,
        +
        103 "ChannelRef1 not convertible to ChannelResult");
        +
        104 static_assert(std::is_convertible<ChannelRef2, ChannelResult>::value,
        +
        105 "ChannelRef2 not convertible to ChannelResult");
        +
        106
        +
        +
        109 auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        +
        110 {
        +
        111 return ChannelResult(ch1) / ChannelResult(ch2);
        +
        112 }
        +
        +
        113};
        +
        +
        114
        +
        118template <typename Channel, typename Scalar, typename ChannelResult>
        +
        + +
        120{
        +
        121 using ChannelRef = typename channel_traits<Channel>::const_reference;
        +
        122 static_assert(std::is_convertible<ChannelRef, ChannelResult>::value,
        +
        123 "ChannelRef not convertible to ChannelResult");
        +
        124 static_assert(std::is_scalar<Scalar>::value, "Scalar not a scalar");
        +
        125 static_assert(std::is_convertible<Scalar, ChannelResult>::value,
        +
        126 "Scalar not convertible to ChannelResult");
        +
        127
        +
        128 auto operator()(ChannelRef channel, Scalar const& scalar) const -> ChannelResult
        +
        129 {
        +
        130 return ChannelResult(channel) + ChannelResult(scalar);
        +
        131 }
        +
        132};
        +
        +
        133
        +
        137template <typename Channel, typename Scalar, typename ChannelResult>
        +
        + +
        139{
        +
        140 using ChannelRef = typename channel_traits<Channel>::const_reference;
        +
        141 static_assert(std::is_convertible<ChannelRef, ChannelResult>::value,
        +
        142 "ChannelRef not convertible to ChannelResult");
        +
        143 static_assert(std::is_scalar<Scalar>::value, "Scalar not a scalar");
        +
        144 static_assert(std::is_convertible<Scalar, ChannelResult>::value,
        +
        145 "Scalar not convertible to ChannelResult");
        +
        146
        +
        +
        149 auto operator()(ChannelRef channel, Scalar const& scalar) const -> ChannelResult
        +
        150 {
        +
        151 // TODO: Conversion after subtraction vs conversion of operands in channel_minus_t?
        +
        152 return ChannelResult(channel - scalar);
        +
        153 }
        +
        +
        154};
        +
        +
        155
        +
        159template <typename Channel, typename Scalar, typename ChannelResult>
        +
        + +
        161{
        +
        162 using ChannelRef = typename channel_traits<Channel>::const_reference;
        +
        163 static_assert(std::is_convertible<ChannelRef, ChannelResult>::value,
        +
        164 "ChannelRef not convertible to ChannelResult");
        +
        165 static_assert(std::is_scalar<Scalar>::value, "Scalar not a scalar");
        +
        166 static_assert(std::is_convertible<Scalar, ChannelResult>::value,
        +
        167 "Scalar not convertible to ChannelResult");
        +
        168
        +
        +
        171 auto operator()(ChannelRef channel, Scalar const& scalar) const -> ChannelResult
        +
        172 {
        +
        173 return ChannelResult(channel) * ChannelResult(scalar);
        +
        174 }
        +
        +
        175};
        +
        +
        176
        +
        180template <typename Channel, typename Scalar, typename ChannelResult>
        +
        + +
        182{
        +
        183 using ChannelRef = typename channel_traits<Channel>::const_reference;
        +
        184 static_assert(std::is_convertible<ChannelRef, ChannelResult>::value,
        +
        185 "ChannelRef not convertible to ChannelResult");
        +
        186 static_assert(std::is_scalar<Scalar>::value, "Scalar not a scalar");
        +
        187 static_assert(std::is_convertible<Scalar, ChannelResult>::value,
        +
        188 "Scalar not convertible to ChannelResult");
        +
        189
        +
        +
        192 auto operator()(ChannelRef channel, Scalar const& scalar) const -> ChannelResult
        +
        193 {
        +
        194 return ChannelResult(channel) / ChannelResult(scalar);
        +
        195 }
        +
        +
        196};
        +
        +
        197
        +
        201template <typename Channel>
        +
        + +
        203{
        +
        204 using ChannelRef = typename channel_traits<Channel>::reference;
        +
        205
        +
        206 auto operator()(ChannelRef channel) const -> ChannelRef
        +
        207 {
        +
        208 // TODO: Split into steps: extract with explicit conversion to double, divide and assign?
        +
        209 //double const v = ch;
        +
        210 //ch = static_cast<Channel>(v / 2.0);
        +
        211 channel /= 2.0;
        +
        212 return channel;
        +
        213 }
        +
        214};
        +
        +
        215
        +
        219template <typename Channel>
        +
        + +
        221{
        +
        222 using ChannelRef = typename channel_traits<Channel>::reference;
        +
        223
        +
        224 auto operator()(ChannelRef channel) const -> ChannelRef
        +
        225 {
        +
        226 channel = Channel(0);
        +
        227 return channel;
        +
        228 }
        +
        229};
        +
        +
        230
        +
        234template <typename Channel1, typename Channel2>
        +
        + +
        236{
        +
        237 using ChannelRef1 = typename channel_traits<Channel1>::const_reference;
        +
        238 using ChannelRef2 = typename channel_traits<Channel2>::reference;
        +
        239 static_assert(std::is_convertible<ChannelRef1, Channel2>::value,
        +
        240 "ChannelRef1 not convertible to Channel2");
        +
        241
        +
        +
        244 auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelRef2
        +
        245 {
        +
        246 ch2 = Channel2(ch1);
        +
        247 return ch2;
        +
        248 }
        +
        +
        249};
        +
        +
        250
        +
        251}} // namespace boost::gil
        +
        252
        +
        253#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition channel_numeric_operations.hpp:236
        +
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelRef2
        Definition channel_numeric_operations.hpp:244
        +
        Arithmetic operation of dividing channel value by scalar.
        Definition channel_numeric_operations.hpp:182
        +
        auto operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResult
        Definition channel_numeric_operations.hpp:192
        +
        Arithmetic operation of division of two channel values.
        Definition channel_numeric_operations.hpp:99
        +
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        Definition channel_numeric_operations.hpp:109
        +
        Arithmetic operation of dividing channel value by 2.
        Definition channel_numeric_operations.hpp:203
        +
        Arithmetic operation of subtracting scalar from channel value.
        Definition channel_numeric_operations.hpp:139
        +
        auto operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResult
        Definition channel_numeric_operations.hpp:149
        +
        Arithmetic operation of subtraction of two channel values.
        Definition channel_numeric_operations.hpp:57
        +
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        Definition channel_numeric_operations.hpp:67
        +
        Arithmetic operation of channel value by a scalar.
        Definition channel_numeric_operations.hpp:161
        +
        auto operator()(ChannelRef channel, Scalar const &scalar) const -> ChannelResult
        Definition channel_numeric_operations.hpp:171
        +
        Arithmetic operation of multiplication of two channel values.
        Definition channel_numeric_operations.hpp:78
        +
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        Definition channel_numeric_operations.hpp:88
        +
        Arithmetic operation of adding scalar to channel value.
        Definition channel_numeric_operations.hpp:120
        +
        Arithmetic operation of addition of two channel values.
        Definition channel_numeric_operations.hpp:36
        +
        auto operator()(ChannelRef1 ch1, ChannelRef2 ch2) const -> ChannelResult
        Definition channel_numeric_operations.hpp:46
        +
        Operation of setting channel value to zero.
        Definition channel_numeric_operations.hpp:221
        diff --git a/html/reference/classboost_1_1gil_1_1any__image-members.html b/html/reference/classboost_1_1gil_1_1any__image-members.html index a9e6c1309..92bc48c8a 100644 --- a/html/reference/classboost_1_1gil_1_1any__image-members.html +++ b/html/reference/classboost_1_1gil_1_1any__image-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        any_image< Images > Member List
        +
        any_image< Images > Member List

        This is the complete list of members for any_image< Images >, including all inherited members.

        - + - + - + - + - + - + - +
        const_view_t typedef (defined in any_image< Images >)any_image< Images >
        dimensions() const (defined in any_image< Images >)any_image< Images >inline
        dimensions() const (defined in any_image< Images >)any_image< Images >inline
        height() const (defined in any_image< Images >)any_image< Images >inline
        num_channels() const (defined in any_image< Images >)any_image< Images >inline
        num_channels() const (defined in any_image< Images >)any_image< Images >inline
        operator=(any_image const &img) (defined in any_image< Images >)any_image< Images >inline
        operator=(Image const &img) (defined in any_image< Images >)any_image< Images >inline
        operator=(Image const &img) (defined in any_image< Images >)any_image< Images >inline
        operator=(any_image< OtherImages... > const &img) (defined in any_image< Images >)any_image< Images >inline
        point_t typedef (defined in any_image< Images >)any_image< Images >
        point_t typedef (defined in any_image< Images >)any_image< Images >
        recreate(point_t const &dims, unsigned alignment=1) (defined in any_image< Images >)any_image< Images >inline
        recreate(x_coord_t width, y_coord_t height, unsigned alignment=1) (defined in any_image< Images >)any_image< Images >inline
        recreate(x_coord_t width, y_coord_t height, unsigned alignment=1) (defined in any_image< Images >)any_image< Images >inline
        view_t typedef (defined in any_image< Images >)any_image< Images >
        width() const (defined in any_image< Images >)any_image< Images >inline
        width() const (defined in any_image< Images >)any_image< Images >inline
        x_coord_t typedef (defined in any_image< Images >)any_image< Images >
        y_coord_t typedef (defined in any_image< Images >)any_image< Images >
        y_coord_t typedef (defined in any_image< Images >)any_image< Images >
        diff --git a/html/reference/classboost_1_1gil_1_1any__image.html b/html/reference/classboost_1_1gil_1_1any__image.html index f57d583a8..8ed601ffe 100644 --- a/html/reference/classboost_1_1gil_1_1any__image.html +++ b/html/reference/classboost_1_1gil_1_1any__image.html @@ -4,7 +4,7 @@ - + Generic Image Library: any_image< Images > Class Template Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ + -
        -
        any_image< Images > Class Template Reference
        +
        any_image< Images > Class Template Reference
        @@ -59,61 +59,59 @@ $(function() {

        Inherits variant< Images... >.

        - - - - - -

        +

        Public Types

        +
        using view_t = mp11::mp_rename< detail::images_get_views_t< any_image >, any_image_view >
         
        +
        using const_view_t = mp11::mp_rename< detail::images_get_const_views_t< any_image >, any_image_view >
         
        +
        using x_coord_t = std::ptrdiff_t
         
        +
        using y_coord_t = std::ptrdiff_t
         
        +
        using point_t = point< std::ptrdiff_t >
         
        - - - - + - - - + + - - - + + - - - - -

        +

        Public Member Functions

        +
        any_imageoperator= (any_image const &img)
         
        +
         
        template<typename Image >
        any_imageoperator= (Image const &img)
         
        +
        any_imageoperator= (Image const &img)
         
        template<typename ... OtherImages>
        any_imageoperator= (any_image< OtherImages... > const &img)
         
        +
        any_imageoperator= (any_image< OtherImages... > const &img)
         
        void recreate (point_t const &dims, unsigned alignment=1)
         
        +
        void recreate (x_coord_t width, y_coord_t height, unsigned alignment=1)
         
        +
        std::size_t num_channels () const
         
        +
        point_t dimensions () const
         
        +
        x_coord_t width () const
         
        +
        y_coord_t height () const
         

        Detailed Description

        -

        template<typename ... Images>
        -class boost::gil::any_image< Images >

        - -

        Represents a run-time specified image. Note it does NOT model ImageConcept.

        +
        template<typename ... Images>
        +class boost::gil::any_image< Images >

        Represents a run-time specified image. Note it does NOT model ImageConcept.

        Represents an image whose type (color space, layout, planar/interleaved organization, etc) can be specified at run time. It is the runtime equivalent of image. Some of the requirements of ImageConcept, such as the value_type alias cannot be fulfilled, since the language does not allow runtime type specification. Other requirements, such as access to the pixels, would be inefficient to provide. Thus any_image does not fully model ImageConcept. In particular, its view and const_view methods return any_image_view, which does not fully model ImageViewConcept. See any_image_view for more.


        The documentation for this class was generated from the following file:
        • any_image.hpp
        • @@ -124,7 +122,7 @@ class boost::gil::any_image< Images > diff --git a/html/reference/classboost_1_1gil_1_1any__image__view-members.html b/html/reference/classboost_1_1gil_1_1any__image__view-members.html index 42d266fa6..c8d9fd576 100644 --- a/html/reference/classboost_1_1gil_1_1any__image__view-members.html +++ b/html/reference/classboost_1_1gil_1_1any__image__view-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        any_image_view< Views > Member List
        +
        any_image_view< Views > Member List

        This is the complete list of members for any_image_view< Views >, including all inherited members.

        - + - + - + - + - + - +
        const_t typedef (defined in any_image_view< Views >)any_image_view< Views >
        dimensions() const (defined in any_image_view< Views >)any_image_view< Views >inline
        dimensions() const (defined in any_image_view< Views >)any_image_view< Views >inline
        height() const (defined in any_image_view< Views >)any_image_view< Views >inline
        num_channels() const (defined in any_image_view< Views >)any_image_view< Views >inline
        num_channels() const (defined in any_image_view< Views >)any_image_view< Views >inline
        operator=(any_image_view const &view) (defined in any_image_view< Views >)any_image_view< Views >inline
        operator=(View const &view) (defined in any_image_view< Views >)any_image_view< Views >inline
        operator=(View const &view) (defined in any_image_view< Views >)any_image_view< Views >inline
        operator=(any_image_view< OtherViews... > const &view) (defined in any_image_view< Views >)any_image_view< Views >inline
        point_t typedef (defined in any_image_view< Views >)any_image_view< Views >
        point_t typedef (defined in any_image_view< Views >)any_image_view< Views >
        size() const (defined in any_image_view< Views >)any_image_view< Views >inline
        size_type typedef (defined in any_image_view< Views >)any_image_view< Views >
        size_type typedef (defined in any_image_view< Views >)any_image_view< Views >
        width() const (defined in any_image_view< Views >)any_image_view< Views >inline
        x_coord_t typedef (defined in any_image_view< Views >)any_image_view< Views >
        x_coord_t typedef (defined in any_image_view< Views >)any_image_view< Views >
        y_coord_t typedef (defined in any_image_view< Views >)any_image_view< Views >
        @@ -69,7 +69,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1any__image__view.html b/html/reference/classboost_1_1gil_1_1any__image__view.html index 05a3828a3..0d9748daa 100644 --- a/html/reference/classboost_1_1gil_1_1any__image__view.html +++ b/html/reference/classboost_1_1gil_1_1any__image__view.html @@ -4,7 +4,7 @@ - + Generic Image Library: any_image_view< Views > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        any_image_view< Views > Class Template Reference
        +
        any_image_view< Views > Class Template Reference
        @@ -59,58 +59,56 @@ $(function() {

        Inherits variant< Views... >.

        - - - - - -

        +

        Public Types

        +
        using const_t = detail::views_get_const_t< any_image_view >
         
        +
        using x_coord_t = std::ptrdiff_t
         
        +
        using y_coord_t = std::ptrdiff_t
         
        +
        using point_t = point< std::ptrdiff_t >
         
        +
        using size_type = std::size_t
         
        - - - - + + - - - + + - - - + + - - - -

        +

        Public Member Functions

        -any_image_viewoperator= (any_image_view const &view)
         
        +
        +any_image_viewoperator= (any_image_view const &view)
         
        template<typename View >
        any_image_viewoperator= (View const &view)
         
        +
        any_image_viewoperator= (View const &view)
         
        template<typename ... OtherViews>
        any_image_viewoperator= (any_image_view< OtherViews... > const &view)
         
        +
        any_image_viewoperator= (any_image_view< OtherViews... > const &view)
         
        std::size_t num_channels () const
         
        +
        point_t dimensions () const
         
        +
        size_type size () const
         
        +
        x_coord_t width () const
         
        +
        y_coord_t height () const
         

        Detailed Description

        -

        template<typename ... Views>
        -class boost::gil::any_image_view< Views >

        - -

        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, Note that this class does NOT model ImageViewConcept.

        +
        template<typename ... Views>
        +class boost::gil::any_image_view< Views >

        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, Note that this class does NOT model ImageViewConcept.

        CLASS any_image_view

        Represents a view whose type (color space, layout, planar/interleaved organization, etc) can be specified at run time. It is the runtime equivalent of image_view. Some of the requirements of ImageViewConcept, such as the value_type alias cannot be fulfilled, since the language does not allow runtime type specification. Other requirements, such as access to the pixels, would be inefficient to provide. Thus any_image_view does not fully model ImageViewConcept. However, many algorithms provide overloads taking runtime specified views and thus in many cases any_image_view can be used in places taking a view.

        To perform an algorithm on any_image_view, put the algorithm in a function object and invoke it by calling variant2::visit(algorithm_fn, runtime_view);

        @@ -123,7 +121,7 @@ class boost::gil::any_image_view< Views > diff --git a/html/reference/classboost_1_1gil_1_1bit__range-members.html b/html/reference/classboost_1_1gil_1_1bit__range-members.html index c52f00012..73500dfa8 100644 --- a/html/reference/classboost_1_1gil_1_1bit__range-members.html +++ b/html/reference/classboost_1_1gil_1_1bit__range-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        bit_range< RangeSize, IsMutable > Member List
        +
        bit_range< RangeSize, IsMutable > Member List

        This is the complete list of members for bit_range< RangeSize, IsMutable >, including all inherited members.

        - + - + - + - + - + - + - +
        bit_advance(difference_type num_bits) (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_distance_to(bit_range const &b) const -> difference_type (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_distance_to(bit_range const &b) const -> difference_type (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_offset() const -> int (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_range (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >friend
        bit_range (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >friend
        bit_range() (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_range(byte_t *current_byte, int bit_offset) (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_range(byte_t *current_byte, int bit_offset) (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_range(bit_range const &br) (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_range(const bit_range< RangeSize, M > &br) (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        bit_range(const bit_range< RangeSize, M > &br) (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        byte_t typedef (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >
        current_byte() const -> byte_t * (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        current_byte() const -> byte_t * (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        difference_type typedef (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >
        operator++() -> bit_range & (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        operator++() -> bit_range & (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        operator--() -> bit_range & (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        operator=(bit_range const &br) -> bit_range & (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        operator=(bit_range const &br) -> bit_range & (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        operator==(bit_range const &br) const (defined in bit_range< RangeSize, IsMutable >)bit_range< RangeSize, IsMutable >inline
        @@ -71,7 +71,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1bit__range.html b/html/reference/classboost_1_1gil_1_1bit__range.html index 0ac0a38e1..9dda9fe40 100644 --- a/html/reference/classboost_1_1gil_1_1bit__range.html +++ b/html/reference/classboost_1_1gil_1_1bit__range.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_range< RangeSize, IsMutable > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        bit_range< RangeSize, IsMutable > Class Template Reference
        +
        bit_range< RangeSize, IsMutable > Class Template Reference

        #include <bit_aligned_pixel_reference.hpp>

        - - -

        +

        Public Types

        +
        using byte_t = mp11::mp_if_c< IsMutable, unsigned char, unsigned char const >
         
        +
        using difference_type = std::ptrdiff_t
         
        - - - - - - - - - - - -

        +

        Public Member Functions

        +
         bit_range (byte_t *current_byte, int bit_offset)
         
        +
         bit_range (bit_range const &br)
         
        +
        template<bool M>
         bit_range (const bit_range< RangeSize, M > &br)
         
        +
        auto operator= (bit_range const &br) -> bit_range &
         
        +
        bool operator== (bit_range const &br) const
         
        +
        auto operator++ () -> bit_range &
         
        +
        auto operator-- () -> bit_range &
         
        +
        void bit_advance (difference_type num_bits)
         
        +
        auto bit_distance_to (bit_range const &b) const -> difference_type
         
        +
        auto current_byte () const -> byte_t *
         
        +
        auto bit_offset () const -> int
         

        Detailed Description

        -

        template<int RangeSize, bool IsMutable>
        -class boost::gil::bit_range< RangeSize, IsMutable >

        - -

        A model of a heterogeneous pixel that is not byte aligned. Examples are bitmap (1-bit pixels) or 6-bit RGB (222).

        +
        template<int RangeSize, bool IsMutable>
        +class boost::gil::bit_range< RangeSize, IsMutable >

        A model of a heterogeneous pixel that is not byte aligned. Examples are bitmap (1-bit pixels) or 6-bit RGB (222).


        The documentation for this class was generated from the following file: @@ -114,7 +112,7 @@ class boost::gil::bit_range< RangeSize, IsMutable > diff --git a/html/reference/classboost_1_1gil_1_1color__convert__deref__fn-members.html b/html/reference/classboost_1_1gil_1_1color__convert__deref__fn-members.html index 50bb01fb4..4246b35c4 100644 --- a/html/reference/classboost_1_1gil_1_1color__convert__deref__fn-members.html +++ b/html/reference/classboost_1_1gil_1_1color__convert__deref__fn-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        color_convert_deref_fn< SrcConstRefP, DstP, CC > Member List
        +
        color_convert_deref_fn< SrcConstRefP, DstP, CC > Member List

        This is the complete list of members for color_convert_deref_fn< SrcConstRefP, DstP, CC >, including all inherited members.

        - - + + - - - + + + - - - + + +
        argument_type typedef (defined in deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >)deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
        color_convert_deref_fn() (defined in color_convert_deref_fn< SrcConstRefP, DstP, CC >)color_convert_deref_fn< SrcConstRefP, DstP, CC >inline
        argument_type typedef (defined in deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >)deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        color_convert_deref_fn() (defined in color_convert_deref_fn< SrcConstRefP, DstP, CC >)color_convert_deref_fn< SrcConstRefP, DstP, CC >inline
        color_convert_deref_fn(CC cc_in) (defined in color_convert_deref_fn< SrcConstRefP, DstP, CC >)color_convert_deref_fn< SrcConstRefP, DstP, CC >inline
        const_reference typedef (defined in deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >)deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
        const_t typedef (defined in deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >)deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
        is_mutable (defined in deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >)deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >static
        const_reference typedef (defined in deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >)deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        const_t typedef (defined in deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >)deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        is_mutable (defined in deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >)deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >static
        operator()(SrcConstRefP srcP) const (defined in color_convert_deref_fn< SrcConstRefP, DstP, CC >)color_convert_deref_fn< SrcConstRefP, DstP, CC >inline
        reference typedef (defined in deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >)deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
        result_type typedef (defined in deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >)deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
        value_type typedef (defined in deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >)deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
        reference typedef (defined in deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >)deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        result_type typedef (defined in deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >)deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        value_type typedef (defined in deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >)deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        diff --git a/html/reference/classboost_1_1gil_1_1color__convert__deref__fn.html b/html/reference/classboost_1_1gil_1_1color__convert__deref__fn.html index 60a861980..c6e04ac9e 100644 --- a/html/reference/classboost_1_1gil_1_1color__convert__deref__fn.html +++ b/html/reference/classboost_1_1gil_1_1color__convert__deref__fn.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_convert_deref_fn< SrcConstRefP, DstP, CC > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -61,50 +61,48 @@ Inheritance diagram for color_convert_deref_fn< SrcConstRefP, DstP, CC >:<
        -deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false > +deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        - - -

        +

        Public Member Functions

        +
         color_convert_deref_fn (CC cc_in)
         
        +
        DstP operator() (SrcConstRefP srcP) const
         
        - - - + + - + - + - + - + - + - - + +

        +

        Additional Inherited Members

        - Public Types inherited from deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
        -using argument_type = SrcConstRefP
        - Public Types inherited from deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        +using argument_type = ArgType
         
        -using result_type = DstP
        +using result_type = ResultType
         
        -using const_t = color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >
        +using const_t = ConstT
         
        -using value_type = DstP
        +using value_type = Value
         
        -using reference = DstP
        +using reference = Reference
         
        -using const_reference = const DstP &
        +using const_reference = ConstReference
         
        - Static Public Attributes inherited from deref_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
        -static constexpr bool is_mutable
        - Static Public Attributes inherited from deref_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >
        +static constexpr bool is_mutable = IsMutable
         

        Detailed Description

        -

        template<typename SrcConstRefP, typename DstP, typename CC = default_color_converter>
        -class boost::gil::color_convert_deref_fn< SrcConstRefP, DstP, CC >

        - -

        Function object that given a source pixel, returns it converted to a given color space and channel depth. Models: PixelDereferenceAdaptorConcept.

        +
        template<typename SrcConstRefP, typename DstP, typename CC = default_color_converter>
        +class boost::gil::color_convert_deref_fn< SrcConstRefP, DstP, CC >

        Function object that given a source pixel, returns it converted to a given color space and channel depth. Models: PixelDereferenceAdaptorConcept.

        Useful in constructing a color converted view over a given image view


        The documentation for this class was generated from the following file:
        • image_view_factory.hpp
        • @@ -115,7 +113,7 @@ class boost::gil::color_convert_deref_fn< SrcConstRefP, DstP, CC > diff --git a/html/reference/classboost_1_1gil_1_1color__convert__deref__fn.png b/html/reference/classboost_1_1gil_1_1color__convert__deref__fn.png index a692d59a1..7dff61f83 100644 Binary files a/html/reference/classboost_1_1gil_1_1color__convert__deref__fn.png and b/html/reference/classboost_1_1gil_1_1color__convert__deref__fn.png differ diff --git a/html/reference/classboost_1_1gil_1_1deref__compose-members.html b/html/reference/classboost_1_1gil_1_1deref__compose-members.html index b34a659c6..7eef3f172 100644 --- a/html/reference/classboost_1_1gil_1_1deref__compose-members.html +++ b/html/reference/classboost_1_1gil_1_1deref__compose-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        deref_compose< D1, D2 > Member List
        +
        deref_compose< D1, D2 > Member List

        This is the complete list of members for deref_compose< D1, D2 >, including all inherited members.

        - + - - - + - + - - - - - - + + +
        _fn1 (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >
        _fn2 (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >
        _fn2 (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >
        argument_type typedef (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >
        const_reference typedef (defined in deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >)deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
        const_t typedef (defined in deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >)deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
        deref_compose()=default (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >
        deref_compose()=default (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >
        deref_compose(const D1 &x, const D2 &y) (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >inline
        deref_compose(const deref_compose &dc) (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >inline
        deref_compose(const deref_compose &dc) (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >inline
        deref_compose(const deref_compose< _D1, _D2 > &dc) (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >inline
        is_mutable (defined in deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >)deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >static
        operator()(argument_type x) const (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >inline
        operator()(argument_type x) (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >inline
        reference typedef (defined in deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >)deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
        result_type typedef (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >
        value_type typedef (defined in deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >)deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
        operator()(argument_type x) const (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >inline
        operator()(argument_type x) (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >inline
        result_type typedef (defined in deref_compose< D1, D2 >)deref_compose< D1, D2 >
        diff --git a/html/reference/classboost_1_1gil_1_1deref__compose.html b/html/reference/classboost_1_1gil_1_1deref__compose.html index 4c1081dcf..690d3c040 100644 --- a/html/reference/classboost_1_1gil_1_1deref__compose.html +++ b/html/reference/classboost_1_1gil_1_1deref__compose.html @@ -4,7 +4,7 @@ - + Generic Image Library: deref_compose< D1, D2 > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        deref_compose< D1, D2 > Class Template Reference
        +
        deref_compose< D1, D2 > Class Template Reference
        @@ -67,74 +67,72 @@ Inheritance diagram for deref_compose< D1, D2 >:
        - - - - - - - - -

        +

        Public Types

        +
        using argument_type = typename D2::argument_type
         
        +
        using result_type = typename D1::result_type
         
        - Public Types inherited from deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
        +
        using argument_type = D2::argument_type
         
        +
        using result_type = D1::result_type
         
        +
        using const_t = deref_compose< D1::const_t, D2::const_t >
         
        +
        using value_type = D1::value_type
         
        +
        using reference = D1::reference
         
        +
        using const_reference = D1::const_reference
         
        - - - - - -

        +

        Public Member Functions

        +
         deref_compose (const D1 &x, const D2 &y)
         
        +
         deref_compose (const deref_compose &dc)
         
        +
        template<typename _D1 , typename _D2 >
         deref_compose (const deref_compose< _D1, _D2 > &dc)
         
        +
        result_type operator() (argument_type x) const
         
        +
        result_type operator() (argument_type x)
         
        - - -

        +

        Public Attributes

        +
        D1 _fn1
         
        +
        D2 _fn2
         
        - -

        +

        Additional Inherited Members

        - Static Public Attributes inherited from deref_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
        +
        static constexpr bool is_mutable
         

        Detailed Description

        -

        template<typename D1, typename D2>
        -class boost::gil::deref_compose< D1, D2 >

        - -

        Composes two dereference function objects. Similar to std::unary_compose but needs to pull some aliases from the component types. Models: PixelDereferenceAdaptorConcept.

        +
        template<typename D1, typename D2>
        +class boost::gil::deref_compose< D1, D2 >

        Composes two dereference function objects. Similar to std::unary_compose but needs to pull some aliases from the component types. Models: PixelDereferenceAdaptorConcept.


        The documentation for this class was generated from the following file: @@ -144,7 +142,7 @@ class boost::gil::deref_compose< D1, D2 > diff --git a/html/reference/classboost_1_1gil_1_1deref__compose.png b/html/reference/classboost_1_1gil_1_1deref__compose.png index 82cee62b1..bcdd6bf86 100644 Binary files a/html/reference/classboost_1_1gil_1_1deref__compose.png and b/html/reference/classboost_1_1gil_1_1deref__compose.png differ diff --git a/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor-members.html b/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor-members.html index e0bba8d5a..6e01e8b47 100644 --- a/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor-members.html +++ b/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        dereference_iterator_adaptor< Iterator, DFn > Member List
        +
        dereference_iterator_adaptor< Iterator, DFn > Member List

        This is the complete list of members for dereference_iterator_adaptor< Iterator, DFn >, including all inherited members.

        - + - + - + - + - + - + - + - + - + - +
        base() (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        base() const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        base() const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        boost::iterator_core_access (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >friend
        deref_fn() const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        deref_fn() const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        dereference_fn typedef (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >
        dereference_iterator_adaptor (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >friend
        dereference_iterator_adaptor (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >friend
        dereference_iterator_adaptor() (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        dereference_iterator_adaptor(const dereference_iterator_adaptor< Iterator1, DFn > &dit) (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        dereference_iterator_adaptor(const dereference_iterator_adaptor< Iterator1, DFn > &dit) (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        dereference_iterator_adaptor(Iterator it, DFn deref_fn=DFn()) (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        dereference_iterator_adaptor(const dereference_iterator_adaptor< Iterator1, DFn1 > &it) (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        dereference_iterator_adaptor(const dereference_iterator_adaptor< Iterator1, DFn1 > &it) (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        difference_type typedef (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >
        operator!=(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator!=(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator<(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator<=(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator<=(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator==(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator>(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator>(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator>=(const dereference_iterator_adaptor &p) const (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >inline
        operator[](difference_type d) constdereference_iterator_adaptor< Iterator, DFn >inline
        operator[](difference_type d) constdereference_iterator_adaptor< Iterator, DFn >inline
        parent_t typedef (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >
        reference typedef (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >
        reference typedef (defined in dereference_iterator_adaptor< Iterator, DFn >)dereference_iterator_adaptor< Iterator, DFn >
        diff --git a/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor.html b/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor.html index 28c422591..dd4559238 100644 --- a/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor.html +++ b/html/reference/classboost_1_1gil_1_1dereference__iterator__adaptor.html @@ -4,7 +4,7 @@ - + Generic Image Library: dereference_iterator_adaptor< Iterator, DFn > Class Template Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ + -
        -
        dereference_iterator_adaptor< Iterator, DFn > Class Template Reference
        +
        dereference_iterator_adaptor< Iterator, DFn > Class Template Reference
        @@ -60,81 +60,81 @@ $(function() {

        Inherits iterator_adaptor< dereference_iterator_adaptor< Iterator, DFn >, Iterator, DFn::value_type, std::iterator_traits< Iterator >::iterator_category, DFn::reference, use_default >.

        - - - - -

        +

        Public Types

        +
        using parent_t = iterator_adaptor< dereference_iterator_adaptor< Iterator, DFn >, Iterator, typename DFn::value_type, typename std::iterator_traits< Iterator >::iterator_category, typename DFn::reference, use_default >
         
        +
        using reference = typename DFn::result_type
         
        +
        using difference_type = typename std::iterator_traits< Iterator >::difference_type
         
        +
        using dereference_fn = DFn
         
        - - - - - + - - - - - - - - - + - - + - +

        +

        Public Member Functions

        +
        template<typename Iterator1 >
         dereference_iterator_adaptor (const dereference_iterator_adaptor< Iterator1, DFn > &dit)
         
        +
         dereference_iterator_adaptor (Iterator it, DFn deref_fn=DFn())
         
        +
        template<typename Iterator1 , typename DFn1 >
         dereference_iterator_adaptor (const dereference_iterator_adaptor< Iterator1, DFn1 > &it)
         
        reference operator[] (difference_type d) const
        reference operator[] (difference_type d) const
         
        +
        bool operator> (const dereference_iterator_adaptor &p) const
         
        +
        bool operator< (const dereference_iterator_adaptor &p) const
         
        +
        bool operator>= (const dereference_iterator_adaptor &p) const
         
        +
        bool operator<= (const dereference_iterator_adaptor &p) const
         
        +
        bool operator== (const dereference_iterator_adaptor &p) const
         
        +
        bool operator!= (const dereference_iterator_adaptor &p) const
         
        +
        Iterator & base ()
         
        +
         
        const Iterator & base () const
         
        +
         
        const DFn & deref_fn () const
         
         
        - -

        +

        Friends

        +
        class boost::iterator_core_access
         

        Detailed Description

        -

        template<typename Iterator, typename DFn>
        -class boost::gil::dereference_iterator_adaptor< Iterator, DFn >

        - -

        An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept.

        +
        template<typename Iterator, typename DFn>
        +class boost::gil::dereference_iterator_adaptor< Iterator, DFn >

        An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept.

        Member Function Documentation

        - -

        ◆ operator[]()

        + +

        ◆ operator[]()

        +
        +template<typename Iterator , typename DFn >
        diff --git a/html/reference/group___color_base_algorithm_homogeneous.html b/html/reference/group___color_base_algorithm_homogeneous.html index aaf850210..f6bdfdd1a 100644 --- a/html/reference/group___color_base_algorithm_homogeneous.html +++ b/html/reference/group___color_base_algorithm_homogeneous.html @@ -4,7 +4,7 @@ - + Generic Image Library: element_type, element_reference_type, element_const_reference_type @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        element_type, element_reference_type, element_const_reference_type
        +
        element_type, element_reference_type, element_const_reference_type

        Types for homogeneous color bases. More...

        @@ -166,7 +166,7 @@ class boost::gil::dereference_iterator_adaptor< Iterator, DFn > diff --git a/html/reference/classboost_1_1gil_1_1derived__image__type-members.html b/html/reference/classboost_1_1gil_1_1derived__image__type-members.html index 28dedeb6d..5bb0b06d9 100644 --- a/html/reference/classboost_1_1gil_1_1derived__image__type-members.html +++ b/html/reference/classboost_1_1gil_1_1derived__image__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        derived_image_type< Image, T, L, IsPlanar > Member List
        +
        derived_image_type< Image, T, L, IsPlanar > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1derived__image__type.html b/html/reference/classboost_1_1gil_1_1derived__image__type.html index 573007c8c..897c1ce95 100644 --- a/html/reference/classboost_1_1gil_1_1derived__image__type.html +++ b/html/reference/classboost_1_1gil_1_1derived__image__type.html @@ -4,7 +4,7 @@ - + Generic Image Library: derived_image_type< Image, T, L, IsPlanar > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,17 +56,15 @@ $(function() {

        #include <metafunctions.hpp>

        - -

        +

        Public Types

        +
        using type = typename image_type< channel_t, layout_t, planar >::type
         

        Detailed Description

        -

        template<typename Image, typename T = use_default, typename L = use_default, typename IsPlanar = use_default>
        -class boost::gil::derived_image_type< Image, T, L, IsPlanar >

        - -

        Constructs a homogeneous image type from a source image type by changing some of the properties.

        +
        template<typename Image, typename T = use_default, typename L = use_default, typename IsPlanar = use_default>
        +class boost::gil::derived_image_type< Image, T, L, IsPlanar >

        Constructs a homogeneous image type from a source image type by changing some of the properties.

        Use use_default for the properties of the source image that you want to keep.


        The documentation for this class was generated from the following file:
        • metafunctions.hpp
        • @@ -77,7 +75,7 @@ class boost::gil::derived_image_type< Image, T, L, IsPlanar > diff --git a/html/reference/classboost_1_1gil_1_1derived__iterator__type-members.html b/html/reference/classboost_1_1gil_1_1derived__iterator__type-members.html index 053e11831..89f656757 100644 --- a/html/reference/classboost_1_1gil_1_1derived__iterator__type-members.html +++ b/html/reference/classboost_1_1gil_1_1derived__iterator__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        derived_iterator_type< Iterator, T, L, IsPlanar, IsStep, IsMutable > Member List
        +
        derived_iterator_type< Iterator, T, L, IsPlanar, IsStep, IsMutable > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1derived__iterator__type.html b/html/reference/classboost_1_1gil_1_1derived__iterator__type.html index f273e04ff..6034b7461 100644 --- a/html/reference/classboost_1_1gil_1_1derived__iterator__type.html +++ b/html/reference/classboost_1_1gil_1_1derived__iterator__type.html @@ -4,7 +4,7 @@ - + Generic Image Library: derived_iterator_type< Iterator, T, L, IsPlanar, IsStep, IsMutable > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,17 +56,15 @@ $(function() {

        #include <metafunctions.hpp>

        - -

        +

        Public Types

        +
        using type = typename iterator_type< channel_t, layout_t, planar, step, mut >::type
         

        Detailed Description

        -

        template<typename Iterator, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename IsStep = use_default, typename IsMutable = use_default>
        -class boost::gil::derived_iterator_type< Iterator, T, L, IsPlanar, IsStep, IsMutable >

        - -

        Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties.

        +
        template<typename Iterator, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename IsStep = use_default, typename IsMutable = use_default>
        +class boost::gil::derived_iterator_type< Iterator, T, L, IsPlanar, IsStep, IsMutable >

        Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties.

        Use use_default for the properties of the source view that you want to keep.


        The documentation for this class was generated from the following file:
        • metafunctions.hpp
        • @@ -77,7 +75,7 @@ class boost::gil::derived_iterator_type< Iterator, T, L, IsPlanar, IsStep, Is diff --git a/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type-members.html b/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type-members.html index 97e00737f..b36be7023 100644 --- a/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type-members.html +++ b/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        derived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutable > Member List
        +
        derived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutable > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type.html b/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type.html index e45484363..2039e5ce1 100644 --- a/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type.html +++ b/html/reference/classboost_1_1gil_1_1derived__pixel__reference__type.html @@ -4,7 +4,7 @@ - + Generic Image Library: derived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutable > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,17 +56,15 @@ $(function() {

        #include <metafunctions.hpp>

        - -

        +

        Public Types

        +
        using type = typename pixel_reference_type< channel_t, layout_t, planar, mut >::type
         

        Detailed Description

        -

        template<typename Ref, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename IsMutable = use_default>
        -class boost::gil::derived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutable >

        - -

        Constructs a pixel reference type from a source pixel reference type by changing some of the properties.

        +
        template<typename Ref, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename IsMutable = use_default>
        +class boost::gil::derived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutable >

        Constructs a pixel reference type from a source pixel reference type by changing some of the properties.

        Use use_default for the properties of the source view that you want to keep.


        The documentation for this class was generated from the following file:
        • metafunctions.hpp
        • @@ -77,7 +75,7 @@ class boost::gil::derived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutabl diff --git a/html/reference/classboost_1_1gil_1_1derived__view__type-members.html b/html/reference/classboost_1_1gil_1_1derived__view__type-members.html index 302d279a7..f3a906a2c 100644 --- a/html/reference/classboost_1_1gil_1_1derived__view__type-members.html +++ b/html/reference/classboost_1_1gil_1_1derived__view__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        derived_view_type< View, T, L, IsPlanar, StepX, IsMutable > Member List
        +
        derived_view_type< View, T, L, IsPlanar, StepX, IsMutable > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1derived__view__type.html b/html/reference/classboost_1_1gil_1_1derived__view__type.html index 481b4025d..57b16255a 100644 --- a/html/reference/classboost_1_1gil_1_1derived__view__type.html +++ b/html/reference/classboost_1_1gil_1_1derived__view__type.html @@ -4,7 +4,7 @@ - + Generic Image Library: derived_view_type< View, T, L, IsPlanar, StepX, IsMutable > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,17 +56,15 @@ $(function() {

        #include <metafunctions.hpp>

        - -

        +

        Public Types

        +
        using type = typename view_type< channel_t, layout_t, planar, step, mut >::type
         

        Detailed Description

        -

        template<typename View, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename StepX = use_default, typename IsMutable = use_default>
        -class boost::gil::derived_view_type< View, T, L, IsPlanar, StepX, IsMutable >

        - -

        Constructs an image view type from a source view type by changing some of the properties.

        +
        template<typename View, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename StepX = use_default, typename IsMutable = use_default>
        +class boost::gil::derived_view_type< View, T, L, IsPlanar, StepX, IsMutable >

        Constructs an image view type from a source view type by changing some of the properties.

        Use use_default for the properties of the source view that you want to keep.


        The documentation for this class was generated from the following file:
        • metafunctions.hpp
        • @@ -77,7 +75,7 @@ class boost::gil::derived_view_type< View, T, L, IsPlanar, StepX, IsMutable & diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n-members.html b/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n-members.html index fa54bdbea..d1276e783 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n-members.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        correlator_n< PixelAccum > Member List
        +
        correlator_n< PixelAccum > Member List

        This is the complete list of members for correlator_n< PixelAccum >, including all inherited members.

        - +
        correlator_n(std::size_t size) (defined in correlator_n< PixelAccum >)correlator_n< PixelAccum >inline
        operator()(SrcIterator src_begin, SrcIterator src_end, KernelIterator kernel_begin, DstIterator dst_begin) (defined in correlator_n< PixelAccum >)correlator_n< PixelAccum >inline
        operator()(SrcIterator src_begin, SrcIterator src_end, KernelIterator kernel_begin, DstIterator dst_begin) (defined in correlator_n< PixelAccum >)correlator_n< PixelAccum >inline
        diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n.html b/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n.html index ad54984eb..8dc5af4ad 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1correlator__n.html @@ -4,7 +4,7 @@ - + Generic Image Library: correlator_n< PixelAccum > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,19 @@ $(function() {

        #include <convolve.hpp>

        - - -

        +

        Public Member Functions

        +
         correlator_n (std::size_t size)
         
        +
        template<typename SrcIterator , typename KernelIterator , typename DstIterator >
        void operator() (SrcIterator src_begin, SrcIterator src_end, KernelIterator kernel_begin, DstIterator dst_begin)
         

        Detailed Description

        -

        template<typename PixelAccum>
        -class boost::gil::detail::correlator_n< PixelAccum >

        - -

        Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is to be provided through constructor for all instances.

        +
        template<typename PixelAccum>
        +class boost::gil::detail::correlator_n< PixelAccum >

        Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is to be provided through constructor for all instances.


        The documentation for this class was generated from the following file: @@ -80,7 +78,7 @@ class boost::gil::detail::correlator_n< PixelAccum > diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device-members.html b/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device-members.html index 4554f1b59..5251815b1 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device-members.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        file_stream_device< FormatTag > Member List
        +
        file_stream_device< FormatTag > Member List

        This is the complete list of members for file_stream_device< FormatTag >, including all inherited members.

        - + - + - + - + - + - + - + - + - + - + - + - +
        error() (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        file_stream_device(const std::string &file_name, read_tag tag=read_tag())file_stream_device< FormatTag >inline
        file_stream_device(const std::string &file_name, read_tag tag=read_tag())file_stream_device< FormatTag >inline
        file_stream_device(const char *file_name, read_tag=read_tag())file_stream_device< FormatTag >inline
        file_stream_device(const std::string &file_name, write_tag tag)file_stream_device< FormatTag >inline
        file_stream_device(const std::string &file_name, write_tag tag)file_stream_device< FormatTag >inline
        file_stream_device(const char *file_name, write_tag)file_stream_device< FormatTag >inline
        file_stream_device(FILE *file)file_stream_device< FormatTag >inline
        file_stream_device(FILE *file)file_stream_device< FormatTag >inline
        flush() (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        format_tag_t typedef (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >
        format_tag_t typedef (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >
        get() -> FILE * (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        get() const -> FILE const * (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        get() const -> FILE const * (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        getc() (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        getc_unchecked() (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        getc_unchecked() (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        print_line(const std::string &line)file_stream_device< FormatTag >inline
        read(byte_t *data, std::size_t count) -> std::size_tfile_stream_device< FormatTag >inline
        read(byte_t *data, std::size_t count) -> std::size_tfile_stream_device< FormatTag >inline
        read(T(&buf)[N])file_stream_device< FormatTag >inline
        read_uint16()file_stream_device< FormatTag >inline
        read_uint16()file_stream_device< FormatTag >inline
        read_uint32()file_stream_device< FormatTag >inline
        read_uint8()file_stream_device< FormatTag >inline
        read_uint8()file_stream_device< FormatTag >inline
        seek(long count, int whence=SEEK_SET) (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        tell() (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        tell() (defined in file_stream_device< FormatTag >)file_stream_device< FormatTag >inline
        write(T const *buf, std::size_t count) -> std::size_tfile_stream_device< FormatTag >inline
        write(const T(&buf)[N])file_stream_device< FormatTag >inline
        write(const T(&buf)[N])file_stream_device< FormatTag >inline
        write_uint16(uint16_t x)file_stream_device< FormatTag >inline
        write_uint32(uint32_t x)file_stream_device< FormatTag >inline
        write_uint32(uint32_t x)file_stream_device< FormatTag >inline
        write_uint8(uint8_t x)file_stream_device< FormatTag >inline
        @@ -81,7 +81,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device.html b/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device.html index fa5fc2228..db6852229 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1file__stream__device.html @@ -4,7 +4,7 @@ - + Generic Image Library: file_stream_device< FormatTag > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        file_stream_device< FormatTag > Class Template Reference
        +
        file_stream_device< FormatTag > Class Template Reference

        #include <device.hpp>

        -

        +

        Classes

        struct  read_tag
         Used to overload the constructor. More...
         
        - -

        +

        Public Types

        +
        using format_tag_t = FormatTag
         
        - - + - + - + - + - + - - - - - + - - + - + - + - + - - + - - + - + - + - + - - - - + -

        +

        Public Member Functions

         file_stream_device (const std::string &file_name, read_tag tag=read_tag())
         file_stream_device (const std::string &file_name, read_tag tag=read_tag())
         
         file_stream_device (const char *file_name, read_tag=read_tag())
         file_stream_device (const char *file_name, read_tag=read_tag())
         
         file_stream_device (const std::string &file_name, write_tag tag)
         file_stream_device (const std::string &file_name, write_tag tag)
         
         file_stream_device (const char *file_name, write_tag)
         file_stream_device (const char *file_name, write_tag)
         
         file_stream_device (FILE *file)
         file_stream_device (FILE *file)
         
        +
        auto get () -> FILE *
         
        +
        auto get () const -> FILE const *
         
        +
        int getc_unchecked ()
         
        +
        char getc ()
         
        auto read (byte_t *data, std::size_t count) -> std::size_t
        auto read (byte_t *data, std::size_t count) -> std::size_t
         
        +
        template<typename T , int N>
        void read (T(&buf)[N])
        void read (T(&buf)[N])
         Reads array.
         
        -uint8_t read_uint8 ()
        +uint8_t read_uint8 ()
         Reads byte.
         
        -uint16_t read_uint16 ()
        +uint16_t read_uint16 ()
         Reads 16 bit little endian integer.
         
        -uint32_t read_uint32 ()
        +uint32_t read_uint32 ()
         Reads 32 bit little endian integer.
         
        +
        template<typename T >
        auto write (T const *buf, std::size_t count) -> std::size_t
        auto write (T const *buf, std::size_t count) -> std::size_t
         Writes number of elements from a buffer.
         
        +
        template<typename T , std::size_t N>
        void write (const T(&buf)[N])
        void write (const T(&buf)[N])
         Writes array.
         
        -void write_uint8 (uint8_t x)
        +void write_uint8 (uint8_t x)
         Writes byte.
         
        -void write_uint16 (uint16_t x)
        +void write_uint16 (uint16_t x)
         Writes 16 bit little endian integer.
         
        -void write_uint32 (uint32_t x)
        +void write_uint32 (uint32_t x)
         Writes 32 bit little endian integer.
         
        +
        void seek (long count, int whence=SEEK_SET)
         
        +
        long int tell ()
         
        +
        void flush ()
         
        -void print_line (const std::string &line)
        +void print_line (const std::string &line)
         Prints formatted ASCII text.
         
        +
        int error ()
         

        Detailed Description

        -

        template<typename FormatTag>
        -class boost::gil::detail::file_stream_device< FormatTag >

        - -

        Implements the IODevice concept c.f. to Concept of IO Device required by Image libraries like libjpeg and libpng.

        +
        template<typename FormatTag>
        +class boost::gil::detail::file_stream_device< FormatTag >

        Implements the IODevice concept c.f. to Concept of IO Device required by Image libraries like libjpeg and libpng.

        Todo:
        switch to a sane interface as soon as there is something good in boost. I.E. the IOChains library would fit very well here.

        This implementation is based on FILE*.

        Constructor & Destructor Documentation

        - -

        ◆ file_stream_device() [1/5]

        + +

        ◆ file_stream_device() [1/5]

        +
        +template<typename FormatTag >
        diff --git a/html/reference/group___color_base_algorithm_generate.html b/html/reference/group___color_base_algorithm_generate.html index 345c2d2cb..b2acb75fa 100644 --- a/html/reference/group___color_base_algorithm_generate.html +++ b/html/reference/group___color_base_algorithm_generate.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_generate @@ -27,34 +27,34 @@
        - + +/* @license-end */ +

        Equivalent to std::generate. More...

        @@ -194,11 +194,13 @@ class boost::gil::detail::file_stream_device< FormatTag > - -

        ◆ file_stream_device() [2/5]

        + +

        ◆ file_stream_device() [2/5]

        +
        +template<typename FormatTag >
        diff --git a/html/reference/group___color_base_algorithm_for_each.html b/html/reference/group___color_base_algorithm_for_each.html index 930902b64..444d85aa6 100644 --- a/html/reference/group___color_base_algorithm_for_each.html +++ b/html/reference/group___color_base_algorithm_for_each.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_for_each @@ -27,86 +27,86 @@
        - + +/* @license-end */ +

        Equivalent to std::for_each. Pairs the elements semantically. More...

        @@ -231,11 +233,13 @@ class boost::gil::detail::file_stream_device< FormatTag > - -

        ◆ file_stream_device() [3/5]

        + +

        ◆ file_stream_device() [3/5]

        +
        +template<typename FormatTag >
        diff --git a/html/reference/group___color_base_algorithm_fill.html b/html/reference/group___color_base_algorithm_fill.html index 4c0571f7b..2d43a8b55 100644 --- a/html/reference/group___color_base_algorithm_fill.html +++ b/html/reference/group___color_base_algorithm_fill.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_fill @@ -27,37 +27,37 @@
        - + +/* @license-end */ +
        -

        Equivalent to std::fill. +

        Equivalent to std::fill. More...

        @@ -268,11 +272,13 @@ class boost::gil::detail::file_stream_device< FormatTag > - -

        ◆ file_stream_device() [4/5]

        + +

        ◆ file_stream_device() [4/5]

        +
        +template<typename FormatTag >
        diff --git a/html/reference/group___color_base_algorithm_equal.html b/html/reference/group___color_base_algorithm_equal.html index 0acb06ded..6dc5ff6c0 100644 --- a/html/reference/group___color_base_algorithm_equal.html +++ b/html/reference/group___color_base_algorithm_equal.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_equal @@ -27,37 +27,37 @@
        - + +/* @license-end */ +
        -

        Equivalent to std::equal. Pairs the elements semantically. +

        Equivalent to std::equal. Pairs the elements semantically. More...

        @@ -305,11 +311,13 @@ class boost::gil::detail::file_stream_device< FormatTag > - -

        ◆ file_stream_device() [5/5]

        + +

        ◆ file_stream_device() [5/5]

        +
        +template<typename FormatTag >
        template <typename Pixel>
        void set_red_to_max(Pixel& pixel) {
        boost::function_requires<MutablePixelConcept<Pixel> >();
        -
        static_assert(contains_color<Pixel, red_t>::value, "");
        +
        static_assert(contains_color<Pixel, red_t>::value, "");
        -
        using red_channel_t = typename color_element_type<Pixel, red_t>::type;
        -
        get_color(pixel, red_t()) = channel_traits<red_channel_t>::max_value();
        +
        using red_channel_t = typename color_element_type<Pixel, red_t>::type;
        +
        get_color(pixel, red_t()) = channel_traits<red_channel_t>::max_value();
        }
        -
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition: color_base_algorithm.hpp:190
        +
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition color_base_algorithm.hpp:190
        diff --git a/html/reference/group___color_base_algorithm_copy.html b/html/reference/group___color_base_algorithm_copy.html index a1aa5b1f1..ef5e99239 100644 --- a/html/reference/group___color_base_algorithm_copy.html +++ b/html/reference/group___color_base_algorithm_copy.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_copy @@ -27,34 +27,34 @@
        - + +/* @license-end */ +

        Equivalent to std::copy. Pairs the elements semantically. More...

        @@ -333,11 +341,13 @@ class boost::gil::detail::file_stream_device< FormatTag >

        Member Function Documentation

        - -

        ◆ read()

        + +

        ◆ read()

        +
        +template<typename FormatTag >
        diff --git a/html/reference/group___color_base_algorithm_color.html b/html/reference/group___color_base_algorithm_color.html index ccaecb0a9..72ee299ac 100644 --- a/html/reference/group___color_base_algorithm_color.html +++ b/html/reference/group___color_base_algorithm_color.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_element_type, color_element_reference_type, color_element_const_reference_type, get_color, contains_color @@ -27,30 +27,30 @@
        - + +/* @license-end */ +
        -
        -
        color_element_type, color_element_reference_type, color_element_const_reference_type, get_color, contains_color
        +
        color_element_type, color_element_reference_type, color_element_const_reference_type, get_color, contains_color

        get_color: Named channel accessors More...

        @@ -381,7 +391,7 @@ class boost::gil::detail::file_stream_device< FormatTag > diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1istream__device-members.html b/html/reference/classboost_1_1gil_1_1detail_1_1istream__device-members.html index 0631f1c6a..30d22fc7d 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1istream__device-members.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1istream__device-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        istream_device< FormatTag > Member List
        +
        istream_device< FormatTag > Member List

        This is the complete list of members for istream_device< FormatTag >, including all inherited members.

        - + - + - + - + - + - +
        error() (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        flush() (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        flush() (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        getc() (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        getc_unchecked() (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        getc_unchecked() (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        istream_device(std::istream &in) (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        read(byte_t *data, std::size_t count) (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        read(byte_t *data, std::size_t count) (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        read(T(&buf)[N])istream_device< FormatTag >inline
        read_uint16()istream_device< FormatTag >inline
        read_uint16()istream_device< FormatTag >inline
        read_uint32()istream_device< FormatTag >inline
        read_uint8()istream_device< FormatTag >inline
        read_uint8()istream_device< FormatTag >inline
        seek(long count, int whence=SEEK_SET) (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        tell() (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        tell() (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        write(const byte_t *, std::size_t) (defined in istream_device< FormatTag >)istream_device< FormatTag >inline
        @@ -69,7 +69,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1istream__device.html b/html/reference/classboost_1_1gil_1_1detail_1_1istream__device.html index 14d09c307..d65c473e3 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1istream__device.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1istream__device.html @@ -4,7 +4,7 @@ - + Generic Image Library: istream_device< FormatTag > Class Template Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ +

        #include <device.hpp>

        - - - - - - - + - + - + - + - - - - -

        +

        Public Member Functions

        +
         istream_device (std::istream &in)
         
        +
        int getc_unchecked ()
         
        +
        char getc ()
         
        +
        std::size_t read (byte_t *data, std::size_t count)
         
        +
        template<typename T , int N>
        void read (T(&buf)[N])
        void read (T(&buf)[N])
         Reads array.
         
        -uint8_t read_uint8 ()
        +uint8_t read_uint8 ()
         Reads byte.
         
        -uint16_t read_uint16 ()
        +uint16_t read_uint16 ()
         Reads 16 bit little endian integer.
         
        -uint32_t read_uint32 ()
        +uint32_t read_uint32 ()
         Reads 32 bit little endian integer.
         
        +
        void seek (long count, int whence=SEEK_SET)
         
        +
        long int tell ()
         
        +
        void write (const byte_t *, std::size_t)
         
        +
        void flush ()
         
        +
        int error ()
         

        Detailed Description

        -

        template<typename FormatTag>
        -class boost::gil::detail::istream_device< FormatTag >

        - -

        Input stream device

        +
        template<typename FormatTag>
        +class boost::gil::detail::istream_device< FormatTag >

        Input stream device


        The documentation for this class was generated from the following file: @@ -114,7 +112,7 @@ class boost::gil::detail::istream_device< FormatTag > diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor-members.html b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor-members.html index 1d9d80edf..b49da8586 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor-members.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        kernel_1d_adaptor< Core > Member List
        +
        kernel_1d_adaptor< Core > Member List

        This is the complete list of members for kernel_1d_adaptor< Core >, including all inherited members.

        - + - + - + - +
        center() -> std::size_t & (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        center() const -> std::size_t const & (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        center() const -> std::size_t const & (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        kernel_1d_adaptor()=default (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >
        kernel_1d_adaptor(std::size_t center) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inlineexplicit
        kernel_1d_adaptor(std::size_t center) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inlineexplicit
        kernel_1d_adaptor(std::size_t size, std::size_t center) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        kernel_1d_adaptor(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        kernel_1d_adaptor(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        left_size() const (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        operator=(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        operator=(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        right_size() const (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        @@ -65,7 +65,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.html b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.html index 8882c49e2..4e9d67c73 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.html @@ -4,7 +4,7 @@ - + Generic Image Library: kernel_1d_adaptor< Core > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -55,41 +55,46 @@ $(function() { More...

        #include <kernel.hpp>

        - -

        Inherits Core.

        +
        +Inheritance diagram for kernel_1d_adaptor< Core >:
        +
        +
        + + +kernel_1d< T, Allocator > + +
        - - - - - - - + - - -

        +

        Public Member Functions

        +
         kernel_1d_adaptor (std::size_t center)
         
        +
         kernel_1d_adaptor (std::size_t size, std::size_t center)
         
        +
         kernel_1d_adaptor (kernel_1d_adaptor const &other)
         
        +
        kernel_1d_adaptoroperator= (kernel_1d_adaptor const &other)
         
        +
         
        std::size_t left_size () const
         
        +
        std::size_t right_size () const
         
        +
        auto center () -> std::size_t &
         
        +
        auto center () const -> std::size_t const &
         

        Detailed Description

        -

        template<typename Core>
        -class boost::gil::detail::kernel_1d_adaptor< Core >

        - -

        kernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),operator[], value_type,iterator,const_iterator,reference,const_reference

        +
        template<typename Core>
        +class boost::gil::detail::kernel_1d_adaptor< Core >

        kernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),operator[], value_type,iterator,const_iterator,reference,const_reference


        The documentation for this class was generated from the following file: @@ -99,7 +104,7 @@ class boost::gil::detail::kernel_1d_adaptor< Core > diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.png b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.png new file mode 100644 index 000000000..92c6c3ce8 Binary files /dev/null and b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__1d__adaptor.png differ diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d-members.html b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d-members.html index 1ebadffd7..20213f04f 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d-members.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        kernel_2d< T, Allocator > Member List
        +
        kernel_2d< T, Allocator > Member List

        This is the complete list of members for kernel_2d< T, Allocator >, including all inherited members.

        - + - + - + - + - + - + - + - + - + - +
        at(std::size_t x, std::size_t y) const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_x() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_x() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_x() const -> std::size_t const & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_y() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_y() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_y() const -> std::size_t const & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        kernel_2d()=default (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >
        kernel_2d()=default (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >
        kernel_2d(std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >inline
        kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >inline
        kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >inline
        kernel_2d(kernel_2d const &other) (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >inline
        kernel_2d_adaptor()=default (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >
        kernel_2d_adaptor()=default (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >
        kernel_2d_adaptor(std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inlineexplicit
        kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        kernel_2d_adaptor(kernel_2d_adaptor const &other) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        left_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        left_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        lower_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        operator=(kernel_2d const &other)=default (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >
        operator=(kernel_2d const &other)=default (defined in kernel_2d< T, Allocator >)kernel_2d< T, Allocator >
        operator=(kernel_2d_adaptor const &other) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        right_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        right_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        square_size (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >protected
        square_size (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >protected
        upper_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        @@ -77,7 +77,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d.html b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d.html index 446da429a..2096bf241 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d.html @@ -4,7 +4,7 @@ - + Generic Image Library: kernel_2d< T, Allocator > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -58,27 +58,25 @@ $(function() {

        Inherits kernel_2d_adaptor< Core >.

        - - - - - - +

        +

        Public Member Functions

        +
         kernel_2d (std::size_t size, std::size_t center_y, std::size_t center_x)
         
        +
        template<typename FwdIterator >
         kernel_2d (FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x)
         
        +
         kernel_2d (kernel_2d const &other)
         
        +
        kernel_2doperator= (kernel_2d const &other)=default
         
         

        Detailed Description

        -

        template<typename T, typename Allocator = std::allocator<T>>
        -class boost::gil::detail::kernel_2d< T, Allocator >

        - -

        variable-size kernel

        +
        template<typename T, typename Allocator = std::allocator<T>>
        +class boost::gil::detail::kernel_2d< T, Allocator >

        variable-size kernel


        The documentation for this class was generated from the following file: @@ -88,7 +86,7 @@ class boost::gil::detail::kernel_2d< T, Allocator > diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed-members.html b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed-members.html index 066169a95..0f68cb11c 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed-members.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        kernel_2d_fixed< T, Size > Member List
        +
        kernel_2d_fixed< T, Size > Member List

        This is the complete list of members for kernel_2d_fixed< T, Size >, including all inherited members.

        - + - + - + - + - + - + - + - + - + - + - +
        at(std::size_t x, std::size_t y) const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_x() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_x() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_x() const -> std::size_t const & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_y() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_y() -> std::size_t & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        center_y() const -> std::size_t const & (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        kernel_2d_adaptor()=default (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >
        kernel_2d_adaptor()=default (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >
        kernel_2d_adaptor(std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inlineexplicit
        kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        kernel_2d_adaptor(kernel_2d_adaptor const &other) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        kernel_2d_fixed() (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inline
        kernel_2d_fixed() (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inline
        kernel_2d_fixed(std::size_t center_y, std::size_t center_x) (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inlineexplicit
        kernel_2d_fixed(FwdIterator elements, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inlineexplicit
        kernel_2d_fixed(FwdIterator elements, std::size_t center_y, std::size_t center_x) (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inlineexplicit
        kernel_2d_fixed(kernel_2d_fixed const &other) (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >inline
        left_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        left_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        lower_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        operator=(kernel_2d_fixed const &other)=default (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >
        operator=(kernel_2d_fixed const &other)=default (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >
        operator=(kernel_2d_adaptor const &other) (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        right_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        right_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        square_size (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >protected
        square_size (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >protected
        static_size (defined in kernel_2d_fixed< T, Size >)kernel_2d_fixed< T, Size >static
        upper_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        upper_size() const (defined in kernel_2d_adaptor< Core >)kernel_2d_adaptor< Core >inline
        diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed.html b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed.html index e48d535f8..08af13da0 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1kernel__2d__fixed.html @@ -4,7 +4,7 @@ - + Generic Image Library: kernel_2d_fixed< T, Size > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        kernel_2d_fixed< T, Size > Class Template Reference
        +
        kernel_2d_fixed< T, Size > Class Template Reference
        @@ -59,33 +59,31 @@ $(function() {

        Inherits kernel_2d_adaptor< Core >.

        - - - - - - +

        +

        Public Member Functions

        +
         kernel_2d_fixed (std::size_t center_y, std::size_t center_x)
         
        +
        template<typename FwdIterator >
         kernel_2d_fixed (FwdIterator elements, std::size_t center_y, std::size_t center_x)
         
        +
         kernel_2d_fixed (kernel_2d_fixed const &other)
         
        +
        kernel_2d_fixedoperator= (kernel_2d_fixed const &other)=default
         
         
        - -

        +

        Static Public Attributes

        +
        static constexpr std::size_t static_size = Size
         

        Detailed Description

        -

        template<typename T, std::size_t Size>
        -class boost::gil::detail::kernel_2d_fixed< T, Size >

        - -

        static-size kernel

        +
        template<typename T, std::size_t Size>
        +class boost::gil::detail::kernel_2d_fixed< T, Size >

        static-size kernel


        The documentation for this class was generated from the following file: @@ -95,7 +93,7 @@ class boost::gil::detail::kernel_2d_fixed< T, Size > diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1ostream__device-members.html b/html/reference/classboost_1_1gil_1_1detail_1_1ostream__device-members.html index 80ea9b936..9e9f3caea 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1ostream__device-members.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1ostream__device-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ostream_device< FormatTag > Member List
        +
        ostream_device< FormatTag > Member List

        This is the complete list of members for ostream_device< FormatTag >, including all inherited members.

        - + - + - + - + - + - +
        error() (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        flush() (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        flush() (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        ostream_device(std::ostream &out) (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        print_line(const std::string &line)ostream_device< FormatTag >inline
        print_line(const std::string &line)ostream_device< FormatTag >inline
        read(byte_t *, std::size_t) (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        seek(long count, int whence) (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        seek(long count, int whence) (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        tell() (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        write(const byte_t *data, std::size_t count) (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        write(const byte_t *data, std::size_t count) (defined in ostream_device< FormatTag >)ostream_device< FormatTag >inline
        write(const T(&buf)[N])ostream_device< FormatTag >inline
        write_uint16(uint16_t x)ostream_device< FormatTag >inline
        write_uint16(uint16_t x)ostream_device< FormatTag >inline
        write_uint32(uint32_t x)ostream_device< FormatTag >inline
        write_uint8(uint8_t x)ostream_device< FormatTag >inline
        write_uint8(uint8_t x)ostream_device< FormatTag >inline
        diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1ostream__device.html b/html/reference/classboost_1_1gil_1_1detail_1_1ostream__device.html index 07435b383..09602db3b 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1ostream__device.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1ostream__device.html @@ -4,7 +4,7 @@ - + Generic Image Library: ostream_device< FormatTag > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +

        #include <device.hpp>

        - - - - - - - - + - + - + - + - - + -

        +

        Public Member Functions

        +
         ostream_device (std::ostream &out)
         
        +
        std::size_t read (byte_t *, std::size_t)
         
        +
        void seek (long count, int whence)
         
        +
        long int tell ()
         
        +
        void write (const byte_t *data, std::size_t count)
         
        +
        template<typename T , std::size_t N>
        void write (const T(&buf)[N])
        void write (const T(&buf)[N])
         Writes array.
         
        -void write_uint8 (uint8_t x)
        +void write_uint8 (uint8_t x)
         Writes byte.
         
        -void write_uint16 (uint16_t x)
        +void write_uint16 (uint16_t x)
         Writes 16 bit little endian integer.
         
        -void write_uint32 (uint32_t x)
        +void write_uint32 (uint32_t x)
         Writes 32 bit little endian integer.
         
        +
        void flush ()
         
        -void print_line (const std::string &line)
        +void print_line (const std::string &line)
         Prints formatted ASCII text.
         
        +
        int error ()
         

        Detailed Description

        -

        template<typename FormatTag>
        -class boost::gil::detail::ostream_device< FormatTag >

        - -

        Output stream device

        +
        template<typename FormatTag>
        +class boost::gil::detail::ostream_device< FormatTag >

        Output stream device


        The documentation for this class was generated from the following file: @@ -112,7 +110,7 @@ class boost::gil::detail::ostream_device< FormatTag > diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor-members.html b/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor-members.html index 6aeb96b47..56d9cece7 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor-members.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        step_iterator_adaptor< Derived, Iterator, SFn > Member List
        +
        step_iterator_adaptor< Derived, Iterator, SFn > Member List

        This is the complete list of members for step_iterator_adaptor< Derived, Iterator, SFn >, including all inherited members.

        - + - + - + - +
        _step_fn (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >protected
        base_difference_type typedef (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >
        base_difference_type typedef (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >
        boost::iterator_core_access (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >friend
        difference_type typedef (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >
        difference_type typedef (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >
        parent_t typedef (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >
        reference typedef (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >
        reference typedef (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >
        step() const -> difference_type (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >inline
        step_iterator_adaptor() (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >inline
        step_iterator_adaptor() (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >inline
        step_iterator_adaptor(Iterator const &it, SFn step_fn=SFn()) (defined in step_iterator_adaptor< Derived, Iterator, SFn >)step_iterator_adaptor< Derived, Iterator, SFn >inline
        @@ -65,7 +65,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor.html b/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor.html index 8a37cf74e..e0d52c45b 100644 --- a/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor.html +++ b/html/reference/classboost_1_1gil_1_1detail_1_1step__iterator__adaptor.html @@ -4,7 +4,7 @@ - + Generic Image Library: step_iterator_adaptor< Derived, Iterator, SFn > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        step_iterator_adaptor< Derived, Iterator, SFn > Class Template Reference
        +
        step_iterator_adaptor< Derived, Iterator, SFn > Class Template Reference
        @@ -61,47 +61,45 @@ $(function() {

        Inherits iterator_adaptor< Derived, Iterator, use_default, use_default, use_default, SFn::difference_type >.

        - - - - -

        +

        Public Types

        +
        using parent_t = iterator_adaptor< Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type >
         
        +
        using base_difference_type = typename std::iterator_traits< Iterator >::difference_type
         
        +
        using difference_type = typename SFn::difference_type
         
        +
        using reference = typename std::iterator_traits< Iterator >::reference
         
        - - -

        +

        Public Member Functions

        +
         step_iterator_adaptor (Iterator const &it, SFn step_fn=SFn())
         
        +
        auto step () const -> difference_type
         
        - -

        +

        Protected Attributes

        +
        SFn _step_fn
         
        - -

        +

        Friends

        +
        class boost::iterator_core_access
         

        Detailed Description

        -

        template<typename Derived, typename Iterator, typename SFn>
        -class boost::gil::detail::step_iterator_adaptor< Derived, Iterator, SFn >

        - -

        An adaptor over an existing iterator that changes the step unit.

        +
        template<typename Derived, typename Iterator, typename SFn>
        +class boost::gil::detail::step_iterator_adaptor< Derived, Iterator, SFn >

        An adaptor over an existing iterator that changes the step unit.

        (i.e. distance(it,it+1)) by a given predicate. Instead of calling base's operators ++, –, +=, -=, etc. the adaptor is using the passed policy object SFn for advancing and for computing the distance between iterators.


        The documentation for this class was generated from the following file:
        • step_iterator.hpp
        • @@ -112,7 +110,7 @@ class boost::gil::detail::step_iterator_adaptor< Derived, Iterator, SFn >< diff --git a/html/reference/classboost_1_1gil_1_1histogram-members.html b/html/reference/classboost_1_1gil_1_1histogram-members.html index ba163ad92..2d5d13ea1 100644 --- a/html/reference/classboost_1_1gil_1_1histogram-members.html +++ b/html/reference/classboost_1_1gil_1_1histogram-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        histogram< T > Member List
        +
        histogram< T > Member List

        This is the complete list of members for histogram< T >, including all inherited members.

        - - - + + + - + - + - + - - - + + + - +
        dimension()histogram< T >inlinestatic
        equals(OtherType const &otherhist) consthistogram< T >inline
        fill(SrcView const &srcview, std::size_t bin_width=1, bool applymask=false, std::vector< std::vector< bool >> mask={}, key_t lower=key_t(), key_t upper=key_t(), bool setlimits=false)histogram< T >inline
        histogram()=default (defined in histogram< T >)histogram< T >
        equals(OtherType const &otherhist) consthistogram< T >inline
        fill(SrcView const &srcview, std::size_t bin_width=1, bool applymask=false, std::vector< std::vector< bool > > mask={}, key_t lower=key_t(), key_t upper=key_t(), bool setlimits=false)histogram< T >inline
        histogram()=default (defined in histogram< T >)histogram< T >
        is_pixel_compatible()histogram< T >inlinestatic
        is_tuple_compatible(Tuple const &)histogram< T >inline
        is_tuple_compatible(Tuple const &)histogram< T >inline
        key_from_pixel(Pixel const &p) consthistogram< T >inline
        key_from_tuple(Tuple const &t) consthistogram< T >inline
        key_from_tuple(Tuple const &t) consthistogram< T >inline
        max_key() consthistogram< T >inline
        min_key() consthistogram< T >inline
        min_key() consthistogram< T >inline
        nearest_key(key_t const &k) consthistogram< T >inline
        normalize()histogram< T >inline
        operator()(T... indices)histogram< T >inline
        sorted_keys() consthistogram< T >inline
        normalize()histogram< T >inline
        operator()(T... indices)histogram< T >inline
        sorted_keys() consthistogram< T >inline
        sub_histogram(Tuple const &t1, Tuple const &t2)histogram< T >inline
        sub_histogram()histogram< T >inline
        sub_histogram()histogram< T >inline
        sum() consthistogram< T >inline
        @@ -73,7 +73,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1histogram.html b/html/reference/classboost_1_1gil_1_1histogram.html index ddb0283c1..df9ab33cd 100644 --- a/html/reference/classboost_1_1gil_1_1histogram.html +++ b/html/reference/classboost_1_1gil_1_1histogram.html @@ -4,7 +4,7 @@ - + Generic Image Library: histogram< T > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        histogram< T > Class Template Reference
        +
        histogram< T > Class Template Reference
        @@ -59,90 +59,89 @@ $(function() {

        Inherits unordered_map< std::tuple< T... >, double, detail::hash_tuple< T... > >.

        - - - - - + + + - + - - + - - + - - + - + - - - - - + + + - + - - - - - + + + + - + - + - + - - - + + +

        +

        Public Member Functions

        -mapped_t & operator() (T... indices)
         Returns bin value corresponding to specified tuple.
         
        +
        +mapped_t & operator() (T... indices)
         Returns bin value corresponding to specified tuple.
         
        template<typename OtherType >
        bool equals (OtherType const &otherhist) const
        bool equals (OtherType const &otherhist) const
         Checks if 2 histograms are equal. Ignores type, and checks if the keys (after type casting) match.
         
        +
        template<typename Tuple >
        bool is_tuple_compatible (Tuple const &)
        bool is_tuple_compatible (Tuple const &)
         Checks if the histogram class is compatible to be used with the specified tuple type.
         
        +
        template<std::size_t... Dimensions, typename Tuple >
        key_t key_from_tuple (Tuple const &t) const
        key_t key_from_tuple (Tuple const &t) const
         Returns a key compatible to be used as the histogram key from the input tuple.
         
        +
        template<std::size_t... Dimensions, typename Pixel >
        key_t key_from_pixel (Pixel const &p) const
        key_t key_from_pixel (Pixel const &p) const
         Returns a histogram compatible key from the input pixel which can be directly used.
         
        -key_t nearest_key (key_t const &k) const
        +key_t nearest_key (key_t const &k) const
         Return nearest smaller key to specified histogram key.
         
        +
        template<std::size_t... Dimensions, typename SrcView >
        void fill (SrcView const &srcview, std::size_t bin_width=1, bool applymask=false, std::vector< std::vector< bool >> mask={}, key_t lower=key_t(), key_t upper=key_t(), bool setlimits=false)
         Fills the histogram with the input image view.
         
        +
        void fill (SrcView const &srcview, std::size_t bin_width=1, bool applymask=false, std::vector< std::vector< bool > > mask={}, key_t lower=key_t(), key_t upper=key_t(), bool setlimits=false)
         Fills the histogram with the input image view.
         
        template<std::size_t... Dimensions, typename Tuple >
        histogram sub_histogram (Tuple const &t1, Tuple const &t2)
        histogram sub_histogram (Tuple const &t1, Tuple const &t2)
         Can return a subset or a mask over the current histogram.
         
        +
        template<std::size_t... Dimensions>
        histogram< boost::mp11::mp_at< bin_t, boost::mp11::mp_size_t< Dimensions > >... > sub_histogram ()
         Returns a sub-histogram over specified axes.
         
        -void normalize ()
        histogram< boost::mp11::mp_at< bin_t, boost::mp11::mp_size_t< Dimensions > >... > sub_histogram ()
         Returns a sub-histogram over specified axes.
         
        +void normalize ()
         Normalize this histogram class.
         
        -double sum () const
        +double sum () const
         Return the sum count of all bins.
         
        -key_t min_key () const
        +key_t min_key () const
         Return the minimum key in histogram.
         
        -key_t max_key () const
        +key_t max_key () const
         Return the maximum key in histogram.
         
        -std::vector< key_t > sorted_keys () const
         Return sorted keys in a vector.
         
        +std::vector< key_t > sorted_keys () const
         Return sorted keys in a vector.
         
        - - + - +

        +

        Static Public Member Functions

        -static constexpr std::size_t dimension ()
        +static constexpr std::size_t dimension ()
         Returns the number of dimensions(axes) the class supports.
         
        -static constexpr bool is_pixel_compatible ()
        +static constexpr bool is_pixel_compatible ()
         Checks if the histogram class is compatible to be used with a GIL image type.
         

        Detailed Description

        -

        template<typename... T>
        -class boost::gil::histogram< T >

        - -

        Default histogram class provided by boost::gil.

        -

        The class inherits over the std::unordered_map provided by STL. A complete example/tutorial of how to use the class resides in the docs. Simple calling syntax for a 3D dimensional histogram :

        histogram<int, int , int> h;
        +
        template<typename... T>
        +class boost::gil::histogram< T >

        Default histogram class provided by boost::gil.

        +

        The class inherits over the std::unordered_map provided by STL. A complete example/tutorial of how to use the class resides in the docs. Simple calling syntax for a 3D dimensional histogram :

        h(1, 1, 1) = 0;
        +
        Default histogram class provided by boost::gil.
        Definition histogram.hpp:215

        This is just a starter to what all can be achieved with it, refer to the docs for the full demo.


        The documentation for this class was generated from the following file:
        • histogram.hpp
        • @@ -153,7 +152,7 @@ class boost::gil::histogram< T > diff --git a/html/reference/classboost_1_1gil_1_1image-members.html b/html/reference/classboost_1_1gil_1_1image-members.html index b1f686084..20dfbf9a9 100644 --- a/html/reference/classboost_1_1gil_1_1image-members.html +++ b/html/reference/classboost_1_1gil_1_1image-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        image< Pixel, IsPlanar, Alloc > Member List
        +
        image< Pixel, IsPlanar, Alloc > Member List

        This is the complete list of members for image< Pixel, IsPlanar, Alloc >, including all inherited members.

        - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
        _view (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        allocator() (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        allocator() (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        allocator() const (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        allocator_type typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        allocator_type typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        const_view_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        coord_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        coord_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        dimensions() const (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        height() const (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        height() const (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >friend
        image(std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inlineexplicit
        image(std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inlineexplicit
        image(point_t const &dimensions, std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(x_coord_t width, y_coord_t height, std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(x_coord_t width, y_coord_t height, std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(point_t const &dimensions, const Pixel &p_in, std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(const image &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(const image< P2, IP2, Alloc2 > &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(const image< P2, IP2, Alloc2 > &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(const image_view< Loc > &view, std::size_t alignment=0, const Alloc alloc_in=Alloc()) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(image &&img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        image(image &&img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        operator=(const image &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        operator=(const Img &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        operator=(const Img &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        operator=(image &&img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        point_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        point_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        recreate(point_t const &dims, std::size_t alignment=0) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(x_coord_t width, y_coord_t height, std::size_t alignment=0) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(x_coord_t width, y_coord_t height, std::size_t alignment=0) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(point_t const &dims, const Pixel &p_in, std::size_t alignment=0) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment=0) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment=0) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(point_t const &dims, std::size_t alignment, const Alloc alloc_in) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(point_t const &dims, const Pixel &p_in, std::size_t alignment, const Alloc alloc_in) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment, const Alloc alloc_in) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        recreate(x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment, const Alloc alloc_in) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        swap(image &img) (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        value_type typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        value_type typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        view_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        width() const (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        width() const (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        x_coord_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        y_coord_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        y_coord_t typedef (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >
        ~image() (defined in image< Pixel, IsPlanar, Alloc >)image< Pixel, IsPlanar, Alloc >inline
        @@ -93,7 +93,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1image.html b/html/reference/classboost_1_1gil_1_1image.html index 935b0c233..1f765449f 100644 --- a/html/reference/classboost_1_1gil_1_1image.html +++ b/html/reference/classboost_1_1gil_1_1image.html @@ -4,7 +4,7 @@ - + Generic Image Library: image< Pixel, IsPlanar, Alloc > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        image< Pixel, IsPlanar, Alloc > Class Template Reference
        +
        image< Pixel, IsPlanar, Alloc > Class Template Reference
        @@ -58,128 +58,126 @@ $(function() {

        #include <image.hpp>

        - - - - - - - - -

        +

        Public Types

        +
        using allocator_type = typename std::allocator_traits< Alloc >::template rebind_alloc< unsigned char >
         
        +
        using view_t = typename view_type_from_pixel< Pixel, IsPlanar >::type
         
        +
        using const_view_t = typename view_t::const_t
         
        +
        using point_t = typename view_t::point_t
         
        +
        using coord_t = typename view_t::coord_t
         
        +
        using value_type = typename view_t::value_type
         
        +
        using x_coord_t = coord_t
         
        +
        using y_coord_t = coord_t
         
        - - - - + + - - - - - - - - - - + + - - - - + - - - + + - - + - - - - + + + - - - - - - - -

        +

        Public Member Functions

        -point_t const & dimensions () const
         
        +
        +point_t const & dimensions () const
         
        x_coord_t width () const
         
        +
        y_coord_t height () const
         
        +
         image (std::size_t alignment=0, const Alloc alloc_in=Alloc())
         
        +
         image (point_t const &dimensions, std::size_t alignment=0, const Alloc alloc_in=Alloc())
         
        +
         image (x_coord_t width, y_coord_t height, std::size_t alignment=0, const Alloc alloc_in=Alloc())
         
        +
         image (point_t const &dimensions, const Pixel &p_in, std::size_t alignment=0, const Alloc alloc_in=Alloc())
         
        +
         image (x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment=0, const Alloc alloc_in=Alloc())
         
        +
         image (const image &img)
         
        +
        template<typename P2 , bool IP2, typename Alloc2 >
         image (const image< P2, IP2, Alloc2 > &img)
         
        -template<typename Loc , typename std::enable_if< pixels_are_compatible< typename Loc::value_type, Pixel >::value, int >::type = 0>
         image (const image_view< Loc > &view, std::size_t alignment=0, const Alloc alloc_in=Alloc())
        +template<typename Loc , typename std::enable_if< pixels_are_compatible< typename Loc::value_type, Pixel >::value, int >::type = 0>
         image (const image_view< Loc > &view, std::size_t alignment=0, const Alloc alloc_in=Alloc())
         
        +
         image (image &&img)
         
        +
        imageoperator= (const image &img)
         
        +
         
        template<typename Img >
        imageoperator= (const Img &img)
         
        +
        imageoperator= (const Img &img)
         
        imageoperator= (image &&img)
         
        +
         
        Alloc & allocator ()
         
        -Alloc const & allocator () const
         
        +
         
        +Alloc const & allocator () const
         
        void swap (image &img)
         
        +
        void recreate (point_t const &dims, std::size_t alignment=0)
         
        +
        void recreate (x_coord_t width, y_coord_t height, std::size_t alignment=0)
         
        +
        void recreate (point_t const &dims, const Pixel &p_in, std::size_t alignment=0)
         
        +
        void recreate (x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment=0)
         
        +
        void recreate (point_t const &dims, std::size_t alignment, const Alloc alloc_in)
         
        +
        void recreate (x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in)
         
        +
        void recreate (point_t const &dims, const Pixel &p_in, std::size_t alignment, const Alloc alloc_in)
         
        +
        void recreate (x_coord_t width, y_coord_t height, const Pixel &p_in, std::size_t alignment, const Alloc alloc_in)
         
        - -

        +

        Public Attributes

        +
        view_t _view
         

        Detailed Description

        -

        template<typename Pixel, bool IsPlanar, typename Alloc>
        -class boost::gil::image< Pixel, IsPlanar, Alloc >

        - -

        container interface over image view. Models ImageConcept, PixelBasedConcept

        +
        template<typename Pixel, bool IsPlanar, typename Alloc>
        +class boost::gil::image< Pixel, IsPlanar, Alloc >

        container interface over image view. Models ImageConcept, PixelBasedConcept

        A 2D container whose elements are pixels. It is templated over the pixel type, a boolean indicating whether it should be planar, and an optional allocator.

        Note that its element type does not have to be a pixel. image can be instantiated with any Regular element, in which case it models the weaker RandomAccess2DImageConcept and does not model PixelBasedConcept

        When recreating an image of the same or smaller size the memory will be reused if possible.

        @@ -192,7 +190,7 @@ class boost::gil::image< Pixel, IsPlanar, Alloc > diff --git a/html/reference/classboost_1_1gil_1_1image__view-members.html b/html/reference/classboost_1_1gil_1_1image__view-members.html index a90b165ba..fb86afcdd 100644 --- a/html/reference/classboost_1_1gil_1_1image__view-members.html +++ b/html/reference/classboost_1_1gil_1_1image__view-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        image_view< Loc > Member List
        +
        image_view< Loc > Member List

        This is the complete list of members for image_view< Loc >, including all inherited members.

        - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
        at(difference_type i) const -> iterator (defined in image_view< Loc >)image_view< Loc >inline
        at(point_t const &p) const -> iterator (defined in image_view< Loc >)image_view< Loc >inline
        at(point_t const &p) const -> iterator (defined in image_view< Loc >)image_view< Loc >inline
        at(x_coord_t x, y_coord_t y) const -> iterator (defined in image_view< Loc >)image_view< Loc >inline
        axis_iterator(point_t const &p) const -> typename axis< D >::iterator (defined in image_view< Loc >)image_view< Loc >inline
        axis_iterator(point_t const &p) const -> typename axis< D >::iterator (defined in image_view< Loc >)image_view< Loc >inline
        back() const -> referenceimage_view< Loc >inline
        begin() const -> iterator (defined in image_view< Loc >)image_view< Loc >inline
        begin() const -> iterator (defined in image_view< Loc >)image_view< Loc >inline
        col_begin(x_coord_t x) const -> y_iterator (defined in image_view< Loc >)image_view< Loc >inline
        col_end(x_coord_t x) const -> y_iterator (defined in image_view< Loc >)image_view< Loc >inline
        col_end(x_coord_t x) const -> y_iterator (defined in image_view< Loc >)image_view< Loc >inline
        const_iterator typedef (defined in image_view< Loc >)image_view< Loc >
        const_reference typedef (defined in image_view< Loc >)image_view< Loc >
        const_reference typedef (defined in image_view< Loc >)image_view< Loc >
        const_t typedef (defined in image_view< Loc >)image_view< Loc >
        coord_t typedef (defined in image_view< Loc >)image_view< Loc >
        coord_t typedef (defined in image_view< Loc >)image_view< Loc >
        difference_type typedef (defined in image_view< Loc >)image_view< Loc >
        dimensions() const -> point_t const & (defined in image_view< Loc >)image_view< Loc >inline
        dimensions() const -> point_t const & (defined in image_view< Loc >)image_view< Loc >inline
        empty() constimage_view< Loc >inline
        end() const -> iterator (defined in image_view< Loc >)image_view< Loc >inline
        end() const -> iterator (defined in image_view< Loc >)image_view< Loc >inline
        front() const -> referenceimage_view< Loc >inline
        height() const -> y_coord_t (defined in image_view< Loc >)image_view< Loc >inline
        height() const -> y_coord_t (defined in image_view< Loc >)image_view< Loc >inline
        image_view (defined in image_view< Loc >)image_view< Loc >friend
        image_view() (defined in image_view< Loc >)image_view< Loc >inline
        image_view() (defined in image_view< Loc >)image_view< Loc >inline
        image_view(image_view const &img_view) (defined in image_view< Loc >)image_view< Loc >inline
        image_view(View const &view) (defined in image_view< Loc >)image_view< Loc >inline
        image_view(View const &view) (defined in image_view< Loc >)image_view< Loc >inline
        image_view(point_t const &dims, L2 const &loc) (defined in image_view< Loc >)image_view< Loc >inline
        image_view(coord_t width, coord_t height, L2 const &loc) (defined in image_view< Loc >)image_view< Loc >inline
        image_view(coord_t width, coord_t height, L2 const &loc) (defined in image_view< Loc >)image_view< Loc >inline
        is_1d_traversable() const (defined in image_view< Loc >)image_view< Loc >inline
        iterator typedef (defined in image_view< Loc >)image_view< Loc >
        iterator typedef (defined in image_view< Loc >)image_view< Loc >
        locator typedef (defined in image_view< Loc >)image_view< Loc >
        num_channels() const -> std::size_t (defined in image_view< Loc >)image_view< Loc >inline
        num_channels() const -> std::size_t (defined in image_view< Loc >)image_view< Loc >inline
        num_dimensions (defined in image_view< Loc >)image_view< Loc >static
        operator!=(View const &view) const (defined in image_view< Loc >)image_view< Loc >inline
        operator!=(View const &view) const (defined in image_view< Loc >)image_view< Loc >inline
        operator()(point_t const &p) const -> reference (defined in image_view< Loc >)image_view< Loc >inline
        operator()(x_coord_t x, y_coord_t y) const -> reference (defined in image_view< Loc >)image_view< Loc >inline
        operator()(x_coord_t x, y_coord_t y) const -> reference (defined in image_view< Loc >)image_view< Loc >inline
        operator=(View const &view) (defined in image_view< Loc >)image_view< Loc >inline
        operator=(image_view const &view) (defined in image_view< Loc >)image_view< Loc >inline
        operator=(image_view const &view) (defined in image_view< Loc >)image_view< Loc >inline
        operator==(View const &view) const (defined in image_view< Loc >)image_view< Loc >inline
        operator[](difference_type i) const -> reference (defined in image_view< Loc >)image_view< Loc >inline
        operator[](difference_type i) const -> reference (defined in image_view< Loc >)image_view< Loc >inline
        pixels() const -> locator const & (defined in image_view< Loc >)image_view< Loc >inline
        point_t typedef (defined in image_view< Loc >)image_view< Loc >
        point_t typedef (defined in image_view< Loc >)image_view< Loc >
        pointer typedef (defined in image_view< Loc >)image_view< Loc >
        rbegin() const -> reverse_iterator (defined in image_view< Loc >)image_view< Loc >inline
        rbegin() const -> reverse_iterator (defined in image_view< Loc >)image_view< Loc >inline
        reference typedef (defined in image_view< Loc >)image_view< Loc >
        rend() const -> reverse_iterator (defined in image_view< Loc >)image_view< Loc >inline
        rend() const -> reverse_iterator (defined in image_view< Loc >)image_view< Loc >inline
        reverse_iterator typedef (defined in image_view< Loc >)image_view< Loc >
        row_begin(y_coord_t y) const -> x_iterator (defined in image_view< Loc >)image_view< Loc >inline
        row_begin(y_coord_t y) const -> x_iterator (defined in image_view< Loc >)image_view< Loc >inline
        row_end(y_coord_t y) const -> x_iterator (defined in image_view< Loc >)image_view< Loc >inline
        size() const -> size_type (defined in image_view< Loc >)image_view< Loc >inline
        size() const -> size_type (defined in image_view< Loc >)image_view< Loc >inline
        size_type typedef (defined in image_view< Loc >)image_view< Loc >
        swap (defined in image_view< Loc >)image_view< Loc >friend
        swap (defined in image_view< Loc >)image_view< Loc >friend
        swap(image_view< Loc > &other)image_view< Loc >inline
        value_type typedef (defined in image_view< Loc >)image_view< Loc >
        value_type typedef (defined in image_view< Loc >)image_view< Loc >
        width() const -> x_coord_t (defined in image_view< Loc >)image_view< Loc >inline
        x_at(x_coord_t x, y_coord_t y) const -> x_iterator (defined in image_view< Loc >)image_view< Loc >inline
        x_at(x_coord_t x, y_coord_t y) const -> x_iterator (defined in image_view< Loc >)image_view< Loc >inline
        x_at(point_t const &p) const -> x_iterator (defined in image_view< Loc >)image_view< Loc >inline
        x_coord_t typedef (defined in image_view< Loc >)image_view< Loc >
        x_coord_t typedef (defined in image_view< Loc >)image_view< Loc >
        x_iterator typedef (defined in image_view< Loc >)image_view< Loc >
        xy_at(x_coord_t x, y_coord_t y) const -> xy_locator (defined in image_view< Loc >)image_view< Loc >inline
        xy_at(x_coord_t x, y_coord_t y) const -> xy_locator (defined in image_view< Loc >)image_view< Loc >inline
        xy_at(point_t const &p) const -> xy_locator (defined in image_view< Loc >)image_view< Loc >inline
        xy_locator typedef (defined in image_view< Loc >)image_view< Loc >
        xy_locator typedef (defined in image_view< Loc >)image_view< Loc >
        y_at(x_coord_t x, y_coord_t y) const -> y_iterator (defined in image_view< Loc >)image_view< Loc >inline
        y_at(point_t const &p) const -> y_iterator (defined in image_view< Loc >)image_view< Loc >inline
        y_at(point_t const &p) const -> y_iterator (defined in image_view< Loc >)image_view< Loc >inline
        y_coord_t typedef (defined in image_view< Loc >)image_view< Loc >
        y_iterator typedef (defined in image_view< Loc >)image_view< Loc >
        y_iterator typedef (defined in image_view< Loc >)image_view< Loc >
        diff --git a/html/reference/classboost_1_1gil_1_1image__view.html b/html/reference/classboost_1_1gil_1_1image__view.html index 81fc91fa8..6fa8f414c 100644 --- a/html/reference/classboost_1_1gil_1_1image__view.html +++ b/html/reference/classboost_1_1gil_1_1image__view.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_view< Loc > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        image_view< Loc > Class Template Reference
        +
        image_view< Loc > Class Template Reference
        @@ -59,236 +59,232 @@ $(function() {

        #include <image_view.hpp>

        - - - - - - - - - - - - - - - - - - -

        +

        Public Types

        +
        using value_type = typename Loc::value_type
         
        +
        using reference = typename Loc::reference
         
        +
        using coord_t = typename Loc::coord_t
         
        +
        using difference_type = coord_t
         
        +
        using point_t = typename Loc::point_t
         
        +
        using locator = Loc
         
        +
        using const_t = image_view< typename Loc::const_t >
         
        +
        using iterator = iterator_from_2d< Loc >
         
        +
        using const_iterator = typename const_t::iterator
         
        +
        using const_reference = typename const_t::reference
         
        +
        using pointer = typename std::iterator_traits< iterator >::pointer
         
        +
        using reverse_iterator = std::reverse_iterator< iterator >
         
        +
        using size_type = std::size_t
         
        +
        using xy_locator = locator
         
        +
        using x_iterator = typename xy_locator::x_iterator
         
        +
        using y_iterator = typename xy_locator::y_iterator
         
        +
        using x_coord_t = typename xy_locator::x_coord_t
         
        +
        using y_coord_t = typename xy_locator::y_coord_t
         
        - - - - + - - - - - - - - + + + + - + - - + - - + + - - - - - - - - + + - - + + - - + +

        +

        Public Member Functions

        +
         image_view (image_view const &img_view)
         
        +
        template<typename View >
         image_view (View const &view)
         image_view (View const &view)
         
        +
        template<typename L2 >
         image_view (point_t const &dims, L2 const &loc)
         
        +
        template<typename L2 >
         image_view (coord_t width, coord_t height, L2 const &loc)
         
        +
        template<typename View >
        image_viewoperator= (View const &view)
         
        -image_viewoperator= (image_view const &view)
         
        +
        image_viewoperator= (View const &view)
         
        +image_viewoperator= (image_view const &view)
         
        template<typename View >
        bool operator== (View const &view) const
        bool operator== (View const &view) const
         
        +
        template<typename View >
        bool operator!= (View const &view) const
        bool operator!= (View const &view) const
         
        void swap (image_view< Loc > &other)
         Exchanges the elements of the current view with those of other in constant time. More...
        void swap (image_view< Loc > &other)
         Exchanges the elements of the current view with those of other in constant time.
         
        +
        auto dimensions () const -> point_t const &
         
        +
        auto pixels () const -> locator const &
         
        +
        auto width () const -> x_coord_t
         
        +
        auto height () const -> y_coord_t
         
        +
        auto num_channels () const -> std::size_t
         
        +
        bool is_1d_traversable () const
         
        bool empty () const
         Returns true if the view has no elements, false otherwise. More...
        bool empty () const
         Returns true if the view has no elements, false otherwise.
         
        auto front () const -> reference
         Returns a reference to the first element in raster order. More...
        auto front () const -> reference
         Returns a reference to the first element in raster order.
         
        auto back () const -> reference
         Returns a reference to the last element in raster order. More...
        auto back () const -> reference
         Returns a reference to the last element in raster order.
         
        - -

        +

        Static Public Attributes

        +
        static const std::size_t num_dimensions =2
         
        - -

        +

        Friends

        +
        template<typename L2 >
        void swap (image_view< L2 > &lhs, image_view< L2 > &rhs)
         
        - - - - - - -

        Y navigation

        -template<typename L2 >
        class image_view
         
        +
        auto y_at (x_coord_t x, y_coord_t y) const -> y_iterator
         
        +
        auto y_at (point_t const &p) const -> y_iterator
         
        +
        auto col_begin (x_coord_t x) const -> y_iterator
         
        +
        auto col_end (x_coord_t x) const -> y_iterator
         
        - - - - - - - - -

        1D navigation

        +
        auto size () const -> size_type
         
        +
        auto begin () const -> iterator
         
        +
        auto end () const -> iterator
         
        +
        auto rbegin () const -> reverse_iterator
         
        +
        auto rend () const -> reverse_iterator
         
        +
        auto operator[] (difference_type i) const -> reference
         
        +
        auto at (difference_type i) const -> iterator
         
        +
        auto at (point_t const &p) const -> iterator
         
        +
        auto at (x_coord_t x, y_coord_t y) const -> iterator
         
        - - - - + - -

        2-D navigation

        +
        auto operator() (point_t const &p) const -> reference
         
        +
        auto operator() (x_coord_t x, y_coord_t y) const -> reference
         
        +
        template<std::size_t D>
        auto axis_iterator (point_t const &p) const -> typename axis< D >::iterator
        auto axis_iterator (point_t const &p) const -> typename axis< D >::iterator
         
        +
        auto xy_at (x_coord_t x, y_coord_t y) const -> xy_locator
         
        +
        auto xy_at (point_t const &p) const -> xy_locator
         
        - - - -

        X navigation

        +
        auto x_at (x_coord_t x, y_coord_t y) const -> x_iterator
         
        +
        auto x_at (point_t const &p) const -> x_iterator
         
        +
        auto row_begin (y_coord_t y) const -> x_iterator
         
        +
        auto row_end (y_coord_t y) const -> x_iterator
         

        Detailed Description

        -

        template<typename Loc>
        -class boost::gil::image_view< Loc >

        - -

        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept.

        +
        template<typename Loc>
        +class boost::gil::image_view< Loc >

        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept.

        Image view consists of a pixel 2D locator (defining the mechanism for navigating in 2D) and the image dimensions.

        Image views to images are what ranges are to STL containers. They are lightweight objects, that don't own the pixels. It is the user's responsibility that the underlying data remains valid for the lifetime of the image view.

        Similar to iterators and ranges, constness of views does not extend to constness of pixels. A const image_view does not allow changing its location in memory (resizing, moving) but does not prevent one from changing the pixels. The latter requires an image view whose value_type is const.

        -

        Images have interfaces consistent with STL 1D random access containers, so they can be used directly in STL algorithms like:

        std::fill(img.begin(), img.end(), red_pixel);
        -
        void fill(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
        std::fill(I,I,V) with I being a iterator_from_2d
        Definition: algorithm.hpp:369
        +

        Images have interfaces consistent with STL 1D random access containers, so they can be used directly in STL algorithms like:

        std::fill(img.begin(), img.end(), red_pixel);
        +
        void fill(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
        std::fill(I,I,V) with I being a iterator_from_2d
        Definition algorithm.hpp:369

        In addition, horizontal, vertical and 2D random access iterators are provided.

        Note also that image_view does not require that its element type be a pixel. It could be instantiated with a locator whose value_type models only Regular. In this case the image view models the weaker RandomAccess2DImageViewConcept, and does not model PixelBasedConcept. Many generic algorithms don't require the elements to be pixels.

        Member Function Documentation

        - -

        ◆ back()

        + +

        ◆ back()

        +
        +template<typename Loc >
        diff --git a/html/reference/group___color_base_algorithm.html b/html/reference/group___color_base_algorithm.html index 5a507779d..fcb51969b 100644 --- a/html/reference/group___color_base_algorithm.html +++ b/html/reference/group___color_base_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,61 +27,61 @@
        - + +/* @license-end */ +
        -
        -
        Algorithms and Utility Functions
        +
        Algorithms and Utility Functions

        ColorBase algorithms, metafunctions and utility functions. More...

        @@ -314,11 +310,13 @@ class boost::gil::image_view< Loc > - -

        ◆ empty()

        + +

        ◆ empty()

        +
        +template<typename Loc >
        diff --git a/html/reference/group___channel_algorithm.html b/html/reference/group___channel_algorithm.html index f93dad97c..b612ba6fd 100644 --- a/html/reference/group___channel_algorithm.html +++ b/html/reference/group___channel_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,42 +27,42 @@
        - + +/* @license-end */ +
        -
        -
        Algorithms and Utility Functions
        +
        Algorithms and Utility Functions

        Channel algorithms, metafunctions and utility functions. More...

        @@ -343,11 +341,13 @@ class boost::gil::image_view< Loc > - -

        ◆ front()

        + +

        ◆ front()

        +
        +template<typename Loc >
        diff --git a/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html b/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html index 30d716377..88052f660 100644 --- a/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html +++ b/html/reference/extension_2dynamic__image_2algorithm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: algorithm.hpp Source File @@ -27,253 +27,283 @@
        - + +/* @license-end */ + +
        -
        -
        extension/dynamic_image/algorithm.hpp
        +
        extension/dynamic_image/algorithm.hpp
        -Go to the documentation of this file.
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2022 Marco Langer <langer.m86 at gmail dot com>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ALGORITHM_HPP
        -
        10 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ALGORITHM_HPP
        -
        11 
        -
        12 #include <boost/gil/extension/dynamic_image/any_image.hpp>
        -
        13 
        -
        14 #include <boost/gil/algorithm.hpp>
        -
        15 
        -
        16 #include <boost/variant2/variant.hpp>
        -
        17 
        -
        18 #include <functional>
        -
        19 #include <utility>
        -
        20 
        -
        29 
        -
        30 namespace boost { namespace gil {
        -
        31 
        -
        32 namespace detail {
        -
        33 
        -
        34 struct equal_pixels_fn : binary_operation_obj<equal_pixels_fn, bool>
        -
        35 {
        -
        36  template <typename V1, typename V2>
        -
        37  BOOST_FORCEINLINE
        -
        38  bool apply_compatible(V1 const& v1, V2 const& v2) const
        -
        39  {
        -
        40  return equal_pixels(v1, v2);
        -
        41  }
        -
        42 };
        -
        43 
        -
        44 } // namespace detail
        -
        45 
        -
        49 template <typename ...Types, typename View>
        -
        50 auto equal_pixels(any_image_view<Types...> const& src, View const& dst) -> bool
        -
        51 {
        -
        52  return variant2::visit(
        -
        53  std::bind(detail::equal_pixels_fn(), std::placeholders::_1, dst),
        -
        54  src);
        -
        55 }
        -
        56 
        -
        60 template <typename View, typename ...Types>
        -
        61 auto equal_pixels(View const& src, any_image_view<Types...> const& dst) -> bool
        -
        62 {
        -
        63  return variant2::visit(
        -
        64  std::bind(detail::equal_pixels_fn(), src, std::placeholders::_1),
        -
        65  dst);
        -
        66 }
        -
        67 
        -
        71 template <typename ...Types1, typename ...Types2>
        - -
        73 {
        -
        74  return variant2::visit(detail::equal_pixels_fn(), src, dst);
        -
        75 }
        -
        76 
        -
        77 namespace detail {
        -
        78 
        -
        79 struct copy_pixels_fn : public binary_operation_obj<copy_pixels_fn>
        -
        80 {
        -
        81  template <typename View1, typename View2>
        -
        82  BOOST_FORCEINLINE
        -
        83  void apply_compatible(View1 const& src, View2 const& dst) const
        -
        84  {
        -
        85  copy_pixels(src,dst);
        -
        86  }
        -
        87 };
        -
        88 
        -
        89 } // namespace detail
        -
        90 
        -
        94 template <typename ...Types, typename View>
        -
        95 void copy_pixels(any_image_view<Types...> const& src, View const& dst)
        -
        96 {
        -
        97  variant2::visit(std::bind(detail::copy_pixels_fn(), std::placeholders::_1, dst), src);
        -
        98 }
        -
        99 
        -
        103 template <typename ...Types, typename View>
        -
        104 void copy_pixels(View const& src, any_image_view<Types...> const& dst)
        -
        105 {
        -
        106  variant2::visit(std::bind(detail::copy_pixels_fn(), src, std::placeholders::_1), dst);
        -
        107 }
        -
        108 
        -
        112 template <typename ...Types1, typename ...Types2>
        - -
        114 {
        -
        115  variant2::visit(detail::copy_pixels_fn(), src, dst);
        -
        116 }
        -
        117 
        -
        118 //forward declaration for default_color_converter (see full definition in color_convert.hpp)
        -
        119 struct default_color_converter;
        -
        120 
        -
        125 template <typename ...Types, typename View, typename CC>
        -
        126 void copy_and_convert_pixels(any_image_view<Types...> const& src, View const& dst, CC cc)
        -
        127 {
        -
        128  using cc_fn = detail::copy_and_convert_pixels_fn<CC>;
        -
        129  variant2::visit(std::bind(cc_fn{cc}, std::placeholders::_1, dst), src);
        -
        130 }
        -
        131 
        -
        135 template <typename ...Types, typename View>
        -
        136 void copy_and_convert_pixels(any_image_view<Types...> const& src, View const& dst)
        -
        137 {
        -
        138  using cc_fn = detail::copy_and_convert_pixels_fn<default_color_converter>;
        -
        139  variant2::visit(std::bind(cc_fn{}, std::placeholders::_1, dst), src);
        -
        140 }
        -
        141 
        -
        146 template <typename View, typename ...Types, typename CC>
        -
        147 void copy_and_convert_pixels(View const& src, any_image_view<Types...> const& dst, CC cc)
        -
        148 {
        -
        149  using cc_fn = detail::copy_and_convert_pixels_fn<CC>;
        -
        150  variant2::visit(std::bind(cc_fn{cc}, src, std::placeholders::_1), dst);
        -
        151 }
        -
        152 
        -
        156 template <typename View, typename ...Types>
        -
        157 void copy_and_convert_pixels(View const& src, any_image_view<Types...> const& dst)
        -
        158 {
        -
        159  using cc_fn = detail::copy_and_convert_pixels_fn<default_color_converter>;
        -
        160  variant2::visit(std::bind(cc_fn{}, src, std::placeholders::_1), dst);
        -
        161 }
        -
        162 
        -
        167 template <typename ...Types1, typename ...Types2, typename CC>
        - -
        169  any_image_view<Types1...> const& src,
        -
        170  any_image_view<Types2...> const& dst, CC cc)
        -
        171 {
        -
        172  variant2::visit(detail::copy_and_convert_pixels_fn<CC>(cc), src, dst);
        -
        173 }
        -
        174 
        -
        178 template <typename ...Types1, typename ...Types2>
        - -
        180  any_image_view<Types1...> const& src,
        -
        181  any_image_view<Types2...> const& dst)
        -
        182 {
        -
        183  variant2::visit(
        -
        184  detail::copy_and_convert_pixels_fn<default_color_converter>(), src, dst);
        -
        185 }
        -
        186 
        -
        187 namespace detail {
        -
        188 
        -
        189 template <bool IsCompatible>
        -
        190 struct fill_pixels_fn1
        -
        191 {
        -
        192  template <typename V, typename Value>
        -
        193  static void apply(V const& src, Value const& val) { fill_pixels(src, val); }
        -
        194 };
        -
        195 
        -
        196 // copy_pixels invoked on incompatible images
        -
        197 template <>
        -
        198 struct fill_pixels_fn1<false>
        -
        199 {
        -
        200  template <typename V, typename Value>
        -
        201  static void apply(V const&, Value const&) { throw std::bad_cast();}
        -
        202 };
        -
        203 
        -
        204 template <typename Value>
        -
        205 struct fill_pixels_fn
        -
        206 {
        -
        207  fill_pixels_fn(Value const& val) : val_(val) {}
        -
        208 
        -
        209  using result_type = void;
        -
        210  template <typename V>
        -
        211  result_type operator()(V const& view) const
        -
        212  {
        -
        213  fill_pixels_fn1
        -
        214  <
        -
        215  pixels_are_compatible
        -
        216  <
        -
        217  typename V::value_type,
        -
        218  Value
        -
        219  >::value
        -
        220  >::apply(view, val_);
        -
        221  }
        -
        222 
        -
        223  Value val_;
        -
        224 };
        -
        225 
        -
        226 } // namespace detail
        -
        227 
        -
        231 template <typename ...Types, typename Value>
        -
        232 void fill_pixels(any_image_view<Types...> const& view, Value const& val)
        -
        233 {
        -
        234  variant2::visit(detail::fill_pixels_fn<Value>(val), view);
        -
        235 }
        -
        236 
        -
        237 namespace detail {
        -
        238 
        -
        239 template <typename F>
        -
        240 struct for_each_pixel_fn
        -
        241 {
        -
        242  for_each_pixel_fn(F&& fun) : fun_(std::move(fun)) {}
        -
        243 
        -
        244  template <typename View>
        -
        245  auto operator()(View const& view) -> F
        -
        246  {
        -
        247  return for_each_pixel(view, fun_);
        -
        248  }
        -
        249 
        -
        250  F fun_;
        -
        251 };
        -
        252 
        -
        253 } // namespace detail
        -
        254 
        -
        260 template <typename ...Types, typename F>
        -
        261 auto for_each_pixel(any_image_view<Types...> const& view, F fun) -> F
        -
        262 {
        -
        263  return variant2::visit(detail::for_each_pixel_fn<F>(std::move(fun)), view);
        -
        264 }
        -
        265 
        -
        266 }} // namespace boost::gil
        -
        267 
        -
        268 #endif
        -
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition: any_image_view.hpp:76
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        void copy_and_convert_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
        Definition: extension/dynamic_image/algorithm.hpp:179
        -
        void copy_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
        Definition: extension/dynamic_image/algorithm.hpp:113
        -
        auto equal_pixels(any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst) -> bool
        Definition: extension/dynamic_image/algorithm.hpp:72
        -
        void fill_pixels(any_image_view< Types... > const &view, Value const &val)
        fill_pixels for any image view. The pixel to fill with must be compatible with the current view
        Definition: extension/dynamic_image/algorithm.hpp:232
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +Go to the documentation of this file.
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2022 Marco Langer <langer.m86 at gmail dot com>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ALGORITHM_HPP
        +
        10#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_ALGORITHM_HPP
        +
        11
        +
        12#include <boost/gil/extension/dynamic_image/any_image.hpp>
        +
        13
        +
        14#include <boost/gil/algorithm.hpp>
        +
        15
        +
        16#include <boost/variant2/variant.hpp>
        +
        17
        +
        18#include <functional>
        +
        19#include <utility>
        +
        20
        +
        29
        +
        30namespace boost { namespace gil {
        +
        31
        +
        32namespace detail {
        +
        33
        +
        34struct equal_pixels_fn : binary_operation_obj<equal_pixels_fn, bool>
        +
        35{
        +
        36 template <typename V1, typename V2>
        +
        37 BOOST_FORCEINLINE
        +
        38 bool apply_compatible(V1 const& v1, V2 const& v2) const
        +
        39 {
        +
        40 return equal_pixels(v1, v2);
        +
        41 }
        +
        42};
        +
        43
        +
        44} // namespace detail
        +
        45
        +
        49template <typename ...Types, typename View>
        +
        +
        50auto equal_pixels(any_image_view<Types...> const& src, View const& dst) -> bool
        +
        51{
        +
        52 return variant2::visit(
        +
        53 std::bind(detail::equal_pixels_fn(), std::placeholders::_1, dst),
        +
        54 src);
        +
        55}
        +
        +
        56
        +
        60template <typename View, typename ...Types>
        +
        +
        61auto equal_pixels(View const& src, any_image_view<Types...> const& dst) -> bool
        +
        62{
        +
        63 return variant2::visit(
        +
        64 std::bind(detail::equal_pixels_fn(), src, std::placeholders::_1),
        +
        65 dst);
        +
        66}
        +
        +
        67
        +
        71template <typename ...Types1, typename ...Types2>
        +
        + +
        73{
        +
        74 return variant2::visit(detail::equal_pixels_fn(), src, dst);
        +
        75}
        +
        +
        76
        +
        77namespace detail {
        +
        78
        +
        79struct copy_pixels_fn : public binary_operation_obj<copy_pixels_fn>
        +
        80{
        +
        81 template <typename View1, typename View2>
        +
        82 BOOST_FORCEINLINE
        +
        83 void apply_compatible(View1 const& src, View2 const& dst) const
        +
        84 {
        +
        85 copy_pixels(src,dst);
        +
        86 }
        +
        87};
        +
        88
        +
        89} // namespace detail
        +
        90
        +
        94template <typename ...Types, typename View>
        +
        +
        95void copy_pixels(any_image_view<Types...> const& src, View const& dst)
        +
        96{
        +
        97 variant2::visit(std::bind(detail::copy_pixels_fn(), std::placeholders::_1, dst), src);
        +
        98}
        +
        +
        99
        +
        103template <typename ...Types, typename View>
        +
        +
        104void copy_pixels(View const& src, any_image_view<Types...> const& dst)
        +
        105{
        +
        106 variant2::visit(std::bind(detail::copy_pixels_fn(), src, std::placeholders::_1), dst);
        +
        107}
        +
        +
        108
        +
        112template <typename ...Types1, typename ...Types2>
        +
        + +
        114{
        +
        115 variant2::visit(detail::copy_pixels_fn(), src, dst);
        +
        116}
        +
        +
        117
        +
        118//forward declaration for default_color_converter (see full definition in color_convert.hpp)
        +
        119struct default_color_converter;
        +
        120
        +
        125template <typename ...Types, typename View, typename CC>
        +
        +
        126void copy_and_convert_pixels(any_image_view<Types...> const& src, View const& dst, CC cc)
        +
        127{
        +
        128 using cc_fn = detail::copy_and_convert_pixels_fn<CC>;
        +
        129 variant2::visit(std::bind(cc_fn{cc}, std::placeholders::_1, dst), src);
        +
        130}
        +
        +
        131
        +
        135template <typename ...Types, typename View>
        +
        +
        136void copy_and_convert_pixels(any_image_view<Types...> const& src, View const& dst)
        +
        137{
        +
        138 using cc_fn = detail::copy_and_convert_pixels_fn<default_color_converter>;
        +
        139 variant2::visit(std::bind(cc_fn{}, std::placeholders::_1, dst), src);
        +
        140}
        +
        +
        141
        +
        146template <typename View, typename ...Types, typename CC>
        +
        +
        147void copy_and_convert_pixels(View const& src, any_image_view<Types...> const& dst, CC cc)
        +
        148{
        +
        149 using cc_fn = detail::copy_and_convert_pixels_fn<CC>;
        +
        150 variant2::visit(std::bind(cc_fn{cc}, src, std::placeholders::_1), dst);
        +
        151}
        +
        +
        152
        +
        156template <typename View, typename ...Types>
        +
        +
        157void copy_and_convert_pixels(View const& src, any_image_view<Types...> const& dst)
        +
        158{
        +
        159 using cc_fn = detail::copy_and_convert_pixels_fn<default_color_converter>;
        +
        160 variant2::visit(std::bind(cc_fn{}, src, std::placeholders::_1), dst);
        +
        161}
        +
        +
        162
        +
        167template <typename ...Types1, typename ...Types2, typename CC>
        +
        +
        168void copy_and_convert_pixels(
        +
        169 any_image_view<Types1...> const& src,
        +
        170 any_image_view<Types2...> const& dst, CC cc)
        +
        171{
        +
        172 variant2::visit(detail::copy_and_convert_pixels_fn<CC>(cc), src, dst);
        +
        173}
        +
        +
        174
        +
        178template <typename ...Types1, typename ...Types2>
        +
        +
        179void copy_and_convert_pixels(
        +
        180 any_image_view<Types1...> const& src,
        +
        181 any_image_view<Types2...> const& dst)
        +
        182{
        +
        183 variant2::visit(
        +
        184 detail::copy_and_convert_pixels_fn<default_color_converter>(), src, dst);
        +
        185}
        +
        +
        186
        +
        187namespace detail {
        +
        188
        +
        189template <bool IsCompatible>
        +
        190struct fill_pixels_fn1
        +
        191{
        +
        192 template <typename V, typename Value>
        +
        193 static void apply(V const& src, Value const& val) { fill_pixels(src, val); }
        +
        194};
        +
        195
        +
        196// copy_pixels invoked on incompatible images
        +
        197template <>
        +
        198struct fill_pixels_fn1<false>
        +
        199{
        +
        200 template <typename V, typename Value>
        +
        201 static void apply(V const&, Value const&) { throw std::bad_cast();}
        +
        202};
        +
        203
        +
        204template <typename Value>
        +
        205struct fill_pixels_fn
        +
        206{
        +
        207 fill_pixels_fn(Value const& val) : val_(val) {}
        +
        208
        +
        209 using result_type = void;
        +
        210 template <typename V>
        +
        211 result_type operator()(V const& view) const
        +
        212 {
        +
        213 fill_pixels_fn1
        +
        214 <
        +
        215 pixels_are_compatible
        +
        216 <
        +
        217 typename V::value_type,
        +
        218 Value
        +
        219 >::value
        +
        220 >::apply(view, val_);
        +
        221 }
        +
        222
        +
        223 Value val_;
        +
        224};
        +
        225
        +
        226} // namespace detail
        +
        227
        +
        231template <typename ...Types, typename Value>
        +
        +
        232void fill_pixels(any_image_view<Types...> const& view, Value const& val)
        +
        233{
        +
        234 variant2::visit(detail::fill_pixels_fn<Value>(val), view);
        +
        235}
        +
        +
        236
        +
        237namespace detail {
        +
        238
        +
        239template <typename F>
        +
        240struct for_each_pixel_fn
        +
        241{
        +
        242 for_each_pixel_fn(F&& fun) : fun_(std::move(fun)) {}
        +
        243
        +
        244 template <typename View>
        +
        245 auto operator()(View const& view) -> F
        +
        246 {
        +
        247 return for_each_pixel(view, fun_);
        +
        248 }
        +
        249
        +
        250 F fun_;
        +
        251};
        +
        252
        +
        253} // namespace detail
        +
        254
        +
        260template <typename ...Types, typename F>
        +
        261auto for_each_pixel(any_image_view<Types...> const& view, F fun) -> F
        +
        262{
        +
        263 return variant2::visit(detail::for_each_pixel_fn<F>(std::move(fun)), view);
        +
        264}
        +
        265
        +
        266}} // namespace boost::gil
        +
        267
        +
        268#endif
        +
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition any_image_view.hpp:76
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition algorithm.hpp:292
        +
        BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
        std::equal for image views
        Definition algorithm.hpp:1109
        +
        BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
        std::fill for image views
        Definition algorithm.hpp:420
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/extension_2dynamic__image_2image__view__factory_8hpp_source.html b/html/reference/extension_2dynamic__image_2image__view__factory_8hpp_source.html index 37fa5717d..c6a37f3a4 100644 --- a/html/reference/extension_2dynamic__image_2image__view__factory_8hpp_source.html +++ b/html/reference/extension_2dynamic__image_2image__view__factory_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_view_factory.hpp Source File @@ -27,411 +27,443 @@

        - + +/* @license-end */ + +
        -
        -
        extension/dynamic_image/image_view_factory.hpp
        +
        extension/dynamic_image/image_view_factory.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_IMAGE_VIEW_FACTORY_HPP
        -
        9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_IMAGE_VIEW_FACTORY_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/dynamic_image/any_image_view.hpp>
        -
        12 
        -
        13 #include <boost/gil/dynamic_step.hpp>
        -
        14 #include <boost/gil/image_view_factory.hpp>
        -
        15 #include <boost/gil/point.hpp>
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 
        -
        18 #include <cstdint>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        22 // Methods for constructing any image views from other any image views
        -
        23 // Extends image view factory to runtime type-specified views (any_image_view)
        -
        24 
        -
        25 namespace detail {
        -
        26 
        -
        27 template <typename ResultView>
        -
        28 struct flipped_up_down_view_fn
        -
        29 {
        -
        30  using result_type = ResultView;
        -
        31 
        -
        32  template <typename View>
        -
        33  auto operator()(View const& src) const -> result_type
        -
        34  {
        -
        35  return result_type{flipped_up_down_view(src)};
        -
        36  }
        -
        37 };
        -
        38 
        -
        39 template <typename ResultView>
        -
        40 struct flipped_left_right_view_fn
        -
        41 {
        -
        42  using result_type = ResultView;
        -
        43 
        -
        44  template <typename View>
        -
        45  auto operator()(View const& src) const -> result_type
        -
        46  {
        -
        47  return result_type{flipped_left_right_view(src)};
        -
        48  }
        -
        49 };
        -
        50 
        -
        51 template <typename ResultView>
        -
        52 struct rotated90cw_view_fn
        -
        53 {
        -
        54  using result_type = ResultView;
        -
        55 
        -
        56  template <typename View>
        -
        57  auto operator()(View const& src) const -> result_type
        -
        58  {
        -
        59  return result_type{rotated90cw_view(src)};
        -
        60  }
        -
        61 };
        -
        62 
        -
        63 template <typename ResultView>
        -
        64 struct rotated90ccw_view_fn
        -
        65 {
        -
        66  using result_type = ResultView;
        -
        67 
        -
        68  template <typename View>
        -
        69  auto operator()(View const& src) const -> result_type
        -
        70  {
        -
        71  return result_type{rotated90ccw_view(src)};
        -
        72  }
        -
        73 };
        -
        74 
        -
        75 template <typename ResultView>
        -
        76 struct tranposed_view_fn
        -
        77 {
        -
        78  using result_type = ResultView;
        -
        79 
        -
        80  template <typename View>
        -
        81  auto operator()(View const& src) const -> result_type
        -
        82  {
        -
        83  return result_type{tranposed_view(src)};
        -
        84  }
        -
        85 };
        -
        86 
        -
        87 template <typename ResultView>
        -
        88 struct rotated180_view_fn
        -
        89 {
        -
        90  using result_type = ResultView;
        -
        91 
        -
        92  template <typename View>
        -
        93  auto operator()(View const& src) const -> result_type
        -
        94  {
        -
        95  return result_type{rotated180_view(src)};
        -
        96  }
        -
        97 };
        -
        98 
        -
        99 template <typename ResultView>
        -
        100 struct subimage_view_fn
        -
        101 {
        -
        102  using result_type = ResultView;
        -
        103 
        -
        104  subimage_view_fn(point_t const& topleft, point_t const& dimensions)
        -
        105  : _topleft(topleft), _size2(dimensions)
        -
        106  {}
        -
        107 
        -
        108  template <typename View>
        -
        109  auto operator()(View const& src) const -> result_type
        -
        110  {
        -
        111  return result_type{subimage_view(src,_topleft,_size2)};
        -
        112  }
        -
        113 
        -
        114  point_t _topleft;
        -
        115  point_t _size2;
        -
        116 };
        -
        117 
        -
        118 template <typename ResultView>
        -
        119 struct subsampled_view_fn
        -
        120 {
        -
        121  using result_type = ResultView;
        -
        122 
        -
        123  subsampled_view_fn(point_t const& step) : _step(step) {}
        -
        124 
        -
        125  template <typename View>
        -
        126  auto operator()(View const& src) const -> result_type
        -
        127  {
        -
        128  return result_type{subsampled_view(src,_step)};
        -
        129  }
        -
        130 
        -
        131  point_t _step;
        -
        132 };
        -
        133 
        -
        134 template <typename ResultView>
        -
        135 struct nth_channel_view_fn
        -
        136 {
        -
        137  using result_type = ResultView;
        -
        138 
        -
        139  nth_channel_view_fn(int n) : _n(n) {}
        -
        140 
        -
        141  template <typename View>
        -
        142  auto operator()(View const& src) const -> result_type
        -
        143  {
        -
        144  return result_type(nth_channel_view(src,_n));
        -
        145  }
        -
        146 
        -
        147  int _n;
        -
        148 };
        -
        149 
        -
        150 template <typename DstP, typename ResultView, typename CC = default_color_converter>
        -
        151 struct color_converted_view_fn
        -
        152 {
        -
        153  using result_type = ResultView;
        -
        154 
        -
        155  color_converted_view_fn(CC cc = CC()): _cc(cc) {}
        -
        156 
        -
        157  template <typename View>
        -
        158  auto operator()(View const& src) const -> result_type
        -
        159  {
        -
        160  return result_type{color_converted_view<DstP>(src, _cc)};
        -
        161  }
        -
        162 
        -
        163 private:
        -
        164  CC _cc;
        -
        165 };
        -
        166 
        -
        167 } // namespace detail
        -
        168 
        -
        171 template <typename ...Views>
        -
        172 inline
        - -
        174  -> typename dynamic_y_step_type<any_image_view<Views...>>::type
        -
        175 {
        -
        176  using result_view_t = typename dynamic_y_step_type<any_image_view<Views...>>::type;
        -
        177  return variant2::visit(detail::flipped_up_down_view_fn<result_view_t>(), src);
        -
        178 }
        -
        179 
        -
        182 template <typename ...Views>
        -
        183 inline
        - -
        185  -> typename dynamic_x_step_type<any_image_view<Views...>>::type
        -
        186 {
        -
        187  using result_view_t = typename dynamic_x_step_type<any_image_view<Views...>>::type;
        -
        188  return variant2::visit(detail::flipped_left_right_view_fn<result_view_t>(), src);
        -
        189 }
        -
        190 
        -
        193 template <typename ...Views>
        -
        194 inline
        - -
        196  -> typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type
        -
        197 {
        -
        198  using result_view_t = typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type;
        -
        199  return variant2::visit(detail::tranposed_view_fn<result_view_t>(), src);
        -
        200 }
        -
        201 
        -
        204 template <typename ...Views>
        -
        205 inline
        - -
        207  -> typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type
        -
        208 {
        -
        209  using result_view_t = typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type;
        -
        210  return variant2::visit(detail::rotated90cw_view_fn<result_view_t>(), src);
        -
        211 }
        -
        212 
        -
        215 template <typename ...Views>
        -
        216 inline
        - -
        218  -> typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type
        -
        219 {
        -
        220  using result_view_t = typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type;
        -
        221  return variant2::visit(detail::rotated90ccw_view_fn<result_view_t>(), src);
        -
        222 }
        -
        223 
        -
        226 template <typename ...Views>
        -
        227 inline
        - -
        229  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
        -
        230 {
        -
        231  using result_view_t = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
        -
        232  return variant2::visit(detail::rotated180_view_fn<result_view_t>(), src);
        -
        233 }
        -
        234 
        -
        237 template <typename ...Views>
        -
        238 inline
        - -
        240  any_image_view<Views...> const& src,
        -
        241  point_t const& topleft,
        -
        242  point_t const& dimensions)
        -
        243  -> any_image_view<Views...>
        -
        244 {
        -
        245  using subimage_view_fn = detail::subimage_view_fn<any_image_view<Views...>>;
        -
        246  return variant2::visit(subimage_view_fn(topleft, dimensions), src);
        -
        247 }
        -
        248 
        -
        251 template <typename ...Views>
        -
        252 inline
        - -
        254  any_image_view<Views...> const& src,
        -
        255  std::ptrdiff_t x_min, std::ptrdiff_t y_min, std::ptrdiff_t width, std::ptrdiff_t height)
        -
        256  -> any_image_view<Views...>
        -
        257 {
        -
        258  using subimage_view_fn = detail::subimage_view_fn<any_image_view<Views...>>;
        -
        259  return variant2::visit(subimage_view_fn(point_t(x_min, y_min),point_t(width, height)), src);
        -
        260 }
        -
        261 
        -
        264 template <typename ...Views>
        -
        265 inline
        -
        266 auto subsampled_view(any_image_view<Views...> const& src, point_t const& step)
        -
        267  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
        -
        268 {
        -
        269  using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
        -
        270  using subsampled_view = detail::subsampled_view_fn<step_type>;
        -
        271  return variant2::visit(subsampled_view(step), src);
        -
        272 }
        -
        273 
        -
        276 template <typename ...Views>
        -
        277 inline
        -
        278 auto subsampled_view(any_image_view<Views...> const& src, std::ptrdiff_t x_step, std::ptrdiff_t y_step)
        -
        279  -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
        -
        280 {
        -
        281  using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
        -
        282  using subsampled_view_fn = detail::subsampled_view_fn<step_type>;
        -
        283  return variant2::visit(subsampled_view_fn(point_t(x_step, y_step)), src);
        -
        284 }
        -
        285 
        -
        286 namespace detail {
        -
        287 
        -
        288 template <typename View>
        -
        289 struct get_nthchannel_type { using type = typename nth_channel_view_type<View>::type; };
        -
        290 
        -
        291 template <typename Views>
        -
        292 struct views_get_nthchannel_type : mp11::mp_transform<get_nthchannel_type, Views> {};
        -
        293 
        -
        294 } // namespace detail
        -
        295 
        -
        298 template <typename ...Views>
        - -
        300 {
        -
        301  using type = typename detail::views_get_nthchannel_type<any_image_view<Views...>>;
        -
        302 };
        -
        303 
        -
        306 template <typename ...Views>
        -
        307 inline
        - -
        309  -> typename nth_channel_view_type<any_image_view<Views...>>::type
        -
        310 {
        -
        311  using result_view_t = typename nth_channel_view_type<any_image_view<Views...>>::type;
        -
        312  return variant2::visit(detail::nth_channel_view_fn<result_view_t>(n), src);
        -
        313 }
        -
        314 
        -
        315 namespace detail {
        -
        316 
        -
        317 template <typename Views, typename DstP, typename CC>
        -
        318 struct views_get_ccv_type
        -
        319 {
        -
        320 private:
        -
        321  template <typename T>
        -
        322  using ccvt = typename color_converted_view_type<T, DstP, CC>::type;
        -
        323 public:
        -
        324  using type = mp11::mp_transform<ccvt, Views>;
        -
        325 };
        -
        326 
        -
        327 } // namespace detail
        -
        328 
        -
        331 template <typename ...Views, typename DstP, typename CC>
        -
        332 struct color_converted_view_type<any_image_view<Views...>,DstP,CC>
        -
        333 {
        -
        334  //using type = any_image_view<typename detail::views_get_ccv_type<Views, DstP, CC>::type>;
        -
        335  using type = typename detail::views_get_ccv_type<any_image_view<Views...>, DstP, CC>::type;
        -
        336 };
        -
        337 
        -
        341 template <typename DstP, typename ...Views, typename CC>
        -
        342 inline
        - -
        344  -> typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type
        -
        345 {
        -
        346  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type;
        -
        347  return variant2::visit(detail::color_converted_view_fn<DstP, cc_view_t, CC>(cc), src);
        -
        348 }
        -
        349 
        -
        352 template <typename ...Views, typename DstP>
        - -
        354 {
        -
        355  using type = typename detail::views_get_ccv_type<any_image_view<Views...>, DstP, default_color_converter>::type;
        -
        356 };
        -
        357 
        -
        361 template <typename DstP, typename ...Views>
        -
        362 inline
        - -
        364  -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type
        -
        365 {
        -
        366  using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP>::type;
        -
        367  return variant2::visit(detail::color_converted_view_fn<DstP, cc_view_t>(), src);
        -
        368 }
        -
        369 
        -
        374 template <typename DstP, typename ...Views, typename CC>
        -
        375 [[deprecated("Use color_converted_view(const any_image_view<Views...>& src, CC) instead.")]]
        -
        376 inline
        - -
        378  -> typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type
        -
        379 {
        -
        380  return color_converted_view(src, cc);
        -
        381 }
        -
        382 
        -
        387 template <typename DstP, typename ...Views>
        -
        388 [[deprecated("Use color_converted_view(any_image_view<Views...> const& src) instead.")]]
        -
        389 inline
        - -
        391  -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type
        -
        392 {
        -
        393  return color_converted_view(src);
        -
        394 }
        -
        395 
        -
        397 
        -
        398 }} // namespace boost::gil
        -
        399 
        -
        400 #endif
        -
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition: any_image_view.hpp:76
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_IMAGE_VIEW_FACTORY_HPP
        +
        9#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_IMAGE_VIEW_FACTORY_HPP
        +
        10
        +
        11#include <boost/gil/extension/dynamic_image/any_image_view.hpp>
        +
        12
        +
        13#include <boost/gil/dynamic_step.hpp>
        +
        14#include <boost/gil/image_view_factory.hpp>
        +
        15#include <boost/gil/point.hpp>
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17
        +
        18#include <cstdint>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        22// Methods for constructing any image views from other any image views
        +
        23// Extends image view factory to runtime type-specified views (any_image_view)
        +
        24
        +
        25namespace detail {
        +
        26
        +
        27template <typename ResultView>
        +
        28struct flipped_up_down_view_fn
        +
        29{
        +
        30 using result_type = ResultView;
        +
        31
        +
        32 template <typename View>
        +
        33 auto operator()(View const& src) const -> result_type
        +
        34 {
        +
        35 return result_type{flipped_up_down_view(src)};
        +
        36 }
        +
        37};
        +
        38
        +
        39template <typename ResultView>
        +
        40struct flipped_left_right_view_fn
        +
        41{
        +
        42 using result_type = ResultView;
        +
        43
        +
        44 template <typename View>
        +
        45 auto operator()(View const& src) const -> result_type
        +
        46 {
        +
        47 return result_type{flipped_left_right_view(src)};
        +
        48 }
        +
        49};
        +
        50
        +
        51template <typename ResultView>
        +
        52struct rotated90cw_view_fn
        +
        53{
        +
        54 using result_type = ResultView;
        +
        55
        +
        56 template <typename View>
        +
        57 auto operator()(View const& src) const -> result_type
        +
        58 {
        +
        59 return result_type{rotated90cw_view(src)};
        +
        60 }
        +
        61};
        +
        62
        +
        63template <typename ResultView>
        +
        64struct rotated90ccw_view_fn
        +
        65{
        +
        66 using result_type = ResultView;
        +
        67
        +
        68 template <typename View>
        +
        69 auto operator()(View const& src) const -> result_type
        +
        70 {
        +
        71 return result_type{rotated90ccw_view(src)};
        +
        72 }
        +
        73};
        +
        74
        +
        75template <typename ResultView>
        +
        76struct tranposed_view_fn
        +
        77{
        +
        78 using result_type = ResultView;
        +
        79
        +
        80 template <typename View>
        +
        81 auto operator()(View const& src) const -> result_type
        +
        82 {
        +
        83 return result_type{tranposed_view(src)};
        +
        84 }
        +
        85};
        +
        86
        +
        87template <typename ResultView>
        +
        88struct rotated180_view_fn
        +
        89{
        +
        90 using result_type = ResultView;
        +
        91
        +
        92 template <typename View>
        +
        93 auto operator()(View const& src) const -> result_type
        +
        94 {
        +
        95 return result_type{rotated180_view(src)};
        +
        96 }
        +
        97};
        +
        98
        +
        99template <typename ResultView>
        +
        100struct subimage_view_fn
        +
        101{
        +
        102 using result_type = ResultView;
        +
        103
        +
        104 subimage_view_fn(point_t const& topleft, point_t const& dimensions)
        +
        105 : _topleft(topleft), _size2(dimensions)
        +
        106 {}
        +
        107
        +
        108 template <typename View>
        +
        109 auto operator()(View const& src) const -> result_type
        +
        110 {
        +
        111 return result_type{subimage_view(src,_topleft,_size2)};
        +
        112 }
        +
        113
        +
        114 point_t _topleft;
        +
        115 point_t _size2;
        +
        116};
        +
        117
        +
        118template <typename ResultView>
        +
        119struct subsampled_view_fn
        +
        120{
        +
        121 using result_type = ResultView;
        +
        122
        +
        123 subsampled_view_fn(point_t const& step) : _step(step) {}
        +
        124
        +
        125 template <typename View>
        +
        126 auto operator()(View const& src) const -> result_type
        +
        127 {
        +
        128 return result_type{subsampled_view(src,_step)};
        +
        129 }
        +
        130
        +
        131 point_t _step;
        +
        132};
        +
        133
        +
        134template <typename ResultView>
        +
        135struct nth_channel_view_fn
        +
        136{
        +
        137 using result_type = ResultView;
        +
        138
        +
        139 nth_channel_view_fn(int n) : _n(n) {}
        +
        140
        +
        141 template <typename View>
        +
        142 auto operator()(View const& src) const -> result_type
        +
        143 {
        +
        144 return result_type(nth_channel_view(src,_n));
        +
        145 }
        +
        146
        +
        147 int _n;
        +
        148};
        +
        149
        +
        150template <typename DstP, typename ResultView, typename CC = default_color_converter>
        +
        151struct color_converted_view_fn
        +
        152{
        +
        153 using result_type = ResultView;
        +
        154
        +
        155 color_converted_view_fn(CC cc = CC()): _cc(cc) {}
        +
        156
        +
        157 template <typename View>
        +
        158 auto operator()(View const& src) const -> result_type
        +
        159 {
        +
        160 return result_type{color_converted_view<DstP>(src, _cc)};
        +
        161 }
        +
        162
        +
        163private:
        +
        164 CC _cc;
        +
        165};
        +
        166
        +
        167} // namespace detail
        +
        168
        +
        171template <typename ...Views>
        +
        172inline
        +
        +
        173auto flipped_up_down_view(any_image_view<Views...> const& src)
        +
        174 -> typename dynamic_y_step_type<any_image_view<Views...>>::type
        +
        175{
        +
        176 using result_view_t = typename dynamic_y_step_type<any_image_view<Views...>>::type;
        +
        177 return variant2::visit(detail::flipped_up_down_view_fn<result_view_t>(), src);
        +
        178}
        +
        +
        179
        +
        182template <typename ...Views>
        +
        183inline
        +
        +
        184auto flipped_left_right_view(any_image_view<Views...> const& src)
        +
        185 -> typename dynamic_x_step_type<any_image_view<Views...>>::type
        +
        186{
        +
        187 using result_view_t = typename dynamic_x_step_type<any_image_view<Views...>>::type;
        +
        188 return variant2::visit(detail::flipped_left_right_view_fn<result_view_t>(), src);
        +
        189}
        +
        +
        190
        +
        193template <typename ...Views>
        +
        194inline
        +
        +
        195auto transposed_view(any_image_view<Views...> const& src)
        +
        196 -> typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type
        +
        197{
        +
        198 using result_view_t = typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type;
        +
        199 return variant2::visit(detail::tranposed_view_fn<result_view_t>(), src);
        +
        200}
        +
        +
        201
        +
        204template <typename ...Views>
        +
        205inline
        +
        +
        206auto rotated90cw_view(any_image_view<Views...> const& src)
        +
        207 -> typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type
        +
        208{
        +
        209 using result_view_t = typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type;
        +
        210 return variant2::visit(detail::rotated90cw_view_fn<result_view_t>(), src);
        +
        211}
        +
        +
        212
        +
        215template <typename ...Views>
        +
        216inline
        +
        +
        217auto rotated90ccw_view(any_image_view<Views...> const& src)
        +
        218 -> typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type
        +
        219{
        +
        220 using result_view_t = typename dynamic_xy_step_transposed_type<any_image_view<Views...>>::type;
        +
        221 return variant2::visit(detail::rotated90ccw_view_fn<result_view_t>(), src);
        +
        222}
        +
        +
        223
        +
        226template <typename ...Views>
        +
        227inline
        +
        +
        228auto rotated180_view(any_image_view<Views...> const& src)
        +
        229 -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
        +
        230{
        +
        231 using result_view_t = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
        +
        232 return variant2::visit(detail::rotated180_view_fn<result_view_t>(), src);
        +
        233}
        +
        +
        234
        +
        237template <typename ...Views>
        +
        238inline
        +
        +
        239auto subimage_view(
        +
        240 any_image_view<Views...> const& src,
        +
        241 point_t const& topleft,
        +
        242 point_t const& dimensions)
        +
        243 -> any_image_view<Views...>
        +
        244{
        +
        245 using subimage_view_fn = detail::subimage_view_fn<any_image_view<Views...>>;
        +
        246 return variant2::visit(subimage_view_fn(topleft, dimensions), src);
        +
        247}
        +
        +
        248
        +
        251template <typename ...Views>
        +
        252inline
        +
        +
        253auto subimage_view(
        +
        254 any_image_view<Views...> const& src,
        +
        255 std::ptrdiff_t x_min, std::ptrdiff_t y_min, std::ptrdiff_t width, std::ptrdiff_t height)
        +
        256 -> any_image_view<Views...>
        +
        257{
        +
        258 using subimage_view_fn = detail::subimage_view_fn<any_image_view<Views...>>;
        +
        259 return variant2::visit(subimage_view_fn(point_t(x_min, y_min),point_t(width, height)), src);
        +
        260}
        +
        +
        261
        +
        264template <typename ...Views>
        +
        265inline
        +
        +
        266auto subsampled_view(any_image_view<Views...> const& src, point_t const& step)
        +
        267 -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
        +
        268{
        +
        269 using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
        +
        270 using subsampled_view = detail::subsampled_view_fn<step_type>;
        +
        271 return variant2::visit(subsampled_view(step), src);
        +
        272}
        +
        +
        273
        +
        276template <typename ...Views>
        +
        277inline
        +
        +
        278auto subsampled_view(any_image_view<Views...> const& src, std::ptrdiff_t x_step, std::ptrdiff_t y_step)
        +
        279 -> typename dynamic_xy_step_type<any_image_view<Views...>>::type
        +
        280{
        +
        281 using step_type = typename dynamic_xy_step_type<any_image_view<Views...>>::type;
        +
        282 using subsampled_view_fn = detail::subsampled_view_fn<step_type>;
        +
        283 return variant2::visit(subsampled_view_fn(point_t(x_step, y_step)), src);
        +
        284}
        +
        +
        285
        +
        286namespace detail {
        +
        287
        +
        288template <typename View>
        +
        289struct get_nthchannel_type { using type = typename nth_channel_view_type<View>::type; };
        +
        290
        +
        291template <typename Views>
        +
        292struct views_get_nthchannel_type : mp11::mp_transform<get_nthchannel_type, Views> {};
        +
        293
        +
        294} // namespace detail
        +
        295
        +
        298template <typename ...Views>
        +
        + +
        300{
        +
        301 using type = typename detail::views_get_nthchannel_type<any_image_view<Views...>>;
        +
        302};
        +
        +
        303
        +
        306template <typename ...Views>
        +
        307inline
        +
        +
        308auto nth_channel_view(any_image_view<Views...> const& src, int n)
        +
        309 -> typename nth_channel_view_type<any_image_view<Views...>>::type
        +
        310{
        +
        311 using result_view_t = typename nth_channel_view_type<any_image_view<Views...>>::type;
        +
        312 return variant2::visit(detail::nth_channel_view_fn<result_view_t>(n), src);
        +
        313}
        +
        +
        314
        +
        315namespace detail {
        +
        316
        +
        317template <typename Views, typename DstP, typename CC>
        +
        318struct views_get_ccv_type
        +
        319{
        +
        320private:
        +
        321 template <typename T>
        +
        322 using ccvt = typename color_converted_view_type<T, DstP, CC>::type;
        +
        323public:
        +
        324 using type = mp11::mp_transform<ccvt, Views>;
        +
        325};
        +
        326
        +
        327} // namespace detail
        +
        328
        +
        331template <typename ...Views, typename DstP, typename CC>
        +
        + +
        333{
        +
        334 //using type = any_image_view<typename detail::views_get_ccv_type<Views, DstP, CC>::type>;
        +
        335 using type = typename detail::views_get_ccv_type<any_image_view<Views...>, DstP, CC>::type;
        +
        336};
        +
        +
        337
        +
        341template <typename DstP, typename ...Views, typename CC>
        +
        342inline
        +
        + +
        344 -> typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type
        +
        345{
        +
        346 using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type;
        +
        347 return variant2::visit(detail::color_converted_view_fn<DstP, cc_view_t, CC>(cc), src);
        +
        348}
        +
        +
        349
        +
        352template <typename ...Views, typename DstP>
        +
        + +
        354{
        +
        355 using type = typename detail::views_get_ccv_type<any_image_view<Views...>, DstP, default_color_converter>::type;
        +
        356};
        +
        +
        357
        +
        361template <typename DstP, typename ...Views>
        +
        362inline
        +
        + +
        364 -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type
        +
        365{
        +
        366 using cc_view_t = typename color_converted_view_type<any_image_view<Views...>, DstP>::type;
        +
        367 return variant2::visit(detail::color_converted_view_fn<DstP, cc_view_t>(), src);
        +
        368}
        +
        +
        369
        +
        374template <typename DstP, typename ...Views, typename CC>
        +
        375[[deprecated("Use color_converted_view(const any_image_view<Views...>& src, CC) instead.")]]
        +
        376inline
        +
        + +
        378 -> typename color_converted_view_type<any_image_view<Views...>, DstP, CC>::type
        +
        379{
        +
        380 return color_converted_view(src, cc);
        +
        381}
        +
        +
        382
        +
        387template <typename DstP, typename ...Views>
        +
        388[[deprecated("Use color_converted_view(any_image_view<Views...> const& src) instead.")]]
        +
        389inline
        +
        + +
        391 -> typename color_converted_view_type<any_image_view<Views...>, DstP>::type
        +
        392{
        +
        393 return color_converted_view(src);
        +
        394}
        +
        +
        395
        +
        397
        +
        398}} // namespace boost::gil
        +
        399
        +
        400#endif
        +
        Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCon...
        Definition any_image_view.hpp:76
        -
        auto rotated180_view(any_image_view< Views... > const &src) -> typename dynamic_xy_step_type< any_image_view< Views... >>::type
        Definition: extension/dynamic_image/image_view_factory.hpp:228
        -
        auto rotated90ccw_view(any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
        Definition: extension/dynamic_image/image_view_factory.hpp:217
        -
        auto rotated90cw_view(any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
        Definition: extension/dynamic_image/image_view_factory.hpp:206
        -
        auto any_color_converted_view(const any_image_view< Views... > &src) -> typename color_converted_view_type< any_image_view< Views... >, DstP >::type
        overload of generic color_converted_view with the default color-converter These are workarounds for G...
        Definition: extension/dynamic_image/image_view_factory.hpp:390
        -
        auto color_converted_view(any_image_view< Views... > const &src) -> typename color_converted_view_type< any_image_view< Views... >, DstP >::type
        overload of generic color_converted_view with the default color-converter
        Definition: extension/dynamic_image/image_view_factory.hpp:363
        -
        auto flipped_left_right_view(any_image_view< Views... > const &src) -> typename dynamic_x_step_type< any_image_view< Views... >>::type
        Definition: extension/dynamic_image/image_view_factory.hpp:184
        -
        auto flipped_up_down_view(any_image_view< Views... > const &src) -> typename dynamic_y_step_type< any_image_view< Views... >>::type
        Definition: extension/dynamic_image/image_view_factory.hpp:173
        -
        auto nth_channel_view(any_image_view< Views... > const &src, int n) -> typename nth_channel_view_type< any_image_view< Views... >>::type
        Definition: extension/dynamic_image/image_view_factory.hpp:308
        -
        auto subimage_view(any_image_view< Views... > const &src, std::ptrdiff_t x_min, std::ptrdiff_t y_min, std::ptrdiff_t width, std::ptrdiff_t height) -> any_image_view< Views... >
        Definition: extension/dynamic_image/image_view_factory.hpp:253
        -
        auto subsampled_view(any_image_view< Views... > const &src, std::ptrdiff_t x_step, std::ptrdiff_t y_step) -> typename dynamic_xy_step_type< any_image_view< Views... >>::type
        Definition: extension/dynamic_image/image_view_factory.hpp:278
        -
        auto transposed_view(any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
        Definition: extension/dynamic_image/image_view_factory.hpp:195
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Returns the type of a view that does color conversion upon dereferencing its pixels.
        Definition: image_view_factory.hpp:176
        -
        class for color-converting one pixel to another
        Definition: color_convert.hpp:328
        -
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition: dynamic_step.hpp:17
        -
        Returns the type of a transposed view that has a dynamic step along both X and Y.
        Definition: image_view_factory.hpp:52
        -
        Returns the type of a view that has a dynamic step along both X and Y.
        Definition: image_view_factory.hpp:46
        -
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition: dynamic_step.hpp:21
        -
        Given a source image view type View, returns the type of an image view over a single channel of View.
        Definition: image_view_factory.hpp:437
        +
        auto any_color_converted_view(const any_image_view< Views... > &src, CC cc) -> typename color_converted_view_type< any_image_view< Views... >, DstP, CC >::type
        overload of generic color_converted_view with user defined color-converter These are workarounds for ...
        Definition extension/dynamic_image/image_view_factory.hpp:377
        +
        auto color_converted_view(View const &src, CC cc) -> typename color_converted_view_type< View, DstP, CC >::type
        view of a different color space with a user defined color-converter
        Definition image_view_factory.hpp:184
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Returns the type of a view that does color conversion upon dereferencing its pixels.
        Definition image_view_factory.hpp:176
        +
        class for color-converting one pixel to another
        Definition color_convert.hpp:328
        +
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition dynamic_step.hpp:17
        +
        Returns the type of a transposed view that has a dynamic step along both X and Y.
        Definition image_view_factory.hpp:52
        +
        Returns the type of a view that has a dynamic step along both X and Y.
        Definition image_view_factory.hpp:46
        +
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition dynamic_step.hpp:21
        +
        Given a source image view type View, returns the type of an image view over a single channel of View.
        Definition image_view_factory.hpp:437
        diff --git a/html/reference/files.html b/html/reference/files.html index 2232f994c..ce60f8b7f 100644 --- a/html/reference/files.html +++ b/html/reference/files.html @@ -4,7 +4,7 @@ - + Generic Image Library: File List @@ -27,130 +27,139 @@

        - + +/* @license-end */ +
        -
        -
        File List
        +
        File List
        Here is a list of all documented files with brief descriptions:
        -
        @@ -373,11 +373,13 @@ class boost::gil::image_view< Loc > - -

        ◆ swap()

        + +

        ◆ swap()

        +
        +template<typename Loc >
        diff --git a/html/reference/doc.png b/html/reference/doc.png deleted file mode 100644 index 17edabff9..000000000 Binary files a/html/reference/doc.png and /dev/null differ diff --git a/html/reference/doc.svg b/html/reference/doc.svg new file mode 100644 index 000000000..0b928a531 --- /dev/null +++ b/html/reference/doc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/html/reference/docd.svg b/html/reference/docd.svg new file mode 100644 index 000000000..ac18b2755 --- /dev/null +++ b/html/reference/docd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/html/reference/doxygen.css b/html/reference/doxygen.css index ffbff0224..eeadba5e9 100644 --- a/html/reference/doxygen.css +++ b/html/reference/doxygen.css @@ -1,29 +1,378 @@ -/* The standard CSS for doxygen 1.9.1 */ +/* The standard CSS for doxygen 1.9.8*/ + +html { +/* page base colors */ +--page-background-color: white; +--page-foreground-color: black; +--page-link-color: #3D578C; +--page-visited-link-color: #4665A2; + +/* index */ +--index-odd-item-bg-color: #F8F9FC; +--index-even-item-bg-color: white; +--index-header-color: black; +--index-separator-color: #A0A0A0; + +/* header */ +--header-background-color: #F9FAFC; +--header-separator-color: #C4CFE5; +--header-gradient-image: url('nav_h.png'); +--group-header-separator-color: #879ECB; +--group-header-color: #354C7B; +--inherit-header-color: gray; + +--footer-foreground-color: #2A3D61; +--footer-logo-width: 104px; +--citation-label-color: #334975; +--glow-color: cyan; + +--title-background-color: white; +--title-separator-color: #5373B4; +--directory-separator-color: #9CAFD4; +--separator-color: #4A6AAA; + +--blockquote-background-color: #F7F8FB; +--blockquote-border-color: #9CAFD4; + +--scrollbar-thumb-color: #9CAFD4; +--scrollbar-background-color: #F9FAFC; + +--icon-background-color: #728DC1; +--icon-foreground-color: white; +--icon-doc-image: url('doc.svg'); +--icon-folder-open-image: url('folderopen.svg'); +--icon-folder-closed-image: url('folderclosed.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #F9FAFC; +--memdecl-separator-color: #DEE4F0; +--memdecl-foreground-color: #555; +--memdecl-template-color: #4665A2; + +/* detailed member list */ +--memdef-border-color: #A8B8D9; +--memdef-title-background-color: #E2E8F2; +--memdef-title-gradient-image: url('nav_f.png'); +--memdef-proto-background-color: #DFE5F1; +--memdef-proto-text-color: #253555; +--memdef-proto-text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--memdef-doc-background-color: white; +--memdef-param-name-color: #602020; +--memdef-template-color: #4665A2; + +/* tables */ +--table-cell-border-color: #2D4068; +--table-header-background-color: #374F7F; +--table-header-foreground-color: #FFFFFF; + +/* labels */ +--label-background-color: #728DC1; +--label-left-top-border-color: #5373B4; +--label-right-bottom-border-color: #C4CFE5; +--label-foreground-color: white; + +/** navigation bar/tree/menu */ +--nav-background-color: #F9FAFC; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_b.png'); +--nav-gradient-hover-image: url('tab_h.png'); +--nav-gradient-active-image: url('tab_a.png'); +--nav-gradient-active-image-parent: url("../tab_a.png"); +--nav-separator-image: url('tab_s.png'); +--nav-breadcrumb-image: url('bc_s.png'); +--nav-breadcrumb-border-color: #C2CDE4; +--nav-splitbar-image: url('splitbar.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #283A5D; +--nav-text-hover-color: white; +--nav-text-active-color: white; +--nav-text-normal-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #364D7C; +--nav-menu-background-color: white; +--nav-menu-foreground-color: #555555; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.5); +--nav-arrow-color: #9CAFD4; +--nav-arrow-selected-color: #9CAFD4; + +/* table of contents */ +--toc-background-color: #F4F6FA; +--toc-border-color: #D8DFEE; +--toc-header-color: #4665A2; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: white; +--search-foreground-color: #909090; +--search-magnification-image: url('mag.svg'); +--search-magnification-select-image: url('mag_sel.svg'); +--search-active-color: black; +--search-filter-background-color: #F9FAFC; +--search-filter-foreground-color: black; +--search-filter-border-color: #90A5CE; +--search-filter-highlight-text-color: white; +--search-filter-highlight-bg-color: #3D578C; +--search-results-foreground-color: #425E97; +--search-results-background-color: #EEF1F7; +--search-results-border-color: black; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #555; + +/** code fragments */ +--code-keyword-color: #008000; +--code-type-keyword-color: #604020; +--code-flow-keyword-color: #E08000; +--code-comment-color: #800000; +--code-preprocessor-color: #806020; +--code-string-literal-color: #002080; +--code-char-literal-color: #008080; +--code-xml-cdata-color: black; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #4665A2; +--code-external-link-color: #4665A2; +--fragment-foreground-color: black; +--fragment-background-color: #FBFCFD; +--fragment-border-color: #C4CFE5; +--fragment-lineno-border-color: #00FF00; +--fragment-lineno-background-color: #E8E8E8; +--fragment-lineno-foreground-color: black; +--fragment-lineno-link-fg-color: #4665A2; +--fragment-lineno-link-bg-color: #D8D8D8; +--fragment-lineno-link-hover-fg-color: #4665A2; +--fragment-lineno-link-hover-bg-color: #C8C8C8; +--tooltip-foreground-color: black; +--tooltip-background-color: white; +--tooltip-border-color: gray; +--tooltip-doc-color: grey; +--tooltip-declaration-color: #006318; +--tooltip-link-color: #4665A2; +--tooltip-shadow: 1px 1px 7px gray; +--fold-line-color: #808080; +--fold-minus-image: url('minus.svg'); +--fold-plus-image: url('plus.svg'); +--fold-minus-image-relpath: url('../../minus.svg'); +--fold-plus-image-relpath: url('../../plus.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; -body, table, div, p, dl { - font: 400 14px/22px Roboto,sans-serif; } -p.reference, p.definition { - font: 400 14px/22px Roboto,sans-serif; +@media (prefers-color-scheme: dark) { + html:not(.dark-mode) { + color-scheme: dark; + +/* page base colors */ +--page-background-color: black; +--page-foreground-color: #C9D1D9; +--page-link-color: #90A5CE; +--page-visited-link-color: #A3B4D7; + +/* index */ +--index-odd-item-bg-color: #0B101A; +--index-even-item-bg-color: black; +--index-header-color: #C4CFE5; +--index-separator-color: #334975; + +/* header */ +--header-background-color: #070B11; +--header-separator-color: #141C2E; +--header-gradient-image: url('nav_hd.png'); +--group-header-separator-color: #283A5D; +--group-header-color: #90A5CE; +--inherit-header-color: #A0A0A0; + +--footer-foreground-color: #5B7AB7; +--footer-logo-width: 60px; +--citation-label-color: #90A5CE; +--glow-color: cyan; + +--title-background-color: #090D16; +--title-separator-color: #354C79; +--directory-separator-color: #283A5D; +--separator-color: #283A5D; + +--blockquote-background-color: #101826; +--blockquote-border-color: #283A5D; + +--scrollbar-thumb-color: #283A5D; +--scrollbar-background-color: #070B11; + +--icon-background-color: #334975; +--icon-foreground-color: #C4CFE5; +--icon-doc-image: url('docd.svg'); +--icon-folder-open-image: url('folderopend.svg'); +--icon-folder-closed-image: url('folderclosedd.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #0B101A; +--memdecl-separator-color: #2C3F65; +--memdecl-foreground-color: #BBB; +--memdecl-template-color: #7C95C6; + +/* detailed member list */ +--memdef-border-color: #233250; +--memdef-title-background-color: #1B2840; +--memdef-title-gradient-image: url('nav_fd.png'); +--memdef-proto-background-color: #19243A; +--memdef-proto-text-color: #9DB0D4; +--memdef-proto-text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); +--memdef-doc-background-color: black; +--memdef-param-name-color: #D28757; +--memdef-template-color: #7C95C6; + +/* tables */ +--table-cell-border-color: #283A5D; +--table-header-background-color: #283A5D; +--table-header-foreground-color: #C4CFE5; + +/* labels */ +--label-background-color: #354C7B; +--label-left-top-border-color: #4665A2; +--label-right-bottom-border-color: #283A5D; +--label-foreground-color: #CCCCCC; + +/** navigation bar/tree/menu */ +--nav-background-color: #101826; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_bd.png'); +--nav-gradient-hover-image: url('tab_hd.png'); +--nav-gradient-active-image: url('tab_ad.png'); +--nav-gradient-active-image-parent: url("../tab_ad.png"); +--nav-separator-image: url('tab_sd.png'); +--nav-breadcrumb-image: url('bc_sd.png'); +--nav-breadcrumb-border-color: #2A3D61; +--nav-splitbar-image: url('splitbard.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #B6C4DF; +--nav-text-hover-color: #DCE2EF; +--nav-text-active-color: #DCE2EF; +--nav-text-normal-shadow: 0px 1px 1px black; +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #B6C4DF; +--nav-menu-background-color: #05070C; +--nav-menu-foreground-color: #BBBBBB; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.2); +--nav-arrow-color: #334975; +--nav-arrow-selected-color: #90A5CE; + +/* table of contents */ +--toc-background-color: #151E30; +--toc-border-color: #202E4A; +--toc-header-color: #A3B4D7; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: black; +--search-foreground-color: #C5C5C5; +--search-magnification-image: url('mag_d.svg'); +--search-magnification-select-image: url('mag_seld.svg'); +--search-active-color: #C5C5C5; +--search-filter-background-color: #101826; +--search-filter-foreground-color: #90A5CE; +--search-filter-border-color: #7C95C6; +--search-filter-highlight-text-color: #BCC9E2; +--search-filter-highlight-bg-color: #283A5D; +--search-results-background-color: #101826; +--search-results-foreground-color: #90A5CE; +--search-results-border-color: #7C95C6; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #2F436C; + +/** code fragments */ +--code-keyword-color: #CC99CD; +--code-type-keyword-color: #AB99CD; +--code-flow-keyword-color: #E08000; +--code-comment-color: #717790; +--code-preprocessor-color: #65CABE; +--code-string-literal-color: #7EC699; +--code-char-literal-color: #00E0F0; +--code-xml-cdata-color: #C9D1D9; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #C0C0C0; +--code-vhdl-keyword-color: #CF53C9; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #79C0FF; +--code-external-link-color: #79C0FF; +--fragment-foreground-color: #C9D1D9; +--fragment-background-color: black; +--fragment-border-color: #30363D; +--fragment-lineno-border-color: #30363D; +--fragment-lineno-background-color: black; +--fragment-lineno-foreground-color: #6E7681; +--fragment-lineno-link-fg-color: #6E7681; +--fragment-lineno-link-bg-color: #303030; +--fragment-lineno-link-hover-fg-color: #8E96A1; +--fragment-lineno-link-hover-bg-color: #505050; +--tooltip-foreground-color: #C9D1D9; +--tooltip-background-color: #202020; +--tooltip-border-color: #C9D1D9; +--tooltip-doc-color: #D9E1E9; +--tooltip-declaration-color: #20C348; +--tooltip-link-color: #79C0FF; +--tooltip-shadow: none; +--fold-line-color: #808080; +--fold-minus-image: url('minusd.svg'); +--fold-plus-image: url('plusd.svg'); +--fold-minus-image-relpath: url('../../minusd.svg'); +--fold-plus-image-relpath: url('../../plusd.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +}} +body { + background-color: var(--page-background-color); + color: var(--page-foreground-color); +} + +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 22px; } /* @group Heading Levels */ -h1.groupheader { - font-size: 150%; -} - .title { - font: 400 14px/28px Roboto,sans-serif; + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 28px; font-size: 150%; font-weight: bold; margin: 10px 2px; } +h1.groupheader { + font-size: 150%; +} + h2.groupheader { - border-bottom: 1px solid #879ECB; - color: #354C7B; + border-bottom: 1px solid var(--group-header-separator-color); + color: var(--group-header-color); font-size: 150%; font-weight: normal; margin-top: 1.75em; @@ -46,22 +395,13 @@ h1, h2, h3, h4, h5, h6 { } h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { - text-shadow: 0 0 15px cyan; + text-shadow: 0 0 15px var(--glow-color); } dt { font-weight: bold; } -ul.multicol { - -moz-column-gap: 1em; - -webkit-column-gap: 1em; - column-gap: 1em; - -moz-column-count: 3; - -webkit-column-count: 3; - column-count: 3; -} - p.startli, p.startdd { margin-top: 2px; } @@ -113,7 +453,6 @@ h3.version { } div.navtab { - border-right: 1px solid #A3B4D7; padding-right: 15px; text-align: right; line-height: 110%; @@ -127,16 +466,17 @@ td.navtab { padding-right: 6px; padding-left: 6px; } + td.navtabHL { - background-image: url('tab_a.png'); + background-image: var(--nav-gradient-active-image); background-repeat:repeat-x; padding-right: 6px; padding-left: 6px; } td.navtabHL a, td.navtabHL a:visited { - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); } a.navtab { @@ -148,7 +488,13 @@ div.qindex{ width: 100%; line-height: 140%; font-size: 130%; - color: #A0A0A0; + color: var(--index-separator-color); +} + +#main-menu a:focus { + outline: auto; + z-index: 10; + position: relative; } dt.alphachar{ @@ -157,7 +503,7 @@ dt.alphachar{ } .alphachar a{ - color: black; + color: var(--index-header-color); } .alphachar a:hover, .alphachar a:visited{ @@ -176,8 +522,12 @@ dt.alphachar{ line-height: 1.15em; } +.classindex dl.even { + background-color: var(--index-even-item-bg-color); +} + .classindex dl.odd { - background-color: #F8F9FC; + background-color: var(--index-odd-item-bg-color); } @media(min-width: 1120px) { @@ -196,23 +546,19 @@ dt.alphachar{ /* @group Link Styling */ a { - color: #3D578C; + color: var(--page-link-color); font-weight: normal; text-decoration: none; } .contents a:visited { - color: #4665A2; + color: var(--page-visited-link-color); } a:hover { text-decoration: underline; } -.contents a.qindexHL:visited { - color: #FFFFFF; -} - a.el { font-weight: bold; } @@ -221,13 +567,40 @@ a.elRef { } a.code, a.code:visited, a.line, a.line:visited { - color: #4665A2; + color: var(--code-link-color); } a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { - color: #4665A2; + color: var(--code-external-link-color); } +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + /* @end */ dl.el { @@ -235,7 +608,17 @@ dl.el { } ul { - overflow: hidden; /*Fixed: list item bullets overlap floating elements*/ + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; } #side-nav ul { @@ -254,30 +637,32 @@ ul { } pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; + border: 1px solid var(--fragment-border-color); + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; word-wrap: break-word; font-size: 9pt; line-height: 125%; - font-family: monospace, fixed; + font-family: var(--font-family-monospace); font-size: 105%; } div.fragment { - padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ - margin: 4px 8px 4px 2px; - background-color: #FBFCFD; - border: 1px solid #C4CFE5; + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + color: var(--fragment-foreground-color); + background-color: var(--fragment-background-color); + border: 1px solid var(--fragment-border-color); } div.line { - font-family: monospace, fixed; + font-family: var(--font-family-monospace); font-size: 13px; min-height: 13px; - line-height: 1.0; + line-height: 1.2; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ @@ -306,24 +691,40 @@ div.line:after { } div.line.glow { - background-color: cyan; - box-shadow: 0 0 10px cyan; + background-color: var(--glow-color); + box-shadow: 0 0 10px var(--glow-color); } +span.fold { + margin-left: 5px; + margin-right: 1px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; + display: inline-block; + width: 12px; + height: 12px; + background-repeat:no-repeat; + background-position:center; +} span.lineno { padding-right: 4px; + margin-right: 9px; text-align: right; - border-right: 2px solid #0F0; - background-color: #E8E8E8; + border-right: 2px solid var(--fragment-lineno-border-color); + color: var(--fragment-lineno-foreground-color); + background-color: var(--fragment-lineno-background-color); white-space: pre; } -span.lineno a { - background-color: #D8D8D8; +span.lineno a, span.lineno a:visited { + color: var(--fragment-lineno-link-fg-color); + background-color: var(--fragment-lineno-link-bg-color); } span.lineno a:hover { - background-color: #C8C8C8; + color: var(--fragment-lineno-link-hover-fg-color); + background-color: var(--fragment-lineno-link-hover-bg-color); } .lineno { @@ -335,24 +736,6 @@ span.lineno a:hover { user-select: none; } -div.ah, span.ah { - background-color: black; - font-weight: bold; - color: #FFFFFF; - margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); -} - div.classindex ul { list-style: none; padding-left: 0; @@ -374,8 +757,7 @@ div.groupText { } body { - background-color: white; - color: black; + color: var(--page-foreground-color); margin: 0; } @@ -385,31 +767,17 @@ div.contents { margin-right: 8px; } -td.indexkey { - background-color: #EBEFF6; - font-weight: bold; - border: 1px solid #C4CFE5; - margin: 2px 0px 2px 0; - padding: 2px 10px; - white-space: nowrap; - vertical-align: top; -} - -td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; - padding: 2px 10px; - margin: 2px 0px; -} - -tr.memlist { - background-color: #EEF1F7; -} - p.formulaDsp { text-align: center; } +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; +} + img.formulaDsp { } @@ -437,89 +805,74 @@ address.footer { img.footer { border: 0px; vertical-align: middle; + width: var(--footer-logo-width); +} + +.compoundTemplParams { + color: var(--memdecl-template-color); + font-size: 80%; + line-height: 120%; } /* @group Code Colorization */ span.keyword { - color: #008000 + color: var(--code-keyword-color); } span.keywordtype { - color: #604020 + color: var(--code-type-keyword-color); } span.keywordflow { - color: #e08000 + color: var(--code-flow-keyword-color); } span.comment { - color: #800000 + color: var(--code-comment-color); } span.preprocessor { - color: #806020 + color: var(--code-preprocessor-color); } span.stringliteral { - color: #002080 + color: var(--code-string-literal-color); } span.charliteral { - color: #008080 + color: var(--code-char-literal-color); +} + +span.xmlcdata { + color: var(--code-xml-cdata-color); } span.vhdldigit { - color: #ff00ff + color: var(--code-vhdl-digit-color); } span.vhdlchar { - color: #000000 + color: var(--code-vhdl-char-color); } span.vhdlkeyword { - color: #700070 + color: var(--code-vhdl-keyword-color); } span.vhdllogic { - color: #ff0000 + color: var(--code-vhdl-logic-color); } blockquote { - background-color: #F7F8FB; - border-left: 2px solid #9CAFD4; + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); margin: 0 24px 0 4px; padding: 0 12px 0 16px; } -blockquote.DocNodeRTL { - border-left: 0; - border-right: 2px solid #9CAFD4; - margin: 0 4px 0 24px; - padding: 0 16px 0 12px; -} - /* @end */ -/* -.search { - color: #003399; - font-weight: bold; -} - -form.search { - margin-bottom: 0px; - margin-top: 0px; -} - -input.search { - font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -*/ - td.tiny { font-size: 75%; } @@ -527,18 +880,19 @@ td.tiny { .dirtab { padding: 4px; border-collapse: collapse; - border: 1px solid #A3B4D7; + border: 1px solid var(--table-cell-border-color); } th.dirtab { - background: #EBEFF6; + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-weight: bold; } hr { height: 0px; border: none; - border-top: 1px solid #4A6AAA; + border-top: 1px solid var(--separator-color); } hr.footer { @@ -566,14 +920,14 @@ table.memberdecls { } .memberdecls td.glow, .fieldtable tr.glow { - background-color: cyan; - box-shadow: 0 0 15px cyan; + background-color: var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); } .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; + background-color: var(--memdecl-background-color); border: none; margin: 4px; padding: 1px 0 0 8px; @@ -581,11 +935,11 @@ table.memberdecls { .mdescLeft, .mdescRight { padding: 0px 8px 4px 8px; - color: #555; + color: var(--memdecl-foreground-color); } .memSeparator { - border-bottom: 1px solid #DEE4F0; + border-bottom: 1px solid var(--memdecl-separator-color); line-height: 1px; margin: 0px; padding: 0px; @@ -600,7 +954,7 @@ table.memberdecls { } .memTemplParams { - color: #4665A2; + color: var(--memdecl-template-color); white-space: nowrap; font-size: 80%; } @@ -613,15 +967,15 @@ table.memberdecls { .memtitle { padding: 8px; - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); border-top-right-radius: 4px; border-top-left-radius: 4px; margin-bottom: -1px; - background-image: url('nav_f.png'); + background-image: var(--memdef-title-gradient-image); background-repeat: repeat-x; - background-color: #E2E8F2; + background-color: var(--memdef-title-background-color); line-height: 1.25; font-weight: 300; float:left; @@ -636,20 +990,11 @@ table.memberdecls { .memtemplate { font-size: 80%; - color: #4665A2; + color: var(--memdef-template-color); font-weight: normal; margin-left: 9px; } -.memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - .mempage { width: 100%; } @@ -668,7 +1013,7 @@ table.memberdecls { } .memitem.glow { - box-shadow: 0 0 15px cyan; + box-shadow: 0 0 15px var(--glow-color); } .memname { @@ -681,41 +1026,32 @@ table.memberdecls { } .memproto, dl.reflist dt { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); padding: 6px 0px 6px 0px; - color: #253555; + color: var(--memdef-proto-text-color); font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-color: #DFE5F1; - /* opera specific markup */ + text-shadow: var(--memdef-proto-text-shadow); + background-color: var(--memdef-proto-background-color); box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 4px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 4px; - } .overload { - font-family: "courier new",courier,monospace; + font-family: var(--font-family-monospace); font-size: 65%; } .memdoc, dl.reflist dd { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); padding: 6px 10px 2px 10px; - background-color: #FBFCFD; border-top-width: 0; background-image:url('nav_g.png'); background-repeat:repeat-x; - background-color: #FFFFFF; + background-color: var(--memdef-doc-background-color); /* opera specific markup */ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; @@ -748,7 +1084,7 @@ dl.reflist dd { } .paramname { - color: #602020; + color: var(--memdef-param-name-color); white-space: nowrap; } .paramname em { @@ -761,20 +1097,20 @@ dl.reflist dd { .params, .retval, .exception, .tparams { margin-left: 0px; padding-left: 0px; -} +} .params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { font-weight: bold; vertical-align: top; } - + .params .paramtype, .tparams .paramtype { font-style: italic; vertical-align: top; -} - +} + .params .paramdir, .tparams .paramdir { - font-family: "courier new",courier,monospace; + font-family: var(--font-family-monospace); vertical-align: top; } @@ -798,13 +1134,13 @@ span.mlabels { } span.mlabel { - background-color: #728DC1; - border-top:1px solid #5373B4; - border-left:1px solid #5373B4; - border-right:1px solid #C4CFE5; - border-bottom:1px solid #C4CFE5; + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); text-shadow: none; - color: white; + color: var(--label-foreground-color); margin-right: 4px; padding: 2px 3px; border-radius: 3px; @@ -821,8 +1157,8 @@ span.mlabel { div.directory { margin: 10px 0px; - border-top: 1px solid #9CAFD4; - border-bottom: 1px solid #9CAFD4; + border-top: 1px solid var(--directory-separator-color); + border-bottom: 1px solid var(--directory-separator-color); width: 100%; } @@ -858,9 +1194,14 @@ div.directory { border-left: 1px solid rgba(0,0,0,0.05); } +.directory tr.odd { + padding-left: 6px; + background-color: var(--index-odd-item-bg-color); +} + .directory tr.even { padding-left: 6px; - background-color: #F7F8FB; + background-color: var(--index-even-item-bg-color); } .directory img { @@ -878,11 +1219,11 @@ div.directory { cursor: pointer; padding-left: 2px; padding-right: 2px; - color: #3D578C; + color: var(--page-link-color); } .arrow { - color: #9CAFD4; + color: var(--nav-arrow-color); -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; @@ -896,14 +1237,15 @@ div.directory { } .icon { - font-family: Arial, Helvetica; + font-family: var(--font-family-icon); + line-height: normal; font-weight: bold; font-size: 12px; height: 14px; width: 16px; display: inline-block; - background-color: #728DC1; - color: white; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); text-align: center; border-radius: 4px; margin-left: 2px; @@ -920,8 +1262,7 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('folderopen.png'); - background-position: 0px -4px; + background-image:var(--icon-folder-open-image); background-repeat: repeat-y; vertical-align:top; display: inline-block; @@ -931,8 +1272,7 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('folderclosed.png'); - background-position: 0px -4px; + background-image:var(--icon-folder-closed-image); background-repeat: repeat-y; vertical-align:top; display: inline-block; @@ -942,17 +1282,13 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('doc.png'); + background-image:var(--icon-doc-image); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } -table.directory { - font: 400 14px Roboto,sans-serif; -} - /* @end */ div.dynheader { @@ -967,7 +1303,7 @@ div.dynheader { address { font-style: normal; - color: #2A3D61; + color: var(--footer-foreground-color); } table.doxtable caption { @@ -981,28 +1317,23 @@ table.doxtable { } table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; + border: 1px solid var(--table-cell-border-color); padding: 3px 7px 2px; } table.doxtable th { - background-color: #374F7F; - color: #FFFFFF; + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-size: 110%; padding-bottom: 4px; padding-top: 5px; } table.fieldtable { - /*width: 100%;*/ margin-bottom: 10px; - border: 1px solid #A8B8D9; + border: 1px solid var(--memdef-border-color); border-spacing: 0px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; border-radius: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); } @@ -1012,8 +1343,8 @@ table.fieldtable { .fieldtable td.fieldtype, .fieldtable td.fieldname { white-space: nowrap; - border-right: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); vertical-align: top; } @@ -1022,14 +1353,13 @@ table.fieldtable { } .fieldtable td.fielddoc { - border-bottom: 1px solid #A8B8D9; - /*width: 100%;*/ + border-bottom: 1px solid var(--memdef-border-color); } .fieldtable td.fielddoc p:first-child { margin-top: 0px; -} - +} + .fieldtable td.fielddoc p:last-child { margin-bottom: 2px; } @@ -1039,22 +1369,18 @@ table.fieldtable { } .fieldtable th { - background-image:url('nav_f.png'); + background-image: var(--memdef-title-gradient-image); background-repeat:repeat-x; - background-color: #E2E8F2; + background-color: var(--memdef-title-background-color); font-size: 90%; - color: #253555; + color: var(--memdef-proto-text-color); padding-bottom: 4px; padding-top: 5px; text-align:left; font-weight: 400; - -moz-border-radius-topleft: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; - border-bottom: 1px solid #A8B8D9; + border-bottom: 1px solid var(--memdef-border-color); } @@ -1062,7 +1388,7 @@ table.fieldtable { top: 0px; left: 10px; height: 36px; - background-image: url('tab_b.png'); + background-image: var(--nav-gradient-image); z-index: 101; overflow: hidden; font-size: 13px; @@ -1071,13 +1397,13 @@ table.fieldtable { .navpath ul { font-size: 11px; - background-image:url('tab_b.png'); + background-image: var(--nav-gradient-image); background-repeat:repeat-x; background-position: 0 -5px; height:30px; line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; + color:var(--nav-text-normal-color); + border:solid 1px var(--nav-breadcrumb-border-color); overflow:hidden; margin:0px; padding:0px; @@ -1089,10 +1415,10 @@ table.fieldtable { float:left; padding-left:10px; padding-right:15px; - background-image:url('bc_s.png'); + background-image:var(--nav-breadcrumb-image); background-repeat:no-repeat; background-position:right; - color:#364D7C; + color: var(--nav-foreground-color); } .navpath li.navelem a @@ -1101,15 +1427,16 @@ table.fieldtable { display:block; text-decoration: none; outline: none; - color: #283A5D; - font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; + color: var(--nav-text-normal-color); + font-family: var(--font-family-nav); + text-shadow: var(--nav-text-normal-shadow); + text-decoration: none; } .navpath li.navelem a:hover { - color:#6884BD; + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); } .navpath li.footer @@ -1121,7 +1448,7 @@ table.fieldtable { background-image:none; background-repeat:no-repeat; background-position:right; - color:#364D7C; + color: var(--footer-foreground-color); font-size: 8pt; } @@ -1133,7 +1460,7 @@ div.summary padding-right: 5px; width: 50%; text-align: right; -} +} div.summary a { @@ -1148,7 +1475,7 @@ table.classindex margin-right: 3%; width: 94%; border: 0; - border-spacing: 0; + border-spacing: 0; padding: 0; } @@ -1166,11 +1493,11 @@ div.ingroups a div.header { - background-image:url('nav_h.png'); + background-image: var(--header-gradient-image); background-repeat:repeat-x; - background-color: #F9FAFC; + background-color: var(--header-background-color); margin: 0px; - border-bottom: 1px solid #C4CFE5; + border-bottom: 1px solid var(--header-separator-color); } div.headertitle @@ -1193,11 +1520,6 @@ dl.section { padding-left: 0px; } -dl.section.DocNodeRTL { - margin-right: 0px; - padding-right: 0px; -} - dl.note { margin-left: -7px; padding-left: 3px; @@ -1205,16 +1527,6 @@ dl.note { border-color: #D0C000; } -dl.note.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #D0C000; -} - dl.warning, dl.attention { margin-left: -7px; padding-left: 3px; @@ -1222,16 +1534,6 @@ dl.warning, dl.attention { border-color: #FF0000; } -dl.warning.DocNodeRTL, dl.attention.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #FF0000; -} - dl.pre, dl.post, dl.invariant { margin-left: -7px; padding-left: 3px; @@ -1239,16 +1541,6 @@ dl.pre, dl.post, dl.invariant { border-color: #00D000; } -dl.pre.DocNodeRTL, dl.post.DocNodeRTL, dl.invariant.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #00D000; -} - dl.deprecated { margin-left: -7px; padding-left: 3px; @@ -1256,16 +1548,6 @@ dl.deprecated { border-color: #505050; } -dl.deprecated.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #505050; -} - dl.todo { margin-left: -7px; padding-left: 3px; @@ -1273,16 +1555,6 @@ dl.todo { border-color: #00C0E0; } -dl.todo.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #00C0E0; -} - dl.test { margin-left: -7px; padding-left: 3px; @@ -1290,16 +1562,6 @@ dl.test { border-color: #3030E0; } -dl.test.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #3030E0; -} - dl.bug { margin-left: -7px; padding-left: 3px; @@ -1307,21 +1569,16 @@ dl.bug { border-color: #C08050; } -dl.bug.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #C08050; -} - dl.section dd { margin-bottom: 6px; } +#projectrow +{ + height: 56px; +} + #projectlogo { text-align: center; @@ -1337,25 +1594,29 @@ dl.section dd { #projectalign { vertical-align: middle; + padding-left: 0.5em; } #projectname { - font: 300% Tahoma, Arial,sans-serif; + font-size: 200%; + font-family: var(--font-family-title); margin: 0px; padding: 2px 0px; } - + #projectbrief { - font: 120% Tahoma, Arial,sans-serif; + font-size: 90%; + font-family: var(--font-family-title); margin: 0px; padding: 0px; } #projectnumber { - font: 50% Tahoma, Arial,sans-serif; + font-size: 50%; + font-family: 50% var(--font-family-title); margin: 0px; padding: 0px; } @@ -1365,7 +1626,8 @@ dl.section dd { padding: 0px; margin: 0px; width: 100%; - border-bottom: 1px solid #5373B4; + border-bottom: 1px solid var(--title-separator-color); + background-color: var(--title-background-color); } .image @@ -1398,17 +1660,12 @@ dl.section dd { font-weight: bold; } -div.zoom -{ - border: 1px solid #90A5CE; -} - dl.citelist { margin-bottom:50px; } dl.citelist dt { - color:#334975; + color:var(--citation-label-color); float:left; font-weight:bold; margin-right:10px; @@ -1424,8 +1681,8 @@ dl.citelist dd { div.toc { padding: 14px 25px; - background-color: #F4F6FA; - border: 1px solid #D8DFEE; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); border-radius: 7px 7px 7px 7px; float: right; height: auto; @@ -1433,28 +1690,17 @@ div.toc { width: 200px; } -.PageDocRTL-title div.toc { - float: left !important; - text-align: right; -} - div.toc li { - background: url("bdwn.png") no-repeat scroll 0 5px transparent; - font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); margin-top: 5px; padding-left: 10px; padding-top: 2px; } -.PageDocRTL-title div.toc li { - background-position-x: right !important; - padding-left: 0 !important; - padding-right: 10px; -} - div.toc h3 { - font: bold 12px/1.2 Arial,FreeSans,sans-serif; - color: #4665A2; + font: bold 12px/1.2 var(--font-family-toc); + color: var(--toc-header-color); border-bottom: 0 none; margin: 0; } @@ -1463,7 +1709,7 @@ div.toc ul { list-style: none outside none; border: medium none; padding: 0px; -} +} div.toc li.level1 { margin-left: 0px; @@ -1474,11 +1720,11 @@ div.toc li.level2 { } div.toc li.level3 { - margin-left: 30px; + margin-left: 15px; } div.toc li.level4 { - margin-left: 45px; + margin-left: 15px; } span.emoji { @@ -1487,29 +1733,13 @@ span.emoji { */ } -.PageDocRTL-title div.toc li.level1 { - margin-left: 0 !important; - margin-right: 0; -} - -.PageDocRTL-title div.toc li.level2 { - margin-left: 0 !important; - margin-right: 15px; -} - -.PageDocRTL-title div.toc li.level3 { - margin-left: 0 !important; - margin-right: 30px; -} - -.PageDocRTL-title div.toc li.level4 { - margin-left: 0 !important; - margin-right: 45px; +span.obfuscator { + display: none; } .inherit_header { font-weight: bold; - color: gray; + color: var(--inherit-header-color); cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; @@ -1541,11 +1771,12 @@ tr.heading h2 { #powerTip { cursor: default; - white-space: nowrap; - background-color: white; - border: 1px solid gray; + /*white-space: nowrap;*/ + color: var(--tooltip-foreground-color); + background-color: var(--tooltip-background-color); + border: 1px solid var(--tooltip-border-color); border-radius: 4px 4px 4px 4px; - box-shadow: 1px 1px 7px gray; + box-shadow: var(--tooltip-shadow); display: none; font-size: smaller; max-width: 80%; @@ -1556,7 +1787,7 @@ tr.heading h2 { } #powerTip div.ttdoc { - color: grey; + color: var(--tooltip-doc-color); font-style: italic; } @@ -1564,18 +1795,24 @@ tr.heading h2 { font-weight: bold; } +#powerTip a { + color: var(--tooltip-link-color); +} + #powerTip div.ttname { font-weight: bold; } #powerTip div.ttdeci { - color: #006318; + color: var(--tooltip-declaration-color); } #powerTip div { margin: 0px; padding: 0px; - font: 12px/16px Roboto,sans-serif; + font-size: 12px; + font-family: var(--font-family-tooltip); + line-height: 16px; } #powerTip:before, #powerTip:after { @@ -1620,12 +1857,12 @@ tr.heading h2 { } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { - border-top-color: #FFFFFF; + border-top-color: var(--tooltip-background-color); border-width: 10px; margin: 0px -10px; } -#powerTip.n:before { - border-top-color: #808080; +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: var(--tooltip-border-color); border-width: 11px; margin: 0px -11px; } @@ -1648,13 +1885,13 @@ tr.heading h2 { } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { - border-bottom-color: #FFFFFF; + border-bottom-color: var(--tooltip-background-color); border-width: 10px; margin: 0px -10px; } #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { - border-bottom-color: #808080; + border-bottom-color: var(--tooltip-border-color); border-width: 11px; margin: 0px -11px; } @@ -1675,13 +1912,13 @@ tr.heading h2 { left: 100%; } #powerTip.e:after { - border-left-color: #FFFFFF; + border-left-color: var(--tooltip-border-color); border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.e:before { - border-left-color: #808080; + border-left-color: var(--tooltip-border-color); border-width: 11px; top: 50%; margin-top: -11px; @@ -1691,13 +1928,13 @@ tr.heading h2 { right: 100%; } #powerTip.w:after { - border-right-color: #FFFFFF; + border-right-color: var(--tooltip-border-color); border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.w:before { - border-right-color: #808080; + border-right-color: var(--tooltip-border-color); border-width: 11px; top: 50%; margin-top: -11px; @@ -1731,7 +1968,7 @@ table.markdownTable { } table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; + border: 1px solid var(--table-cell-border-color); padding: 3px 7px 2px; } @@ -1739,8 +1976,8 @@ table.markdownTable tr { } th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-size: 110%; padding-bottom: 4px; padding-top: 5px; @@ -1758,32 +1995,9 @@ th.markdownTableHeadCenter, td.markdownTableBodyCenter { text-align: center } -.DocNodeRTL { - text-align: right; - direction: rtl; -} - -.DocNodeLTR { - text-align: left; - direction: ltr; -} - -table.DocNodeRTL { - width: auto; - margin-right: 0; - margin-left: auto; -} - -table.DocNodeLTR { - width: auto; - margin-right: auto; - margin-left: 0; -} - tt, code, kbd, samp { display: inline-block; - direction:ltr; } /* @end */ @@ -1791,3 +2005,23 @@ u { text-decoration: underline; } +details>summary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + diff --git a/html/reference/doxygen.svg b/html/reference/doxygen.svg index d42dad52d..79a763540 100644 --- a/html/reference/doxygen.svg +++ b/html/reference/doxygen.svg @@ -1,4 +1,6 @@ + @@ -17,7 +19,7 @@ - + diff --git a/html/reference/dynamic__at__c_8hpp_source.html b/html/reference/dynamic__at__c_8hpp_source.html index 23f31861f..7463de98b 100644 --- a/html/reference/dynamic__at__c_8hpp_source.html +++ b/html/reference/dynamic__at__c_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_at_c.hpp Source File @@ -27,147 +27,151 @@
        - + +/* @license-end */ + +
        -
        -
        dynamic_at_c.hpp
        +
        dynamic_at_c.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_AT_C_HPP
        -
        9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_AT_C_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 
        -
        13 #include <boost/preprocessor/facilities/empty.hpp>
        -
        14 #include <boost/preprocessor/repetition/repeat.hpp>
        -
        15 
        -
        16 #include <stdexcept>
        -
        17 
        -
        18 namespace boost { namespace gil {
        -
        19 
        -
        20 // Constructs for static-to-dynamic integer convesion
        -
        21 
        -
        22 #define BOOST_GIL_AT_C_VALUE(z, N, text) mp11::mp_at_c<IntTypes, S+N>::value,
        -
        23 #define BOOST_GIL_DYNAMIC_AT_C_LIMIT 226 // size of the maximum vector to handle
        -
        24 
        -
        25 #define BOOST_GIL_AT_C_LOOKUP(z, NUM, text) \
        -
        26  template<std::size_t S> \
        -
        27  struct at_c_fn<S,NUM> { \
        -
        28  template <typename IntTypes, typename ValueType> inline \
        -
        29  static ValueType apply(std::size_t index) { \
        -
        30  static ValueType table[] = { \
        -
        31  BOOST_PP_REPEAT(NUM, BOOST_GIL_AT_C_VALUE, BOOST_PP_EMPTY) \
        -
        32  }; \
        -
        33  return table[index]; \
        -
        34  } \
        -
        35  };
        -
        36 
        -
        37 namespace detail {
        -
        38  namespace at_c {
        -
        39  template <std::size_t START, std::size_t NUM> struct at_c_fn;
        -
        40  BOOST_PP_REPEAT(BOOST_GIL_DYNAMIC_AT_C_LIMIT, BOOST_GIL_AT_C_LOOKUP, BOOST_PP_EMPTY)
        -
        41 
        -
        42  template <std::size_t QUOT> struct at_c_impl;
        -
        43 
        -
        44  template <>
        -
        45  struct at_c_impl<0> {
        -
        46  template <typename IntTypes, typename ValueType> inline
        -
        47  static ValueType apply(std::size_t index) {
        -
        48  return at_c_fn<0, mp11::mp_size<IntTypes>::value>::template apply<IntTypes,ValueType>(index);
        -
        49  }
        -
        50  };
        -
        51 
        -
        52  template <>
        -
        53  struct at_c_impl<1> {
        -
        54  template <typename IntTypes, typename ValueType> inline
        -
        55  static ValueType apply(std::size_t index) {
        -
        56  const std::size_t SIZE = mp11::mp_size<IntTypes>::value;
        -
        57  const std::size_t REM = SIZE % BOOST_GIL_DYNAMIC_AT_C_LIMIT;
        -
        58  switch (index / BOOST_GIL_DYNAMIC_AT_C_LIMIT) {
        -
        59  case 0: return at_c_fn<0 ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index);
        -
        60  case 1: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT ,REM >::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT);
        -
        61  };
        -
        62  throw;
        -
        63  }
        -
        64  };
        -
        65 
        -
        66  template <>
        -
        67  struct at_c_impl<2> {
        -
        68  template <typename IntTypes, typename ValueType> inline
        -
        69  static ValueType apply(std::size_t index) {
        -
        70  const std::size_t SIZE = mp11::mp_size<IntTypes>::value;
        -
        71  const std::size_t REM = SIZE % BOOST_GIL_DYNAMIC_AT_C_LIMIT;
        -
        72  switch (index / BOOST_GIL_DYNAMIC_AT_C_LIMIT) {
        -
        73  case 0: return at_c_fn<0 ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index);
        -
        74  case 1: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT);
        -
        75  case 2: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT*2,REM >::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT*2);
        -
        76  };
        -
        77  throw;
        -
        78  }
        -
        79  };
        -
        80 
        -
        81  template <>
        -
        82  struct at_c_impl<3> {
        -
        83  template <typename IntTypes, typename ValueType> inline
        -
        84  static ValueType apply(std::size_t index) {
        -
        85  const std::size_t SIZE = mp11::mp_size<IntTypes>::value;
        -
        86  const std::size_t REM = SIZE % BOOST_GIL_DYNAMIC_AT_C_LIMIT;
        -
        87  switch (index / BOOST_GIL_DYNAMIC_AT_C_LIMIT) {
        -
        88  case 0: return at_c_fn<0 ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index);
        -
        89  case 1: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT);
        -
        90  case 2: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT*2,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT*2);
        -
        91  case 3: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT*3,REM >::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT*3);
        -
        92  };
        -
        93  throw;
        -
        94  }
        -
        95  };
        -
        96  }
        -
        97 }
        -
        98 
        -
        106 
        -
        107 template <typename IntTypes, typename ValueType> inline
        -
        108 ValueType at_c(std::size_t index) {
        -
        109  const std::size_t Size=mp11::mp_size<IntTypes>::value;
        -
        110  return detail::at_c::at_c_impl<Size/BOOST_GIL_DYNAMIC_AT_C_LIMIT>::template apply<IntTypes,ValueType>(index);
        -
        111 }
        -
        112 
        -
        113 #undef BOOST_GIL_AT_C_VALUE
        -
        114 #undef BOOST_GIL_DYNAMIC_AT_C_LIMIT
        -
        115 #undef BOOST_GIL_AT_C_LOOKUP
        -
        116 
        -
        117 }} // namespace boost::gil
        -
        118 
        -
        119 #endif
        -
        auto at_c(detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
        Provides mutable access to the K-th element, in physical order.
        Definition: color_base.hpp:632
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_AT_C_HPP
        +
        9#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_AT_C_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12
        +
        13#include <boost/preprocessor/facilities/empty.hpp>
        +
        14#include <boost/preprocessor/repetition/repeat.hpp>
        +
        15
        +
        16#include <stdexcept>
        +
        17
        +
        18namespace boost { namespace gil {
        +
        19
        +
        20// Constructs for static-to-dynamic integer conversion
        +
        21
        +
        22#define BOOST_GIL_AT_C_VALUE(z, N, text) mp11::mp_at_c<IntTypes, S+N>::value,
        +
        23#define BOOST_GIL_DYNAMIC_AT_C_LIMIT 226 // size of the maximum vector to handle
        +
        24
        +
        25#define BOOST_GIL_AT_C_LOOKUP(z, NUM, text) \
        +
        26 template<std::size_t S> \
        +
        27 struct at_c_fn<S,NUM> { \
        +
        28 template <typename IntTypes, typename ValueType> inline \
        +
        29 static ValueType apply(std::size_t index) { \
        +
        30 static ValueType table[] = { \
        +
        31 BOOST_PP_REPEAT(NUM, BOOST_GIL_AT_C_VALUE, BOOST_PP_EMPTY) \
        +
        32 }; \
        +
        33 return table[index]; \
        +
        34 } \
        +
        35 };
        +
        36
        +
        37namespace detail {
        +
        38 namespace at_c {
        +
        39 template <std::size_t START, std::size_t NUM> struct at_c_fn;
        +
        40 BOOST_PP_REPEAT(BOOST_GIL_DYNAMIC_AT_C_LIMIT, BOOST_GIL_AT_C_LOOKUP, BOOST_PP_EMPTY)
        +
        41
        +
        42 template <std::size_t QUOT> struct at_c_impl;
        +
        43
        +
        44 template <>
        +
        45 struct at_c_impl<0> {
        +
        46 template <typename IntTypes, typename ValueType> inline
        +
        47 static ValueType apply(std::size_t index) {
        +
        48 return at_c_fn<0, mp11::mp_size<IntTypes>::value>::template apply<IntTypes,ValueType>(index);
        +
        49 }
        +
        50 };
        +
        51
        +
        52 template <>
        +
        53 struct at_c_impl<1> {
        +
        54 template <typename IntTypes, typename ValueType> inline
        +
        55 static ValueType apply(std::size_t index) {
        +
        56 const std::size_t SIZE = mp11::mp_size<IntTypes>::value;
        +
        57 const std::size_t REM = SIZE % BOOST_GIL_DYNAMIC_AT_C_LIMIT;
        +
        58 switch (index / BOOST_GIL_DYNAMIC_AT_C_LIMIT) {
        +
        59 case 0: return at_c_fn<0 ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index);
        +
        60 case 1: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT ,REM >::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT);
        +
        61 };
        +
        62 throw;
        +
        63 }
        +
        64 };
        +
        65
        +
        66 template <>
        +
        67 struct at_c_impl<2> {
        +
        68 template <typename IntTypes, typename ValueType> inline
        +
        69 static ValueType apply(std::size_t index) {
        +
        70 const std::size_t SIZE = mp11::mp_size<IntTypes>::value;
        +
        71 const std::size_t REM = SIZE % BOOST_GIL_DYNAMIC_AT_C_LIMIT;
        +
        72 switch (index / BOOST_GIL_DYNAMIC_AT_C_LIMIT) {
        +
        73 case 0: return at_c_fn<0 ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index);
        +
        74 case 1: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT);
        +
        75 case 2: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT*2,REM >::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT*2);
        +
        76 };
        +
        77 throw;
        +
        78 }
        +
        79 };
        +
        80
        +
        81 template <>
        +
        82 struct at_c_impl<3> {
        +
        83 template <typename IntTypes, typename ValueType> inline
        +
        84 static ValueType apply(std::size_t index) {
        +
        85 const std::size_t SIZE = mp11::mp_size<IntTypes>::value;
        +
        86 const std::size_t REM = SIZE % BOOST_GIL_DYNAMIC_AT_C_LIMIT;
        +
        87 switch (index / BOOST_GIL_DYNAMIC_AT_C_LIMIT) {
        +
        88 case 0: return at_c_fn<0 ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index);
        +
        89 case 1: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT ,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT);
        +
        90 case 2: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT*2,BOOST_GIL_DYNAMIC_AT_C_LIMIT-1>::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT*2);
        +
        91 case 3: return at_c_fn<BOOST_GIL_DYNAMIC_AT_C_LIMIT*3,REM >::template apply<IntTypes,ValueType>(index - BOOST_GIL_DYNAMIC_AT_C_LIMIT*3);
        +
        92 };
        +
        93 throw;
        +
        94 }
        +
        95 };
        +
        96 }
        +
        97}
        +
        98
        +
        106
        +
        107template <typename IntTypes, typename ValueType> inline
        +
        108ValueType at_c(std::size_t index) {
        +
        109 const std::size_t Size=mp11::mp_size<IntTypes>::value;
        +
        110 return detail::at_c::at_c_impl<Size/BOOST_GIL_DYNAMIC_AT_C_LIMIT>::template apply<IntTypes,ValueType>(index);
        +
        111}
        +
        112
        +
        113#undef BOOST_GIL_AT_C_VALUE
        +
        114#undef BOOST_GIL_DYNAMIC_AT_C_LIMIT
        +
        115#undef BOOST_GIL_AT_C_LOOKUP
        +
        116
        +
        117}} // namespace boost::gil
        +
        118
        +
        119#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/dynamic__image__all_8hpp_source.html b/html/reference/dynamic__image__all_8hpp_source.html index cacce49c8..2b14d11c4 100644 --- a/html/reference/dynamic__image__all_8hpp_source.html +++ b/html/reference/dynamic__image__all_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_image_all.hpp Source File @@ -27,42 +27,47 @@

        - + +/* @license-end */ + +
        -
        -
        dynamic_image_all.hpp
        +
        dynamic_image_all.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_IMAGE_ALL_HPP
        -
        9 #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_IMAGE_ALL_HPP
        -
        10 
        - -
        12 #include <boost/gil/extension/dynamic_image/any_image.hpp>
        -
        13 #include <boost/gil/extension/dynamic_image/apply_operation.hpp>
        -
        14 #include <boost/gil/extension/dynamic_image/image_view_factory.hpp>
        -
        15 
        -
        16 #endif
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_IMAGE_ALL_HPP
        +
        9#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_DYNAMIC_IMAGE_ALL_HPP
        +
        10
        + +
        12#include <boost/gil/extension/dynamic_image/any_image.hpp>
        +
        13#include <boost/gil/extension/dynamic_image/apply_operation.hpp>
        +
        14#include <boost/gil/extension/dynamic_image/image_view_factory.hpp>
        +
        15
        +
        16#endif
        Some basic STL-style algorithms when applied to runtime type specified image views.
        @@ -70,7 +75,7 @@ $(function() { diff --git a/html/reference/dynamic__step_8hpp_source.html b/html/reference/dynamic__step_8hpp_source.html index f3f63fece..c49cb1fe4 100644 --- a/html/reference/dynamic__step_8hpp_source.html +++ b/html/reference/dynamic__step_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_step.hpp Source File @@ -27,63 +27,68 @@

        - + +/* @license-end */ + +
        -
        -
        dynamic_step.hpp
        +
        dynamic_step.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_DYNAMIC_STEP_HPP
        -
        9 #define BOOST_GIL_DYNAMIC_STEP_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/dynamic_step.hpp>
        -
        12 
        -
        13 namespace boost { namespace gil {
        -
        14 
        -
        16 template <typename IteratorOrLocatorOrView>
        - -
        18 
        -
        20 template <typename LocatorOrView>
        - -
        22 
        -
        26 template <typename View>
        - -
        28 
        -
        29 }} // namespace boost::gil
        -
        30 
        -
        31 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition: dynamic_step.hpp:17
        -
        Returns the type of a view that has a dynamic step along both X and Y.
        Definition: image_view_factory.hpp:46
        -
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition: dynamic_step.hpp:21
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_DYNAMIC_STEP_HPP
        +
        9#define BOOST_GIL_DYNAMIC_STEP_HPP
        +
        10
        +
        11#include <boost/gil/concepts/dynamic_step.hpp>
        +
        12
        +
        13namespace boost { namespace gil {
        +
        14
        +
        16template <typename IteratorOrLocatorOrView>
        + +
        18
        +
        20template <typename LocatorOrView>
        + +
        22
        +
        26template <typename View>
        + +
        28
        +
        29}} // namespace boost::gil
        +
        30
        +
        31#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition dynamic_step.hpp:17
        +
        Returns the type of a view that has a dynamic step along both X and Y.
        Definition image_view_factory.hpp:46
        +
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition dynamic_step.hpp:21
        diff --git a/html/reference/dynsections.js b/html/reference/dynsections.js index 3174bd7be..b73c82889 100644 --- a/html/reference/dynsections.js +++ b/html/reference/dynsections.js @@ -47,6 +47,8 @@ function updateStripes() { $('table.directory tr'). removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); } function toggleLevel(level) @@ -118,4 +120,73 @@ function toggleInherit(id) $(img).attr('src',src.substring(0,src.length-10)+'open.png'); } } + +var opened=true; +// in case HTML_COLORSTYLE is LIGHT or DARK the vars will be replaced, so we write them out explicitly and use double quotes +var plusImg = [ "var(--fold-plus-image)", "var(--fold-plus-image-relpath)" ]; +var minusImg = [ "var(--fold-minus-image)", "var(--fold-minus-image-relpath)" ]; + +// toggle all folding blocks +function codefold_toggle_all(relPath) { + if (opened) { + $('#fold_all').css('background-image',plusImg[relPath]); + $('div[id^=foldopen]').hide(); + $('div[id^=foldclosed]').show(); + } else { + $('#fold_all').css('background-image',minusImg[relPath]); + $('div[id^=foldopen]').show(); + $('div[id^=foldclosed]').hide(); + } + opened=!opened; +} + +// toggle single folding block +function codefold_toggle(id) { + $('#foldopen'+id).toggle(); + $('#foldclosed'+id).toggle(); +} +function init_codefold(relPath) { + $('span[class=lineno]').css( + {'padding-right':'4px', + 'margin-right':'2px', + 'display':'inline-block', + 'width':'54px', + 'background':'linear-gradient(var(--fold-line-color),var(--fold-line-color)) no-repeat 46px/2px 100%' + }); + // add global toggle to first line + $('span[class=lineno]:first').append(''); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + var id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + var start = $(this).attr('data-start'); + var end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + var line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').css('background-image',plusImg[relPath]); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); +} + /* @license-end */ diff --git a/html/reference/error_8hpp_source.html b/html/reference/error_8hpp_source.html index d45b8ddc8..15a6d1f88 100644 --- a/html/reference/error_8hpp_source.html +++ b/html/reference/error_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: error.hpp Source File @@ -27,63 +27,68 @@

        - + +/* @license-end */ + +
        -
        -
        error.hpp
        +
        error.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_ERROR_HPP
        -
        9 #define BOOST_GIL_IO_ERROR_HPP
        -
        10 
        -
        11 #include <ios>
        -
        12 
        -
        13 namespace boost { namespace gil {
        -
        14 
        -
        15 inline void io_error(const char* descr)
        -
        16 {
        -
        17  throw std::ios_base::failure(descr);
        -
        18 }
        -
        19 
        -
        20 inline void io_error_if(bool expr, const char* descr)
        -
        21 {
        -
        22  if (expr)
        -
        23  io_error(descr);
        -
        24 }
        -
        25 
        -
        26 } // namespace gil
        -
        27 } // namespace boost
        -
        28 
        -
        29 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_ERROR_HPP
        +
        9#define BOOST_GIL_IO_ERROR_HPP
        +
        10
        +
        11#include <ios>
        +
        12
        +
        13namespace boost { namespace gil {
        +
        14
        +
        15inline void io_error(const char* descr)
        +
        16{
        +
        17 throw std::ios_base::failure(descr);
        +
        18}
        +
        19
        +
        20inline void io_error_if(bool expr, const char* descr)
        +
        21{
        +
        22 if (expr)
        +
        23 io_error(descr);
        +
        24}
        +
        25
        +
        26} // namespace gil
        +
        27} // namespace boost
        +
        28
        +
        29#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/extension_2dynamic__image_2algorithm_8hpp.html b/html/reference/extension_2dynamic__image_2algorithm_8hpp.html index f497e860e..686e85f9b 100644 --- a/html/reference/extension_2dynamic__image_2algorithm_8hpp.html +++ b/html/reference/extension_2dynamic__image_2algorithm_8hpp.html @@ -4,7 +4,7 @@ - + Generic Image Library: algorithm.hpp File Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -61,58 +61,58 @@ $(function() {

        Go to the source code of this file.

        @@ -412,7 +414,7 @@ class boost::gil::image_view< Loc > diff --git a/html/reference/classboost_1_1gil_1_1iterator__from__2d-members.html b/html/reference/classboost_1_1gil_1_1iterator__from__2d-members.html index ed02c175e..690e35396 100644 --- a/html/reference/classboost_1_1gil_1_1iterator__from__2d-members.html +++ b/html/reference/classboost_1_1gil_1_1iterator__from__2d-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        iterator_from_2d< Loc2 > Member List
        +
        iterator_from_2d< Loc2 > Member List

        This is the complete list of members for iterator_from_2d< Loc2 >, including all inherited members.

        - + - + - + - + - + - + - + - + - +
        boost::iterator_core_access (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >friend
        difference_type typedef (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        difference_type typedef (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        is_1d_traversable() const (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        iterator_from_2d (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >friend
        iterator_from_2d (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >friend
        iterator_from_2d()=default (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        iterator_from_2d(const Loc2 &p, std::ptrdiff_t width, std::ptrdiff_t x=0, std::ptrdiff_t y=0) (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        iterator_from_2d(const Loc2 &p, std::ptrdiff_t width, std::ptrdiff_t x=0, std::ptrdiff_t y=0) (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        iterator_from_2d(const iterator_from_2d &pit) (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        iterator_from_2d(const iterator_from_2d< Loc > &pit) (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        iterator_from_2d(const iterator_from_2d< Loc > &pit) (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        operator=(iterator_from_2d const &other)=default (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        operator[](difference_type d) constiterator_from_2d< Loc2 >inline
        operator[](difference_type d) constiterator_from_2d< Loc2 >inline
        parent_t typedef (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        point_t typedef (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        point_t typedef (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        reference typedef (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        width() const (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        width() const (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        x() (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        x_iterator typedef (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        x_iterator typedef (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >
        x_pos() const (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        y_pos() const (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        y_pos() const (defined in iterator_from_2d< Loc2 >)iterator_from_2d< Loc2 >inline
        diff --git a/html/reference/classboost_1_1gil_1_1iterator__from__2d.html b/html/reference/classboost_1_1gil_1_1iterator__from__2d.html index 2e9a64915..397b9e34f 100644 --- a/html/reference/classboost_1_1gil_1_1iterator__from__2d.html +++ b/html/reference/classboost_1_1gil_1_1iterator__from__2d.html @@ -4,7 +4,7 @@ - + Generic Image Library: iterator_from_2d< Loc2 > Class Template Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ + -
        -
        iterator_from_2d< Loc2 > Class Template Reference
        +
        iterator_from_2d< Loc2 > Class Template Reference
        @@ -60,75 +60,75 @@ $(function() {

        Inherits iterator_facade< iterator_from_2d< Loc2 >, Loc2::value_type, std::random_access_iterator_tag, Loc2::reference, Loc2::coord_t >.

        - - - - - -

        +

        Public Types

        +
        using parent_t = iterator_facade< iterator_from_2d< Loc2 >, typename Loc2::value_type, std::random_access_iterator_tag, typename Loc2::reference, typename Loc2::coord_t >
         
        +
        using reference = typename parent_t::reference
         
        +
        using difference_type = typename parent_t::difference_type
         
        +
        using x_iterator = typename Loc2::x_iterator
         
        +
        using point_t = typename Loc2::point_t
         
        - - - - - + - - - - + - - - - +

        +

        Public Member Functions

        +
        std::ptrdiff_t width () const
         
        +
        std::ptrdiff_t x_pos () const
         
        +
        std::ptrdiff_t y_pos () const
         
        reference operator[] (difference_type d) const
        reference operator[] (difference_type d) const
         
        +
        bool is_1d_traversable () const
         
        +
        x_iterator & x ()
         
        +
         
         iterator_from_2d (const Loc2 &p, std::ptrdiff_t width, std::ptrdiff_t x=0, std::ptrdiff_t y=0)
         
        +
         iterator_from_2d (const iterator_from_2d &pit)
         
        +
        template<typename Loc >
         iterator_from_2d (const iterator_from_2d< Loc > &pit)
         
        +
        iterator_from_2doperator= (iterator_from_2d const &other)=default
         
         
        - -

        +

        Friends

        +
        class boost::iterator_core_access
         

        Detailed Description

        -

        template<typename Loc2>
        -class boost::gil::iterator_from_2d< Loc2 >

        - -

        Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept.

        +
        template<typename Loc2>
        +class boost::gil::iterator_from_2d< Loc2 >

        Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept.

        Pixels are traversed from the top to the bottom row and from the left to the right within each row

        Member Function Documentation

        - -

        ◆ operator[]()

        + +

        ◆ operator[]()

        +
        +template<typename Loc2 >
        diff --git a/html/reference/dir_29d7d1879aced8e7726ea9a11f3c7333.html b/html/reference/dir_29d7d1879aced8e7726ea9a11f3c7333.html index 65ee27fca..4db56b379 100644 --- a/html/reference/dir_29d7d1879aced8e7726ea9a11f3c7333.html +++ b/html/reference/dir_29d7d1879aced8e7726ea9a11f3c7333.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_processing Directory Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        image_processing Directory Reference
        +
        image_processing Directory Reference
        +
        @@ -160,7 +160,7 @@ class boost::gil::iterator_from_2d< Loc2 > diff --git a/html/reference/classboost_1_1gil_1_1kernel__1d-members.html b/html/reference/classboost_1_1gil_1_1kernel__1d-members.html index 96e69cb86..28ff83fbe 100644 --- a/html/reference/classboost_1_1gil_1_1kernel__1d-members.html +++ b/html/reference/classboost_1_1gil_1_1kernel__1d-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        kernel_1d< T, Allocator > Member List
        +
        kernel_1d< T, Allocator > Member List

        This is the complete list of members for kernel_1d< T, Allocator >, including all inherited members.

        - - + + - + - - - - - - - - - + + + + + + + + +
        center() -> std::size_t & (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
        center() const -> std::size_t const & (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
        center() -> std::size_t & (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        center() const -> std::size_t const & (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        kernel_1d()=default (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >
        kernel_1d(std::size_t size, std::size_t center) (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >inline
        kernel_1d(std::size_t size, std::size_t center) (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >inline
        kernel_1d(FwdIterator elements, std::size_t size, std::size_t center) (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >inline
        kernel_1d(kernel_1d const &other) (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >inline
        kernel_1d_adaptor()=default (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >
        kernel_1d_adaptor(std::size_t center) (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inlineexplicit
        kernel_1d_adaptor(std::size_t size, std::size_t center) (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
        kernel_1d_adaptor(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
        left_size() const (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
        operator=(kernel_1d const &other)=default (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >
        operator=(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
        right_size() const (defined in kernel_1d_adaptor< std::vector< T, std::allocator< T > > >)kernel_1d_adaptor< std::vector< T, std::allocator< T > > >inline
        kernel_1d(kernel_1d const &other) (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >inline
        kernel_1d_adaptor()=default (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >
        kernel_1d_adaptor(std::size_t center) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inlineexplicit
        kernel_1d_adaptor(std::size_t size, std::size_t center) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        kernel_1d_adaptor(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        left_size() const (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        operator=(kernel_1d const &other)=default (defined in kernel_1d< T, Allocator >)kernel_1d< T, Allocator >
        operator=(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        right_size() const (defined in kernel_1d_adaptor< Core >)kernel_1d_adaptor< Core >inline
        diff --git a/html/reference/classboost_1_1gil_1_1kernel__1d.html b/html/reference/classboost_1_1gil_1_1kernel__1d.html index 1d92272d2..637b9eb2f 100644 --- a/html/reference/classboost_1_1gil_1_1kernel__1d.html +++ b/html/reference/classboost_1_1gil_1_1kernel__1d.html @@ -4,7 +4,7 @@ - + Generic Image Library: kernel_1d< T, Allocator > Class Template Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        @@ -61,56 +61,54 @@ Inheritance diagram for kernel_1d< T, Allocator >:
        -kernel_1d_adaptor< std::vector< T, std::allocator< T > > > +kernel_1d_adaptor< Core >
        - - - - - - - - + + - - - - - + - - -

        +

        Public Member Functions

        +
         kernel_1d (std::size_t size, std::size_t center)
         
        +
        template<typename FwdIterator >
         kernel_1d (FwdIterator elements, std::size_t size, std::size_t center)
         
        +
         kernel_1d (kernel_1d const &other)
         
        +
        kernel_1doperator= (kernel_1d const &other)=default
         
        - Public Member Functions inherited from kernel_1d_adaptor< std::vector< T, std::allocator< T > > >
        +
         
        - Public Member Functions inherited from kernel_1d_adaptor< Core >
         kernel_1d_adaptor (std::size_t center)
         
        +
         kernel_1d_adaptor (std::size_t size, std::size_t center)
         
        +
         kernel_1d_adaptor (kernel_1d_adaptor const &other)
         
        +
        kernel_1d_adaptoroperator= (kernel_1d_adaptor const &other)
         
        +
         
        std::size_t left_size () const
         
        +
        std::size_t right_size () const
         
        +
        auto center () -> std::size_t &
         
        +
        auto center () const -> std::size_t const &
         

        Detailed Description

        -

        template<typename T, typename Allocator = std::allocator<T>>
        -class boost::gil::kernel_1d< T, Allocator >

        - -

        variable-size kernel

        +
        template<typename T, typename Allocator = std::allocator<T>>
        +class boost::gil::kernel_1d< T, Allocator >

        variable-size kernel


        The documentation for this class was generated from the following file: @@ -120,7 +118,7 @@ class boost::gil::kernel_1d< T, Allocator > diff --git a/html/reference/classboost_1_1gil_1_1kernel__1d.png b/html/reference/classboost_1_1gil_1_1kernel__1d.png index fb32b2fe1..016ec54f8 100644 Binary files a/html/reference/classboost_1_1gil_1_1kernel__1d.png and b/html/reference/classboost_1_1gil_1_1kernel__1d.png differ diff --git a/html/reference/classboost_1_1gil_1_1kernel__1d__fixed-members.html b/html/reference/classboost_1_1gil_1_1kernel__1d__fixed-members.html index bc43b9802..0910015ce 100644 --- a/html/reference/classboost_1_1gil_1_1kernel__1d__fixed-members.html +++ b/html/reference/classboost_1_1gil_1_1kernel__1d__fixed-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        kernel_1d_fixed< T, Size > Member List
        +
        kernel_1d_fixed< T, Size > Member List

        This is the complete list of members for kernel_1d_fixed< T, Size >, including all inherited members.

        - - - - - - - + - - - - - - + + +
        center() -> std::size_t & (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
        center() const -> std::size_t const & (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
        kernel_1d_adaptor()=default (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >
        kernel_1d_adaptor(std::size_t center) (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inlineexplicit
        kernel_1d_adaptor(std::size_t size, std::size_t center) (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
        kernel_1d_adaptor(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
        kernel_1d_fixed()=default (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >
        kernel_1d_fixed(std::size_t center) (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >inlineexplicit
        kernel_1d_fixed(std::size_t center) (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >inlineexplicit
        kernel_1d_fixed(FwdIterator elements, std::size_t center) (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >inlineexplicit
        kernel_1d_fixed(kernel_1d_fixed const &other) (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >inline
        left_size() const (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
        operator=(kernel_1d_fixed const &other)=default (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >
        operator=(kernel_1d_adaptor const &other) (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
        right_size() const (defined in kernel_1d_adaptor< std::array< T, Size > >)kernel_1d_adaptor< std::array< T, Size > >inline
        static_size (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >static
        kernel_1d_fixed(kernel_1d_fixed const &other) (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >inline
        operator=(kernel_1d_fixed const &other)=default (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >
        static_size (defined in kernel_1d_fixed< T, Size >)kernel_1d_fixed< T, Size >static
        diff --git a/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.html b/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.html index b5308da0c..fa54c4430 100644 --- a/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.html +++ b/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.html @@ -4,7 +4,7 @@ - + Generic Image Library: kernel_1d_fixed< T, Size > Class Template Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ + -
        -
        kernel_1d_fixed< T, Size > Class Template Reference
        +
        kernel_1d_fixed< T, Size > Class Template Reference
        @@ -66,58 +66,56 @@ Inheritance diagram for kernel_1d_fixed< T, Size >:
        - - - - - - + - - - - - - + - - -

        +

        Public Member Functions

        +
         kernel_1d_fixed (std::size_t center)
         
        +
        template<typename FwdIterator >
         kernel_1d_fixed (FwdIterator elements, std::size_t center)
         
        +
         kernel_1d_fixed (kernel_1d_fixed const &other)
         
        +
        kernel_1d_fixedoperator= (kernel_1d_fixed const &other)=default
         
         
        - Public Member Functions inherited from kernel_1d_adaptor< std::array< T, Size > >
        +
         kernel_1d_adaptor (std::size_t center)
         
        +
         kernel_1d_adaptor (std::size_t size, std::size_t center)
         
        +
         kernel_1d_adaptor (kernel_1d_adaptor const &other)
         
        +
        kernel_1d_adaptoroperator= (kernel_1d_adaptor const &other)
         
        +
         
        std::size_t left_size () const
         
        +
        std::size_t right_size () const
         
        +
        auto center () -> std::size_t &
         
        +
        auto center () const -> std::size_t const &
         
        - -

        +

        Static Public Attributes

        +
        static constexpr std::size_t static_size = Size
         

        Detailed Description

        -

        template<typename T, std::size_t Size>
        -class boost::gil::kernel_1d_fixed< T, Size >

        - -

        static-size kernel

        +
        template<typename T, std::size_t Size>
        +class boost::gil::kernel_1d_fixed< T, Size >

        static-size kernel


        The documentation for this class was generated from the following file: @@ -127,7 +125,7 @@ class boost::gil::kernel_1d_fixed< T, Size > diff --git a/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.png b/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.png index 55f572d95..65769ca04 100644 Binary files a/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.png and b/html/reference/classboost_1_1gil_1_1kernel__1d__fixed.png differ diff --git a/html/reference/classboost_1_1gil_1_1memory__based__2d__locator-members.html b/html/reference/classboost_1_1gil_1_1memory__based__2d__locator-members.html index ecfee6bba..9a94b1a78 100644 --- a/html/reference/classboost_1_1gil_1_1memory__based__2d__locator-members.html +++ b/html/reference/classboost_1_1gil_1_1memory__based__2d__locator-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        memory_based_2d_locator< StepIterator > Member List
        +
        memory_based_2d_locator< StepIterator > Member List

        This is the complete list of members for memory_based_2d_locator< StepIterator >, including all inherited members.

        - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - + - - - - - + + + - + - + - + - + - - - + - +
        axis_iterator() (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        axis_iterator() const (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        axis_iterator(point_t const &p) const (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        cache_location(const difference_type &d) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        cache_location(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        cached_location_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        const_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        coord_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        difference_type typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        is_1d_traversable(x_coord_t width) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >friend
        memory_based_2d_locator() (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const StepIterator &yit) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const memory_based_2d_locator< SI > &loc, coord_t y_step) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const memory_based_2d_locator< SI > &loc, coord_t x_step, coord_t y_step, bool transpose=false) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(x_iterator xit, std::ptrdiff_t row_bytes) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const memory_based_2d_locator< X > &pl) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const memory_based_2d_locator &pl) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        num_dimensions (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >static
        operator!=(const memory_based_2d_locator< StepIterator > &p) const (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        operator()(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator*() const (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        operator+(const difference_type &d) const (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        operator+=(const difference_type &d) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator-(const difference_type &d) const (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        operator-=(const difference_type &d) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        cache_location(const difference_type &d) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        cache_location(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        cached_location_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        const_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        coord_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        difference_type typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        is_1d_traversable(x_coord_t width) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >friend
        memory_based_2d_locator() (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const StepIterator &yit) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const memory_based_2d_locator< SI > &loc, coord_t y_step) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const memory_based_2d_locator< SI > &loc, coord_t x_step, coord_t y_step, bool transpose=false) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(x_iterator xit, std::ptrdiff_t row_bytes) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const memory_based_2d_locator< X > &pl) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        memory_based_2d_locator(const memory_based_2d_locator &pl) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator()(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator+=(const difference_type &d) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator-=(const difference_type &d) (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator=(memory_based_2d_locator const &other)=default (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        operator==(const this_t &p) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator==(const this_t &p) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator[](const difference_type &d) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator[](const cached_location_t &loc) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        operator[](const cached_location_t &loc) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        parent_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        pixel_size() const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        point_t typedef (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >
        reference typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        row_size() const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        value_type typedef (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >
        pixel_size() const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        reference typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        row_size() const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        x() const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        x() (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        x() (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        x_at(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        x_at(const difference_type &d) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        x_at(const difference_type &d) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        x_coord_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        x_iterator typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        x_iterator typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        xy_at(x_coord_t dx, y_coord_t dy) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        xy_at(const difference_type &d) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        xy_at(const difference_type &d) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        y() const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        y() (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        y_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        y_at(const difference_type &d) const (defined in pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >)pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >inline
        y() (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        y_coord_t typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        y_distance_to(this_t const &p2, x_coord_t xDiff) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        y_distance_to(this_t const &p2, x_coord_t xDiff) const (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >inline
        y_iterator typedef (defined in memory_based_2d_locator< StepIterator >)memory_based_2d_locator< StepIterator >
        @@ -107,7 +95,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.html b/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.html index 608fa30a9..115589791 100644 --- a/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.html +++ b/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.html @@ -4,7 +4,7 @@ - + Generic Image Library: memory_based_2d_locator< StepIterator > Class Template Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ + -
        -
        memory_based_2d_locator< StepIterator > Class Template Reference
        +
        memory_based_2d_locator< StepIterator > Class Template Reference
        @@ -66,227 +66,225 @@ Inheritance diagram for memory_based_2d_locator< StepIterator >:
        - - - - - - - - - - - - - - - - + - - - - -

        +

        Public Types

        +
        using parent_t = pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, typename iterator_adaptor_get_base< StepIterator >::type, StepIterator >
         
        +
        using const_t = memory_based_2d_locator< typename const_iterator_type< StepIterator >::type >
         
        +
        using coord_t = typename parent_t::coord_t
         
        +
        using x_coord_t = typename parent_t::x_coord_t
         
        +
        using y_coord_t = typename parent_t::y_coord_t
         
        +
        using x_iterator = typename parent_t::x_iterator
         
        +
        using y_iterator = typename parent_t::y_iterator
         
        +
        using difference_type = typename parent_t::difference_type
         
        +
        using reference = typename parent_t::reference
         
        +
        using cached_location_t = std::ptrdiff_t
         
        - Public Types inherited from pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >
        +
        using x_iterator = iterator_adaptor_get_base< StepIterator >::type
         
        +
        using y_iterator = StepIterator
         
        +
        using value_type = typename std::iterator_traits< x_iterator >::value_type
         
        +
        using reference = typename std::iterator_traits< x_iterator >::reference
         
        -using coord_t = typename std::iterator_traits< x_iterator >::difference_type
        +using coord_t = typename std::iterator_traits< x_iterator >::difference_type
         
        +
        using difference_type = point< coord_t >
         
        +
        using point_t = difference_type
         
        +
        using x_coord_t = typename point_t::template axis< 0 >::coord_t
         
        +
        using y_coord_t = typename point_t::template axis< 1 >::coord_t
         
        +
        using cached_location_t = difference_type
         
        - - - - - - - - - - + - - - - - + + + + - - + - - + - - - - - - - - + - - + - - - - - - - - - - - - - - - - + - - + - - + - - - - - + - - + - - -

        +

        Public Member Functions

        +
         memory_based_2d_locator (const StepIterator &yit)
         
        +
        template<typename SI >
         memory_based_2d_locator (const memory_based_2d_locator< SI > &loc, coord_t y_step)
         
        +
        template<typename SI >
         memory_based_2d_locator (const memory_based_2d_locator< SI > &loc, coord_t x_step, coord_t y_step, bool transpose=false)
         
        +
         memory_based_2d_locator (x_iterator xit, std::ptrdiff_t row_bytes)
         
        +
        template<typename X >
         memory_based_2d_locator (const memory_based_2d_locator< X > &pl)
         
        +
         memory_based_2d_locator (const memory_based_2d_locator &pl)
         
        +
        memory_based_2d_locatoroperator= (memory_based_2d_locator const &other)=default
         
        +
         
        bool operator== (const this_t &p) const
         
        -x_iterator const & x () const
         
        -y_iterator const & y () const
         
        +
        +x_iterator const & x () const
         
        +y_iterator const & y () const
         
        x_iterator & x ()
         
        +
         
        y_iterator & y ()
         
        +
         
        x_iterator x_at (x_coord_t dx, y_coord_t dy) const
         
        +
        x_iterator x_at (const difference_type &d) const
         
        +
        this_t xy_at (x_coord_t dx, y_coord_t dy) const
         
        +
        this_t xy_at (const difference_type &d) const
         
        +
        reference operator() (x_coord_t dx, y_coord_t dy) const
         
        +
        reference operator[] (const difference_type &d) const
         
        +
        this_toperator+= (const difference_type &d)
         
        +
         
        this_toperator-= (const difference_type &d)
         
        +
         
        cached_location_t cache_location (const difference_type &d) const
         
        +
        cached_location_t cache_location (x_coord_t dx, y_coord_t dy) const
         
        +
        reference operator[] (const cached_location_t &loc) const
         
        +
        std::ptrdiff_t row_size () const
         
        +
        std::ptrdiff_t pixel_size () const
         
        +
        bool is_1d_traversable (x_coord_t width) const
         
        +
        std::ptrdiff_t y_distance_to (this_t const &p2, x_coord_t xDiff) const
         
        - Public Member Functions inherited from pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >
        +
        bool operator!= (const memory_based_2d_locator< StepIterator > &p) const
         
        +
        x_iterator x_at (x_coord_t dx, y_coord_t dy) const
         
        +
        x_iterator x_at (const difference_type &d) const
         
        +
        y_iterator y_at (x_coord_t dx, y_coord_t dy) const
         
        +
        y_iterator y_at (const difference_type &d) const
         
        +
        memory_based_2d_locator< StepIterator > xy_at (x_coord_t dx, y_coord_t dy) const
         
        +
        memory_based_2d_locator< StepIterator > xy_at (const difference_type &d) const
         
        +
        axis< D >::iterator & axis_iterator ()
         
        +
         
        axis< D >::iterator const & axis_iterator () const
         
        +
         
        axis< D >::iterator axis_iterator (point_t const &p) const
         
        +
         
        reference operator() (x_coord_t dx, y_coord_t dy) const
         
        +
        reference operator[] (const difference_type &d) const
         
        +
        reference operator* () const
         
        +
        memory_based_2d_locator< StepIterator > & operator+= (const difference_type &d)
         
        +
         
        memory_based_2d_locator< StepIterator > & operator-= (const difference_type &d)
         
        +
         
        memory_based_2d_locator< StepIterator > operator+ (const difference_type &d) const
         
        +
        memory_based_2d_locator< StepIterator > operator- (const difference_type &d) const
         
        +
        cached_location_t cache_location (const difference_type &d) const
         
        +
        cached_location_t cache_location (x_coord_t dx, y_coord_t dy) const
         
        - -

        +

        Additional Inherited Members

        - Static Public Attributes inherited from pixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >
        +
        static const std::size_t num_dimensions
         

        Detailed Description

        -

        template<typename StepIterator>
        -class boost::gil::memory_based_2d_locator< StepIterator >

        - -

        Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept.

        +
        template<typename StepIterator>
        +class boost::gil::memory_based_2d_locator< StepIterator >

        Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept.

        The class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation.

        Each instantiation is optimal in terms of size and efficiency. For example, xy locator over interleaved rgb image results in a step iterator consisting of one std::ptrdiff_t for the row size and one native pointer (8 bytes total). ++locator.x() resolves to pointer increment. At the other extreme, a 2D navigation of the even pixels of a planar CMYK image results in a step iterator consisting of one std::ptrdiff_t for the doubled row size, and one step iterator consisting of one std::ptrdiff_t for the horizontal step of two and a CMYK planar_pixel_iterator consisting of 4 pointers (24 bytes). In this case ++locator.x() results in four native pointer additions.

        Note also that memory_based_2d_locator does not require that its element type be a pixel. It could be instantiated with an iterator whose value_type models only Regular. In this case the locator models the weaker RandomAccess2DLocatorConcept, and does not model PixelBasedConcept. Many generic algorithms don't require the elements to be pixels.

        @@ -300,7 +298,7 @@ class boost::gil::memory_based_2d_locator< StepIterator > diff --git a/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.png b/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.png index ceb2df7a0..a2303937d 100644 Binary files a/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.png and b/html/reference/classboost_1_1gil_1_1memory__based__2d__locator.png differ diff --git a/html/reference/classboost_1_1gil_1_1memory__based__step__iterator-members.html b/html/reference/classboost_1_1gil_1_1memory__based__step__iterator-members.html index 1408e9f56..d1cae0bda 100644 --- a/html/reference/classboost_1_1gil_1_1memory__based__step__iterator-members.html +++ b/html/reference/classboost_1_1gil_1_1memory__based__step__iterator-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        memory_based_step_iterator< Iterator > Member List
        +
        memory_based_step_iterator< Iterator > Member List

        This is the complete list of members for memory_based_step_iterator< Iterator >, including all inherited members.

        - - - - + + - + - + - + - - - - - + +
        _step_fn (defined in step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >)step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >protected
        base() -> x_iterator & (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        base() const -> x_iterator const & (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        base_difference_type typedef (defined in step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >)step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >
        base() -> x_iterator & (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        base() const -> x_iterator const & (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        difference_type typedef (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >
        memory_based_step_iterator() (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        memory_based_step_iterator() (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        memory_based_step_iterator(Iterator it, std::ptrdiff_t memunit_step) (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        memory_based_step_iterator(const memory_based_step_iterator< I2 > &it) (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        memory_based_step_iterator(const memory_based_step_iterator< I2 > &it) (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        operator[](difference_type d) const -> referencememory_based_step_iterator< Iterator >inline
        parent_t typedef (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >
        parent_t typedef (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >
        reference typedef (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >
        set_step(std::ptrdiff_t memunit_step) (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        step() const -> difference_type (defined in step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >)step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >inline
        step_iterator_adaptor() (defined in step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >)step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >inline
        step_iterator_adaptor(Iterator const &it, memunit_step_fn< Iterator > step_fn=memunit_step_fn< Iterator >()) (defined in step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >)step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >inline
        x_iterator typedef (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >
        set_step(std::ptrdiff_t memunit_step) (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >inline
        x_iterator typedef (defined in memory_based_step_iterator< Iterator >)memory_based_step_iterator< Iterator >
        diff --git a/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.html b/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.html index 4347555b8..8de481578 100644 --- a/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.html +++ b/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: memory_based_step_iterator< Iterator > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        memory_based_step_iterator< Iterator > Class Template Reference
        +
        memory_based_step_iterator< Iterator > Class Template Reference
        @@ -66,84 +66,84 @@ Inheritance diagram for memory_based_step_iterator< Iterator >:
        - - - - - - - - -

        +

        Public Types

        +
        using parent_t = detail::step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >
         
        +
        using reference = typename parent_t::reference
         
        +
        using difference_type = typename parent_t::difference_type
         
        +
        using x_iterator = Iterator
         
        - Public Types inherited from step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >
        +
        using parent_t = iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, use_default, use_default, use_default, typename SFn::difference_type >
         
        +
        using base_difference_type = typename std::iterator_traits< Iterator >::difference_type
         
        +
        using difference_type = typename SFn::difference_type
         
        +
        using reference = typename std::iterator_traits< Iterator >::reference
         
        - - - - + - - - - -

        +

        Public Member Functions

        +
         memory_based_step_iterator (Iterator it, std::ptrdiff_t memunit_step)
         
        +
        template<typename I2 >
         memory_based_step_iterator (const memory_based_step_iterator< I2 > &it)
         
        auto operator[] (difference_type d) const -> reference
        auto operator[] (difference_type d) const -> reference
         
        +
        void set_step (std::ptrdiff_t memunit_step)
         
        +
        auto base () -> x_iterator &
         
        +
        auto base () const -> x_iterator const &
         
        - Public Member Functions inherited from step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >
        +
         step_iterator_adaptor (Iterator const &it, memunit_step_fn< Iterator > step_fn=memunit_step_fn< Iterator >())
         
        +
        auto step () const -> difference_type
         
        - -

        +

        Additional Inherited Members

        - Protected Attributes inherited from step_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >
        +
        memunit_step_fn< Iterator > _step_fn
         

        Detailed Description

        -

        template<typename Iterator>
        -class boost::gil::memory_based_step_iterator< Iterator >

        - -

        MEMORY-BASED STEP ITERATOR.

        +
        template<typename Iterator>
        +class boost::gil::memory_based_step_iterator< Iterator >

        MEMORY-BASED STEP ITERATOR.

        Iterator with dynamically specified step in memory units (bytes or bits). Models StepIteratorConcept, IteratorAdaptorConcept, MemoryBasedIteratorConcept, PixelIteratorConcept, HasDynamicXStepTypeConcept

        A refinement of step_iterator_adaptor that uses a dynamic parameter for the step which is specified in memory units, such as bytes or bits

        Pixel step iterators are used to provide iteration over non-adjacent pixels. Common use is a vertical traversal, where the step is the row stride.

        Another application is as a sub-channel view. For example, a red intensity image over interleaved RGB data would use a step iterator adaptor with step sizeof(channel_t)*3 In the latter example the step size could be fixed at compile time for efficiency. Compile-time fixed step can be implemented by providing a step function object that takes the step as a template

        Member Function Documentation

        - -

        ◆ operator[]()

        + +

        ◆ operator[]()

        +
        +template<typename Iterator >
        diff --git a/html/reference/dir_1a56ea1a3a929887046b273f6b45aa06.html b/html/reference/dir_1a56ea1a3a929887046b273f6b45aa06.html index b4a9a5732..5bd7eee59 100644 --- a/html/reference/dir_1a56ea1a3a929887046b273f6b45aa06.html +++ b/html/reference/dir_1a56ea1a3a929887046b273f6b45aa06.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_image Directory Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        dynamic_image Directory Reference
        +
        dynamic_image Directory Reference
        @@ -176,7 +176,7 @@ class boost::gil::memory_based_step_iterator< Iterator > diff --git a/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.png b/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.png index 5559145a8..abefed9fa 100644 Binary files a/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.png and b/html/reference/classboost_1_1gil_1_1memory__based__step__iterator.png differ diff --git a/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4-members.html b/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4-members.html index 6ae7f467e..a29bdf949 100644 --- a/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4-members.html +++ b/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        packed_dynamic_channel_reference< BitField, NumBits, false > Member List
        +
        packed_dynamic_channel_reference< BitField, NumBits, false > Member List

        This is the complete list of members for packed_dynamic_channel_reference< BitField, NumBits, false >, including all inherited members.

        - + - + - + - +
        const_reference typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >
        first_bit() const -> unsigned int (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
        first_bit() const -> unsigned int (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
        get() const -> integer_t (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
        integer_t typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >
        integer_t typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >
        mutable_reference typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >
        packed_dynamic_channel_reference(void const *data_ptr, unsigned first_bit) (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
        packed_dynamic_channel_reference(void const *data_ptr, unsigned first_bit) (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
        packed_dynamic_channel_reference(const_reference const &ref) (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
        packed_dynamic_channel_reference(mutable_reference const &ref) (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
        packed_dynamic_channel_reference(mutable_reference const &ref) (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >inline
        packed_dynamic_channel_reference< BitField, NumBits, true > (defined in packed_dynamic_channel_reference< BitField, NumBits, false >)packed_dynamic_channel_reference< BitField, NumBits, false >friend
        @@ -65,7 +65,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4.html b/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4.html index c559d9a6b..ae549451a 100644 --- a/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4.html +++ b/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01false_01_4.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_dynamic_channel_reference< BitField, NumBits, false > Class Template Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ + -
        -
        packed_dynamic_channel_reference< BitField, NumBits, false > Class Template Reference
        +
        packed_dynamic_channel_reference< BitField, NumBits, false > Class Template Reference
        @@ -60,47 +60,45 @@ $(function() {

        Inherits packed_channel_reference_base< packed_dynamic_channel_reference< BitField, NumBits, false >, BitField, NumBits, false >.

        - - - -

        +

        Public Types

        +
        using const_reference = packed_dynamic_channel_reference< BitField, NumBits, false > const
         
        +
        using mutable_reference = packed_dynamic_channel_reference< BitField, NumBits, true > const
         
        +
        using integer_t = typename parent_t::integer_t
         
        - - - - - -

        +

        Public Member Functions

        +
         packed_dynamic_channel_reference (void const *data_ptr, unsigned first_bit)
         
        +
         packed_dynamic_channel_reference (const_reference const &ref)
         
        +
         packed_dynamic_channel_reference (mutable_reference const &ref)
         
        +
        auto first_bit () const -> unsigned int
         
        +
        auto get () const -> integer_t
         
        - -

        +

        Friends

        +
        class packed_dynamic_channel_reference< BitField, NumBits, true >
         

        Detailed Description

        -

        template<typename BitField, int NumBits>
        -class boost::gil::packed_dynamic_channel_reference< BitField, NumBits, false >

        - -

        Models a constant subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter.

        +
        template<typename BitField, int NumBits>
        +class boost::gil::packed_dynamic_channel_reference< BitField, NumBits, false >

        Models a constant subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter.


        The documentation for this class was generated from the following file: @@ -110,7 +108,7 @@ class boost::gil::packed_dynamic_channel_reference< BitField, NumBits, false diff --git a/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4-members.html b/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4-members.html index 8260049b5..543a4582e 100644 --- a/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4-members.html +++ b/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        packed_dynamic_channel_reference< BitField, NumBits, true > Member List
        +
        packed_dynamic_channel_reference< BitField, NumBits, true > Member List

        This is the complete list of members for packed_dynamic_channel_reference< BitField, NumBits, true >, including all inherited members.

        - + - + - + - + - + - +
        const_reference typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >
        first_bit() const -> unsigned int (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        first_bit() const -> unsigned int (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        get() const -> integer_t (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        integer_t typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >
        integer_t typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >
        mutable_reference typedef (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >
        operator=(integer_t value) const -> packed_dynamic_channel_reference const & (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        operator=(integer_t value) const -> packed_dynamic_channel_reference const & (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        operator=(mutable_reference const &ref) const -> packed_dynamic_channel_reference const & (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        operator=(const_reference const &ref) const -> packed_dynamic_channel_reference const & (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        operator=(const_reference const &ref) const -> packed_dynamic_channel_reference const & (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        operator=(packed_channel_reference< BitField1, FirstBit1, NumBits, Mutable1 > const &ref) const -> packed_dynamic_channel_reference const & (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        packed_dynamic_channel_reference(void *data_ptr, unsigned first_bit) (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        packed_dynamic_channel_reference(void *data_ptr, unsigned first_bit) (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        packed_dynamic_channel_reference(packed_dynamic_channel_reference const &ref) (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        packed_dynamic_channel_reference< BitField, NumBits, false > (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >friend
        packed_dynamic_channel_reference< BitField, NumBits, false > (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >friend
        set_unsafe(integer_t value) const (defined in packed_dynamic_channel_reference< BitField, NumBits, true >)packed_dynamic_channel_reference< BitField, NumBits, true >inline
        @@ -69,7 +69,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4.html b/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4.html index 842624b80..4286791f2 100644 --- a/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4.html +++ b/html/reference/classboost_1_1gil_1_1packed__dynamic__channel__reference_3_01_bit_field_00_01_num_bits_00_01true_01_4.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_dynamic_channel_reference< BitField, NumBits, true > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        packed_dynamic_channel_reference< BitField, NumBits, true > Class Template Reference
        +
        packed_dynamic_channel_reference< BitField, NumBits, true > Class Template Reference
        @@ -60,60 +60,58 @@ $(function() {

        Inherits packed_channel_reference_base< packed_dynamic_channel_reference< BitField, NumBits, true >, BitField, NumBits, true >.

        - - - -

        +

        Public Types

        +
        using const_reference = packed_dynamic_channel_reference< BitField, NumBits, false > const
         
        +
        using mutable_reference = packed_dynamic_channel_reference< BitField, NumBits, true > const
         
        +
        using integer_t = typename parent_t::integer_t
         
        - - - - - - - - - -

        +

        Public Member Functions

        +
         packed_dynamic_channel_reference (void *data_ptr, unsigned first_bit)
         
        +
         packed_dynamic_channel_reference (packed_dynamic_channel_reference const &ref)
         
        +
        auto operator= (integer_t value) const -> packed_dynamic_channel_reference const &
         
        +
        auto operator= (mutable_reference const &ref) const -> packed_dynamic_channel_reference const &
         
        +
        auto operator= (const_reference const &ref) const -> packed_dynamic_channel_reference const &
         
        +
        template<typename BitField1 , int FirstBit1, bool Mutable1>
        auto operator= (packed_channel_reference< BitField1, FirstBit1, NumBits, Mutable1 > const &ref) const -> packed_dynamic_channel_reference const &
         
        +
        auto first_bit () const -> unsigned int
         
        +
        auto get () const -> integer_t
         
        +
        void set_unsafe (integer_t value) const
         
        - -

        +

        Friends

        +
        class packed_dynamic_channel_reference< BitField, NumBits, false >
         

        Detailed Description

        -

        template<typename BitField, int NumBits>
        -class boost::gil::packed_dynamic_channel_reference< BitField, NumBits, true >

        - -

        Models a mutable subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter.

        +
        template<typename BitField, int NumBits>
        +class boost::gil::packed_dynamic_channel_reference< BitField, NumBits, true >

        Models a mutable subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter.


        The documentation for this class was generated from the following file: @@ -123,7 +121,7 @@ class boost::gil::packed_dynamic_channel_reference< BitField, NumBits, true & diff --git a/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base-members.html b/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base-members.html index 00e2d89fa..53c4ed8ec 100644 --- a/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base-members.html +++ b/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        pixel_2d_locator_base< Loc, XIterator, YIterator > Member List
        +
        pixel_2d_locator_base< Loc, XIterator, YIterator > Member List

        This is the complete list of members for pixel_2d_locator_base< Loc, XIterator, YIterator >, including all inherited members.

        - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
        axis_iterator() (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        axis_iterator() const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        axis_iterator() const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        axis_iterator(point_t const &p) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        cache_location(const difference_type &d) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        cache_location(const difference_type &d) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        cache_location(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        cached_location_t typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        cached_location_t typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        coord_t typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        difference_type typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        difference_type typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        num_dimensions (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >static
        operator!=(const Loc &p) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator!=(const Loc &p) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator()(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator*() const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator*() const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator+(const difference_type &d) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator+=(const difference_type &d) (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator+=(const difference_type &d) (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator-(const difference_type &d) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator-=(const difference_type &d) (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator-=(const difference_type &d) (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        operator[](const difference_type &d) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        pixel_2d_locator (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >friend
        pixel_2d_locator (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >friend
        point_t typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        reference typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        reference typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        value_type typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        x_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        x_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        x_at(const difference_type &d) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        x_coord_t typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        x_coord_t typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        x_iterator typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        xy_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        xy_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        xy_at(const difference_type &d) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        y_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        y_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        y_at(const difference_type &d) const (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >inline
        y_coord_t typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        y_coord_t typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        y_iterator typedef (defined in pixel_2d_locator_base< Loc, XIterator, YIterator >)pixel_2d_locator_base< Loc, XIterator, YIterator >
        @@ -87,7 +87,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base.html b/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base.html index 36c67b51c..a9ee57464 100644 --- a/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base.html +++ b/html/reference/classboost_1_1gil_1_1pixel__2d__locator__base.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_2d_locator_base< Loc, XIterator, YIterator > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        pixel_2d_locator_base< Loc, XIterator, YIterator > Class Template Reference
        +
        pixel_2d_locator_base< Loc, XIterator, YIterator > Class Template Reference
        @@ -59,130 +59,129 @@ $(function() {

        #include <locator.hpp>

        - - - - - - + - - - - -

        +

        Public Types

        +
        using x_iterator = XIterator
         
        +
        using y_iterator = YIterator
         
        +
        using value_type = typename std::iterator_traits< x_iterator >::value_type
         
        +
        using reference = typename std::iterator_traits< x_iterator >::reference
         
        -using coord_t = typename std::iterator_traits< x_iterator >::difference_type
        +using coord_t = typename std::iterator_traits< x_iterator >::difference_type
         
        +
        using difference_type = point< coord_t >
         
        +
        using point_t = difference_type
         
        +
        using x_coord_t = typename point_t::template axis< 0 >::coord_t
         
        +
        using y_coord_t = typename point_t::template axis< 1 >::coord_t
         
        +
        using cached_location_t = difference_type
         
        - - - - - - - - - - - - + + - - - + + - - - + + - - - - - + - - + - - -

        +

        Public Member Functions

        +
        bool operator!= (const Loc &p) const
         
        +
        x_iterator x_at (x_coord_t dx, y_coord_t dy) const
         
        +
        x_iterator x_at (const difference_type &d) const
         
        +
        y_iterator y_at (x_coord_t dx, y_coord_t dy) const
         
        +
        y_iterator y_at (const difference_type &d) const
         
        +
        Loc xy_at (x_coord_t dx, y_coord_t dy) const
         
        +
        Loc xy_at (const difference_type &d) const
         
        +
        template<std::size_t D>
        axis< D >::iterator & axis_iterator ()
         
        +
        axis< D >::iterator & axis_iterator ()
         
        template<std::size_t D>
        axis< D >::iterator const & axis_iterator () const
         
        +
        axis< D >::iterator const & axis_iterator () const
         
        template<std::size_t D>
        axis< D >::iterator axis_iterator (point_t const &p) const
         
        +
        axis< D >::iterator axis_iterator (point_t const &p) const
         
        reference operator() (x_coord_t dx, y_coord_t dy) const
         
        +
        reference operator[] (const difference_type &d) const
         
        +
        reference operator* () const
         
        +
        Loc & operator+= (const difference_type &d)
         
        +
         
        Loc & operator-= (const difference_type &d)
         
        +
         
        Loc operator+ (const difference_type &d) const
         
        +
        Loc operator- (const difference_type &d) const
         
        +
        cached_location_t cache_location (const difference_type &d) const
         
        +
        cached_location_t cache_location (x_coord_t dx, y_coord_t dy) const
         
        - -

        +

        Static Public Attributes

        +
        static const std::size_t num_dimensions =2
         
        - -

        +

        Friends

        +
        template<typename X >
        class pixel_2d_locator
         

        Detailed Description

        -

        template<typename Loc, typename XIterator, typename YIterator>
        -class boost::gil::pixel_2d_locator_base< Loc, XIterator, YIterator >

        - -

        base class for models of PixelLocatorConcept

        -

        Pixel locator is similar to a pixel iterator, but allows for 2D navigation of pixels within an image view. It has a 2D difference_type and supports random access operations like:

        difference_type offset2(2,3);
        +
        template<typename Loc, typename XIterator, typename YIterator>
        +class boost::gil::pixel_2d_locator_base< Loc, XIterator, YIterator >

        base class for models of PixelLocatorConcept

        +

        Pixel locator is similar to a pixel iterator, but allows for 2D navigation of pixels within an image view. It has a 2D difference_type and supports random access operations like:

        difference_type offset2(2,3);
        locator+=offset2;
        locator[offset2]=my_pixel;
        +
        2D point both axes of which have the same dimension typeModels: Point2DConcept
        Definition point.hpp:36

        In addition, each coordinate acts as a random-access iterator that can be modified separately: "++locator.x()" or "locator.y()+=10" thereby moving the locator horizontally or vertically.

        It is called a locator because it doesn't implement the complete interface of a random access iterator. For example, increment and decrement operations don't make sense (no way to specify dimension). Also 2D difference between two locators cannot be computed without knowledge of the X position within the image.

        -

        This base class provides most of the methods and type aliases needed to create a model of a locator. GIL provides two locator models as subclasses of pixel_2d_locator_base. A memory-based locator, memory_based_2d_locator and a virtual locator, virtual_2d_locator. The minimum functionality a subclass must provide is this:

        class my_locator : public pixel_2d_locator_base<my_locator, ..., ...> { // supply the types for x-iterator and y-iterator
        -
        using const_t = ...; // read-only locator
        +

        This base class provides most of the methods and type aliases needed to create a model of a locator. GIL provides two locator models as subclasses of pixel_2d_locator_base. A memory-based locator, memory_based_2d_locator and a virtual locator, virtual_2d_locator. The minimum functionality a subclass must provide is this:

        class my_locator : public pixel_2d_locator_base<my_locator, ..., ...> { // supply the types for x-iterator and y-iterator
        +
        using const_t = ...; // read-only locator
        template <typename Deref> struct add_deref {
        -
        using type = ...; // locator that invokes the Deref dereference object upon pixel access
        +
        using type = ...; // locator that invokes the Deref dereference object upon pixel access
        static type make(const my_locator& loc, const Deref& d);
        };
        @@ -208,6 +207,7 @@ class boost::gil::pixel_2d_locator_base< Loc, XIterator, YIterator >
        // column of the next row. Some models need the image width to determine that.
        bool is_1d_traversable(x_coord_t width) const;
        };
        +
        base class for models of PixelLocatorConcept
        Definition locator.hpp:109

        Models may choose to override some of the functions in the base class with more efficient versions.


        The documentation for this class was generated from the following file:
        • locator.hpp
        • @@ -218,7 +218,7 @@ class boost::gil::pixel_2d_locator_base< Loc, XIterator, YIterator > diff --git a/html/reference/classboost_1_1gil_1_1point-members.html b/html/reference/classboost_1_1gil_1_1point-members.html index 56a451301..5ad98db45 100644 --- a/html/reference/classboost_1_1gil_1_1point-members.html +++ b/html/reference/classboost_1_1gil_1_1point-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        point< T > Member List
        +
        point< T > Member List

        This is the complete list of members for point< T >, including all inherited members.

        - + - + - + - + - + - + - +
        num_dimensions (defined in point< T >)point< T >static
        operator*=(double d) (defined in point< T >)point< T >inline
        operator*=(double d) (defined in point< T >)point< T >inline
        operator+=(point const &p) (defined in point< T >)point< T >inline
        operator-=(point const &p) (defined in point< T >)point< T >inline
        operator-=(point const &p) (defined in point< T >)point< T >inline
        operator/=(double d) (defined in point< T >)point< T >inline
        operator<<(std::ptrdiff_t shift) const (defined in point< T >)point< T >inline
        operator<<(std::ptrdiff_t shift) const (defined in point< T >)point< T >inline
        operator>>(std::ptrdiff_t shift) const (defined in point< T >)point< T >inline
        operator[](std::size_t i) const (defined in point< T >)point< T >inline
        operator[](std::size_t i) const (defined in point< T >)point< T >inline
        operator[](std::size_t i) (defined in point< T >)point< T >inline
        point()=default (defined in point< T >)point< T >
        point()=default (defined in point< T >)point< T >
        point(T px, T py) (defined in point< T >)point< T >inline
        value_type typedef (defined in point< T >)point< T >
        value_type typedef (defined in point< T >)point< T >
        x (defined in point< T >)point< T >
        y (defined in point< T >)point< T >
        y (defined in point< T >)point< T >
        diff --git a/html/reference/classboost_1_1gil_1_1point.html b/html/reference/classboost_1_1gil_1_1point.html index 789d004c6..1e709ea26 100644 --- a/html/reference/classboost_1_1gil_1_1point.html +++ b/html/reference/classboost_1_1gil_1_1point.html @@ -4,7 +4,7 @@ - + Generic Image Library: point< T > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        point< T > Class Template Reference
        +
        point< T > Class Template Reference
        @@ -59,62 +59,60 @@ $(function() {

        #include <point.hpp>

        - -

        +

        Public Types

        +
        using value_type = T
         
        - - - - - - - + - - + - - + - - - - + + + - +

        +

        Public Member Functions

        +
         point (T px, T py)
         
        +
        point operator<< (std::ptrdiff_t shift) const
         
        +
        point operator>> (std::ptrdiff_t shift) const
         
        +
        pointoperator+= (point const &p)
         
        +
         
        pointoperator-= (point const &p)
         
        +
         
        pointoperator/= (double d)
         
        +
         
        pointoperator*= (double d)
         
        -T const & operator[] (std::size_t i) const
         
        +
         
        +T const & operator[] (std::size_t i) const
         
        T & operator[] (std::size_t i)
         
         
        - - -

        +

        Public Attributes

        +
        x {0}
         
        +
        y {0}
         
        - -

        +

        Static Public Attributes

        +
        static constexpr std::size_t num_dimensions = 2
         

        Detailed Description

        -

        template<typename T>
        -class boost::gil::point< T >

        - -

        2D point both axes of which have the same dimension type

        +
        template<typename T>
        +class boost::gil::point< T >

        2D point both axes of which have the same dimension type

        Models: Point2DConcept


        The documentation for this class was generated from the following files:
        • locator.hpp
        • @@ -126,7 +124,7 @@ class boost::gil::point< T > diff --git a/html/reference/classboost_1_1gil_1_1promote__integral-members.html b/html/reference/classboost_1_1gil_1_1promote__integral-members.html index 57acd16e0..beced8572 100644 --- a/html/reference/classboost_1_1gil_1_1promote__integral-members.html +++ b/html/reference/classboost_1_1gil_1_1promote__integral-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral > Member List
        +
        promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/classboost_1_1gil_1_1promote__integral.html b/html/reference/classboost_1_1gil_1_1promote__integral.html index b5e23d02c..488fb5331 100644 --- a/html/reference/classboost_1_1gil_1_1promote__integral.html +++ b/html/reference/classboost_1_1gil_1_1promote__integral.html @@ -4,7 +4,7 @@ - + Generic Image Library: promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,17 +56,15 @@ $(function() {

        #include <promote_integral.hpp>

        - -

        +

        Public Types

        +
        using type = typename detail::promote_integral::promote_to_larger< T, integral_types, min_bit_size_type::value >::type
         

        Detailed Description

        -

        template<typename T, bool PromoteUnsignedToUnsigned = false, bool UseCheckedInteger = false, bool IsIntegral = std::is_integral<T>::value>
        -class boost::gil::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >

        - -

        Meta-function to define an integral type with size than is (roughly) twice the bit size of T.

        +
        template<typename T, bool PromoteUnsignedToUnsigned = false, bool UseCheckedInteger = false, bool IsIntegral = std::is_integral<T>::value>
        +class boost::gil::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >

        Meta-function to define an integral type with size than is (roughly) twice the bit size of T.

        This meta-function tries to promote the fundamental integral type T to a another integral type with size (roughly) twice the bit size of T.

        To do this, two times the bit size of T is tested against the bit sizes of: short, int, long, boost::long_long_type, boost::int128_t and the one that first matches is chosen.

        For unsigned types the bit size of T is tested against the bit sizes of the types above, if T is promoted to a signed type, or the bit sizes of unsigned short, unsigned int, unsigned long, std::size_t, boost::ulong_long_type, boost::uint128_t if T is promoted to an unsigned type.

        @@ -82,7 +80,7 @@ class boost::gil::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedI diff --git a/html/reference/classboost_1_1gil_1_1scanline__read__iterator-members.html b/html/reference/classboost_1_1gil_1_1scanline__read__iterator-members.html index 13c2f61c4..2c06fe13e 100644 --- a/html/reference/classboost_1_1gil_1_1scanline__read__iterator-members.html +++ b/html/reference/classboost_1_1gil_1_1scanline__read__iterator-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        scanline_read_iterator< Reader > Member List
        +
        scanline_read_iterator< Reader > Member List

        This is the complete list of members for scanline_read_iterator< Reader >, including all inherited members.

        - +
        boost::iterator_core_access (defined in scanline_read_iterator< Reader >)scanline_read_iterator< Reader >friend
        scanline_read_iterator(Reader &reader, int pos=0) (defined in scanline_read_iterator< Reader >)scanline_read_iterator< Reader >inline
        scanline_read_iterator(Reader &reader, int pos=0) (defined in scanline_read_iterator< Reader >)scanline_read_iterator< Reader >inline
        diff --git a/html/reference/classboost_1_1gil_1_1scanline__read__iterator.html b/html/reference/classboost_1_1gil_1_1scanline__read__iterator.html index 68069d808..b68ca632a 100644 --- a/html/reference/classboost_1_1gil_1_1scanline__read__iterator.html +++ b/html/reference/classboost_1_1gil_1_1scanline__read__iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: scanline_read_iterator< Reader > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        scanline_read_iterator< Reader > Class Template Reference
        +
        scanline_read_iterator< Reader > Class Template Reference
        @@ -59,23 +59,21 @@ $(function() {

        Inherits iterator_facade< scanline_read_iterator< Reader >, byte_t *, std::input_iterator_tag >.

        - -

        +

        Public Member Functions

        +
         scanline_read_iterator (Reader &reader, int pos=0)
         
        - -

        +

        Friends

        +
        class boost::iterator_core_access
         

        Detailed Description

        -

        template<typename Reader>
        -class boost::gil::scanline_read_iterator< Reader >

        - -

        Input iterator to read images.

        +
        template<typename Reader>
        +class boost::gil::scanline_read_iterator< Reader >

        Input iterator to read images.


        The documentation for this class was generated from the following file: @@ -85,7 +83,7 @@ class boost::gil::scanline_read_iterator< Reader > diff --git a/html/reference/classboost_1_1gil_1_1virtual__2d__locator-members.html b/html/reference/classboost_1_1gil_1_1virtual__2d__locator-members.html index 127b6212c..0756c6121 100644 --- a/html/reference/classboost_1_1gil_1_1virtual__2d__locator-members.html +++ b/html/reference/classboost_1_1gil_1_1virtual__2d__locator-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        virtual_2d_locator< DerefFn, IsTransposed > Member List
        +
        virtual_2d_locator< DerefFn, IsTransposed > Member List

        This is the complete list of members for virtual_2d_locator< DerefFn, IsTransposed >, including all inherited members.

        - - - - - - - + - - - - - - - - - - - - - - - + + + + + - - - - - + + + - + - + - + - - - + - - - + - - - + - +
        axis_iterator() (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        axis_iterator() const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        axis_iterator(point_t const &p) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        cache_location(const difference_type &d) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        cache_location(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        cached_location_t typedef (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
        const_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        coord_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        coord_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        deref_fn() const -> deref_fn_t const & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        deref_fn_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        difference_type typedef (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
        is_1d_traversable(x_coord_t) constvirtual_2d_locator< DerefFn, IsTransposed >inline
        num_dimensions (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >static
        operator!=(const virtual_2d_locator< DerefFn, IsTransposed > &p) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        operator()(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        operator*() const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        operator+(const difference_type &d) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        operator+=(const difference_type &d) (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        operator-(const difference_type &d) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        operator-=(const difference_type &d) (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        operator=(virtual_2d_locator const &other)=default (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        operator==(const this_t &p) const (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        operator[](const difference_type &d) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        parent_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        deref_fn_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        is_1d_traversable(x_coord_t) constvirtual_2d_locator< DerefFn, IsTransposed >inline
        operator=(virtual_2d_locator const &other)=default (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        operator==(const this_t &p) const (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        parent_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        point_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        pos() const -> point_t const & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        reference typedef (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
        step() const -> point_t const & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        value_type typedef (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
        virtual_2d_locator (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >friend
        pos() const -> point_t const & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        step() const -> point_t const & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        virtual_2d_locator (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >friend
        virtual_2d_locator(point_t const &p={0, 0}, point_t const &step={1, 1}, deref_fn_t const &deref_fn=deref_fn_t()) (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        virtual_2d_locator(virtual_2d_locator< D, TR > const &loc, coord_t y_step) (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        virtual_2d_locator(virtual_2d_locator< D, TR > const &loc, coord_t y_step) (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        virtual_2d_locator(virtual_2d_locator< D, TR > const &loc, coord_t x_step, coord_t y_step, bool transpose=false) (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        virtual_2d_locator(virtual_2d_locator< D, TR > const &other) (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        virtual_2d_locator(virtual_2d_locator< D, TR > const &other) (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        virtual_2d_locator(virtual_2d_locator const &other) (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        x() -> x_iterator & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        x() -> x_iterator & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        x() const -> x_iterator const & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        x_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        x_at(const difference_type &d) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        x_coord_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        x_coord_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        x_iterator typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        xy_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        xy_at(const difference_type &d) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        y() -> y_iterator & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        y() -> y_iterator & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        y() const -> y_iterator const & (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >inline
        y_at(x_coord_t dx, y_coord_t dy) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        y_at(const difference_type &d) const (defined in pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >)pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >inline
        y_coord_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        y_coord_t typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        y_distance_to(this_t const &it2, x_coord_t) const -> y_coord_tvirtual_2d_locator< DerefFn, IsTransposed >inline
        y_iterator typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        y_iterator typedef (defined in virtual_2d_locator< DerefFn, IsTransposed >)virtual_2d_locator< DerefFn, IsTransposed >
        diff --git a/html/reference/classboost_1_1gil_1_1virtual__2d__locator.html b/html/reference/classboost_1_1gil_1_1virtual__2d__locator.html index e2b84177c..ad4ef3f3a 100644 --- a/html/reference/classboost_1_1gil_1_1virtual__2d__locator.html +++ b/html/reference/classboost_1_1gil_1_1virtual__2d__locator.html @@ -4,7 +4,7 @@ - + Generic Image Library: virtual_2d_locator< DerefFn, IsTransposed > Class Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        virtual_2d_locator< DerefFn, IsTransposed > Class Template Reference
        +
        virtual_2d_locator< DerefFn, IsTransposed > Class Template Reference
        @@ -66,191 +66,189 @@ Inheritance diagram for virtual_2d_locator< DerefFn, IsTransposed >:
        - - - - - - - - - - - - - - - + - - - - -

        +

        Public Types

        +
        using parent_t = pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
         
        +
        using const_t = virtual_2d_locator< typename DerefFn::const_t, IsTransposed >
         
        +
        using deref_fn_t = DerefFn
         
        +
        using point_t = typename parent_t::point_t
         
        +
        using coord_t = typename parent_t::coord_t
         
        +
        using x_coord_t = typename parent_t::x_coord_t
         
        +
        using y_coord_t = typename parent_t::y_coord_t
         
        +
        using x_iterator = typename parent_t::x_iterator
         
        +
        using y_iterator = typename parent_t::y_iterator
         
        - Public Types inherited from pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
        +
        using x_iterator = position_iterator< DerefFn, IsTransposed >
         
        +
        using y_iterator = position_iterator< DerefFn, 1-IsTransposed >
         
        +
        using value_type = typename std::iterator_traits< x_iterator >::value_type
         
        +
        using reference = typename std::iterator_traits< x_iterator >::reference
         
        -using coord_t = typename std::iterator_traits< x_iterator >::difference_type
        +using coord_t = typename std::iterator_traits< x_iterator >::difference_type
         
        +
        using difference_type = point< coord_t >
         
        +
        using point_t = difference_type
         
        +
        using x_coord_t = typename point_t::template axis< 0 >::coord_t
         
        +
        using y_coord_t = typename point_t::template axis< 1 >::coord_t
         
        +
        using cached_location_t = difference_type
         
        - - - - - - - - - + - - - - - + - + - - - - - - - - - - - - - + - - + - - + - - - - - + - - + - - -

        +

        Public Member Functions

        +
         virtual_2d_locator (point_t const &p={0, 0}, point_t const &step={1, 1}, deref_fn_t const &deref_fn=deref_fn_t())
         
        +
        template<typename D , bool TR>
         virtual_2d_locator (virtual_2d_locator< D, TR > const &loc, coord_t y_step)
         
        +
        template<typename D , bool TR>
         virtual_2d_locator (virtual_2d_locator< D, TR > const &loc, coord_t x_step, coord_t y_step, bool transpose=false)
         
        +
        template<typename D , bool TR>
         virtual_2d_locator (virtual_2d_locator< D, TR > const &other)
         
        +
         virtual_2d_locator (virtual_2d_locator const &other)
         
        +
        virtual_2d_locatoroperator= (virtual_2d_locator const &other)=default
         
        +
         
        bool operator== (const this_t &p) const
         
        +
        auto x () -> x_iterator &
         
        +
        auto x () const -> x_iterator const &
         
        +
        auto y () -> y_iterator &
         
        +
        auto y () const -> y_iterator const &
         
        -auto y_distance_to (this_t const &it2, x_coord_t) const -> y_coord_t
        +auto y_distance_to (this_t const &it2, x_coord_t) const -> y_coord_t
         Returns the y distance between two x_iterators given the difference of their x positions.
         
        bool is_1d_traversable (x_coord_t) const
        bool is_1d_traversable (x_coord_t) const
         
        +
        auto pos () const -> point_t const &
         
        +
        auto step () const -> point_t const &
         
        +
        auto deref_fn () const -> deref_fn_t const &
         
        - Public Member Functions inherited from pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
        +
        bool operator!= (const virtual_2d_locator< DerefFn, IsTransposed > &p) const
         
        +
        x_iterator x_at (x_coord_t dx, y_coord_t dy) const
         
        +
        x_iterator x_at (const difference_type &d) const
         
        +
        y_iterator y_at (x_coord_t dx, y_coord_t dy) const
         
        +
        y_iterator y_at (const difference_type &d) const
         
        +
        virtual_2d_locator< DerefFn, IsTransposed > xy_at (x_coord_t dx, y_coord_t dy) const
         
        +
        virtual_2d_locator< DerefFn, IsTransposed > xy_at (const difference_type &d) const
         
        +
        axis< D >::iterator & axis_iterator ()
         
        +
         
        axis< D >::iterator const & axis_iterator () const
         
        +
         
        axis< D >::iterator axis_iterator (point_t const &p) const
         
        +
         
        reference operator() (x_coord_t dx, y_coord_t dy) const
         
        +
        reference operator[] (const difference_type &d) const
         
        +
        reference operator* () const
         
        +
        virtual_2d_locator< DerefFn, IsTransposed > & operator+= (const difference_type &d)
         
        +
         
        virtual_2d_locator< DerefFn, IsTransposed > & operator-= (const difference_type &d)
         
        +
         
        virtual_2d_locator< DerefFn, IsTransposed > operator+ (const difference_type &d) const
         
        +
        virtual_2d_locator< DerefFn, IsTransposed > operator- (const difference_type &d) const
         
        +
        cached_location_t cache_location (const difference_type &d) const
         
        +
        cached_location_t cache_location (x_coord_t dx, y_coord_t dy) const
         
        - -

        +

        Additional Inherited Members

        - Static Public Attributes inherited from pixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
        +
        static const std::size_t num_dimensions
         

        Detailed Description

        -

        template<typename DerefFn, bool IsTransposed>
        -class boost::gil::virtual_2d_locator< DerefFn, IsTransposed >

        - -

        A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept.

        +
        template<typename DerefFn, bool IsTransposed>
        +class boost::gil::virtual_2d_locator< DerefFn, IsTransposed >

        A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept.

        Template Parameters
        @@ -259,11 +257,13 @@ class boost::gil::virtual_2d_locator< DerefFn, IsTransposed >

        Member Function Documentation

        - -

        ◆ is_1d_traversable()

        + +

        ◆ is_1d_traversable()

        +
        +template<typename DerefFn , bool IsTransposed>
        DerefFnFunction object that given a point returns a reference. Models PixelDereferenceAdaptorConcept.
        diff --git a/html/reference/dir_1878a3f4746a95c6aad317458cc7ef80.html b/html/reference/dir_1878a3f4746a95c6aad317458cc7ef80.html index 896df977e..092db478f 100644 --- a/html/reference/dir_1878a3f4746a95c6aad317458cc7ef80.html +++ b/html/reference/dir_1878a3f4746a95c6aad317458cc7ef80.html @@ -4,7 +4,7 @@ - + Generic Image Library: boost Directory Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        boost Directory Reference
        +
        boost Directory Reference
        @@ -295,7 +295,7 @@ class boost::gil::virtual_2d_locator< DerefFn, IsTransposed > diff --git a/html/reference/classboost_1_1gil_1_1virtual__2d__locator.png b/html/reference/classboost_1_1gil_1_1virtual__2d__locator.png index 8b9770147..2c1a4fe61 100644 Binary files a/html/reference/classboost_1_1gil_1_1virtual__2d__locator.png and b/html/reference/classboost_1_1gil_1_1virtual__2d__locator.png differ diff --git a/html/reference/classes.html b/html/reference/classes.html index fdabf5f76..4a233e8cc 100644 --- a/html/reference/classes.html +++ b/html/reference/classes.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class Index @@ -27,83 +27,83 @@
        - + +/* @license-end */ +
        -
        -
        Class Index
        +
        Class Index
        A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | R | S | T | V | Y
        -
        A
        +
        A
        alpha_t (boost::gil)
        any_image (boost::gil)
        any_image_view (boost::gil)
        Assignable (boost::gil)
        -
        B
        +
        B
        binary_operation_obj (boost::gil)
        bit_aligned_image1_type (boost::gil)
        bit_aligned_image2_type (boost::gil)
        bit_aligned_image3_type (boost::gil)
        bit_aligned_image4_type (boost::gil)
        bit_aligned_image5_type (boost::gil)
        bit_aligned_image_type (boost::gil)
        bit_aligned_pixel_iterator (boost::gil)
        bit_range (boost::gil)
        black_t (boost::gil)
        blue_t (boost::gil)
        byte_to_memunit (boost::gil)
        -
        C
        +
        C
        channel_assigns_t (boost::gil)
        channel_converter (boost::gil)
        channel_converter_unsigned< float32_t, DstChannelV > (boost::gil)
        channel_converter_unsigned< float32_t, uint32_t > (boost::gil)
        channel_converter_unsigned< T, T > (boost::gil)
        channel_converter_unsigned< uint32_t, float32_t > (boost::gil)
        channel_converter_unsigned_impl (boost::gil::detail)
        channel_divides_scalar_t (boost::gil)
        channel_divides_t (boost::gil)
        channel_halves_t (boost::gil)
        channel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)
        channel_minus_scalar_t (boost::gil)
        channel_minus_t (boost::gil)
        channel_multiplier (boost::gil)
        channel_multiplier_unsigned (boost::gil)
        channel_multiplier_unsigned< float32_t > (boost::gil)
        channel_multiplier_unsigned< uint16_t > (boost::gil)
        channel_multiplier_unsigned< uint8_t > (boost::gil)
        channel_multiplies_scalar_t (boost::gil)
        channel_multiplies_t (boost::gil)
        channel_plus_scalar_t (boost::gil)
        channel_plus_t (boost::gil)
        channel_type (boost::gil)
        channel_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)
        channel_zeros_t (boost::gil)
        ChannelConcept (boost::gil)
        ChannelConvertibleConcept (boost::gil)
        ChannelIsMutableConcept (boost::gil::detail)
        ChannelMappingConcept (boost::gil)
        channels_are_compatible (boost::gil)
        ChannelsCompatibleConcept (boost::gil)
        ChannelValueConcept (boost::gil)
        CollectionImageViewConcept (boost::gil)
        color_convert_deref_fn (boost::gil)
        color_converted_view_type (boost::gil)
        color_converted_view_type< any_image_view< Views... >, DstP > (boost::gil)
        color_converted_view_type< any_image_view< Views... >, DstP, CC > (boost::gil)
        color_element_const_reference_type (boost::gil)
        color_element_reference_type (boost::gil)
        color_element_type (boost::gil)
        color_space_type< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)
        ColorBaseConcept (boost::gil)
        ColorBasesCompatibleConcept (boost::gil)
        ColorBaseValueConcept (boost::gil)
        ColorSpaceConcept (boost::gil)
        ColorSpacesCompatibleConcept (boost::gil)
        const_iterator_type (boost::gil)
        contains_color (boost::gil)
        copier_n (boost::gil::detail)
        copier_n< I, iterator_from_2d< OL > > (boost::gil::detail)
        copier_n< iterator_from_2d< IL >, iterator_from_2d< OL > > (boost::gil::detail)
        copier_n< iterator_from_2d< IL >, O > (boost::gil::detail)
        CopyConstructible (boost::gil)
        correlator_k (boost::gil::detail)
        correlator_n (boost::gil::detail)
        cyan_t (boost::gil)
        -
        D
        +
        D
        dec (boost::gil::detail)
        default_channel_converter (boost::gil)
        default_color_converter (boost::gil)
        default_color_converter_impl (boost::gil)
        default_color_converter_impl< C, C > (boost::gil)
        default_color_converter_impl< C1, rgba_t > (boost::gil)
        default_color_converter_impl< cmyk_t, gray_t > (boost::gil)
        default_color_converter_impl< cmyk_t, rgb_t > (boost::gil)
        default_color_converter_impl< gray_t, cmyk_t > (boost::gil)
        default_color_converter_impl< gray_t, rgb_t > (boost::gil)
        default_color_converter_impl< rgb_t, cmyk_t > (boost::gil)
        default_color_converter_impl< rgb_t, gray_t > (boost::gil)
        default_color_converter_impl< rgba_t, C2 > (boost::gil)
        default_color_converter_impl< rgba_t, rgba_t > (boost::gil)
        DefaultConstructible (boost::gil)
        deref_base (boost::gil)
        deref_compose (boost::gil)
        dereference_iterator_adaptor (boost::gil)
        derived_image_type (boost::gil)
        derived_iterator_type (boost::gil)
        derived_pixel_reference_type (boost::gil)
        derived_view_type (boost::gil)
        devicen_color_t (boost::gil)
        devicen_layout_t (boost::gil)
        devicen_t (boost::gil)
        dynamic_x_step_type (boost::gil)
        dynamic_xy_step_transposed_type (boost::gil)
        dynamic_xy_step_type (boost::gil)
        dynamic_y_step_type (boost::gil)
        -
        E
        +
        E
        element_const_reference_type (boost::gil)
        element_reference_type (boost::gil)
        element_type (boost::gil)
        equal_n_fn< boost::gil::iterator_from_2d< Loc >, It > (boost::gil::detail)
        equal_n_fn< boost::gil::iterator_from_2d< Loc1 >, boost::gil::iterator_from_2d< Loc2 > > (boost::gil::detail)
        equal_n_fn< It, boost::gil::iterator_from_2d< Loc > > (boost::gil::detail)
        equal_n_fn< pixel< T, CS > const *, pixel< T, CS > const * > (boost::gil::detail)
        equal_n_fn< planar_pixel_iterator< IC, CS >, planar_pixel_iterator< IC, CS > > (boost::gil::detail)
        EqualityComparable (boost::gil)
        -
        F
        +
        F
        file_stream_device (boost::gil::detail)
        filler (boost::gil::detail)
        filler< 1 > (boost::gil::detail)
        ForwardCollectionImageViewConcept (boost::gil)
        -
        G
        +
        G
        get_dynamic_image_reader (boost::gil)
        get_dynamic_image_writer (boost::gil)
        get_reader (boost::gil)
        get_reader_backend (boost::gil)
        get_scanline_reader (boost::gil)
        get_writer (boost::gil)
        gray_color_t (boost::gil)
        green_t (boost::gil)
        -
        H
        +
        H
        HasDynamicXStepTypeConcept (boost::gil)
        HasDynamicYStepTypeConcept (boost::gil)
        hash_tuple (boost::gil::detail)
        HasTransposedTypeConcept (boost::gil)
        histogram (boost::gil)
        homogeneous_color_base< Element, Layout, 1 > (boost::gil::detail)
        homogeneous_color_base< Element, Layout, 2 > (boost::gil::detail)
        homogeneous_color_base< Element, Layout, 3 > (boost::gil::detail)
        homogeneous_color_base< Element, Layout, 4 > (boost::gil::detail)
        homogeneous_color_base< Element, Layout, 5 > (boost::gil::detail)
        HomogeneousColorBaseConcept (boost::gil)
        HomogeneousColorBaseValueConcept (boost::gil)
        HomogeneousPixelBasedConcept (boost::gil)
        HomogeneousPixelConcept (boost::gil)
        HomogeneousPixelValueConcept (boost::gil)
        -
        I
        +
        I
        identity (boost::gil::detail)
        image (boost::gil)
        image_is_basic (boost::gil)
        image_type (boost::gil)
        image_view (boost::gil)
        ImageConcept (boost::gil)
        ImageViewConcept (boost::gil)
        inc (boost::gil::detail)
        is_input_device (boost::gil::detail)
        is_iterator_adaptor (boost::gil)
        is_output_device (boost::gil::detail)
        is_pixel< bit_aligned_pixel_reference< B, C, L, M > > (boost::gil)
        is_pixel< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)
        is_planar< planar_pixel_reference< ChannelReference, ColorSpace > > (boost::gil)
        is_read_device (boost::gil::detail)
        is_read_only (boost::gil::detail)
        is_read_supported (boost::gil)
        is_write_device (boost::gil::detail)
        istream_device (boost::gil::detail)
        iterator_adaptor_get_base (boost::gil)
        iterator_adaptor_rebind (boost::gil)
        iterator_add_deref (boost::gil)
        iterator_add_deref< dereference_iterator_adaptor< Iterator, PREV_DEREF >, Deref > (boost::gil)
        iterator_from_2d (boost::gil)
        iterator_is_basic (boost::gil)
        iterator_is_basic< memory_based_step_iterator< pixel< T, L > * > > (boost::gil)
        iterator_is_basic< memory_based_step_iterator< pixel< T, L > const * > > (boost::gil)
        iterator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T *, CS > > > (boost::gil)
        iterator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T const *, CS > > > (boost::gil)
        iterator_is_basic< pixel< T, L > * > (boost::gil)
        iterator_is_basic< pixel< T, L > const * > (boost::gil)
        iterator_is_basic< planar_pixel_iterator< T *, CS > > (boost::gil)
        iterator_is_basic< planar_pixel_iterator< T const *, CS > > (boost::gil)
        iterator_is_mutable (boost::gil)
        iterator_is_step (boost::gil)
        iterator_type (boost::gil)
        iterator_type_from_pixel (boost::gil)
        IteratorAdaptorConcept (boost::gil)
        -
        K
        +
        K
        kernel_1d (boost::gil)
        kernel_1d_adaptor (boost::gil::detail)
        kernel_1d_fixed (boost::gil)
        kernel_2d (boost::gil::detail)
        kernel_2d_fixed (boost::gil::detail)
        kth_channel_deref_fn (boost::gil::detail)
        kth_channel_view_type (boost::gil)
        kth_semantic_element_const_reference_type (boost::gil)
        kth_semantic_element_reference_type (boost::gil)
        kth_semantic_element_type (boost::gil)
        -
        L
        +
        L
        layout (boost::gil)
        locator_is_basic (boost::gil)
        locator_is_mutable (boost::gil)
        locator_is_step_in_x (boost::gil)
        locator_is_step_in_y (boost::gil)
        locator_type (boost::gil)
        -
        M
        +
        M
        magenta_t (boost::gil)
        memory_based_2d_locator (boost::gil)
        memory_based_step_iterator (boost::gil)
        MemoryBasedIteratorConcept (boost::gil)
        memunit_step_fn (boost::gil)
        Metafunction (boost::gil)
        MutableChannelConcept (boost::gil)
        MutableColorBaseConcept (boost::gil)
        MutableHomogeneousColorBaseConcept (boost::gil)
        MutableHomogeneousPixelConcept (boost::gil)
        MutableImageViewConcept (boost::gil)
        MutableIteratorAdaptorConcept (boost::gil)
        MutablePixelConcept (boost::gil)
        MutablePixelIteratorConcept (boost::gil)
        MutablePixelLocatorConcept (boost::gil)
        MutableRandomAccess2DImageViewConcept (boost::gil)
        MutableRandomAccess2DLocatorConcept (boost::gil)
        MutableRandomAccessNDImageViewConcept (boost::gil)
        MutableRandomAccessNDLocatorConcept (boost::gil)
        MutableStepIteratorConcept (boost::gil)
        -
        N
        +
        N
        nth_channel_deref_fn (boost::gil::detail)
        nth_channel_view_type (boost::gil)
        nth_channel_view_type< any_image_view< Views... > > (boost::gil)
        num_channels (boost::gil)
        -
        O
        +
        O
        ostream_device (boost::gil::detail)
        -
        P
        +
        P
        packed_dynamic_channel_reference< BitField, NumBits, false > (boost::gil)
        packed_dynamic_channel_reference< BitField, NumBits, true > (boost::gil)
        packed_image1_type (boost::gil)
        packed_image2_type (boost::gil)
        packed_image3_type (boost::gil)
        packed_image4_type (boost::gil)
        packed_image5_type (boost::gil)
        packed_image_type (boost::gil)
        packed_pixel (boost::gil)
        packed_pixel_type (boost::gil)
        pixel (boost::gil)
        pixel_2d_locator_base (boost::gil)
        pixel_assigns_t (boost::gil)
        pixel_divides_scalar_t (boost::gil)
        pixel_divides_t (boost::gil)
        pixel_halves_t (boost::gil)
        pixel_is_reference (boost::gil)
        pixel_minus_t (boost::gil)
        pixel_multiplies_scalar_t (boost::gil)
        pixel_multiplies_t (boost::gil)
        pixel_plus_t (boost::gil)
        pixel_proxy (boost::gil)
        pixel_reference_is_basic (boost::gil)
        pixel_reference_is_mutable (boost::gil)
        pixel_reference_is_proxy (boost::gil)
        pixel_reference_type (boost::gil)
        pixel_value_type (boost::gil)
        pixel_zeros_t (boost::gil)
        PixelBasedConcept (boost::gil)
        PixelConcept (boost::gil)
        PixelConvertibleConcept (boost::gil)
        PixelDereferenceAdaptorConcept (boost::gil)
        PixelImageViewIsMutableConcept (boost::gil::detail)
        PixelIteratorConcept (boost::gil)
        PixelIteratorIsMutableConcept (boost::gil::detail)
        PixelLocatorConcept (boost::gil)
        pixels_are_compatible (boost::gil)
        PixelsCompatibleConcept (boost::gil)
        PixelValueConcept (boost::gil)
        planar_pixel_iterator (boost::gil)
        planar_pixel_reference (boost::gil)
        plus_asymmetric (boost::gil::detail)
        point (boost::gil)
        Point2DConcept (boost::gil)
        PointNDConcept (boost::gil)
        position_iterator (boost::gil)
        promote_integral (boost::gil)
        -
        R
        +
        R
        RandomAccess2DImageConcept (boost::gil)
        RandomAccess2DImageViewConcept (boost::gil)
        RandomAccess2DImageViewIsMutableConcept (boost::gil::detail)
        RandomAccess2DLocatorConcept (boost::gil)
        RandomAccessNDImageConcept (boost::gil)
        RandomAccessNDImageViewConcept (boost::gil)
        RandomAccessNDImageViewIsMutableConcept (boost::gil::detail)
        RandomAccessNDLocatorConcept (boost::gil)
        RandomAccessNDLocatorIsMutableConcept (boost::gil::detail)
        file_stream_device::read_tag (boost::gil::detail)
        reader_base (boost::gil)
        red_t (boost::gil)
        Regular (boost::gil)
        ReversibleCollectionImageViewConcept (boost::gil)
        rgb_to_luminance_fn (boost::gil::detail)
        -
        S
        +
        S
        SameType (boost::gil)
        scanline_read_iterator (boost::gil)
        size (boost::gil)
        std_fill_t (boost::gil::detail)
        step_iterator_adaptor (boost::gil::detail)
        StepIteratorConcept (boost::gil)
        Swappable (boost::gil)
        -
        T
        +
        T
        transposed_type (boost::gil)
        tuple_limit (boost::gil::detail)
        type_from_x_iterator (boost::gil)
        type_to_index (boost::gil::detail)
        -
        V
        +
        V
        view_is_basic (boost::gil)
        view_is_mutable (boost::gil)
        view_is_step_in_x (boost::gil)
        view_is_step_in_y (boost::gil)
        view_type (boost::gil)
        view_type_from_pixel (boost::gil)
        views_are_compatible (boost::gil)
        ViewsCompatibleConcept (boost::gil)
        virtual_2d_locator (boost::gil)
        -
        Y
        +
        Y
        yellow_t (boost::gil)
        @@ -112,7 +112,7 @@ $(function() { diff --git a/html/reference/cmyk_8hpp_source.html b/html/reference/cmyk_8hpp_source.html index 22f6624be..e4cc883a0 100644 --- a/html/reference/cmyk_8hpp_source.html +++ b/html/reference/cmyk_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: cmyk.hpp Source File @@ -27,83 +27,90 @@
        - + +/* @license-end */ + +
        -
        -
        cmyk.hpp
        +
        cmyk.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CMYK_HPP
        -
        9 #define BOOST_GIL_CMYK_HPP
        -
        10 
        -
        11 #include <boost/gil/metafunctions.hpp>
        -
        12 #include <boost/gil/detail/mp11.hpp>
        -
        13 
        -
        14 #include <cstddef>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        20 
        -
        22 struct cyan_t {};
        -
        23 
        -
        25 struct magenta_t {};
        -
        26 
        -
        28 struct yellow_t {};
        -
        29 
        -
        31 struct black_t {};
        -
        33 
        -
        35 using cmyk_t = mp11::mp_list<cyan_t, magenta_t, yellow_t, black_t>;
        -
        36 
        - -
        39 
        -
        42 template <typename IC>
        -
        43 inline auto planar_cmyk_view(std::size_t width, std::size_t height, IC c, IC m, IC y, IC k, std::ptrdiff_t rowsize_in_bytes)
        - -
        45 {
        -
        46  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,cmyk_t> >::view_t;
        -
        47  return view_t(width, height, typename view_t::locator(planar_pixel_iterator<IC,cmyk_t>(c,m,y,k), rowsize_in_bytes));
        -
        48 }
        -
        49 
        -
        50 }} // namespace gil
        -
        51 
        -
        52 #endif
        -
        auto planar_cmyk_view(std::size_t width, std::size_t height, IC c, IC m, IC y, IC k, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, cmyk_t >>::view_t
        from raw CMYK planar data
        Definition: cmyk.hpp:43
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Black.
        Definition: cmyk.hpp:31
        -
        Cyan.
        Definition: cmyk.hpp:22
        -
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:268
        -
        Magenta.
        Definition: cmyk.hpp:25
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: planar_pixel_iterator.hpp:58
        -
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:303
        -
        Yellow.
        Definition: cmyk.hpp:28
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CMYK_HPP
        +
        9#define BOOST_GIL_CMYK_HPP
        +
        10
        +
        11#include <boost/gil/metafunctions.hpp>
        +
        12#include <boost/gil/detail/mp11.hpp>
        +
        13
        +
        14#include <cstddef>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        20
        +
        22struct cyan_t {};
        +
        23
        +
        25struct magenta_t {};
        +
        26
        +
        28struct yellow_t {};
        +
        29
        +
        31struct black_t {};
        +
        33
        +
        35using cmyk_t = mp11::mp_list<cyan_t, magenta_t, yellow_t, black_t>;
        +
        36
        + +
        39
        +
        42template <typename IC>
        +
        +
        43inline auto planar_cmyk_view(std::size_t width, std::size_t height, IC c, IC m, IC y, IC k, std::ptrdiff_t rowsize_in_bytes)
        + +
        45{
        +
        46 using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,cmyk_t> >::view_t;
        +
        47 return view_t(width, height, typename view_t::locator(planar_pixel_iterator<IC,cmyk_t>(c,m,y,k), rowsize_in_bytes));
        +
        48}
        +
        +
        49
        +
        50}} // namespace gil
        +
        51
        +
        52#endif
        +
        auto planar_cmyk_view(std::size_t width, std::size_t height, IC c, IC m, IC y, IC k, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, cmyk_t > >::view_t
        from raw CMYK planar data
        Definition cmyk.hpp:43
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Black.
        Definition cmyk.hpp:31
        +
        Cyan.
        Definition cmyk.hpp:22
        +
        Represents a color space and ordering of channels in memory.
        Definition utilities.hpp:268
        +
        Magenta.
        Definition cmyk.hpp:25
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition planar_pixel_iterator.hpp:58
        +
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition metafunctions.hpp:303
        +
        Yellow.
        Definition cmyk.hpp:28
        diff --git a/html/reference/color_8hpp_source.html b/html/reference/color_8hpp_source.html index 10fbaf37f..8af87d2bc 100644 --- a/html/reference/color_8hpp_source.html +++ b/html/reference/color_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color.hpp Source File @@ -27,111 +27,122 @@

        - + +/* @license-end */ + +
        -
        -
        color.hpp
        +
        color.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_COLOR_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_COLOR_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/concept_check.hpp>
        -
        12 
        -
        13 #include <type_traits>
        -
        14 
        -
        15 #if defined(BOOST_CLANG)
        -
        16 #pragma clang diagnostic push
        -
        17 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        18 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        19 #endif
        -
        20 
        -
        21 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        22 #pragma GCC diagnostic push
        -
        23 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        24 #endif
        -
        25 
        -
        26 namespace boost { namespace gil {
        -
        27 
        -
        36 template <typename CS>
        - -
        38 {
        -
        39  void constraints()
        -
        40  {
        -
        41  // Boost.MP11-compatible list, whose elements are color tags
        -
        42 
        -
        43  // TODO: Is this incomplete?
        -
        44  }
        -
        45 };
        -
        46 
        -
        47 // Models ColorSpaceConcept
        -
        48 template <typename CS1, typename CS2>
        -
        49 struct color_spaces_are_compatible : std::is_same<CS1, CS2> {};
        -
        50 
        -
        59 template <typename CS1, typename CS2>
        - -
        61 {
        -
        62  void constraints()
        -
        63  {
        -
        64  static_assert(color_spaces_are_compatible<CS1, CS2>::value, "");
        -
        65  }
        -
        66 };
        -
        67 
        -
        77 template <typename CM>
        - -
        79 {
        -
        80  void constraints()
        -
        81  {
        -
        82  // Boost.MP11-compatible list, whose elements model
        -
        83  // MPLIntegralConstant representing a permutation.
        -
        84 
        -
        85  // TODO: Is this incomplete?
        -
        86  }
        -
        87 };
        -
        88 
        -
        89 }} // namespace boost::gil
        -
        90 
        -
        91 #if defined(BOOST_CLANG)
        -
        92 #pragma clang diagnostic pop
        -
        93 #endif
        -
        94 
        -
        95 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        96 #pragma GCC diagnostic pop
        -
        97 #endif
        -
        98 
        -
        99 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Channel mapping concept.
        Definition: color.hpp:79
        -
        Color space type concept.
        Definition: color.hpp:38
        -
        Two color spaces are compatible if they are the same.
        Definition: color.hpp:61
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_COLOR_HPP
        +
        9#define BOOST_GIL_CONCEPTS_COLOR_HPP
        +
        10
        +
        11#include <boost/gil/concepts/concept_check.hpp>
        +
        12
        +
        13#include <type_traits>
        +
        14
        +
        15#if defined(BOOST_CLANG)
        +
        16#pragma clang diagnostic push
        +
        17#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        18#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        19#endif
        +
        20
        +
        21#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        22#pragma GCC diagnostic push
        +
        23#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        24#endif
        +
        25
        +
        26namespace boost { namespace gil {
        +
        27
        +
        36template <typename CS>
        +
        + +
        38{
        +
        39 void constraints()
        +
        40 {
        +
        41 // Boost.MP11-compatible list, whose elements are color tags
        +
        42
        +
        43 // TODO: Is this incomplete?
        +
        44 }
        +
        45};
        +
        +
        46
        +
        47// Models ColorSpaceConcept
        +
        48template <typename CS1, typename CS2>
        +
        49struct color_spaces_are_compatible : std::is_same<CS1, CS2> {};
        +
        50
        +
        59template <typename CS1, typename CS2>
        +
        + +
        61{
        +
        62 void constraints()
        +
        63 {
        +
        64 static_assert(color_spaces_are_compatible<CS1, CS2>::value, "");
        +
        65 }
        +
        66};
        +
        +
        67
        +
        77template <typename CM>
        +
        + +
        79{
        +
        80 void constraints()
        +
        81 {
        +
        82 // Boost.MP11-compatible list, whose elements model
        +
        83 // MPLIntegralConstant representing a permutation.
        +
        84
        +
        85 // TODO: Is this incomplete?
        +
        86 }
        +
        87};
        +
        +
        88
        +
        89}} // namespace boost::gil
        +
        90
        +
        91#if defined(BOOST_CLANG)
        +
        92#pragma clang diagnostic pop
        +
        93#endif
        +
        94
        +
        95#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        96#pragma GCC diagnostic pop
        +
        97#endif
        +
        98
        +
        99#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Channel mapping concept.
        Definition color.hpp:79
        +
        Color space type concept.
        Definition color.hpp:38
        +
        Two color spaces are compatible if they are the same.
        Definition color.hpp:61
        diff --git a/html/reference/color__base_8hpp_source.html b/html/reference/color__base_8hpp_source.html index a6336e559..6f9e8150d 100644 --- a/html/reference/color__base_8hpp_source.html +++ b/html/reference/color__base_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_base.hpp Source File @@ -27,689 +27,706 @@

        - + +/* @license-end */ + +
        -
        -
        color_base.hpp
        +
        color_base.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_COLOR_BASE_HPP
        -
        10 #define BOOST_GIL_COLOR_BASE_HPP
        -
        11 
        -
        12 #include <boost/gil/utilities.hpp>
        -
        13 #include <boost/gil/concepts.hpp>
        -
        14 #include <boost/gil/detail/mp11.hpp>
        -
        15 
        -
        16 #include <boost/assert.hpp>
        -
        17 #include <boost/config.hpp>
        -
        18 
        -
        19 #include <type_traits>
        -
        20 
        -
        21 namespace boost { namespace gil {
        -
        22 
        -
        23 // Forward-declare
        -
        24 template <typename P> P* memunit_advanced(const P* p, std::ptrdiff_t diff);
        -
        25 
        -
        26 // Forward-declare semantic_at_c
        -
        27 template <int K, typename ColorBase>
        -
        28 auto semantic_at_c(ColorBase& p)
        -
        29  -> typename std::enable_if
        -
        30  <
        -
        31  !std::is_const<ColorBase>::value,
        -
        32  typename kth_semantic_element_reference_type<ColorBase, K>::type
        -
        33  >::type;
        -
        34 
        -
        35 
        -
        36 template <int K, typename ColorBase>
        -
        37 auto semantic_at_c(const ColorBase& p) -> typename kth_semantic_element_const_reference_type<ColorBase,K>::type;
        -
        38 
        -
        39 // Forward declare element_reference_type
        -
        40 template <typename ColorBase> struct element_reference_type;
        -
        41 template <typename ColorBase> struct element_const_reference_type;
        -
        42 template <typename ColorBase, int K> struct kth_element_type;
        -
        43 template <typename ColorBase, int K> struct kth_element_type<const ColorBase,K> : public kth_element_type<ColorBase,K> {};
        -
        44 template <typename ColorBase, int K> struct kth_element_reference_type;
        -
        45 template <typename ColorBase, int K> struct kth_element_reference_type<const ColorBase,K> : public kth_element_reference_type<ColorBase,K> {};
        -
        46 template <typename ColorBase, int K> struct kth_element_const_reference_type;
        -
        47 template <typename ColorBase, int K> struct kth_element_const_reference_type<const ColorBase,K> : public kth_element_const_reference_type<ColorBase,K> {};
        -
        48 
        -
        49 namespace detail {
        -
        50 
        -
        51 template <typename DstLayout, typename SrcLayout, int K>
        -
        52 struct mapping_transform : mp11::mp_at
        -
        53  <
        -
        54  typename SrcLayout::channel_mapping_t,
        -
        55  typename detail::type_to_index
        -
        56  <
        -
        57  typename DstLayout::channel_mapping_t,
        -
        58  std::integral_constant<int, K>
        -
        59  >
        -
        60  >::type
        -
        61 {};
        -
        62 
        -
        68 
        -
        69 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        70 #pragma warning(push)
        -
        71 #pragma warning(disable:4512) //assignment operator could not be generated
        -
        72 #endif
        -
        73 
        -
        77 template <typename Element, typename Layout>
        -
        78 struct homogeneous_color_base<Element, Layout, 1>
        -
        79 {
        -
        80  using layout_t = Layout;
        -
        81 
        -
        82  template
        -
        83  <
        -
        84  typename U = Element,
        -
        85  typename = typename std::enable_if<!std::is_reference<U>::value>::type
        -
        86  >
        -
        87  homogeneous_color_base() : v0_{} {}
        -
        88 
        -
        89  explicit homogeneous_color_base(Element v) : v0_(v) {}
        -
        90 
        -
        91  template <typename E2, typename L2>
        -
        92  homogeneous_color_base(homogeneous_color_base<E2, L2, 1> const& c)
        -
        93  : v0_(gil::at_c<0>(c))
        -
        94  {}
        -
        95 
        -
        96  auto at(std::integral_constant<int, 0>)
        - -
        98  { return v0_; }
        -
        99 
        -
        100  auto at(std::integral_constant<int, 0>) const
        - -
        102  { return v0_; }
        -
        103 
        -
        104  // grayscale pixel values are convertible to channel type
        -
        105  // FIXME: explicit?
        -
        106  operator Element() const { return v0_; }
        -
        107 
        -
        108 private:
        -
        109  Element v0_;
        -
        110 };
        -
        111 
        -
        115 template <typename Element, typename Layout>
        -
        116 struct homogeneous_color_base<Element, Layout, 2>
        -
        117 {
        -
        118  using layout_t = Layout;
        -
        119 
        -
        120  template
        -
        121  <
        -
        122  typename U = Element,
        -
        123  typename = typename std::enable_if<!std::is_reference<U>::value>::type
        -
        124  >
        -
        125  homogeneous_color_base() : v0_{}, v1_{} {}
        -
        126 
        -
        127  explicit homogeneous_color_base(Element v) : v0_(v), v1_(v) {}
        -
        128 
        -
        129  homogeneous_color_base(Element v0, Element v1) : v0_(v0), v1_(v1) {}
        -
        130 
        -
        131  template <typename E2, typename L2>
        -
        132  homogeneous_color_base(homogeneous_color_base<E2, L2, 2> const& c)
        -
        133  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        -
        134  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        -
        135  {}
        -
        136 
        -
        137  // Support for l-value reference proxy copy construction
        -
        138  template <typename E2, typename L2>
        -
        139  homogeneous_color_base(homogeneous_color_base<E2, L2, 2>& c)
        -
        140  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        -
        141  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        -
        142  {}
        -
        143 
        -
        144  // Support for planar_pixel_iterator construction and dereferencing
        -
        145  template <typename P>
        -
        146  homogeneous_color_base(P* p, bool)
        -
        147  : v0_(&semantic_at_c<0>(*p))
        -
        148  , v1_(&semantic_at_c<1>(*p))
        -
        149  {}
        -
        150 
        -
        151  // Support for planar_pixel_reference offset constructor
        -
        152  template <typename Ptr>
        -
        153  homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
        -
        154  : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
        -
        155  , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
        -
        156  {}
        -
        157 
        -
        158  template <typename Ref>
        -
        159  Ref deref() const
        -
        160  {
        -
        161  return Ref(*semantic_at_c<0>(*this), *semantic_at_c<1>(*this));
        -
        162  }
        -
        163 
        -
        164  auto at(std::integral_constant<int, 0>)
        - -
        166  { return v0_; }
        -
        167 
        -
        168  auto at(std::integral_constant<int, 0>) const
        - -
        170  { return v0_; }
        -
        171 
        -
        172  auto at(std::integral_constant<int, 1>)
        - -
        174  { return v1_; }
        -
        175 
        -
        176  auto at(std::integral_constant<int, 1>) const
        - -
        178  { return v1_; }
        -
        179 
        -
        180  // Support for planar_pixel_reference operator[]
        -
        181  auto at_c_dynamic(std::size_t i) const -> Element
        -
        182  {
        -
        183  if (i == 0)
        -
        184  return v0_;
        -
        185  else
        -
        186  return v1_;
        -
        187  }
        -
        188 
        -
        189 private:
        -
        190  Element v0_;
        -
        191  Element v1_;
        -
        192 };
        -
        193 
        -
        197 template <typename Element, typename Layout>
        -
        198 struct homogeneous_color_base<Element, Layout, 3>
        -
        199 {
        -
        200  using layout_t = Layout;
        -
        201 
        -
        202  template
        -
        203  <
        -
        204  typename U = Element,
        -
        205  typename = typename std::enable_if<!std::is_reference<U>::value>::type
        -
        206  >
        -
        207  homogeneous_color_base() : v0_{}, v1_{}, v2_{} {}
        -
        208 
        -
        209  explicit homogeneous_color_base(Element v) : v0_(v), v1_(v), v2_(v) {}
        -
        210 
        -
        211  homogeneous_color_base(Element v0, Element v1, Element v2)
        -
        212  : v0_(v0), v1_(v1), v2_(v2)
        -
        213  {}
        -
        214 
        -
        215  template <typename E2, typename L2>
        -
        216  homogeneous_color_base(homogeneous_color_base<E2, L2, 3> const& c)
        -
        217  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        -
        218  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        -
        219  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        -
        220  {}
        -
        221 
        -
        222  // Support for l-value reference proxy copy construction
        -
        223  template <typename E2, typename L2>
        -
        224  homogeneous_color_base(homogeneous_color_base<E2, L2, 3>& c)
        -
        225  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        -
        226  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        -
        227  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        -
        228  {}
        -
        229 
        -
        230  // Support for planar_pixel_iterator construction and dereferencing
        -
        231  template <typename P>
        -
        232  homogeneous_color_base(P* p, bool)
        -
        233  : v0_(&semantic_at_c<0>(*p))
        -
        234  , v1_(&semantic_at_c<1>(*p))
        -
        235  , v2_(&semantic_at_c<2>(*p))
        -
        236  {}
        -
        237 
        -
        238  // Support for planar_pixel_reference offset constructor
        -
        239  template <typename Ptr>
        -
        240  homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
        -
        241  : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
        -
        242  , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
        -
        243  , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
        -
        244  {}
        -
        245 
        -
        246  template <typename Ref>
        -
        247  Ref deref() const
        -
        248  {
        -
        249  return Ref(
        -
        250  *semantic_at_c<0>(*this),
        -
        251  *semantic_at_c<1>(*this),
        -
        252  *semantic_at_c<2>(*this));
        -
        253  }
        -
        254 
        -
        255  auto at(std::integral_constant<int, 0>)
        - -
        257  { return v0_; }
        -
        258 
        -
        259  auto at(std::integral_constant<int, 0>) const
        - -
        261  { return v0_; }
        -
        262 
        -
        263  auto at(std::integral_constant<int, 1>)
        - -
        265  { return v1_; }
        -
        266 
        -
        267  auto at(std::integral_constant<int, 1>) const
        - -
        269  { return v1_; }
        -
        270 
        -
        271  auto at(std::integral_constant<int, 2>)
        - -
        273  { return v2_; }
        -
        274 
        -
        275  auto at(std::integral_constant<int, 2>) const
        - -
        277  { return v2_; }
        -
        278 
        -
        279  // Support for planar_pixel_reference operator[]
        -
        280  auto at_c_dynamic(std::size_t i) const -> Element
        -
        281  {
        -
        282  switch (i)
        -
        283  {
        -
        284  case 0: return v0_;
        -
        285  case 1: return v1_;
        -
        286  }
        -
        287  return v2_;
        -
        288  }
        -
        289 
        -
        290 private:
        -
        291  Element v0_;
        -
        292  Element v1_;
        -
        293  Element v2_;
        -
        294 };
        -
        295 
        -
        299 template <typename Element, typename Layout>
        -
        300 struct homogeneous_color_base<Element, Layout, 4>
        -
        301 {
        -
        302  using layout_t = Layout;
        -
        303 
        -
        304  template
        -
        305  <
        -
        306  typename U = Element,
        -
        307  typename = typename std::enable_if<!std::is_reference<U>::value>::type
        -
        308  >
        -
        309  homogeneous_color_base() : v0_{}, v1_{}, v2_{}, v3_{} {}
        -
        310 
        -
        311  explicit homogeneous_color_base(Element v) : v0_(v), v1_(v), v2_(v), v3_(v) {}
        -
        312 
        -
        313  homogeneous_color_base(Element v0, Element v1, Element v2, Element v3)
        -
        314  : v0_(v0), v1_(v1), v2_(v2), v3_(v3)
        -
        315  {}
        -
        316 
        -
        317  template <typename E2, typename L2>
        -
        318  homogeneous_color_base(homogeneous_color_base<E2, L2, 4> const& c)
        -
        319  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        -
        320  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        -
        321  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        -
        322  , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
        -
        323  {}
        -
        324 
        -
        325  // Support for l-value reference proxy copy construction
        -
        326  template <typename E2, typename L2>
        -
        327  homogeneous_color_base(homogeneous_color_base<E2, L2, 4>& c)
        -
        328  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        -
        329  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        -
        330  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        -
        331  , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
        -
        332  {}
        -
        333 
        -
        334  // Support for planar_pixel_iterator construction and dereferencing
        -
        335  template <typename P>
        -
        336  homogeneous_color_base(P * p, bool)
        -
        337  : v0_(&semantic_at_c<0>(*p))
        -
        338  , v1_(&semantic_at_c<1>(*p))
        -
        339  , v2_(&semantic_at_c<2>(*p))
        -
        340  , v3_(&semantic_at_c<3>(*p))
        -
        341  {}
        -
        342 
        -
        343  // Support for planar_pixel_reference offset constructor
        -
        344  template <typename Ptr>
        -
        345  homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
        -
        346  : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
        -
        347  , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
        -
        348  , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
        -
        349  , v3_(*memunit_advanced(semantic_at_c<3>(ptr), diff))
        -
        350  {}
        -
        351 
        -
        352  template <typename Ref>
        -
        353  Ref deref() const
        -
        354  {
        -
        355  return Ref(
        -
        356  *semantic_at_c<0>(*this),
        -
        357  *semantic_at_c<1>(*this),
        -
        358  *semantic_at_c<2>(*this),
        -
        359  *semantic_at_c<3>(*this));
        -
        360  }
        -
        361 
        -
        362  auto at(std::integral_constant<int, 0>)
        - -
        364  { return v0_; }
        -
        365 
        -
        366  auto at(std::integral_constant<int, 0>) const
        - -
        368  { return v0_; }
        -
        369 
        -
        370  auto at(std::integral_constant<int, 1>)
        - -
        372  { return v1_; }
        -
        373 
        -
        374  auto at(std::integral_constant<int, 1>) const
        - -
        376  { return v1_; }
        -
        377 
        -
        378  auto at(std::integral_constant<int, 2>)
        - -
        380  { return v2_; }
        -
        381 
        -
        382  auto at(std::integral_constant<int, 2>) const
        - -
        384  { return v2_; }
        -
        385 
        -
        386  auto at(std::integral_constant<int, 3>)
        - -
        388  { return v3_; }
        -
        389 
        -
        390  auto at(std::integral_constant<int, 3>) const
        - -
        392  { return v3_; }
        -
        393 
        -
        394  // Support for planar_pixel_reference operator[]
        -
        395  auto at_c_dynamic(std::size_t i) const -> Element
        -
        396  {
        -
        397  switch (i)
        -
        398  {
        -
        399  case 0: return v0_;
        -
        400  case 1: return v1_;
        -
        401  case 2: return v2_;
        -
        402  }
        -
        403  return v3_;
        -
        404  }
        -
        405 
        -
        406 private:
        -
        407  Element v0_;
        -
        408  Element v1_;
        -
        409  Element v2_;
        -
        410  Element v3_;
        -
        411 };
        -
        412 
        -
        416 template <typename Element, typename Layout>
        -
        417 struct homogeneous_color_base<Element, Layout, 5>
        -
        418 {
        -
        419  using layout_t = Layout;
        -
        420 
        -
        421  template
        -
        422  <
        -
        423  typename U = Element,
        -
        424  typename = typename std::enable_if<!std::is_reference<U>::value>::type
        -
        425  >
        -
        426  homogeneous_color_base()
        -
        427  : v0_{}, v1_{}, v2_{}, v3_{}, v4_{}
        -
        428  {}
        -
        429 
        -
        430  explicit homogeneous_color_base(Element v)
        -
        431  : v0_(v), v1_(v), v2_(v), v3_(v), v4_(v)
        -
        432  {}
        -
        433 
        -
        434  homogeneous_color_base(Element v0, Element v1, Element v2, Element v3, Element v4)
        -
        435  : v0_(v0), v1_(v1), v2_(v2), v3_(v3), v4_(v4)
        -
        436  {}
        -
        437 
        -
        438  template <typename E2, typename L2>
        -
        439  homogeneous_color_base(homogeneous_color_base<E2, L2, 5> const& c)
        -
        440  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        -
        441  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        -
        442  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        -
        443  , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
        -
        444  , v4_(gil::at_c<mapping_transform<Layout, L2, 4>::value>(c))
        -
        445  {}
        -
        446 
        -
        447  // Support for l-value reference proxy copy construction
        -
        448  template <typename E2, typename L2>
        -
        449  homogeneous_color_base(homogeneous_color_base<E2, L2, 5>& c)
        -
        450  : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        -
        451  , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        -
        452  , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        -
        453  , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
        -
        454  , v4_(gil::at_c<mapping_transform<Layout, L2, 4>::value>(c))
        -
        455  {}
        -
        456 
        -
        457  // Support for planar_pixel_iterator construction and dereferencing
        -
        458  template <typename P>
        -
        459  homogeneous_color_base(P* p, bool)
        -
        460  : v0_(&semantic_at_c<0>(*p))
        -
        461  , v1_(&semantic_at_c<1>(*p))
        -
        462  , v2_(&semantic_at_c<2>(*p))
        -
        463  , v3_(&semantic_at_c<3>(*p))
        -
        464  , v4_(&semantic_at_c<4>(*p))
        -
        465  {}
        -
        466 
        -
        467  // Support for planar_pixel_reference offset constructor
        -
        468  template <typename Ptr>
        -
        469  homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
        -
        470  : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
        -
        471  , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
        -
        472  , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
        -
        473  , v3_(*memunit_advanced(semantic_at_c<3>(ptr), diff))
        -
        474  , v4_(*memunit_advanced(semantic_at_c<4>(ptr), diff))
        -
        475  {}
        -
        476 
        -
        477 
        -
        478  auto at(std::integral_constant<int, 0>)
        - -
        480  { return v0_; }
        -
        481 
        -
        482  auto at(std::integral_constant<int, 0>) const
        - -
        484  { return v0_; }
        -
        485 
        -
        486  auto at(std::integral_constant<int, 1>)
        - -
        488  { return v1_; }
        -
        489 
        -
        490  auto at(std::integral_constant<int, 1>) const
        - -
        492  { return v1_; }
        -
        493 
        -
        494  auto at(std::integral_constant<int, 2>)
        - -
        496  { return v2_; }
        -
        497 
        -
        498  auto at(std::integral_constant<int, 2>) const
        - -
        500  { return v2_; }
        -
        501 
        -
        502  auto at(std::integral_constant<int, 3>)
        - -
        504  { return v3_; }
        -
        505 
        -
        506  auto at(std::integral_constant<int, 3>) const
        - -
        508  { return v3_; }
        -
        509 
        -
        510  auto at(std::integral_constant<int, 4>)
        - -
        512  { return v4_; }
        -
        513 
        -
        514  auto at(std::integral_constant<int, 4>) const
        - -
        516  { return v4_; }
        -
        517 
        -
        518  template <typename Ref>
        -
        519  Ref deref() const
        -
        520  {
        -
        521  return Ref(
        -
        522  *semantic_at_c<0>(*this),
        -
        523  *semantic_at_c<1>(*this),
        -
        524  *semantic_at_c<2>(*this),
        -
        525  *semantic_at_c<3>(*this),
        -
        526  *semantic_at_c<4>(*this));
        -
        527  }
        -
        528 
        -
        529  // Support for planar_pixel_reference operator[]
        -
        530  auto at_c_dynamic(std::size_t i) const -> Element
        -
        531  {
        -
        532  switch (i)
        -
        533  {
        -
        534  case 0: return v0_;
        -
        535  case 1: return v1_;
        -
        536  case 2: return v2_;
        -
        537  case 3: return v3_;
        -
        538  }
        -
        539  return v4_;
        -
        540  }
        -
        541 
        -
        542 private:
        -
        543  Element v0_;
        -
        544  Element v1_;
        -
        545  Element v2_;
        -
        546  Element v3_;
        -
        547  Element v4_;
        -
        548 };
        -
        549 
        -
        550 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        551 #pragma warning(pop)
        -
        552 #endif
        -
        553 
        -
        554 // The following way of casting adjacent channels (the contents of color_base) into an array appears to be unsafe
        -
        555 // -- there is no guarantee that the compiler won't add any padding between adjacent channels.
        -
        556 // Note, however, that GIL _must_ be compiled with compiler settings ensuring there is no padding in the color base structs.
        -
        557 // This is because the color base structs must model the interleaved organization in memory. In other words, the client may
        -
        558 // have existing RGB image in the form "RGBRGBRGB..." and we must be able to represent it with an array of RGB color bases (i.e. RGB pixels)
        -
        559 // with no padding. We have tested with char/int/float/double channels on gcc and VC and have so far discovered no problem.
        -
        560 // We have even tried using strange channels consisting of short + char (3 bytes). With the default 4-byte alignment on VC, the size
        -
        561 // of this channel is padded to 4 bytes, so an RGB pixel of it will be 4x3=12 bytes. The code below will still work properly.
        -
        562 // However, the client must nevertheless ensure that proper compiler settings are used for their compiler and their channel types.
        -
        563 
        -
        564 template <typename Element, typename Layout, int K>
        -
        565 auto dynamic_at_c(homogeneous_color_base<Element,Layout,K>& cb, std::size_t i)
        - -
        567 {
        -
        568  BOOST_ASSERT(i < K);
        -
        569  return (gil_reinterpret_cast<Element*>(&cb))[i];
        -
        570 }
        -
        571 
        -
        572 template <typename Element, typename Layout, int K>
        -
        573 auto dynamic_at_c(homogeneous_color_base<Element, Layout, K> const& cb, std::size_t i)
        -
        574  -> typename element_const_reference_type
        -
        575  <
        -
        576  homogeneous_color_base<Element, Layout, K>
        -
        577  >::type
        -
        578 {
        -
        579  BOOST_ASSERT(i < K);
        -
        580  return (gil_reinterpret_cast_c<const Element*>(&cb))[i];
        -
        581 }
        -
        582 
        -
        583 template <typename Element, typename Layout, int K>
        -
        584 auto dynamic_at_c(homogeneous_color_base<Element&, Layout, K> const& cb, std::size_t i)
        -
        585  -> typename element_reference_type
        -
        586  <
        -
        587  homogeneous_color_base<Element&, Layout, K>
        -
        588  >::type
        -
        589 {
        -
        590  BOOST_ASSERT(i < K);
        -
        591  return cb.at_c_dynamic(i);
        -
        592 }
        -
        593 
        -
        594 template <typename Element, typename Layout, int K>
        -
        595 auto dynamic_at_c(
        -
        596  homogeneous_color_base<Element const&, Layout, K>const& cb, std::size_t i)
        -
        597  -> typename element_const_reference_type
        -
        598  <
        -
        599  homogeneous_color_base<Element const&, Layout, K>
        -
        600  >::type
        -
        601 {
        -
        602  BOOST_ASSERT(i < K);
        -
        603  return cb.at_c_dynamic(i);
        -
        604 }
        -
        605 
        -
        606 } // namespace detail
        -
        607 
        -
        608 template <typename Element, typename Layout, int K1, int K>
        -
        609 struct kth_element_type<detail::homogeneous_color_base<Element, Layout, K1>, K>
        -
        610 {
        -
        611  using type = Element;
        -
        612 };
        -
        613 
        -
        614 template <typename Element, typename Layout, int K1, int K>
        -
        615 struct kth_element_reference_type<detail::homogeneous_color_base<Element, Layout, K1>, K>
        -
        616  : std::add_lvalue_reference<Element>
        -
        617 {};
        -
        618 
        -
        619 template <typename Element, typename Layout, int K1, int K>
        -
        620 struct kth_element_const_reference_type
        -
        621  <
        -
        622  detail::homogeneous_color_base<Element, Layout, K1>,
        -
        623  K
        -
        624  >
        -
        625  : std::add_lvalue_reference<typename std::add_const<Element>::type>
        -
        626 {};
        -
        627 
        -
        630 template <int K, typename E, typename L, int N>
        -
        631 inline
        -
        632 auto at_c(detail::homogeneous_color_base<E, L, N>& p)
        -
        633  -> typename std::add_lvalue_reference<E>::type
        -
        634 {
        -
        635  return p.at(std::integral_constant<int, K>());
        -
        636 }
        -
        637 
        -
        640 template <int K, typename E, typename L, int N>
        -
        641 inline
        -
        642 auto at_c(const detail::homogeneous_color_base<E, L, N>& p)
        -
        643  -> typename std::add_lvalue_reference<typename std::add_const<E>::type>::type
        -
        644 {
        -
        645  return p.at(std::integral_constant<int, K>());
        -
        646 }
        -
        647 
        -
        648 namespace detail
        -
        649 {
        -
        650 
        -
        651 struct swap_fn
        -
        652 {
        -
        653  template <typename T>
        -
        654  void operator()(T& x, T& y) const
        -
        655  {
        -
        656  using std::swap;
        -
        657  swap(x, y);
        -
        658  }
        -
        659 };
        -
        660 
        -
        661 } // namespace detail
        -
        662 
        -
        663 template <typename E, typename L, int N>
        -
        664 inline
        -
        665 void swap(
        -
        666  detail::homogeneous_color_base<E, L, N>& x,
        -
        667  detail::homogeneous_color_base<E, L, N>& y)
        -
        668 {
        -
        669  static_for_each(x, y, detail::swap_fn());
        -
        670 }
        -
        671 
        -
        672 }} // namespace boost::gil
        -
        673 
        -
        674 #endif
        -
        auto semantic_at_c(const ColorBase &p) -> typename kth_semantic_element_const_reference_type< ColorBase, K >::type
        A constant accessor to the K-th semantic element of a color base.
        Definition: color_base_algorithm.hpp:133
        -
        auto at_c(const detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< typename std::add_const< E >::type >::type
        Provides constant access to the K-th element, in physical order.
        Definition: color_base.hpp:642
        -
        void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
        swap for packed_channel_reference
        Definition: channel.hpp:583
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Specifies the return type of the constant element accessor at_c of a homogeneous color base.
        Definition: color_base_algorithm.hpp:235
        -
        Specifies the return type of the mutable element accessor at_c of a homogeneous color base.
        Definition: color_base_algorithm.hpp:230
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_COLOR_BASE_HPP
        +
        10#define BOOST_GIL_COLOR_BASE_HPP
        +
        11
        +
        12#include <boost/gil/utilities.hpp>
        +
        13#include <boost/gil/concepts.hpp>
        +
        14#include <boost/gil/detail/mp11.hpp>
        +
        15
        +
        16#include <boost/assert.hpp>
        +
        17#include <boost/config.hpp>
        +
        18
        +
        19#include <type_traits>
        +
        20
        +
        21namespace boost { namespace gil {
        +
        22
        +
        23// Forward-declare
        +
        24template <typename P> P* memunit_advanced(const P* p, std::ptrdiff_t diff);
        +
        25
        +
        26// Forward-declare semantic_at_c
        +
        27template <int K, typename ColorBase>
        +
        28auto semantic_at_c(ColorBase& p)
        +
        29 -> typename std::enable_if
        +
        30 <
        +
        31 !std::is_const<ColorBase>::value,
        +
        32 typename kth_semantic_element_reference_type<ColorBase, K>::type
        +
        33 >::type;
        +
        34
        +
        35
        +
        36template <int K, typename ColorBase>
        +
        37auto semantic_at_c(const ColorBase& p) -> typename kth_semantic_element_const_reference_type<ColorBase,K>::type;
        +
        38
        +
        39// Forward declare element_reference_type
        +
        40template <typename ColorBase> struct element_reference_type;
        +
        41template <typename ColorBase> struct element_const_reference_type;
        +
        42template <typename ColorBase, int K> struct kth_element_type;
        +
        43template <typename ColorBase, int K> struct kth_element_type<const ColorBase,K> : public kth_element_type<ColorBase,K> {};
        +
        44template <typename ColorBase, int K> struct kth_element_reference_type;
        +
        45template <typename ColorBase, int K> struct kth_element_reference_type<const ColorBase,K> : public kth_element_reference_type<ColorBase,K> {};
        +
        46template <typename ColorBase, int K> struct kth_element_const_reference_type;
        +
        47template <typename ColorBase, int K> struct kth_element_const_reference_type<const ColorBase,K> : public kth_element_const_reference_type<ColorBase,K> {};
        +
        48
        +
        49namespace detail {
        +
        50
        +
        51template <typename DstLayout, typename SrcLayout, int K>
        +
        52struct mapping_transform : mp11::mp_at
        +
        53 <
        +
        54 typename SrcLayout::channel_mapping_t,
        +
        55 typename detail::type_to_index
        +
        56 <
        +
        57 typename DstLayout::channel_mapping_t,
        +
        58 std::integral_constant<int, K>
        +
        59 >
        +
        60 >::type
        +
        61{};
        +
        62
        +
        68
        +
        69#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        70#pragma warning(push)
        +
        71#pragma warning(disable:4512) //assignment operator could not be generated
        +
        72#endif
        +
        73
        +
        77template <typename Element, typename Layout>
        +
        +
        78struct homogeneous_color_base<Element, Layout, 1>
        +
        79{
        +
        80 using layout_t = Layout;
        +
        81
        +
        82 template
        +
        83 <
        +
        84 typename U = Element,
        +
        85 typename = typename std::enable_if<!std::is_reference<U>::value>::type
        +
        86 >
        +
        87 homogeneous_color_base() : v0_{} {}
        +
        88
        +
        89 explicit homogeneous_color_base(Element v) : v0_(v) {}
        +
        90
        +
        91 template <typename E2, typename L2>
        +
        92 homogeneous_color_base(homogeneous_color_base<E2, L2, 1> const& c)
        +
        93 : v0_(gil::at_c<0>(c))
        +
        94 {}
        +
        95
        +
        96 auto at(std::integral_constant<int, 0>)
        + +
        98 { return v0_; }
        +
        99
        +
        100 auto at(std::integral_constant<int, 0>) const
        + +
        102 { return v0_; }
        +
        103
        +
        104 // grayscale pixel values are convertible to channel type
        +
        105 // FIXME: explicit?
        +
        106 operator Element() const { return v0_; }
        +
        107
        +
        108private:
        +
        109 Element v0_;
        +
        110};
        +
        +
        111
        +
        115template <typename Element, typename Layout>
        +
        +
        116struct homogeneous_color_base<Element, Layout, 2>
        +
        117{
        +
        118 using layout_t = Layout;
        +
        119
        +
        120 template
        +
        121 <
        +
        122 typename U = Element,
        +
        123 typename = typename std::enable_if<!std::is_reference<U>::value>::type
        +
        124 >
        +
        125 homogeneous_color_base() : v0_{}, v1_{} {}
        +
        126
        +
        127 explicit homogeneous_color_base(Element v) : v0_(v), v1_(v) {}
        +
        128
        +
        129 homogeneous_color_base(Element v0, Element v1) : v0_(v0), v1_(v1) {}
        +
        130
        +
        131 template <typename E2, typename L2>
        +
        132 homogeneous_color_base(homogeneous_color_base<E2, L2, 2> const& c)
        +
        133 : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        +
        134 , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        +
        135 {}
        +
        136
        +
        137 // Support for l-value reference proxy copy construction
        +
        138 template <typename E2, typename L2>
        +
        139 homogeneous_color_base(homogeneous_color_base<E2, L2, 2>& c)
        +
        140 : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        +
        141 , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        +
        142 {}
        +
        143
        +
        144 // Support for planar_pixel_iterator construction and dereferencing
        +
        145 template <typename P>
        +
        146 homogeneous_color_base(P* p, bool)
        +
        147 : v0_(&semantic_at_c<0>(*p))
        +
        148 , v1_(&semantic_at_c<1>(*p))
        +
        149 {}
        +
        150
        +
        151 // Support for planar_pixel_reference offset constructor
        +
        152 template <typename Ptr>
        +
        153 homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
        +
        154 : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
        +
        155 , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
        +
        156 {}
        +
        157
        +
        158 template <typename Ref>
        +
        159 Ref deref() const
        +
        160 {
        +
        161 return Ref(*semantic_at_c<0>(*this), *semantic_at_c<1>(*this));
        +
        162 }
        +
        163
        +
        164 auto at(std::integral_constant<int, 0>)
        + +
        166 { return v0_; }
        +
        167
        +
        168 auto at(std::integral_constant<int, 0>) const
        + +
        170 { return v0_; }
        +
        171
        +
        172 auto at(std::integral_constant<int, 1>)
        + +
        174 { return v1_; }
        +
        175
        +
        176 auto at(std::integral_constant<int, 1>) const
        + +
        178 { return v1_; }
        +
        179
        +
        180 // Support for planar_pixel_reference operator[]
        +
        181 auto at_c_dynamic(std::size_t i) const -> Element
        +
        182 {
        +
        183 if (i == 0)
        +
        184 return v0_;
        +
        185 else
        +
        186 return v1_;
        +
        187 }
        +
        188
        +
        189private:
        +
        190 Element v0_;
        +
        191 Element v1_;
        +
        192};
        +
        +
        193
        +
        197template <typename Element, typename Layout>
        +
        +
        198struct homogeneous_color_base<Element, Layout, 3>
        +
        199{
        +
        200 using layout_t = Layout;
        +
        201
        +
        202 template
        +
        203 <
        +
        204 typename U = Element,
        +
        205 typename = typename std::enable_if<!std::is_reference<U>::value>::type
        +
        206 >
        +
        207 homogeneous_color_base() : v0_{}, v1_{}, v2_{} {}
        +
        208
        +
        209 explicit homogeneous_color_base(Element v) : v0_(v), v1_(v), v2_(v) {}
        +
        210
        +
        211 homogeneous_color_base(Element v0, Element v1, Element v2)
        +
        212 : v0_(v0), v1_(v1), v2_(v2)
        +
        213 {}
        +
        214
        +
        215 template <typename E2, typename L2>
        +
        216 homogeneous_color_base(homogeneous_color_base<E2, L2, 3> const& c)
        +
        217 : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        +
        218 , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        +
        219 , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        +
        220 {}
        +
        221
        +
        222 // Support for l-value reference proxy copy construction
        +
        223 template <typename E2, typename L2>
        +
        224 homogeneous_color_base(homogeneous_color_base<E2, L2, 3>& c)
        +
        225 : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        +
        226 , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        +
        227 , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        +
        228 {}
        +
        229
        +
        230 // Support for planar_pixel_iterator construction and dereferencing
        +
        231 template <typename P>
        +
        232 homogeneous_color_base(P* p, bool)
        +
        233 : v0_(&semantic_at_c<0>(*p))
        +
        234 , v1_(&semantic_at_c<1>(*p))
        +
        235 , v2_(&semantic_at_c<2>(*p))
        +
        236 {}
        +
        237
        +
        238 // Support for planar_pixel_reference offset constructor
        +
        239 template <typename Ptr>
        +
        240 homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
        +
        241 : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
        +
        242 , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
        +
        243 , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
        +
        244 {}
        +
        245
        +
        246 template <typename Ref>
        +
        247 Ref deref() const
        +
        248 {
        +
        249 return Ref(
        +
        250 *semantic_at_c<0>(*this),
        +
        251 *semantic_at_c<1>(*this),
        +
        252 *semantic_at_c<2>(*this));
        +
        253 }
        +
        254
        +
        255 auto at(std::integral_constant<int, 0>)
        + +
        257 { return v0_; }
        +
        258
        +
        259 auto at(std::integral_constant<int, 0>) const
        + +
        261 { return v0_; }
        +
        262
        +
        263 auto at(std::integral_constant<int, 1>)
        + +
        265 { return v1_; }
        +
        266
        +
        267 auto at(std::integral_constant<int, 1>) const
        + +
        269 { return v1_; }
        +
        270
        +
        271 auto at(std::integral_constant<int, 2>)
        + +
        273 { return v2_; }
        +
        274
        +
        275 auto at(std::integral_constant<int, 2>) const
        + +
        277 { return v2_; }
        +
        278
        +
        279 // Support for planar_pixel_reference operator[]
        +
        280 auto at_c_dynamic(std::size_t i) const -> Element
        +
        281 {
        +
        282 switch (i)
        +
        283 {
        +
        284 case 0: return v0_;
        +
        285 case 1: return v1_;
        +
        286 }
        +
        287 return v2_;
        +
        288 }
        +
        289
        +
        290private:
        +
        291 Element v0_;
        +
        292 Element v1_;
        +
        293 Element v2_;
        +
        294};
        +
        +
        295
        +
        299template <typename Element, typename Layout>
        +
        +
        300struct homogeneous_color_base<Element, Layout, 4>
        +
        301{
        +
        302 using layout_t = Layout;
        +
        303
        +
        304 template
        +
        305 <
        +
        306 typename U = Element,
        +
        307 typename = typename std::enable_if<!std::is_reference<U>::value>::type
        +
        308 >
        +
        309 homogeneous_color_base() : v0_{}, v1_{}, v2_{}, v3_{} {}
        +
        310
        +
        311 explicit homogeneous_color_base(Element v) : v0_(v), v1_(v), v2_(v), v3_(v) {}
        +
        312
        +
        313 homogeneous_color_base(Element v0, Element v1, Element v2, Element v3)
        +
        314 : v0_(v0), v1_(v1), v2_(v2), v3_(v3)
        +
        315 {}
        +
        316
        +
        317 template <typename E2, typename L2>
        +
        318 homogeneous_color_base(homogeneous_color_base<E2, L2, 4> const& c)
        +
        319 : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        +
        320 , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        +
        321 , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        +
        322 , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
        +
        323 {}
        +
        324
        +
        325 // Support for l-value reference proxy copy construction
        +
        326 template <typename E2, typename L2>
        +
        327 homogeneous_color_base(homogeneous_color_base<E2, L2, 4>& c)
        +
        328 : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        +
        329 , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        +
        330 , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        +
        331 , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
        +
        332 {}
        +
        333
        +
        334 // Support for planar_pixel_iterator construction and dereferencing
        +
        335 template <typename P>
        +
        336 homogeneous_color_base(P * p, bool)
        +
        337 : v0_(&semantic_at_c<0>(*p))
        +
        338 , v1_(&semantic_at_c<1>(*p))
        +
        339 , v2_(&semantic_at_c<2>(*p))
        +
        340 , v3_(&semantic_at_c<3>(*p))
        +
        341 {}
        +
        342
        +
        343 // Support for planar_pixel_reference offset constructor
        +
        344 template <typename Ptr>
        +
        345 homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
        +
        346 : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
        +
        347 , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
        +
        348 , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
        +
        349 , v3_(*memunit_advanced(semantic_at_c<3>(ptr), diff))
        +
        350 {}
        +
        351
        +
        352 template <typename Ref>
        +
        353 Ref deref() const
        +
        354 {
        +
        355 return Ref(
        +
        356 *semantic_at_c<0>(*this),
        +
        357 *semantic_at_c<1>(*this),
        +
        358 *semantic_at_c<2>(*this),
        +
        359 *semantic_at_c<3>(*this));
        +
        360 }
        +
        361
        +
        362 auto at(std::integral_constant<int, 0>)
        + +
        364 { return v0_; }
        +
        365
        +
        366 auto at(std::integral_constant<int, 0>) const
        + +
        368 { return v0_; }
        +
        369
        +
        370 auto at(std::integral_constant<int, 1>)
        + +
        372 { return v1_; }
        +
        373
        +
        374 auto at(std::integral_constant<int, 1>) const
        + +
        376 { return v1_; }
        +
        377
        +
        378 auto at(std::integral_constant<int, 2>)
        + +
        380 { return v2_; }
        +
        381
        +
        382 auto at(std::integral_constant<int, 2>) const
        + +
        384 { return v2_; }
        +
        385
        +
        386 auto at(std::integral_constant<int, 3>)
        + +
        388 { return v3_; }
        +
        389
        +
        390 auto at(std::integral_constant<int, 3>) const
        + +
        392 { return v3_; }
        +
        393
        +
        394 // Support for planar_pixel_reference operator[]
        +
        395 auto at_c_dynamic(std::size_t i) const -> Element
        +
        396 {
        +
        397 switch (i)
        +
        398 {
        +
        399 case 0: return v0_;
        +
        400 case 1: return v1_;
        +
        401 case 2: return v2_;
        +
        402 }
        +
        403 return v3_;
        +
        404 }
        +
        405
        +
        406private:
        +
        407 Element v0_;
        +
        408 Element v1_;
        +
        409 Element v2_;
        +
        410 Element v3_;
        +
        411};
        +
        +
        412
        +
        416template <typename Element, typename Layout>
        +
        +
        417struct homogeneous_color_base<Element, Layout, 5>
        +
        418{
        +
        419 using layout_t = Layout;
        +
        420
        +
        421 template
        +
        422 <
        +
        423 typename U = Element,
        +
        424 typename = typename std::enable_if<!std::is_reference<U>::value>::type
        +
        425 >
        +
        426 homogeneous_color_base()
        +
        427 : v0_{}, v1_{}, v2_{}, v3_{}, v4_{}
        +
        428 {}
        +
        429
        +
        430 explicit homogeneous_color_base(Element v)
        +
        431 : v0_(v), v1_(v), v2_(v), v3_(v), v4_(v)
        +
        432 {}
        +
        433
        +
        434 homogeneous_color_base(Element v0, Element v1, Element v2, Element v3, Element v4)
        +
        435 : v0_(v0), v1_(v1), v2_(v2), v3_(v3), v4_(v4)
        +
        436 {}
        +
        437
        +
        438 template <typename E2, typename L2>
        +
        439 homogeneous_color_base(homogeneous_color_base<E2, L2, 5> const& c)
        +
        440 : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        +
        441 , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        +
        442 , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        +
        443 , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
        +
        444 , v4_(gil::at_c<mapping_transform<Layout, L2, 4>::value>(c))
        +
        445 {}
        +
        446
        +
        447 // Support for l-value reference proxy copy construction
        +
        448 template <typename E2, typename L2>
        +
        449 homogeneous_color_base(homogeneous_color_base<E2, L2, 5>& c)
        +
        450 : v0_(gil::at_c<mapping_transform<Layout, L2, 0>::value>(c))
        +
        451 , v1_(gil::at_c<mapping_transform<Layout, L2, 1>::value>(c))
        +
        452 , v2_(gil::at_c<mapping_transform<Layout, L2, 2>::value>(c))
        +
        453 , v3_(gil::at_c<mapping_transform<Layout, L2, 3>::value>(c))
        +
        454 , v4_(gil::at_c<mapping_transform<Layout, L2, 4>::value>(c))
        +
        455 {}
        +
        456
        +
        457 // Support for planar_pixel_iterator construction and dereferencing
        +
        458 template <typename P>
        +
        459 homogeneous_color_base(P* p, bool)
        +
        460 : v0_(&semantic_at_c<0>(*p))
        +
        461 , v1_(&semantic_at_c<1>(*p))
        +
        462 , v2_(&semantic_at_c<2>(*p))
        +
        463 , v3_(&semantic_at_c<3>(*p))
        +
        464 , v4_(&semantic_at_c<4>(*p))
        +
        465 {}
        +
        466
        +
        467 // Support for planar_pixel_reference offset constructor
        +
        468 template <typename Ptr>
        +
        469 homogeneous_color_base(Ptr const& ptr, std::ptrdiff_t diff)
        +
        470 : v0_(*memunit_advanced(semantic_at_c<0>(ptr), diff))
        +
        471 , v1_(*memunit_advanced(semantic_at_c<1>(ptr), diff))
        +
        472 , v2_(*memunit_advanced(semantic_at_c<2>(ptr), diff))
        +
        473 , v3_(*memunit_advanced(semantic_at_c<3>(ptr), diff))
        +
        474 , v4_(*memunit_advanced(semantic_at_c<4>(ptr), diff))
        +
        475 {}
        +
        476
        +
        477
        +
        478 auto at(std::integral_constant<int, 0>)
        + +
        480 { return v0_; }
        +
        481
        +
        482 auto at(std::integral_constant<int, 0>) const
        + +
        484 { return v0_; }
        +
        485
        +
        486 auto at(std::integral_constant<int, 1>)
        + +
        488 { return v1_; }
        +
        489
        +
        490 auto at(std::integral_constant<int, 1>) const
        + +
        492 { return v1_; }
        +
        493
        +
        494 auto at(std::integral_constant<int, 2>)
        + +
        496 { return v2_; }
        +
        497
        +
        498 auto at(std::integral_constant<int, 2>) const
        + +
        500 { return v2_; }
        +
        501
        +
        502 auto at(std::integral_constant<int, 3>)
        + +
        504 { return v3_; }
        +
        505
        +
        506 auto at(std::integral_constant<int, 3>) const
        + +
        508 { return v3_; }
        +
        509
        +
        510 auto at(std::integral_constant<int, 4>)
        + +
        512 { return v4_; }
        +
        513
        +
        514 auto at(std::integral_constant<int, 4>) const
        + +
        516 { return v4_; }
        +
        517
        +
        518 template <typename Ref>
        +
        519 Ref deref() const
        +
        520 {
        +
        521 return Ref(
        +
        522 *semantic_at_c<0>(*this),
        +
        523 *semantic_at_c<1>(*this),
        +
        524 *semantic_at_c<2>(*this),
        +
        525 *semantic_at_c<3>(*this),
        +
        526 *semantic_at_c<4>(*this));
        +
        527 }
        +
        528
        +
        529 // Support for planar_pixel_reference operator[]
        +
        530 auto at_c_dynamic(std::size_t i) const -> Element
        +
        531 {
        +
        532 switch (i)
        +
        533 {
        +
        534 case 0: return v0_;
        +
        535 case 1: return v1_;
        +
        536 case 2: return v2_;
        +
        537 case 3: return v3_;
        +
        538 }
        +
        539 return v4_;
        +
        540 }
        +
        541
        +
        542private:
        +
        543 Element v0_;
        +
        544 Element v1_;
        +
        545 Element v2_;
        +
        546 Element v3_;
        +
        547 Element v4_;
        +
        548};
        +
        +
        549
        +
        550#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        551#pragma warning(pop)
        +
        552#endif
        +
        553
        +
        554// The following way of casting adjacent channels (the contents of color_base) into an array appears to be unsafe
        +
        555// -- there is no guarantee that the compiler won't add any padding between adjacent channels.
        +
        556// Note, however, that GIL _must_ be compiled with compiler settings ensuring there is no padding in the color base structs.
        +
        557// This is because the color base structs must model the interleaved organization in memory. In other words, the client may
        +
        558// have existing RGB image in the form "RGBRGBRGB..." and we must be able to represent it with an array of RGB color bases (i.e. RGB pixels)
        +
        559// with no padding. We have tested with char/int/float/double channels on gcc and VC and have so far discovered no problem.
        +
        560// We have even tried using strange channels consisting of short + char (3 bytes). With the default 4-byte alignment on VC, the size
        +
        561// of this channel is padded to 4 bytes, so an RGB pixel of it will be 4x3=12 bytes. The code below will still work properly.
        +
        562// However, the client must nevertheless ensure that proper compiler settings are used for their compiler and their channel types.
        +
        563
        +
        564template <typename Element, typename Layout, int K>
        +
        565auto dynamic_at_c(homogeneous_color_base<Element,Layout,K>& cb, std::size_t i)
        + +
        567{
        +
        568 BOOST_ASSERT(i < K);
        +
        569 return (gil_reinterpret_cast<Element*>(&cb))[i];
        +
        570}
        +
        571
        +
        572template <typename Element, typename Layout, int K>
        +
        573auto dynamic_at_c(homogeneous_color_base<Element, Layout, K> const& cb, std::size_t i)
        + +
        575 <
        +
        576 homogeneous_color_base<Element, Layout, K>
        +
        577 >::type
        +
        578{
        +
        579 BOOST_ASSERT(i < K);
        +
        580 return (gil_reinterpret_cast_c<const Element*>(&cb))[i];
        +
        581}
        +
        582
        +
        583template <typename Element, typename Layout, int K>
        +
        584auto dynamic_at_c(homogeneous_color_base<Element&, Layout, K> const& cb, std::size_t i)
        +
        585 -> typename element_reference_type
        +
        586 <
        +
        587 homogeneous_color_base<Element&, Layout, K>
        +
        588 >::type
        +
        589{
        +
        590 BOOST_ASSERT(i < K);
        +
        591 return cb.at_c_dynamic(i);
        +
        592}
        +
        593
        +
        594template <typename Element, typename Layout, int K>
        +
        595auto dynamic_at_c(
        +
        596 homogeneous_color_base<Element const&, Layout, K>const& cb, std::size_t i)
        +
        597 -> typename element_const_reference_type
        +
        598 <
        +
        599 homogeneous_color_base<Element const&, Layout, K>
        +
        600 >::type
        +
        601{
        +
        602 BOOST_ASSERT(i < K);
        +
        603 return cb.at_c_dynamic(i);
        +
        604}
        +
        605
        +
        606} // namespace detail
        +
        607
        +
        608template <typename Element, typename Layout, int K1, int K>
        +
        609struct kth_element_type<detail::homogeneous_color_base<Element, Layout, K1>, K>
        +
        610{
        +
        611 using type = Element;
        +
        612};
        +
        613
        +
        614template <typename Element, typename Layout, int K1, int K>
        +
        615struct kth_element_reference_type<detail::homogeneous_color_base<Element, Layout, K1>, K>
        +
        616 : std::add_lvalue_reference<Element>
        +
        617{};
        +
        618
        +
        619template <typename Element, typename Layout, int K1, int K>
        +
        620struct kth_element_const_reference_type
        +
        621 <
        +
        622 detail::homogeneous_color_base<Element, Layout, K1>,
        +
        623 K
        +
        624 >
        +
        625 : std::add_lvalue_reference<typename std::add_const<Element>::type>
        +
        626{};
        +
        627
        +
        630template <int K, typename E, typename L, int N>
        +
        631inline
        +
        +
        632auto at_c(detail::homogeneous_color_base<E, L, N>& p)
        +
        633 -> typename std::add_lvalue_reference<E>::type
        +
        634{
        +
        635 return p.at(std::integral_constant<int, K>());
        +
        636}
        +
        +
        637
        +
        640template <int K, typename E, typename L, int N>
        +
        641inline
        +
        +
        642auto at_c(const detail::homogeneous_color_base<E, L, N>& p)
        +
        643 -> typename std::add_lvalue_reference<typename std::add_const<E>::type>::type
        +
        644{
        +
        645 return p.at(std::integral_constant<int, K>());
        +
        646}
        +
        +
        647
        +
        648namespace detail
        +
        649{
        +
        650
        +
        651struct swap_fn
        +
        652{
        +
        653 template <typename T>
        +
        654 void operator()(T& x, T& y) const
        +
        655 {
        +
        656 using std::swap;
        +
        657 swap(x, y);
        +
        658 }
        +
        659};
        +
        660
        +
        661} // namespace detail
        +
        662
        +
        663template <typename E, typename L, int N>
        +
        664inline
        +
        665void swap(
        +
        666 detail::homogeneous_color_base<E, L, N>& x,
        +
        667 detail::homogeneous_color_base<E, L, N>& y)
        +
        668{
        +
        669 static_for_each(x, y, detail::swap_fn());
        +
        670}
        +
        671
        +
        672}} // namespace boost::gil
        +
        673
        +
        674#endif
        +
        auto semantic_at_c(ColorBase &p) -> typename std::enable_if< !std::is_const< ColorBase >::value, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type
        A mutable accessor to the K-th semantic element of a color base.
        Definition color_base_algorithm.hpp:119
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Specifies the return type of the constant element accessor at_c of a homogeneous color base.
        Definition color_base_algorithm.hpp:235
        +
        Specifies the return type of the mutable element accessor at_c of a homogeneous color base.
        Definition color_base_algorithm.hpp:230
        diff --git a/html/reference/color__base__algorithm_8hpp_source.html b/html/reference/color__base__algorithm_8hpp_source.html index 8bafbbf4d..4071baff9 100644 --- a/html/reference/color__base__algorithm_8hpp_source.html +++ b/html/reference/color__base__algorithm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_base_algorithm.hpp Source File @@ -27,555 +27,576 @@

        - + +/* @license-end */ + +
        -
        -
        color_base_algorithm.hpp
        +
        color_base_algorithm.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_COLOR_BASE_ALGORITHM_HPP
        -
        10 #define BOOST_GIL_COLOR_BASE_ALGORITHM_HPP
        -
        11 
        -
        12 #include <boost/gil/concepts.hpp>
        -
        13 #include <boost/gil/utilities.hpp>
        -
        14 #include <boost/gil/detail/mp11.hpp>
        -
        15 
        -
        16 #include <boost/config.hpp>
        -
        17 
        -
        18 #include <algorithm>
        -
        19 #include <type_traits>
        -
        20 
        -
        21 namespace boost { namespace gil {
        -
        22 
        -
        26 
        -
        41 template <typename ColorBase>
        -
        42 struct size : public mp11::mp_size<typename ColorBase::layout_t::color_space_t> {};
        -
        43 
        -
        47 
        -
        76 template <typename ColorBase, int K>
        - -
        78 {
        -
        79  using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
        -
        80  static_assert(K < mp11::mp_size<channel_mapping_t>::value,
        -
        81  "K index should be less than size of channel_mapping_t sequence");
        -
        82 
        -
        83  static constexpr int semantic_index = mp11::mp_at_c<channel_mapping_t, K>::type::value;
        -
        84  using type = typename kth_element_type<ColorBase, semantic_index>::type;
        -
        85 };
        -
        86 
        -
        89 template <typename ColorBase, int K>
        - -
        91 {
        -
        92  using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
        -
        93  static_assert(K < mp11::mp_size<channel_mapping_t>::value,
        -
        94  "K index should be less than size of channel_mapping_t sequence");
        -
        95 
        -
        96  static constexpr int semantic_index = mp11::mp_at_c<channel_mapping_t, K>::type::value;
        -
        97  using type = typename kth_element_reference_type<ColorBase, semantic_index>::type;
        -
        98  static type get(ColorBase& cb) { return gil::at_c<semantic_index>(cb); }
        -
        99 };
        -
        100 
        -
        103 template <typename ColorBase, int K>
        - -
        105 {
        -
        106  using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
        -
        107  static_assert(K < mp11::mp_size<channel_mapping_t>::value,
        -
        108  "K index should be less than size of channel_mapping_t sequence");
        -
        109 
        -
        110  static constexpr int semantic_index = mp11::mp_at_c<channel_mapping_t, K>::type::value;
        -
        111  using type = typename kth_element_const_reference_type<ColorBase,semantic_index>::type;
        -
        112  static type get(const ColorBase& cb) { return gil::at_c<semantic_index>(cb); }
        -
        113 };
        -
        114 
        -
        117 template <int K, typename ColorBase>
        -
        118 inline
        -
        119 auto semantic_at_c(ColorBase& p)
        -
        120  -> typename std::enable_if
        -
        121  <
        -
        122  !std::is_const<ColorBase>::value,
        -
        123  typename kth_semantic_element_reference_type<ColorBase, K>::type
        -
        124  >::type
        -
        125 {
        - -
        127 }
        -
        128 
        -
        131 template <int K, typename ColorBase>
        -
        132 inline
        -
        133 auto semantic_at_c(ColorBase const& p)
        -
        134  -> typename kth_semantic_element_const_reference_type<ColorBase, K>::type
        -
        135 {
        - -
        137 }
        -
        138 
        -
        142 
        -
        164 template <typename ColorBase, typename Color>
        - -
        166  : mp11::mp_contains<typename ColorBase::layout_t::color_space_t, Color>
        -
        167 {};
        -
        168 
        -
        169 template <typename ColorBase, typename Color>
        -
        170 struct color_index_type : public detail::type_to_index<typename ColorBase::layout_t::color_space_t,Color> {};
        -
        171 
        -
        174 template <typename ColorBase, typename Color>
        -
        175 struct color_element_type : public kth_semantic_element_type<ColorBase,color_index_type<ColorBase,Color>::value> {};
        -
        176 
        -
        179 template <typename ColorBase, typename Color>
        -
        180 struct color_element_reference_type : public kth_semantic_element_reference_type<ColorBase,color_index_type<ColorBase,Color>::value> {};
        -
        181 
        -
        184 template <typename ColorBase, typename Color>
        -
        185 struct color_element_const_reference_type : public kth_semantic_element_const_reference_type<ColorBase,color_index_type<ColorBase,Color>::value> {};
        -
        186 
        -
        189 template <typename ColorBase, typename Color>
        -
        190 auto get_color(ColorBase& cb, Color=Color())
        -
        191  -> typename color_element_reference_type<ColorBase,Color>::type
        -
        192 {
        - -
        194 }
        -
        195 
        -
        198 template <typename ColorBase, typename Color>
        -
        199 auto get_color(const ColorBase& cb, Color=Color())
        -
        200  -> typename color_element_const_reference_type<ColorBase,Color>::type
        -
        201 {
        - -
        203 }
        -
        204 
        -
        210 
        -
        224 template <typename ColorBase>
        -
        225 struct element_type : public kth_element_type<ColorBase, 0> {};
        -
        226 
        -
        229 template <typename ColorBase>
        -
        230 struct element_reference_type : public kth_element_reference_type<ColorBase, 0> {};
        -
        231 
        -
        234 template <typename ColorBase>
        -
        235 struct element_const_reference_type : public kth_element_const_reference_type<ColorBase, 0> {};
        -
        236 
        -
        237 
        -
        238 namespace detail {
        -
        239 
        -
        240 // compile-time recursion for per-element operations on color bases
        -
        241 template <int N>
        -
        242 struct element_recursion
        -
        243 {
        -
        244 
        -
        245 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        246 #pragma GCC diagnostic push
        -
        247 #pragma GCC diagnostic ignored "-Wconversion"
        -
        248 #pragma GCC diagnostic ignored "-Wfloat-equal"
        -
        249 #endif
        -
        250 
        -
        251  template <typename P1,typename P2>
        -
        252  static bool static_equal(const P1& p1, const P2& p2)
        -
        253  {
        -
        254  return element_recursion<N-1>::static_equal(p1,p2) &&
        -
        255  semantic_at_c<N-1>(p1)==semantic_at_c<N-1>(p2);
        -
        256  }
        -
        257 
        -
        258  template <typename P1,typename P2>
        -
        259  static void static_copy(const P1& p1, P2& p2)
        -
        260  {
        -
        261  element_recursion<N-1>::static_copy(p1,p2);
        -
        262  semantic_at_c<N-1>(p2)=semantic_at_c<N-1>(p1);
        -
        263  }
        -
        264 
        -
        265  template <typename P,typename T2>
        -
        266  static void static_fill(P& p, T2 v)
        -
        267  {
        -
        268  element_recursion<N-1>::static_fill(p,v);
        -
        269  semantic_at_c<N-1>(p)=v;
        -
        270  }
        -
        271 
        -
        272  template <typename Dst,typename Op>
        -
        273  static void static_generate(Dst& dst, Op op)
        -
        274  {
        -
        275  element_recursion<N-1>::static_generate(dst,op);
        -
        276  semantic_at_c<N-1>(dst)=op();
        -
        277  }
        -
        278 
        -
        279 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        280 #pragma GCC diagnostic pop
        -
        281 #endif
        -
        282 
        -
        283  //static_for_each with one source
        -
        284  template <typename P1,typename Op>
        -
        285  static Op static_for_each(P1& p1, Op op) {
        -
        286  Op op2(element_recursion<N-1>::static_for_each(p1,op));
        -
        287  op2(semantic_at_c<N-1>(p1));
        -
        288  return op2;
        -
        289  }
        -
        290  template <typename P1,typename Op>
        -
        291  static Op static_for_each(const P1& p1, Op op) {
        -
        292  Op op2(element_recursion<N-1>::static_for_each(p1,op));
        -
        293  op2(semantic_at_c<N-1>(p1));
        -
        294  return op2;
        -
        295  }
        -
        296  //static_for_each with two sources
        -
        297  template <typename P1,typename P2,typename Op>
        -
        298  static Op static_for_each(P1& p1, P2& p2, Op op) {
        -
        299  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
        -
        300  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
        -
        301  return op2;
        -
        302  }
        -
        303  template <typename P1,typename P2,typename Op>
        -
        304  static Op static_for_each(P1& p1, const P2& p2, Op op) {
        -
        305  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
        -
        306  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
        -
        307  return op2;
        -
        308  }
        -
        309  template <typename P1,typename P2,typename Op>
        -
        310  static Op static_for_each(const P1& p1, P2& p2, Op op) {
        -
        311  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
        -
        312  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
        -
        313  return op2;
        -
        314  }
        -
        315  template <typename P1,typename P2,typename Op>
        -
        316  static Op static_for_each(const P1& p1, const P2& p2, Op op) {
        -
        317  Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
        -
        318  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
        -
        319  return op2;
        -
        320  }
        -
        321  //static_for_each with three sources
        -
        322  template <typename P1,typename P2,typename P3,typename Op>
        -
        323  static Op static_for_each(P1& p1, P2& p2, P3& p3, Op op) {
        -
        324  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        -
        325  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        -
        326  return op2;
        -
        327  }
        -
        328  template <typename P1,typename P2,typename P3,typename Op>
        -
        329  static Op static_for_each(P1& p1, P2& p2, const P3& p3, Op op) {
        -
        330  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        -
        331  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        -
        332  return op2;
        -
        333  }
        -
        334  template <typename P1,typename P2,typename P3,typename Op>
        -
        335  static Op static_for_each(P1& p1, const P2& p2, P3& p3, Op op) {
        -
        336  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        -
        337  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        -
        338  return op2;
        -
        339  }
        -
        340  template <typename P1,typename P2,typename P3,typename Op>
        -
        341  static Op static_for_each(P1& p1, const P2& p2, const P3& p3, Op op) {
        -
        342  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        -
        343  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        -
        344  return op2;
        -
        345  }
        -
        346  template <typename P1,typename P2,typename P3,typename Op>
        -
        347  static Op static_for_each(const P1& p1, P2& p2, P3& p3, Op op) {
        -
        348  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        -
        349  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        -
        350  return op2;
        -
        351  }
        -
        352  template <typename P1,typename P2,typename P3,typename Op>
        -
        353  static Op static_for_each(const P1& p1, P2& p2, const P3& p3, Op op) {
        -
        354  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        -
        355  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        -
        356  return op2;
        -
        357  }
        -
        358  template <typename P1,typename P2,typename P3,typename Op>
        -
        359  static Op static_for_each(const P1& p1, const P2& p2, P3& p3, Op op) {
        -
        360  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        -
        361  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        -
        362  return op2;
        -
        363  }
        -
        364  template <typename P1,typename P2,typename P3,typename Op>
        -
        365  static Op static_for_each(const P1& p1, const P2& p2, const P3& p3, Op op) {
        -
        366  Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        -
        367  op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        -
        368  return op2;
        -
        369  }
        -
        370  //static_transform with one source
        -
        371  template <typename P1,typename Dst,typename Op>
        -
        372  static Op static_transform(P1& src, Dst& dst, Op op) {
        -
        373  Op op2(element_recursion<N-1>::static_transform(src,dst,op));
        -
        374  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
        -
        375  return op2;
        -
        376  }
        -
        377  template <typename P1,typename Dst,typename Op>
        -
        378  static Op static_transform(const P1& src, Dst& dst, Op op) {
        -
        379  Op op2(element_recursion<N-1>::static_transform(src,dst,op));
        -
        380  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
        -
        381  return op2;
        -
        382  }
        -
        383  //static_transform with two sources
        -
        384  template <typename P1,typename P2,typename Dst,typename Op>
        -
        385  static Op static_transform(P1& src1, P2& src2, Dst& dst, Op op) {
        -
        386  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
        -
        387  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
        -
        388  return op2;
        -
        389  }
        -
        390  template <typename P1,typename P2,typename Dst,typename Op>
        -
        391  static Op static_transform(P1& src1, const P2& src2, Dst& dst, Op op) {
        -
        392  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
        -
        393  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
        -
        394  return op2;
        -
        395  }
        -
        396  template <typename P1,typename P2,typename Dst,typename Op>
        -
        397  static Op static_transform(const P1& src1, P2& src2, Dst& dst, Op op) {
        -
        398  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
        -
        399  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
        -
        400  return op2;
        -
        401  }
        -
        402  template <typename P1,typename P2,typename Dst,typename Op>
        -
        403  static Op static_transform(const P1& src1, const P2& src2, Dst& dst, Op op) {
        -
        404  Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
        -
        405  semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
        -
        406  return op2;
        -
        407  }
        -
        408 };
        -
        409 
        -
        410 // Termination condition of the compile-time recursion for element operations on a color base
        -
        411 template<> struct element_recursion<0> {
        -
        412  //static_equal
        -
        413  template <typename P1,typename P2>
        -
        414  static bool static_equal(const P1&, const P2&) { return true; }
        -
        415  //static_copy
        -
        416  template <typename P1,typename P2>
        -
        417  static void static_copy(const P1&, const P2&) {}
        -
        418  //static_fill
        -
        419  template <typename P, typename T2>
        -
        420  static void static_fill(const P&, T2) {}
        -
        421  //static_generate
        -
        422  template <typename Dst,typename Op>
        -
        423  static void static_generate(const Dst&,Op){}
        -
        424  //static_for_each with one source
        -
        425  template <typename P1,typename Op>
        -
        426  static Op static_for_each(const P1&,Op op){return op;}
        -
        427  //static_for_each with two sources
        -
        428  template <typename P1,typename P2,typename Op>
        -
        429  static Op static_for_each(const P1&,const P2&,Op op){return op;}
        -
        430  //static_for_each with three sources
        -
        431  template <typename P1,typename P2,typename P3,typename Op>
        -
        432  static Op static_for_each(const P1&,const P2&,const P3&,Op op){return op;}
        -
        433  //static_transform with one source
        -
        434  template <typename P1,typename Dst,typename Op>
        -
        435  static Op static_transform(const P1&,const Dst&,Op op){return op;}
        -
        436  //static_transform with two sources
        -
        437  template <typename P1,typename P2,typename Dst,typename Op>
        -
        438  static Op static_transform(const P1&,const P2&,const Dst&,Op op){return op;}
        -
        439 };
        -
        440 
        -
        441 // std::min and std::max don't have the mutable overloads...
        -
        442 template <typename Q>
        -
        443 inline auto mutable_min(Q const& x, Q const& y) -> Q const& { return x<y ? x : y; }
        -
        444 
        -
        445 template <typename Q>
        -
        446 inline auto mutable_min(Q& x, Q& y) -> Q& { return x<y ? x : y; }
        -
        447 
        -
        448 template <typename Q>
        -
        449 inline auto mutable_max(Q const& x, Q const& y) -> Q const& { return x<y ? y : x; }
        -
        450 
        -
        451 template <typename Q>
        -
        452 inline auto mutable_max(Q& x, Q& y) -> Q& { return x<y ? y : x; }
        -
        453 
        -
        454 
        -
        455 // compile-time recursion for min/max element
        -
        456 template <int N>
        -
        457 struct min_max_recur
        -
        458 {
        -
        459  template <typename P>
        -
        460  static auto max_(P const& p) -> typename element_const_reference_type<P>::type
        -
        461  {
        -
        462  return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
        -
        463  }
        -
        464 
        -
        465  template <typename P>
        -
        466  static auto max_(P& p) -> typename element_reference_type<P>::type
        -
        467  {
        -
        468  return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
        -
        469  }
        -
        470 
        -
        471  template <typename P>
        -
        472  static auto min_(P const& p) -> typename element_const_reference_type<P>::type
        -
        473  {
        -
        474  return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
        -
        475  }
        -
        476 
        -
        477  template <typename P>
        -
        478  static auto min_(P& p) -> typename element_reference_type<P>::type
        -
        479  {
        -
        480  return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
        -
        481  }
        -
        482 };
        -
        483 
        -
        484 // termination condition of the compile-time recursion for min/max element
        -
        485 template <>
        -
        486 struct min_max_recur<1>
        -
        487 {
        -
        488  template <typename P>
        -
        489  static auto max_(P const& p) -> typename element_const_reference_type<P>::type { return semantic_at_c<0>(p); }
        -
        490 
        -
        491  template <typename P>
        -
        492  static auto max_(P& p) -> typename element_reference_type<P>::type { return semantic_at_c<0>(p); }
        -
        493 
        -
        494  template <typename P>
        -
        495  static auto min_(P const& p) -> typename element_const_reference_type<P>::type { return semantic_at_c<0>(p); }
        -
        496 
        -
        497  template <typename P>
        -
        498  static auto min_(P& p) -> typename element_reference_type<P>::type { return semantic_at_c<0>(p); }
        -
        499 };
        -
        500 } // namespace detail
        -
        501 
        -
        514 
        -
        515 template <typename P>
        -
        516 BOOST_FORCEINLINE
        -
        517 auto static_max(P const& p) -> typename element_const_reference_type<P>::type { return detail::min_max_recur<size<P>::value>::max_(p); }
        -
        518 
        -
        519 template <typename P>
        -
        520 BOOST_FORCEINLINE
        -
        521 auto static_max(P& p) -> typename element_reference_type<P>::type { return detail::min_max_recur<size<P>::value>::max_(p); }
        -
        522 
        -
        523 template <typename P>
        -
        524 BOOST_FORCEINLINE
        -
        525 auto static_min(P const& p) -> typename element_const_reference_type<P>::type { return detail::min_max_recur<size<P>::value>::min_(p); }
        -
        526 
        -
        527 template <typename P>
        -
        528 BOOST_FORCEINLINE
        -
        529 auto static_min(P& p) -> typename element_reference_type<P>::type { return detail::min_max_recur<size<P>::value>::min_(p); }
        -
        531 
        -
        546 
        -
        547 template <typename P1,typename P2>
        -
        548 BOOST_FORCEINLINE
        -
        549 bool static_equal(P1 const& p1, const P2& p2) { return detail::element_recursion<size<P1>::value>::static_equal(p1,p2); }
        -
        550 
        -
        552 
        -
        567 
        -
        568 template <typename Src,typename Dst>
        -
        569 BOOST_FORCEINLINE
        -
        570 void static_copy(const Src& src, Dst& dst)
        -
        571 {
        -
        572  detail::element_recursion<size<Dst>::value>::static_copy(src, dst);
        -
        573 }
        -
        574 
        -
        576 
        -
        588 
        -
        589 template <typename P,typename V>
        -
        590 BOOST_FORCEINLINE
        -
        591 void static_fill(P& p, const V& v)
        -
        592 {
        -
        593  detail::element_recursion<size<P>::value>::static_fill(p,v);
        -
        594 }
        -
        595 
        -
        597 
        -
        616 
        -
        617 template <typename P1,typename Op>
        -
        618 BOOST_FORCEINLINE
        -
        619 void static_generate(P1& dst,Op op) { detail::element_recursion<size<P1>::value>::static_generate(dst,op); }
        -
        621 
        -
        647 
        -
        648 //static_transform with one source
        -
        649 template <typename Src,typename Dst,typename Op>
        -
        650 BOOST_FORCEINLINE
        -
        651 Op static_transform(Src& src,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(src,dst,op); }
        -
        652 template <typename Src,typename Dst,typename Op>
        -
        653 BOOST_FORCEINLINE
        -
        654 Op static_transform(const Src& src,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(src,dst,op); }
        -
        655 //static_transform with two sources
        -
        656 template <typename P2,typename P3,typename Dst,typename Op>
        -
        657 BOOST_FORCEINLINE
        -
        658 Op static_transform(P2& p2,P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
        -
        659 template <typename P2,typename P3,typename Dst,typename Op>
        -
        660 BOOST_FORCEINLINE
        -
        661 Op static_transform(P2& p2,const P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
        -
        662 template <typename P2,typename P3,typename Dst,typename Op>
        -
        663 BOOST_FORCEINLINE
        -
        664 Op static_transform(const P2& p2,P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
        -
        665 template <typename P2,typename P3,typename Dst,typename Op>
        -
        666 BOOST_FORCEINLINE
        -
        667 Op static_transform(const P2& p2,const P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
        -
        669 
        -
        694 
        -
        695 //static_for_each with one source
        -
        696 template <typename P1,typename Op>
        -
        697 BOOST_FORCEINLINE
        -
        698 Op static_for_each( P1& p1, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,op); }
        -
        699 template <typename P1,typename Op>
        -
        700 BOOST_FORCEINLINE
        -
        701 Op static_for_each(const P1& p1, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,op); }
        -
        702 //static_for_each with two sources
        -
        703 template <typename P1,typename P2,typename Op>
        -
        704 BOOST_FORCEINLINE
        -
        705 Op static_for_each(P1& p1, P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
        -
        706 template <typename P1,typename P2,typename Op>
        -
        707 BOOST_FORCEINLINE
        -
        708 Op static_for_each(P1& p1,const P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
        -
        709 template <typename P1,typename P2,typename Op>
        -
        710 BOOST_FORCEINLINE
        -
        711 Op static_for_each(const P1& p1, P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
        -
        712 template <typename P1,typename P2,typename Op>
        -
        713 BOOST_FORCEINLINE
        -
        714 Op static_for_each(const P1& p1,const P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
        -
        715 //static_for_each with three sources
        -
        716 template <typename P1,typename P2,typename P3,typename Op>
        -
        717 BOOST_FORCEINLINE
        -
        718 Op static_for_each(P1& p1,P2& p2,P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        -
        719 template <typename P1,typename P2,typename P3,typename Op>
        -
        720 BOOST_FORCEINLINE
        -
        721 Op static_for_each(P1& p1,P2& p2,const P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        -
        722 template <typename P1,typename P2,typename P3,typename Op>
        -
        723 BOOST_FORCEINLINE
        -
        724 Op static_for_each(P1& p1,const P2& p2,P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        -
        725 template <typename P1,typename P2,typename P3,typename Op>
        -
        726 BOOST_FORCEINLINE
        -
        727 Op static_for_each(P1& p1,const P2& p2,const P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        -
        728 template <typename P1,typename P2,typename P3,typename Op>
        -
        729 BOOST_FORCEINLINE
        -
        730 Op static_for_each(const P1& p1,P2& p2,P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        -
        731 template <typename P1,typename P2,typename P3,typename Op>
        -
        732 BOOST_FORCEINLINE
        -
        733 Op static_for_each(const P1& p1,P2& p2,const P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        -
        734 template <typename P1,typename P2,typename P3,typename Op>
        -
        735 BOOST_FORCEINLINE
        -
        736 Op static_for_each(const P1& p1,const P2& p2,P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        -
        737 template <typename P1,typename P2,typename P3,typename Op>
        -
        738 BOOST_FORCEINLINE
        -
        739 Op static_for_each(const P1& p1,const P2& p2,const P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        -
        741 
        -
        742 }} // namespace boost::gil
        -
        743 
        -
        744 #endif
        -
        auto get_color(const ColorBase &cb, Color=Color()) -> typename color_element_const_reference_type< ColorBase, Color >::type
        Constant accessor to the element associated with a given color name.
        Definition: color_base_algorithm.hpp:199
        -
        auto semantic_at_c(ColorBase &p) -> typename std::enable_if< !std::is_const< ColorBase >::value, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type
        A mutable accessor to the K-th semantic element of a color base.
        Definition: color_base_algorithm.hpp:119
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Specifies the return type of the constant element accessor by color name, get_color(color_base,...
        Definition: color_base_algorithm.hpp:185
        -
        Specifies the return type of the mutable element accessor by color name, get_color(color_base,...
        Definition: color_base_algorithm.hpp:180
        -
        Specifies the type of the element associated with a given color tag.
        Definition: color_base_algorithm.hpp:175
        -
        A predicate metafunction determining whether a given color base contains a given color.
        Definition: color_base_algorithm.hpp:167
        -
        Returns the index corresponding to the first occurrance of a given given type in.
        Definition: utilities.hpp:251
        -
        Specifies the return type of the constant element accessor at_c of a homogeneous color base.
        Definition: color_base_algorithm.hpp:235
        -
        Specifies the return type of the mutable element accessor at_c of a homogeneous color base.
        Definition: color_base_algorithm.hpp:230
        -
        Specifies the element type of a homogeneous color base.
        Definition: color_base_algorithm.hpp:225
        -
        Specifies the return type of the constant semantic_at_c<K>(color_base);.
        Definition: color_base_algorithm.hpp:105
        -
        Specifies the return type of the mutable semantic_at_c<K>(color_base);.
        Definition: color_base_algorithm.hpp:91
        -
        Specifies the type of the K-th semantic element of a color base.
        Definition: color_base_algorithm.hpp:78
        -
        Returns an integral constant type specifying the number of elements in a color base.
        Definition: color_base_algorithm.hpp:42
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_COLOR_BASE_ALGORITHM_HPP
        +
        10#define BOOST_GIL_COLOR_BASE_ALGORITHM_HPP
        +
        11
        +
        12#include <boost/gil/concepts.hpp>
        +
        13#include <boost/gil/utilities.hpp>
        +
        14#include <boost/gil/detail/mp11.hpp>
        +
        15
        +
        16#include <boost/config.hpp>
        +
        17
        +
        18#include <algorithm>
        +
        19#include <type_traits>
        +
        20
        +
        21namespace boost { namespace gil {
        +
        22
        +
        26
        +
        41template <typename ColorBase>
        +
        42struct size : public mp11::mp_size<typename ColorBase::layout_t::color_space_t> {};
        +
        43
        +
        47
        +
        76template <typename ColorBase, int K>
        +
        + +
        78{
        +
        79 using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
        +
        80 static_assert(K < mp11::mp_size<channel_mapping_t>::value,
        +
        81 "K index should be less than size of channel_mapping_t sequence");
        +
        82
        +
        83 static constexpr int semantic_index = mp11::mp_at_c<channel_mapping_t, K>::type::value;
        +
        84 using type = typename kth_element_type<ColorBase, semantic_index>::type;
        +
        85};
        +
        +
        86
        +
        89template <typename ColorBase, int K>
        +
        + +
        91{
        +
        92 using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
        +
        93 static_assert(K < mp11::mp_size<channel_mapping_t>::value,
        +
        94 "K index should be less than size of channel_mapping_t sequence");
        +
        95
        +
        96 static constexpr int semantic_index = mp11::mp_at_c<channel_mapping_t, K>::type::value;
        +
        97 using type = typename kth_element_reference_type<ColorBase, semantic_index>::type;
        +
        98 static type get(ColorBase& cb) { return gil::at_c<semantic_index>(cb); }
        +
        99};
        +
        +
        100
        +
        103template <typename ColorBase, int K>
        +
        + +
        105{
        +
        106 using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
        +
        107 static_assert(K < mp11::mp_size<channel_mapping_t>::value,
        +
        108 "K index should be less than size of channel_mapping_t sequence");
        +
        109
        +
        110 static constexpr int semantic_index = mp11::mp_at_c<channel_mapping_t, K>::type::value;
        +
        111 using type = typename kth_element_const_reference_type<ColorBase,semantic_index>::type;
        +
        112 static type get(const ColorBase& cb) { return gil::at_c<semantic_index>(cb); }
        +
        113};
        +
        +
        114
        +
        117template <int K, typename ColorBase>
        +
        118inline
        +
        +
        119auto semantic_at_c(ColorBase& p)
        +
        120 -> typename std::enable_if
        +
        121 <
        +
        122 !std::is_const<ColorBase>::value,
        +
        123 typename kth_semantic_element_reference_type<ColorBase, K>::type
        +
        124 >::type
        +
        125{
        + +
        127}
        +
        +
        128
        +
        131template <int K, typename ColorBase>
        +
        132inline
        +
        +
        133auto semantic_at_c(ColorBase const& p)
        +
        134 -> typename kth_semantic_element_const_reference_type<ColorBase, K>::type
        +
        135{
        + +
        137}
        +
        +
        138
        +
        142
        +
        164template <typename ColorBase, typename Color>
        +
        + +
        166 : mp11::mp_contains<typename ColorBase::layout_t::color_space_t, Color>
        +
        167{};
        +
        +
        168
        +
        169template <typename ColorBase, typename Color>
        +
        170struct color_index_type : public detail::type_to_index<typename ColorBase::layout_t::color_space_t,Color> {};
        +
        171
        +
        174template <typename ColorBase, typename Color>
        +
        175struct color_element_type : public kth_semantic_element_type<ColorBase,color_index_type<ColorBase,Color>::value> {};
        +
        176
        +
        179template <typename ColorBase, typename Color>
        +
        180struct color_element_reference_type : public kth_semantic_element_reference_type<ColorBase,color_index_type<ColorBase,Color>::value> {};
        +
        181
        +
        184template <typename ColorBase, typename Color>
        +
        185struct color_element_const_reference_type : public kth_semantic_element_const_reference_type<ColorBase,color_index_type<ColorBase,Color>::value> {};
        +
        186
        +
        189template <typename ColorBase, typename Color>
        +
        +
        190auto get_color(ColorBase& cb, Color=Color())
        +
        191 -> typename color_element_reference_type<ColorBase,Color>::type
        +
        192{
        + +
        194}
        +
        +
        195
        +
        198template <typename ColorBase, typename Color>
        +
        +
        199auto get_color(const ColorBase& cb, Color=Color())
        +
        200 -> typename color_element_const_reference_type<ColorBase,Color>::type
        +
        201{
        + +
        203}
        +
        +
        204
        +
        210
        +
        224template <typename ColorBase>
        +
        225struct element_type : public kth_element_type<ColorBase, 0> {};
        +
        226
        +
        229template <typename ColorBase>
        +
        230struct element_reference_type : public kth_element_reference_type<ColorBase, 0> {};
        +
        231
        +
        234template <typename ColorBase>
        +
        235struct element_const_reference_type : public kth_element_const_reference_type<ColorBase, 0> {};
        +
        236
        +
        237
        +
        238namespace detail {
        +
        239
        +
        240// compile-time recursion for per-element operations on color bases
        +
        241template <int N>
        +
        242struct element_recursion
        +
        243{
        +
        244
        +
        245#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        246#pragma GCC diagnostic push
        +
        247#pragma GCC diagnostic ignored "-Wconversion"
        +
        248#pragma GCC diagnostic ignored "-Wfloat-equal"
        +
        249#endif
        +
        250
        +
        251 template <typename P1,typename P2>
        +
        252 static bool static_equal(const P1& p1, const P2& p2)
        +
        253 {
        +
        254 return element_recursion<N-1>::static_equal(p1,p2) &&
        +
        255 semantic_at_c<N-1>(p1)==semantic_at_c<N-1>(p2);
        +
        256 }
        +
        257
        +
        258 template <typename P1,typename P2>
        +
        259 static void static_copy(const P1& p1, P2& p2)
        +
        260 {
        +
        261 element_recursion<N-1>::static_copy(p1,p2);
        +
        262 semantic_at_c<N-1>(p2)=semantic_at_c<N-1>(p1);
        +
        263 }
        +
        264
        +
        265 template <typename P,typename T2>
        +
        266 static void static_fill(P& p, T2 v)
        +
        267 {
        +
        268 element_recursion<N-1>::static_fill(p,v);
        +
        269 semantic_at_c<N-1>(p)=v;
        +
        270 }
        +
        271
        +
        272 template <typename Dst,typename Op>
        +
        273 static void static_generate(Dst& dst, Op op)
        +
        274 {
        +
        275 element_recursion<N-1>::static_generate(dst,op);
        +
        276 semantic_at_c<N-1>(dst)=op();
        +
        277 }
        +
        278
        +
        279#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        280#pragma GCC diagnostic pop
        +
        281#endif
        +
        282
        +
        283 //static_for_each with one source
        +
        284 template <typename P1,typename Op>
        +
        285 static Op static_for_each(P1& p1, Op op) {
        +
        286 Op op2(element_recursion<N-1>::static_for_each(p1,op));
        +
        287 op2(semantic_at_c<N-1>(p1));
        +
        288 return op2;
        +
        289 }
        +
        290 template <typename P1,typename Op>
        +
        291 static Op static_for_each(const P1& p1, Op op) {
        +
        292 Op op2(element_recursion<N-1>::static_for_each(p1,op));
        +
        293 op2(semantic_at_c<N-1>(p1));
        +
        294 return op2;
        +
        295 }
        +
        296 //static_for_each with two sources
        +
        297 template <typename P1,typename P2,typename Op>
        +
        298 static Op static_for_each(P1& p1, P2& p2, Op op) {
        +
        299 Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
        +
        300 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
        +
        301 return op2;
        +
        302 }
        +
        303 template <typename P1,typename P2,typename Op>
        +
        304 static Op static_for_each(P1& p1, const P2& p2, Op op) {
        +
        305 Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
        +
        306 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
        +
        307 return op2;
        +
        308 }
        +
        309 template <typename P1,typename P2,typename Op>
        +
        310 static Op static_for_each(const P1& p1, P2& p2, Op op) {
        +
        311 Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
        +
        312 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
        +
        313 return op2;
        +
        314 }
        +
        315 template <typename P1,typename P2,typename Op>
        +
        316 static Op static_for_each(const P1& p1, const P2& p2, Op op) {
        +
        317 Op op2(element_recursion<N-1>::static_for_each(p1,p2,op));
        +
        318 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2));
        +
        319 return op2;
        +
        320 }
        +
        321 //static_for_each with three sources
        +
        322 template <typename P1,typename P2,typename P3,typename Op>
        +
        323 static Op static_for_each(P1& p1, P2& p2, P3& p3, Op op) {
        +
        324 Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        +
        325 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        +
        326 return op2;
        +
        327 }
        +
        328 template <typename P1,typename P2,typename P3,typename Op>
        +
        329 static Op static_for_each(P1& p1, P2& p2, const P3& p3, Op op) {
        +
        330 Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        +
        331 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        +
        332 return op2;
        +
        333 }
        +
        334 template <typename P1,typename P2,typename P3,typename Op>
        +
        335 static Op static_for_each(P1& p1, const P2& p2, P3& p3, Op op) {
        +
        336 Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        +
        337 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        +
        338 return op2;
        +
        339 }
        +
        340 template <typename P1,typename P2,typename P3,typename Op>
        +
        341 static Op static_for_each(P1& p1, const P2& p2, const P3& p3, Op op) {
        +
        342 Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        +
        343 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        +
        344 return op2;
        +
        345 }
        +
        346 template <typename P1,typename P2,typename P3,typename Op>
        +
        347 static Op static_for_each(const P1& p1, P2& p2, P3& p3, Op op) {
        +
        348 Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        +
        349 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        +
        350 return op2;
        +
        351 }
        +
        352 template <typename P1,typename P2,typename P3,typename Op>
        +
        353 static Op static_for_each(const P1& p1, P2& p2, const P3& p3, Op op) {
        +
        354 Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        +
        355 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        +
        356 return op2;
        +
        357 }
        +
        358 template <typename P1,typename P2,typename P3,typename Op>
        +
        359 static Op static_for_each(const P1& p1, const P2& p2, P3& p3, Op op) {
        +
        360 Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        +
        361 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        +
        362 return op2;
        +
        363 }
        +
        364 template <typename P1,typename P2,typename P3,typename Op>
        +
        365 static Op static_for_each(const P1& p1, const P2& p2, const P3& p3, Op op) {
        +
        366 Op op2(element_recursion<N-1>::static_for_each(p1,p2,p3,op));
        +
        367 op2(semantic_at_c<N-1>(p1), semantic_at_c<N-1>(p2), semantic_at_c<N-1>(p3));
        +
        368 return op2;
        +
        369 }
        +
        370 //static_transform with one source
        +
        371 template <typename P1,typename Dst,typename Op>
        +
        372 static Op static_transform(P1& src, Dst& dst, Op op) {
        +
        373 Op op2(element_recursion<N-1>::static_transform(src,dst,op));
        +
        374 semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
        +
        375 return op2;
        +
        376 }
        +
        377 template <typename P1,typename Dst,typename Op>
        +
        378 static Op static_transform(const P1& src, Dst& dst, Op op) {
        +
        379 Op op2(element_recursion<N-1>::static_transform(src,dst,op));
        +
        380 semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src));
        +
        381 return op2;
        +
        382 }
        +
        383 //static_transform with two sources
        +
        384 template <typename P1,typename P2,typename Dst,typename Op>
        +
        385 static Op static_transform(P1& src1, P2& src2, Dst& dst, Op op) {
        +
        386 Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
        +
        387 semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
        +
        388 return op2;
        +
        389 }
        +
        390 template <typename P1,typename P2,typename Dst,typename Op>
        +
        391 static Op static_transform(P1& src1, const P2& src2, Dst& dst, Op op) {
        +
        392 Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
        +
        393 semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
        +
        394 return op2;
        +
        395 }
        +
        396 template <typename P1,typename P2,typename Dst,typename Op>
        +
        397 static Op static_transform(const P1& src1, P2& src2, Dst& dst, Op op) {
        +
        398 Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
        +
        399 semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
        +
        400 return op2;
        +
        401 }
        +
        402 template <typename P1,typename P2,typename Dst,typename Op>
        +
        403 static Op static_transform(const P1& src1, const P2& src2, Dst& dst, Op op) {
        +
        404 Op op2(element_recursion<N-1>::static_transform(src1,src2,dst,op));
        +
        405 semantic_at_c<N-1>(dst)=op2(semantic_at_c<N-1>(src1), semantic_at_c<N-1>(src2));
        +
        406 return op2;
        +
        407 }
        +
        408};
        +
        409
        +
        410// Termination condition of the compile-time recursion for element operations on a color base
        +
        411template<> struct element_recursion<0> {
        +
        412 //static_equal
        +
        413 template <typename P1,typename P2>
        +
        414 static bool static_equal(const P1&, const P2&) { return true; }
        +
        415 //static_copy
        +
        416 template <typename P1,typename P2>
        +
        417 static void static_copy(const P1&, const P2&) {}
        +
        418 //static_fill
        +
        419 template <typename P, typename T2>
        +
        420 static void static_fill(const P&, T2) {}
        +
        421 //static_generate
        +
        422 template <typename Dst,typename Op>
        +
        423 static void static_generate(const Dst&,Op){}
        +
        424 //static_for_each with one source
        +
        425 template <typename P1,typename Op>
        +
        426 static Op static_for_each(const P1&,Op op){return op;}
        +
        427 //static_for_each with two sources
        +
        428 template <typename P1,typename P2,typename Op>
        +
        429 static Op static_for_each(const P1&,const P2&,Op op){return op;}
        +
        430 //static_for_each with three sources
        +
        431 template <typename P1,typename P2,typename P3,typename Op>
        +
        432 static Op static_for_each(const P1&,const P2&,const P3&,Op op){return op;}
        +
        433 //static_transform with one source
        +
        434 template <typename P1,typename Dst,typename Op>
        +
        435 static Op static_transform(const P1&,const Dst&,Op op){return op;}
        +
        436 //static_transform with two sources
        +
        437 template <typename P1,typename P2,typename Dst,typename Op>
        +
        438 static Op static_transform(const P1&,const P2&,const Dst&,Op op){return op;}
        +
        439};
        +
        440
        +
        441// std::min and std::max don't have the mutable overloads...
        +
        442template <typename Q>
        +
        443inline auto mutable_min(Q const& x, Q const& y) -> Q const& { return x<y ? x : y; }
        +
        444
        +
        445template <typename Q>
        +
        446inline auto mutable_min(Q& x, Q& y) -> Q& { return x<y ? x : y; }
        +
        447
        +
        448template <typename Q>
        +
        449inline auto mutable_max(Q const& x, Q const& y) -> Q const& { return x<y ? y : x; }
        +
        450
        +
        451template <typename Q>
        +
        452inline auto mutable_max(Q& x, Q& y) -> Q& { return x<y ? y : x; }
        +
        453
        +
        454
        +
        455// compile-time recursion for min/max element
        +
        456template <int N>
        +
        457struct min_max_recur
        +
        458{
        +
        459 template <typename P>
        +
        460 static auto max_(P const& p) -> typename element_const_reference_type<P>::type
        +
        461 {
        +
        462 return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
        +
        463 }
        +
        464
        +
        465 template <typename P>
        +
        466 static auto max_(P& p) -> typename element_reference_type<P>::type
        +
        467 {
        +
        468 return mutable_max(min_max_recur<N-1>::max_(p),semantic_at_c<N-1>(p));
        +
        469 }
        +
        470
        +
        471 template <typename P>
        +
        472 static auto min_(P const& p) -> typename element_const_reference_type<P>::type
        +
        473 {
        +
        474 return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
        +
        475 }
        +
        476
        +
        477 template <typename P>
        +
        478 static auto min_(P& p) -> typename element_reference_type<P>::type
        +
        479 {
        +
        480 return mutable_min(min_max_recur<N-1>::min_(p),semantic_at_c<N-1>(p));
        +
        481 }
        +
        482};
        +
        483
        +
        484// termination condition of the compile-time recursion for min/max element
        +
        485template <>
        +
        486struct min_max_recur<1>
        +
        487{
        +
        488 template <typename P>
        +
        489 static auto max_(P const& p) -> typename element_const_reference_type<P>::type { return semantic_at_c<0>(p); }
        +
        490
        +
        491 template <typename P>
        +
        492 static auto max_(P& p) -> typename element_reference_type<P>::type { return semantic_at_c<0>(p); }
        +
        493
        +
        494 template <typename P>
        +
        495 static auto min_(P const& p) -> typename element_const_reference_type<P>::type { return semantic_at_c<0>(p); }
        +
        496
        +
        497 template <typename P>
        +
        498 static auto min_(P& p) -> typename element_reference_type<P>::type { return semantic_at_c<0>(p); }
        +
        499};
        +
        500} // namespace detail
        +
        501
        +
        514
        +
        515template <typename P>
        +
        516BOOST_FORCEINLINE
        +
        517auto static_max(P const& p) -> typename element_const_reference_type<P>::type { return detail::min_max_recur<size<P>::value>::max_(p); }
        +
        518
        +
        519template <typename P>
        +
        520BOOST_FORCEINLINE
        +
        521auto static_max(P& p) -> typename element_reference_type<P>::type { return detail::min_max_recur<size<P>::value>::max_(p); }
        +
        522
        +
        523template <typename P>
        +
        524BOOST_FORCEINLINE
        +
        525auto static_min(P const& p) -> typename element_const_reference_type<P>::type { return detail::min_max_recur<size<P>::value>::min_(p); }
        +
        526
        +
        527template <typename P>
        +
        528BOOST_FORCEINLINE
        +
        529auto static_min(P& p) -> typename element_reference_type<P>::type { return detail::min_max_recur<size<P>::value>::min_(p); }
        +
        531
        +
        546
        +
        547template <typename P1,typename P2>
        +
        548BOOST_FORCEINLINE
        +
        549bool static_equal(P1 const& p1, const P2& p2) { return detail::element_recursion<size<P1>::value>::static_equal(p1,p2); }
        +
        550
        +
        552
        +
        567
        +
        568template <typename Src,typename Dst>
        +
        569BOOST_FORCEINLINE
        +
        570void static_copy(const Src& src, Dst& dst)
        +
        571{
        +
        572 detail::element_recursion<size<Dst>::value>::static_copy(src, dst);
        +
        573}
        +
        574
        +
        576
        +
        588
        +
        589template <typename P,typename V>
        +
        590BOOST_FORCEINLINE
        +
        591void static_fill(P& p, const V& v)
        +
        592{
        +
        593 detail::element_recursion<size<P>::value>::static_fill(p,v);
        +
        594}
        +
        595
        +
        597
        +
        616
        +
        617template <typename P1,typename Op>
        +
        618BOOST_FORCEINLINE
        +
        619void static_generate(P1& dst,Op op) { detail::element_recursion<size<P1>::value>::static_generate(dst,op); }
        +
        621
        +
        647
        +
        648//static_transform with one source
        +
        649template <typename Src,typename Dst,typename Op>
        +
        650BOOST_FORCEINLINE
        +
        651Op static_transform(Src& src,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(src,dst,op); }
        +
        652template <typename Src,typename Dst,typename Op>
        +
        653BOOST_FORCEINLINE
        +
        654Op static_transform(const Src& src,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(src,dst,op); }
        +
        655//static_transform with two sources
        +
        656template <typename P2,typename P3,typename Dst,typename Op>
        +
        657BOOST_FORCEINLINE
        +
        658Op static_transform(P2& p2,P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
        +
        659template <typename P2,typename P3,typename Dst,typename Op>
        +
        660BOOST_FORCEINLINE
        +
        661Op static_transform(P2& p2,const P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
        +
        662template <typename P2,typename P3,typename Dst,typename Op>
        +
        663BOOST_FORCEINLINE
        +
        664Op static_transform(const P2& p2,P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
        +
        665template <typename P2,typename P3,typename Dst,typename Op>
        +
        666BOOST_FORCEINLINE
        +
        667Op static_transform(const P2& p2,const P3& p3,Dst& dst,Op op) { return detail::element_recursion<size<Dst>::value>::static_transform(p2,p3,dst,op); }
        +
        669
        +
        694
        +
        695//static_for_each with one source
        +
        696template <typename P1,typename Op>
        +
        697BOOST_FORCEINLINE
        +
        698Op static_for_each( P1& p1, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,op); }
        +
        699template <typename P1,typename Op>
        +
        700BOOST_FORCEINLINE
        +
        701Op static_for_each(const P1& p1, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,op); }
        +
        702//static_for_each with two sources
        +
        703template <typename P1,typename P2,typename Op>
        +
        704BOOST_FORCEINLINE
        +
        705Op static_for_each(P1& p1, P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
        +
        706template <typename P1,typename P2,typename Op>
        +
        707BOOST_FORCEINLINE
        +
        708Op static_for_each(P1& p1,const P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
        +
        709template <typename P1,typename P2,typename Op>
        +
        710BOOST_FORCEINLINE
        +
        711Op static_for_each(const P1& p1, P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
        +
        712template <typename P1,typename P2,typename Op>
        +
        713BOOST_FORCEINLINE
        +
        714Op static_for_each(const P1& p1,const P2& p2, Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,op); }
        +
        715//static_for_each with three sources
        +
        716template <typename P1,typename P2,typename P3,typename Op>
        +
        717BOOST_FORCEINLINE
        +
        718Op static_for_each(P1& p1,P2& p2,P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        +
        719template <typename P1,typename P2,typename P3,typename Op>
        +
        720BOOST_FORCEINLINE
        +
        721Op static_for_each(P1& p1,P2& p2,const P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        +
        722template <typename P1,typename P2,typename P3,typename Op>
        +
        723BOOST_FORCEINLINE
        +
        724Op static_for_each(P1& p1,const P2& p2,P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        +
        725template <typename P1,typename P2,typename P3,typename Op>
        +
        726BOOST_FORCEINLINE
        +
        727Op static_for_each(P1& p1,const P2& p2,const P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        +
        728template <typename P1,typename P2,typename P3,typename Op>
        +
        729BOOST_FORCEINLINE
        +
        730Op static_for_each(const P1& p1,P2& p2,P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        +
        731template <typename P1,typename P2,typename P3,typename Op>
        +
        732BOOST_FORCEINLINE
        +
        733Op static_for_each(const P1& p1,P2& p2,const P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        +
        734template <typename P1,typename P2,typename P3,typename Op>
        +
        735BOOST_FORCEINLINE
        +
        736Op static_for_each(const P1& p1,const P2& p2,P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        +
        737template <typename P1,typename P2,typename P3,typename Op>
        +
        738BOOST_FORCEINLINE
        +
        739Op static_for_each(const P1& p1,const P2& p2,const P3& p3,Op op) { return detail::element_recursion<size<P1>::value>::static_for_each(p1,p2,p3,op); }
        +
        741
        +
        742}} // namespace boost::gil
        +
        743
        +
        744#endif
        +
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition color_base_algorithm.hpp:190
        +
        auto semantic_at_c(ColorBase &p) -> typename std::enable_if< !std::is_const< ColorBase >::value, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type
        A mutable accessor to the K-th semantic element of a color base.
        Definition color_base_algorithm.hpp:119
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Specifies the return type of the constant element accessor by color name, get_color(color_base,...
        Definition color_base_algorithm.hpp:185
        +
        Specifies the return type of the mutable element accessor by color name, get_color(color_base,...
        Definition color_base_algorithm.hpp:180
        +
        Specifies the type of the element associated with a given color tag.
        Definition color_base_algorithm.hpp:175
        +
        A predicate metafunction determining whether a given color base contains a given color.
        Definition color_base_algorithm.hpp:167
        +
        Returns the index corresponding to the first occurrence of a given given type in.
        Definition utilities.hpp:251
        +
        Specifies the return type of the constant element accessor at_c of a homogeneous color base.
        Definition color_base_algorithm.hpp:235
        +
        Specifies the return type of the mutable element accessor at_c of a homogeneous color base.
        Definition color_base_algorithm.hpp:230
        +
        Specifies the element type of a homogeneous color base.
        Definition color_base_algorithm.hpp:225
        +
        Specifies the return type of the constant semantic_at_c<K>(color_base);.
        Definition color_base_algorithm.hpp:105
        +
        Specifies the return type of the mutable semantic_at_c<K>(color_base);.
        Definition color_base_algorithm.hpp:91
        +
        Specifies the type of the K-th semantic element of a color base.
        Definition color_base_algorithm.hpp:78
        +
        Returns an integral constant type specifying the number of elements in a color base.
        Definition color_base_algorithm.hpp:42
        diff --git a/html/reference/color__convert_8hpp_source.html b/html/reference/color__convert_8hpp_source.html index c23bf1bc9..5b3faf30c 100644 --- a/html/reference/color__convert_8hpp_source.html +++ b/html/reference/color__convert_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_convert.hpp Source File @@ -27,339 +27,372 @@

        - + +/* @license-end */ + +
        -
        -
        color_convert.hpp
        +
        color_convert.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_COLOR_CONVERT_HPP
        -
        9 #define BOOST_GIL_COLOR_CONVERT_HPP
        -
        10 
        -
        11 #include <boost/gil/channel_algorithm.hpp>
        -
        12 #include <boost/gil/cmyk.hpp>
        -
        13 #include <boost/gil/color_base_algorithm.hpp>
        -
        14 #include <boost/gil/gray.hpp>
        -
        15 #include <boost/gil/metafunctions.hpp>
        -
        16 #include <boost/gil/pixel.hpp>
        -
        17 #include <boost/gil/rgb.hpp>
        -
        18 #include <boost/gil/rgba.hpp>
        -
        19 #include <boost/gil/utilities.hpp>
        -
        20 
        -
        21 #include <algorithm>
        -
        22 #include <functional>
        -
        23 #include <type_traits>
        -
        24 
        -
        25 namespace boost { namespace gil {
        -
        26 
        -
        29 
        -
        30 // Forward-declare
        -
        31 template <typename P> struct channel_type;
        -
        32 
        -
        38 
        -
        41 template <typename C1, typename C2>
        - -
        43 {
        -
        44  static_assert(
        -
        45  std::is_same<C1, C2>::value,
        -
        46  "default_color_converter_impl not specialized for given color spaces");
        -
        47 };
        -
        48 
        -
        51 template <typename C>
        - -
        53  template <typename P1, typename P2>
        -
        54  void operator()(const P1& src, P2& dst) const {
        -
        55  static_for_each(src,dst,default_channel_converter());
        -
        56  }
        -
        57 };
        -
        58 
        -
        59 namespace detail {
        -
        60 
        -
        62 
        -
        63 // The default implementation of to_luminance uses float0..1 as the intermediate channel type
        -
        64 template <typename RedChannel, typename GreenChannel, typename BlueChannel, typename GrayChannelValue>
        - -
        66  auto operator()(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) const -> GrayChannelValue
        -
        67  {
        -
        68  return channel_convert<GrayChannelValue>(float32_t(
        -
        69  channel_convert<float32_t>(red )*0.30f +
        -
        70  channel_convert<float32_t>(green)*0.59f +
        -
        71  channel_convert<float32_t>(blue )*0.11f) );
        -
        72  }
        -
        73 };
        -
        74 
        -
        75 // performance specialization for unsigned char
        -
        76 template <typename GrayChannelValue>
        -
        77 struct rgb_to_luminance_fn<uint8_t,uint8_t,uint8_t, GrayChannelValue> {
        -
        78  auto operator()(uint8_t red, uint8_t green, uint8_t blue) const -> GrayChannelValue
        -
        79  {
        -
        80  return channel_convert<GrayChannelValue>(uint8_t(
        -
        81  ((uint32_t(red )*4915 + uint32_t(green)*9667 + uint32_t(blue )*1802) + 8192) >> 14));
        -
        82  }
        -
        83 };
        -
        84 
        -
        85 template <typename GrayChannel, typename RedChannel, typename GreenChannel, typename BlueChannel>
        -
        86 auto rgb_to_luminance(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) -> typename channel_traits<GrayChannel>::value_type
        -
        87 {
        -
        88  return rgb_to_luminance_fn<RedChannel,GreenChannel,BlueChannel,
        -
        89  typename channel_traits<GrayChannel>::value_type>()(red,green,blue);
        -
        90 }
        -
        91 
        -
        92 } // namespace detail
        -
        93 
        -
        96 template <>
        -
        97 struct default_color_converter_impl<gray_t,rgb_t> {
        -
        98  template <typename P1, typename P2>
        -
        99  void operator()(const P1& src, P2& dst) const {
        -
        100  get_color(dst,red_t()) =
        -
        101  channel_convert<typename color_element_type<P2, red_t >::type>(get_color(src,gray_color_t()));
        -
        102  get_color(dst,green_t())=
        -
        103  channel_convert<typename color_element_type<P2, green_t>::type>(get_color(src,gray_color_t()));
        -
        104  get_color(dst,blue_t()) =
        -
        105  channel_convert<typename color_element_type<P2, blue_t >::type>(get_color(src,gray_color_t()));
        -
        106  }
        -
        107 };
        -
        108 
        -
        113 template <>
        -
        114 struct default_color_converter_impl<gray_t,cmyk_t> {
        -
        115  template <typename P1, typename P2>
        -
        116  void operator()(const P1& src, P2& dst) const {
        -
        117  get_color(dst,cyan_t())=
        -
        118  channel_traits<typename color_element_type<P2, cyan_t >::type>::min_value();
        -
        119  get_color(dst,magenta_t())=
        -
        120  channel_traits<typename color_element_type<P2, magenta_t>::type>::min_value();
        -
        121  get_color(dst,yellow_t())=
        -
        122  channel_traits<typename color_element_type<P2, yellow_t >::type>::min_value();
        -
        123  get_color(dst,black_t())=
        -
        124  channel_convert<typename color_element_type<P2, black_t >::type>(get_color(src,gray_color_t()));
        -
        125  }
        -
        126 };
        -
        127 
        -
        130 template <>
        -
        131 struct default_color_converter_impl<rgb_t,gray_t> {
        -
        132  template <typename P1, typename P2>
        -
        133  void operator()(const P1& src, P2& dst) const {
        -
        134  get_color(dst,gray_color_t()) =
        -
        135  detail::rgb_to_luminance<typename color_element_type<P2,gray_color_t>::type>(
        -
        136  get_color(src,red_t()), get_color(src,green_t()), get_color(src,blue_t())
        -
        137  );
        -
        138  }
        -
        139 };
        -
        140 
        -
        141 
        -
        156 template <>
        -
        157 struct default_color_converter_impl<rgb_t, cmyk_t>
        -
        158 {
        -
        159  template <typename SrcPixel, typename DstPixel>
        -
        160  void operator()(SrcPixel const& src, DstPixel& dst) const
        -
        161  {
        -
        162  using src_t = typename channel_type<SrcPixel>::type;
        -
        163  src_t const r = get_color(src, red_t());
        -
        164  src_t const g = get_color(src, green_t());
        -
        165  src_t const b = get_color(src, blue_t());
        -
        166 
        -
        167  using uint_t = typename channel_type<cmyk8_pixel_t>::type;
        -
        168  uint_t c = channel_invert(channel_convert<uint_t>(r)); // c = 1 - r
        -
        169  uint_t m = channel_invert(channel_convert<uint_t>(g)); // m = 1 - g
        -
        170  uint_t y = channel_invert(channel_convert<uint_t>(b)); // y = 1 - b
        -
        171  uint_t k = (std::min)(c,(std::min)(m,y)); // k = minimum(c, m, y)
        -
        172 
        -
        173  // Apply color correction, strengthening, reducing non-zero components by
        -
        174  // s = 1 / (1 - k) for k < 1, where 1 denotes dst_t max, otherwise s = 1 (literal).
        -
        175  uint_t const dst_max = channel_traits<uint_t>::max_value();
        -
        176  uint_t const s_div = static_cast<uint_t>(dst_max - k);
        -
        177  if (s_div != 0)
        -
        178  {
        -
        179  double const s = dst_max / static_cast<double>(s_div);
        -
        180  c = static_cast<uint_t>((c - k) * s);
        -
        181  m = static_cast<uint_t>((m - k) * s);
        -
        182  y = static_cast<uint_t>((y - k) * s);
        -
        183  }
        -
        184  else
        -
        185  {
        -
        186  // Black only for k = 1 (max of dst_t)
        -
        187  c = channel_traits<uint_t>::min_value();
        -
        188  m = channel_traits<uint_t>::min_value();
        -
        189  y = channel_traits<uint_t>::min_value();
        -
        190  }
        -
        191  using dst_t = typename channel_type<DstPixel>::type;
        -
        192  get_color(dst, cyan_t()) = channel_convert<dst_t>(c);
        -
        193  get_color(dst, magenta_t()) = channel_convert<dst_t>(m);
        -
        194  get_color(dst, yellow_t()) = channel_convert<dst_t>(y);
        -
        195  get_color(dst, black_t()) = channel_convert<dst_t>(k);
        -
        196  }
        -
        197 };
        -
        198 
        -
        199 
        -
        206 template <>
        -
        207 struct default_color_converter_impl<cmyk_t,rgb_t> {
        -
        208  template <typename P1, typename P2>
        -
        209  void operator()(const P1& src, P2& dst) const {
        -
        210  using T1 = typename channel_type<P1>::type;
        -
        211  get_color(dst,red_t()) =
        -
        212  channel_convert<typename color_element_type<P2,red_t>::type>(
        -
        213  channel_invert<T1>(
        -
        214  (std::min)(channel_traits<T1>::max_value(),
        - -
        216  get_color(dst,green_t())=
        -
        217  channel_convert<typename color_element_type<P2,green_t>::type>(
        -
        218  channel_invert<T1>(
        -
        219  (std::min)(channel_traits<T1>::max_value(),
        - -
        221  get_color(dst,blue_t()) =
        -
        222  channel_convert<typename color_element_type<P2,blue_t>::type>(
        -
        223  channel_invert<T1>(
        -
        224  (std::min)(channel_traits<T1>::max_value(),
        - -
        226  }
        -
        227 };
        -
        228 
        -
        229 
        -
        234 template <>
        -
        235 struct default_color_converter_impl<cmyk_t,gray_t> {
        -
        236  template <typename P1, typename P2>
        -
        237  void operator()(const P1& src, P2& dst) const {
        -
        238  get_color(dst,gray_color_t())=
        -
        239  channel_convert<typename color_element_type<P2,gray_color_t>::type>(
        - - -
        242  detail::rgb_to_luminance<typename color_element_type<P1,black_t>::type>(
        -
        243  get_color(src,cyan_t()),
        -
        244  get_color(src,magenta_t()),
        -
        245  get_color(src,yellow_t())
        -
        246  )
        -
        247  ),
        -
        248  channel_invert(get_color(src,black_t()))));
        -
        249  }
        -
        250 };
        -
        251 
        -
        252 namespace detail {
        -
        253 
        -
        254 template <typename Pixel>
        -
        255 auto alpha_or_max_impl(Pixel const& p, std::true_type) -> typename channel_type<Pixel>::type
        -
        256 {
        -
        257  return get_color(p,alpha_t());
        -
        258 }
        -
        259 template <typename Pixel>
        -
        260 auto alpha_or_max_impl(Pixel const&, std::false_type) -> typename channel_type<Pixel>::type
        -
        261 {
        -
        262  return channel_traits<typename channel_type<Pixel>::type>::max_value();
        -
        263 }
        -
        264 
        -
        265 } // namespace detail
        -
        266 
        -
        267 // Returns max_value if the pixel has no alpha channel. Otherwise returns the alpha.
        -
        268 template <typename Pixel>
        -
        269 auto alpha_or_max(Pixel const& p) -> typename channel_type<Pixel>::type
        -
        270 {
        -
        271  return detail::alpha_or_max_impl(
        -
        272  p,
        -
        273  mp11::mp_contains<typename color_space_type<Pixel>::type, alpha_t>());
        -
        274 }
        -
        275 
        -
        276 
        -
        279 template <typename C1>
        -
        280 struct default_color_converter_impl<C1,rgba_t> {
        -
        281  template <typename P1, typename P2>
        -
        282  void operator()(const P1& src, P2& dst) const {
        -
        283  using T2 = typename channel_type<P2>::type;
        - - -
        286  get_color(dst,red_t()) =get_color(tmp,red_t());
        -
        287  get_color(dst,green_t())=get_color(tmp,green_t());
        -
        288  get_color(dst,blue_t()) =get_color(tmp,blue_t());
        -
        289  get_color(dst,alpha_t())=channel_convert<T2>(alpha_or_max(src));
        -
        290  }
        -
        291 };
        -
        292 
        -
        299 template <typename C2>
        -
        300 struct default_color_converter_impl<rgba_t,C2> {
        -
        301  template <typename P1, typename P2>
        -
        302  void operator()(const P1& src, P2& dst) const {
        -
        303  using T1 = typename channel_type<P1>::type;
        - - - - -
        308  ,dst);
        -
        309  }
        -
        310 };
        -
        311 
        -
        314 template <>
        -
        315 struct default_color_converter_impl<rgba_t,rgba_t> {
        -
        316  template <typename P1, typename P2>
        -
        317  void operator()(const P1& src, P2& dst) const {
        -
        318  static_for_each(src,dst,default_channel_converter());
        -
        319  }
        -
        320 };
        -
        321 
        -
        325 
        - -
        329  template <typename SrcP, typename DstP>
        -
        330  void operator()(const SrcP& src,DstP& dst) const {
        -
        331  using SrcColorSpace = typename color_space_type<SrcP>::type;
        -
        332  using DstColorSpace = typename color_space_type<DstP>::type;
        - -
        334  }
        -
        335 };
        -
        336 
        -
        341 template <typename SrcP, typename DstP>
        -
        342 inline void color_convert(const SrcP& src, DstP& dst) {
        -
        343  default_color_converter()(src,dst);
        -
        344 }
        -
        345 
        -
        346 } } // namespace boost::gil
        -
        347 
        -
        348 #endif
        -
        auto channel_invert(Channel x) -> typename channel_traits< Channel >::value_type
        Default implementation. Provide overloads for performance.
        Definition: channel_algorithm.hpp:582
        -
        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
        -
        auto channel_multiply(Channel a, Channel b) -> typename channel_traits< Channel >::value_type
        A function multiplying two channels. result = a * b / max_value.
        Definition: channel_algorithm.hpp:561
        -
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition: color_base_algorithm.hpp:190
        -
        void color_convert(const SrcP &src, DstP &dst)
        helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
        Definition: color_convert.hpp:342
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Alpha.
        Definition: rgba.hpp:22
        -
        Black.
        Definition: cmyk.hpp:31
        -
        Blue.
        Definition: rgb.hpp:30
        -
        Definition: color_convert.hpp:31
        -
        Cyan.
        Definition: cmyk.hpp:22
        -
        Same as channel_converter, except it takes the destination channel by reference, which allows us to m...
        Definition: channel_algorithm.hpp:471
        -
        Color Convertion function object. To be specialized for every src/dst color space.
        Definition: color_convert.hpp:43
        -
        class for color-converting one pixel to another
        Definition: color_convert.hpp:328
        -
        red * .3 + green * .59 + blue * .11 + .5
        Definition: color_convert.hpp:65
        -
        Gray.
        Definition: gray.hpp:18
        -
        Green.
        Definition: rgb.hpp:27
        -
        Magenta.
        Definition: cmyk.hpp:25
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: pixel.hpp:106
        -
        Red.
        Definition: rgb.hpp:24
        -
        Yellow.
        Definition: cmyk.hpp:28
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_COLOR_CONVERT_HPP
        +
        9#define BOOST_GIL_COLOR_CONVERT_HPP
        +
        10
        +
        11#include <boost/gil/channel_algorithm.hpp>
        +
        12#include <boost/gil/cmyk.hpp>
        +
        13#include <boost/gil/color_base_algorithm.hpp>
        +
        14#include <boost/gil/gray.hpp>
        +
        15#include <boost/gil/metafunctions.hpp>
        +
        16#include <boost/gil/pixel.hpp>
        +
        17#include <boost/gil/rgb.hpp>
        +
        18#include <boost/gil/rgba.hpp>
        +
        19#include <boost/gil/utilities.hpp>
        +
        20
        +
        21#include <algorithm>
        +
        22#include <functional>
        +
        23#include <type_traits>
        +
        24
        +
        25namespace boost { namespace gil {
        +
        26
        +
        29
        +
        30// Forward-declare
        +
        31template <typename P> struct channel_type;
        +
        32
        +
        38
        +
        41template <typename C1, typename C2>
        +
        + +
        43{
        +
        44 static_assert(
        +
        45 std::is_same<C1, C2>::value,
        +
        46 "default_color_converter_impl not specialized for given color spaces");
        +
        47};
        +
        +
        48
        +
        51template <typename C>
        +
        + +
        53 template <typename P1, typename P2>
        +
        54 void operator()(const P1& src, P2& dst) const {
        +
        55 static_for_each(src,dst,default_channel_converter());
        +
        56 }
        +
        57};
        +
        +
        58
        +
        59namespace detail {
        +
        60
        +
        62
        +
        63// The default implementation of to_luminance uses float0..1 as the intermediate channel type
        +
        64template <typename RedChannel, typename GreenChannel, typename BlueChannel, typename GrayChannelValue>
        +
        + +
        66 auto operator()(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) const -> GrayChannelValue
        +
        67 {
        +
        68 return channel_convert<GrayChannelValue>(float32_t(
        +
        69 channel_convert<float32_t>(red )*0.30f +
        +
        70 channel_convert<float32_t>(green)*0.59f +
        +
        71 channel_convert<float32_t>(blue )*0.11f) );
        +
        72 }
        +
        73};
        +
        +
        74
        +
        75// performance specialization for unsigned char
        +
        76template <typename GrayChannelValue>
        +
        77struct rgb_to_luminance_fn<uint8_t,uint8_t,uint8_t, GrayChannelValue> {
        +
        78 auto operator()(uint8_t red, uint8_t green, uint8_t blue) const -> GrayChannelValue
        +
        79 {
        +
        80 return channel_convert<GrayChannelValue>(uint8_t(
        +
        81 ((uint32_t(red )*4915 + uint32_t(green)*9667 + uint32_t(blue )*1802) + 8192) >> 14));
        +
        82 }
        +
        83};
        +
        84
        +
        85template <typename GrayChannel, typename RedChannel, typename GreenChannel, typename BlueChannel>
        +
        86auto rgb_to_luminance(const RedChannel& red, const GreenChannel& green, const BlueChannel& blue) -> typename channel_traits<GrayChannel>::value_type
        +
        87{
        +
        88 return rgb_to_luminance_fn<RedChannel,GreenChannel,BlueChannel,
        +
        89 typename channel_traits<GrayChannel>::value_type>()(red,green,blue);
        +
        90}
        +
        91
        +
        92} // namespace detail
        +
        93
        +
        96template <>
        +
        +
        97struct default_color_converter_impl<gray_t,rgb_t> {
        +
        98 template <typename P1, typename P2>
        +
        99 void operator()(const P1& src, P2& dst) const {
        +
        100 get_color(dst,red_t()) =
        +
        101 channel_convert<typename color_element_type<P2, red_t >::type>(get_color(src,gray_color_t()));
        +
        102 get_color(dst,green_t())=
        +
        103 channel_convert<typename color_element_type<P2, green_t>::type>(get_color(src,gray_color_t()));
        +
        104 get_color(dst,blue_t()) =
        +
        105 channel_convert<typename color_element_type<P2, blue_t >::type>(get_color(src,gray_color_t()));
        +
        106 }
        +
        107};
        +
        +
        108
        +
        113template <>
        +
        +
        114struct default_color_converter_impl<gray_t,cmyk_t> {
        +
        115 template <typename P1, typename P2>
        +
        116 void operator()(const P1& src, P2& dst) const {
        +
        117 get_color(dst,cyan_t())=
        +
        118 channel_traits<typename color_element_type<P2, cyan_t >::type>::min_value();
        +
        119 get_color(dst,magenta_t())=
        +
        120 channel_traits<typename color_element_type<P2, magenta_t>::type>::min_value();
        +
        121 get_color(dst,yellow_t())=
        +
        122 channel_traits<typename color_element_type<P2, yellow_t >::type>::min_value();
        +
        123 get_color(dst,black_t())=
        +
        124 channel_convert<typename color_element_type<P2, black_t >::type>(get_color(src,gray_color_t()));
        +
        125 }
        +
        126};
        +
        +
        127
        +
        130template <>
        +
        +
        131struct default_color_converter_impl<rgb_t,gray_t> {
        +
        132 template <typename P1, typename P2>
        +
        133 void operator()(const P1& src, P2& dst) const {
        +
        134 get_color(dst,gray_color_t()) =
        +
        135 detail::rgb_to_luminance<typename color_element_type<P2,gray_color_t>::type>(
        +
        136 get_color(src,red_t()), get_color(src,green_t()), get_color(src,blue_t())
        +
        137 );
        +
        138 }
        +
        139};
        +
        +
        140
        +
        141
        +
        156template <>
        +
        +
        157struct default_color_converter_impl<rgb_t, cmyk_t>
        +
        158{
        +
        159 template <typename SrcPixel, typename DstPixel>
        +
        160 void operator()(SrcPixel const& src, DstPixel& dst) const
        +
        161 {
        +
        162 using src_t = typename channel_type<SrcPixel>::type;
        +
        163 src_t const r = get_color(src, red_t());
        +
        164 src_t const g = get_color(src, green_t());
        +
        165 src_t const b = get_color(src, blue_t());
        +
        166
        +
        167 using uint_t = typename channel_type<cmyk8_pixel_t>::type;
        +
        168 uint_t c = channel_invert(channel_convert<uint_t>(r)); // c = 1 - r
        +
        169 uint_t m = channel_invert(channel_convert<uint_t>(g)); // m = 1 - g
        +
        170 uint_t y = channel_invert(channel_convert<uint_t>(b)); // y = 1 - b
        +
        171 uint_t k = (std::min)(c,(std::min)(m,y)); // k = minimum(c, m, y)
        +
        172
        +
        173 // Apply color correction, strengthening, reducing non-zero components by
        +
        174 // s = 1 / (1 - k) for k < 1, where 1 denotes dst_t max, otherwise s = 1 (literal).
        +
        175 uint_t const dst_max = channel_traits<uint_t>::max_value();
        +
        176 uint_t const s_div = static_cast<uint_t>(dst_max - k);
        +
        177 if (s_div != 0)
        +
        178 {
        +
        179 double const s = dst_max / static_cast<double>(s_div);
        +
        180 c = static_cast<uint_t>((c - k) * s);
        +
        181 m = static_cast<uint_t>((m - k) * s);
        +
        182 y = static_cast<uint_t>((y - k) * s);
        +
        183 }
        +
        184 else
        +
        185 {
        +
        186 // Black only for k = 1 (max of dst_t)
        +
        187 c = channel_traits<uint_t>::min_value();
        +
        188 m = channel_traits<uint_t>::min_value();
        +
        189 y = channel_traits<uint_t>::min_value();
        +
        190 }
        +
        191 using dst_t = typename channel_type<DstPixel>::type;
        +
        192 get_color(dst, cyan_t()) = channel_convert<dst_t>(c);
        +
        193 get_color(dst, magenta_t()) = channel_convert<dst_t>(m);
        +
        194 get_color(dst, yellow_t()) = channel_convert<dst_t>(y);
        +
        195 get_color(dst, black_t()) = channel_convert<dst_t>(k);
        +
        196 }
        +
        197};
        +
        +
        198
        +
        199
        +
        206template <>
        +
        +
        207struct default_color_converter_impl<cmyk_t,rgb_t> {
        +
        208 template <typename P1, typename P2>
        +
        209 void operator()(const P1& src, P2& dst) const {
        +
        210 using T1 = typename channel_type<P1>::type;
        +
        211 get_color(dst,red_t()) =
        +
        212 channel_convert<typename color_element_type<P2,red_t>::type>(
        +
        213 channel_invert<T1>(
        +
        214 (std::min)(channel_traits<T1>::max_value(),
        + +
        216 get_color(dst,green_t())=
        +
        217 channel_convert<typename color_element_type<P2,green_t>::type>(
        +
        218 channel_invert<T1>(
        +
        219 (std::min)(channel_traits<T1>::max_value(),
        + +
        221 get_color(dst,blue_t()) =
        +
        222 channel_convert<typename color_element_type<P2,blue_t>::type>(
        +
        223 channel_invert<T1>(
        +
        224 (std::min)(channel_traits<T1>::max_value(),
        + +
        226 }
        +
        227};
        +
        +
        228
        +
        229
        +
        234template <>
        +
        +
        235struct default_color_converter_impl<cmyk_t,gray_t> {
        +
        236 template <typename P1, typename P2>
        +
        237 void operator()(const P1& src, P2& dst) const {
        +
        238 get_color(dst,gray_color_t())=
        +
        239 channel_convert<typename color_element_type<P2,gray_color_t>::type>(
        + + +
        242 detail::rgb_to_luminance<typename color_element_type<P1,black_t>::type>(
        +
        243 get_color(src,cyan_t()),
        +
        244 get_color(src,magenta_t()),
        +
        245 get_color(src,yellow_t())
        +
        246 )
        +
        247 ),
        + +
        249 }
        +
        250};
        +
        +
        251
        +
        252namespace detail {
        +
        253
        +
        254template <typename Pixel>
        +
        255auto alpha_or_max_impl(Pixel const& p, std::true_type) -> typename channel_type<Pixel>::type
        +
        256{
        +
        257 return get_color(p,alpha_t());
        +
        258}
        +
        259template <typename Pixel>
        +
        260auto alpha_or_max_impl(Pixel const&, std::false_type) -> typename channel_type<Pixel>::type
        +
        261{
        +
        262 return channel_traits<typename channel_type<Pixel>::type>::max_value();
        +
        263}
        +
        264
        +
        265} // namespace detail
        +
        266
        +
        267// Returns max_value if the pixel has no alpha channel. Otherwise returns the alpha.
        +
        268template <typename Pixel>
        +
        269auto alpha_or_max(Pixel const& p) -> typename channel_type<Pixel>::type
        +
        270{
        +
        271 return detail::alpha_or_max_impl(
        +
        272 p,
        +
        273 mp11::mp_contains<typename color_space_type<Pixel>::type, alpha_t>());
        +
        274}
        +
        275
        +
        276
        +
        279template <typename C1>
        +
        + +
        281 template <typename P1, typename P2>
        +
        282 void operator()(const P1& src, P2& dst) const {
        +
        283 using T2 = typename channel_type<P2>::type;
        + + +
        286 get_color(dst,red_t()) =get_color(tmp,red_t());
        +
        287 get_color(dst,green_t())=get_color(tmp,green_t());
        +
        288 get_color(dst,blue_t()) =get_color(tmp,blue_t());
        +
        289 get_color(dst,alpha_t())=channel_convert<T2>(alpha_or_max(src));
        +
        290 }
        +
        291};
        +
        +
        292
        +
        299template <typename C2>
        +
        + +
        301 template <typename P1, typename P2>
        +
        302 void operator()(const P1& src, P2& dst) const {
        +
        303 using T1 = typename channel_type<P1>::type;
        + + + + +
        308 ,dst);
        +
        309 }
        +
        310};
        +
        +
        311
        +
        314template <>
        +
        +
        315struct default_color_converter_impl<rgba_t,rgba_t> {
        +
        316 template <typename P1, typename P2>
        +
        317 void operator()(const P1& src, P2& dst) const {
        +
        318 static_for_each(src,dst,default_channel_converter());
        +
        319 }
        +
        320};
        +
        +
        321
        +
        325
        +
        + +
        329 template <typename SrcP, typename DstP>
        +
        330 void operator()(const SrcP& src,DstP& dst) const {
        +
        331 using SrcColorSpace = typename color_space_type<SrcP>::type;
        +
        332 using DstColorSpace = typename color_space_type<DstP>::type;
        + +
        334 }
        +
        335};
        +
        +
        336
        +
        341template <typename SrcP, typename DstP>
        +
        +
        342inline void color_convert(const SrcP& src, DstP& dst) {
        +
        343 default_color_converter()(src,dst);
        +
        344}
        +
        +
        345
        +
        346} } // namespace boost::gil
        +
        347
        +
        348#endif
        +
        auto channel_invert(Channel x) -> typename channel_traits< Channel >::value_type
        Default implementation. Provide overloads for performance.
        Definition channel_algorithm.hpp:582
        +
        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
        +
        auto channel_multiply(Channel a, Channel b) -> typename channel_traits< Channel >::value_type
        A function multiplying two channels. result = a * b / max_value.
        Definition channel_algorithm.hpp:561
        +
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition color_base_algorithm.hpp:190
        +
        void color_convert(const SrcP &src, DstP &dst)
        helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
        Definition color_convert.hpp:342
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Alpha.
        Definition rgba.hpp:22
        +
        Black.
        Definition cmyk.hpp:31
        +
        Blue.
        Definition rgb.hpp:30
        +
        Definition color_convert.hpp:31
        +
        Cyan.
        Definition cmyk.hpp:22
        +
        Same as channel_converter, except it takes the destination channel by reference, which allows us to m...
        Definition channel_algorithm.hpp:471
        +
        Color Conversion function object. To be specialized for every src/dst color space.
        Definition color_convert.hpp:43
        +
        class for color-converting one pixel to another
        Definition color_convert.hpp:328
        +
        red * .3 + green * .59 + blue * .11 + .5
        Definition color_convert.hpp:65
        +
        Gray.
        Definition gray.hpp:18
        +
        Green.
        Definition rgb.hpp:27
        +
        Magenta.
        Definition cmyk.hpp:25
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition pixel.hpp:106
        +
        Red.
        Definition rgb.hpp:24
        +
        Yellow.
        Definition cmyk.hpp:28
        diff --git a/html/reference/concept__check_8hpp_source.html b/html/reference/concept__check_8hpp_source.html index 4dd34cdb2..fb9858dc9 100644 --- a/html/reference/concept__check_8hpp_source.html +++ b/html/reference/concept__check_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: concept_check.hpp Source File @@ -27,94 +27,99 @@

        - + +/* @license-end */ + +
        -
        -
        concept_check.hpp
        +
        concept_check.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
        -
        10 
        -
        11 #include <boost/config.hpp>
        -
        12 
        -
        13 #if defined(BOOST_CLANG)
        -
        14 #pragma clang diagnostic push
        -
        15 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        16 #pragma clang diagnostic ignored "-Wconversion"
        -
        17 #pragma clang diagnostic ignored "-Wfloat-equal"
        -
        18 #pragma clang diagnostic ignored "-Wuninitialized"
        -
        19 #endif
        -
        20 
        -
        21 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        22 #pragma GCC diagnostic push
        -
        23 #pragma GCC diagnostic ignored "-Wconversion"
        -
        24 #pragma GCC diagnostic ignored "-Wfloat-equal"
        -
        25 #pragma GCC diagnostic ignored "-Wuninitialized"
        -
        26 #endif
        -
        27 
        -
        28 #include <boost/concept_check.hpp>
        -
        29 
        -
        30 #if defined(BOOST_CLANG)
        -
        31 #pragma clang diagnostic pop
        -
        32 #endif
        -
        33 
        -
        34 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        35 #pragma GCC diagnostic pop
        -
        36 #endif
        -
        37 
        -
        38 // TODO: Document BOOST_GIL_USE_CONCEPT_CHECK here
        -
        39 
        -
        40 namespace boost { namespace gil {
        -
        41 
        -
        42 // TODO: What is BOOST_GIL_CLASS_REQUIRE for; Why not use BOOST_CLASS_REQUIRE?
        -
        43 // TODO: What is gil_function_requires for; Why not function_requires?
        -
        44 
        -
        45 #ifdef BOOST_GIL_USE_CONCEPT_CHECK
        -
        46  #define BOOST_GIL_CLASS_REQUIRE(type_var, ns, concept) \
        -
        47  BOOST_CLASS_REQUIRE(type_var, ns, concept);
        -
        48 
        -
        49  template <typename Concept>
        -
        50  void gil_function_requires() { function_requires<Concept>(); }
        -
        51 #else
        -
        52  #define BOOST_GIL_CLASS_REQUIRE(type_var, ns, concept)
        -
        53 
        -
        54  template <typename C>
        -
        55  void gil_function_requires() {}
        -
        56 #endif
        -
        57 
        -
        58 }} // namespace boost::gil:
        -
        59 
        -
        60 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
        +
        9#define BOOST_GIL_CONCEPTS_CONCEPTS_CHECK_HPP
        +
        10
        +
        11#include <boost/config.hpp>
        +
        12
        +
        13#if defined(BOOST_CLANG)
        +
        14#pragma clang diagnostic push
        +
        15#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        16#pragma clang diagnostic ignored "-Wconversion"
        +
        17#pragma clang diagnostic ignored "-Wfloat-equal"
        +
        18#pragma clang diagnostic ignored "-Wuninitialized"
        +
        19#endif
        +
        20
        +
        21#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        22#pragma GCC diagnostic push
        +
        23#pragma GCC diagnostic ignored "-Wconversion"
        +
        24#pragma GCC diagnostic ignored "-Wfloat-equal"
        +
        25#pragma GCC diagnostic ignored "-Wuninitialized"
        +
        26#endif
        +
        27
        +
        28#include <boost/concept_check.hpp>
        +
        29
        +
        30#if defined(BOOST_CLANG)
        +
        31#pragma clang diagnostic pop
        +
        32#endif
        +
        33
        +
        34#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        35#pragma GCC diagnostic pop
        +
        36#endif
        +
        37
        +
        38// TODO: Document BOOST_GIL_USE_CONCEPT_CHECK here
        +
        39
        +
        40namespace boost { namespace gil {
        +
        41
        +
        42// TODO: What is BOOST_GIL_CLASS_REQUIRE for; Why not use BOOST_CLASS_REQUIRE?
        +
        43// TODO: What is gil_function_requires for; Why not function_requires?
        +
        44
        +
        45#ifdef BOOST_GIL_USE_CONCEPT_CHECK
        +
        46 #define BOOST_GIL_CLASS_REQUIRE(type_var, ns, concept) \
        +
        47 BOOST_CLASS_REQUIRE(type_var, ns, concept);
        +
        48
        +
        49 template <typename Concept>
        +
        50 void gil_function_requires() { function_requires<Concept>(); }
        +
        51#else
        +
        52 #define BOOST_GIL_CLASS_REQUIRE(type_var, ns, concept)
        +
        53
        +
        54 template <typename C>
        +
        55 void gil_function_requires() {}
        +
        56#endif
        +
        57
        +
        58}} // namespace boost::gil:
        +
        59
        +
        60#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/concepts_2channel_8hpp_source.html b/html/reference/concepts_2channel_8hpp_source.html index d2b4dce3a..aa58fba6b 100644 --- a/html/reference/concepts_2channel_8hpp_source.html +++ b/html/reference/concepts_2channel_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel.hpp Source File @@ -27,185 +27,203 @@

        - + +/* @license-end */ + +
        -
        -
        concepts/channel.hpp
        +
        concepts/channel.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_CHANNEL_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_CHANNEL_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/concept_check.hpp>
        -
        13 #include <boost/gil/concepts/fwd.hpp>
        -
        14 
        -
        15 #include <boost/concept_check.hpp>
        -
        16 
        -
        17 #include <utility> // std::swap
        -
        18 #include <type_traits>
        -
        19 
        -
        20 #if defined(BOOST_CLANG)
        -
        21 #pragma clang diagnostic push
        -
        22 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        23 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        24 #endif
        -
        25 
        -
        26 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        27 #pragma GCC diagnostic push
        -
        28 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        29 #endif
        -
        30 
        -
        31 namespace boost { namespace gil {
        -
        32 
        -
        33 // Forward declarations
        -
        34 template <typename T>
        -
        35 struct channel_traits;
        -
        36 
        -
        37 template <typename DstT, typename SrcT>
        -
        38 auto channel_convert(SrcT const& val)
        -
        39  -> typename channel_traits<DstT>::value_type;
        -
        40 
        -
        73 template <typename T>
        - -
        75 {
        -
        76  void constraints()
        -
        77  {
        -
        78  gil_function_requires<boost::EqualityComparableConcept<T>>();
        -
        79 
        -
        80  using v = typename channel_traits<T>::value_type;
        -
        81  using r = typename channel_traits<T>::reference;
        -
        82  using p = typename channel_traits<T>::pointer;
        -
        83  using cr = typename channel_traits<T>::const_reference;
        -
        84  using cp = typename channel_traits<T>::const_pointer;
        -
        85 
        -
        86  channel_traits<T>::min_value();
        -
        87  channel_traits<T>::max_value();
        -
        88  }
        -
        89 
        -
        90  T c;
        -
        91 };
        -
        92 
        -
        93 namespace detail
        -
        94 {
        -
        95 
        -
        97 template <typename T>
        - -
        99 {
        -
        100  void constraints()
        -
        101  {
        -
        102  c1 = c2;
        -
        103  using std::swap;
        -
        104  swap(c1, c2);
        -
        105  }
        -
        106  T c1;
        -
        107  T c2;
        -
        108 };
        -
        109 
        -
        110 } // namespace detail
        -
        111 
        -
        117 template <typename T>
        - -
        119 {
        -
        120  void constraints()
        -
        121  {
        -
        122  gil_function_requires<ChannelConcept<T>>();
        -
        123  gil_function_requires<detail::ChannelIsMutableConcept<T>>();
        -
        124  }
        -
        125 };
        -
        126 
        -
        132 template <typename T>
        - -
        134 {
        -
        135  void constraints()
        -
        136  {
        -
        137  gil_function_requires<ChannelConcept<T>>();
        -
        138  gil_function_requires<Regular<T>>();
        -
        139  }
        -
        140 };
        -
        141 
        -
        153 template <typename T1, typename T2> // Models GIL Pixel
        - -
        155  : std::is_same
        -
        156  <
        -
        157  typename channel_traits<T1>::value_type,
        -
        158  typename channel_traits<T2>::value_type
        -
        159  >
        -
        160 {
        -
        161 };
        -
        162 
        -
        172 template <typename Channel1, typename Channel2>
        - -
        174 {
        -
        175  void constraints()
        -
        176  {
        - -
        178  }
        -
        179 };
        -
        180 
        -
        192 template <typename SrcChannel, typename DstChannel>
        - -
        194 {
        -
        195  void constraints()
        -
        196  {
        -
        197  gil_function_requires<ChannelConcept<SrcChannel>>();
        -
        198  gil_function_requires<MutableChannelConcept<DstChannel>>();
        -
        199  dst = channel_convert<DstChannel, SrcChannel>(src);
        -
        200  ignore_unused_variable_warning(dst);
        -
        201  }
        -
        202  SrcChannel src;
        -
        203  DstChannel dst;
        -
        204 };
        -
        205 
        -
        206 }} // namespace boost::gil
        -
        207 
        -
        208 #if defined(BOOST_CLANG)
        -
        209 #pragma clang diagnostic pop
        -
        210 #endif
        -
        211 
        -
        212 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        213 #pragma GCC diagnostic pop
        -
        214 #endif
        -
        215 
        -
        216 #endif
        -
        auto channel_convert(SrcChannel const &src) -> typename channel_traits< DstChannel >::value_type
        Converting from one channel type to another.
        Definition: channel_algorithm.hpp:461
        -
        void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
        swap for packed_channel_reference
        Definition: channel.hpp:583
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
        Definition: concepts/channel.hpp:75
        -
        A channel is convertible to another one if the channel_convert algorithm is defined for the two chann...
        Definition: concepts/channel.hpp:194
        -
        A channel that supports default construction.
        Definition: concepts/channel.hpp:134
        -
        Channels are compatible if their associated value types (ignoring constness and references) are the s...
        Definition: concepts/channel.hpp:174
        -
        A channel that allows for modifying its value.
        Definition: concepts/channel.hpp:119
        -
        Predicate metafunction returning whether two channels are compatible.
        Definition: concepts/channel.hpp:160
        -
        Definition: concepts/channel.hpp:99
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_CHANNEL_HPP
        +
        9#define BOOST_GIL_CONCEPTS_CHANNEL_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/concept_check.hpp>
        +
        13#include <boost/gil/concepts/fwd.hpp>
        +
        14
        +
        15#include <boost/concept_check.hpp>
        +
        16
        +
        17#include <utility> // std::swap
        +
        18#include <type_traits>
        +
        19
        +
        20#if defined(BOOST_CLANG)
        +
        21#pragma clang diagnostic push
        +
        22#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        23#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        24#endif
        +
        25
        +
        26#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        27#pragma GCC diagnostic push
        +
        28#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        29#endif
        +
        30
        +
        31namespace boost { namespace gil {
        +
        32
        +
        33// Forward declarations
        +
        34template <typename T>
        +
        35struct channel_traits;
        +
        36
        +
        37template <typename DstT, typename SrcT>
        +
        38auto channel_convert(SrcT const& val)
        +
        39 -> typename channel_traits<DstT>::value_type;
        +
        40
        +
        73template <typename T>
        +
        + +
        75{
        +
        76 void constraints()
        +
        77 {
        +
        78 gil_function_requires<boost::EqualityComparableConcept<T>>();
        +
        79
        +
        80 using v = typename channel_traits<T>::value_type;
        +
        81 using r = typename channel_traits<T>::reference;
        +
        82 using p = typename channel_traits<T>::pointer;
        +
        83 using cr = typename channel_traits<T>::const_reference;
        +
        84 using cp = typename channel_traits<T>::const_pointer;
        +
        85
        +
        86 channel_traits<T>::min_value();
        +
        87 channel_traits<T>::max_value();
        +
        88 }
        +
        89
        +
        90 T c;
        +
        91};
        +
        +
        92
        +
        93namespace detail
        +
        94{
        +
        95
        +
        97template <typename T>
        +
        + +
        99{
        +
        100 void constraints()
        +
        101 {
        +
        102 c1 = c2;
        +
        103 using std::swap;
        +
        104 swap(c1, c2);
        +
        105 }
        +
        106 T c1;
        +
        107 T c2;
        +
        108};
        +
        +
        109
        +
        110} // namespace detail
        +
        111
        +
        117template <typename T>
        +
        + +
        119{
        +
        120 void constraints()
        +
        121 {
        +
        122 gil_function_requires<ChannelConcept<T>>();
        +
        123 gil_function_requires<detail::ChannelIsMutableConcept<T>>();
        +
        124 }
        +
        125};
        +
        +
        126
        +
        132template <typename T>
        +
        + +
        134{
        +
        135 void constraints()
        +
        136 {
        +
        137 gil_function_requires<ChannelConcept<T>>();
        +
        138 gil_function_requires<Regular<T>>();
        +
        139 }
        +
        140};
        +
        +
        141
        +
        153template <typename T1, typename T2> // Models GIL Pixel
        +
        + +
        155 : std::is_same
        +
        156 <
        +
        157 typename channel_traits<T1>::value_type,
        +
        158 typename channel_traits<T2>::value_type
        +
        159 >
        +
        160{
        +
        161};
        +
        +
        162
        +
        172template <typename Channel1, typename Channel2>
        +
        + +
        174{
        +
        175 void constraints()
        +
        176 {
        + +
        178 }
        +
        179};
        +
        +
        180
        +
        192template <typename SrcChannel, typename DstChannel>
        +
        + +
        194{
        +
        195 void constraints()
        +
        196 {
        +
        197 gil_function_requires<ChannelConcept<SrcChannel>>();
        +
        198 gil_function_requires<MutableChannelConcept<DstChannel>>();
        +
        199 dst = channel_convert<DstChannel, SrcChannel>(src);
        +
        200 ignore_unused_variable_warning(dst);
        +
        201 }
        +
        202 SrcChannel src;
        +
        203 DstChannel dst;
        +
        204};
        +
        +
        205
        +
        206}} // namespace boost::gil
        +
        207
        +
        208#if defined(BOOST_CLANG)
        +
        209#pragma clang diagnostic pop
        +
        210#endif
        +
        211
        +
        212#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        213#pragma GCC diagnostic pop
        +
        214#endif
        +
        215
        +
        216#endif
        +
        auto channel_convert(SrcChannel const &src) -> typename channel_traits< DstChannel >::value_type
        Converting from one channel type to another.
        Definition channel_algorithm.hpp:461
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
        Definition concepts/channel.hpp:75
        +
        A channel is convertible to another one if the channel_convert algorithm is defined for the two chann...
        Definition concepts/channel.hpp:194
        +
        A channel that supports default construction.
        Definition concepts/channel.hpp:134
        +
        Channels are compatible if their associated value types (ignoring constness and references) are the s...
        Definition concepts/channel.hpp:174
        +
        A channel that allows for modifying its value.
        Definition concepts/channel.hpp:119
        +
        Predicate metafunction returning whether two channels are compatible.
        Definition concepts/channel.hpp:160
        +
        Definition concepts/channel.hpp:99
        diff --git a/html/reference/concepts_2color__base_8hpp_source.html b/html/reference/concepts_2color__base_8hpp_source.html index a580d1a72..13caf9845 100644 --- a/html/reference/concepts_2color__base_8hpp_source.html +++ b/html/reference/concepts_2color__base_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_base.hpp Source File @@ -27,258 +27,276 @@

        - + +/* @license-end */ + +
        -
        -
        concepts/color_base.hpp
        +
        concepts/color_base.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_COLOR_BASE_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_COLOR_BASE_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/color.hpp>
        -
        13 #include <boost/gil/concepts/concept_check.hpp>
        -
        14 #include <boost/gil/concepts/fwd.hpp>
        -
        15 
        -
        16 #include <boost/core/ignore_unused.hpp>
        -
        17 #include <type_traits>
        -
        18 
        -
        19 #if defined(BOOST_CLANG)
        -
        20 #pragma clang diagnostic push
        -
        21 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        22 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        23 #endif
        -
        24 
        -
        25 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        26 #pragma GCC diagnostic push
        -
        27 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        28 #endif
        -
        29 
        -
        30 namespace boost { namespace gil {
        -
        31 
        -
        32 // Forward declarations of at_c
        -
        33 namespace detail {
        -
        34 
        -
        35 template <typename Element, typename Layout, int K>
        -
        36 struct homogeneous_color_base;
        -
        37 
        -
        38 } // namespace detail
        -
        39 
        -
        40 template <int K, typename E, typename L, int N>
        -
        41 auto at_c(detail::homogeneous_color_base<E, L, N>& p)
        -
        42  -> typename std::add_lvalue_reference<E>::type;
        -
        43 
        -
        44 template <int K, typename E, typename L, int N>
        -
        45 auto at_c(detail::homogeneous_color_base<E, L, N> const& p)
        -
        46  -> typename std::add_lvalue_reference<typename std::add_const<E>::type>::type;
        -
        47 
        -
        48 template <typename P, typename C, typename L>
        -
        49 struct packed_pixel;
        -
        50 
        -
        51 template <int K, typename P, typename C, typename L>
        -
        52 auto at_c(packed_pixel<P, C, L>& p)
        -
        53  -> typename kth_element_reference_type<packed_pixel<P, C, L>, K>::type;
        -
        54 
        -
        55 template <int K, typename P, typename C, typename L>
        -
        56 auto at_c(packed_pixel<P, C, L> const& p)
        -
        57  -> typename kth_element_const_reference_type<packed_pixel<P, C, L>, K>::type;
        -
        58 
        -
        59 template <typename B, typename C, typename L, bool M>
        -
        60 struct bit_aligned_pixel_reference;
        -
        61 
        -
        62 template <int K, typename B, typename C, typename L, bool M>
        -
        63 inline auto at_c(bit_aligned_pixel_reference<B, C, L, M> const& p)
        -
        64  -> typename kth_element_reference_type
        -
        65  <
        -
        66  bit_aligned_pixel_reference<B, C, L, M>,
        -
        67  K
        -
        68  >::type;
        -
        69 
        -
        70 // Forward declarations of semantic_at_c
        -
        71 template <int K, typename ColorBase>
        -
        72 auto semantic_at_c(ColorBase& p)
        -
        73  -> typename std::enable_if
        -
        74  <
        -
        75  !std::is_const<ColorBase>::value,
        -
        76  typename kth_semantic_element_reference_type<ColorBase, K>::type
        -
        77  >::type;
        -
        78 
        -
        79 template <int K, typename ColorBase>
        -
        80 auto semantic_at_c(ColorBase const& p)
        -
        81  -> typename kth_semantic_element_const_reference_type<ColorBase, K>::type;
        -
        82 
        -
        136 template <typename ColorBase>
        - -
        138 {
        -
        139  void constraints()
        -
        140  {
        -
        141  gil_function_requires<CopyConstructible<ColorBase>>();
        -
        142  gil_function_requires<EqualityComparable<ColorBase>>();
        -
        143 
        -
        144  using color_space_t = typename ColorBase::layout_t::color_space_t;
        -
        145  gil_function_requires<ColorSpaceConcept<color_space_t>>();
        -
        146 
        -
        147  using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
        -
        148  // TODO: channel_mapping_t must be an Boost.MP11-compatible random access sequence
        -
        149 
        -
        150  static const int num_elements = size<ColorBase>::value;
        -
        151 
        -
        152  using TN = typename kth_element_type<ColorBase, num_elements - 1>::type;
        -
        153  using RN = typename kth_element_const_reference_type<ColorBase, num_elements - 1>::type;
        -
        154 
        -
        155  RN r = gil::at_c<num_elements - 1>(cb);
        -
        156  boost::ignore_unused(r);
        -
        157 
        -
        158  // functions that work for every pixel (no need to require them)
        -
        159  semantic_at_c<0>(cb);
        -
        160  semantic_at_c<num_elements-1>(cb);
        -
        161  // also static_max(cb), static_min(cb), static_fill(cb,value),
        -
        162  // and all variations of static_for_each(), static_generate(), static_transform()
        -
        163  }
        -
        164  ColorBase cb;
        -
        165 };
        -
        166 
        -
        182 template <typename ColorBase>
        - -
        184 {
        -
        185  void constraints()
        -
        186  {
        -
        187  gil_function_requires<ColorBaseConcept<ColorBase>>();
        -
        188  gil_function_requires<Assignable<ColorBase>>();
        -
        189  gil_function_requires<Swappable<ColorBase>>();
        -
        190 
        -
        191  using R0 = typename kth_element_reference_type<ColorBase, 0>::type;
        -
        192 
        -
        193  R0 r = gil::at_c<0>(cb);
        -
        194  gil::at_c<0>(cb) = r;
        -
        195  }
        -
        196  ColorBase cb;
        -
        197 };
        -
        198 
        -
        206 template <typename ColorBase>
        - -
        208 {
        -
        209  void constraints()
        -
        210  {
        -
        211  gil_function_requires<MutableColorBaseConcept<ColorBase>>();
        -
        212  gil_function_requires<Regular<ColorBase>>();
        -
        213  }
        -
        214 };
        -
        215 
        -
        226 template <typename ColorBase>
        - -
        228 {
        -
        229  void constraints()
        -
        230  {
        -
        231  gil_function_requires<ColorBaseConcept<ColorBase>>();
        -
        232 
        -
        233  static const int num_elements = size<ColorBase>::value;
        -
        234 
        -
        235  using T0 = typename kth_element_type<ColorBase, 0>::type;
        -
        236  using TN = typename kth_element_type<ColorBase, num_elements - 1>::type;
        -
        237 
        -
        238  static_assert(std::is_same<T0, TN>::value, ""); // better than nothing
        -
        239 
        -
        240  using R0 = typename kth_element_const_reference_type<ColorBase, 0>::type;
        -
        241  R0 r = dynamic_at_c(cb, 0);
        -
        242  boost::ignore_unused(r);
        -
        243  }
        -
        244  ColorBase cb;
        -
        245 };
        -
        246 
        -
        256 template <typename ColorBase>
        - -
        258 {
        -
        259  void constraints()
        -
        260  {
        -
        261  gil_function_requires<ColorBaseConcept<ColorBase>>();
        -
        262  gil_function_requires<HomogeneousColorBaseConcept<ColorBase>>();
        -
        263  using R0 = typename kth_element_reference_type<ColorBase, 0>::type;
        -
        264  R0 r = dynamic_at_c(cb, 0);
        -
        265  boost::ignore_unused(r);
        -
        266  dynamic_at_c(cb, 0) = dynamic_at_c(cb, 0);
        -
        267  }
        -
        268  ColorBase cb;
        -
        269 };
        -
        270 
        -
        281 template <typename ColorBase>
        - -
        283 {
        -
        284  void constraints()
        -
        285  {
        -
        286  gil_function_requires<MutableHomogeneousColorBaseConcept<ColorBase>>();
        -
        287  gil_function_requires<Regular<ColorBase>>();
        -
        288  }
        -
        289 };
        -
        290 
        -
        302 template <typename ColorBase1, typename ColorBase2>
        - -
        304 {
        -
        305  void constraints()
        -
        306  {
        -
        307  static_assert(std::is_same
        -
        308  <
        -
        309  typename ColorBase1::layout_t::color_space_t,
        -
        310  typename ColorBase2::layout_t::color_space_t
        -
        311  >::value, "");
        -
        312 
        -
        313 // using e1 = typename kth_semantic_element_type<ColorBase1,0>::type;
        -
        314 // using e2 = typename kth_semantic_element_type<ColorBase2,0>::type;
        -
        315 // "e1 is convertible to e2"
        -
        316  }
        -
        317 };
        -
        318 
        -
        319 }} // namespace boost::gil
        -
        320 
        -
        321 #if defined(BOOST_CLANG)
        -
        322 #pragma clang diagnostic pop
        -
        323 #endif
        -
        324 
        -
        325 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        326 #pragma GCC diagnostic pop
        -
        327 #endif
        -
        328 
        -
        329 #endif
        -
        auto semantic_at_c(ColorBase &p) -> typename std::enable_if< !std::is_const< ColorBase >::value, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type
        A mutable accessor to the K-th semantic element of a color base.
        Definition: color_base_algorithm.hpp:119
        -
        auto at_c(detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
        Provides mutable access to the K-th element, in physical order.
        Definition: color_base.hpp:632
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        A color base is a container of color elements (such as channels, channel references or channel pointe...
        Definition: concepts/color_base.hpp:138
        -
        Color base that also has a default-constructor. Refines Regular.
        Definition: concepts/color_base.hpp:208
        -
        Two color bases are compatible if they have the same color space and their elements are compatible,...
        Definition: concepts/color_base.hpp:304
        -
        Color base whose elements all have the same type.
        Definition: concepts/color_base.hpp:228
        -
        Homogeneous color base that also has a default constructor. Refines Regular.
        Definition: concepts/color_base.hpp:283
        -
        Color base which allows for modifying its elements.
        Definition: concepts/color_base.hpp:184
        -
        Homogeneous color base that allows for modifying its elements.
        Definition: concepts/color_base.hpp:258
        -
        Returns an integral constant type specifying the number of elements in a color base.
        Definition: color_base_algorithm.hpp:42
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_COLOR_BASE_HPP
        +
        9#define BOOST_GIL_CONCEPTS_COLOR_BASE_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/color.hpp>
        +
        13#include <boost/gil/concepts/concept_check.hpp>
        +
        14#include <boost/gil/concepts/fwd.hpp>
        +
        15
        +
        16#include <boost/core/ignore_unused.hpp>
        +
        17#include <type_traits>
        +
        18
        +
        19#if defined(BOOST_CLANG)
        +
        20#pragma clang diagnostic push
        +
        21#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        22#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        23#endif
        +
        24
        +
        25#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        26#pragma GCC diagnostic push
        +
        27#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        28#endif
        +
        29
        +
        30namespace boost { namespace gil {
        +
        31
        +
        32// Forward declarations of at_c
        +
        33namespace detail {
        +
        34
        +
        35template <typename Element, typename Layout, int K>
        +
        36struct homogeneous_color_base;
        +
        37
        +
        38} // namespace detail
        +
        39
        +
        40template <int K, typename E, typename L, int N>
        +
        41auto at_c(detail::homogeneous_color_base<E, L, N>& p)
        +
        42 -> typename std::add_lvalue_reference<E>::type;
        +
        43
        +
        44template <int K, typename E, typename L, int N>
        +
        45auto at_c(detail::homogeneous_color_base<E, L, N> const& p)
        +
        46 -> typename std::add_lvalue_reference<typename std::add_const<E>::type>::type;
        +
        47
        +
        48template <typename P, typename C, typename L>
        +
        49struct packed_pixel;
        +
        50
        +
        51template <int K, typename P, typename C, typename L>
        +
        52auto at_c(packed_pixel<P, C, L>& p)
        +
        53 -> typename kth_element_reference_type<packed_pixel<P, C, L>, K>::type;
        +
        54
        +
        55template <int K, typename P, typename C, typename L>
        +
        56auto at_c(packed_pixel<P, C, L> const& p)
        +
        57 -> typename kth_element_const_reference_type<packed_pixel<P, C, L>, K>::type;
        +
        58
        +
        59template <typename B, typename C, typename L, bool M>
        +
        60struct bit_aligned_pixel_reference;
        +
        61
        +
        62template <int K, typename B, typename C, typename L, bool M>
        +
        63inline auto at_c(bit_aligned_pixel_reference<B, C, L, M> const& p)
        +
        64 -> typename kth_element_reference_type
        +
        65 <
        +
        66 bit_aligned_pixel_reference<B, C, L, M>,
        +
        67 K
        +
        68 >::type;
        +
        69
        +
        70// Forward declarations of semantic_at_c
        +
        71template <int K, typename ColorBase>
        +
        72auto semantic_at_c(ColorBase& p)
        +
        73 -> typename std::enable_if
        +
        74 <
        +
        75 !std::is_const<ColorBase>::value,
        +
        76 typename kth_semantic_element_reference_type<ColorBase, K>::type
        +
        77 >::type;
        +
        78
        +
        79template <int K, typename ColorBase>
        +
        80auto semantic_at_c(ColorBase const& p)
        +
        81 -> typename kth_semantic_element_const_reference_type<ColorBase, K>::type;
        +
        82
        +
        136template <typename ColorBase>
        +
        + +
        138{
        +
        139 void constraints()
        +
        140 {
        +
        141 gil_function_requires<CopyConstructible<ColorBase>>();
        +
        142 gil_function_requires<EqualityComparable<ColorBase>>();
        +
        143
        +
        144 using color_space_t = typename ColorBase::layout_t::color_space_t;
        +
        145 gil_function_requires<ColorSpaceConcept<color_space_t>>();
        +
        146
        +
        147 using channel_mapping_t = typename ColorBase::layout_t::channel_mapping_t;
        +
        148 // TODO: channel_mapping_t must be an Boost.MP11-compatible random access sequence
        +
        149
        +
        150 static const int num_elements = size<ColorBase>::value;
        +
        151
        +
        152 using TN = typename kth_element_type<ColorBase, num_elements - 1>::type;
        +
        153 using RN = typename kth_element_const_reference_type<ColorBase, num_elements - 1>::type;
        +
        154
        +
        155 RN r = gil::at_c<num_elements - 1>(cb);
        +
        156 boost::ignore_unused(r);
        +
        157
        +
        158 // functions that work for every pixel (no need to require them)
        +
        159 semantic_at_c<0>(cb);
        +
        160 semantic_at_c<num_elements-1>(cb);
        +
        161 // also static_max(cb), static_min(cb), static_fill(cb,value),
        +
        162 // and all variations of static_for_each(), static_generate(), static_transform()
        +
        163 }
        +
        164 ColorBase cb;
        +
        165};
        +
        +
        166
        +
        182template <typename ColorBase>
        +
        + +
        184{
        +
        185 void constraints()
        +
        186 {
        +
        187 gil_function_requires<ColorBaseConcept<ColorBase>>();
        +
        188 gil_function_requires<Assignable<ColorBase>>();
        +
        189 gil_function_requires<Swappable<ColorBase>>();
        +
        190
        +
        191 using R0 = typename kth_element_reference_type<ColorBase, 0>::type;
        +
        192
        +
        193 R0 r = gil::at_c<0>(cb);
        +
        194 gil::at_c<0>(cb) = r;
        +
        195 }
        +
        196 ColorBase cb;
        +
        197};
        +
        +
        198
        +
        206template <typename ColorBase>
        +
        + +
        208{
        +
        209 void constraints()
        +
        210 {
        +
        211 gil_function_requires<MutableColorBaseConcept<ColorBase>>();
        +
        212 gil_function_requires<Regular<ColorBase>>();
        +
        213 }
        +
        214};
        +
        +
        215
        +
        226template <typename ColorBase>
        +
        + +
        228{
        +
        229 void constraints()
        +
        230 {
        +
        231 gil_function_requires<ColorBaseConcept<ColorBase>>();
        +
        232
        +
        233 static const int num_elements = size<ColorBase>::value;
        +
        234
        +
        235 using T0 = typename kth_element_type<ColorBase, 0>::type;
        +
        236 using TN = typename kth_element_type<ColorBase, num_elements - 1>::type;
        +
        237
        +
        238 static_assert(std::is_same<T0, TN>::value, ""); // better than nothing
        +
        239
        +
        240 using R0 = typename kth_element_const_reference_type<ColorBase, 0>::type;
        +
        241 R0 r = dynamic_at_c(cb, 0);
        +
        242 boost::ignore_unused(r);
        +
        243 }
        +
        244 ColorBase cb;
        +
        245};
        +
        +
        246
        +
        256template <typename ColorBase>
        +
        + +
        258{
        +
        259 void constraints()
        +
        260 {
        +
        261 gil_function_requires<ColorBaseConcept<ColorBase>>();
        +
        262 gil_function_requires<HomogeneousColorBaseConcept<ColorBase>>();
        +
        263 using R0 = typename kth_element_reference_type<ColorBase, 0>::type;
        +
        264 R0 r = dynamic_at_c(cb, 0);
        +
        265 boost::ignore_unused(r);
        +
        266 dynamic_at_c(cb, 0) = dynamic_at_c(cb, 0);
        +
        267 }
        +
        268 ColorBase cb;
        +
        269};
        +
        +
        270
        +
        281template <typename ColorBase>
        +
        + +
        283{
        +
        284 void constraints()
        +
        285 {
        +
        286 gil_function_requires<MutableHomogeneousColorBaseConcept<ColorBase>>();
        +
        287 gil_function_requires<Regular<ColorBase>>();
        +
        288 }
        +
        289};
        +
        +
        290
        +
        302template <typename ColorBase1, typename ColorBase2>
        +
        + +
        304{
        +
        305 void constraints()
        +
        306 {
        +
        307 static_assert(std::is_same
        +
        308 <
        +
        309 typename ColorBase1::layout_t::color_space_t,
        +
        310 typename ColorBase2::layout_t::color_space_t
        +
        311 >::value, "");
        +
        312
        +
        313// using e1 = typename kth_semantic_element_type<ColorBase1,0>::type;
        +
        314// using e2 = typename kth_semantic_element_type<ColorBase2,0>::type;
        +
        315// "e1 is convertible to e2"
        +
        316 }
        +
        317};
        +
        +
        318
        +
        319}} // namespace boost::gil
        +
        320
        +
        321#if defined(BOOST_CLANG)
        +
        322#pragma clang diagnostic pop
        +
        323#endif
        +
        324
        +
        325#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        326#pragma GCC diagnostic pop
        +
        327#endif
        +
        328
        +
        329#endif
        +
        auto semantic_at_c(ColorBase &p) -> typename std::enable_if< !std::is_const< ColorBase >::value, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type
        A mutable accessor to the K-th semantic element of a color base.
        Definition color_base_algorithm.hpp:119
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        A color base is a container of color elements (such as channels, channel references or channel pointe...
        Definition concepts/color_base.hpp:138
        +
        Color base that also has a default-constructor. Refines Regular.
        Definition concepts/color_base.hpp:208
        +
        Two color bases are compatible if they have the same color space and their elements are compatible,...
        Definition concepts/color_base.hpp:304
        +
        Color base whose elements all have the same type.
        Definition concepts/color_base.hpp:228
        +
        Homogeneous color base that also has a default constructor. Refines Regular.
        Definition concepts/color_base.hpp:283
        +
        Color base which allows for modifying its elements.
        Definition concepts/color_base.hpp:184
        +
        Homogeneous color base that allows for modifying its elements.
        Definition concepts/color_base.hpp:258
        +
        Returns an integral constant type specifying the number of elements in a color base.
        Definition color_base_algorithm.hpp:42
        diff --git a/html/reference/concepts_2dynamic__step_8hpp_source.html b/html/reference/concepts_2dynamic__step_8hpp_source.html index a1c14e664..32f57a16a 100644 --- a/html/reference/concepts_2dynamic__step_8hpp_source.html +++ b/html/reference/concepts_2dynamic__step_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: dynamic_step.hpp Source File @@ -27,95 +27,104 @@

        - + +/* @license-end */ + +
        -
        -
        concepts/dynamic_step.hpp
        +
        concepts/dynamic_step.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_DYNAMIC_STEP_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_DYNAMIC_STEP_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/fwd.hpp>
        -
        12 #include <boost/gil/concepts/concept_check.hpp>
        -
        13 
        -
        14 #if defined(BOOST_CLANG)
        -
        15 #pragma clang diagnostic push
        -
        16 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        17 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        18 #endif
        -
        19 
        -
        20 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        21 #pragma GCC diagnostic push
        -
        22 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        23 #endif
        -
        24 
        -
        25 namespace boost { namespace gil {
        -
        26 
        -
        38 template <typename T>
        - -
        40 {
        -
        41  void constraints()
        -
        42  {
        -
        43  using type = typename dynamic_x_step_type<T>::type;
        -
        44  ignore_unused_variable_warning(type{});
        -
        45  }
        -
        46 };
        -
        47 
        -
        58 template <typename T>
        - -
        60 {
        -
        61  void constraints()
        -
        62  {
        -
        63  using type = typename dynamic_y_step_type<T>::type;
        -
        64  ignore_unused_variable_warning(type{});
        -
        65  }
        -
        66 };
        -
        67 
        -
        68 }} // namespace boost::gil
        -
        69 
        -
        70 #if defined(BOOST_CLANG)
        -
        71 #pragma clang diagnostic pop
        -
        72 #endif
        -
        73 
        -
        74 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        75 #pragma GCC diagnostic pop
        -
        76 #endif
        -
        77 
        -
        78 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Concept for iterators, locators and views that can define a type just like the given iterator,...
        Definition: concepts/dynamic_step.hpp:40
        -
        Concept for locators and views that can define a type just like the given locator or view,...
        Definition: concepts/dynamic_step.hpp:60
        -
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition: dynamic_step.hpp:17
        -
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition: dynamic_step.hpp:21
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_DYNAMIC_STEP_HPP
        +
        9#define BOOST_GIL_CONCEPTS_DYNAMIC_STEP_HPP
        +
        10
        +
        11#include <boost/gil/concepts/fwd.hpp>
        +
        12#include <boost/gil/concepts/concept_check.hpp>
        +
        13
        +
        14#if defined(BOOST_CLANG)
        +
        15#pragma clang diagnostic push
        +
        16#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        17#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        18#endif
        +
        19
        +
        20#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        21#pragma GCC diagnostic push
        +
        22#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        23#endif
        +
        24
        +
        25namespace boost { namespace gil {
        +
        26
        +
        38template <typename T>
        +
        + +
        40{
        +
        41 void constraints()
        +
        42 {
        +
        43 using type = typename dynamic_x_step_type<T>::type;
        +
        44 ignore_unused_variable_warning(type{});
        +
        45 }
        +
        46};
        +
        +
        47
        +
        58template <typename T>
        +
        + +
        60{
        +
        61 void constraints()
        +
        62 {
        +
        63 using type = typename dynamic_y_step_type<T>::type;
        +
        64 ignore_unused_variable_warning(type{});
        +
        65 }
        +
        66};
        +
        +
        67
        +
        68}} // namespace boost::gil
        +
        69
        +
        70#if defined(BOOST_CLANG)
        +
        71#pragma clang diagnostic pop
        +
        72#endif
        +
        73
        +
        74#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        75#pragma GCC diagnostic pop
        +
        76#endif
        +
        77
        +
        78#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Concept for iterators, locators and views that can define a type just like the given iterator,...
        Definition concepts/dynamic_step.hpp:40
        +
        Concept for locators and views that can define a type just like the given locator or view,...
        Definition concepts/dynamic_step.hpp:60
        +
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition dynamic_step.hpp:17
        +
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition dynamic_step.hpp:21
        diff --git a/html/reference/concepts_2image_8hpp_source.html b/html/reference/concepts_2image_8hpp_source.html index 5d8b17922..abe7d2d53 100644 --- a/html/reference/concepts_2image_8hpp_source.html +++ b/html/reference/concepts_2image_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image.hpp Source File @@ -27,159 +27,170 @@

        - + +/* @license-end */ + +
        -
        -
        concepts/image.hpp
        +
        concepts/image.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_IMAGE_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_IMAGE_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/concept_check.hpp>
        -
        13 #include <boost/gil/concepts/fwd.hpp>
        -
        14 #include <boost/gil/concepts/image_view.hpp>
        -
        15 #include <boost/gil/concepts/point.hpp>
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 
        -
        18 #include <type_traits>
        -
        19 
        -
        20 #if defined(BOOST_CLANG)
        -
        21 #pragma clang diagnostic push
        -
        22 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        23 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        24 #endif
        -
        25 
        -
        26 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        27 #pragma GCC diagnostic push
        -
        28 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        29 #endif
        -
        30 
        -
        31 namespace boost { namespace gil {
        -
        32 
        -
        56 template <typename Image>
        - -
        58 {
        -
        59  void constraints()
        -
        60  {
        -
        61  gil_function_requires<Regular<Image>>();
        -
        62 
        -
        63  using view_t = typename Image::view_t;
        -
        64  gil_function_requires<MutableRandomAccessNDImageViewConcept<view_t>>();
        -
        65 
        -
        66  using const_view_t = typename Image::const_view_t;
        -
        67  using pixel_t = typename Image::value_type;
        -
        68  using point_t = typename Image::point_t;
        -
        69  gil_function_requires<PointNDConcept<point_t>>();
        -
        70 
        -
        71  const_view_t cv = const_view(image);
        -
        72  ignore_unused_variable_warning(cv);
        -
        73  view_t v = view(image);
        -
        74  ignore_unused_variable_warning(v);
        -
        75 
        -
        76  pixel_t fill_value;
        -
        77  point_t pt = image.dimensions();
        -
        78  Image image1(pt);
        -
        79  Image image2(pt, 1);
        -
        80  Image image3(pt, fill_value, 1);
        -
        81  image.recreate(pt);
        -
        82  image.recreate(pt, 1);
        -
        83  image.recreate(pt, fill_value, 1);
        -
        84  }
        -
        85  Image image;
        -
        86 };
        -
        87 
        -
        88 
        -
        108 template <typename Image>
        - -
        110 {
        -
        111  void constraints()
        -
        112  {
        -
        113  gil_function_requires<RandomAccessNDImageConcept<Image>>();
        -
        114  using x_coord_t = typename Image::x_coord_t;
        -
        115  using y_coord_t = typename Image::y_coord_t;
        -
        116  using value_t = typename Image::value_type;
        -
        117 
        -
        118  gil_function_requires<MutableRandomAccess2DImageViewConcept<typename Image::view_t>>();
        -
        119 
        -
        120  x_coord_t w=image.width();
        -
        121  y_coord_t h=image.height();
        -
        122  value_t fill_value;
        -
        123  Image im1(w,h);
        -
        124  Image im2(w,h,1);
        -
        125  Image im3(w,h,fill_value,1);
        -
        126  image.recreate(w,h);
        -
        127  image.recreate(w,h,1);
        -
        128  image.recreate(w,h,fill_value,1);
        -
        129  }
        -
        130  Image image;
        -
        131 };
        -
        132 
        -
        143 template <typename Image>
        - -
        145 {
        -
        146  void constraints()
        -
        147  {
        -
        148  gil_function_requires<RandomAccess2DImageConcept<Image>>();
        -
        149  gil_function_requires<MutableImageViewConcept<typename Image::view_t>>();
        -
        150  using coord_t = typename Image::coord_t;
        -
        151  static_assert(num_channels<Image>::value == mp11::mp_size<typename color_space_type<Image>::type>::value, "");
        -
        152 
        -
        153  static_assert(std::is_same<coord_t, typename Image::x_coord_t>::value, "");
        -
        154  static_assert(std::is_same<coord_t, typename Image::y_coord_t>::value, "");
        -
        155  }
        -
        156  Image image;
        -
        157 };
        -
        158 
        -
        159 }} // namespace boost::gil
        -
        160 
        -
        161 #if defined(BOOST_CLANG)
        -
        162 #pragma clang diagnostic pop
        -
        163 #endif
        -
        164 
        -
        165 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        166 #pragma GCC diagnostic pop
        -
        167 #endif
        -
        168 
        -
        169 #endif
        -
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:43
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_IMAGE_HPP
        +
        9#define BOOST_GIL_CONCEPTS_IMAGE_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/concept_check.hpp>
        +
        13#include <boost/gil/concepts/fwd.hpp>
        +
        14#include <boost/gil/concepts/image_view.hpp>
        +
        15#include <boost/gil/concepts/point.hpp>
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17
        +
        18#include <type_traits>
        +
        19
        +
        20#if defined(BOOST_CLANG)
        +
        21#pragma clang diagnostic push
        +
        22#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        23#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        24#endif
        +
        25
        +
        26#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        27#pragma GCC diagnostic push
        +
        28#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        29#endif
        +
        30
        +
        31namespace boost { namespace gil {
        +
        32
        +
        56template <typename Image>
        +
        + +
        58{
        +
        59 void constraints()
        +
        60 {
        +
        61 gil_function_requires<Regular<Image>>();
        +
        62
        +
        63 using view_t = typename Image::view_t;
        +
        64 gil_function_requires<MutableRandomAccessNDImageViewConcept<view_t>>();
        +
        65
        +
        66 using const_view_t = typename Image::const_view_t;
        +
        67 using pixel_t = typename Image::value_type;
        +
        68 using point_t = typename Image::point_t;
        +
        69 gil_function_requires<PointNDConcept<point_t>>();
        +
        70
        +
        71 const_view_t cv = const_view(image);
        +
        72 ignore_unused_variable_warning(cv);
        +
        73 view_t v = view(image);
        +
        74 ignore_unused_variable_warning(v);
        +
        75
        +
        76 pixel_t fill_value;
        +
        77 point_t pt = image.dimensions();
        +
        78 Image image1(pt);
        +
        79 Image image2(pt, 1);
        +
        80 Image image3(pt, fill_value, 1);
        +
        81 image.recreate(pt);
        +
        82 image.recreate(pt, 1);
        +
        83 image.recreate(pt, fill_value, 1);
        +
        84 }
        +
        85 Image image;
        +
        86};
        +
        +
        87
        +
        88
        +
        108template <typename Image>
        +
        + +
        110{
        +
        111 void constraints()
        +
        112 {
        +
        113 gil_function_requires<RandomAccessNDImageConcept<Image>>();
        +
        114 using x_coord_t = typename Image::x_coord_t;
        +
        115 using y_coord_t = typename Image::y_coord_t;
        +
        116 using value_t = typename Image::value_type;
        +
        117
        +
        118 gil_function_requires<MutableRandomAccess2DImageViewConcept<typename Image::view_t>>();
        +
        119
        +
        120 x_coord_t w=image.width();
        +
        121 y_coord_t h=image.height();
        +
        122 value_t fill_value;
        +
        123 Image im1(w,h);
        +
        124 Image im2(w,h,1);
        +
        125 Image im3(w,h,fill_value,1);
        +
        126 image.recreate(w,h);
        +
        127 image.recreate(w,h,1);
        +
        128 image.recreate(w,h,fill_value,1);
        +
        129 }
        +
        130 Image image;
        +
        131};
        +
        +
        132
        +
        143template <typename Image>
        +
        + +
        145{
        +
        146 void constraints()
        +
        147 {
        +
        148 gil_function_requires<RandomAccess2DImageConcept<Image>>();
        +
        149 gil_function_requires<MutableImageViewConcept<typename Image::view_t>>();
        +
        150 using coord_t = typename Image::coord_t;
        +
        151 static_assert(num_channels<Image>::value == mp11::mp_size<typename color_space_type<Image>::type>::value, "");
        +
        152
        +
        153 static_assert(std::is_same<coord_t, typename Image::x_coord_t>::value, "");
        +
        154 static_assert(std::is_same<coord_t, typename Image::y_coord_t>::value, "");
        +
        155 }
        +
        156 Image image;
        +
        157};
        +
        +
        158
        +
        159}} // namespace boost::gil
        +
        160
        +
        161#if defined(BOOST_CLANG)
        +
        162#pragma clang diagnostic pop
        +
        163#endif
        +
        164
        +
        165#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        166#pragma GCC diagnostic pop
        +
        167#endif
        +
        168
        +
        169#endif
        +
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition image.hpp:43
        -
        auto const_view(const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
        Returns the constant-pixel view of an image.
        Definition: image.hpp:573
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        2-dimensional image whose value type models PixelValueConcept
        Definition: concepts/image.hpp:145
        -
        2-dimensional container of values
        Definition: concepts/image.hpp:110
        -
        N-dimensional container of values.
        Definition: concepts/image.hpp:58
        -
        Returns the number of channels of a pixel-based GIL construct.
        Definition: pixel.hpp:54
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        auto const_view(const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
        Returns the constant-pixel view of an image.
        Definition image.hpp:573
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        2-dimensional image whose value type models PixelValueConcept
        Definition concepts/image.hpp:145
        +
        2-dimensional container of values
        Definition concepts/image.hpp:110
        +
        N-dimensional container of values.
        Definition concepts/image.hpp:58
        +
        Returns the number of channels of a pixel-based GIL construct.
        Definition pixel.hpp:54
        diff --git a/html/reference/concepts_2image__view_8hpp_source.html b/html/reference/concepts_2image__view_8hpp_source.html index 1b243c206..2a01e91de 100644 --- a/html/reference/concepts_2image__view_8hpp_source.html +++ b/html/reference/concepts_2image__view_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_view.hpp Source File @@ -27,439 +27,472 @@

        - + +/* @license-end */ + +
        -
        -
        concepts/image_view.hpp
        +
        concepts/image_view.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/concept_check.hpp>
        -
        13 #include <boost/gil/concepts/fwd.hpp>
        -
        14 #include <boost/gil/concepts/pixel.hpp>
        -
        15 #include <boost/gil/concepts/pixel_dereference.hpp>
        -
        16 #include <boost/gil/concepts/pixel_iterator.hpp>
        -
        17 #include <boost/gil/concepts/pixel_locator.hpp>
        -
        18 #include <boost/gil/concepts/point.hpp>
        -
        19 #include <boost/gil/concepts/detail/utility.hpp>
        -
        20 
        -
        21 #include <cstddef>
        -
        22 #include <iterator>
        -
        23 #include <type_traits>
        -
        24 
        -
        25 #if defined(BOOST_CLANG)
        -
        26 #pragma clang diagnostic push
        -
        27 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        28 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        29 #endif
        -
        30 
        -
        31 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        32 #pragma GCC diagnostic push
        -
        33 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        34 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
        -
        35 #endif
        -
        36 
        -
        37 namespace boost { namespace gil {
        -
        38 
        -
        42 
        -
        46 
        -
        50 
        -
        102 template <typename View>
        - -
        104 {
        -
        105  void constraints()
        -
        106  {
        -
        107  gil_function_requires<Regular<View>>();
        -
        108 
        -
        109  using value_type = typename View::value_type;
        -
        110  using reference = typename View::reference; // result of dereferencing
        -
        111  using pointer = typename View::pointer;
        -
        112  using difference_type = typename View::difference_type; // result of operator-(1d_iterator,1d_iterator)
        -
        113  using const_t = typename View::const_t; // same as this type, but over const values
        -
        114  using point_t = typename View::point_t; // N-dimensional point
        -
        115  using locator = typename View::locator; // N-dimensional locator
        -
        116  using iterator = typename View::iterator;
        -
        117  using const_iterator = typename View::const_iterator;
        -
        118  using reverse_iterator = typename View::reverse_iterator;
        -
        119  using size_type = typename View::size_type;
        -
        120  static const std::size_t N=View::num_dimensions;
        -
        121 
        -
        122  gil_function_requires<RandomAccessNDLocatorConcept<locator>>();
        -
        123  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<iterator>>();
        -
        124  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<reverse_iterator>>();
        -
        125 
        -
        126  using first_it_type = typename View::template axis<0>::iterator;
        -
        127  using last_it_type = typename View::template axis<N-1>::iterator;
        -
        128  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
        -
        129  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
        -
        130 
        -
        131 // static_assert(typename std::iterator_traits<first_it_type>::difference_type, typename point_t::template axis<0>::coord_t>::value, "");
        -
        132 // static_assert(typename std::iterator_traits<last_it_type>::difference_type, typename point_t::template axis<N-1>::coord_t>::value, "");
        -
        133 
        -
        134  // point_t must be an N-dimensional point, each dimension of which must have the same type as difference_type of the corresponding iterator
        -
        135  gil_function_requires<PointNDConcept<point_t>>();
        -
        136  static_assert(point_t::num_dimensions == N, "");
        -
        137  static_assert(std::is_same
        -
        138  <
        -
        139  typename std::iterator_traits<first_it_type>::difference_type,
        -
        140  typename point_t::template axis<0>::coord_t
        -
        141  >::value, "");
        -
        142  static_assert(std::is_same
        -
        143  <
        -
        144  typename std::iterator_traits<last_it_type>::difference_type,
        -
        145  typename point_t::template axis<N-1>::coord_t
        -
        146  >::value, "");
        -
        147 
        -
        148  point_t p;
        -
        149  locator lc;
        -
        150  iterator it;
        -
        151  reverse_iterator rit;
        -
        152  difference_type d; detail::initialize_it(d); ignore_unused_variable_warning(d);
        -
        153 
        -
        154  View(p,lc); // view must be constructible from a locator and a point
        -
        155 
        -
        156  p = view.dimensions();
        -
        157  lc = view.pixels();
        -
        158  size_type sz = view.size(); ignore_unused_variable_warning(sz);
        -
        159  bool is_contiguous = view.is_1d_traversable();
        -
        160  ignore_unused_variable_warning(is_contiguous);
        -
        161 
        -
        162  it = view.begin();
        -
        163  it = view.end();
        -
        164  rit = view.rbegin();
        -
        165  rit = view.rend();
        -
        166 
        -
        167  reference r1 = view[d]; ignore_unused_variable_warning(r1); // 1D access
        -
        168  reference r2 = view(p); ignore_unused_variable_warning(r2); // 2D access
        -
        169 
        -
        170  // get 1-D iterator of any dimension at a given pixel location
        -
        171  first_it_type fi = view.template axis_iterator<0>(p);
        -
        172  ignore_unused_variable_warning(fi);
        -
        173  last_it_type li = view.template axis_iterator<N-1>(p);
        -
        174  ignore_unused_variable_warning(li);
        -
        175 
        -
        176  using deref_t = PixelDereferenceAdaptorArchetype<typename View::value_type>;
        -
        177  using dtype = typename View::template add_deref<deref_t>::type;
        -
        178  }
        -
        179  View view;
        -
        180 };
        -
        181 
        -
        220 template <typename View>
        - -
        222 {
        -
        223  void constraints()
        -
        224  {
        -
        225  gil_function_requires<RandomAccessNDImageViewConcept<View>>();
        -
        226  static_assert(View::num_dimensions == 2, "");
        -
        227 
        -
        228  // TODO: This executes the requirements for RandomAccessNDLocatorConcept again. Fix it to improve compile time
        -
        229  gil_function_requires<RandomAccess2DLocatorConcept<typename View::locator>>();
        -
        230 
        -
        231  using dynamic_x_step_t = typename dynamic_x_step_type<View>::type;
        -
        232  using dynamic_y_step_t = typename dynamic_y_step_type<View>::type;
        -
        233  using transposed_t = typename transposed_type<View>::type;
        -
        234  using x_iterator = typename View::x_iterator;
        -
        235  using y_iterator = typename View::y_iterator;
        -
        236  using x_coord_t = typename View::x_coord_t;
        -
        237  using y_coord_t = typename View::y_coord_t;
        -
        238  using xy_locator = typename View::xy_locator;
        -
        239 
        -
        240  x_coord_t xd = 0; ignore_unused_variable_warning(xd);
        -
        241  y_coord_t yd = 0; ignore_unused_variable_warning(yd);
        -
        242  x_iterator xit;
        -
        243  y_iterator yit;
        -
        244  typename View::point_t d;
        -
        245 
        -
        246  View(xd, yd, xy_locator()); // constructible with width, height, 2d_locator
        -
        247 
        -
        248  xy_locator lc = view.xy_at(xd, yd);
        -
        249  lc = view.xy_at(d);
        -
        250 
        -
        251  typename View::reference r = view(xd, yd);
        -
        252  ignore_unused_variable_warning(r);
        -
        253  xd = view.width();
        -
        254  yd = view.height();
        -
        255 
        -
        256  xit = view.x_at(d);
        -
        257  xit = view.x_at(xd,yd);
        -
        258  xit = view.row_begin(xd);
        -
        259  xit = view.row_end(xd);
        -
        260 
        -
        261  yit = view.y_at(d);
        -
        262  yit = view.y_at(xd,yd);
        -
        263  yit = view.col_begin(xd);
        -
        264  yit = view.col_end(xd);
        -
        265  }
        -
        266  View view;
        -
        267 };
        -
        268 
        -
        273 template <typename View>
        - -
        275 {
        -
        276  void constraints()
        -
        277  {
        -
        278  using value_type = typename View::value_type;
        -
        279  using iterator = typename View::iterator;
        -
        280  using const_iterator = typename View::const_iterator;
        -
        281  using reference = typename View::reference;
        -
        282  using const_reference = typename View::const_reference;
        -
        283  using pointer = typename View::pointer;
        -
        284  using difference_type = typename View::difference_type;
        -
        285  using size_type= typename View::size_type;
        -
        286 
        -
        287  iterator i;
        -
        288  i = view1.begin();
        -
        289  i = view2.end();
        -
        290 
        -
        291  const_iterator ci;
        -
        292  ci = view1.begin();
        -
        293  ci = view2.end();
        -
        294 
        -
        295  size_type s;
        -
        296  s = view1.size();
        -
        297  s = view2.size();
        -
        298  ignore_unused_variable_warning(s);
        -
        299 
        -
        300  view1.empty();
        -
        301 
        -
        302  view1.swap(view2);
        -
        303  }
        -
        304  View view1;
        -
        305  View view2;
        -
        306 };
        -
        307 
        -
        312 template <typename View>
        - -
        314 {
        -
        315  void constraints()
        -
        316  {
        -
        317  gil_function_requires<CollectionImageViewConcept<View>>();
        -
        318 
        -
        319  using reference = typename View::reference;
        -
        320  using const_reference = typename View::const_reference;
        -
        321 
        -
        322  reference r = view.front();
        -
        323  ignore_unused_variable_warning(r);
        -
        324 
        -
        325  const_reference cr = view.front();
        -
        326  ignore_unused_variable_warning(cr);
        -
        327  }
        -
        328  View view;
        -
        329 };
        -
        330 
        -
        335 template <typename View>
        - -
        337 {
        -
        338  void constraints()
        -
        339  {
        -
        340  gil_function_requires<CollectionImageViewConcept<View>>();
        -
        341 
        -
        342  using reverse_iterator = typename View::reverse_iterator;
        -
        343  using reference = typename View::reference;
        -
        344  using const_reference = typename View::const_reference;
        -
        345 
        -
        346  reverse_iterator i;
        -
        347  i = view.rbegin();
        -
        348  i = view.rend();
        -
        349 
        -
        350  reference r = view.back();
        -
        351  ignore_unused_variable_warning(r);
        -
        352 
        -
        353  const_reference cr = view.back();
        -
        354  ignore_unused_variable_warning(cr);
        -
        355  }
        -
        356  View view;
        -
        357 };
        -
        358 
        -
        374 template <typename View>
        - -
        376 {
        -
        377  void constraints()
        -
        378  {
        -
        379  gil_function_requires<RandomAccess2DImageViewConcept<View>>();
        -
        380 
        -
        381  // TODO: This executes the requirements for RandomAccess2DLocatorConcept again. Fix it to improve compile time
        -
        382  gil_function_requires<PixelLocatorConcept<typename View::xy_locator>>();
        -
        383 
        -
        384  static_assert(std::is_same<typename View::x_coord_t, typename View::y_coord_t>::value, "");
        -
        385 
        -
        386  using coord_t = typename View::coord_t; // 1D difference type (same for all dimensions)
        -
        387  std::size_t num_chan = view.num_channels(); ignore_unused_variable_warning(num_chan);
        -
        388  }
        -
        389  View view;
        -
        390 };
        -
        391 
        -
        392 namespace detail {
        -
        393 
        -
        395 template <typename View>
        - -
        397 {
        -
        398  void constraints()
        -
        399  {
        -
        400  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<typename View::locator>>();
        -
        401 
        -
        402  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::iterator>>();
        -
        403 
        -
        404  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        -
        405  <
        -
        406  typename View::reverse_iterator
        -
        407  >>();
        -
        408 
        -
        409  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        -
        410  <
        -
        411  typename View::template axis<0>::iterator
        -
        412  >>();
        -
        413 
        -
        414  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        -
        415  <
        -
        416  typename View::template axis<View::num_dimensions - 1>::iterator
        -
        417  >>();
        -
        418 
        -
        419  typename View::difference_type diff;
        -
        420  initialize_it(diff);
        -
        421  ignore_unused_variable_warning(diff);
        -
        422 
        -
        423  typename View::point_t pt;
        -
        424  typename View::value_type v;
        -
        425  initialize_it(v);
        -
        426 
        -
        427  view[diff] = v;
        -
        428  view(pt) = v;
        -
        429  }
        -
        430  View view;
        -
        431 };
        -
        432 
        -
        434 template <typename View>
        - -
        436 {
        -
        437  void constraints()
        -
        438  {
        -
        439  gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
        -
        440  typename View::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
        -
        441  typename View::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
        -
        442  typename View::value_type v; initialize_it(v);
        -
        443  view(xd, yd) = v;
        -
        444  }
        -
        445  View view;
        -
        446 };
        -
        447 
        -
        449 template <typename View>
        - -
        451 {
        -
        452  void constraints()
        -
        453  {
        -
        454  gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
        -
        455  }
        -
        456 };
        -
        457 
        -
        458 } // namespace detail
        -
        459 
        -
        469 template <typename View>
        - -
        471 {
        -
        472  void constraints()
        -
        473  {
        -
        474  gil_function_requires<RandomAccessNDImageViewConcept<View>>();
        -
        475  gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
        -
        476  }
        -
        477 };
        -
        478 
        -
        486 template <typename View>
        - -
        488 {
        -
        489  void constraints()
        -
        490  {
        -
        491  gil_function_requires<RandomAccess2DImageViewConcept<View>>();
        -
        492  gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
        -
        493  }
        -
        494 };
        -
        495 
        -
        503 template <typename View>
        - -
        505 {
        -
        506  void constraints()
        -
        507  {
        -
        508  gil_function_requires<ImageViewConcept<View>>();
        -
        509  gil_function_requires<detail::PixelImageViewIsMutableConcept<View>>();
        -
        510  }
        -
        511 };
        -
        512 
        -
        521 template <typename V1, typename V2>
        - -
        523  : pixels_are_compatible<typename V1::value_type, typename V2::value_type>
        -
        524 {
        -
        525 };
        -
        526 
        -
        538 template <typename V1, typename V2>
        - -
        540 {
        -
        541  void constraints()
        -
        542  {
        -
        543  static_assert(views_are_compatible<V1, V2>::value, "");
        -
        544  }
        -
        545 };
        -
        546 
        -
        547 }} // namespace boost::gil
        -
        548 
        -
        549 #if defined(BOOST_CLANG)
        -
        550 #pragma clang diagnostic pop
        -
        551 #endif
        -
        552 
        -
        553 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        554 #pragma GCC diagnostic pop
        -
        555 #endif
        -
        556 
        -
        557 #endif
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP
        +
        9#define BOOST_GIL_CONCEPTS_IMAGE_VIEW_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/concept_check.hpp>
        +
        13#include <boost/gil/concepts/fwd.hpp>
        +
        14#include <boost/gil/concepts/pixel.hpp>
        +
        15#include <boost/gil/concepts/pixel_dereference.hpp>
        +
        16#include <boost/gil/concepts/pixel_iterator.hpp>
        +
        17#include <boost/gil/concepts/pixel_locator.hpp>
        +
        18#include <boost/gil/concepts/point.hpp>
        +
        19#include <boost/gil/concepts/detail/utility.hpp>
        +
        20
        +
        21#include <cstddef>
        +
        22#include <iterator>
        +
        23#include <type_traits>
        +
        24
        +
        25#if defined(BOOST_CLANG)
        +
        26#pragma clang diagnostic push
        +
        27#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        28#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        29#endif
        +
        30
        +
        31#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        32#pragma GCC diagnostic push
        +
        33#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        34#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
        +
        35#endif
        +
        36
        +
        37namespace boost { namespace gil {
        +
        38
        +
        42
        +
        46
        +
        50
        +
        102template <typename View>
        +
        + +
        104{
        +
        105 void constraints()
        +
        106 {
        +
        107 gil_function_requires<Regular<View>>();
        +
        108
        +
        109 using value_type = typename View::value_type;
        +
        110 using reference = typename View::reference; // result of dereferencing
        +
        111 using pointer = typename View::pointer;
        +
        112 using difference_type = typename View::difference_type; // result of operator-(1d_iterator,1d_iterator)
        +
        113 using const_t = typename View::const_t; // same as this type, but over const values
        +
        114 using point_t = typename View::point_t; // N-dimensional point
        +
        115 using locator = typename View::locator; // N-dimensional locator
        +
        116 using iterator = typename View::iterator;
        +
        117 using const_iterator = typename View::const_iterator;
        +
        118 using reverse_iterator = typename View::reverse_iterator;
        +
        119 using size_type = typename View::size_type;
        +
        120 static const std::size_t N=View::num_dimensions;
        +
        121
        +
        122 gil_function_requires<RandomAccessNDLocatorConcept<locator>>();
        +
        123 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<iterator>>();
        +
        124 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<reverse_iterator>>();
        +
        125
        +
        126 using first_it_type = typename View::template axis<0>::iterator;
        +
        127 using last_it_type = typename View::template axis<N-1>::iterator;
        +
        128 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
        +
        129 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
        +
        130
        +
        131// static_assert(typename std::iterator_traits<first_it_type>::difference_type, typename point_t::template axis<0>::coord_t>::value, "");
        +
        132// static_assert(typename std::iterator_traits<last_it_type>::difference_type, typename point_t::template axis<N-1>::coord_t>::value, "");
        +
        133
        +
        134 // point_t must be an N-dimensional point, each dimension of which must have the same type as difference_type of the corresponding iterator
        +
        135 gil_function_requires<PointNDConcept<point_t>>();
        +
        136 static_assert(point_t::num_dimensions == N, "");
        +
        137 static_assert(std::is_same
        +
        138 <
        +
        139 typename std::iterator_traits<first_it_type>::difference_type,
        +
        140 typename point_t::template axis<0>::coord_t
        +
        141 >::value, "");
        +
        142 static_assert(std::is_same
        +
        143 <
        +
        144 typename std::iterator_traits<last_it_type>::difference_type,
        +
        145 typename point_t::template axis<N-1>::coord_t
        +
        146 >::value, "");
        +
        147
        +
        148 point_t p;
        +
        149 locator lc;
        +
        150 iterator it;
        +
        151 reverse_iterator rit;
        +
        152 difference_type d; detail::initialize_it(d); ignore_unused_variable_warning(d);
        +
        153
        +
        154 View(p,lc); // view must be constructible from a locator and a point
        +
        155
        +
        156 p = view.dimensions();
        +
        157 lc = view.pixels();
        +
        158 size_type sz = view.size(); ignore_unused_variable_warning(sz);
        +
        159 bool is_contiguous = view.is_1d_traversable();
        +
        160 ignore_unused_variable_warning(is_contiguous);
        +
        161
        +
        162 it = view.begin();
        +
        163 it = view.end();
        +
        164 rit = view.rbegin();
        +
        165 rit = view.rend();
        +
        166
        +
        167 reference r1 = view[d]; ignore_unused_variable_warning(r1); // 1D access
        +
        168 reference r2 = view(p); ignore_unused_variable_warning(r2); // 2D access
        +
        169
        +
        170 // get 1-D iterator of any dimension at a given pixel location
        +
        171 first_it_type fi = view.template axis_iterator<0>(p);
        +
        172 ignore_unused_variable_warning(fi);
        +
        173 last_it_type li = view.template axis_iterator<N-1>(p);
        +
        174 ignore_unused_variable_warning(li);
        +
        175
        +
        176 using deref_t = PixelDereferenceAdaptorArchetype<typename View::value_type>;
        +
        177 using dtype = typename View::template add_deref<deref_t>::type;
        +
        178 }
        +
        179 View view;
        +
        180};
        +
        +
        181
        +
        220template <typename View>
        +
        + +
        222{
        +
        223 void constraints()
        +
        224 {
        +
        225 gil_function_requires<RandomAccessNDImageViewConcept<View>>();
        +
        226 static_assert(View::num_dimensions == 2, "");
        +
        227
        +
        228 // TODO: This executes the requirements for RandomAccessNDLocatorConcept again. Fix it to improve compile time
        +
        229 gil_function_requires<RandomAccess2DLocatorConcept<typename View::locator>>();
        +
        230
        +
        231 using dynamic_x_step_t = typename dynamic_x_step_type<View>::type;
        +
        232 using dynamic_y_step_t = typename dynamic_y_step_type<View>::type;
        +
        233 using transposed_t = typename transposed_type<View>::type;
        +
        234 using x_iterator = typename View::x_iterator;
        +
        235 using y_iterator = typename View::y_iterator;
        +
        236 using x_coord_t = typename View::x_coord_t;
        +
        237 using y_coord_t = typename View::y_coord_t;
        +
        238 using xy_locator = typename View::xy_locator;
        +
        239
        +
        240 x_coord_t xd = 0; ignore_unused_variable_warning(xd);
        +
        241 y_coord_t yd = 0; ignore_unused_variable_warning(yd);
        +
        242 x_iterator xit;
        +
        243 y_iterator yit;
        +
        244 typename View::point_t d;
        +
        245
        +
        246 View(xd, yd, xy_locator()); // constructible with width, height, 2d_locator
        +
        247
        +
        248 xy_locator lc = view.xy_at(xd, yd);
        +
        249 lc = view.xy_at(d);
        +
        250
        +
        251 typename View::reference r = view(xd, yd);
        +
        252 ignore_unused_variable_warning(r);
        +
        253 xd = view.width();
        +
        254 yd = view.height();
        +
        255
        +
        256 xit = view.x_at(d);
        +
        257 xit = view.x_at(xd,yd);
        +
        258 xit = view.row_begin(xd);
        +
        259 xit = view.row_end(xd);
        +
        260
        +
        261 yit = view.y_at(d);
        +
        262 yit = view.y_at(xd,yd);
        +
        263 yit = view.col_begin(xd);
        +
        264 yit = view.col_end(xd);
        +
        265 }
        +
        266 View view;
        +
        267};
        +
        +
        268
        +
        273template <typename View>
        +
        + +
        275{
        +
        276 void constraints()
        +
        277 {
        +
        278 using value_type = typename View::value_type;
        +
        279 using iterator = typename View::iterator;
        +
        280 using const_iterator = typename View::const_iterator;
        +
        281 using reference = typename View::reference;
        +
        282 using const_reference = typename View::const_reference;
        +
        283 using pointer = typename View::pointer;
        +
        284 using difference_type = typename View::difference_type;
        +
        285 using size_type= typename View::size_type;
        +
        286
        +
        287 iterator i;
        +
        288 i = view1.begin();
        +
        289 i = view2.end();
        +
        290
        +
        291 const_iterator ci;
        +
        292 ci = view1.begin();
        +
        293 ci = view2.end();
        +
        294
        +
        295 size_type s;
        +
        296 s = view1.size();
        +
        297 s = view2.size();
        +
        298 ignore_unused_variable_warning(s);
        +
        299
        +
        300 view1.empty();
        +
        301
        +
        302 view1.swap(view2);
        +
        303 }
        +
        304 View view1;
        +
        305 View view2;
        +
        306};
        +
        +
        307
        +
        312template <typename View>
        +
        + +
        314{
        +
        315 void constraints()
        +
        316 {
        +
        317 gil_function_requires<CollectionImageViewConcept<View>>();
        +
        318
        +
        319 using reference = typename View::reference;
        +
        320 using const_reference = typename View::const_reference;
        +
        321
        +
        322 reference r = view.front();
        +
        323 ignore_unused_variable_warning(r);
        +
        324
        +
        325 const_reference cr = view.front();
        +
        326 ignore_unused_variable_warning(cr);
        +
        327 }
        +
        328 View view;
        +
        329};
        +
        +
        330
        +
        335template <typename View>
        +
        + +
        337{
        +
        338 void constraints()
        +
        339 {
        +
        340 gil_function_requires<CollectionImageViewConcept<View>>();
        +
        341
        +
        342 using reverse_iterator = typename View::reverse_iterator;
        +
        343 using reference = typename View::reference;
        +
        344 using const_reference = typename View::const_reference;
        +
        345
        +
        346 reverse_iterator i;
        +
        347 i = view.rbegin();
        +
        348 i = view.rend();
        +
        349
        +
        350 reference r = view.back();
        +
        351 ignore_unused_variable_warning(r);
        +
        352
        +
        353 const_reference cr = view.back();
        +
        354 ignore_unused_variable_warning(cr);
        +
        355 }
        +
        356 View view;
        +
        357};
        +
        +
        358
        +
        374template <typename View>
        +
        + +
        376{
        +
        377 void constraints()
        +
        378 {
        +
        379 gil_function_requires<RandomAccess2DImageViewConcept<View>>();
        +
        380
        +
        381 // TODO: This executes the requirements for RandomAccess2DLocatorConcept again. Fix it to improve compile time
        +
        382 gil_function_requires<PixelLocatorConcept<typename View::xy_locator>>();
        +
        383
        +
        384 static_assert(std::is_same<typename View::x_coord_t, typename View::y_coord_t>::value, "");
        +
        385
        +
        386 using coord_t = typename View::coord_t; // 1D difference type (same for all dimensions)
        +
        387 std::size_t num_chan = view.num_channels(); ignore_unused_variable_warning(num_chan);
        +
        388 }
        +
        389 View view;
        +
        390};
        +
        +
        391
        +
        392namespace detail {
        +
        393
        +
        395template <typename View>
        +
        + +
        397{
        +
        398 void constraints()
        +
        399 {
        +
        400 gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<typename View::locator>>();
        +
        401
        +
        402 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::iterator>>();
        +
        403
        +
        404 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        +
        405 <
        +
        406 typename View::reverse_iterator
        +
        407 >>();
        +
        408
        +
        409 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        +
        410 <
        +
        411 typename View::template axis<0>::iterator
        +
        412 >>();
        +
        413
        +
        414 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        +
        415 <
        +
        416 typename View::template axis<View::num_dimensions - 1>::iterator
        +
        417 >>();
        +
        418
        +
        419 typename View::difference_type diff;
        +
        420 initialize_it(diff);
        +
        421 ignore_unused_variable_warning(diff);
        +
        422
        +
        423 typename View::point_t pt;
        +
        424 typename View::value_type v;
        +
        425 initialize_it(v);
        +
        426
        +
        427 view[diff] = v;
        +
        428 view(pt) = v;
        +
        429 }
        +
        430 View view;
        +
        431};
        +
        +
        432
        +
        434template <typename View>
        +
        + +
        436{
        +
        437 void constraints()
        +
        438 {
        +
        439 gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
        +
        440 typename View::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
        +
        441 typename View::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
        +
        442 typename View::value_type v; initialize_it(v);
        +
        443 view(xd, yd) = v;
        +
        444 }
        +
        445 View view;
        +
        446};
        +
        +
        447
        +
        449template <typename View>
        +
        + +
        451{
        +
        452 void constraints()
        +
        453 {
        +
        454 gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
        +
        455 }
        +
        456};
        +
        +
        457
        +
        458} // namespace detail
        +
        459
        +
        469template <typename View>
        +
        + +
        471{
        +
        472 void constraints()
        +
        473 {
        +
        474 gil_function_requires<RandomAccessNDImageViewConcept<View>>();
        +
        475 gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View>>();
        +
        476 }
        +
        477};
        +
        +
        478
        +
        486template <typename View>
        +
        + +
        488{
        +
        489 void constraints()
        +
        490 {
        +
        491 gil_function_requires<RandomAccess2DImageViewConcept<View>>();
        +
        492 gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View>>();
        +
        493 }
        +
        494};
        +
        +
        495
        +
        503template <typename View>
        +
        + +
        505{
        +
        506 void constraints()
        +
        507 {
        +
        508 gil_function_requires<ImageViewConcept<View>>();
        +
        509 gil_function_requires<detail::PixelImageViewIsMutableConcept<View>>();
        +
        510 }
        +
        511};
        +
        +
        512
        +
        521template <typename V1, typename V2>
        +
        + +
        523 : pixels_are_compatible<typename V1::value_type, typename V2::value_type>
        +
        524{
        +
        525};
        +
        +
        526
        +
        538template <typename V1, typename V2>
        +
        + +
        540{
        +
        541 void constraints()
        +
        542 {
        +
        543 static_assert(views_are_compatible<V1, V2>::value, "");
        +
        544 }
        +
        545};
        +
        +
        546
        +
        547}} // namespace boost::gil
        +
        548
        +
        549#if defined(BOOST_CLANG)
        +
        550#pragma clang diagnostic pop
        +
        551#endif
        +
        552
        +
        553#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        554#pragma GCC diagnostic pop
        +
        555#endif
        +
        556
        +
        557#endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        GIL view as Collection.
        Definition: concepts/image_view.hpp:275
        -
        GIL view as ForwardCollection.
        Definition: concepts/image_view.hpp:314
        -
        GIL's 2-dimensional view over immutable GIL pixels.
        Definition: concepts/image_view.hpp:376
        -
        GIL's 2-dimensional view over mutable GIL pixels.
        Definition: concepts/image_view.hpp:505
        -
        2-dimensional view over mutable values
        Definition: concepts/image_view.hpp:488
        -
        N-dimensional view over mutable values.
        Definition: concepts/image_view.hpp:471
        -
        2-dimensional view over immutable values
        Definition: concepts/image_view.hpp:222
        -
        N-dimensional view over immutable values.
        Definition: concepts/image_view.hpp:104
        -
        GIL view as ReversibleCollection.
        Definition: concepts/image_view.hpp:337
        -
        Views are compatible if they have the same color spaces and compatible channel values.
        Definition: concepts/image_view.hpp:540
        -
        Definition: concepts/image_view.hpp:451
        - - -
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition: dynamic_step.hpp:17
        -
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition: dynamic_step.hpp:21
        -
        Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
        Definition: concepts/pixel.hpp:239
        -
        Returns whether two views are compatible.
        Definition: concepts/image_view.hpp:524
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        GIL view as Collection.
        Definition concepts/image_view.hpp:275
        +
        GIL view as ForwardCollection.
        Definition concepts/image_view.hpp:314
        +
        GIL's 2-dimensional view over immutable GIL pixels.
        Definition concepts/image_view.hpp:376
        +
        GIL's 2-dimensional view over mutable GIL pixels.
        Definition concepts/image_view.hpp:505
        +
        2-dimensional view over mutable values
        Definition concepts/image_view.hpp:488
        +
        N-dimensional view over mutable values.
        Definition concepts/image_view.hpp:471
        +
        2-dimensional view over immutable values
        Definition concepts/image_view.hpp:222
        +
        N-dimensional view over immutable values.
        Definition concepts/image_view.hpp:104
        +
        GIL view as ReversibleCollection.
        Definition concepts/image_view.hpp:337
        +
        Views are compatible if they have the same color spaces and compatible channel values.
        Definition concepts/image_view.hpp:540
        +
        Definition concepts/image_view.hpp:451
        + + +
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition dynamic_step.hpp:17
        +
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition dynamic_step.hpp:21
        +
        Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
        Definition concepts/pixel.hpp:239
        +
        Returns whether two views are compatible.
        Definition concepts/image_view.hpp:524
        diff --git a/html/reference/concepts_2pixel_8hpp_source.html b/html/reference/concepts_2pixel_8hpp_source.html index 1b8a53298..f9a6ee43a 100644 --- a/html/reference/concepts_2pixel_8hpp_source.html +++ b/html/reference/concepts_2pixel_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel.hpp Source File @@ -27,240 +27,263 @@

        - + +/* @license-end */ + +
        -
        -
        concepts/pixel.hpp
        +
        concepts/pixel.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_PIXEL_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/channel.hpp>
        -
        13 #include <boost/gil/concepts/color.hpp>
        -
        14 #include <boost/gil/concepts/color_base.hpp>
        -
        15 #include <boost/gil/concepts/concept_check.hpp>
        -
        16 #include <boost/gil/concepts/fwd.hpp>
        -
        17 #include <boost/gil/concepts/pixel_based.hpp>
        -
        18 #include <boost/gil/concepts/detail/type_traits.hpp>
        -
        19 #include <boost/gil/detail/mp11.hpp>
        -
        20 
        -
        21 #include <cstddef>
        -
        22 #include <type_traits>
        -
        23 
        -
        24 #if defined(BOOST_CLANG)
        -
        25 #pragma clang diagnostic push
        -
        26 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        27 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        28 #endif
        -
        29 
        -
        30 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        31 #pragma GCC diagnostic push
        -
        32 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        33 #endif
        -
        34 
        -
        35 namespace boost { namespace gil {
        -
        36 
        -
        62 template <typename P>
        - -
        64 {
        -
        65  void constraints()
        -
        66  {
        -
        67  gil_function_requires<ColorBaseConcept<P>>();
        -
        68  gil_function_requires<PixelBasedConcept<P>>();
        -
        69 
        -
        70  static_assert(is_pixel<P>::value, "");
        -
        71  static const bool is_mutable = P::is_mutable;
        -
        72  ignore_unused_variable_warning(is_mutable);
        -
        73 
        -
        74  using value_type = typename P::value_type;
        -
        75  // TODO: Is the cyclic dependency intentional? --mloskot
        -
        76  // gil_function_requires<PixelValueConcept<value_type>>();
        -
        77 
        -
        78  using reference = typename P::reference;
        -
        79  gil_function_requires<PixelConcept
        -
        80  <
        -
        81  typename detail::remove_const_and_reference<reference>::type
        -
        82  >>();
        -
        83 
        -
        84  using const_reference = typename P::const_reference;
        -
        85  gil_function_requires<PixelConcept
        -
        86  <
        -
        87  typename detail::remove_const_and_reference<const_reference>::type
        -
        88  >>();
        -
        89  }
        -
        90 };
        -
        91 
        -
        100 template <typename P>
        - -
        102 {
        -
        103  void constraints()
        -
        104  {
        -
        105  gil_function_requires<PixelConcept<P>>();
        -
        106  static_assert(P::is_mutable, "");
        -
        107  }
        -
        108 };
        -
        109 
        -
        122 template <typename P>
        - -
        124 {
        -
        125  void constraints()
        -
        126  {
        -
        127  gil_function_requires<PixelConcept<P>>();
        -
        128  gil_function_requires<HomogeneousColorBaseConcept<P>>();
        -
        129  gil_function_requires<HomogeneousPixelBasedConcept<P>>();
        -
        130  p[0];
        -
        131  }
        -
        132  P p;
        -
        133 };
        -
        134 
        -
        147 template <typename P>
        - -
        149 {
        -
        150  void constraints()
        -
        151  {
        -
        152  gil_function_requires<HomogeneousPixelConcept<P>>();
        -
        153  gil_function_requires<MutableHomogeneousColorBaseConcept<P>>();
        -
        154  p[0] = v;
        -
        155  v = p[0];
        -
        156  }
        -
        157  typename P::template element_type<P>::type v;
        -
        158  P p;
        -
        159 };
        -
        160 
        -
        169 template <typename P>
        - -
        171 {
        -
        172  void constraints()
        -
        173  {
        -
        174  gil_function_requires<PixelConcept<P>>();
        -
        175  gil_function_requires<Regular<P>>();
        -
        176  }
        -
        177 };
        -
        178 
        -
        187 template <typename P>
        - -
        189 {
        -
        190  void constraints()
        -
        191  {
        -
        192  gil_function_requires<HomogeneousPixelConcept<P>>();
        -
        193  gil_function_requires<Regular<P>>();
        -
        194  static_assert(std::is_same<P, typename P::value_type>::value, "");
        -
        195  }
        -
        196 };
        -
        197 
        -
        198 namespace detail {
        -
        199 
        -
        200 template <typename P1, typename P2, int K>
        -
        201 struct channels_are_pairwise_compatible
        -
        202  : mp11::mp_and
        -
        203  <
        -
        204  channels_are_pairwise_compatible<P1, P2, K - 1>,
        -
        205  channels_are_compatible
        -
        206  <
        -
        207  typename kth_semantic_element_reference_type<P1, K>::type,
        -
        208  typename kth_semantic_element_reference_type<P2, K>::type
        -
        209  >
        -
        210  >
        -
        211 {
        -
        212 };
        -
        213 
        -
        214 template <typename P1, typename P2>
        -
        215 struct channels_are_pairwise_compatible<P1, P2, -1> : std::true_type {};
        -
        216 
        -
        217 } // namespace detail
        -
        218 
        -
        225 template <typename P1, typename P2>
        - -
        227  : mp11::mp_and
        -
        228  <
        -
        229  typename color_spaces_are_compatible
        -
        230  <
        -
        231  typename color_space_type<P1>::type,
        -
        232  typename color_space_type<P2>::type
        -
        233  >::type,
        -
        234  detail::channels_are_pairwise_compatible
        -
        235  <
        -
        236  P1, P2, num_channels<P1>::value - 1
        -
        237  >
        -
        238  >
        -
        239 {
        -
        240 };
        -
        241 
        -
        255 template <typename P1, typename P2>
        - -
        257 {
        -
        258  void constraints()
        -
        259  {
        -
        260  static_assert(pixels_are_compatible<P1, P2>::value, "");
        -
        261  }
        -
        262 };
        -
        263 
        -
        276 template <typename SrcP, typename DstP>
        - -
        278 {
        -
        279  void constraints()
        -
        280  {
        -
        281  gil_function_requires<PixelConcept<SrcP>>();
        -
        282  gil_function_requires<MutablePixelConcept<DstP>>();
        -
        283  color_convert(src, dst);
        -
        284  }
        -
        285  SrcP src;
        -
        286  DstP dst;
        -
        287 };
        -
        288 
        -
        289 }} // namespace boost::gil
        -
        290 
        -
        291 #if defined(BOOST_CLANG)
        -
        292 #pragma clang diagnostic pop
        -
        293 #endif
        -
        294 
        -
        295 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        296 #pragma GCC diagnostic pop
        -
        297 #endif
        -
        298 
        -
        299 #endif
        -
        void color_convert(const SrcP &src, DstP &dst)
        helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
        Definition: color_convert.hpp:342
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Homogeneous pixel concept.
        Definition: concepts/pixel.hpp:124
        -
        Homogeneous pixel concept that is a Regular type.
        Definition: concepts/pixel.hpp:189
        -
        Homogeneous pixel concept that allows for changing its channels.
        Definition: concepts/pixel.hpp:149
        -
        Pixel concept that allows for changing its channels.
        Definition: concepts/pixel.hpp:102
        -
        Pixel concept - A color base whose elements are channels.
        Definition: concepts/pixel.hpp:64
        -
        Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
        Definition: concepts/pixel.hpp:278
        -
        Pixel concept that is a Regular type.
        Definition: concepts/pixel.hpp:171
        -
        Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
        Definition: concepts/pixel.hpp:257
        -
        Specifies the element type of a homogeneous color base.
        Definition: color_base_algorithm.hpp:225
        -
        Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
        Definition: concepts/pixel.hpp:239
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_PIXEL_HPP
        +
        9#define BOOST_GIL_CONCEPTS_PIXEL_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/channel.hpp>
        +
        13#include <boost/gil/concepts/color.hpp>
        +
        14#include <boost/gil/concepts/color_base.hpp>
        +
        15#include <boost/gil/concepts/concept_check.hpp>
        +
        16#include <boost/gil/concepts/fwd.hpp>
        +
        17#include <boost/gil/concepts/pixel_based.hpp>
        +
        18#include <boost/gil/concepts/detail/type_traits.hpp>
        +
        19#include <boost/gil/detail/mp11.hpp>
        +
        20
        +
        21#include <cstddef>
        +
        22#include <type_traits>
        +
        23
        +
        24#if defined(BOOST_CLANG)
        +
        25#pragma clang diagnostic push
        +
        26#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        27#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        28#endif
        +
        29
        +
        30#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        31#pragma GCC diagnostic push
        +
        32#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        33#endif
        +
        34
        +
        35namespace boost { namespace gil {
        +
        36
        +
        62template <typename P>
        +
        + +
        64{
        +
        65 void constraints()
        +
        66 {
        +
        67 gil_function_requires<ColorBaseConcept<P>>();
        +
        68 gil_function_requires<PixelBasedConcept<P>>();
        +
        69
        +
        70 static_assert(is_pixel<P>::value, "");
        +
        71 static const bool is_mutable = P::is_mutable;
        +
        72 ignore_unused_variable_warning(is_mutable);
        +
        73
        +
        74 using value_type = typename P::value_type;
        +
        75 // TODO: Is the cyclic dependency intentional? --mloskot
        +
        76 // gil_function_requires<PixelValueConcept<value_type>>();
        +
        77
        +
        78 using reference = typename P::reference;
        +
        79 gil_function_requires<PixelConcept
        +
        80 <
        +
        81 typename detail::remove_const_and_reference<reference>::type
        +
        82 >>();
        +
        83
        +
        84 using const_reference = typename P::const_reference;
        +
        85 gil_function_requires<PixelConcept
        +
        86 <
        +
        87 typename detail::remove_const_and_reference<const_reference>::type
        +
        88 >>();
        +
        89 }
        +
        90};
        +
        +
        91
        +
        100template <typename P>
        +
        + +
        102{
        +
        103 void constraints()
        +
        104 {
        +
        105 gil_function_requires<PixelConcept<P>>();
        +
        106 static_assert(P::is_mutable, "");
        +
        107 }
        +
        108};
        +
        +
        109
        +
        122template <typename P>
        +
        + +
        124{
        +
        125 void constraints()
        +
        126 {
        +
        127 gil_function_requires<PixelConcept<P>>();
        +
        128 gil_function_requires<HomogeneousColorBaseConcept<P>>();
        +
        129 gil_function_requires<HomogeneousPixelBasedConcept<P>>();
        +
        130 p[0];
        +
        131 }
        +
        132 P p;
        +
        133};
        +
        +
        134
        +
        147template <typename P>
        +
        + +
        149{
        +
        150 void constraints()
        +
        151 {
        +
        152 gil_function_requires<HomogeneousPixelConcept<P>>();
        +
        153 gil_function_requires<MutableHomogeneousColorBaseConcept<P>>();
        +
        154 p[0] = v;
        +
        155 v = p[0];
        +
        156 }
        +
        157 typename P::template element_type<P>::type v;
        +
        158 P p;
        +
        159};
        +
        +
        160
        +
        169template <typename P>
        +
        + +
        171{
        +
        172 void constraints()
        +
        173 {
        +
        174 gil_function_requires<PixelConcept<P>>();
        +
        175 gil_function_requires<Regular<P>>();
        +
        176 }
        +
        177};
        +
        +
        178
        +
        187template <typename P>
        +
        + +
        189{
        +
        190 void constraints()
        +
        191 {
        +
        192 gil_function_requires<HomogeneousPixelConcept<P>>();
        +
        193 gil_function_requires<Regular<P>>();
        +
        194 static_assert(std::is_same<P, typename P::value_type>::value, "");
        +
        195 }
        +
        196};
        +
        +
        197
        +
        198namespace detail {
        +
        199
        +
        200template <typename P1, typename P2, int K>
        +
        201struct channels_are_pairwise_compatible
        +
        202 : mp11::mp_and
        +
        203 <
        +
        204 channels_are_pairwise_compatible<P1, P2, K - 1>,
        +
        205 channels_are_compatible
        +
        206 <
        +
        207 typename kth_semantic_element_reference_type<P1, K>::type,
        +
        208 typename kth_semantic_element_reference_type<P2, K>::type
        +
        209 >
        +
        210 >
        +
        211{
        +
        212};
        +
        213
        +
        214template <typename P1, typename P2>
        +
        215struct channels_are_pairwise_compatible<P1, P2, -1> : std::true_type {};
        +
        216
        +
        217} // namespace detail
        +
        218
        +
        225template <typename P1, typename P2>
        +
        + +
        227 : mp11::mp_and
        +
        228 <
        +
        229 typename color_spaces_are_compatible
        +
        230 <
        +
        231 typename color_space_type<P1>::type,
        +
        232 typename color_space_type<P2>::type
        +
        233 >::type,
        +
        234 detail::channels_are_pairwise_compatible
        +
        235 <
        +
        236 P1, P2, num_channels<P1>::value - 1
        +
        237 >
        +
        238 >
        +
        239{
        +
        240};
        +
        +
        241
        +
        255template <typename P1, typename P2>
        +
        + +
        257{
        +
        258 void constraints()
        +
        259 {
        +
        260 static_assert(pixels_are_compatible<P1, P2>::value, "");
        +
        261 }
        +
        262};
        +
        +
        263
        +
        276template <typename SrcP, typename DstP>
        +
        + +
        278{
        +
        279 void constraints()
        +
        280 {
        +
        281 gil_function_requires<PixelConcept<SrcP>>();
        +
        282 gil_function_requires<MutablePixelConcept<DstP>>();
        +
        283 color_convert(src, dst);
        +
        284 }
        +
        285 SrcP src;
        +
        286 DstP dst;
        +
        287};
        +
        +
        288
        +
        289}} // namespace boost::gil
        +
        290
        +
        291#if defined(BOOST_CLANG)
        +
        292#pragma clang diagnostic pop
        +
        293#endif
        +
        294
        +
        295#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        296#pragma GCC diagnostic pop
        +
        297#endif
        +
        298
        +
        299#endif
        +
        void color_convert(const SrcP &src, DstP &dst)
        helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
        Definition color_convert.hpp:342
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Homogeneous pixel concept.
        Definition concepts/pixel.hpp:124
        +
        Homogeneous pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:189
        +
        Homogeneous pixel concept that allows for changing its channels.
        Definition concepts/pixel.hpp:149
        +
        Pixel concept that allows for changing its channels.
        Definition concepts/pixel.hpp:102
        +
        Pixel concept - A color base whose elements are channels.
        Definition concepts/pixel.hpp:64
        +
        Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
        Definition concepts/pixel.hpp:278
        +
        Pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:171
        +
        Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
        Definition concepts/pixel.hpp:257
        +
        Specifies the element type of a homogeneous color base.
        Definition color_base_algorithm.hpp:225
        +
        Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
        Definition concepts/pixel.hpp:239
        diff --git a/html/reference/concepts_2pixel__iterator_8hpp_source.html b/html/reference/concepts_2pixel__iterator_8hpp_source.html index 05f34a8bf..eb14cf68a 100644 --- a/html/reference/concepts_2pixel__iterator_8hpp_source.html +++ b/html/reference/concepts_2pixel__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_iterator.hpp Source File @@ -27,302 +27,325 @@

        - + +/* @license-end */ + +
        -
        -
        concepts/pixel_iterator.hpp
        +
        concepts/pixel_iterator.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_ITERATOR_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_PIXEL_ITERATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/channel.hpp>
        -
        12 #include <boost/gil/concepts/color.hpp>
        -
        13 #include <boost/gil/concepts/concept_check.hpp>
        -
        14 #include <boost/gil/concepts/fwd.hpp>
        -
        15 #include <boost/gil/concepts/pixel.hpp>
        -
        16 #include <boost/gil/concepts/pixel_based.hpp>
        -
        17 
        -
        18 #include <boost/iterator/iterator_concepts.hpp>
        -
        19 
        -
        20 #include <cstddef>
        -
        21 #include <iterator>
        -
        22 #include <type_traits>
        -
        23 
        -
        24 #if defined(BOOST_CLANG)
        -
        25 #pragma clang diagnostic push
        -
        26 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        27 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        28 #endif
        -
        29 
        -
        30 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        31 #pragma GCC diagnostic push
        -
        32 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        33 #endif
        -
        34 
        -
        35 namespace boost { namespace gil {
        -
        36 
        -
        37 // Forward declarations
        -
        38 template <typename It> struct const_iterator_type;
        -
        39 template <typename It> struct iterator_is_mutable;
        -
        40 template <typename It> struct is_iterator_adaptor;
        -
        41 template <typename It, typename NewBaseIt> struct iterator_adaptor_rebind;
        -
        42 template <typename It> struct iterator_adaptor_get_base;
        -
        43 
        -
        44 // These iterator mutability concepts are taken from Boost concept_check.hpp.
        -
        45 // Isolating mutability to result in faster compile time
        -
        46 namespace detail {
        -
        47 
        -
        48 // Preconditions: TT Models boost_concepts::ForwardTraversalConcept
        -
        49 template <class TT>
        -
        50 struct ForwardIteratorIsMutableConcept
        -
        51 {
        -
        52  void constraints()
        -
        53  {
        -
        54  auto const tmp = *i;
        -
        55  *i++ = tmp; // require postincrement and assignment
        -
        56  }
        -
        57  TT i;
        -
        58 };
        -
        59 
        -
        60 // Preconditions: TT Models boost::BidirectionalIteratorConcept
        -
        61 template <class TT>
        -
        62 struct BidirectionalIteratorIsMutableConcept
        -
        63 {
        -
        64  void constraints()
        -
        65  {
        -
        66  gil_function_requires< ForwardIteratorIsMutableConcept<TT>>();
        -
        67  auto const tmp = *i;
        -
        68  *i-- = tmp; // require postdecrement and assignment
        -
        69  }
        -
        70  TT i;
        -
        71 };
        -
        72 
        -
        73 // Preconditions: TT Models boost_concepts::RandomAccessTraversalConcept
        -
        74 template <class TT>
        -
        75 struct RandomAccessIteratorIsMutableConcept
        -
        76 {
        -
        77  void constraints()
        -
        78  {
        -
        79  gil_function_requires<BidirectionalIteratorIsMutableConcept<TT>>();
        -
        80 
        -
        81  typename std::iterator_traits<TT>::difference_type n = 0;
        -
        82  ignore_unused_variable_warning(n);
        -
        83  i[n] = *i; // require element access and assignment
        -
        84  }
        -
        85  TT i;
        -
        86 };
        -
        87 
        -
        88 // Iterators that can be used as the base of memory_based_step_iterator require some additional functions
        -
        89 // \tparam Iterator Models boost_concepts::RandomAccessTraversalConcept
        -
        90 template <typename Iterator>
        -
        91 struct RandomAccessIteratorIsMemoryBasedConcept
        -
        92 {
        -
        93  void constraints()
        -
        94  {
        -
        95  std::ptrdiff_t bs = memunit_step(it);
        -
        96  ignore_unused_variable_warning(bs);
        -
        97 
        -
        98  it = memunit_advanced(it, 3);
        -
        99  std::ptrdiff_t bd = memunit_distance(it, it);
        -
        100  ignore_unused_variable_warning(bd);
        -
        101 
        -
        102  memunit_advance(it,3);
        -
        103  // for performace you may also provide a customized implementation of memunit_advanced_ref
        -
        104  }
        -
        105  Iterator it;
        -
        106 };
        -
        107 
        -
        109 template <typename Iterator>
        - -
        111 {
        -
        112  void constraints()
        -
        113  {
        -
        114  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<Iterator>>();
        -
        115 
        -
        116  using ref_t = typename std::remove_reference
        -
        117  <
        -
        118  typename std::iterator_traits<Iterator>::reference
        -
        119  >::type;
        -
        120  using channel_t = typename element_type<ref_t>::type;
        -
        121  gil_function_requires<detail::ChannelIsMutableConcept<channel_t>>();
        -
        122  }
        -
        123 };
        -
        124 
        -
        125 } // namespace detail
        -
        126 
        -
        136 template <typename T>
        - -
        138 {
        -
        139  void constraints()
        -
        140  {
        -
        141  using type = typename transposed_type<T>::type;
        -
        142  ignore_unused_variable_warning(type{});
        -
        143  }
        -
        144 };
        -
        145 
        -
        149 
        -
        169 template <typename Iterator>
        - -
        171 {
        -
        172  void constraints()
        -
        173  {
        -
        174  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
        -
        175  gil_function_requires<PixelBasedConcept<Iterator>>();
        -
        176 
        -
        177  using value_type = typename std::iterator_traits<Iterator>::value_type;
        -
        178  gil_function_requires<PixelValueConcept<value_type>>();
        -
        179 
        -
        180  using const_t = typename const_iterator_type<Iterator>::type;
        -
        181  static bool const is_mutable = iterator_is_mutable<Iterator>::value;
        -
        182  ignore_unused_variable_warning(is_mutable);
        -
        183 
        -
        184  // immutable iterator must be constructible from (possibly mutable) iterator
        -
        185  const_t const_it(it);
        -
        186  ignore_unused_variable_warning(const_it);
        -
        187 
        -
        188  check_base(typename is_iterator_adaptor<Iterator>::type());
        -
        189  }
        -
        190 
        -
        191  void check_base(std::false_type) {}
        -
        192 
        -
        193  void check_base(std::true_type)
        -
        194  {
        -
        195  using base_t = typename iterator_adaptor_get_base<Iterator>::type;
        -
        196  gil_function_requires<PixelIteratorConcept<base_t>>();
        -
        197  }
        -
        198 
        -
        199  Iterator it;
        -
        200 };
        -
        201 
        -
        208 template <typename Iterator>
        - -
        210 {
        -
        211  void constraints()
        -
        212  {
        -
        213  gil_function_requires<PixelIteratorConcept<Iterator>>();
        -
        214  gil_function_requires<detail::PixelIteratorIsMutableConcept<Iterator>>();
        -
        215  }
        -
        216 };
        -
        217 
        -
        221 
        -
        235 template <typename Iterator>
        - -
        237 {
        -
        238  void constraints()
        -
        239  {
        -
        240  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
        -
        241  gil_function_requires<detail::RandomAccessIteratorIsMemoryBasedConcept<Iterator>>();
        -
        242  }
        -
        243 };
        -
        244 
        -
        256 template <typename Iterator>
        - -
        258 {
        -
        259  void constraints()
        -
        260  {
        -
        261  gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
        -
        262  it.set_step(0);
        -
        263  }
        -
        264  Iterator it;
        -
        265 };
        -
        266 
        -
        267 
        -
        274 template <typename Iterator>
        - -
        276 {
        -
        277  void constraints()
        -
        278  {
        -
        279  gil_function_requires<StepIteratorConcept<Iterator>>();
        -
        280  gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
        -
        281  }
        -
        282 };
        -
        283 
        -
        287 
        -
        316 template <typename Iterator>
        - -
        318 {
        -
        319  void constraints()
        -
        320  {
        -
        321  gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
        -
        322 
        -
        323  using base_t = typename iterator_adaptor_get_base<Iterator>::type;
        -
        324  gil_function_requires<boost_concepts::ForwardTraversalConcept<base_t>>();
        -
        325 
        -
        326  static_assert(is_iterator_adaptor<Iterator>::value, "");
        -
        327  using rebind_t = typename iterator_adaptor_rebind<Iterator, void*>::type;
        -
        328 
        -
        329  base_t base = it.base();
        -
        330  ignore_unused_variable_warning(base);
        -
        331  }
        -
        332  Iterator it;
        -
        333 };
        -
        334 
        -
        341 template <typename Iterator>
        - -
        343 {
        -
        344  void constraints()
        -
        345  {
        -
        346  gil_function_requires<IteratorAdaptorConcept<Iterator>>();
        -
        347  gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
        -
        348  }
        -
        349 };
        -
        350 
        -
        351 }} // namespace boost::gil
        -
        352 
        -
        353 #if defined(BOOST_CLANG)
        -
        354 #pragma clang diagnostic pop
        -
        355 #endif
        -
        356 
        -
        357 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        358 #pragma GCC diagnostic pop
        -
        359 #endif
        -
        360 
        -
        361 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Concept for locators and views that can define a type just like the given locator or view,...
        Definition: concepts/pixel_iterator.hpp:138
        -
        Iterator adaptor is a forward iterator adapting another forward iterator.
        Definition: concepts/pixel_iterator.hpp:318
        -
        Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
        Definition: concepts/pixel_iterator.hpp:237
        -
        Iterator adaptor that is mutable.
        Definition: concepts/pixel_iterator.hpp:343
        -
        Pixel iterator that allows for changing its pixel.
        Definition: concepts/pixel_iterator.hpp:210
        -
        Step iterator that allows for modifying its current value.
        Definition: concepts/pixel_iterator.hpp:276
        -
        An STL random access traversal iterator over a model of PixelConcept.
        Definition: concepts/pixel_iterator.hpp:171
        -
        Step iterator concept.
        Definition: concepts/pixel_iterator.hpp:258
        -
        Returns the type of an iterator just like the input iterator, except operating over immutable values.
        Definition: pixel_iterator.hpp:40
        -
        Definition: concepts/pixel_iterator.hpp:111
        -
        Specifies the element type of a homogeneous color base.
        Definition: color_base_algorithm.hpp:225
        -
        metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
        Definition: pixel_iterator.hpp:28
        -
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition: metafunctions.hpp:36
        -
        Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
        Definition: pixel_iterator.hpp:36
        -
        Metafunction predicate returning whether the given iterator allows for changing its values.
        Definition: pixel_iterator.hpp:49
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_PIXEL_ITERATOR_HPP
        +
        9#define BOOST_GIL_CONCEPTS_PIXEL_ITERATOR_HPP
        +
        10
        +
        11#include <boost/gil/concepts/channel.hpp>
        +
        12#include <boost/gil/concepts/color.hpp>
        +
        13#include <boost/gil/concepts/concept_check.hpp>
        +
        14#include <boost/gil/concepts/fwd.hpp>
        +
        15#include <boost/gil/concepts/pixel.hpp>
        +
        16#include <boost/gil/concepts/pixel_based.hpp>
        +
        17
        +
        18#include <boost/iterator/iterator_concepts.hpp>
        +
        19
        +
        20#include <cstddef>
        +
        21#include <iterator>
        +
        22#include <type_traits>
        +
        23
        +
        24#if defined(BOOST_CLANG)
        +
        25#pragma clang diagnostic push
        +
        26#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        27#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        28#endif
        +
        29
        +
        30#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        31#pragma GCC diagnostic push
        +
        32#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        33#endif
        +
        34
        +
        35namespace boost { namespace gil {
        +
        36
        +
        37// Forward declarations
        +
        38template <typename It> struct const_iterator_type;
        +
        39template <typename It> struct iterator_is_mutable;
        +
        40template <typename It> struct is_iterator_adaptor;
        +
        41template <typename It, typename NewBaseIt> struct iterator_adaptor_rebind;
        +
        42template <typename It> struct iterator_adaptor_get_base;
        +
        43
        +
        44// These iterator mutability concepts are taken from Boost concept_check.hpp.
        +
        45// Isolating mutability to result in faster compile time
        +
        46namespace detail {
        +
        47
        +
        48// Preconditions: TT Models boost_concepts::ForwardTraversalConcept
        +
        49template <class TT>
        +
        50struct ForwardIteratorIsMutableConcept
        +
        51{
        +
        52 void constraints()
        +
        53 {
        +
        54 auto const tmp = *i;
        +
        55 *i++ = tmp; // require postincrement and assignment
        +
        56 }
        +
        57 TT i;
        +
        58};
        +
        59
        +
        60// Preconditions: TT Models boost::BidirectionalIteratorConcept
        +
        61template <class TT>
        +
        62struct BidirectionalIteratorIsMutableConcept
        +
        63{
        +
        64 void constraints()
        +
        65 {
        +
        66 gil_function_requires< ForwardIteratorIsMutableConcept<TT>>();
        +
        67 auto const tmp = *i;
        +
        68 *i-- = tmp; // require postdecrement and assignment
        +
        69 }
        +
        70 TT i;
        +
        71};
        +
        72
        +
        73// Preconditions: TT Models boost_concepts::RandomAccessTraversalConcept
        +
        74template <class TT>
        +
        75struct RandomAccessIteratorIsMutableConcept
        +
        76{
        +
        77 void constraints()
        +
        78 {
        +
        79 gil_function_requires<BidirectionalIteratorIsMutableConcept<TT>>();
        +
        80
        +
        81 typename std::iterator_traits<TT>::difference_type n = 0;
        +
        82 ignore_unused_variable_warning(n);
        +
        83 i[n] = *i; // require element access and assignment
        +
        84 }
        +
        85 TT i;
        +
        86};
        +
        87
        +
        88// Iterators that can be used as the base of memory_based_step_iterator require some additional functions
        +
        89// \tparam Iterator Models boost_concepts::RandomAccessTraversalConcept
        +
        90template <typename Iterator>
        +
        91struct RandomAccessIteratorIsMemoryBasedConcept
        +
        92{
        +
        93 void constraints()
        +
        94 {
        +
        95 std::ptrdiff_t bs = memunit_step(it);
        +
        96 ignore_unused_variable_warning(bs);
        +
        97
        +
        98 it = memunit_advanced(it, 3);
        +
        99 std::ptrdiff_t bd = memunit_distance(it, it);
        +
        100 ignore_unused_variable_warning(bd);
        +
        101
        +
        102 memunit_advance(it,3);
        +
        103 // for performance you may also provide a customized implementation of memunit_advanced_ref
        +
        104 }
        +
        105 Iterator it;
        +
        106};
        +
        107
        +
        109template <typename Iterator>
        +
        + +
        111{
        +
        112 void constraints()
        +
        113 {
        +
        114 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<Iterator>>();
        +
        115
        +
        116 using ref_t = typename std::remove_reference
        +
        117 <
        +
        118 typename std::iterator_traits<Iterator>::reference
        +
        119 >::type;
        +
        120 using channel_t = typename element_type<ref_t>::type;
        +
        121 gil_function_requires<detail::ChannelIsMutableConcept<channel_t>>();
        +
        122 }
        +
        123};
        +
        +
        124
        +
        125} // namespace detail
        +
        126
        +
        136template <typename T>
        +
        + +
        138{
        +
        139 void constraints()
        +
        140 {
        +
        141 using type = typename transposed_type<T>::type;
        +
        142 ignore_unused_variable_warning(type{});
        +
        143 }
        +
        144};
        +
        +
        145
        +
        149
        +
        169template <typename Iterator>
        +
        + +
        171{
        +
        172 void constraints()
        +
        173 {
        +
        174 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
        +
        175 gil_function_requires<PixelBasedConcept<Iterator>>();
        +
        176
        +
        177 using value_type = typename std::iterator_traits<Iterator>::value_type;
        +
        178 gil_function_requires<PixelValueConcept<value_type>>();
        +
        179
        +
        180 using const_t = typename const_iterator_type<Iterator>::type;
        +
        181 static bool const is_mutable = iterator_is_mutable<Iterator>::value;
        +
        182 ignore_unused_variable_warning(is_mutable);
        +
        183
        +
        184 // immutable iterator must be constructible from (possibly mutable) iterator
        +
        185 const_t const_it(it);
        +
        186 ignore_unused_variable_warning(const_it);
        +
        187
        +
        188 check_base(typename is_iterator_adaptor<Iterator>::type());
        +
        189 }
        +
        190
        +
        191 void check_base(std::false_type) {}
        +
        192
        +
        193 void check_base(std::true_type)
        +
        194 {
        +
        195 using base_t = typename iterator_adaptor_get_base<Iterator>::type;
        +
        196 gil_function_requires<PixelIteratorConcept<base_t>>();
        +
        197 }
        +
        198
        +
        199 Iterator it;
        +
        200};
        +
        +
        201
        +
        208template <typename Iterator>
        +
        + +
        210{
        +
        211 void constraints()
        +
        212 {
        +
        213 gil_function_requires<PixelIteratorConcept<Iterator>>();
        +
        214 gil_function_requires<detail::PixelIteratorIsMutableConcept<Iterator>>();
        +
        215 }
        +
        216};
        +
        +
        217
        +
        221
        +
        235template <typename Iterator>
        +
        + +
        237{
        +
        238 void constraints()
        +
        239 {
        +
        240 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator>>();
        +
        241 gil_function_requires<detail::RandomAccessIteratorIsMemoryBasedConcept<Iterator>>();
        +
        242 }
        +
        243};
        +
        +
        244
        +
        256template <typename Iterator>
        +
        + +
        258{
        +
        259 void constraints()
        +
        260 {
        +
        261 gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
        +
        262 it.set_step(0);
        +
        263 }
        +
        264 Iterator it;
        +
        265};
        +
        +
        266
        +
        267
        +
        274template <typename Iterator>
        +
        + +
        276{
        +
        277 void constraints()
        +
        278 {
        +
        279 gil_function_requires<StepIteratorConcept<Iterator>>();
        +
        280 gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
        +
        281 }
        +
        282};
        +
        +
        283
        +
        287
        +
        316template <typename Iterator>
        +
        + +
        318{
        +
        319 void constraints()
        +
        320 {
        +
        321 gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator>>();
        +
        322
        +
        323 using base_t = typename iterator_adaptor_get_base<Iterator>::type;
        +
        324 gil_function_requires<boost_concepts::ForwardTraversalConcept<base_t>>();
        +
        325
        +
        326 static_assert(is_iterator_adaptor<Iterator>::value, "");
        +
        327 using rebind_t = typename iterator_adaptor_rebind<Iterator, void*>::type;
        +
        328
        +
        329 base_t base = it.base();
        +
        330 ignore_unused_variable_warning(base);
        +
        331 }
        +
        332 Iterator it;
        +
        333};
        +
        +
        334
        +
        341template <typename Iterator>
        +
        + +
        343{
        +
        344 void constraints()
        +
        345 {
        +
        346 gil_function_requires<IteratorAdaptorConcept<Iterator>>();
        +
        347 gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator>>();
        +
        348 }
        +
        349};
        +
        +
        350
        +
        351}} // namespace boost::gil
        +
        352
        +
        353#if defined(BOOST_CLANG)
        +
        354#pragma clang diagnostic pop
        +
        355#endif
        +
        356
        +
        357#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        358#pragma GCC diagnostic pop
        +
        359#endif
        +
        360
        +
        361#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Concept for locators and views that can define a type just like the given locator or view,...
        Definition concepts/pixel_iterator.hpp:138
        +
        Iterator adaptor is a forward iterator adapting another forward iterator.
        Definition concepts/pixel_iterator.hpp:318
        +
        Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
        Definition concepts/pixel_iterator.hpp:237
        +
        Iterator adaptor that is mutable.
        Definition concepts/pixel_iterator.hpp:343
        +
        Pixel iterator that allows for changing its pixel.
        Definition concepts/pixel_iterator.hpp:210
        +
        Step iterator that allows for modifying its current value.
        Definition concepts/pixel_iterator.hpp:276
        +
        An STL random access traversal iterator over a model of PixelConcept.
        Definition concepts/pixel_iterator.hpp:171
        +
        Step iterator concept.
        Definition concepts/pixel_iterator.hpp:258
        +
        Returns the type of an iterator just like the input iterator, except operating over immutable values.
        Definition pixel_iterator.hpp:40
        +
        Definition concepts/pixel_iterator.hpp:111
        +
        Specifies the element type of a homogeneous color base.
        Definition color_base_algorithm.hpp:225
        +
        metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
        Definition pixel_iterator.hpp:28
        +
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition metafunctions.hpp:36
        +
        Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
        Definition pixel_iterator.hpp:36
        +
        Metafunction predicate returning whether the given iterator allows for changing its values.
        Definition pixel_iterator.hpp:49
        diff --git a/html/reference/concepts_2point_8hpp_source.html b/html/reference/concepts_2point_8hpp_source.html index e8b7395a8..6a7b86aa8 100644 --- a/html/reference/concepts_2point_8hpp_source.html +++ b/html/reference/concepts_2point_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: point.hpp Source File @@ -27,124 +27,133 @@

        - + +/* @license-end */ + +
        -
        -
        concepts/point.hpp
        +
        concepts/point.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_POINT_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_POINT_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/concept_check.hpp>
        -
        13 
        -
        14 #include <cstddef>
        -
        15 
        -
        16 #if defined(BOOST_CLANG)
        -
        17 #pragma clang diagnostic push
        -
        18 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        19 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        20 #endif
        -
        21 
        -
        22 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        23 #pragma GCC diagnostic push
        -
        24 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        25 #endif
        -
        26 
        -
        27 namespace boost { namespace gil {
        -
        28 
        -
        29 // Forward declarations
        -
        30 template <typename T>
        -
        31 class point;
        -
        32 
        -
        33 template <std::size_t K, typename T>
        -
        34 T const& axis_value(point<T> const& p);
        -
        35 
        -
        36 template <std::size_t K, typename T>
        -
        37 T& axis_value(point<T>& p);
        -
        38 
        -
        60 template <typename P>
        - -
        62 {
        -
        63  void constraints()
        -
        64  {
        -
        65  gil_function_requires<Regular<P>>();
        -
        66 
        -
        67  using value_type = typename P::value_type;
        -
        68  ignore_unused_variable_warning(value_type{});
        -
        69 
        -
        70  static const std::size_t N = P::num_dimensions;
        -
        71  ignore_unused_variable_warning(N);
        -
        72  using FT = typename P::template axis<0>::coord_t;
        -
        73  using LT = typename P::template axis<N - 1>::coord_t;
        -
        74  FT ft = gil::axis_value<0>(point);
        -
        75  axis_value<0>(point) = ft;
        -
        76  LT lt = axis_value<N - 1>(point);
        -
        77  axis_value<N - 1>(point) = lt;
        -
        78 
        -
        79  //value_type v=point[0];
        -
        80  //ignore_unused_variable_warning(v);
        -
        81  }
        -
        82  P point;
        -
        83 };
        -
        84 
        -
        102 template <typename P>
        - -
        104 {
        -
        105  void constraints()
        -
        106  {
        -
        107  gil_function_requires<PointNDConcept<P>>();
        -
        108  static_assert(P::num_dimensions == 2, "");
        -
        109  point.x = point.y;
        -
        110  point[0] = point[1];
        -
        111  }
        -
        112  P point;
        -
        113 };
        -
        114 
        -
        115 }} // namespace boost::gil
        -
        116 
        -
        117 #if defined(BOOST_CLANG)
        -
        118 #pragma clang diagnostic pop
        -
        119 #endif
        -
        120 
        -
        121 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        122 #pragma GCC diagnostic pop
        -
        123 #endif
        -
        124 
        -
        125 #endif
        -
        2D point both axes of which have the same dimension typeModels: Point2DConcept
        Definition: point.hpp:36
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        2-dimensional point concept
        Definition: concepts/point.hpp:104
        -
        N-dimensional point concept.
        Definition: concepts/point.hpp:62
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_POINT_HPP
        +
        9#define BOOST_GIL_CONCEPTS_POINT_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/concept_check.hpp>
        +
        13
        +
        14#include <cstddef>
        +
        15
        +
        16#if defined(BOOST_CLANG)
        +
        17#pragma clang diagnostic push
        +
        18#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        19#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        20#endif
        +
        21
        +
        22#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        23#pragma GCC diagnostic push
        +
        24#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        25#endif
        +
        26
        +
        27namespace boost { namespace gil {
        +
        28
        +
        29// Forward declarations
        +
        30template <typename T>
        +
        31class point;
        +
        32
        +
        33template <std::size_t K, typename T>
        +
        34T const& axis_value(point<T> const& p);
        +
        35
        +
        36template <std::size_t K, typename T>
        +
        37T& axis_value(point<T>& p);
        +
        38
        +
        60template <typename P>
        +
        + +
        62{
        +
        63 void constraints()
        +
        64 {
        +
        65 gil_function_requires<Regular<P>>();
        +
        66
        +
        67 using value_type = typename P::value_type;
        +
        68 ignore_unused_variable_warning(value_type{});
        +
        69
        +
        70 static const std::size_t N = P::num_dimensions;
        +
        71 ignore_unused_variable_warning(N);
        +
        72 using FT = typename P::template axis<0>::coord_t;
        +
        73 using LT = typename P::template axis<N - 1>::coord_t;
        +
        74 FT ft = gil::axis_value<0>(point);
        +
        75 axis_value<0>(point) = ft;
        +
        76 LT lt = axis_value<N - 1>(point);
        +
        77 axis_value<N - 1>(point) = lt;
        +
        78
        +
        79 //value_type v=point[0];
        +
        80 //ignore_unused_variable_warning(v);
        +
        81 }
        +
        82 P point;
        +
        83};
        +
        +
        84
        +
        102template <typename P>
        +
        + +
        104{
        +
        105 void constraints()
        +
        106 {
        +
        107 gil_function_requires<PointNDConcept<P>>();
        +
        108 static_assert(P::num_dimensions == 2, "");
        +
        109 point.x = point.y;
        +
        110 point[0] = point[1];
        +
        111 }
        +
        112 P point;
        +
        113};
        +
        +
        114
        +
        115}} // namespace boost::gil
        +
        116
        +
        117#if defined(BOOST_CLANG)
        +
        118#pragma clang diagnostic pop
        +
        119#endif
        +
        120
        +
        121#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        122#pragma GCC diagnostic pop
        +
        123#endif
        +
        124
        +
        125#endif
        +
        2D point both axes of which have the same dimension typeModels: Point2DConcept
        Definition point.hpp:36
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        2-dimensional point concept
        Definition concepts/point.hpp:104
        +
        N-dimensional point concept.
        Definition concepts/point.hpp:62
        diff --git a/html/reference/concepts_8hpp_source.html b/html/reference/concepts_8hpp_source.html index eb079480b..374e16601 100644 --- a/html/reference/concepts_8hpp_source.html +++ b/html/reference/concepts_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: concepts.hpp Source File @@ -27,59 +27,64 @@

        - + +/* @license-end */ + +
        -
        -
        concepts.hpp
        +
        concepts.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_HPP
        -
        10 
        -
        11 // TODO: Remove and prefer individual includes from boost/gil/concepts/*.hpp?
        -
        12 
        -
        13 #include <boost/gil/concepts/channel.hpp>
        -
        14 #include <boost/gil/concepts/color.hpp>
        -
        15 #include <boost/gil/concepts/color_base.hpp>
        -
        16 #include <boost/gil/concepts/concept_check.hpp>
        -
        17 #include <boost/gil/concepts/image.hpp>
        -
        18 #include <boost/gil/concepts/image_view.hpp>
        -
        19 #include <boost/gil/concepts/pixel.hpp>
        -
        20 #include <boost/gil/concepts/pixel_based.hpp>
        -
        21 #include <boost/gil/concepts/pixel_dereference.hpp>
        -
        22 #include <boost/gil/concepts/pixel_iterator.hpp>
        -
        23 #include <boost/gil/concepts/pixel_locator.hpp>
        -
        24 #include <boost/gil/concepts/point.hpp>
        -
        25 
        -
        26 #endif
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_HPP
        +
        9#define BOOST_GIL_CONCEPTS_HPP
        +
        10
        +
        11// TODO: Remove and prefer individual includes from boost/gil/concepts/*.hpp?
        +
        12
        +
        13#include <boost/gil/concepts/channel.hpp>
        +
        14#include <boost/gil/concepts/color.hpp>
        +
        15#include <boost/gil/concepts/color_base.hpp>
        +
        16#include <boost/gil/concepts/concept_check.hpp>
        +
        17#include <boost/gil/concepts/image.hpp>
        +
        18#include <boost/gil/concepts/image_view.hpp>
        +
        19#include <boost/gil/concepts/pixel.hpp>
        +
        20#include <boost/gil/concepts/pixel_based.hpp>
        +
        21#include <boost/gil/concepts/pixel_dereference.hpp>
        +
        22#include <boost/gil/concepts/pixel_iterator.hpp>
        +
        23#include <boost/gil/concepts/pixel_locator.hpp>
        +
        24#include <boost/gil/concepts/point.hpp>
        +
        25
        +
        26#endif
        diff --git a/html/reference/conversion__policies_8hpp_source.html b/html/reference/conversion__policies_8hpp_source.html index 20b42a265..9f4d0351d 100644 --- a/html/reference/conversion__policies_8hpp_source.html +++ b/html/reference/conversion__policies_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: conversion_policies.hpp Source File @@ -27,140 +27,144 @@

        - + +/* @license-end */ + +
        -
        -
        conversion_policies.hpp
        +
        conversion_policies.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning, Andreas Pokorny
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_CONVERSION_POLICIES_HPP
        -
        9 #define BOOST_GIL_IO_CONVERSION_POLICIES_HPP
        -
        10 
        -
        11 #include <boost/gil/image_view_factory.hpp>
        -
        12 #include <boost/gil/detail/mp11.hpp>
        -
        13 #include <boost/gil/io/error.hpp>
        -
        14 
        -
        15 #include <algorithm>
        -
        16 #include <iterator>
        -
        17 #include <type_traits>
        -
        18 
        -
        19 namespace boost{ namespace gil { namespace detail {
        -
        20 
        -
        21 struct read_and_no_convert
        -
        22 {
        -
        23 public:
        -
        24  using color_converter_type = void *;
        -
        25 
        -
        26  template <typename InIterator, typename OutIterator>
        -
        27  void read(
        -
        28  InIterator const& /*begin*/, InIterator const& /*end*/ , OutIterator /*out*/,
        -
        29  typename std::enable_if
        -
        30  <
        -
        31  mp11::mp_not
        -
        32  <
        -
        33  pixels_are_compatible
        -
        34  <
        -
        35  typename std::iterator_traits<InIterator>::value_type,
        -
        36  typename std::iterator_traits<OutIterator>::value_type
        -
        37  >
        -
        38  >::value
        -
        39  >::type* /*dummy*/ = nullptr)
        -
        40  {
        -
        41  io_error("Data cannot be copied because the pixels are incompatible.");
        -
        42  }
        -
        43 
        -
        44  template <typename InIterator, typename OutIterator>
        -
        45  void read(InIterator const& begin, InIterator const& end, OutIterator out,
        -
        46  typename std::enable_if
        -
        47  <
        -
        48  pixels_are_compatible
        -
        49  <
        -
        50  typename std::iterator_traits<InIterator>::value_type,
        -
        51  typename std::iterator_traits<OutIterator>::value_type
        -
        52  >::value
        -
        53  >::type* /*dummy*/ = nullptr)
        -
        54  {
        -
        55  std::copy(begin, end, out);
        -
        56  }
        -
        57 };
        -
        58 
        -
        59 template<typename CC>
        -
        60 struct read_and_convert
        -
        61 {
        -
        62 public:
        -
        63  using color_converter_type = default_color_converter;
        -
        64  CC _cc;
        -
        65 
        -
        66  read_and_convert()
        -
        67  {}
        -
        68 
        -
        69  read_and_convert( const color_converter_type& cc )
        -
        70  : _cc( cc )
        -
        71  {}
        -
        72 
        -
        73  template< typename InIterator
        -
        74  , typename OutIterator
        -
        75  >
        -
        76  void read( const InIterator& begin
        -
        77  , const InIterator& end
        -
        78  , OutIterator out
        -
        79  )
        -
        80  {
        -
        81  using deref_t = color_convert_deref_fn<typename std::iterator_traits<InIterator>::reference
        -
        82  , typename std::iterator_traits<OutIterator>::value_type //reference?
        -
        83  , CC
        -
        84  >;
        -
        85 
        -
        86  std::transform( begin
        -
        87  , end
        -
        88  , out
        -
        89  , deref_t( _cc )
        -
        90  );
        -
        91  }
        -
        92 };
        -
        93 
        -
        96 template< typename Conversion_Policy >
        -
        97 struct is_read_only : std::false_type {};
        -
        98 
        -
        99 template<>
        -
        100 struct is_read_only<detail::read_and_no_convert> : std::true_type {};
        -
        101 
        -
        102 } // namespace detail
        -
        103 } // namespace gil
        -
        104 } // namespace boost
        -
        105 
        -
        106 #endif
        -
        BOOST_FORCEINLINE auto copy(boost::gil::pixel< T, CS > *first, boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
        Copy when both src and dst are interleaved and of the same type can be just memmove.
        Definition: algorithm.hpp:145
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Determines if reader type is read only ( no conversion ).
        Definition: conversion_policies.hpp:97
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning, Andreas Pokorny
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_CONVERSION_POLICIES_HPP
        +
        9#define BOOST_GIL_IO_CONVERSION_POLICIES_HPP
        +
        10
        +
        11#include <boost/gil/image_view_factory.hpp>
        +
        12#include <boost/gil/detail/mp11.hpp>
        +
        13#include <boost/gil/io/error.hpp>
        +
        14
        +
        15#include <algorithm>
        +
        16#include <iterator>
        +
        17#include <type_traits>
        +
        18
        +
        19namespace boost{ namespace gil { namespace detail {
        +
        20
        +
        21struct read_and_no_convert
        +
        22{
        +
        23public:
        +
        24 using color_converter_type = void *;
        +
        25
        +
        26 template <typename InIterator, typename OutIterator>
        +
        27 void read(
        +
        28 InIterator const& /*begin*/, InIterator const& /*end*/ , OutIterator /*out*/,
        +
        29 typename std::enable_if
        +
        30 <
        +
        31 mp11::mp_not
        +
        32 <
        +
        33 pixels_are_compatible
        +
        34 <
        +
        35 typename std::iterator_traits<InIterator>::value_type,
        +
        36 typename std::iterator_traits<OutIterator>::value_type
        +
        37 >
        +
        38 >::value
        +
        39 >::type* /*dummy*/ = nullptr)
        +
        40 {
        +
        41 io_error("Data cannot be copied because the pixels are incompatible.");
        +
        42 }
        +
        43
        +
        44 template <typename InIterator, typename OutIterator>
        +
        45 void read(InIterator const& begin, InIterator const& end, OutIterator out,
        +
        46 typename std::enable_if
        +
        47 <
        +
        48 pixels_are_compatible
        +
        49 <
        +
        50 typename std::iterator_traits<InIterator>::value_type,
        +
        51 typename std::iterator_traits<OutIterator>::value_type
        +
        52 >::value
        +
        53 >::type* /*dummy*/ = nullptr)
        +
        54 {
        +
        55 std::copy(begin, end, out);
        +
        56 }
        +
        57};
        +
        58
        +
        59template<typename CC>
        +
        60struct read_and_convert
        +
        61{
        +
        62public:
        +
        63 using color_converter_type = default_color_converter;
        +
        64 CC _cc;
        +
        65
        +
        66 read_and_convert()
        +
        67 {}
        +
        68
        +
        69 read_and_convert( const color_converter_type& cc )
        +
        70 : _cc( cc )
        +
        71 {}
        +
        72
        +
        73 template< typename InIterator
        +
        74 , typename OutIterator
        +
        75 >
        +
        76 void read( const InIterator& begin
        +
        77 , const InIterator& end
        +
        78 , OutIterator out
        +
        79 )
        +
        80 {
        +
        81 using deref_t = color_convert_deref_fn<typename std::iterator_traits<InIterator>::reference
        +
        82 , typename std::iterator_traits<OutIterator>::value_type //reference?
        +
        83 , CC
        +
        84 >;
        +
        85
        +
        86 std::transform( begin
        +
        87 , end
        +
        88 , out
        +
        89 , deref_t( _cc )
        +
        90 );
        +
        91 }
        +
        92};
        +
        93
        +
        96template< typename Conversion_Policy >
        +
        97struct is_read_only : std::false_type {};
        +
        98
        +
        99template<>
        +
        100struct is_read_only<detail::read_and_no_convert> : std::true_type {};
        +
        101
        +
        102} // namespace detail
        +
        103} // namespace gil
        +
        104} // namespace boost
        +
        105
        +
        106#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Determines if reader type is read only ( no conversion ).
        Definition conversion_policies.hpp:97
        diff --git a/html/reference/convolve_8hpp_source.html b/html/reference/convolve_8hpp_source.html index cfefb0bb5..36c3cea2f 100644 --- a/html/reference/convolve_8hpp_source.html +++ b/html/reference/convolve_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: convolve.hpp Source File @@ -27,385 +27,394 @@

        - + +/* @license-end */ + +
        -
        -
        convolve.hpp
        +
        convolve.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2019 Miral Shah <miralshah2211@gmail.com>
        -
        4 // Copyright 2019-2021 Pranam Lashkari <plashkari628@gmail.com>
        -
        5 //
        -
        6 // Distributed under the Boost Software License, Version 1.0
        -
        7 // See accompanying file LICENSE_1_0.txt or copy at
        -
        8 // http://www.boost.org/LICENSE_1_0.txt
        -
        9 //
        -
        10 #ifndef BOOST_GIL_IMAGE_PROCESSING_CONVOLVE_HPP
        -
        11 #define BOOST_GIL_IMAGE_PROCESSING_CONVOLVE_HPP
        -
        12 
        -
        13 #include <boost/gil/image_processing/kernel.hpp>
        -
        14 
        -
        15 #include <boost/gil/algorithm.hpp>
        -
        16 #include <boost/gil/image_view_factory.hpp>
        -
        17 #include <boost/gil/metafunctions.hpp>
        -
        18 #include <boost/gil/pixel_numeric_operations.hpp>
        -
        19 
        -
        20 #include <boost/assert.hpp>
        -
        21 
        -
        22 #include <algorithm>
        -
        23 #include <cstddef>
        -
        24 #include <functional>
        -
        25 #include <type_traits>
        -
        26 #include <vector>
        -
        27 
        -
        28 namespace boost { namespace gil {
        -
        29 
        -
        30 // 2D spatial seperable convolutions and cross-correlations
        -
        31 
        -
        32 namespace detail {
        -
        33 
        -
        50 template
        -
        51 <
        -
        52  typename PixelAccum,
        -
        53  typename SrcView,
        -
        54  typename Kernel,
        -
        55  typename DstView,
        -
        56  typename Correlator
        -
        57 >
        -
        58 void correlate_rows_impl(
        -
        59  SrcView const& src_view,
        -
        60  Kernel const& kernel,
        -
        61  DstView const& dst_view,
        -
        62  boundary_option option,
        -
        63  Correlator correlator)
        -
        64 {
        -
        65  BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
        -
        66  BOOST_ASSERT(kernel.size() != 0);
        -
        67 
        -
        68  if(kernel.size() == 1)
        -
        69  {
        -
        70  // Reduces to a multiplication
        -
        71  view_multiplies_scalar<PixelAccum>(src_view, *kernel.begin(), dst_view);
        -
        72  return;
        -
        73  }
        -
        74 
        -
        75  using src_pixel_ref_t = typename pixel_proxy<typename SrcView::value_type>::type;
        -
        76  using dst_pixel_ref_t = typename pixel_proxy<typename DstView::value_type>::type;
        -
        77  using x_coord_t = typename SrcView::x_coord_t;
        -
        78  using y_coord_t = typename SrcView::y_coord_t;
        -
        79 
        -
        80  x_coord_t const width = src_view.width();
        -
        81  y_coord_t const height = src_view.height();
        -
        82  if (width == 0)
        -
        83  return;
        -
        84 
        -
        85  PixelAccum acc_zero;
        -
        86  pixel_zeros_t<PixelAccum>()(acc_zero);
        -
        87  if (option == boundary_option::output_ignore || option == boundary_option::output_zero)
        -
        88  {
        -
        89  typename DstView::value_type dst_zero;
        -
        90  pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(acc_zero, dst_zero);
        -
        91  if (width < static_cast<x_coord_t>(kernel.size()))
        -
        92  {
        -
        93  if (option == boundary_option::output_zero)
        -
        94  fill_pixels(dst_view, dst_zero);
        -
        95  }
        -
        96  else
        -
        97  {
        -
        98  std::vector<PixelAccum> buffer(width);
        -
        99  for (y_coord_t y = 0; y < height; ++y)
        -
        100  {
        -
        101  assign_pixels(src_view.row_begin(y), src_view.row_end(y), &buffer.front());
        -
        102  typename DstView::x_iterator it_dst = dst_view.row_begin(y);
        -
        103  if (option == boundary_option::output_zero)
        -
        104  std::fill_n(it_dst, kernel.left_size(), dst_zero);
        -
        105  it_dst += kernel.left_size();
        -
        106  correlator(&buffer.front(), &buffer.front() + width + 1 - kernel.size(),
        -
        107  kernel.begin(), it_dst);
        -
        108  it_dst += width + 1 - kernel.size();
        -
        109  if (option == boundary_option::output_zero)
        -
        110  std::fill_n(it_dst, kernel.right_size(), dst_zero);
        -
        111  }
        -
        112  }
        -
        113  }
        -
        114  else
        -
        115  {
        -
        116  std::vector<PixelAccum> buffer(width + kernel.size() - 1);
        -
        117  for (y_coord_t y = 0; y < height; ++y)
        -
        118  {
        -
        119  PixelAccum *it_buffer = &buffer.front();
        -
        120  if (option == boundary_option::extend_padded)
        -
        121  {
        -
        122  assign_pixels(
        -
        123  src_view.row_begin(y) - kernel.left_size(),
        -
        124  src_view.row_end(y) + kernel.right_size(),
        -
        125  it_buffer);
        -
        126  }
        -
        127  else if (option == boundary_option::extend_zero)
        -
        128  {
        -
        129  std::fill_n(it_buffer, kernel.left_size(), acc_zero);
        -
        130  it_buffer += kernel.left_size();
        -
        131  assign_pixels(src_view.row_begin(y), src_view.row_end(y), it_buffer);
        -
        132  it_buffer += width;
        -
        133  std::fill_n(it_buffer, kernel.right_size(), acc_zero);
        -
        134  }
        -
        135  else if (option == boundary_option::extend_constant)
        -
        136  {
        -
        137  PixelAccum filler;
        -
        138  pixel_assigns_t<src_pixel_ref_t, PixelAccum>()(*src_view.row_begin(y), filler);
        -
        139  std::fill_n(it_buffer, kernel.left_size(), filler);
        -
        140  it_buffer += kernel.left_size();
        -
        141  assign_pixels(src_view.row_begin(y), src_view.row_end(y), it_buffer);
        -
        142  it_buffer += width;
        -
        143  pixel_assigns_t<src_pixel_ref_t, PixelAccum>()(src_view.row_end(y)[-1], filler);
        -
        144  std::fill_n(it_buffer, kernel.right_size(), filler);
        -
        145  }
        -
        146 
        -
        147  correlator(
        -
        148  &buffer.front(), &buffer.front() + width,
        -
        149  kernel.begin(),
        -
        150  dst_view.row_begin(y));
        -
        151  }
        -
        152  }
        -
        153 }
        -
        154 
        -
        158 template <typename PixelAccum>
        - -
        160 {
        -
        161 public:
        -
        162  correlator_n(std::size_t size) : size_(size) {}
        -
        163 
        -
        164  template <typename SrcIterator, typename KernelIterator, typename DstIterator>
        -
        165  void operator()(
        -
        166  SrcIterator src_begin,
        -
        167  SrcIterator src_end,
        -
        168  KernelIterator kernel_begin,
        -
        169  DstIterator dst_begin)
        -
        170  {
        -
        171  correlate_pixels_n<PixelAccum>(src_begin, src_end, kernel_begin, size_, dst_begin);
        -
        172  }
        -
        173 
        -
        174 private:
        -
        175  std::size_t size_{0};
        -
        176 };
        -
        177 
        -
        181 template <std::size_t Size, typename PixelAccum>
        - -
        183 {
        -
        184  template <typename SrcIterator, typename KernelIterator, typename DstIterator>
        -
        185  void operator()(
        -
        186  SrcIterator src_begin,
        -
        187  SrcIterator src_end,
        -
        188  KernelIterator kernel_begin,
        -
        189  DstIterator dst_begin)
        -
        190  {
        -
        191  correlate_pixels_k<Size, PixelAccum>(src_begin, src_end, kernel_begin, dst_begin);
        -
        192  }
        -
        193 };
        -
        194 
        -
        195 } // namespace detail
        -
        196 
        -
        205 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        -
        206 BOOST_FORCEINLINE
        -
        207 void correlate_rows(
        -
        208  SrcView const& src_view,
        -
        209  Kernel const& kernel,
        -
        210  DstView const& dst_view,
        -
        211  boundary_option option = boundary_option::extend_zero)
        -
        212 {
        -
        213  detail::correlate_rows_impl<PixelAccum>(
        -
        214  src_view, kernel, dst_view, option, detail::correlator_n<PixelAccum>(kernel.size()));
        -
        215 }
        -
        216 
        -
        225 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        -
        226 BOOST_FORCEINLINE
        -
        227 void correlate_cols(
        -
        228  SrcView const& src_view,
        -
        229  Kernel const& kernel,
        -
        230  DstView const& dst_view,
        -
        231  boundary_option option = boundary_option::extend_zero)
        -
        232 {
        -
        233  correlate_rows<PixelAccum>(
        -
        234  transposed_view(src_view), kernel, transposed_view(dst_view), option);
        -
        235 }
        -
        236 
        -
        244 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        -
        245 BOOST_FORCEINLINE
        -
        246 void convolve_rows(
        -
        247  SrcView const& src_view,
        -
        248  Kernel const& kernel,
        -
        249  DstView const& dst_view,
        -
        250  boundary_option option = boundary_option::extend_zero)
        -
        251 {
        -
        252  correlate_rows<PixelAccum>(src_view, reverse_kernel(kernel), dst_view, option);
        -
        253 }
        -
        254 
        -
        263 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        -
        264 BOOST_FORCEINLINE
        -
        265 void convolve_cols(
        -
        266  SrcView const& src_view,
        -
        267  Kernel const& kernel,
        -
        268  DstView const& dst_view,
        -
        269  boundary_option option = boundary_option::extend_zero)
        -
        270 {
        -
        271  convolve_rows<PixelAccum>(
        -
        272  transposed_view(src_view), kernel, transposed_view(dst_view), option);
        -
        273 }
        -
        274 
        -
        282 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        -
        283 BOOST_FORCEINLINE
        -
        284 void correlate_rows_fixed(
        -
        285  SrcView const& src_view,
        -
        286  Kernel const& kernel,
        -
        287  DstView const& dst_view,
        -
        288  boundary_option option = boundary_option::extend_zero)
        -
        289 {
        -
        290  using correlator = detail::correlator_k<Kernel::static_size, PixelAccum>;
        -
        291  detail::correlate_rows_impl<PixelAccum>(src_view, kernel, dst_view, option, correlator{});
        -
        292 }
        -
        293 
        -
        302 template <typename PixelAccum,typename SrcView,typename Kernel,typename DstView>
        -
        303 BOOST_FORCEINLINE
        -
        304 void correlate_cols_fixed(
        -
        305  SrcView const& src_view,
        -
        306  Kernel const& kernel,
        -
        307  DstView const& dst_view,
        -
        308  boundary_option option = boundary_option::extend_zero)
        -
        309 {
        -
        310  correlate_rows_fixed<PixelAccum>(
        -
        311  transposed_view(src_view), kernel, transposed_view(dst_view), option);
        -
        312 }
        -
        313 
        -
        321 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        -
        322 BOOST_FORCEINLINE
        -
        323 void convolve_rows_fixed(
        -
        324  SrcView const& src_view,
        -
        325  Kernel const& kernel,
        -
        326  DstView const& dst_view,
        -
        327  boundary_option option = boundary_option::extend_zero)
        -
        328 {
        -
        329  correlate_rows_fixed<PixelAccum>(src_view, reverse_kernel(kernel), dst_view, option);
        -
        330 }
        -
        331 
        -
        340 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        -
        341 BOOST_FORCEINLINE
        -
        342 void convolve_cols_fixed(
        -
        343  SrcView const& src_view,
        -
        344  Kernel const& kernel,
        -
        345  DstView const& dst_view,
        -
        346  boundary_option option = boundary_option::extend_zero)
        -
        347 {
        -
        348  convolve_rows_fixed<PixelAccum>(
        -
        349  transposed_view(src_view), kernel, transposed_view(dst_view), option);
        -
        350 }
        -
        351 
        -
        352 namespace detail
        -
        353 {
        -
        354 
        -
        363 template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        -
        364 BOOST_FORCEINLINE
        -
        365 void convolve_1d(
        -
        366  SrcView const& src_view,
        -
        367  Kernel const& kernel,
        -
        368  DstView const& dst_view,
        -
        369  boundary_option option = boundary_option::extend_zero)
        -
        370 {
        -
        371  convolve_rows<PixelAccum>(src_view, kernel, dst_view, option);
        -
        372  convolve_cols<PixelAccum>(dst_view, kernel, dst_view, option);
        -
        373 }
        -
        374 
        -
        375 template <typename SrcView, typename DstView, typename Kernel>
        -
        376 void convolve_2d_impl(SrcView const& src_view, DstView const& dst_view, Kernel const& kernel)
        -
        377 {
        -
        378  int flip_ker_row, flip_ker_col, row_boundary, col_boundary;
        -
        379  float aux_total;
        -
        380  for (std::ptrdiff_t view_row = 0; view_row < src_view.height(); ++view_row)
        -
        381  {
        -
        382  for (std::ptrdiff_t view_col = 0; view_col < src_view.width(); ++view_col)
        -
        383  {
        -
        384  aux_total = 0.0f;
        -
        385  for (std::size_t kernel_row = 0; kernel_row < kernel.size(); ++kernel_row)
        -
        386  {
        -
        387  flip_ker_row = kernel.size() - 1 - kernel_row; // row index of flipped kernel
        -
        388 
        -
        389  for (std::size_t kernel_col = 0; kernel_col < kernel.size(); ++kernel_col)
        -
        390  {
        -
        391  flip_ker_col = kernel.size() - 1 - kernel_col; // column index of flipped kernel
        -
        392 
        -
        393  // index of input signal, used for checking boundary
        -
        394  row_boundary = view_row + (kernel.center_y() - flip_ker_row);
        -
        395  col_boundary = view_col + (kernel.center_x() - flip_ker_col);
        -
        396 
        -
        397  // ignore input samples which are out of bound
        -
        398  if (row_boundary >= 0 && row_boundary < src_view.height() &&
        -
        399  col_boundary >= 0 && col_boundary < src_view.width())
        -
        400  {
        -
        401  aux_total +=
        -
        402  src_view(col_boundary, row_boundary)[0] *
        -
        403  kernel.at(flip_ker_col, flip_ker_row);
        -
        404  }
        -
        405  }
        -
        406  }
        -
        407  dst_view(view_col, view_row) = aux_total;
        -
        408  }
        -
        409  }
        -
        410 }
        -
        411 
        -
        419 template <typename SrcView, typename DstView, typename Kernel>
        -
        420 void convolve_2d(SrcView const& src_view, Kernel const& kernel, DstView const& dst_view)
        -
        421 {
        -
        422  BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
        -
        423  BOOST_ASSERT(kernel.size() != 0);
        -
        424 
        -
        425  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        426  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        427  static_assert(color_spaces_are_compatible
        -
        428  <
        -
        429  typename color_space_type<SrcView>::type,
        -
        430  typename color_space_type<DstView>::type
        -
        431  >::value, "Source and destination views must have pixels with the same color space");
        -
        432 
        -
        433  for (std::size_t i = 0; i < src_view.num_channels(); i++)
        -
        434  {
        -
        435  detail::convolve_2d_impl(
        -
        436  nth_channel_view(src_view, i),
        -
        437  nth_channel_view(dst_view, i),
        -
        438  kernel
        -
        439  );
        -
        440  }
        -
        441 }
        -
        442 
        -
        443 }}} // namespace boost::gil::detail
        -
        444 
        -
        445 #endif
        -
        Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixe...
        Definition: convolve.hpp:160
        -
        BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
        std::fill for image views
        Definition: algorithm.hpp:420
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixe...
        Definition: convolve.hpp:183
        -
        Returns an integral constant type specifying the number of elements in a color base.
        Definition: color_base_algorithm.hpp:42
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2019 Miral Shah <miralshah2211@gmail.com>
        +
        4// Copyright 2019-2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        5//
        +
        6// Distributed under the Boost Software License, Version 1.0
        +
        7// See accompanying file LICENSE_1_0.txt or copy at
        +
        8// http://www.boost.org/LICENSE_1_0.txt
        +
        9//
        +
        10#ifndef BOOST_GIL_IMAGE_PROCESSING_CONVOLVE_HPP
        +
        11#define BOOST_GIL_IMAGE_PROCESSING_CONVOLVE_HPP
        +
        12
        +
        13#include <boost/gil/image_processing/kernel.hpp>
        +
        14
        +
        15#include <boost/gil/algorithm.hpp>
        +
        16#include <boost/gil/image_view_factory.hpp>
        +
        17#include <boost/gil/metafunctions.hpp>
        +
        18#include <boost/gil/pixel_numeric_operations.hpp>
        +
        19
        +
        20#include <boost/assert.hpp>
        +
        21
        +
        22#include <algorithm>
        +
        23#include <cstddef>
        +
        24#include <functional>
        +
        25#include <type_traits>
        +
        26#include <vector>
        +
        27
        +
        28namespace boost { namespace gil {
        +
        29
        +
        30// 2D spatial separable convolutions and cross-correlations
        +
        31
        +
        32namespace detail {
        +
        33
        +
        50template
        +
        51<
        +
        52 typename PixelAccum,
        +
        53 typename SrcView,
        +
        54 typename Kernel,
        +
        55 typename DstView,
        +
        56 typename Correlator
        +
        57>
        +
        58void correlate_rows_impl(
        +
        59 SrcView const& src_view,
        +
        60 Kernel const& kernel,
        +
        61 DstView const& dst_view,
        +
        62 boundary_option option,
        +
        63 Correlator correlator)
        +
        64{
        +
        65 BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
        +
        66 BOOST_ASSERT(kernel.size() != 0);
        +
        67
        +
        68 if(kernel.size() == 1)
        +
        69 {
        +
        70 // Reduces to a multiplication
        +
        71 view_multiplies_scalar<PixelAccum>(src_view, *kernel.begin(), dst_view);
        +
        72 return;
        +
        73 }
        +
        74
        +
        75 using src_pixel_ref_t = typename pixel_proxy<typename SrcView::value_type>::type;
        +
        76 using dst_pixel_ref_t = typename pixel_proxy<typename DstView::value_type>::type;
        +
        77 using x_coord_t = typename SrcView::x_coord_t;
        +
        78 using y_coord_t = typename SrcView::y_coord_t;
        +
        79
        +
        80 x_coord_t const width = src_view.width();
        +
        81 y_coord_t const height = src_view.height();
        +
        82 if (width == 0)
        +
        83 return;
        +
        84
        +
        85 PixelAccum acc_zero;
        +
        86 pixel_zeros_t<PixelAccum>()(acc_zero);
        +
        87 if (option == boundary_option::output_ignore || option == boundary_option::output_zero)
        +
        88 {
        +
        89 typename DstView::value_type dst_zero;
        +
        90 pixel_assigns_t<PixelAccum, dst_pixel_ref_t>()(acc_zero, dst_zero);
        +
        91 if (width < static_cast<x_coord_t>(kernel.size()))
        +
        92 {
        +
        93 if (option == boundary_option::output_zero)
        +
        94 fill_pixels(dst_view, dst_zero);
        +
        95 }
        +
        96 else
        +
        97 {
        +
        98 std::vector<PixelAccum> buffer(width);
        +
        99 for (y_coord_t y = 0; y < height; ++y)
        +
        100 {
        +
        101 assign_pixels(src_view.row_begin(y), src_view.row_end(y), &buffer.front());
        +
        102 typename DstView::x_iterator it_dst = dst_view.row_begin(y);
        +
        103 if (option == boundary_option::output_zero)
        +
        104 std::fill_n(it_dst, kernel.left_size(), dst_zero);
        +
        105 it_dst += kernel.left_size();
        +
        106 correlator(&buffer.front(), &buffer.front() + width + 1 - kernel.size(),
        +
        107 kernel.begin(), it_dst);
        +
        108 it_dst += width + 1 - kernel.size();
        +
        109 if (option == boundary_option::output_zero)
        +
        110 std::fill_n(it_dst, kernel.right_size(), dst_zero);
        +
        111 }
        +
        112 }
        +
        113 }
        +
        114 else
        +
        115 {
        +
        116 std::vector<PixelAccum> buffer(width + kernel.size() - 1);
        +
        117 for (y_coord_t y = 0; y < height; ++y)
        +
        118 {
        +
        119 PixelAccum *it_buffer = &buffer.front();
        +
        120 if (option == boundary_option::extend_padded)
        +
        121 {
        +
        122 assign_pixels(
        +
        123 src_view.row_begin(y) - kernel.left_size(),
        +
        124 src_view.row_end(y) + kernel.right_size(),
        +
        125 it_buffer);
        +
        126 }
        +
        127 else if (option == boundary_option::extend_zero)
        +
        128 {
        +
        129 std::fill_n(it_buffer, kernel.left_size(), acc_zero);
        +
        130 it_buffer += kernel.left_size();
        +
        131 assign_pixels(src_view.row_begin(y), src_view.row_end(y), it_buffer);
        +
        132 it_buffer += width;
        +
        133 std::fill_n(it_buffer, kernel.right_size(), acc_zero);
        +
        134 }
        +
        135 else if (option == boundary_option::extend_constant)
        +
        136 {
        +
        137 PixelAccum filler;
        +
        138 pixel_assigns_t<src_pixel_ref_t, PixelAccum>()(*src_view.row_begin(y), filler);
        +
        139 std::fill_n(it_buffer, kernel.left_size(), filler);
        +
        140 it_buffer += kernel.left_size();
        +
        141 assign_pixels(src_view.row_begin(y), src_view.row_end(y), it_buffer);
        +
        142 it_buffer += width;
        +
        143 pixel_assigns_t<src_pixel_ref_t, PixelAccum>()(src_view.row_end(y)[-1], filler);
        +
        144 std::fill_n(it_buffer, kernel.right_size(), filler);
        +
        145 }
        +
        146
        +
        147 correlator(
        +
        148 &buffer.front(), &buffer.front() + width,
        +
        149 kernel.begin(),
        +
        150 dst_view.row_begin(y));
        +
        151 }
        +
        152 }
        +
        153}
        +
        154
        +
        158template <typename PixelAccum>
        +
        + +
        160{
        +
        161public:
        +
        162 correlator_n(std::size_t size) : size_(size) {}
        +
        163
        +
        164 template <typename SrcIterator, typename KernelIterator, typename DstIterator>
        +
        165 void operator()(
        +
        166 SrcIterator src_begin,
        +
        167 SrcIterator src_end,
        +
        168 KernelIterator kernel_begin,
        +
        169 DstIterator dst_begin)
        +
        170 {
        +
        171 correlate_pixels_n<PixelAccum>(src_begin, src_end, kernel_begin, size_, dst_begin);
        +
        172 }
        +
        173
        +
        174private:
        +
        175 std::size_t size_{0};
        +
        176};
        +
        +
        177
        +
        181template <std::size_t Size, typename PixelAccum>
        +
        + +
        183{
        +
        184 template <typename SrcIterator, typename KernelIterator, typename DstIterator>
        +
        185 void operator()(
        +
        186 SrcIterator src_begin,
        +
        187 SrcIterator src_end,
        +
        188 KernelIterator kernel_begin,
        +
        189 DstIterator dst_begin)
        +
        190 {
        +
        191 correlate_pixels_k<Size, PixelAccum>(src_begin, src_end, kernel_begin, dst_begin);
        +
        192 }
        +
        193};
        +
        +
        194
        +
        195} // namespace detail
        +
        196
        +
        205template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        +
        206BOOST_FORCEINLINE
        +
        207void correlate_rows(
        +
        208 SrcView const& src_view,
        +
        209 Kernel const& kernel,
        +
        210 DstView const& dst_view,
        +
        211 boundary_option option = boundary_option::extend_zero)
        +
        212{
        +
        213 detail::correlate_rows_impl<PixelAccum>(
        +
        214 src_view, kernel, dst_view, option, detail::correlator_n<PixelAccum>(kernel.size()));
        +
        215}
        +
        216
        +
        225template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        +
        226BOOST_FORCEINLINE
        +
        227void correlate_cols(
        +
        228 SrcView const& src_view,
        +
        229 Kernel const& kernel,
        +
        230 DstView const& dst_view,
        +
        231 boundary_option option = boundary_option::extend_zero)
        +
        232{
        +
        233 correlate_rows<PixelAccum>(
        +
        234 transposed_view(src_view), kernel, transposed_view(dst_view), option);
        +
        235}
        +
        236
        +
        244template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        +
        245BOOST_FORCEINLINE
        +
        246void convolve_rows(
        +
        247 SrcView const& src_view,
        +
        248 Kernel const& kernel,
        +
        249 DstView const& dst_view,
        +
        250 boundary_option option = boundary_option::extend_zero)
        +
        251{
        +
        252 correlate_rows<PixelAccum>(src_view, reverse_kernel(kernel), dst_view, option);
        +
        253}
        +
        254
        +
        263template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        +
        264BOOST_FORCEINLINE
        +
        265void convolve_cols(
        +
        266 SrcView const& src_view,
        +
        267 Kernel const& kernel,
        +
        268 DstView const& dst_view,
        +
        269 boundary_option option = boundary_option::extend_zero)
        +
        270{
        +
        271 convolve_rows<PixelAccum>(
        +
        272 transposed_view(src_view), kernel, transposed_view(dst_view), option);
        +
        273}
        +
        274
        +
        282template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        +
        283BOOST_FORCEINLINE
        +
        284void correlate_rows_fixed(
        +
        285 SrcView const& src_view,
        +
        286 Kernel const& kernel,
        +
        287 DstView const& dst_view,
        +
        288 boundary_option option = boundary_option::extend_zero)
        +
        289{
        +
        290 using correlator = detail::correlator_k<Kernel::static_size, PixelAccum>;
        +
        291 detail::correlate_rows_impl<PixelAccum>(src_view, kernel, dst_view, option, correlator{});
        +
        292}
        +
        293
        +
        302template <typename PixelAccum,typename SrcView,typename Kernel,typename DstView>
        +
        303BOOST_FORCEINLINE
        +
        304void correlate_cols_fixed(
        +
        305 SrcView const& src_view,
        +
        306 Kernel const& kernel,
        +
        307 DstView const& dst_view,
        +
        308 boundary_option option = boundary_option::extend_zero)
        +
        309{
        +
        310 correlate_rows_fixed<PixelAccum>(
        +
        311 transposed_view(src_view), kernel, transposed_view(dst_view), option);
        +
        312}
        +
        313
        +
        321template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        +
        322BOOST_FORCEINLINE
        +
        323void convolve_rows_fixed(
        +
        324 SrcView const& src_view,
        +
        325 Kernel const& kernel,
        +
        326 DstView const& dst_view,
        +
        327 boundary_option option = boundary_option::extend_zero)
        +
        328{
        +
        329 correlate_rows_fixed<PixelAccum>(src_view, reverse_kernel(kernel), dst_view, option);
        +
        330}
        +
        331
        +
        340template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        +
        341BOOST_FORCEINLINE
        +
        342void convolve_cols_fixed(
        +
        343 SrcView const& src_view,
        +
        344 Kernel const& kernel,
        +
        345 DstView const& dst_view,
        +
        346 boundary_option option = boundary_option::extend_zero)
        +
        347{
        +
        348 convolve_rows_fixed<PixelAccum>(
        +
        349 transposed_view(src_view), kernel, transposed_view(dst_view), option);
        +
        350}
        +
        351
        +
        352namespace detail
        +
        353{
        +
        354
        +
        363template <typename PixelAccum, typename SrcView, typename Kernel, typename DstView>
        +
        364BOOST_FORCEINLINE
        +
        365void convolve_1d(
        +
        366 SrcView const& src_view,
        +
        367 Kernel const& kernel,
        +
        368 DstView const& dst_view,
        +
        369 boundary_option option = boundary_option::extend_zero)
        +
        370{
        +
        371 convolve_rows<PixelAccum>(src_view, kernel, dst_view, option);
        +
        372 convolve_cols<PixelAccum>(dst_view, kernel, dst_view, option);
        +
        373}
        +
        374
        +
        375template <typename SrcView, typename DstView, typename Kernel>
        +
        376void convolve_2d_impl(SrcView const& src_view, DstView const& dst_view, Kernel const& kernel)
        +
        377{
        +
        378 int flip_ker_row, flip_ker_col, row_boundary, col_boundary;
        +
        379 float aux_total;
        +
        380 for (std::ptrdiff_t view_row = 0; view_row < src_view.height(); ++view_row)
        +
        381 {
        +
        382 for (std::ptrdiff_t view_col = 0; view_col < src_view.width(); ++view_col)
        +
        383 {
        +
        384 aux_total = 0.0f;
        +
        385 for (std::size_t kernel_row = 0; kernel_row < kernel.size(); ++kernel_row)
        +
        386 {
        +
        387 flip_ker_row = kernel.size() - 1 - kernel_row; // row index of flipped kernel
        +
        388
        +
        389 for (std::size_t kernel_col = 0; kernel_col < kernel.size(); ++kernel_col)
        +
        390 {
        +
        391 flip_ker_col = kernel.size() - 1 - kernel_col; // column index of flipped kernel
        +
        392
        +
        393 // index of input signal, used for checking boundary
        +
        394 row_boundary = view_row + (kernel.center_y() - flip_ker_row);
        +
        395 col_boundary = view_col + (kernel.center_x() - flip_ker_col);
        +
        396
        +
        397 // ignore input samples which are out of bound
        +
        398 if (row_boundary >= 0 && row_boundary < src_view.height() &&
        +
        399 col_boundary >= 0 && col_boundary < src_view.width())
        +
        400 {
        +
        401 aux_total +=
        +
        402 src_view(col_boundary, row_boundary)[0] *
        +
        403 kernel.at(flip_ker_col, flip_ker_row);
        +
        404 }
        +
        405 }
        +
        406 }
        +
        407 dst_view(view_col, view_row) = aux_total;
        +
        408 }
        +
        409 }
        +
        410}
        +
        411
        +
        419template <typename SrcView, typename DstView, typename Kernel>
        +
        420void convolve_2d(SrcView const& src_view, Kernel const& kernel, DstView const& dst_view)
        +
        421{
        +
        422 BOOST_ASSERT(src_view.dimensions() == dst_view.dimensions());
        +
        423 BOOST_ASSERT(kernel.size() != 0);
        +
        424
        +
        425 gil_function_requires<ImageViewConcept<SrcView>>();
        +
        426 gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        427 static_assert(color_spaces_are_compatible
        +
        428 <
        +
        429 typename color_space_type<SrcView>::type,
        +
        430 typename color_space_type<DstView>::type
        +
        431 >::value, "Source and destination views must have pixels with the same color space");
        +
        432
        +
        433 for (std::size_t i = 0; i < src_view.num_channels(); i++)
        +
        434 {
        +
        435 detail::convolve_2d_impl(
        +
        436 nth_channel_view(src_view, i),
        +
        437 nth_channel_view(dst_view, i),
        +
        438 kernel
        +
        439 );
        +
        440 }
        +
        441}
        +
        442
        +
        443}}} // namespace boost::gil::detail
        +
        444
        +
        445#endif
        +
        Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixe...
        Definition convolve.hpp:160
        +
        BOOST_FORCEINLINE void fill_pixels(View const &view, Value const &value)
        std::fill for image views
        Definition algorithm.hpp:420
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixe...
        Definition convolve.hpp:183
        +
        Returns an integral constant type specifying the number of elements in a color base.
        Definition color_base_algorithm.hpp:42
        diff --git a/html/reference/device_8hpp_source.html b/html/reference/device_8hpp_source.html index 29bd5b62c..ee50ea3e5 100644 --- a/html/reference/device_8hpp_source.html +++ b/html/reference/device_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: device.hpp Source File @@ -27,764 +27,829 @@

        - + +/* @license-end */ + +
        -
        -
        device.hpp
        +
        device.hpp
        -
        1 //
        -
        2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny
        -
        3 // Copyright 2024 Dirk Stolle
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_IO_DEVICE_HPP
        -
        10 #define BOOST_GIL_IO_DEVICE_HPP
        -
        11 
        -
        12 #include <boost/gil/detail/mp11.hpp>
        -
        13 #include <boost/gil/io/base.hpp>
        -
        14 
        -
        15 #include <cstdio>
        -
        16 #include <memory>
        -
        17 #include <type_traits>
        -
        18 
        -
        19 namespace boost { namespace gil {
        -
        20 
        -
        21 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        22 #pragma warning(push)
        -
        23 #pragma warning(disable:4512) //assignment operator could not be generated
        -
        24 #endif
        -
        25 
        -
        26 namespace detail {
        -
        27 
        -
        28 template < typename T > struct buff_item
        -
        29 {
        -
        30  static const unsigned int size = sizeof( T );
        -
        31 };
        -
        32 
        -
        33 template <> struct buff_item< void >
        -
        34 {
        -
        35  static const unsigned int size = 1;
        -
        36 };
        -
        37 
        -
        48 template< typename FormatTag >
        - -
        50 {
        -
        51 public:
        -
        52 
        -
        53  using format_tag_t = FormatTag;
        -
        54 
        -
        55 public:
        -
        56 
        -
        58  struct read_tag {};
        -
        59  struct write_tag {};
        -
        60 
        -
        64  file_stream_device( const std::string& file_name
        -
        65  , read_tag tag = read_tag()
        -
        66  )
        -
        67  : file_stream_device(file_name.c_str(), tag)
        -
        68  {}
        -
        69 
        -
        73  file_stream_device( const char* file_name
        -
        74  , read_tag = read_tag()
        -
        75  )
        -
        76  {
        -
        77  FILE* file = nullptr;
        -
        78 
        -
        79  io_error_if( ( file = fopen( file_name, "rb" )) == nullptr
        -
        80  , "file_stream_device: failed to open file for reading"
        -
        81  );
        -
        82 
        -
        83  _file = file_ptr_t( file
        -
        84  , file_deleter
        -
        85  );
        -
        86  }
        -
        87 
        -
        91  file_stream_device( const std::string& file_name
        -
        92  , write_tag tag
        -
        93  )
        -
        94  : file_stream_device(file_name.c_str(), tag)
        -
        95  {}
        -
        96 
        -
        100  file_stream_device( const char* file_name
        -
        101  , write_tag
        -
        102  )
        -
        103  {
        -
        104  FILE* file = nullptr;
        -
        105 
        -
        106  io_error_if( ( file = fopen( file_name, "wb" )) == nullptr
        -
        107  , "file_stream_device: failed to open file for writing"
        -
        108  );
        -
        109 
        -
        110  _file = file_ptr_t( file
        -
        111  , file_deleter
        -
        112  );
        -
        113  }
        -
        114 
        -
        118  file_stream_device( FILE* file )
        -
        119  : _file( file
        -
        120  , file_deleter
        -
        121  )
        -
        122  {}
        -
        123 
        -
        124  auto get() -> FILE* { return _file.get(); }
        -
        125  auto get() const -> FILE const* { return _file.get(); }
        -
        126 
        -
        127  int getc_unchecked()
        -
        128  {
        -
        129  return std::getc( get() );
        -
        130  }
        -
        131 
        -
        132  char getc()
        -
        133  {
        -
        134  int ch;
        -
        135 
        -
        136  io_error_if( ( ch = std::getc( get() )) == EOF
        -
        137  , "file_stream_device: unexpected EOF"
        -
        138  );
        -
        139 
        -
        140  return ( char ) ch;
        -
        141  }
        -
        142 
        -
        144  auto read(byte_t* data, std::size_t count) -> std::size_t
        -
        145  {
        -
        146  std::size_t num_elements = fread( data
        -
        147  , 1
        -
        148  , static_cast<int>( count )
        -
        149  , get()
        -
        150  );
        -
        151 
        -
        153  io_error_if( ferror( get() )
        -
        154  , "file_stream_device: file read error"
        -
        155  );
        -
        156 
        -
        157  //libjpeg sometimes reads blocks in 4096 bytes even when the file is smaller than that.
        -
        158  //return value indicates how much was actually read
        -
        159  //returning less than "count" is not an error
        -
        160  return num_elements;
        -
        161  }
        -
        162 
        -
        164  template< typename T, int N>
        -
        165  void read( T (&buf)[N] )
        -
        166  {
        -
        167  io_error_if( read( buf, N ) < N
        -
        168  , "file_stream_device: file read error"
        -
        169  );
        -
        170  }
        -
        171 
        -
        173  uint8_t read_uint8()
        -
        174  {
        -
        175  byte_t m[1];
        -
        176 
        -
        177  read( m );
        -
        178  return m[0];
        -
        179  }
        -
        180 
        -
        182  uint16_t read_uint16()
        -
        183  {
        -
        184  byte_t m[2];
        -
        185 
        -
        186  read( m );
        -
        187  return (m[1] << 8) | m[0];
        -
        188  }
        -
        189 
        -
        191  uint32_t read_uint32()
        -
        192  {
        -
        193  byte_t m[4];
        -
        194 
        -
        195  read( m );
        -
        196  return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
        -
        197  }
        -
        198 
        -
        200  template < typename T >
        -
        201  auto write(T const* buf, std::size_t count) -> std::size_t
        -
        202  {
        -
        203  std::size_t num_elements = fwrite( buf
        -
        204  , buff_item<T>::size
        -
        205  , count
        -
        206  , get()
        -
        207  );
        -
        208 
        -
        209  //return value indicates how much was actually written
        -
        210  //returning less than "count" is not an error
        -
        211  return num_elements;
        -
        212  }
        -
        213 
        -
        215  template < typename T
        -
        216  , std::size_t N
        -
        217  >
        -
        218  void write( const T (&buf)[N] )
        -
        219  {
        -
        220  io_error_if( write( buf, N ) < N
        -
        221  , "file_stream_device: file write error"
        -
        222  );
        -
        223  return ;
        -
        224  }
        -
        225 
        -
        227  void write_uint8( uint8_t x )
        -
        228  {
        -
        229  byte_t m[1] = { x };
        -
        230  write(m);
        -
        231  }
        -
        232 
        -
        234  void write_uint16( uint16_t x )
        -
        235  {
        -
        236  byte_t m[2];
        -
        237 
        -
        238  m[0] = byte_t( x >> 0 );
        -
        239  m[1] = byte_t( x >> 8 );
        -
        240 
        -
        241  write( m );
        -
        242  }
        -
        243 
        -
        245  void write_uint32( uint32_t x )
        -
        246  {
        -
        247  byte_t m[4];
        -
        248 
        -
        249  m[0] = byte_t( x >> 0 );
        -
        250  m[1] = byte_t( x >> 8 );
        -
        251  m[2] = byte_t( x >> 16 );
        -
        252  m[3] = byte_t( x >> 24 );
        -
        253 
        -
        254  write( m );
        -
        255  }
        -
        256 
        -
        257  void seek( long count, int whence = SEEK_SET )
        -
        258  {
        -
        259  io_error_if( fseek( get()
        -
        260  , count
        -
        261  , whence
        -
        262  ) != 0
        -
        263  , "file_stream_device: file seek error"
        -
        264  );
        -
        265  }
        -
        266 
        -
        267  long int tell()
        -
        268  {
        -
        269  long int pos = ftell( get() );
        -
        270 
        -
        271  io_error_if( pos == -1L
        -
        272  , "file_stream_device: file position error"
        -
        273  );
        -
        274 
        -
        275  return pos;
        -
        276  }
        -
        277 
        -
        278  void flush()
        -
        279  {
        -
        280  fflush( get() );
        -
        281  }
        -
        282 
        -
        284  void print_line( const std::string& line )
        -
        285  {
        -
        286  std::size_t num_elements = fwrite( line.c_str()
        -
        287  , sizeof( char )
        -
        288  , line.size()
        -
        289  , get()
        -
        290  );
        -
        291 
        -
        292  io_error_if( num_elements < line.size()
        -
        293  , "file_stream_device: line print error"
        -
        294  );
        -
        295  }
        -
        296 
        -
        297  int error()
        -
        298  {
        -
        299  return ferror( get() );
        -
        300  }
        -
        301 
        -
        302 private:
        -
        303 
        -
        304  static void file_deleter( FILE* file )
        -
        305  {
        -
        306  if( file )
        -
        307  {
        -
        308  fclose( file );
        -
        309  }
        -
        310  }
        -
        311 
        -
        312 private:
        -
        313 
        -
        314  using file_ptr_t = std::shared_ptr<FILE> ;
        -
        315  file_ptr_t _file;
        -
        316 };
        -
        317 
        -
        321 template< typename FormatTag >
        - -
        323 {
        -
        324 public:
        -
        325  istream_device( std::istream& in )
        -
        326  : _in( in )
        -
        327  {
        -
        328  // does the file exists?
        -
        329  io_error_if( !in
        -
        330  , "istream_device: Stream is not valid."
        -
        331  );
        -
        332  }
        -
        333 
        -
        334  int getc_unchecked()
        -
        335  {
        -
        336  return _in.get();
        -
        337  }
        -
        338 
        -
        339  char getc()
        -
        340  {
        -
        341  int ch;
        -
        342 
        -
        343  io_error_if( ( ch = _in.get() ) == EOF
        -
        344  , "istream_device: unexpected EOF"
        -
        345  );
        -
        346 
        -
        347  return ( char ) ch;
        -
        348  }
        -
        349 
        -
        350  std::size_t read( byte_t* data
        -
        351  , std::size_t count )
        -
        352  {
        -
        353  std::streamsize cr = 0;
        -
        354 
        -
        355  do
        -
        356  {
        -
        357  _in.peek();
        -
        358  std::streamsize c = _in.readsome( reinterpret_cast< char* >( data )
        -
        359  , static_cast< std::streamsize >( count ));
        -
        360 
        -
        361  count -= static_cast< std::size_t >( c );
        -
        362  data += c;
        -
        363  cr += c;
        -
        364 
        -
        365  } while( count && _in );
        -
        366 
        -
        367  return static_cast< std::size_t >( cr );
        -
        368  }
        -
        369 
        -
        371  template<typename T, int N>
        -
        372  void read(T (&buf)[N])
        -
        373  {
        -
        374  read(buf, N);
        -
        375  }
        -
        376 
        -
        378  uint8_t read_uint8()
        -
        379  {
        -
        380  byte_t m[1];
        -
        381 
        -
        382  read( m );
        -
        383  return m[0];
        -
        384  }
        -
        385 
        -
        387  uint16_t read_uint16()
        -
        388  {
        -
        389  byte_t m[2];
        -
        390 
        -
        391  read( m );
        -
        392  return (m[1] << 8) | m[0];
        -
        393  }
        -
        394 
        -
        396  uint32_t read_uint32()
        -
        397  {
        -
        398  byte_t m[4];
        -
        399 
        -
        400  read( m );
        -
        401  return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
        -
        402  }
        -
        403 
        -
        404  void seek( long count, int whence = SEEK_SET )
        -
        405  {
        -
        406  _in.seekg( count
        -
        407  , whence == SEEK_SET ? std::ios::beg
        -
        408  :( whence == SEEK_CUR ? std::ios::cur
        -
        409  : std::ios::end )
        -
        410  );
        -
        411  }
        -
        412 
        -
        413  long int tell()
        -
        414  {
        -
        415  auto pos = _in.tellg();
        -
        416 
        -
        417  io_error_if( pos == std::istream::pos_type(-1)
        -
        418  , "istream_device: file position error"
        -
        419  );
        -
        420 
        -
        421  return static_cast<long int>(pos);
        -
        422  }
        -
        423 
        -
        424  void write(const byte_t*, std::size_t)
        -
        425  {
        -
        426  io_error( "istream_device: Bad io error." );
        -
        427  }
        -
        428 
        -
        429  void flush() {}
        -
        430 
        -
        431  int error()
        -
        432  {
        -
        433  return _in.fail();
        -
        434  }
        -
        435 
        -
        436 private:
        -
        437 
        -
        438  std::istream& _in;
        -
        439 };
        -
        440 
        -
        444 template< typename FormatTag >
        - -
        446 {
        -
        447 public:
        -
        448  ostream_device( std::ostream & out )
        -
        449  : _out( out )
        -
        450  {
        -
        451  }
        -
        452 
        -
        453  std::size_t read(byte_t *, std::size_t)
        -
        454  {
        -
        455  io_error( "ostream_device: Bad io error." );
        -
        456  return 0;
        -
        457  }
        -
        458 
        -
        459  void seek( long count, int whence )
        -
        460  {
        -
        461  _out.seekp( count
        -
        462  , whence == SEEK_SET
        -
        463  ? std::ios::beg
        -
        464  : ( whence == SEEK_CUR
        -
        465  ?std::ios::cur
        -
        466  :std::ios::end )
        -
        467  );
        -
        468  }
        -
        469 
        -
        470  long int tell()
        -
        471  {
        -
        472  auto pos = _out.tellp();
        -
        473 
        -
        474  io_error_if( pos == std::ostream::pos_type(-1)
        -
        475  , "ostream_device: file position error"
        -
        476  );
        -
        477 
        -
        478  return static_cast<long int>(pos);
        -
        479  }
        -
        480 
        -
        481  void write( const byte_t* data
        -
        482  , std::size_t count )
        -
        483  {
        -
        484  _out.write( reinterpret_cast<char const*>( data )
        -
        485  , static_cast<std::streamsize>( count )
        -
        486  );
        -
        487  }
        -
        488 
        -
        490  template < typename T
        -
        491  , std::size_t N
        -
        492  >
        -
        493  void write( const T (&buf)[N] )
        -
        494  {
        -
        495  write( buf, N );
        -
        496  }
        -
        497 
        -
        499  void write_uint8( uint8_t x )
        -
        500  {
        -
        501  byte_t m[1] = { x };
        -
        502  write(m);
        -
        503  }
        -
        504 
        -
        506  void write_uint16( uint16_t x )
        -
        507  {
        -
        508  byte_t m[2];
        -
        509 
        -
        510  m[0] = byte_t( x >> 0 );
        -
        511  m[1] = byte_t( x >> 8 );
        -
        512 
        -
        513  write( m );
        -
        514  }
        -
        515 
        -
        517  void write_uint32( uint32_t x )
        -
        518  {
        -
        519  byte_t m[4];
        -
        520 
        -
        521  m[0] = byte_t( x >> 0 );
        -
        522  m[1] = byte_t( x >> 8 );
        -
        523  m[2] = byte_t( x >> 16 );
        -
        524  m[3] = byte_t( x >> 24 );
        -
        525 
        -
        526  write( m );
        -
        527  }
        -
        528 
        -
        529  void flush()
        -
        530  {
        -
        531  _out << std::flush;
        -
        532  }
        -
        533 
        -
        535  void print_line( const std::string& line )
        -
        536  {
        -
        537  _out << line;
        -
        538  }
        -
        539 
        -
        540  int error()
        -
        541  {
        -
        542  return _out.fail();
        -
        543  }
        -
        544 
        -
        545 private:
        -
        546 
        -
        547  std::ostream& _out;
        -
        548 };
        -
        549 
        -
        550 
        -
        555 template< typename IODevice > struct is_input_device : std::false_type{};
        -
        556 template< typename FormatTag > struct is_input_device< file_stream_device< FormatTag > > : std::true_type{};
        -
        557 template< typename FormatTag > struct is_input_device< istream_device< FormatTag > > : std::true_type{};
        -
        558 
        -
        559 template< typename FormatTag
        -
        560  , typename T
        -
        561  , typename D = void
        -
        562  >
        -
        563 struct is_adaptable_input_device : std::false_type{};
        -
        564 
        -
        565 template <typename FormatTag, typename T>
        -
        566 struct is_adaptable_input_device
        -
        567 <
        -
        568  FormatTag,
        -
        569  T,
        -
        570  typename std::enable_if
        -
        571  <
        -
        572  mp11::mp_or
        -
        573  <
        -
        574  std::is_base_of<std::istream, T>,
        -
        575  std::is_same<std::istream, T>
        -
        576  >::value
        -
        577  >::type
        -
        578 > : std::true_type
        -
        579 {
        -
        580  using device_type = istream_device<FormatTag>;
        -
        581 };
        -
        582 
        -
        583 template< typename FormatTag >
        -
        584 struct is_adaptable_input_device< FormatTag
        -
        585  , FILE*
        -
        586  , void
        -
        587  >
        -
        588  : std::true_type
        -
        589 {
        -
        590  using device_type = file_stream_device<FormatTag>;
        -
        591 };
        -
        592 
        -
        596 template< typename FormatTag
        -
        597  , typename T
        -
        598  , typename D = void
        -
        599  >
        -
        600 struct is_read_device : std::false_type
        -
        601 {};
        -
        602 
        -
        603 template <typename FormatTag, typename T>
        -
        604 struct is_read_device
        -
        605 <
        -
        606  FormatTag,
        -
        607  T,
        -
        608  typename std::enable_if
        -
        609  <
        -
        610  mp11::mp_or
        -
        611  <
        -
        612  is_input_device<FormatTag>,
        -
        613  is_adaptable_input_device<FormatTag, T>
        -
        614  >::value
        -
        615  >::type
        -
        616 > : std::true_type
        -
        617 {
        -
        618 };
        -
        619 
        -
        620 
        -
        625 template<typename IODevice> struct is_output_device : std::false_type{};
        -
        626 
        -
        627 template< typename FormatTag > struct is_output_device< file_stream_device< FormatTag > > : std::true_type{};
        -
        628 template< typename FormatTag > struct is_output_device< ostream_device < FormatTag > > : std::true_type{};
        -
        629 
        -
        630 template< typename FormatTag
        -
        631  , typename IODevice
        -
        632  , typename D = void
        -
        633  >
        -
        634 struct is_adaptable_output_device : std::false_type {};
        -
        635 
        -
        636 template <typename FormatTag, typename T>
        -
        637 struct is_adaptable_output_device
        -
        638 <
        -
        639  FormatTag,
        -
        640  T,
        -
        641  typename std::enable_if
        -
        642  <
        -
        643  mp11::mp_or
        -
        644  <
        -
        645  std::is_base_of<std::ostream, T>,
        -
        646  std::is_same<std::ostream, T>
        -
        647  >::value
        -
        648  >::type
        -
        649 > : std::true_type
        -
        650 {
        -
        651  using device_type = ostream_device<FormatTag>;
        -
        652 };
        -
        653 
        -
        654 template<typename FormatTag> struct is_adaptable_output_device<FormatTag,FILE*,void>
        -
        655  : std::true_type
        -
        656 {
        -
        657  using device_type = file_stream_device<FormatTag>;
        -
        658 };
        -
        659 
        -
        660 
        -
        664 template< typename FormatTag
        -
        665  , typename T
        -
        666  , typename D = void
        -
        667  >
        -
        668 struct is_write_device : std::false_type
        -
        669 {};
        -
        670 
        -
        671 template <typename FormatTag, typename T>
        -
        672 struct is_write_device
        -
        673 <
        -
        674  FormatTag,
        -
        675  T,
        -
        676  typename std::enable_if
        -
        677  <
        -
        678  mp11::mp_or
        -
        679  <
        -
        680  is_output_device<FormatTag>,
        -
        681  is_adaptable_output_device<FormatTag, T>
        -
        682  >::value
        -
        683  >::type
        -
        684 > : std::true_type
        -
        685 {
        -
        686 };
        -
        687 
        -
        688 } // namespace detail
        -
        689 
        -
        690 template< typename Device, typename FormatTag > class scanline_reader;
        -
        691 template< typename Device, typename FormatTag, typename ConversionPolicy > class reader;
        -
        692 
        -
        693 template< typename Device, typename FormatTag, typename Log = no_log > class writer;
        -
        694 
        -
        695 template< typename Device, typename FormatTag > class dynamic_image_reader;
        -
        696 template< typename Device, typename FormatTag, typename Log = no_log > class dynamic_image_writer;
        -
        697 
        -
        698 
        -
        699 namespace detail {
        -
        700 
        -
        701 template< typename T >
        -
        702 struct is_reader : std::false_type
        -
        703 {};
        -
        704 
        -
        705 template< typename Device
        -
        706  , typename FormatTag
        -
        707  , typename ConversionPolicy
        -
        708  >
        -
        709 struct is_reader< reader< Device
        -
        710  , FormatTag
        -
        711  , ConversionPolicy
        -
        712  >
        -
        713  > : std::true_type
        -
        714 {};
        -
        715 
        -
        716 template< typename T >
        -
        717 struct is_dynamic_image_reader : std::false_type
        -
        718 {};
        -
        719 
        -
        720 template< typename Device
        -
        721  , typename FormatTag
        -
        722  >
        -
        723 struct is_dynamic_image_reader< dynamic_image_reader< Device
        -
        724  , FormatTag
        -
        725  >
        -
        726  > : std::true_type
        -
        727 {};
        -
        728 
        -
        729 template< typename T >
        -
        730 struct is_writer : std::false_type
        -
        731 {};
        -
        732 
        -
        733 template< typename Device
        -
        734  , typename FormatTag
        -
        735  >
        -
        736 struct is_writer< writer< Device
        -
        737  , FormatTag
        -
        738  >
        -
        739  > : std::true_type
        -
        740 {};
        -
        741 
        -
        742 template< typename T >
        -
        743 struct is_dynamic_image_writer : std::false_type
        -
        744 {};
        -
        745 
        -
        746 template< typename Device
        -
        747  , typename FormatTag
        -
        748  >
        -
        749 struct is_dynamic_image_writer< dynamic_image_writer< Device
        -
        750  , FormatTag
        -
        751  >
        -
        752  > : std::true_type
        -
        753 {};
        -
        754 
        -
        755 } // namespace detail
        -
        756 
        -
        757 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        758 #pragma warning(pop)
        -
        759 #endif
        -
        760 
        -
        761 } // namespace gil
        -
        762 } // namespace boost
        -
        763 
        -
        764 #endif
        - -
        file_stream_device(const std::string &file_name, read_tag tag=read_tag())
        Definition: device.hpp:64
        -
        void write_uint32(uint32_t x)
        Writes 32 bit little endian integer.
        Definition: device.hpp:245
        -
        void print_line(const std::string &line)
        Prints formatted ASCII text.
        Definition: device.hpp:284
        -
        void write_uint8(uint8_t x)
        Writes byte.
        Definition: device.hpp:227
        -
        void read(T(&buf)[N])
        Reads array.
        Definition: device.hpp:165
        -
        file_stream_device(FILE *file)
        Definition: device.hpp:118
        -
        uint16_t read_uint16()
        Reads 16 bit little endian integer.
        Definition: device.hpp:182
        -
        uint8_t read_uint8()
        Reads byte.
        Definition: device.hpp:173
        -
        file_stream_device(const char *file_name, write_tag)
        Definition: device.hpp:100
        -
        auto read(byte_t *data, std::size_t count) -> std::size_t
        Definition: device.hpp:144
        -
        file_stream_device(const std::string &file_name, write_tag tag)
        Definition: device.hpp:91
        -
        void write(const T(&buf)[N])
        Writes array.
        Definition: device.hpp:218
        -
        file_stream_device(const char *file_name, read_tag=read_tag())
        Definition: device.hpp:73
        -
        uint32_t read_uint32()
        Reads 32 bit little endian integer.
        Definition: device.hpp:191
        -
        void write_uint16(uint16_t x)
        Writes 16 bit little endian integer.
        Definition: device.hpp:234
        -
        auto write(T const *buf, std::size_t count) -> std::size_t
        Writes number of elements from a buffer.
        Definition: device.hpp:201
        -
        Definition: device.hpp:323
        -
        void read(T(&buf)[N])
        Reads array.
        Definition: device.hpp:372
        -
        uint16_t read_uint16()
        Reads 16 bit little endian integer.
        Definition: device.hpp:387
        -
        uint8_t read_uint8()
        Reads byte.
        Definition: device.hpp:378
        -
        uint32_t read_uint32()
        Reads 32 bit little endian integer.
        Definition: device.hpp:396
        -
        Definition: device.hpp:446
        -
        void write_uint32(uint32_t x)
        Writes 32 bit little endian integer.
        Definition: device.hpp:517
        -
        void print_line(const std::string &line)
        Prints formatted ASCII text.
        Definition: device.hpp:535
        -
        void write_uint8(uint8_t x)
        Writes byte.
        Definition: device.hpp:499
        -
        void write(const T(&buf)[N])
        Writes array.
        Definition: device.hpp:493
        -
        void write_uint16(uint16_t x)
        Writes 16 bit little endian integer.
        Definition: device.hpp:506
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Used to overload the constructor.
        Definition: device.hpp:58
        -
        Definition: device.hpp:555
        -
        Definition: device.hpp:625
        -
        Definition: device.hpp:601
        -
        Definition: device.hpp:669
        +
        1//
        +
        2// Copyright 2007-2012 Christian Henning, Andreas Pokorny
        +
        3// Copyright 2024 Dirk Stolle
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_IO_DEVICE_HPP
        +
        10#define BOOST_GIL_IO_DEVICE_HPP
        +
        11
        +
        12#include <boost/gil/detail/mp11.hpp>
        +
        13#include <boost/gil/io/base.hpp>
        +
        14
        +
        15#include <cstdio>
        +
        16#include <memory>
        +
        17#include <type_traits>
        +
        18
        +
        19namespace boost { namespace gil {
        +
        20
        +
        21#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        22#pragma warning(push)
        +
        23#pragma warning(disable:4512) //assignment operator could not be generated
        +
        24#endif
        +
        25
        +
        26namespace detail {
        +
        27
        +
        28template < typename T > struct buff_item
        +
        29{
        +
        30 static const unsigned int size = sizeof( T );
        +
        31};
        +
        32
        +
        33template <> struct buff_item< void >
        +
        34{
        +
        35 static const unsigned int size = 1;
        +
        36};
        +
        37
        +
        48template< typename FormatTag >
        +
        + +
        50{
        +
        51public:
        +
        52
        +
        53 using format_tag_t = FormatTag;
        +
        54
        +
        55public:
        +
        56
        +
        58 struct read_tag {};
        +
        59 struct write_tag {};
        +
        60
        +
        +
        64 file_stream_device( const std::string& file_name
        +
        65 , read_tag tag = read_tag()
        +
        66 )
        +
        67 : file_stream_device(file_name.c_str(), tag)
        +
        68 {}
        +
        +
        69
        +
        +
        73 file_stream_device( const char* file_name
        +
        74 , read_tag = read_tag()
        +
        75 )
        +
        76 {
        +
        77 FILE* file = nullptr;
        +
        78
        +
        79 io_error_if( ( file = fopen( file_name, "rb" )) == nullptr
        +
        80 , "file_stream_device: failed to open file for reading"
        +
        81 );
        +
        82
        +
        83 _file = file_ptr_t( file
        +
        84 , file_deleter
        +
        85 );
        +
        86 }
        +
        +
        87
        +
        +
        91 file_stream_device( const std::string& file_name
        +
        92 , write_tag tag
        +
        93 )
        +
        94 : file_stream_device(file_name.c_str(), tag)
        +
        95 {}
        +
        +
        96
        +
        +
        100 file_stream_device( const char* file_name
        +
        101 , write_tag
        +
        102 )
        +
        103 {
        +
        104 FILE* file = nullptr;
        +
        105
        +
        106 io_error_if( ( file = fopen( file_name, "wb" )) == nullptr
        +
        107 , "file_stream_device: failed to open file for writing"
        +
        108 );
        +
        109
        +
        110 _file = file_ptr_t( file
        +
        111 , file_deleter
        +
        112 );
        +
        113 }
        +
        +
        114
        +
        +
        118 file_stream_device( FILE* file )
        +
        119 : _file( file
        +
        120 , file_deleter
        +
        121 )
        +
        122 {}
        +
        +
        123
        +
        124 auto get() -> FILE* { return _file.get(); }
        +
        125 auto get() const -> FILE const* { return _file.get(); }
        +
        126
        +
        127 int getc_unchecked()
        +
        128 {
        +
        129 return std::getc( get() );
        +
        130 }
        +
        131
        +
        132 char getc()
        +
        133 {
        +
        134 int ch;
        +
        135
        +
        136 io_error_if( ( ch = std::getc( get() )) == EOF
        +
        137 , "file_stream_device: unexpected EOF"
        +
        138 );
        +
        139
        +
        140 return ( char ) ch;
        +
        141 }
        +
        142
        +
        +
        144 auto read(byte_t* data, std::size_t count) -> std::size_t
        +
        145 {
        +
        146 std::size_t num_elements = fread( data
        +
        147 , 1
        +
        148 , static_cast<int>( count )
        +
        149 , get()
        +
        150 );
        +
        151
        +
        153 io_error_if( ferror( get() )
        +
        154 , "file_stream_device: file read error"
        +
        155 );
        +
        156
        +
        157 //libjpeg sometimes reads blocks in 4096 bytes even when the file is smaller than that.
        +
        158 //return value indicates how much was actually read
        +
        159 //returning less than "count" is not an error
        +
        160 return num_elements;
        +
        161 }
        +
        +
        162
        +
        164 template< typename T, int N>
        +
        +
        165 void read( T (&buf)[N] )
        +
        166 {
        +
        167 io_error_if( read( buf, N ) < N
        +
        168 , "file_stream_device: file read error"
        +
        169 );
        +
        170 }
        +
        +
        171
        +
        +
        173 uint8_t read_uint8()
        +
        174 {
        +
        175 byte_t m[1];
        +
        176
        +
        177 read( m );
        +
        178 return m[0];
        +
        179 }
        +
        +
        180
        +
        +
        182 uint16_t read_uint16()
        +
        183 {
        +
        184 byte_t m[2];
        +
        185
        +
        186 read( m );
        +
        187 return (m[1] << 8) | m[0];
        +
        188 }
        +
        +
        189
        +
        +
        191 uint32_t read_uint32()
        +
        192 {
        +
        193 byte_t m[4];
        +
        194
        +
        195 read( m );
        +
        196 return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
        +
        197 }
        +
        +
        198
        +
        200 template < typename T >
        +
        +
        201 auto write(T const* buf, std::size_t count) -> std::size_t
        +
        202 {
        +
        203 std::size_t num_elements = fwrite( buf
        +
        204 , buff_item<T>::size
        +
        205 , count
        +
        206 , get()
        +
        207 );
        +
        208
        +
        209 //return value indicates how much was actually written
        +
        210 //returning less than "count" is not an error
        +
        211 return num_elements;
        +
        212 }
        +
        +
        213
        +
        215 template < typename T
        +
        216 , std::size_t N
        +
        217 >
        +
        +
        218 void write( const T (&buf)[N] )
        +
        219 {
        +
        220 io_error_if( write( buf, N ) < N
        +
        221 , "file_stream_device: file write error"
        +
        222 );
        +
        223 return ;
        +
        224 }
        +
        +
        225
        +
        +
        227 void write_uint8( uint8_t x )
        +
        228 {
        +
        229 byte_t m[1] = { x };
        +
        230 write(m);
        +
        231 }
        +
        +
        232
        +
        +
        234 void write_uint16( uint16_t x )
        +
        235 {
        +
        236 byte_t m[2];
        +
        237
        +
        238 m[0] = byte_t( x >> 0 );
        +
        239 m[1] = byte_t( x >> 8 );
        +
        240
        +
        241 write( m );
        +
        242 }
        +
        +
        243
        +
        +
        245 void write_uint32( uint32_t x )
        +
        246 {
        +
        247 byte_t m[4];
        +
        248
        +
        249 m[0] = byte_t( x >> 0 );
        +
        250 m[1] = byte_t( x >> 8 );
        +
        251 m[2] = byte_t( x >> 16 );
        +
        252 m[3] = byte_t( x >> 24 );
        +
        253
        +
        254 write( m );
        +
        255 }
        +
        +
        256
        +
        257 void seek( long count, int whence = SEEK_SET )
        +
        258 {
        +
        259 io_error_if( fseek( get()
        +
        260 , count
        +
        261 , whence
        +
        262 ) != 0
        +
        263 , "file_stream_device: file seek error"
        +
        264 );
        +
        265 }
        +
        266
        +
        267 long int tell()
        +
        268 {
        +
        269 long int pos = ftell( get() );
        +
        270
        +
        271 io_error_if( pos == -1L
        +
        272 , "file_stream_device: file position error"
        +
        273 );
        +
        274
        +
        275 return pos;
        +
        276 }
        +
        277
        +
        278 void flush()
        +
        279 {
        +
        280 fflush( get() );
        +
        281 }
        +
        282
        +
        +
        284 void print_line( const std::string& line )
        +
        285 {
        +
        286 std::size_t num_elements = fwrite( line.c_str()
        +
        287 , sizeof( char )
        +
        288 , line.size()
        +
        289 , get()
        +
        290 );
        +
        291
        +
        292 io_error_if( num_elements < line.size()
        +
        293 , "file_stream_device: line print error"
        +
        294 );
        +
        295 }
        +
        +
        296
        +
        297 int error()
        +
        298 {
        +
        299 return ferror( get() );
        +
        300 }
        +
        301
        +
        302private:
        +
        303
        +
        304 static void file_deleter( FILE* file )
        +
        305 {
        +
        306 if( file )
        +
        307 {
        +
        308 fclose( file );
        +
        309 }
        +
        310 }
        +
        311
        +
        312private:
        +
        313
        +
        314 using file_ptr_t = std::shared_ptr<FILE> ;
        +
        315 file_ptr_t _file;
        +
        316};
        +
        +
        317
        +
        321template< typename FormatTag >
        +
        + +
        323{
        +
        324public:
        +
        325 istream_device( std::istream& in )
        +
        326 : _in( in )
        +
        327 {
        +
        328 // does the file exists?
        +
        329 io_error_if( !in
        +
        330 , "istream_device: Stream is not valid."
        +
        331 );
        +
        332 }
        +
        333
        +
        334 int getc_unchecked()
        +
        335 {
        +
        336 return _in.get();
        +
        337 }
        +
        338
        +
        339 char getc()
        +
        340 {
        +
        341 int ch;
        +
        342
        +
        343 io_error_if( ( ch = _in.get() ) == EOF
        +
        344 , "istream_device: unexpected EOF"
        +
        345 );
        +
        346
        +
        347 return ( char ) ch;
        +
        348 }
        +
        349
        +
        350 std::size_t read( byte_t* data
        +
        351 , std::size_t count )
        +
        352 {
        +
        353 std::streamsize cr = 0;
        +
        354
        +
        355 do
        +
        356 {
        +
        357 _in.peek();
        +
        358 std::streamsize c = _in.readsome( reinterpret_cast< char* >( data )
        +
        359 , static_cast< std::streamsize >( count ));
        +
        360
        +
        361 count -= static_cast< std::size_t >( c );
        +
        362 data += c;
        +
        363 cr += c;
        +
        364
        +
        365 } while( count && _in );
        +
        366
        +
        367 return static_cast< std::size_t >( cr );
        +
        368 }
        +
        369
        +
        371 template<typename T, int N>
        +
        +
        372 void read(T (&buf)[N])
        +
        373 {
        +
        374 read(buf, N);
        +
        375 }
        +
        +
        376
        +
        +
        378 uint8_t read_uint8()
        +
        379 {
        +
        380 byte_t m[1];
        +
        381
        +
        382 read( m );
        +
        383 return m[0];
        +
        384 }
        +
        +
        385
        +
        +
        387 uint16_t read_uint16()
        +
        388 {
        +
        389 byte_t m[2];
        +
        390
        +
        391 read( m );
        +
        392 return (m[1] << 8) | m[0];
        +
        393 }
        +
        +
        394
        +
        +
        396 uint32_t read_uint32()
        +
        397 {
        +
        398 byte_t m[4];
        +
        399
        +
        400 read( m );
        +
        401 return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
        +
        402 }
        +
        +
        403
        +
        404 void seek( long count, int whence = SEEK_SET )
        +
        405 {
        +
        406 _in.seekg( count
        +
        407 , whence == SEEK_SET ? std::ios::beg
        +
        408 :( whence == SEEK_CUR ? std::ios::cur
        +
        409 : std::ios::end )
        +
        410 );
        +
        411 }
        +
        412
        +
        413 long int tell()
        +
        414 {
        +
        415 auto pos = _in.tellg();
        +
        416
        +
        417 io_error_if( pos == std::istream::pos_type(-1)
        +
        418 , "istream_device: file position error"
        +
        419 );
        +
        420
        +
        421 return static_cast<long int>(pos);
        +
        422 }
        +
        423
        +
        424 void write(const byte_t*, std::size_t)
        +
        425 {
        +
        426 io_error( "istream_device: Bad io error." );
        +
        427 }
        +
        428
        +
        429 void flush() {}
        +
        430
        +
        431 int error()
        +
        432 {
        +
        433 return _in.fail();
        +
        434 }
        +
        435
        +
        436private:
        +
        437
        +
        438 std::istream& _in;
        +
        439};
        +
        +
        440
        +
        444template< typename FormatTag >
        +
        + +
        446{
        +
        447public:
        +
        448 ostream_device( std::ostream & out )
        +
        449 : _out( out )
        +
        450 {
        +
        451 }
        +
        452
        +
        453 std::size_t read(byte_t *, std::size_t)
        +
        454 {
        +
        455 io_error( "ostream_device: Bad io error." );
        +
        456 return 0;
        +
        457 }
        +
        458
        +
        459 void seek( long count, int whence )
        +
        460 {
        +
        461 _out.seekp( count
        +
        462 , whence == SEEK_SET
        +
        463 ? std::ios::beg
        +
        464 : ( whence == SEEK_CUR
        +
        465 ?std::ios::cur
        +
        466 :std::ios::end )
        +
        467 );
        +
        468 }
        +
        469
        +
        470 long int tell()
        +
        471 {
        +
        472 auto pos = _out.tellp();
        +
        473
        +
        474 io_error_if( pos == std::ostream::pos_type(-1)
        +
        475 , "ostream_device: file position error"
        +
        476 );
        +
        477
        +
        478 return static_cast<long int>(pos);
        +
        479 }
        +
        480
        +
        481 void write( const byte_t* data
        +
        482 , std::size_t count )
        +
        483 {
        +
        484 _out.write( reinterpret_cast<char const*>( data )
        +
        485 , static_cast<std::streamsize>( count )
        +
        486 );
        +
        487 }
        +
        488
        +
        490 template < typename T
        +
        491 , std::size_t N
        +
        492 >
        +
        +
        493 void write( const T (&buf)[N] )
        +
        494 {
        +
        495 write( buf, N );
        +
        496 }
        +
        +
        497
        +
        +
        499 void write_uint8( uint8_t x )
        +
        500 {
        +
        501 byte_t m[1] = { x };
        +
        502 write(m);
        +
        503 }
        +
        +
        504
        +
        +
        506 void write_uint16( uint16_t x )
        +
        507 {
        +
        508 byte_t m[2];
        +
        509
        +
        510 m[0] = byte_t( x >> 0 );
        +
        511 m[1] = byte_t( x >> 8 );
        +
        512
        +
        513 write( m );
        +
        514 }
        +
        +
        515
        +
        +
        517 void write_uint32( uint32_t x )
        +
        518 {
        +
        519 byte_t m[4];
        +
        520
        +
        521 m[0] = byte_t( x >> 0 );
        +
        522 m[1] = byte_t( x >> 8 );
        +
        523 m[2] = byte_t( x >> 16 );
        +
        524 m[3] = byte_t( x >> 24 );
        +
        525
        +
        526 write( m );
        +
        527 }
        +
        +
        528
        +
        529 void flush()
        +
        530 {
        +
        531 _out << std::flush;
        +
        532 }
        +
        533
        +
        +
        535 void print_line( const std::string& line )
        +
        536 {
        +
        537 _out << line;
        +
        538 }
        +
        +
        539
        +
        540 int error()
        +
        541 {
        +
        542 return _out.fail();
        +
        543 }
        +
        544
        +
        545private:
        +
        546
        +
        547 std::ostream& _out;
        +
        548};
        +
        +
        549
        +
        550
        +
        555template< typename IODevice > struct is_input_device : std::false_type{};
        +
        556template< typename FormatTag > struct is_input_device< file_stream_device< FormatTag > > : std::true_type{};
        +
        557template< typename FormatTag > struct is_input_device< istream_device< FormatTag > > : std::true_type{};
        +
        558
        +
        559template< typename FormatTag
        +
        560 , typename T
        +
        561 , typename D = void
        +
        562 >
        +
        563struct is_adaptable_input_device : std::false_type{};
        +
        564
        +
        565template <typename FormatTag, typename T>
        +
        566struct is_adaptable_input_device
        +
        567<
        +
        568 FormatTag,
        +
        569 T,
        +
        570 typename std::enable_if
        +
        571 <
        +
        572 mp11::mp_or
        +
        573 <
        +
        574 std::is_base_of<std::istream, T>,
        +
        575 std::is_same<std::istream, T>
        +
        576 >::value
        +
        577 >::type
        +
        578> : std::true_type
        +
        579{
        +
        580 using device_type = istream_device<FormatTag>;
        +
        581};
        +
        582
        +
        583template< typename FormatTag >
        +
        584struct is_adaptable_input_device< FormatTag
        +
        585 , FILE*
        +
        586 , void
        +
        587 >
        +
        588 : std::true_type
        +
        589{
        +
        590 using device_type = file_stream_device<FormatTag>;
        +
        591};
        +
        592
        +
        596template< typename FormatTag
        +
        597 , typename T
        +
        598 , typename D = void
        +
        599 >
        +
        +
        600struct is_read_device : std::false_type
        +
        601{};
        +
        +
        602
        +
        603template <typename FormatTag, typename T>
        +
        604struct is_read_device
        +
        605<
        +
        606 FormatTag,
        +
        607 T,
        +
        608 typename std::enable_if
        +
        609 <
        +
        610 mp11::mp_or
        +
        611 <
        +
        612 is_input_device<FormatTag>,
        +
        613 is_adaptable_input_device<FormatTag, T>
        +
        614 >::value
        +
        615 >::type
        +
        616> : std::true_type
        +
        617{
        +
        618};
        +
        619
        +
        620
        +
        625template<typename IODevice> struct is_output_device : std::false_type{};
        +
        626
        +
        627template< typename FormatTag > struct is_output_device< file_stream_device< FormatTag > > : std::true_type{};
        +
        628template< typename FormatTag > struct is_output_device< ostream_device < FormatTag > > : std::true_type{};
        +
        629
        +
        630template< typename FormatTag
        +
        631 , typename IODevice
        +
        632 , typename D = void
        +
        633 >
        +
        634struct is_adaptable_output_device : std::false_type {};
        +
        635
        +
        636template <typename FormatTag, typename T>
        +
        637struct is_adaptable_output_device
        +
        638<
        +
        639 FormatTag,
        +
        640 T,
        +
        641 typename std::enable_if
        +
        642 <
        +
        643 mp11::mp_or
        +
        644 <
        +
        645 std::is_base_of<std::ostream, T>,
        +
        646 std::is_same<std::ostream, T>
        +
        647 >::value
        +
        648 >::type
        +
        649> : std::true_type
        +
        650{
        +
        651 using device_type = ostream_device<FormatTag>;
        +
        652};
        +
        653
        +
        654template<typename FormatTag> struct is_adaptable_output_device<FormatTag,FILE*,void>
        +
        655 : std::true_type
        +
        656{
        +
        657 using device_type = file_stream_device<FormatTag>;
        +
        658};
        +
        659
        +
        660
        +
        664template< typename FormatTag
        +
        665 , typename T
        +
        666 , typename D = void
        +
        667 >
        +
        +
        668struct is_write_device : std::false_type
        +
        669{};
        +
        +
        670
        +
        671template <typename FormatTag, typename T>
        +
        672struct is_write_device
        +
        673<
        +
        674 FormatTag,
        +
        675 T,
        +
        676 typename std::enable_if
        +
        677 <
        +
        678 mp11::mp_or
        +
        679 <
        +
        680 is_output_device<FormatTag>,
        +
        681 is_adaptable_output_device<FormatTag, T>
        +
        682 >::value
        +
        683 >::type
        +
        684> : std::true_type
        +
        685{
        +
        686};
        +
        687
        +
        688} // namespace detail
        +
        689
        +
        690template< typename Device, typename FormatTag > class scanline_reader;
        +
        691template< typename Device, typename FormatTag, typename ConversionPolicy > class reader;
        +
        692
        +
        693template< typename Device, typename FormatTag, typename Log = no_log > class writer;
        +
        694
        +
        695template< typename Device, typename FormatTag > class dynamic_image_reader;
        +
        696template< typename Device, typename FormatTag, typename Log = no_log > class dynamic_image_writer;
        +
        697
        +
        698
        +
        699namespace detail {
        +
        700
        +
        701template< typename T >
        +
        702struct is_reader : std::false_type
        +
        703{};
        +
        704
        +
        705template< typename Device
        +
        706 , typename FormatTag
        +
        707 , typename ConversionPolicy
        +
        708 >
        +
        709struct is_reader< reader< Device
        +
        710 , FormatTag
        +
        711 , ConversionPolicy
        +
        712 >
        +
        713 > : std::true_type
        +
        714{};
        +
        715
        +
        716template< typename T >
        +
        717struct is_dynamic_image_reader : std::false_type
        +
        718{};
        +
        719
        +
        720template< typename Device
        +
        721 , typename FormatTag
        +
        722 >
        +
        723struct is_dynamic_image_reader< dynamic_image_reader< Device
        +
        724 , FormatTag
        +
        725 >
        +
        726 > : std::true_type
        +
        727{};
        +
        728
        +
        729template< typename T >
        +
        730struct is_writer : std::false_type
        +
        731{};
        +
        732
        +
        733template< typename Device
        +
        734 , typename FormatTag
        +
        735 >
        +
        736struct is_writer< writer< Device
        +
        737 , FormatTag
        +
        738 >
        +
        739 > : std::true_type
        +
        740{};
        +
        741
        +
        742template< typename T >
        +
        743struct is_dynamic_image_writer : std::false_type
        +
        744{};
        +
        745
        +
        746template< typename Device
        +
        747 , typename FormatTag
        +
        748 >
        +
        749struct is_dynamic_image_writer< dynamic_image_writer< Device
        +
        750 , FormatTag
        +
        751 >
        +
        752 > : std::true_type
        +
        753{};
        +
        754
        +
        755} // namespace detail
        +
        756
        +
        757#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        758#pragma warning(pop)
        +
        759#endif
        +
        760
        +
        761} // namespace gil
        +
        762} // namespace boost
        +
        763
        +
        764#endif
        + +
        file_stream_device(const std::string &file_name, read_tag tag=read_tag())
        Definition device.hpp:64
        +
        void write_uint32(uint32_t x)
        Writes 32 bit little endian integer.
        Definition device.hpp:245
        +
        void print_line(const std::string &line)
        Prints formatted ASCII text.
        Definition device.hpp:284
        +
        void write_uint8(uint8_t x)
        Writes byte.
        Definition device.hpp:227
        +
        void read(T(&buf)[N])
        Reads array.
        Definition device.hpp:165
        +
        file_stream_device(FILE *file)
        Definition device.hpp:118
        +
        uint16_t read_uint16()
        Reads 16 bit little endian integer.
        Definition device.hpp:182
        +
        uint8_t read_uint8()
        Reads byte.
        Definition device.hpp:173
        +
        file_stream_device(const char *file_name, write_tag)
        Definition device.hpp:100
        +
        auto read(byte_t *data, std::size_t count) -> std::size_t
        Definition device.hpp:144
        +
        file_stream_device(const std::string &file_name, write_tag tag)
        Definition device.hpp:91
        +
        void write(const T(&buf)[N])
        Writes array.
        Definition device.hpp:218
        +
        file_stream_device(const char *file_name, read_tag=read_tag())
        Definition device.hpp:73
        +
        uint32_t read_uint32()
        Reads 32 bit little endian integer.
        Definition device.hpp:191
        +
        void write_uint16(uint16_t x)
        Writes 16 bit little endian integer.
        Definition device.hpp:234
        +
        auto write(T const *buf, std::size_t count) -> std::size_t
        Writes number of elements from a buffer.
        Definition device.hpp:201
        +
        Definition device.hpp:323
        +
        void read(T(&buf)[N])
        Reads array.
        Definition device.hpp:372
        +
        uint16_t read_uint16()
        Reads 16 bit little endian integer.
        Definition device.hpp:387
        +
        uint8_t read_uint8()
        Reads byte.
        Definition device.hpp:378
        +
        uint32_t read_uint32()
        Reads 32 bit little endian integer.
        Definition device.hpp:396
        +
        Definition device.hpp:446
        +
        void write_uint32(uint32_t x)
        Writes 32 bit little endian integer.
        Definition device.hpp:517
        +
        void print_line(const std::string &line)
        Prints formatted ASCII text.
        Definition device.hpp:535
        +
        void write_uint8(uint8_t x)
        Writes byte.
        Definition device.hpp:499
        +
        void write(const T(&buf)[N])
        Writes array.
        Definition device.hpp:493
        +
        void write_uint16(uint16_t x)
        Writes 16 bit little endian integer.
        Definition device.hpp:506
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Used to overload the constructor.
        Definition device.hpp:58
        +
        Definition device.hpp:555
        +
        Definition device.hpp:625
        +
        Definition device.hpp:601
        +
        Definition device.hpp:669
        diff --git a/html/reference/device__n_8hpp_source.html b/html/reference/device__n_8hpp_source.html index 1612903f5..9899ec74b 100644 --- a/html/reference/device__n_8hpp_source.html +++ b/html/reference/device__n_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: device_n.hpp Source File @@ -27,129 +27,144 @@

        - + +/* @license-end */ + +
        -
        -
        device_n.hpp
        +
        device_n.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_DEVICE_N_HPP
        -
        9 #define BOOST_GIL_DEVICE_N_HPP
        -
        10 
        -
        11 #include <boost/gil/metafunctions.hpp>
        -
        12 #include <boost/gil/utilities.hpp>
        -
        13 #include <boost/gil/detail/mp11.hpp>
        -
        14 
        -
        15 #include <boost/config.hpp>
        -
        16 
        -
        17 #include <cstddef>
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        22 
        -
        23 // TODO: Document the DeviceN Color Space and Color Model
        -
        24 // with reference to the Adobe documentation
        -
        25 // https://www.adobe.com/content/dam/acom/en/devnet/postscript/pdfs/TN5604.DeviceN_Color.pdf
        -
        26 
        -
        29 template <int N>
        -
        30 struct devicen_color_t {};
        -
        31 
        -
        32 template <int N>
        -
        33 struct devicen_t;
        -
        34 
        -
        38 template <int N>
        -
        39 struct devicen_t
        -
        40 {
        -
        41 private:
        -
        42  template <typename T>
        - -
        44 
        -
        45  static_assert(
        -
        46  (1 <= N && N <= 5),
        -
        47  "invalid number of DeviceN color components");
        -
        48 
        -
        49 public:
        -
        50  using type = mp11::mp_transform<color_t, mp11::mp_iota_c<N>>;
        -
        51 };
        -
        52 
        -
        55 template <int N>
        -
        56 struct devicen_layout_t : layout<typename devicen_t<N>::type> {};
        -
        57 
        -
        60 template <typename IC>
        -
        61 inline
        -
        62 auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes)
        - -
        64 {
        -
        65  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<2>>>::view_t;
        -
        66  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1), rowsize_in_bytes));
        -
        67 }
        -
        68 
        -
        71 template <typename IC>
        -
        72 inline
        -
        73 auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes)
        - -
        75 {
        -
        76  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<3>>>::view_t;
        -
        77  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2), rowsize_in_bytes));
        -
        78 }
        -
        79 
        -
        82 template <typename IC>
        -
        83 inline
        -
        84 auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, std::ptrdiff_t rowsize_in_bytes)
        - -
        86 {
        -
        87  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<4>>>::view_t;
        -
        88  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2,c3), rowsize_in_bytes));
        -
        89 }
        -
        90 
        -
        93 template <typename IC>
        -
        94 inline
        -
        95 auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, IC c4, std::ptrdiff_t rowsize_in_bytes)
        - -
        97 {
        -
        98  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<5>>>::view_t;
        -
        99  return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2,c3,c4), rowsize_in_bytes));
        -
        100 }
        -
        101 
        -
        102 }} // namespace boost::gil
        -
        103 
        -
        104 #endif
        -
        auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, IC c4, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 5 >>>::view_t
        from 5-channel planar data
        Definition: device_n.hpp:95
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        unnamed color
        Definition: device_n.hpp:30
        -
        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
        -
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:268
        -
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:303
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_DEVICE_N_HPP
        +
        9#define BOOST_GIL_DEVICE_N_HPP
        +
        10
        +
        11#include <boost/gil/metafunctions.hpp>
        +
        12#include <boost/gil/utilities.hpp>
        +
        13#include <boost/gil/detail/mp11.hpp>
        +
        14
        +
        15#include <boost/config.hpp>
        +
        16
        +
        17#include <cstddef>
        +
        18#include <type_traits>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        22
        +
        23// TODO: Document the DeviceN Color Space and Color Model
        +
        24// with reference to the Adobe documentation
        +
        25// https://www.adobe.com/content/dam/acom/en/devnet/postscript/pdfs/TN5604.DeviceN_Color.pdf
        +
        26
        +
        29template <int N>
        + +
        31
        +
        32template <int N>
        +
        33struct devicen_t;
        +
        34
        +
        38template <int N>
        +
        + +
        40{
        +
        41private:
        +
        42 template <typename T>
        + +
        44
        +
        45 static_assert(
        +
        46 (1 <= N && N <= 5),
        +
        47 "invalid number of DeviceN color components");
        +
        48
        +
        49public:
        +
        50 using type = mp11::mp_transform<color_t, mp11::mp_iota_c<N>>;
        +
        51};
        +
        +
        52
        +
        55template <int N>
        +
        56struct devicen_layout_t : layout<typename devicen_t<N>::type> {};
        +
        57
        +
        60template <typename IC>
        +
        61inline
        +
        +
        62auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes)
        + +
        64{
        +
        65 using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<2>>>::view_t;
        +
        66 return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1), rowsize_in_bytes));
        +
        67}
        +
        +
        68
        +
        71template <typename IC>
        +
        72inline
        +
        +
        73auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes)
        + +
        75{
        +
        76 using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<3>>>::view_t;
        +
        77 return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2), rowsize_in_bytes));
        +
        78}
        +
        +
        79
        +
        82template <typename IC>
        +
        83inline
        +
        +
        84auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, std::ptrdiff_t rowsize_in_bytes)
        + +
        86{
        +
        87 using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<4>>>::view_t;
        +
        88 return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2,c3), rowsize_in_bytes));
        +
        89}
        +
        +
        90
        +
        93template <typename IC>
        +
        94inline
        +
        +
        95auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, IC c4, std::ptrdiff_t rowsize_in_bytes)
        + +
        97{
        +
        98 using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<5>>>::view_t;
        +
        99 return view_t(width, height, typename view_t::locator(typename view_t::x_iterator(c0,c1,c2,c3,c4), rowsize_in_bytes));
        +
        100}
        +
        +
        101
        +
        102}} // namespace boost::gil
        +
        103
        +
        104#endif
        +
        auto planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 2 > > >::view_t
        from 2-channel planar data
        Definition device_n.hpp:62
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        unnamed color
        Definition device_n.hpp:30
        +
        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
        +
        Represents a color space and ordering of channels in memory.
        Definition utilities.hpp:268
        +
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition metafunctions.hpp:303
        diff --git a/html/reference/dir_0f86d4ff96b1aea424a4a0f509d03bc0.html b/html/reference/dir_0f86d4ff96b1aea424a4a0f509d03bc0.html index 8ec6265eb..97a444bb9 100644 --- a/html/reference/dir_0f86d4ff96b1aea424a4a0f509d03bc0.html +++ b/html/reference/dir_0f86d4ff96b1aea424a4a0f509d03bc0.html @@ -4,7 +4,7 @@ - + Generic Image Library: extension Directory Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        extension Directory Reference
        +
        extension Directory Reference
        - + + + +

        +

        Directories

         dynamic_image
         
         io
         
        @@ -57,7 +61,7 @@ Directories
        - + +

        +

        Directories

         gil
         
        @@ -57,7 +59,7 @@ Directories
        - - + + + + + + + + + + + + +

        +

        Files

        file  extension/dynamic_image/algorithm.hpp [code]
         algorithm.hpp
         Some basic STL-style algorithms when applied to runtime type specified image views.
         
         any_image.hpp
         
         any_image_view.hpp
         
         apply_operation.hpp
         
         dynamic_at_c.hpp
         
         dynamic_image_all.hpp
         
         image_view_factory.hpp
         
        @@ -60,7 +72,7 @@ Files
        + + + + + + + + + + + + + + + + + + + + + + + + + +

        +Files

         adaptive_histogram_equalization.hpp
         
         convolve.hpp
         
         filter.hpp
         
         harris.hpp
         
         hessian.hpp
         
         histogram_equalization.hpp
         
         histogram_matching.hpp
         
         kernel.hpp
         
         morphology.hpp
         
         numeric.hpp
         
         scaling.hpp
         
         threshold.hpp
         
        diff --git a/html/reference/dir_58c726a731707876b257bd847dce0d3c.html b/html/reference/dir_58c726a731707876b257bd847dce0d3c.html index 25849a2cf..a859d9b5a 100644 --- a/html/reference/dir_58c726a731707876b257bd847dce0d3c.html +++ b/html/reference/dir_58c726a731707876b257bd847dce0d3c.html @@ -4,7 +4,7 @@ - + Generic Image Library: io Directory Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        io Directory Reference
        +
        io Directory Reference
        + + + + + + + + + + + + + + + + +

        +Files

         bmp.hpp
         
         jpeg.hpp
         
         png.hpp
         
         pnm.hpp
         
         raw.hpp
         
         targa.hpp
         
         tiff.hpp
         
        diff --git a/html/reference/dir_65525b100b86579f1f0652bf33388089.html b/html/reference/dir_65525b100b86579f1f0652bf33388089.html index 806c99fd9..432d41cde 100644 --- a/html/reference/dir_65525b100b86579f1f0652bf33388089.html +++ b/html/reference/dir_65525b100b86579f1f0652bf33388089.html @@ -4,7 +4,7 @@ - + Generic Image Library: concepts Directory Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        concepts Directory Reference
        +
        concepts Directory Reference
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

        +Files

         basic.hpp
         
         channel.hpp
         
         color.hpp
         
         color_base.hpp
         
         concept_check.hpp
         
         dynamic_step.hpp
         
         fwd.hpp
         
         image.hpp
         
         image_view.hpp
         
         pixel.hpp
         
         pixel_based.hpp
         
         pixel_dereference.hpp
         
         pixel_iterator.hpp
         
         pixel_locator.hpp
         
         point.hpp
         
        diff --git a/html/reference/dir_80930c1173f2c0438c68e99be5d8d1e3.html b/html/reference/dir_80930c1173f2c0438c68e99be5d8d1e3.html index 66e9ff39c..2704a2d3f 100644 --- a/html/reference/dir_80930c1173f2c0438c68e99be5d8d1e3.html +++ b/html/reference/dir_80930c1173f2c0438c68e99be5d8d1e3.html @@ -4,7 +4,7 @@ - + Generic Image Library: io Directory Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        io Directory Reference
        +
        io Directory Reference
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

        +Files

         base.hpp
         
         bit_operations.hpp
         
         conversion_policies.hpp
         
         device.hpp
         
         error.hpp
         
         get_read_device.hpp
         
         get_reader.hpp
         
         get_write_device.hpp
         
         get_writer.hpp
         
         io.hpp
         
         make_backend.hpp
         
         make_dynamic_image_reader.hpp
         
         make_dynamic_image_writer.hpp
         
         make_reader.hpp
         
         make_scanline_reader.hpp
         
         make_writer.hpp
         
         path_spec.hpp
         
         read_and_convert_image.hpp
         
         read_and_convert_view.hpp
         
         read_image.hpp
         
         read_image_info.hpp
         
         read_view.hpp
         
         reader_base.hpp
         
         row_buffer_helper.hpp
         
         scanline_read_iterator.hpp
         
         typedefs.hpp
         
         write_view.hpp
         
        diff --git a/html/reference/dir_d44c64559bbebec7f509842c48db8b23.html b/html/reference/dir_d44c64559bbebec7f509842c48db8b23.html index c73587eb3..fd5f4cc83 100644 --- a/html/reference/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/html/reference/dir_d44c64559bbebec7f509842c48db8b23.html @@ -4,7 +4,7 @@ - + Generic Image Library: include Directory Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        include Directory Reference
        +
        include Directory Reference
        @@ -53,7 +53,7 @@ $(function() { diff --git a/html/reference/dir_df4750f408086f9b9c1b5ee4251365ff.html b/html/reference/dir_df4750f408086f9b9c1b5ee4251365ff.html index aeed2ad4a..0625575ea 100644 --- a/html/reference/dir_df4750f408086f9b9c1b5ee4251365ff.html +++ b/html/reference/dir_df4750f408086f9b9c1b5ee4251365ff.html @@ -4,7 +4,7 @@ - + Generic Image Library: gil Directory Reference @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        -
        -
        gil Directory Reference
        +
        gil Directory Reference
        - - + + + + + + +

        +

        Directories

        directory  extension
         concepts
         
         image_processing
         
         io
         
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

        +Files

         algorithm.hpp
         
         bit_aligned_pixel_iterator.hpp
         
         bit_aligned_pixel_reference.hpp
         
         channel.hpp
         
         channel_algorithm.hpp
         
         channel_numeric_operations.hpp
         
         cmyk.hpp
         
         color_base.hpp
         
         color_base_algorithm.hpp
         
         color_convert.hpp
         
         concepts.hpp
         
         device_n.hpp
         
         dynamic_step.hpp
         
         gray.hpp
         
         histogram.hpp
         
         image.hpp
         
         image_view.hpp
         
         image_view_factory.hpp
         
         iterator_from_2d.hpp
         
         locator.hpp
         
         metafunctions.hpp
         
         packed_pixel.hpp
         
         pixel.hpp
         
         pixel_iterator.hpp
         
         pixel_iterator_adaptor.hpp
         
         pixel_numeric_operations.hpp
         
         planar_pixel_iterator.hpp
         
         planar_pixel_reference.hpp
         
         point.hpp
         
         position_iterator.hpp
         
         premultiply.hpp
         
         promote_integral.hpp
         
         rgb.hpp
         
         rgba.hpp
         
         step_iterator.hpp
         
         typedefs.hpp
         
         utilities.hpp
         
         virtual_locator.hpp
         
        @@ -59,7 +142,7 @@ Directories
        - - +

        +

        Namespaces

         boost
        namespace  boost
         defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
         
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + +

        +

        Functions

        template<typename ... Types, typename View >
        auto equal_pixels (any_image_view< Types... > const &src, View const &dst) -> bool
         
        template<typename View , typename ... Types>
        auto equal_pixels (View const &src, any_image_view< Types... > const &dst) -> bool
         
        template<typename ... Types1, typename ... Types2>
        auto equal_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst) -> bool
         
        template<typename ... Types, typename View >
        void copy_pixels (any_image_view< Types... > const &src, View const &dst)
         
        template<typename ... Types, typename View >
        void copy_pixels (View const &src, any_image_view< Types... > const &dst)
         
        template<typename ... Types1, typename ... Types2>
        void copy_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
         
        template<typename ... Types, typename View , typename CC >
        void copy_and_convert_pixels (any_image_view< Types... > const &src, View const &dst, CC cc)
         
        template<typename ... Types, typename View >
        void copy_and_convert_pixels (any_image_view< Types... > const &src, View const &dst)
         
        template<typename View , typename ... Types, typename CC >
        void copy_and_convert_pixels (View const &src, any_image_view< Types... > const &dst, CC cc)
         
        template<typename View , typename ... Types>
        void copy_and_convert_pixels (View const &src, any_image_view< Types... > const &dst)
         
        template<typename ... Types1, typename ... Types2, typename CC >
        void copy_and_convert_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst, CC cc)
         
        template<typename ... Types1, typename ... Types2>
        void copy_and_convert_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
         
        template<typename ... Types, typename Value >
        void fill_pixels (any_image_view< Types... > const &view, Value const &val)
         fill_pixels for any image view. The pixel to fill with must be compatible with the current view More...
         
        +
        template<typename ... Types, typename View >
        auto equal_pixels (any_image_view< Types... > const &src, View const &dst) -> bool
         
        template<typename View , typename ... Types>
        auto equal_pixels (View const &src, any_image_view< Types... > const &dst) -> bool
         
        template<typename ... Types1, typename ... Types2>
        auto equal_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst) -> bool
         
        template<typename ... Types, typename View >
        void copy_pixels (any_image_view< Types... > const &src, View const &dst)
         
        template<typename ... Types, typename View >
        void copy_pixels (View const &src, any_image_view< Types... > const &dst)
         
        template<typename ... Types1, typename ... Types2>
        void copy_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
         
        template<typename ... Types, typename View , typename CC >
        void copy_and_convert_pixels (any_image_view< Types... > const &src, View const &dst, CC cc)
         
        template<typename ... Types, typename View >
        void copy_and_convert_pixels (any_image_view< Types... > const &src, View const &dst)
         
        template<typename View , typename ... Types, typename CC >
        void copy_and_convert_pixels (View const &src, any_image_view< Types... > const &dst, CC cc)
         
        template<typename View , typename ... Types>
        void copy_and_convert_pixels (View const &src, any_image_view< Types... > const &dst)
         
        template<typename ... Types1, typename ... Types2, typename CC >
        void copy_and_convert_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst, CC cc)
         
        template<typename ... Types1, typename ... Types2>
        void copy_and_convert_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
         
        template<typename ... Types, typename Value >
        void fill_pixels (any_image_view< Types... > const &view, Value const &val)
         fill_pixels for any image view. The pixel to fill with must be compatible with the current view
         
        template<typename ... Types, typename F >
        auto for_each_pixel (any_image_view< Types... > const &view, F fun) -> F
         
        auto for_each_pixel (any_image_view< Types... > const &view, F fun) -> F
         

        Detailed Description

        Some basic STL-style algorithms when applied to runtime type specified image views.

        @@ -126,7 +126,7 @@ template<typename ... Types, typename F >
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
        [detail level 123456]
         adaptive_histogram_equalization.hpp
         algorithm.hpp
         extension/dynamic_image/algorithm.hppSome basic STL-style algorithms when applied to runtime type specified image views
         any_image.hpp
         any_image_view.hpp
         apply_operation.hpp
         base.hpp
         basic.hpp
         bit_aligned_pixel_iterator.hpp
         bit_aligned_pixel_reference.hpp
         bit_operations.hpp
         bmp.hpp
         channel.hpp
         concepts/channel.hpp
         channel_algorithm.hpp
         channel_numeric_operations.hpp
         cmyk.hpp
         color.hpp
         color_base.hpp
         concepts/color_base.hpp
         color_base_algorithm.hpp
         color_convert.hpp
         concept_check.hpp
         concepts.hpp
         conversion_policies.hpp
         convolve.hpp
         device.hpp
         device_n.hpp
         dynamic_at_c.hpp
         dynamic_image_all.hpp
         dynamic_step.hpp
         concepts/dynamic_step.hpp
         error.hpp
         filter.hpp
         fwd.hpp
         get_read_device.hpp
         get_reader.hpp
         get_write_device.hpp
         get_writer.hpp
         gray.hpp
         harris.hpp
         hessian.hpp
         histogram.hpp
         histogram_equalization.hpp
         histogram_matching.hpp
         image.hpp
         concepts/image.hpp
         image_view.hpp
         concepts/image_view.hpp
         image_view_factory.hpp
         extension/dynamic_image/image_view_factory.hpp
         io.hpp
         iterator_from_2d.hpp
         jpeg.hpp
         kernel.hpp
         locator.hpp
         make_backend.hpp
         make_dynamic_image_reader.hpp
         make_dynamic_image_writer.hpp
         make_reader.hpp
         make_scanline_reader.hpp
         make_writer.hpp
         metafunctions.hpp
         morphology.hpp
         numeric.hpp
         packed_pixel.hpp
         path_spec.hpp
         pixel.hpp
         concepts/pixel.hpp
         pixel_based.hpp
         pixel_dereference.hpp
         pixel_iterator.hpp
         concepts/pixel_iterator.hpp
         pixel_iterator_adaptor.hpp
         pixel_locator.hpp
         pixel_numeric_operations.hpp
         planar_pixel_iterator.hpp
         planar_pixel_reference.hpp
         png.hpp
         pnm.hpp
         point.hpp
         concepts/point.hpp
         position_iterator.hpp
         premultiply.hpp
         promote_integral.hpp
         raw.hpp
         read_and_convert_image.hpp
         read_and_convert_view.hpp
         read_image.hpp
         read_image_info.hpp
         read_view.hpp
         reader_base.hpp
         rgb.hpp
         rgba.hpp
         row_buffer_helper.hpp
         scaling.hpp
         scanline_read_iterator.hpp
         step_iterator.hpp
         targa.hpp
         threshold.hpp
         tiff.hpp
         typedefs.hpp
         io/typedefs.hpp
         utilities.hpp
         virtual_locator.hpp
         write_view.hpp
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          include
          boost
          gil
          concepts
          extension
          image_processing
          io
         algorithm.hpp
         bit_aligned_pixel_iterator.hpp
         bit_aligned_pixel_reference.hpp
         channel.hpp
         channel_algorithm.hpp
         channel_numeric_operations.hpp
         cmyk.hpp
         color_base.hpp
         color_base_algorithm.hpp
         color_convert.hpp
         concepts.hpp
         device_n.hpp
         dynamic_step.hpp
         gray.hpp
         histogram.hpp
         image.hpp
         image_view.hpp
         image_view_factory.hpp
         iterator_from_2d.hpp
         locator.hpp
         metafunctions.hpp
         packed_pixel.hpp
         pixel.hpp
         pixel_iterator.hpp
         pixel_iterator_adaptor.hpp
         pixel_numeric_operations.hpp
         planar_pixel_iterator.hpp
         planar_pixel_reference.hpp
         point.hpp
         position_iterator.hpp
         premultiply.hpp
         promote_integral.hpp
         rgb.hpp
         rgba.hpp
         step_iterator.hpp
         typedefs.hpp
         utilities.hpp
         virtual_locator.hpp
        @@ -159,7 +168,7 @@ $(function() { diff --git a/html/reference/filter_8hpp_source.html b/html/reference/filter_8hpp_source.html index 2cdfe10df..806fb8fca 100644 --- a/html/reference/filter_8hpp_source.html +++ b/html/reference/filter_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: filter.hpp Source File @@ -27,174 +27,179 @@
        - + +/* @license-end */ + +
        -
        -
        filter.hpp
        +
        filter.hpp
        -
        1 //
        -
        2 // Copyright 2019 Miral Shah <miralshah2211@gmail.com>
        -
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        -
        4 //
        -
        5 // Use, modification and distribution are subject to the Boost Software License,
        -
        6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt)
        -
        8 //
        -
        9 
        -
        10 #ifndef BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
        -
        11 #define BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
        -
        12 
        -
        13 #include <boost/gil/image_processing/kernel.hpp>
        -
        14 
        -
        15 #include <boost/gil/image_processing/convolve.hpp>
        -
        16 
        -
        17 #include <boost/gil/image.hpp>
        -
        18 #include <boost/gil/image_view.hpp>
        -
        19 #include <boost/gil/algorithm.hpp>
        -
        20 
        -
        21 #include <cstddef>
        -
        22 #include <vector>
        -
        23 
        -
        24 namespace boost { namespace gil {
        -
        25 
        -
        26 template <typename SrcView, typename DstView>
        -
        27 void box_filter(
        -
        28  SrcView const& src_view,
        -
        29  DstView const& dst_view,
        -
        30  std::size_t kernel_size,
        -
        31  long int anchor = -1,
        -
        32  bool normalize=true,
        -
        33  boundary_option option = boundary_option::extend_zero
        -
        34 )
        -
        35 {
        -
        36  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        37  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        38  static_assert(color_spaces_are_compatible
        -
        39  <
        -
        40  typename color_space_type<SrcView>::type,
        -
        41  typename color_space_type<DstView>::type
        -
        42  >::value, "Source and destination views must have pixels with the same color space");
        -
        43 
        -
        44  std::vector<float> kernel_values;
        -
        45  if (normalize) { kernel_values.resize(kernel_size, 1.0f / float(kernel_size)); }
        -
        46  else { kernel_values.resize(kernel_size, 1.0f); }
        -
        47 
        -
        48  if (anchor == -1) anchor = static_cast<int>(kernel_size / 2);
        -
        49  kernel_1d<float> kernel(kernel_values.begin(), kernel_size, anchor);
        -
        50 
        -
        51  detail::convolve_1d
        -
        52  <
        -
        53  pixel<float, typename SrcView::value_type::layout_t>
        -
        54  >(src_view, kernel, dst_view, option);
        -
        55 }
        -
        56 
        -
        57 template <typename SrcView, typename DstView>
        -
        58 void blur(
        -
        59  SrcView const& src_view,
        -
        60  DstView const& dst_view,
        -
        61  std::size_t kernel_size,
        -
        62  long int anchor = -1,
        -
        63  boundary_option option = boundary_option::extend_zero
        -
        64 )
        -
        65 {
        -
        66  box_filter(src_view, dst_view, kernel_size, anchor, true, option);
        -
        67 }
        -
        68 
        -
        69 
        -
        70 namespace detail
        -
        71 {
        -
        72 template <typename SrcView, typename DstView>
        -
        73 void filter_median_impl(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
        -
        74 {
        -
        75  std::size_t half_kernel_size = kernel_size / 2;
        -
        76 
        -
        77  // deciding output channel type and creating functor
        -
        78  using src_channel_t = typename channel_type<SrcView>::type;
        -
        79 
        -
        80  std::vector<src_channel_t> values;
        -
        81  values.reserve(kernel_size * kernel_size);
        -
        82 
        -
        83  for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        -
        84  {
        -
        85  typename DstView::x_iterator dst_it = dst_view.row_begin(y);
        -
        86 
        -
        87  for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        -
        88  {
        -
        89  auto sub_view = subimage_view(
        -
        90  src_view,
        -
        91  x - half_kernel_size, y - half_kernel_size,
        -
        92  kernel_size,
        -
        93  kernel_size
        -
        94  );
        -
        95  values.assign(sub_view.begin(), sub_view.end());
        -
        96 
        -
        97  std::nth_element(values.begin(), values.begin() + (values.size() / 2), values.end());
        -
        98  dst_it[x] = values[values.size() / 2];
        -
        99  }
        -
        100  }
        -
        101 }
        -
        102 } // namespace detail
        -
        103 
        -
        104 template <typename SrcView, typename DstView>
        -
        105 void median_filter(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
        -
        106 {
        -
        107  static_assert(color_spaces_are_compatible
        -
        108  <
        -
        109  typename color_space_type<SrcView>::type,
        -
        110  typename color_space_type<DstView>::type
        -
        111  >::value, "Source and destination views must have pixels with the same color space");
        -
        112 
        -
        113  std::size_t half_kernel_size = kernel_size / 2;
        -
        114  auto extended_img = extend_boundary(
        -
        115  src_view,
        -
        116  half_kernel_size,
        -
        117  boundary_option::extend_constant
        -
        118  );
        -
        119  auto extended_view = subimage_view(
        -
        120  view(extended_img),
        -
        121  half_kernel_size,
        -
        122  half_kernel_size,
        -
        123  src_view.width(),
        -
        124  src_view.height()
        -
        125  );
        -
        126 
        -
        127  for (std::size_t channel = 0; channel < extended_view.num_channels(); channel++)
        -
        128  {
        -
        129  detail::filter_median_impl(
        -
        130  nth_channel_view(extended_view, channel),
        -
        131  nth_channel_view(dst_view, channel),
        -
        132  kernel_size
        -
        133  );
        -
        134  }
        -
        135 }
        -
        136 
        -
        137 }} //namespace boost::gil
        -
        138 
        -
        139 #endif // !BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2019 Miral Shah <miralshah2211@gmail.com>
        +
        3// Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4//
        +
        5// Use, modification and distribution are subject to the Boost Software License,
        +
        6// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt)
        +
        8//
        +
        9
        +
        10#ifndef BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
        +
        11#define BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
        +
        12
        +
        13#include <boost/gil/image_processing/kernel.hpp>
        +
        14
        +
        15#include <boost/gil/image_processing/convolve.hpp>
        +
        16
        +
        17#include <boost/gil/image.hpp>
        +
        18#include <boost/gil/image_view.hpp>
        +
        19#include <boost/gil/algorithm.hpp>
        +
        20
        +
        21#include <cstddef>
        +
        22#include <vector>
        +
        23
        +
        24namespace boost { namespace gil {
        +
        25
        +
        26template <typename SrcView, typename DstView>
        +
        27void box_filter(
        +
        28 SrcView const& src_view,
        +
        29 DstView const& dst_view,
        +
        30 std::size_t kernel_size,
        +
        31 long int anchor = -1,
        +
        32 bool normalize=true,
        +
        33 boundary_option option = boundary_option::extend_zero
        +
        34)
        +
        35{
        +
        36 gil_function_requires<ImageViewConcept<SrcView>>();
        +
        37 gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        38 static_assert(color_spaces_are_compatible
        +
        39 <
        +
        40 typename color_space_type<SrcView>::type,
        +
        41 typename color_space_type<DstView>::type
        +
        42 >::value, "Source and destination views must have pixels with the same color space");
        +
        43
        +
        44 std::vector<float> kernel_values;
        +
        45 if (normalize) { kernel_values.resize(kernel_size, 1.0f / float(kernel_size)); }
        +
        46 else { kernel_values.resize(kernel_size, 1.0f); }
        +
        47
        +
        48 if (anchor == -1) anchor = static_cast<int>(kernel_size / 2);
        +
        49 kernel_1d<float> kernel(kernel_values.begin(), kernel_size, anchor);
        +
        50
        +
        51 detail::convolve_1d
        +
        52 <
        +
        53 pixel<float, typename SrcView::value_type::layout_t>
        +
        54 >(src_view, kernel, dst_view, option);
        +
        55}
        +
        56
        +
        57template <typename SrcView, typename DstView>
        +
        58void blur(
        +
        59 SrcView const& src_view,
        +
        60 DstView const& dst_view,
        +
        61 std::size_t kernel_size,
        +
        62 long int anchor = -1,
        +
        63 boundary_option option = boundary_option::extend_zero
        +
        64)
        +
        65{
        +
        66 box_filter(src_view, dst_view, kernel_size, anchor, true, option);
        +
        67}
        +
        68
        +
        69
        +
        70namespace detail
        +
        71{
        +
        72template <typename SrcView, typename DstView>
        +
        73void filter_median_impl(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
        +
        74{
        +
        75 std::size_t half_kernel_size = kernel_size / 2;
        +
        76
        +
        77 // deciding output channel type and creating functor
        +
        78 using src_channel_t = typename channel_type<SrcView>::type;
        +
        79
        +
        80 std::vector<src_channel_t> values;
        +
        81 values.reserve(kernel_size * kernel_size);
        +
        82
        +
        83 for (std::ptrdiff_t y = 0; y < src_view.height(); y++)
        +
        84 {
        +
        85 typename DstView::x_iterator dst_it = dst_view.row_begin(y);
        +
        86
        +
        87 for (std::ptrdiff_t x = 0; x < src_view.width(); x++)
        +
        88 {
        +
        89 auto sub_view = subimage_view(
        +
        90 src_view,
        +
        91 x - half_kernel_size, y - half_kernel_size,
        +
        92 kernel_size,
        +
        93 kernel_size
        +
        94 );
        +
        95 values.assign(sub_view.begin(), sub_view.end());
        +
        96
        +
        97 std::nth_element(values.begin(), values.begin() + (values.size() / 2), values.end());
        +
        98 dst_it[x] = values[values.size() / 2];
        +
        99 }
        +
        100 }
        +
        101}
        +
        102} // namespace detail
        +
        103
        +
        104template <typename SrcView, typename DstView>
        +
        105void median_filter(SrcView const& src_view, DstView const& dst_view, std::size_t kernel_size)
        +
        106{
        +
        107 static_assert(color_spaces_are_compatible
        +
        108 <
        +
        109 typename color_space_type<SrcView>::type,
        +
        110 typename color_space_type<DstView>::type
        +
        111 >::value, "Source and destination views must have pixels with the same color space");
        +
        112
        +
        113 std::size_t half_kernel_size = kernel_size / 2;
        +
        114 auto extended_img = extend_boundary(
        +
        115 src_view,
        +
        116 half_kernel_size,
        +
        117 boundary_option::extend_constant
        +
        118 );
        +
        119 auto extended_view = subimage_view(
        +
        120 view(extended_img),
        +
        121 half_kernel_size,
        +
        122 half_kernel_size,
        +
        123 src_view.width(),
        +
        124 src_view.height()
        +
        125 );
        +
        126
        +
        127 for (std::size_t channel = 0; channel < extended_view.num_channels(); channel++)
        +
        128 {
        +
        129 detail::filter_median_impl(
        +
        130 nth_channel_view(extended_view, channel),
        +
        131 nth_channel_view(dst_view, channel),
        +
        132 kernel_size
        +
        133 );
        +
        134 }
        +
        135}
        +
        136
        +
        137}} //namespace boost::gil
        +
        138
        +
        139#endif // !BOOST_GIL_IMAGE_PROCESSING_FILTER_HPP
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/folderclosed.png b/html/reference/folderclosed.png deleted file mode 100644 index bb8ab35ed..000000000 Binary files a/html/reference/folderclosed.png and /dev/null differ diff --git a/html/reference/folderclosed.svg b/html/reference/folderclosed.svg new file mode 100644 index 000000000..b04bed2e7 --- /dev/null +++ b/html/reference/folderclosed.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/html/reference/folderclosedd.svg b/html/reference/folderclosedd.svg new file mode 100644 index 000000000..52f0166a2 --- /dev/null +++ b/html/reference/folderclosedd.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/html/reference/folderopen.png b/html/reference/folderopen.png deleted file mode 100644 index d6c7f676a..000000000 Binary files a/html/reference/folderopen.png and /dev/null differ diff --git a/html/reference/folderopen.svg b/html/reference/folderopen.svg new file mode 100644 index 000000000..f6896dd25 --- /dev/null +++ b/html/reference/folderopen.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/html/reference/folderopend.svg b/html/reference/folderopend.svg new file mode 100644 index 000000000..2d1f06e7b --- /dev/null +++ b/html/reference/folderopend.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/html/reference/functions.html b/html/reference/functions.html index cc53b021f..dc7f7dd6a 100644 --- a/html/reference/functions.html +++ b/html/reference/functions.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class Members @@ -27,200 +27,109 @@

        - + +/* @license-end */ +
        Here is a list of all documented class members with links to the class documentation for each member:
        -

        - b -

        @@ -228,7 +137,7 @@ $(function() { diff --git a/html/reference/functions_func.html b/html/reference/functions_func.html index b77566276..efd7bc623 100644 --- a/html/reference/functions_func.html +++ b/html/reference/functions_func.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class Members - Functions @@ -27,200 +27,109 @@
        - + +/* @license-end */ +
        -  +
        Here is a list of all documented functions with links to the class documentation for each member:
        -

        - b -

        @@ -228,7 +137,7 @@ $(function() { diff --git a/html/reference/fwd_8hpp_source.html b/html/reference/fwd_8hpp_source.html index 414df4641..1d22b0ba1 100644 --- a/html/reference/fwd_8hpp_source.html +++ b/html/reference/fwd_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: fwd.hpp Source File @@ -27,70 +27,75 @@
        - + +/* @license-end */ + +
        -
        -
        fwd.hpp
        +
        fwd.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_FWD_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_FWD_HPP
        -
        10 
        -
        11 namespace boost { namespace gil {
        -
        12 
        -
        13 // Forward declarations used by concepts
        -
        14 
        -
        15 template <typename ColorBase, int K> struct kth_element_type;
        -
        16 template <typename ColorBase, int K> struct kth_element_reference_type;
        -
        17 template <typename ColorBase, int K> struct kth_element_const_reference_type;
        -
        18 template <typename ColorBase, int K> struct kth_semantic_element_reference_type;
        -
        19 template <typename ColorBase, int K> struct kth_semantic_element_const_reference_type;
        -
        20 template <typename ColorBase> struct size;
        -
        21 template <typename ColorBase> struct element_type;
        -
        22 
        -
        23 template <typename T> struct is_pixel;
        -
        24 template <typename T> struct is_planar;
        -
        25 template <typename T> struct channel_type;
        -
        26 template <typename T> struct color_space_type;
        -
        27 template <typename T> struct channel_mapping_type;
        -
        28 template <typename T> struct num_channels;
        -
        29 
        -
        30 template <typename T> struct dynamic_x_step_type;
        -
        31 template <typename T> struct dynamic_y_step_type;
        -
        32 template <typename T> struct transposed_type;
        -
        33 
        -
        34 }} // namespace boost::gil
        -
        35 
        -
        36 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_FWD_HPP
        +
        9#define BOOST_GIL_CONCEPTS_FWD_HPP
        +
        10
        +
        11namespace boost { namespace gil {
        +
        12
        +
        13// Forward declarations used by concepts
        +
        14
        +
        15template <typename ColorBase, int K> struct kth_element_type;
        +
        16template <typename ColorBase, int K> struct kth_element_reference_type;
        +
        17template <typename ColorBase, int K> struct kth_element_const_reference_type;
        +
        18template <typename ColorBase, int K> struct kth_semantic_element_reference_type;
        +
        19template <typename ColorBase, int K> struct kth_semantic_element_const_reference_type;
        +
        20template <typename ColorBase> struct size;
        +
        21template <typename ColorBase> struct element_type;
        +
        22
        +
        23template <typename T> struct is_pixel;
        +
        24template <typename T> struct is_planar;
        +
        25template <typename T> struct channel_type;
        +
        26template <typename T> struct color_space_type;
        +
        27template <typename T> struct channel_mapping_type;
        +
        28template <typename T> struct num_channels;
        +
        29
        +
        30template <typename T> struct dynamic_x_step_type;
        +
        31template <typename T> struct dynamic_y_step_type;
        +
        32template <typename T> struct transposed_type;
        +
        33
        +
        34}} // namespace boost::gil
        +
        35
        +
        36#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/get__read__device_8hpp_source.html b/html/reference/get__read__device_8hpp_source.html index 7c5f82020..95fcf7be4 100644 --- a/html/reference/get__read__device_8hpp_source.html +++ b/html/reference/get__read__device_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: get_read_device.hpp Source File @@ -27,103 +27,108 @@

        - + +/* @license-end */ + +
        -
        -
        get_read_device.hpp
        +
        get_read_device.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_GET_READ_DEVICE_HPP
        -
        9 #define BOOST_GIL_IO_GET_READ_DEVICE_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 #include <boost/gil/io/device.hpp>
        -
        13 #include <boost/gil/io/path_spec.hpp>
        -
        14 
        -
        15 #include <type_traits>
        -
        16 
        -
        17 namespace boost { namespace gil {
        -
        18 
        -
        19 template< typename T
        -
        20  , typename FormatTag
        -
        21  , class Enable = void
        -
        22  >
        -
        23 struct get_read_device
        -
        24 {};
        -
        25 
        -
        26 template <typename Device, typename FormatTag>
        -
        27 struct get_read_device
        -
        28 <
        -
        29  Device,
        -
        30  FormatTag,
        -
        31  typename std::enable_if
        -
        32  <
        -
        33  mp11::mp_and
        -
        34  <
        -
        35  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        36  is_format_tag<FormatTag>
        -
        37  >::value
        -
        38  >::type
        -
        39 >
        -
        40 {
        -
        41  using type = typename detail::is_adaptable_input_device
        -
        42  <
        -
        43  FormatTag,
        -
        44  Device
        -
        45  >::device_type;
        -
        46 };
        -
        47 
        -
        48 template <typename String, typename FormatTag>
        -
        49 struct get_read_device
        -
        50 <
        -
        51  String,
        -
        52  FormatTag,
        -
        53  typename std::enable_if
        -
        54  <
        -
        55  mp11::mp_and
        -
        56  <
        -
        57  detail::is_supported_path_spec<String>,
        -
        58  is_format_tag<FormatTag>
        -
        59  >::value
        -
        60  >::type
        -
        61 >
        -
        62 {
        -
        63  using type = detail::file_stream_device<FormatTag>;
        -
        64 };
        -
        65 
        -
        66 } // namespace gil
        -
        67 } // namespace boost
        -
        68 
        -
        69 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_GET_READ_DEVICE_HPP
        +
        9#define BOOST_GIL_IO_GET_READ_DEVICE_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12#include <boost/gil/io/device.hpp>
        +
        13#include <boost/gil/io/path_spec.hpp>
        +
        14
        +
        15#include <type_traits>
        +
        16
        +
        17namespace boost { namespace gil {
        +
        18
        +
        19template< typename T
        +
        20 , typename FormatTag
        +
        21 , class Enable = void
        +
        22 >
        +
        23struct get_read_device
        +
        24{};
        +
        25
        +
        26template <typename Device, typename FormatTag>
        +
        27struct get_read_device
        +
        28<
        +
        29 Device,
        +
        30 FormatTag,
        +
        31 typename std::enable_if
        +
        32 <
        +
        33 mp11::mp_and
        +
        34 <
        +
        35 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        36 is_format_tag<FormatTag>
        +
        37 >::value
        +
        38 >::type
        +
        39>
        +
        40{
        +
        41 using type = typename detail::is_adaptable_input_device
        +
        42 <
        +
        43 FormatTag,
        +
        44 Device
        +
        45 >::device_type;
        +
        46};
        +
        47
        +
        48template <typename String, typename FormatTag>
        +
        49struct get_read_device
        +
        50<
        +
        51 String,
        +
        52 FormatTag,
        +
        53 typename std::enable_if
        +
        54 <
        +
        55 mp11::mp_and
        +
        56 <
        +
        57 detail::is_supported_path_spec<String>,
        +
        58 is_format_tag<FormatTag>
        +
        59 >::value
        +
        60 >::type
        +
        61>
        +
        62{
        +
        63 using type = detail::file_stream_device<FormatTag>;
        +
        64};
        +
        65
        +
        66} // namespace gil
        +
        67} // namespace boost
        +
        68
        +
        69#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/get__reader_8hpp_source.html b/html/reference/get__reader_8hpp_source.html index d1780c56a..ab960b455 100644 --- a/html/reference/get__reader_8hpp_source.html +++ b/html/reference/get__reader_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: get_reader.hpp Source File @@ -27,201 +27,212 @@

        - + +/* @license-end */ + +
        -
        -
        get_reader.hpp
        +
        get_reader.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_GET_READER_HPP
        -
        9 #define BOOST_GIL_IO_GET_READER_HPP
        -
        10 
        -
        11 #include <boost/gil/io/get_read_device.hpp>
        -
        12 #include <boost/gil/detail/mp11.hpp>
        -
        13 
        -
        14 #include <type_traits>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        19 template
        -
        20 <
        -
        21  typename T,
        -
        22  typename FormatTag,
        -
        23  typename ConversionPolicy,
        -
        24  class Enable = void
        -
        25 >
        -
        26 struct get_reader {};
        -
        27 
        -
        28 template <typename String, typename FormatTag, typename ConversionPolicy>
        -
        29 struct get_reader
        -
        30 <
        -
        31  String,
        -
        32  FormatTag,
        -
        33  ConversionPolicy,
        -
        34  typename std::enable_if
        -
        35  <
        -
        36  mp11::mp_and
        -
        37  <
        -
        38  detail::is_supported_path_spec<String>,
        -
        39  is_format_tag<FormatTag>
        -
        40  >::value
        -
        41  >::type
        -
        42 >
        -
        43 {
        -
        44  using device_t = typename get_read_device<String, FormatTag>::type;
        -
        45  using type = reader<device_t, FormatTag, ConversionPolicy>;
        -
        46 };
        -
        47 
        -
        48 template <typename Device, typename FormatTag, typename ConversionPolicy>
        -
        49 struct get_reader
        -
        50 <
        -
        51  Device,
        -
        52  FormatTag,
        -
        53  ConversionPolicy,
        -
        54  typename std::enable_if
        -
        55  <
        -
        56  mp11::mp_and
        -
        57  <
        -
        58  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        59  is_format_tag<FormatTag>
        -
        60  >::value
        -
        61  >::type
        -
        62 >
        -
        63 {
        -
        64  using device_t = typename get_read_device<Device, FormatTag>::type;
        -
        65  using type = reader<device_t, FormatTag, ConversionPolicy>;
        -
        66 };
        -
        67 
        -
        69 template <typename T, typename FormatTag, class Enable = void>
        - -
        71 {
        -
        72 };
        -
        73 
        -
        74 template <typename String, typename FormatTag>
        - -
        76 <
        -
        77  String,
        -
        78  FormatTag,
        -
        79  typename std::enable_if
        -
        80  <
        -
        81  mp11::mp_and
        -
        82  <
        -
        83  detail::is_supported_path_spec<String>,
        -
        84  is_format_tag<FormatTag>
        -
        85  >::value
        -
        86  >::type
        -
        87 >
        -
        88 {
        -
        89  using device_t = typename get_read_device<String, FormatTag>::type;
        -
        90  using type = dynamic_image_reader<device_t, FormatTag>;
        -
        91 };
        -
        92 
        -
        93 template <typename Device, typename FormatTag>
        -
        94 struct get_dynamic_image_reader
        -
        95 <
        -
        96  Device,
        -
        97  FormatTag,
        -
        98  typename std::enable_if
        -
        99  <
        -
        100  mp11::mp_and
        -
        101  <
        -
        102  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        103  is_format_tag<FormatTag>
        -
        104  >::value
        -
        105  >::type
        -
        106 >
        -
        107 {
        -
        108  using device_t = typename get_read_device<Device, FormatTag>::type;
        -
        109  using type = dynamic_image_reader<device_t, FormatTag>;
        -
        110 };
        -
        111 
        -
        113 template <typename T, typename FormatTag, class Enable = void>
        - -
        115 {
        -
        116 };
        -
        117 
        -
        118 template <typename String, typename FormatTag>
        -
        119 struct get_reader_backend
        -
        120 <
        -
        121  String,
        -
        122  FormatTag,
        -
        123  typename std::enable_if
        -
        124  <
        -
        125  mp11::mp_and
        -
        126  <
        -
        127  detail::is_supported_path_spec<String>,
        -
        128  is_format_tag<FormatTag>
        -
        129  >::value
        -
        130  >::type
        -
        131 >
        -
        132 {
        -
        133  using device_t = typename get_read_device<String, FormatTag>::type;
        -
        134  using type = reader_backend<device_t, FormatTag>;
        -
        135 };
        -
        136 
        -
        137 template <typename Device, typename FormatTag>
        -
        138 struct get_reader_backend
        -
        139 <
        -
        140  Device,
        -
        141  FormatTag,
        -
        142  typename std::enable_if
        -
        143  <
        -
        144  mp11::mp_and
        -
        145  <
        -
        146  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        147  is_format_tag<FormatTag>
        -
        148  >::value
        -
        149  >::type
        -
        150 >
        -
        151 {
        -
        152  using device_t = typename get_read_device<Device, FormatTag>::type;
        -
        153  using type = reader_backend<device_t, FormatTag>;
        -
        154 };
        -
        155 
        -
        157 template <typename T, typename FormatTag>
        - -
        159 {
        -
        160  using device_t = typename get_read_device<T, FormatTag>::type;
        -
        161  using type = scanline_reader<device_t, FormatTag>;
        -
        162 };
        -
        163 
        -
        164 } // namespace gil
        -
        165 } // namespace boost
        -
        166 
        -
        167 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Helper metafunction to generate dynamic image reader type.
        Definition: get_reader.hpp:71
        -
        Helper metafunction to generate image backend type.
        Definition: get_reader.hpp:115
        -
        Helper metafunction to generate image reader type.
        Definition: get_reader.hpp:26
        -
        Helper metafunction to generate image scanline_reader type.
        Definition: get_reader.hpp:159
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_GET_READER_HPP
        +
        9#define BOOST_GIL_IO_GET_READER_HPP
        +
        10
        +
        11#include <boost/gil/io/get_read_device.hpp>
        +
        12#include <boost/gil/detail/mp11.hpp>
        +
        13
        +
        14#include <type_traits>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        19template
        +
        20<
        +
        21 typename T,
        +
        22 typename FormatTag,
        +
        23 typename ConversionPolicy,
        +
        24 class Enable = void
        +
        25>
        +
        26struct get_reader {};
        +
        27
        +
        28template <typename String, typename FormatTag, typename ConversionPolicy>
        +
        29struct get_reader
        +
        30<
        +
        31 String,
        +
        32 FormatTag,
        +
        33 ConversionPolicy,
        +
        34 typename std::enable_if
        +
        35 <
        +
        36 mp11::mp_and
        +
        37 <
        +
        38 detail::is_supported_path_spec<String>,
        +
        39 is_format_tag<FormatTag>
        +
        40 >::value
        +
        41 >::type
        +
        42>
        +
        43{
        +
        44 using device_t = typename get_read_device<String, FormatTag>::type;
        +
        45 using type = reader<device_t, FormatTag, ConversionPolicy>;
        +
        46};
        +
        47
        +
        48template <typename Device, typename FormatTag, typename ConversionPolicy>
        +
        49struct get_reader
        +
        50<
        +
        51 Device,
        +
        52 FormatTag,
        +
        53 ConversionPolicy,
        +
        54 typename std::enable_if
        +
        55 <
        +
        56 mp11::mp_and
        +
        57 <
        +
        58 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        59 is_format_tag<FormatTag>
        +
        60 >::value
        +
        61 >::type
        +
        62>
        +
        63{
        +
        64 using device_t = typename get_read_device<Device, FormatTag>::type;
        +
        65 using type = reader<device_t, FormatTag, ConversionPolicy>;
        +
        66};
        +
        67
        +
        69template <typename T, typename FormatTag, class Enable = void>
        +
        + +
        71{
        +
        72};
        +
        +
        73
        +
        74template <typename String, typename FormatTag>
        + +
        76<
        +
        77 String,
        +
        78 FormatTag,
        +
        79 typename std::enable_if
        +
        80 <
        +
        81 mp11::mp_and
        +
        82 <
        +
        83 detail::is_supported_path_spec<String>,
        +
        84 is_format_tag<FormatTag>
        +
        85 >::value
        +
        86 >::type
        +
        87>
        +
        88{
        +
        89 using device_t = typename get_read_device<String, FormatTag>::type;
        +
        90 using type = dynamic_image_reader<device_t, FormatTag>;
        +
        91};
        +
        92
        +
        93template <typename Device, typename FormatTag>
        +
        94struct get_dynamic_image_reader
        +
        95<
        +
        96 Device,
        +
        97 FormatTag,
        +
        98 typename std::enable_if
        +
        99 <
        +
        100 mp11::mp_and
        +
        101 <
        +
        102 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        103 is_format_tag<FormatTag>
        +
        104 >::value
        +
        105 >::type
        +
        106>
        +
        107{
        +
        108 using device_t = typename get_read_device<Device, FormatTag>::type;
        +
        109 using type = dynamic_image_reader<device_t, FormatTag>;
        +
        110};
        +
        111
        +
        113template <typename T, typename FormatTag, class Enable = void>
        +
        + +
        115{
        +
        116};
        +
        +
        117
        +
        118template <typename String, typename FormatTag>
        + +
        120<
        +
        121 String,
        +
        122 FormatTag,
        +
        123 typename std::enable_if
        +
        124 <
        +
        125 mp11::mp_and
        +
        126 <
        +
        127 detail::is_supported_path_spec<String>,
        +
        128 is_format_tag<FormatTag>
        +
        129 >::value
        +
        130 >::type
        +
        131>
        +
        132{
        +
        133 using device_t = typename get_read_device<String, FormatTag>::type;
        +
        134 using type = reader_backend<device_t, FormatTag>;
        +
        135};
        +
        136
        +
        137template <typename Device, typename FormatTag>
        +
        138struct get_reader_backend
        +
        139<
        +
        140 Device,
        +
        141 FormatTag,
        +
        142 typename std::enable_if
        +
        143 <
        +
        144 mp11::mp_and
        +
        145 <
        +
        146 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        147 is_format_tag<FormatTag>
        +
        148 >::value
        +
        149 >::type
        +
        150>
        +
        151{
        +
        152 using device_t = typename get_read_device<Device, FormatTag>::type;
        +
        153 using type = reader_backend<device_t, FormatTag>;
        +
        154};
        +
        155
        +
        157template <typename T, typename FormatTag>
        +
        + +
        159{
        +
        160 using device_t = typename get_read_device<T, FormatTag>::type;
        +
        161 using type = scanline_reader<device_t, FormatTag>;
        +
        162};
        +
        +
        163
        +
        164} // namespace gil
        +
        165} // namespace boost
        +
        166
        +
        167#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Helper metafunction to generate dynamic image reader type.
        Definition get_reader.hpp:71
        +
        Helper metafunction to generate image backend type.
        Definition get_reader.hpp:115
        +
        Helper metafunction to generate image reader type.
        Definition get_reader.hpp:26
        +
        Helper metafunction to generate image scanline_reader type.
        Definition get_reader.hpp:159
        diff --git a/html/reference/get__write__device_8hpp_source.html b/html/reference/get__write__device_8hpp_source.html index 930bc2cb0..991b9a691 100644 --- a/html/reference/get__write__device_8hpp_source.html +++ b/html/reference/get__write__device_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: get_write_device.hpp Source File @@ -27,95 +27,100 @@

        - + +/* @license-end */ + +
        -
        -
        get_write_device.hpp
        +
        get_write_device.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_GET_WRITE_DEVICE_HPP
        -
        9 #define BOOST_GIL_IO_GET_WRITE_DEVICE_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 #include <boost/gil/io/device.hpp>
        -
        13 #include <boost/gil/io/path_spec.hpp>
        -
        14 
        -
        15 #include <type_traits>
        -
        16 
        -
        17 namespace boost { namespace gil {
        -
        18 
        -
        19 template <typename T, typename FormatTag, class Enable = void>
        -
        20 struct get_write_device {};
        -
        21 
        -
        22 template <typename Device, typename FormatTag>
        -
        23 struct get_write_device
        -
        24 <
        -
        25  Device,
        -
        26  FormatTag,
        -
        27  typename std::enable_if
        -
        28  <
        -
        29  mp11::mp_and
        -
        30  <
        -
        31  detail::is_adaptable_output_device<FormatTag, Device>,
        -
        32  is_format_tag<FormatTag>
        -
        33  >::value
        -
        34  >::type
        -
        35 >
        -
        36 {
        -
        37  using type =
        -
        38  typename detail::is_adaptable_output_device<FormatTag, Device>::device_type;
        -
        39 };
        -
        40 
        -
        41 template <typename String, typename FormatTag>
        -
        42 struct get_write_device
        -
        43 <
        -
        44  String,
        -
        45  FormatTag,
        -
        46  typename std::enable_if
        -
        47  <
        -
        48  mp11::mp_and
        -
        49  <
        -
        50  detail::is_supported_path_spec<String>,
        -
        51  is_format_tag<FormatTag>
        -
        52  >::value
        -
        53  >::type
        -
        54 >
        -
        55 {
        -
        56  using type = detail::file_stream_device<FormatTag>;
        -
        57 };
        -
        58 
        -
        59 }} // namespace boost::gil
        -
        60 
        -
        61 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_GET_WRITE_DEVICE_HPP
        +
        9#define BOOST_GIL_IO_GET_WRITE_DEVICE_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12#include <boost/gil/io/device.hpp>
        +
        13#include <boost/gil/io/path_spec.hpp>
        +
        14
        +
        15#include <type_traits>
        +
        16
        +
        17namespace boost { namespace gil {
        +
        18
        +
        19template <typename T, typename FormatTag, class Enable = void>
        +
        20struct get_write_device {};
        +
        21
        +
        22template <typename Device, typename FormatTag>
        +
        23struct get_write_device
        +
        24<
        +
        25 Device,
        +
        26 FormatTag,
        +
        27 typename std::enable_if
        +
        28 <
        +
        29 mp11::mp_and
        +
        30 <
        +
        31 detail::is_adaptable_output_device<FormatTag, Device>,
        +
        32 is_format_tag<FormatTag>
        +
        33 >::value
        +
        34 >::type
        +
        35>
        +
        36{
        +
        37 using type =
        +
        38 typename detail::is_adaptable_output_device<FormatTag, Device>::device_type;
        +
        39};
        +
        40
        +
        41template <typename String, typename FormatTag>
        +
        42struct get_write_device
        +
        43<
        +
        44 String,
        +
        45 FormatTag,
        +
        46 typename std::enable_if
        +
        47 <
        +
        48 mp11::mp_and
        +
        49 <
        +
        50 detail::is_supported_path_spec<String>,
        +
        51 is_format_tag<FormatTag>
        +
        52 >::value
        +
        53 >::type
        +
        54>
        +
        55{
        +
        56 using type = detail::file_stream_device<FormatTag>;
        +
        57};
        +
        58
        +
        59}} // namespace boost::gil
        +
        60
        +
        61#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/get__writer_8hpp_source.html b/html/reference/get__writer_8hpp_source.html index 55c95692b..339eb05bd 100644 --- a/html/reference/get__writer_8hpp_source.html +++ b/html/reference/get__writer_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: get_writer.hpp Source File @@ -27,139 +27,144 @@

        - + +/* @license-end */ + +
        -
        -
        get_writer.hpp
        +
        get_writer.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_GET_WRITER_HPP
        -
        9 #define BOOST_GIL_IO_GET_WRITER_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 #include <boost/gil/io/get_write_device.hpp>
        -
        13 
        -
        14 #include <type_traits>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        19 template <typename T, typename FormatTag, class Enable = void>
        -
        20 struct get_writer {};
        -
        21 
        -
        22 
        -
        23 template <typename String, typename FormatTag>
        -
        24 struct get_writer
        -
        25 <
        -
        26  String,
        -
        27  FormatTag,
        -
        28  typename std::enable_if
        -
        29  <
        -
        30  mp11::mp_and
        -
        31  <
        -
        32  detail::is_supported_path_spec<String>,
        -
        33  is_format_tag<FormatTag>
        -
        34  >::value
        -
        35  >::type
        -
        36 >
        -
        37 {
        -
        38  using device_t = typename get_write_device<String, FormatTag>::type;
        -
        39  using type = writer<device_t, FormatTag>;
        -
        40 };
        -
        41 
        -
        42 template <typename Device, typename FormatTag>
        -
        43 struct get_writer
        -
        44 <
        -
        45  Device,
        -
        46  FormatTag,
        -
        47  typename std::enable_if
        -
        48  <
        -
        49  mp11::mp_and
        -
        50  <
        -
        51  detail::is_adaptable_output_device<FormatTag, Device>,
        -
        52  is_format_tag<FormatTag>
        -
        53  >::value
        -
        54  >::type
        -
        55 >
        -
        56 {
        -
        57  using device_t = typename get_write_device<Device, FormatTag>::type;
        -
        58  using type = writer<device_t, FormatTag>;
        -
        59 };
        -
        60 
        -
        62 template <typename T, typename FormatTag, class Enable = void>
        - -
        64 
        -
        65 template <typename String, typename FormatTag>
        - -
        67 <
        -
        68  String,
        -
        69  FormatTag,
        -
        70  typename std::enable_if
        -
        71  <
        -
        72  mp11::mp_and
        -
        73  <
        -
        74  detail::is_supported_path_spec<String>,
        -
        75  is_format_tag<FormatTag>
        -
        76  >::value
        -
        77  >::type
        -
        78 >
        -
        79 {
        -
        80  using device_t = typename get_write_device<String, FormatTag>::type;
        -
        81  using type = dynamic_image_writer<device_t, FormatTag>;
        -
        82 };
        -
        83 
        -
        84 template <typename Device, typename FormatTag>
        -
        85 struct get_dynamic_image_writer
        -
        86 <
        -
        87  Device,
        -
        88  FormatTag,
        -
        89  typename std::enable_if
        -
        90  <
        -
        91  mp11::mp_and
        -
        92  <
        -
        93  detail::is_write_device<FormatTag, Device>,
        -
        94  is_format_tag<FormatTag>
        -
        95  >::value
        -
        96  >::type
        -
        97 >
        -
        98 {
        -
        99  using device_t = typename get_write_device<Device, FormatTag>::type;
        -
        100  using type = dynamic_image_writer<device_t, FormatTag>;
        -
        101 };
        -
        102 
        -
        103 }} // namespace boost::gil
        -
        104 
        -
        105 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Helper metafunction to generate dynamic image writer type.
        Definition: get_writer.hpp:63
        -
        Helper metafunction to generate writer type.
        Definition: get_writer.hpp:20
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_GET_WRITER_HPP
        +
        9#define BOOST_GIL_IO_GET_WRITER_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12#include <boost/gil/io/get_write_device.hpp>
        +
        13
        +
        14#include <type_traits>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        19template <typename T, typename FormatTag, class Enable = void>
        +
        20struct get_writer {};
        +
        21
        +
        22
        +
        23template <typename String, typename FormatTag>
        +
        24struct get_writer
        +
        25<
        +
        26 String,
        +
        27 FormatTag,
        +
        28 typename std::enable_if
        +
        29 <
        +
        30 mp11::mp_and
        +
        31 <
        +
        32 detail::is_supported_path_spec<String>,
        +
        33 is_format_tag<FormatTag>
        +
        34 >::value
        +
        35 >::type
        +
        36>
        +
        37{
        +
        38 using device_t = typename get_write_device<String, FormatTag>::type;
        +
        39 using type = writer<device_t, FormatTag>;
        +
        40};
        +
        41
        +
        42template <typename Device, typename FormatTag>
        +
        43struct get_writer
        +
        44<
        +
        45 Device,
        +
        46 FormatTag,
        +
        47 typename std::enable_if
        +
        48 <
        +
        49 mp11::mp_and
        +
        50 <
        +
        51 detail::is_adaptable_output_device<FormatTag, Device>,
        +
        52 is_format_tag<FormatTag>
        +
        53 >::value
        +
        54 >::type
        +
        55>
        +
        56{
        +
        57 using device_t = typename get_write_device<Device, FormatTag>::type;
        +
        58 using type = writer<device_t, FormatTag>;
        +
        59};
        +
        60
        +
        62template <typename T, typename FormatTag, class Enable = void>
        + +
        64
        +
        65template <typename String, typename FormatTag>
        + +
        67<
        +
        68 String,
        +
        69 FormatTag,
        +
        70 typename std::enable_if
        +
        71 <
        +
        72 mp11::mp_and
        +
        73 <
        +
        74 detail::is_supported_path_spec<String>,
        +
        75 is_format_tag<FormatTag>
        +
        76 >::value
        +
        77 >::type
        +
        78>
        +
        79{
        +
        80 using device_t = typename get_write_device<String, FormatTag>::type;
        +
        81 using type = dynamic_image_writer<device_t, FormatTag>;
        +
        82};
        +
        83
        +
        84template <typename Device, typename FormatTag>
        +
        85struct get_dynamic_image_writer
        +
        86<
        +
        87 Device,
        +
        88 FormatTag,
        +
        89 typename std::enable_if
        +
        90 <
        +
        91 mp11::mp_and
        +
        92 <
        +
        93 detail::is_write_device<FormatTag, Device>,
        +
        94 is_format_tag<FormatTag>
        +
        95 >::value
        +
        96 >::type
        +
        97>
        +
        98{
        +
        99 using device_t = typename get_write_device<Device, FormatTag>::type;
        +
        100 using type = dynamic_image_writer<device_t, FormatTag>;
        +
        101};
        +
        102
        +
        103}} // namespace boost::gil
        +
        104
        +
        105#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Helper metafunction to generate dynamic image writer type.
        Definition get_writer.hpp:63
        +
        Helper metafunction to generate writer type.
        Definition get_writer.hpp:20
        diff --git a/html/reference/gray_8hpp_source.html b/html/reference/gray_8hpp_source.html index d670a1b6a..c85d5ac8a 100644 --- a/html/reference/gray_8hpp_source.html +++ b/html/reference/gray_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: gray.hpp Source File @@ -27,61 +27,66 @@

        - + +/* @license-end */ + +
        -
        -
        gray.hpp
        +
        gray.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_GRAY_HPP
        -
        9 #define BOOST_GIL_GRAY_HPP
        -
        10 
        -
        11 #include <boost/gil/utilities.hpp>
        -
        12 #include <boost/gil/detail/mp11.hpp>
        -
        13 
        -
        14 namespace boost { namespace gil {
        -
        15 
        -
        18 struct gray_color_t {};
        -
        19 
        -
        21 using gray_t = mp11::mp_list<gray_color_t>;
        -
        22 
        - -
        25 
        -
        26 }} // namespace boost::gil
        -
        27 
        -
        28 #endif
        -
        29 
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Gray.
        Definition: gray.hpp:18
        -
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:268
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_GRAY_HPP
        +
        9#define BOOST_GIL_GRAY_HPP
        +
        10
        +
        11#include <boost/gil/utilities.hpp>
        +
        12#include <boost/gil/detail/mp11.hpp>
        +
        13
        +
        14namespace boost { namespace gil {
        +
        15
        +
        18struct gray_color_t {};
        +
        19
        +
        21using gray_t = mp11::mp_list<gray_color_t>;
        +
        22
        + +
        25
        +
        26}} // namespace boost::gil
        +
        27
        +
        28#endif
        +
        29
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Gray.
        Definition gray.hpp:18
        +
        Represents a color space and ordering of channels in memory.
        Definition utilities.hpp:268
        diff --git a/html/reference/group___a_h_e-helpers.html b/html/reference/group___a_h_e-helpers.html index 52e394a1c..601983f21 100644 --- a/html/reference/group___a_h_e-helpers.html +++ b/html/reference/group___a_h_e-helpers.html @@ -4,7 +4,7 @@ - + Generic Image Library: AHE-helpers @@ -27,20 +27,20 @@

        - + +/* @license-end */ +
        -
        -
        AHE-helpers
        +
        AHE-helpers
        @@ -53,7 +53,7 @@ $(function() { diff --git a/html/reference/group___a_h_e.html b/html/reference/group___a_h_e.html index f8a422e37..4199ed324 100644 --- a/html/reference/group___a_h_e.html +++ b/html/reference/group___a_h_e.html @@ -4,7 +4,7 @@ - + Generic Image Library: AHE @@ -27,20 +27,20 @@

        - + +/* @license-end */ +
        -
        -
        AHE
        +
        AHE
        @@ -54,7 +54,7 @@ $(function() { diff --git a/html/reference/group___basic_concepts.html b/html/reference/group___basic_concepts.html index 4f585d495..234d9094c 100644 --- a/html/reference/group___basic_concepts.html +++ b/html/reference/group___basic_concepts.html @@ -4,7 +4,7 @@ - + Generic Image Library: Basic Concepts @@ -27,29 +27,29 @@

        - + +/* @license-end */ +
        -
        -
        Basic Concepts
        +
        Basic Concepts

        Various basic concepts. More...

        - @@ -84,7 +84,7 @@ Classes diff --git a/html/reference/group___channel.html b/html/reference/group___channel.html index 576b663c6..9f861719d 100644 --- a/html/reference/group___channel.html +++ b/html/reference/group___channel.html @@ -4,7 +4,7 @@ - + Generic Image Library: Channel @@ -27,37 +27,37 @@
        - + +/* @license-end */ +
        -
        -
        Channel
        +
        Channel

        Channel is the building block of pixel. More...

        +

        Classes

        struct  DefaultConstructible< T >
         Concept of default construction requirement. More...
        - - + - + - +

        +

        Modules

         Concepts
         Concepts
         Concepts for channels.
         
         Models
         Models
         Channel models. Although not required by the ChannelConcept, all GIL-provided channels support arithmetic operations.
         
         Algorithms and Utility Functions
         Algorithms and Utility Functions
         Channel algorithms, metafunctions and utility functions.
         
        @@ -69,7 +69,7 @@ Modules
        - - + - + - +

        +

        Modules

         channel_convert
         channel_convert
         Converting from one channel type to another.
         
         channel_multiply
         channel_multiply
         Multiplying unsigned channel values of the same type. Performs scaled multiplication result = a * b / max_value.
         
         channel_invert
         channel_invert
         Returns the inverse of a channel. result = max_value - x + min_value.
         
        - @@ -76,7 +76,7 @@ Classes diff --git a/html/reference/group___channel_concept.html b/html/reference/group___channel_concept.html index 52884ae21..d623dc264 100644 --- a/html/reference/group___channel_concept.html +++ b/html/reference/group___channel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        Concepts
        +
        Concepts

        Concepts for channels. More...

        +

        Classes

        struct  channels_are_compatible< T1, T2 >
         Predicate metafunction returning whether two channels are compatible. More...
        - @@ -75,7 +75,7 @@ Classes diff --git a/html/reference/group___channel_convert_algorithm.html b/html/reference/group___channel_convert_algorithm.html index 8c361e609..45cc794a5 100644 --- a/html/reference/group___channel_convert_algorithm.html +++ b/html/reference/group___channel_convert_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_convert @@ -27,15 +27,16 @@
        - + +/* @license-end */ +
        @@ -43,21 +44,20 @@ $(function() { Modules | Classes | Functions
        - +

        Converting from one channel type to another. More...

        +

        Classes

        struct  ChannelConcept< T >
         A channel is the building block of a color. Color is defined as a mixture of primary colors and a channel defines the degree to which each primary color is used in the mixture. More...
        - - +

        +

        Modules

         channel_converter_unsigned
         channel_converter_unsigned
         Convert one unsigned/floating point channel to another. Converts both the channel type and range.
         
        - @@ -66,33 +66,33 @@ Classes

        +

        Classes

        struct  channel_converter< SrcChannelV, DstChannelV >
         A unary function object converting between channel types. More...
         Same as channel_converter, except it takes the destination channel by reference, which allows us to move the templates from the class level to the method level. This is important when invoking it on heterogeneous pixels. More...
         
        - - - - - + + +

        +

        Functions

        +
        template<typename DstChannel , typename SrcChannel >
        auto channel_convert (SrcChannel const &src) -> typename channel_traits< DstChannel >::value_type
         Converting from one channel type to another.
         
        auto channel_convert (SrcChannel const &src) -> typename channel_traits< DstChannel >::value_type
         Converting from one channel type to another.
         

        Detailed Description

        Converting from one channel type to another.

        Conversion is done as a simple linear mapping of one channel range to the other, such that the minimum/maximum value of the source maps to the minimum/maximum value of the destination. One implication of this is that the value 0 of signed channels may not be preserved!

        When creating new channel models, it is often a good idea to provide specializations for the channel conversion algorithms, for example, for performance optimizations. If the new model is an integral type that can be signed, it is easier to define the conversion only for the unsigned type (channel_converter_unsigned) and provide specializations of detail::channel_convert_to_unsigned and detail::channel_convert_from_unsigned to convert between the signed and unsigned type.

        Example:

        // float32_t is a floating point channel with range [0.0f ... 1.0f]
        -
        float32_t src_channel = channel_traits<float32_t>::max_value();
        +
        float32_t src_channel = channel_traits<float32_t>::max_value();
        assert(src_channel == 1);
        // uint8_t is 8-bit unsigned integral channel (aliased from unsigned char)
        uint8_t dst_channel = channel_convert<uint8_t>(src_channel);
        assert(dst_channel == 255); // max value goes to max value
        -
        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
        +
        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
        diff --git a/html/reference/group___channel_convert_unsigned_algorithm.html b/html/reference/group___channel_convert_unsigned_algorithm.html index 40d733234..4f8347308 100644 --- a/html/reference/group___channel_convert_unsigned_algorithm.html +++ b/html/reference/group___channel_convert_unsigned_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_converter_unsigned @@ -27,29 +27,29 @@

        - + +/* @license-end */ +
        -
        -
        +

        Convert one unsigned/floating point channel to another. Converts both the channel type and range. More...

        - @@ -72,7 +72,7 @@ Classes diff --git a/html/reference/group___channel_invert_algorithm.html b/html/reference/group___channel_invert_algorithm.html index a408d2ba2..4140795b9 100644 --- a/html/reference/group___channel_invert_algorithm.html +++ b/html/reference/group___channel_invert_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_invert @@ -27,50 +27,50 @@
        - + +/* @license-end */ +

        Returns the inverse of a channel. result = max_value - x + min_value. More...

        +

        Classes

        struct  channel_converter_unsigned< T, T >
         Converting a channel to itself - identity operation. More...
        - - - - - + + +

        +

        Functions

        +
        template<typename Channel >
        auto channel_invert (Channel x) -> typename channel_traits< Channel >::value_type
         Default implementation. Provide overloads for performance.
         
        auto channel_invert (Channel x) -> typename channel_traits< Channel >::value_type
         Default implementation. Provide overloads for performance.
         

        Detailed Description

        Returns the inverse of a channel. result = max_value - x + min_value.

        Example:

        // uint8_t == uint8_t == unsigned char
        uint8_t x=255;
        -
        uint8_t inv = channel_invert(x);
        +
        uint8_t inv = channel_invert(x);
        assert(inv == 0);
        -
        auto channel_invert(Channel x) -> typename channel_traits< Channel >::value_type
        Default implementation. Provide overloads for performance.
        Definition: channel_algorithm.hpp:582
        +
        auto channel_invert(Channel x) -> typename channel_traits< Channel >::value_type
        Default implementation. Provide overloads for performance.
        Definition channel_algorithm.hpp:582
        diff --git a/html/reference/group___channel_model.html b/html/reference/group___channel_model.html index e706937cf..43b6c52fd 100644 --- a/html/reference/group___channel_model.html +++ b/html/reference/group___channel_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,45 +27,45 @@
        - + +/* @license-end */ +
        -
        -
        Models
        +
        Models

        Channel models. Although not required by the ChannelConcept, all GIL-provided channels support arithmetic operations. More...

        - - + - +

        +

        Modules

         scoped_channel_value
         scoped_channel_value
         
         packed_dynamic_channel_reference
         packed_dynamic_channel_reference
         Represents a reference proxy to a channel operating over a bit range whose offset is specified at run time. Models ChannelConcept.
         
        - - + - +

        +

        Typedefs

        -using float32_t = scoped_channel_value< float, float_point_zero< float >, float_point_one< float > >
        +using float32_t = scoped_channel_value< float, float_point_zero< float >, float_point_one< float > >
         32-bit floating point channel type with range [0.0f ... 1.0f]. Models ChannelValueConcept
         
        -using float64_t = scoped_channel_value< double, float_point_zero< double >, float_point_one< double > >
        +using float64_t = scoped_channel_value< double, float_point_zero< double >, float_point_one< double > >
         64-bit floating point channel type with range [0.0f ... 1.0f]. Models ChannelValueConcept
         
        @@ -77,7 +77,7 @@ using 
        diff --git a/html/reference/group___channel_multiply_algorithm.html b/html/reference/group___channel_multiply_algorithm.html index 52631c60b..4dfdc2fe5 100644 --- a/html/reference/group___channel_multiply_algorithm.html +++ b/html/reference/group___channel_multiply_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: channel_multiply @@ -27,30 +27,30 @@
        - + +/* @license-end */ +

        Multiplying unsigned channel values of the same type. Performs scaled multiplication result = a * b / max_value. More...

        - @@ -68,28 +68,28 @@ Classes

        +

        Classes

        struct  channel_multiplier_unsigned< ChannelValue >
         This is the default implementation. Performance specializatons are provided. More...
         A function object to multiply two channels. result = a * b / max_value. More...
         
        - - - - - + + +

        +

        Functions

        +
        template<typename Channel >
        auto channel_multiply (Channel a, Channel b) -> typename channel_traits< Channel >::value_type
         A function multiplying two channels. result = a * b / max_value.
         
        auto channel_multiply (Channel a, Channel b) -> typename channel_traits< Channel >::value_type
         A function multiplying two channels. result = a * b / max_value.
         

        Detailed Description

        Multiplying unsigned channel values of the same type. Performs scaled multiplication result = a * b / max_value.

        Example:

        uint8_t x=128;
        uint8_t y=128;
        -
        uint8_t mul = channel_multiply(x,y);
        +
        uint8_t mul = channel_multiply(x,y);
        assert(mul == 64); // 64 = 128 * 128 / 255
        -
        auto channel_multiply(Channel a, Channel b) -> typename channel_traits< Channel >::value_type
        A function multiplying two channels. result = a * b / max_value.
        Definition: channel_algorithm.hpp:561
        +
        auto channel_multiply(Channel a, Channel b) -> typename channel_traits< Channel >::value_type
        A function multiplying two channels. result = a * b / max_value.
        Definition channel_algorithm.hpp:561
        diff --git a/html/reference/group___color_base.html b/html/reference/group___color_base.html index 45fb16023..8349062e0 100644 --- a/html/reference/group___color_base.html +++ b/html/reference/group___color_base.html @@ -4,7 +4,7 @@ - + Generic Image Library: ColorBase @@ -27,37 +27,37 @@
        - + +/* @license-end */ +
        -
        -
        ColorBase
        +
        ColorBase

        A color base is a container of color elements. More...

        - - + - + - +

        +

        Modules

         Concepts
         Concepts
         ColorBase concepts.
         
         Models
         Models
         ColorBase models.
         
         Algorithms and Utility Functions
         Algorithms and Utility Functions
         ColorBase algorithms, metafunctions and utility functions.
         
        @@ -70,7 +70,7 @@ Modules
        - - + - + - + - + - + - - + + - + - - + + - + - + - +

        +

        Modules

         size
         size
         size: Semantic channel size
         
         kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c
         kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c
         semantic_at_c: Semantic channel accessors
         
         color_element_type, color_element_reference_type, color_element_const_reference_type, get_color, contains_color
         color_element_type, color_element_reference_type, color_element_const_reference_type, get_color, contains_color
         get_color: Named channel accessors
         
         element_type, element_reference_type, element_const_reference_type
         element_type, element_reference_type, element_const_reference_type
         Types for homogeneous color bases.
         
         static_min, static_max
         static_min, static_max
         Equivalents to std::min_element and std::max_element for homogeneous color bases.
         
         static_equal
         Equivalent to std::equal. Pairs the elements semantically.
         static_equal
         Equivalent to std::equal. Pairs the elements semantically.
         
         static_copy
         static_copy
         Equivalent to std::copy. Pairs the elements semantically.
         
         static_fill
         Equivalent to std::fill.
         static_fill
         Equivalent to std::fill.
         
         static_generate
         static_generate
         Equivalent to std::generate.
         
         static_transform
         static_transform
         Equivalent to std::transform. Pairs the elements semantically.
         
         static_for_each
         static_for_each
         Equivalent to std::for_each. Pairs the elements semantically.
         
        @@ -93,7 +93,7 @@ Modules
        - @@ -65,18 +65,18 @@ Classes

        +

        Classes

        struct  contains_color< ColorBase, Color >
         A predicate metafunction determining whether a given color base contains a given color. More...
         Specifies the return type of the constant element accessor by color name, get_color(color_base, Color());. More...
         
        - - - - - - + + + - - - + + +

        +

        Functions

        +
        template<typename ColorBase , typename Color >
        auto get_color (ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
         Mutable accessor to the element associated with a given color name.
         
        +
        auto get_color (ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
         Mutable accessor to the element associated with a given color name.
         
        template<typename ColorBase , typename Color >
        auto get_color (const ColorBase &cb, Color=Color()) -> typename color_element_const_reference_type< ColorBase, Color >::type
         Constant accessor to the element associated with a given color name.
         
        auto get_color (const ColorBase &cb, Color=Color()) -> typename color_element_const_reference_type< ColorBase, Color >::type
         Constant accessor to the element associated with a given color name.
         

        Detailed Description

        get_color: Named channel accessors

        @@ -85,19 +85,19 @@ template<typename ColorBase , typename Color >
        - - - - + +

        +

        Functions

        +
        template<typename Src , typename Dst >
        BOOST_FORCEINLINE void static_copy (const Src &src, Dst &dst)
         
        BOOST_FORCEINLINE void static_copy (const Src &src, Dst &dst)
         

        Detailed Description

        Equivalent to std::copy. Pairs the elements semantically.

        @@ -70,7 +70,7 @@ template<typename Src , typename Dst >
        - - - - + +

        +

        Functions

        +
        template<typename P1 , typename P2 >
        BOOST_FORCEINLINE bool static_equal (P1 const &p1, const P2 &p2)
         
        BOOST_FORCEINLINE bool static_equal (P1 const &p1, const P2 &p2)
         

        Detailed Description

        -

        Equivalent to std::equal. Pairs the elements semantically.

        +

        Equivalent to std::equal. Pairs the elements semantically.

        Example:

        rgb8_pixel_t rgb_red(255,0,0);
        bgr8_pixel_t bgr_red(0,0,255);
        assert(rgb_red[0]==255 && bgr_red[0]==0);
        @@ -70,7 +70,7 @@ template<typename P1 , typename P2 >
        - - - - + +

        +

        Functions

        +
        template<typename P , typename V >
        BOOST_FORCEINLINE void static_fill (P &p, const V &v)
         
        BOOST_FORCEINLINE void static_fill (P &p, const V &v)
         

        Detailed Description

        -

        Equivalent to std::fill.

        +

        Equivalent to std::fill.

        Example:

        rgb8_pixel_t p;
        static_fill(p, 10);
        assert(p == rgb8_pixel_t(10,10,10));
        @@ -67,7 +67,7 @@ template<typename P , typename V >
        - - - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - + +

        +

        Functions

        +
        template<typename P1 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, Op op)
         
        template<typename P1 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, Op op)
         
        template<typename P1 , typename P2 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, P2 &p2, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, P2 &p2, Op op)
         
        template<typename P1 , typename P2 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, const P2 &p2, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, const P2 &p2, Op op)
         
        template<typename P1 , typename P2 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, P2 &p2, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, P2 &p2, Op op)
         
        template<typename P1 , typename P2 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, const P2 &p2, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, const P2 &p2, Op op)
         
        template<typename P1 , typename P2 , typename P3 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, P2 &p2, P3 &p3, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, P2 &p2, P3 &p3, Op op)
         
        template<typename P1 , typename P2 , typename P3 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, P2 &p2, const P3 &p3, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, P2 &p2, const P3 &p3, Op op)
         
        template<typename P1 , typename P2 , typename P3 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, const P2 &p2, P3 &p3, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, const P2 &p2, P3 &p3, Op op)
         
        template<typename P1 , typename P2 , typename P3 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, const P2 &p2, const P3 &p3, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (P1 &p1, const P2 &p2, const P3 &p3, Op op)
         
        template<typename P1 , typename P2 , typename P3 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, P2 &p2, P3 &p3, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, P2 &p2, P3 &p3, Op op)
         
        template<typename P1 , typename P2 , typename P3 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, P2 &p2, const P3 &p3, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, P2 &p2, const P3 &p3, Op op)
         
        template<typename P1 , typename P2 , typename P3 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, const P2 &p2, P3 &p3, Op op)
         
        +
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, const P2 &p2, P3 &p3, Op op)
         
        template<typename P1 , typename P2 , typename P3 , typename Op >
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, const P2 &p2, const P3 &p3, Op op)
         
        BOOST_FORCEINLINE Op static_for_each (const P1 &p1, const P2 &p2, const P3 &p3, Op op)
         

        Detailed Description

        Equivalent to std::for_each. Pairs the elements semantically.

        @@ -132,7 +132,7 @@ template<typename P1 , typename P2 , typename P3 , typename Op >
        - - - - + +

        +

        Functions

        +
        template<typename P1 , typename Op >
        BOOST_FORCEINLINE void static_generate (P1 &dst, Op op)
         
        BOOST_FORCEINLINE void static_generate (P1 &dst, Op op)
         

        Detailed Description

        Equivalent to std::generate.

        @@ -73,7 +73,7 @@ template<typename P1 , typename Op >
        - @@ -64,15 +64,15 @@ Classes

        Detailed Description

        Types for homogeneous color bases.

        element_type, element_reference_type, element_const_reference_type: Support for homogeneous color bases

        -

        Example:

        using element_t = element_type<rgb8c_planar_ptr_t>::type;
        -
        static_assert(std::is_same<element_t, const uint8_t*>::value, "");
        +

        Example:

        using element_t = element_type<rgb8c_planar_ptr_t>::type;
        +
        static_assert(std::is_same<element_t, const uint8_t*>::value, "");
        diff --git a/html/reference/group___color_base_algorithm_min_max.html b/html/reference/group___color_base_algorithm_min_max.html index e49207e46..d5c321a3a 100644 --- a/html/reference/group___color_base_algorithm_min_max.html +++ b/html/reference/group___color_base_algorithm_min_max.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_min, static_max @@ -27,46 +27,46 @@
        - + +/* @license-end */ +
        -
        -
        +

        Equivalents to std::min_element and std::max_element for homogeneous color bases. More...

        +

        Classes

        struct  element_type< ColorBase >
         Specifies the element type of a homogeneous color base. More...
        - - - - - + + - - - + + - - - + + - - + +

        +

        Functions

        +
        template<typename P >
        BOOST_FORCEINLINE auto static_max (P const &p) -> typename element_const_reference_type< P >::type
         
        +
        BOOST_FORCEINLINE auto static_max (P const &p) -> typename element_const_reference_type< P >::type
         
        template<typename P >
        BOOST_FORCEINLINE auto static_max (P &p) -> typename element_reference_type< P >::type
         
        +
        BOOST_FORCEINLINE auto static_max (P &p) -> typename element_reference_type< P >::type
         
        template<typename P >
        BOOST_FORCEINLINE auto static_min (P const &p) -> typename element_const_reference_type< P >::type
         
        +
        BOOST_FORCEINLINE auto static_min (P const &p) -> typename element_const_reference_type< P >::type
         
        template<typename P >
        BOOST_FORCEINLINE auto static_min (P &p) -> typename element_reference_type< P >::type
         
        BOOST_FORCEINLINE auto static_min (P &p) -> typename element_reference_type< P >::type
         

        Detailed Description

        Equivalents to std::min_element and std::max_element for homogeneous color bases.

        @@ -80,7 +80,7 @@ template<typename P > diff --git a/html/reference/group___color_base_algorithm_semantic_at_c.html b/html/reference/group___color_base_algorithm_semantic_at_c.html index 20f89ecb9..c7f63ea41 100644 --- a/html/reference/group___color_base_algorithm_semantic_at_c.html +++ b/html/reference/group___color_base_algorithm_semantic_at_c.html @@ -4,7 +4,7 @@ - + Generic Image Library: kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c @@ -27,30 +27,30 @@

        - + +/* @license-end */ +
        -
        -
        kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c
        +
        kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c

        semantic_at_c: Semantic channel accessors More...

        - @@ -62,16 +62,16 @@ Classes

        +

        Classes

        struct  kth_semantic_element_type< ColorBase, K >
         Specifies the type of the K-th semantic element of a color base. More...
         Specifies the return type of the constant semantic_at_c<K>(color_base);. More...
         
        - - - + - - +

        +

        Functions

        +
        template<int K, typename ColorBase >
        auto semantic_at_c (ColorBase &p) -> typename std::enable_if< !std::is_const< ColorBase >::value, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type
        auto semantic_at_c (ColorBase &p) -> typename std::enable_if< !std::is_const< ColorBase >::value, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type
         A mutable accessor to the K-th semantic element of a color base.
         
        +
        template<int K, typename ColorBase >
        auto semantic_at_c (ColorBase const &p) -> typename kth_semantic_element_const_reference_type< ColorBase, K >::type
        auto semantic_at_c (ColorBase const &p) -> typename kth_semantic_element_const_reference_type< ColorBase, K >::type
         A constant accessor to the K-th semantic element of a color base.
         
        @@ -80,10 +80,10 @@ template<int K, typename ColorBase >

        Support for accessing the elements of a color base by semantic index

        The semantic index of an element is the index of its color in the color space. Semantic indexing allows for proper pairing of elements of color bases independent on their layout. For example, red is the first semantic element of a color base regardless of whether it has an RGB layout or a BGR layout. All GIL color base algorithms taking multiple color bases use semantic indexing to access their elements.

        Example:

        // 16-bit BGR pixel, 4 bits for the blue, 3 bits for the green, 2 bits for the red channel and 7 unused bits
        -
        using bgr432_pixel_t = packed_pixel_type<uint16_t, mp11::mp_list_c<unsigned,4,3,2>, bgr_layout_t>::type;
        +
        using bgr432_pixel_t = packed_pixel_type<uint16_t, mp11::mp_list_c<unsigned,4,3,2>, bgr_layout_t>::type;
        // A reference to its red channel. Although the red channel is the third, its semantic index is 0 in the RGB color space
        -
        using red_channel_reference_t = kth_semantic_element_reference_type<bgr432_pixel_t, 0>::type;
        +
        using red_channel_reference_t = kth_semantic_element_reference_type<bgr432_pixel_t, 0>::type;
        // Initialize the pixel to black
        bgr432_pixel_t red_pixel(0,0,0);
        @@ -97,7 +97,7 @@ template<int K, typename ColorBase > diff --git a/html/reference/group___color_base_algorithm_size.html b/html/reference/group___color_base_algorithm_size.html index 069dbdd1a..bdff6310a 100644 --- a/html/reference/group___color_base_algorithm_size.html +++ b/html/reference/group___color_base_algorithm_size.html @@ -4,7 +4,7 @@ - + Generic Image Library: size @@ -27,29 +27,29 @@

        - + +/* @license-end */ +

        size: Semantic channel size More...

        - @@ -58,15 +58,15 @@ Classes

        Detailed Description

        size: Semantic channel size

        Returns an integral constant type specifying the number of elements in a color base

        -

        Example:

        static_assert(size<rgb8_pixel_t>::value == 3, "");
        -
        static_assert(size<cmyk8_planar_ptr_t>::value == 4, "");
        +

        Example:

        static_assert(size<rgb8_pixel_t>::value == 3, "");
        +
        static_assert(size<cmyk8_planar_ptr_t>::value == 4, "");
        diff --git a/html/reference/group___color_base_algorithm_transform.html b/html/reference/group___color_base_algorithm_transform.html index e3a5e7d0f..af6c018f2 100644 --- a/html/reference/group___color_base_algorithm_transform.html +++ b/html/reference/group___color_base_algorithm_transform.html @@ -4,7 +4,7 @@ - + Generic Image Library: static_transform @@ -27,54 +27,54 @@
        - + +/* @license-end */ +

        Equivalent to std::transform. Pairs the elements semantically. More...

        +

        Classes

        struct  size< ColorBase >
         Returns an integral constant type specifying the number of elements in a color base. More...
        - - - - - + + - - - + + - - - + + - - - + + - - - + + - - + +

        +

        Functions

        +
        template<typename Src , typename Dst , typename Op >
        BOOST_FORCEINLINE Op static_transform (Src &src, Dst &dst, Op op)
         
        +
        BOOST_FORCEINLINE Op static_transform (Src &src, Dst &dst, Op op)
         
        template<typename Src , typename Dst , typename Op >
        BOOST_FORCEINLINE Op static_transform (const Src &src, Dst &dst, Op op)
         
        +
        BOOST_FORCEINLINE Op static_transform (const Src &src, Dst &dst, Op op)
         
        template<typename P2 , typename P3 , typename Dst , typename Op >
        BOOST_FORCEINLINE Op static_transform (P2 &p2, P3 &p3, Dst &dst, Op op)
         
        +
        BOOST_FORCEINLINE Op static_transform (P2 &p2, P3 &p3, Dst &dst, Op op)
         
        template<typename P2 , typename P3 , typename Dst , typename Op >
        BOOST_FORCEINLINE Op static_transform (P2 &p2, const P3 &p3, Dst &dst, Op op)
         
        +
        BOOST_FORCEINLINE Op static_transform (P2 &p2, const P3 &p3, Dst &dst, Op op)
         
        template<typename P2 , typename P3 , typename Dst , typename Op >
        BOOST_FORCEINLINE Op static_transform (const P2 &p2, P3 &p3, Dst &dst, Op op)
         
        +
        BOOST_FORCEINLINE Op static_transform (const P2 &p2, P3 &p3, Dst &dst, Op op)
         
        template<typename P2 , typename P3 , typename Dst , typename Op >
        BOOST_FORCEINLINE Op static_transform (const P2 &p2, const P3 &p3, Dst &dst, Op op)
         
        BOOST_FORCEINLINE Op static_transform (const P2 &p2, const P3 &p3, Dst &dst, Op op)
         

        Detailed Description

        Equivalent to std::transform. Pairs the elements semantically.

        @@ -86,7 +86,7 @@ template<typename P2 , typename P3 , typename Dst , typename Op >
        template <typename Pixel1, typename Pixel2, typename Pixel3>
        void sum_channels(const Pixel1& p1, const Pixel2& p2, Pixel3& result) {
        -
        using result_channel_t = typename channel_type<Pixel3>::type;
        +
        using result_channel_t = typename channel_type<Pixel3>::type;
        static_transform(p1,p2,result,my_plus<result_channel_t>());
        }
        @@ -101,7 +101,7 @@ template<typename P2 , typename P3 , typename Dst , typename Op > diff --git a/html/reference/group___color_base_concept.html b/html/reference/group___color_base_concept.html index 0ea399e6b..e00b28de1 100644 --- a/html/reference/group___color_base_concept.html +++ b/html/reference/group___color_base_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,29 +27,29 @@

        - + +/* @license-end */ +
        -
        -
        Concepts
        +
        Concepts

        ColorBase concepts. More...

        - @@ -81,7 +81,7 @@ Classes diff --git a/html/reference/group___color_base_model.html b/html/reference/group___color_base_model.html index 5558a34b9..cdf85fe40 100644 --- a/html/reference/group___color_base_model.html +++ b/html/reference/group___color_base_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,46 +27,46 @@
        - + +/* @license-end */ +
        -
        -
        Models
        +
        Models

        ColorBase models. More...

        +

        Classes

        struct  ColorBaseConcept< ColorBase >
         A color base is a container of color elements (such as channels, channel references or channel pointers). More...
        - - + - + - + - + - + - +

        +

        Modules

         bit_aligned_pixel_reference
         bit_aligned_pixel_reference
         A heterogeneous color base representing pixel that may not be byte aligned, i.e. it may correspond to a bit range that does not start/end at a byte boundary. Models ColorBaseConcept.
         
         detail::homogeneous_color_base
         detail::homogeneous_color_base
         A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept If the element type models Regular, this class models HomogeneousColorBaseValueConcept.
         
         packed_pixel
         packed_pixel
         A heterogeneous color base whose elements are reference proxies to channels in a pixel. Models ColorBaseValueConcept. This class is used to model packed pixels, such as 16-bit packed RGB.
         
         pixel
         pixel
         A homogeneous color base whose element is a channel value. Models HomogeneousColorBaseValueConcept.
         
         planar_pixel_iterator
         planar_pixel_iterator
         A homogeneous color base whose element is a channel iterator. Models HomogeneousColorBaseValueConcept This class is used as an iterator to a planar pixel.
         
         planar_pixel_reference
         planar_pixel_reference
         A homogeneous color base whose element is a channel reference. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept. This class is used as a reference proxy to a planar pixel.
         
        @@ -78,7 +78,7 @@ Modules diff --git a/html/reference/group___color_base_model_homogeneous.html b/html/reference/group___color_base_model_homogeneous.html index 835ee3593..c7c725043 100644 --- a/html/reference/group___color_base_model_homogeneous.html +++ b/html/reference/group___color_base_model_homogeneous.html @@ -4,7 +4,7 @@ - + Generic Image Library: detail::homogeneous_color_base @@ -27,30 +27,30 @@

        - + +/* @license-end */ +
        -
        -
        detail::homogeneous_color_base
        +
        detail::homogeneous_color_base

        A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept If the element type models Regular, this class models HomogeneousColorBaseValueConcept. More...

        - @@ -68,16 +68,16 @@ Classes

        +

        Classes

        struct  homogeneous_color_base< Element, Layout, 1 >
         A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
         A homogeneous color base holding five color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept. More...
         
        - - - + - - +

        +

        Functions

        +
        template<int K, typename E , typename L , int N>
        auto at_c (detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
        auto at_c (detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
         Provides mutable access to the K-th element, in physical order.
         
        +
        template<int K, typename E , typename L , int N>
        auto at_c (const detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< typename std::add_const< E >::type >::type
        auto at_c (const detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< typename std::add_const< E >::type >::type
         Provides constant access to the K-th element, in physical order.
         
        @@ -89,7 +89,7 @@ template<int K, typename E , typename L , int N> diff --git a/html/reference/group___color_base_model_non_aligned_pixel.html b/html/reference/group___color_base_model_non_aligned_pixel.html index b837511cd..2a422e0e3 100644 --- a/html/reference/group___color_base_model_non_aligned_pixel.html +++ b/html/reference/group___color_base_model_non_aligned_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_reference @@ -27,31 +27,31 @@

        - + +/* @license-end */ +
        -
        -
        bit_aligned_pixel_reference
        +
        bit_aligned_pixel_reference

        A heterogeneous color base representing pixel that may not be byte aligned, i.e. it may correspond to a bit range that does not start/end at a byte boundary. Models ColorBaseConcept. More...

        - - +

        +

        Modules

         bit_aligned_pixel_reference
         bit_aligned_pixel_reference
         A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
         
        @@ -63,7 +63,7 @@ Modules diff --git a/html/reference/group___color_base_model_packed_pixel.html b/html/reference/group___color_base_model_packed_pixel.html index 7708a8873..180d7ac1f 100644 --- a/html/reference/group___color_base_model_packed_pixel.html +++ b/html/reference/group___color_base_model_packed_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_pixel @@ -27,29 +27,29 @@

        - + +/* @license-end */ +
        -
        -
        packed_pixel
        +
        packed_pixel

        A heterogeneous color base whose elements are reference proxies to channels in a pixel. Models ColorBaseValueConcept. This class is used to model packed pixels, such as 16-bit packed RGB. More...

        - @@ -64,7 +64,7 @@ Classes diff --git a/html/reference/group___color_base_model_pixel.html b/html/reference/group___color_base_model_pixel.html index fe3df9dd0..91744b368 100644 --- a/html/reference/group___color_base_model_pixel.html +++ b/html/reference/group___color_base_model_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        +

        A homogeneous color base whose element is a channel value. Models HomogeneousColorBaseValueConcept. More...

        +

        Classes

        struct  packed_pixel< BitField, ChannelRefs, Layout >
         Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and their index. Models ColorBaseValueConcept, PixelValueConcept, PixelBasedConcept Typical use for this is a model of a packed pixel (like 565 RGB) More...
        - @@ -63,7 +63,7 @@ Classes diff --git a/html/reference/group___color_base_model_planar_ptr.html b/html/reference/group___color_base_model_planar_ptr.html index 3a4a1f3aa..7b75c6cb1 100644 --- a/html/reference/group___color_base_model_planar_ptr.html +++ b/html/reference/group___color_base_model_planar_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_iterator @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        planar_pixel_iterator
        +
        planar_pixel_iterator

        A homogeneous color base whose element is a channel iterator. Models HomogeneousColorBaseValueConcept This class is used as an iterator to a planar pixel. More...

        +

        Classes

        struct  pixel< ChannelValue, Layout >
         Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
        - @@ -63,7 +63,7 @@ Classes diff --git a/html/reference/group___color_base_model_planar_ref.html b/html/reference/group___color_base_model_planar_ref.html index 4ce26af8c..a72cca8b6 100644 --- a/html/reference/group___color_base_model_planar_ref.html +++ b/html/reference/group___color_base_model_planar_ref.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_reference @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        planar_pixel_reference
        +
        planar_pixel_reference

        A homogeneous color base whose element is a channel reference. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept. This class is used as a reference proxy to a planar pixel. More...

        +

        Classes

        struct  planar_pixel_iterator< ChannelPtr, ColorSpace >
         An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
        - @@ -63,7 +63,7 @@ Classes diff --git a/html/reference/group___color_convert.html b/html/reference/group___color_convert.html index 134f8c8a5..33fdc443d 100644 --- a/html/reference/group___color_convert.html +++ b/html/reference/group___color_convert.html @@ -4,9 +4,9 @@ - + - Generic Image Library: Color Space Converion + Generic Image Library: Color Space Conversion @@ -27,35 +27,35 @@
        - + +/* @license-end */ +
        -
        -
        Color Space Converion
        +
        Color Space Conversion

        Support for conversion between pixels of different color spaces and channel depths. More...

        +

        Classes

        struct  planar_pixel_reference< ChannelReference, ColorSpace >
         A reference proxy to a planar pixel. More...
        - - + - + @@ -96,7 +96,7 @@ Classes diff --git a/html/reference/group___color_name_model.html b/html/reference/group___color_name_model.html index 5bf4a65ee..32fe64a1d 100644 --- a/html/reference/group___color_name_model.html +++ b/html/reference/group___color_name_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Color Names @@ -27,26 +27,26 @@
        - + +/* @license-end */ +

        +

        Classes

        struct  default_color_converter_impl< C1, C2 >
         Color Convertion function object. To be specialized for every src/dst color space. More...
         Color Conversion function object. To be specialized for every src/dst color space. More...
         
        struct  default_color_converter_impl< C, C >
         When the color space is the same, color convertion performs channel depth conversion. More...
         When the color space is the same, color conversion performs channel depth conversion. More...
         
        struct  default_color_converter_impl< gray_t, rgb_t >
         Gray to RGB. More...
        - @@ -86,7 +86,7 @@ Classes diff --git a/html/reference/group___color_space_and_layout.html b/html/reference/group___color_space_and_layout.html index 18859e622..ba2d34cfa 100644 --- a/html/reference/group___color_space_and_layout.html +++ b/html/reference/group___color_space_and_layout.html @@ -4,7 +4,7 @@ - + Generic Image Library: Color, Color Space, and Layout @@ -27,33 +27,33 @@
        - + +/* @license-end */ +
        -
        -
        Color, Color Space, and Layout
        +
        Color, Color Space, and Layout

        The color space and the layout define the set, ordering and interpretation of channels in a pixel. More...

        +

        Classes

        struct  cyan_t
         Cyan. More...
        - - + - +

        +

        Modules

         Concepts
         Concepts
         
         Models
         Models
         

        Detailed Description

        @@ -64,7 +64,7 @@ Modules diff --git a/html/reference/group___color_space_and_layout_concept.html b/html/reference/group___color_space_and_layout_concept.html index 2fb6b367b..16c46bd39 100644 --- a/html/reference/group___color_space_and_layout_concept.html +++ b/html/reference/group___color_space_and_layout_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,26 +27,26 @@

        - + +/* @license-end */ +
        - @@ -65,7 +65,7 @@ Classes diff --git a/html/reference/group___color_space_and_layout_model.html b/html/reference/group___color_space_and_layout_model.html index 4325af64b..24507e022 100644 --- a/html/reference/group___color_space_and_layout_model.html +++ b/html/reference/group___color_space_and_layout_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,36 +27,36 @@
        - + +/* @license-end */ +

        +

        Classes

        struct  ColorSpaceConcept< CS >
         Color space type concept. More...
        - - + - + - +

        +

        Modules

         Color Names
         Color Names
         
         Color Spaces
         Color Spaces
         
         Layouts
         Layouts
         
        - @@ -69,7 +69,7 @@ Classes diff --git a/html/reference/group___color_space_model.html b/html/reference/group___color_space_model.html index f745d1d37..5760a18e5 100644 --- a/html/reference/group___color_space_model.html +++ b/html/reference/group___color_space_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Color Spaces @@ -27,44 +27,44 @@
        - + +/* @license-end */ +

        +

        Classes

        struct  layout< ColorSpace, ChannelMapping >
         Represents a color space and ordering of channels in memory. More...
        -

        +

        Classes

        struct  devicen_t< N >
         Unnamed color space of 1, 2, 3, 4, or 5 channels. More...
         
        - - - - -

        +

        Typedefs

        +
        using cmyk_t = mp11::mp_list< cyan_t, magenta_t, yellow_t, black_t >
         
        +
        using gray_t = mp11::mp_list< gray_color_t >
         
        +
        using rgb_t = mp11::mp_list< red_t, green_t, blue_t >
         
        +
        using rgba_t = mp11::mp_list< red_t, green_t, blue_t, alpha_t >
         
        @@ -75,7 +75,7 @@ using rgba_t = mp11::m diff --git a/html/reference/group___corner_detection_algorithms.html b/html/reference/group___corner_detection_algorithms.html index 67038ade0..182a85822 100644 --- a/html/reference/group___corner_detection_algorithms.html +++ b/html/reference/group___corner_detection_algorithms.html @@ -4,7 +4,7 @@ - + Generic Image Library: CornerDetectionAlgorithms @@ -27,47 +27,49 @@

        - + +/* @license-end */ +
        -
        -
        CornerDetectionAlgorithms
        +
        CornerDetectionAlgorithms

        Algorithms that are used to find corners in an image. More...

        - - - - - + + + +

        +

        Functions

        template<typename T , typename Allocator >
        void compute_harris_responses (boost::gil::gray32f_view_t m11, boost::gil::gray32f_view_t m12_21, boost::gil::gray32f_view_t m22, boost::gil::detail::kernel_2d< T, Allocator > weights, float k, boost::gil::gray32f_view_t harris_response)
         function to record Harris responses More...
         
        template<typename T , typename Allocator >
        void compute_harris_responses (boost::gil::gray32f_view_t m11, boost::gil::gray32f_view_t m12_21, boost::gil::gray32f_view_t m22, boost::gil::detail::kernel_2d< T, Allocator > weights, float k, boost::gil::gray32f_view_t harris_response)
         function to record Harris responses
         

        Detailed Description

        Algorithms that are used to find corners in an image.

        These algorithms are used to find spots from which sliding the window will produce large intensity change

        Function Documentation

        - -

        ◆ compute_harris_responses()

        + +

        ◆ compute_harris_responses()

        +
        +template<typename T , typename Allocator >
        - + @@ -121,7 +123,7 @@ Functions diff --git a/html/reference/group___down_scaling_algorithms.html b/html/reference/group___down_scaling_algorithms.html index b01a4c909..ebb7a5150 100644 --- a/html/reference/group___down_scaling_algorithms.html +++ b/html/reference/group___down_scaling_algorithms.html @@ -4,7 +4,7 @@ - + Generic Image Library: DownScalingAlgorithms @@ -27,49 +27,51 @@
        - + +/* @license-end */ +
        -
        -
        DownScalingAlgorithms
        +
        DownScalingAlgorithms
        -

        Algorthims suitable for downscaling. +

        Algorithms suitable for downscaling. More...

        void boost::gil::compute_harris_responses void compute_harris_responses ( boost::gil::gray32f_view_t  m11,
        - - - - - + + + +

        +

        Functions

        template<typename ImageView >
        void scale_lanczos (ImageView input_view, ImageView output_view, std::ptrdiff_t a)
         Complete Lanczos algorithm. More...
         
        template<typename ImageView >
        void scale_lanczos (ImageView input_view, ImageView output_view, std::ptrdiff_t a)
         Complete Lanczos algorithm.
         

        Detailed Description

        -

        Algorthims suitable for downscaling.

        +

        Algorithms suitable for downscaling.

        These algorithms provide best results when used for downscaling. Using for upscaling will probably provide less than good results.

        a single step of lanczos downscaling

        Use this algorithm to scale down source image into a smaller image with reasonable quality. Do note that having a look at the output once is a good idea, since it might have ringing artifacts.

        Function Documentation

        - -

        ◆ scale_lanczos()

        + +

        ◆ scale_lanczos()

        +
        +template<typename ImageView >
        - + @@ -105,7 +107,7 @@ Functions diff --git a/html/reference/group___g_i_l_is_basic.html b/html/reference/group___g_i_l_is_basic.html index 0d81f0e0a..75cdee484 100644 --- a/html/reference/group___g_i_l_is_basic.html +++ b/html/reference/group___g_i_l_is_basic.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_is_basic @@ -27,29 +27,29 @@
        - + +/* @license-end */ +

        Determines if GIL constructs are basic. Basic constructs are the ones that can be generated with the type factory methods pixel_reference_type, iterator_type, locator_type, view_type and image_type They can be mutable/immutable, planar/interleaved, step/nonstep. They must use GIL-provided models. More...

        void boost::gil::scale_lanczos void scale_lanczos ( ImageView  input_view,
        - @@ -76,7 +76,7 @@ Classes diff --git a/html/reference/group___g_i_l_is_mutable.html b/html/reference/group___g_i_l_is_mutable.html index ac1007919..f49fce16d 100644 --- a/html/reference/group___g_i_l_is_mutable.html +++ b/html/reference/group___g_i_l_is_mutable.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_is_mutable @@ -27,29 +27,29 @@
        - + +/* @license-end */ +

        Determines if the given pixel reference/iterator/locator/view is mutable (i.e. its pixels can be changed) More...

        +

        Classes

        struct  pixel_reference_is_basic< PixelRef >
         Determines if a given pixel reference is basic Basic references must use gil::pixel& (if interleaved), gil::planar_pixel_reference (if planar). They must use the standard constness rules. More...
        - @@ -72,7 +72,7 @@ Classes diff --git a/html/reference/group___g_i_l_is_step.html b/html/reference/group___g_i_l_is_step.html index 00c9af3c7..f8481016e 100644 --- a/html/reference/group___g_i_l_is_step.html +++ b/html/reference/group___g_i_l_is_step.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_is_step @@ -27,29 +27,29 @@
        - + +/* @license-end */ +

        Determines if the given iterator/locator/view has a step that could be set dynamically. More...

        +

        Classes

        struct  pixel_reference_is_mutable< R >
         Determines if the given pixel reference is mutable (i.e. its channels can be changed) More...
        - @@ -75,7 +75,7 @@ Classes diff --git a/html/reference/group___h_e.html b/html/reference/group___h_e.html index 9324ce9b7..603adfeb8 100644 --- a/html/reference/group___h_e.html +++ b/html/reference/group___h_e.html @@ -4,7 +4,7 @@ - + Generic Image Library: HE @@ -27,20 +27,20 @@
        - + +/* @license-end */ +
        -
        -
        HE
        +
        HE
        @@ -48,14 +48,14 @@ $(function() {

        Histogram Equalization(HE)

        Contains implementation and description of the algorithm used to compute global histogram equalization of input images.

        -

        Algorithm :- 1. If histogram A is to be equalized compute the cumulative histogram of A. 2. Let CFD(A) refer to the cumulative histogram of A 3. For a uniform histogram A', CDF(A') = A' 4. We need to transfrom A to A' such that 5. CDF(A') = CDF(A) => A' = CDF(A) 6. Hence the pixel transform , px => histogram_of_ith_channel[px].

        +

        Algorithm :- 1. If histogram A is to be equalized compute the cumulative histogram of A. 2. Let CFD(A) refer to the cumulative histogram of A 3. For a uniform histogram A', CDF(A') = A' 4. We need to transform A to A' such that 5. CDF(A') = CDF(A) => A' = CDF(A) 6. Hence the pixel transform , px => histogram_of_ith_channel[px].

        diff --git a/html/reference/group___h_m.html b/html/reference/group___h_m.html index ddfa09c72..e3ca345aa 100644 --- a/html/reference/group___h_m.html +++ b/html/reference/group___h_m.html @@ -4,7 +4,7 @@ - + Generic Image Library: HM @@ -27,20 +27,20 @@
        - + +/* @license-end */ +
        -
        -
        HM
        +
        HM
        @@ -48,14 +48,14 @@ $(function() {

        Histogram Matching(HM)

        Contains implementation and description of the algorithm used to compute global histogram matching of input images.

        -

        Algorithm :- 1. Calculate histogram A(pixel) of input image and G(pixel) of reference image. 2. Compute the normalized cumulative(CDF) histograms of A and G. 3. Match the histograms using transofrmation => CDF(A(px)) = CDF(G(px')) => px' = Inv-CDF (CDF(px))

        +

        Algorithm :- 1. Calculate histogram A(pixel) of input image and G(pixel) of reference image. 2. Compute the normalized cumulative(CDF) histograms of A and G. 3. Match the histograms using transformation => CDF(A(px)) = CDF(G(px')) => px' = Inv-CDF (CDF(px))

        diff --git a/html/reference/group___histogram-_helpers.html b/html/reference/group___histogram-_helpers.html index eb890503d..a103e0d3d 100644 --- a/html/reference/group___histogram-_helpers.html +++ b/html/reference/group___histogram-_helpers.html @@ -4,7 +4,7 @@ - + Generic Image Library: Histogram-Helpers @@ -27,30 +27,30 @@
        - + +/* @license-end */ +
        -
        -
        Histogram-Helpers
        +
        Histogram-Helpers

        Helper implementations supporting the histogram class. More...

        +

        Classes

        struct  iterator_is_step< I >
         Determines if the given iterator has a step that could be set dynamically. More...
        - @@ -65,39 +65,41 @@ Classes

        +

        Classes

        struct  hash_tuple< T >
         Functor provided for the hashing of tuples. The following approach makes use hash_combine from boost::container_hash. Although there is a direct hashing available for tuples, this approach will ease adopting in future to a std::hash_combine. In case std::hash extends support to tuples this functor as well as the helper implementation hash_tuple_impl can be removed. More...
         Specialisation for 1D histogram. More...
         
        - - - - - - - - - + + + + + + - - - + + - - - + + +

        +

        Functions

        +
        template<std::size_t Index, typename... T>
        auto hash_tuple_impl (std::size_t &, std::tuple< T... > const &) -> typename std::enable_if< Index==sizeof...(T), void >::type
         
        template<typename Pixel , std::size_t... I>
        auto pixel_to_tuple (Pixel const &p, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(p[I]...))
         
        template<typename Tuple , std::size_t... I>
        auto tuple_to_tuple (Tuple const &t, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(std::get< I >(t)...))
         
        +
        template<typename Pixel , std::size_t... I>
        auto pixel_to_tuple (Pixel const &p, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(p[I]...))
         
        template<typename Tuple , std::size_t... I>
        auto tuple_to_tuple (Tuple const &t, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(std::get< I >(t)...))
         
        template<typename Tuple , std::size_t... I>
        bool tuple_compare (Tuple const &t1, Tuple const &t2, boost::mp11::index_sequence< I... >)
         
        +
        bool tuple_compare (Tuple const &t1, Tuple const &t2, boost::mp11::index_sequence< I... >)
         
        template<typename Tuple >
        bool tuple_compare (Tuple const &t1, Tuple const &t2)
         Compares 2 tuples and outputs t1 <= t2 Comparison is not in a lexicographic manner but on every element of the tuple hence (2, 2) > (1, 3) evaluates to false.
         
        bool tuple_compare (Tuple const &t1, Tuple const &t2)
         Compares 2 tuples and outputs t1 <= t2 Comparison is not in a lexicographic manner but on every element of the tuple hence (2, 2) > (1, 3) evaluates to false.
         

        Detailed Description

        Helper implementations supporting the histogram class.

        Function Documentation

        - -

        ◆ pixel_to_tuple()

        + +

        ◆ pixel_to_tuple()

        +
        +template<typename Pixel , std::size_t... I>
        - + @@ -120,14 +122,16 @@ template<typename Tuple > - -

        ◆ tuple_to_tuple()

        + +

        ◆ tuple_to_tuple()

        +
        +template<typename Tuple , std::size_t... I>
        auto boost::gil::detail::pixel_to_tuple auto pixel_to_tuple ( Pixel const &  p,
        - + @@ -156,7 +160,7 @@ template<typename Tuple > diff --git a/html/reference/group___histogram.html b/html/reference/group___histogram.html index 07792cc75..945c71d9a 100644 --- a/html/reference/group___histogram.html +++ b/html/reference/group___histogram.html @@ -4,7 +4,7 @@ - + Generic Image Library: Histogram @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        Histogram
        +
        Histogram

        Histogram. More...

        auto boost::gil::detail::tuple_to_tuple auto tuple_to_tuple ( Tuple const &  t,
        - @@ -64,7 +64,7 @@ Classes diff --git a/html/reference/group___i_o.html b/html/reference/group___i_o.html index c75c7f80c..99c3219f3 100644 --- a/html/reference/group___i_o.html +++ b/html/reference/group___i_o.html @@ -4,7 +4,7 @@ - + Generic Image Library: I/O @@ -27,102 +27,104 @@
        - + +/* @license-end */ +
        -
        -
        I/O
        +
        I/O

        Support for reading and writing images to file. More...

        +

        Classes

        class  histogram< T >
         Default histogram class provided by boost::gil. More...
        - - + - + - +

        +

        Modules

         JPEG I/O
         JPEG I/O
         Support for reading and writing JPEG image files.
         
         TIFF I/O
         TIFF I/O
         Support for reading and writing TIFF image files.
         
         PNG I/O
         PNG I/O
         Support for reading and writing PNG image files.
         
        - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - + + - - - + + - - - + + - - - + + - - - + + - - + +

        +

        Functions

        template<typename Reader , typename Image >
        void read_and_convert_image (Reader &reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
         Reads and color-converts an image. Image memory is allocated. More...
         
        template<typename Reader , typename View >
        void read_and_convert_view (Reader &reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
         Reads and color-converts an image view. No memory is allocated. More...
         
        template<typename Reader , typename Image >
        void read_image (Reader reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t >, is_read_supported< typename get_pixel_type< typename Image::view_t >::type, typename Reader::format_tag_t > >::value >::type *=nullptr)
         Reads an image without conversion. Image memory is allocated. More...
         
        template<typename Device , typename FormatTag >
        auto read_image_info (Device &file, image_read_settings< FormatTag > const &settings, typename std::enable_if< mp11::mp_and< detail::is_adaptable_input_device< FormatTag, Device >, is_format_tag< FormatTag > >::value >::type *=nullptr) -> typename get_reader_backend< Device, FormatTag >::type
         Returns the image format backend. Backend is format specific. More...
         
        template<typename Reader , typename View >
        void read_view (Reader reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, typename is_format_tag< typename Reader::format_tag_t >::type, typename is_read_supported< typename get_pixel_type< View >::type, typename Reader::format_tag_t >::type >::value >::type *=nullptr)
         Reads an image view without conversion. No memory is allocated. More...
         
        +
        template<typename Reader , typename Image >
        void read_and_convert_image (Reader &reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
         Reads and color-converts an image. Image memory is allocated.
         
        template<typename Reader , typename View >
        void read_and_convert_view (Reader &reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
         Reads and color-converts an image view. No memory is allocated.
         
        template<typename Reader , typename Image >
        void read_image (Reader reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t >, is_read_supported< typename get_pixel_type< typename Image::view_t >::type, typename Reader::format_tag_t > >::value >::type *=nullptr)
         Reads an image without conversion. Image memory is allocated.
         
        template<typename Device , typename FormatTag >
        auto read_image_info (Device &file, image_read_settings< FormatTag > const &settings, typename std::enable_if< mp11::mp_and< detail::is_adaptable_input_device< FormatTag, Device >, is_format_tag< FormatTag > >::value >::type *=nullptr) -> typename get_reader_backend< Device, FormatTag >::type
         Returns the image format backend. Backend is format specific.
         
        template<typename Reader , typename View >
        void read_view (Reader reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, typename is_format_tag< typename Reader::format_tag_t >::type, typename is_read_supported< typename get_pixel_type< View >::type, typename Reader::format_tag_t >::type >::value >::type *=nullptr)
         Reads an image view without conversion. No memory is allocated.
         
        template<typename Writer , typename View >
        void write_view (Writer &writer, View const &view, typename std::enable_if< mp11::mp_and< typename detail::is_writer< Writer >::type, typename is_format_tag< typename Writer::format_tag_t >::type, typename is_write_supported< typename get_pixel_type< View >::type, typename Writer::format_tag_t >::type >::value >::type *=nullptr)
         
        +
        void write_view (Writer &writer, View const &view, typename std::enable_if< mp11::mp_and< typename detail::is_writer< Writer >::type, typename is_format_tag< typename Writer::format_tag_t >::type, typename is_write_supported< typename get_pixel_type< View >::type, typename Writer::format_tag_t >::type >::value >::type *=nullptr)
         
        template<typename Device , typename View , typename FormatTag >
        void write_view (Device &device, View const &view, FormatTag const &tag, typename std::enable_if< mp11::mp_and< typename detail::is_write_device< FormatTag, Device >::type, typename is_format_tag< FormatTag >::type, typename is_write_supported< typename get_pixel_type< View >::type, FormatTag >::type >::value >::type *=nullptr)
         
        +
        void write_view (Device &device, View const &view, FormatTag const &tag, typename std::enable_if< mp11::mp_and< typename detail::is_write_device< FormatTag, Device >::type, typename is_format_tag< FormatTag >::type, typename is_write_supported< typename get_pixel_type< View >::type, FormatTag >::type >::value >::type *=nullptr)
         
        template<typename String , typename View , typename FormatTag >
        void write_view (String const &file_name, View const &view, FormatTag const &tag, typename std::enable_if< mp11::mp_and< typename detail::is_supported_path_spec< String >::type, typename is_format_tag< FormatTag >::type, typename is_write_supported< typename get_pixel_type< View >::type, FormatTag >::type >::value >::type *=nullptr)
         
        +
        void write_view (String const &file_name, View const &view, FormatTag const &tag, typename std::enable_if< mp11::mp_and< typename detail::is_supported_path_spec< String >::type, typename is_format_tag< FormatTag >::type, typename is_write_supported< typename get_pixel_type< View >::type, FormatTag >::type >::value >::type *=nullptr)
         
        template<typename Device , typename View , typename FormatTag , typename Log >
        void write_view (Device &device, View const &view, image_write_info< FormatTag, Log > const &info, typename std::enable_if< mp11::mp_and< typename detail::is_write_device< FormatTag, Device >::type, typename is_format_tag< FormatTag >::type, typename is_write_supported< typename get_pixel_type< View >::type, FormatTag >::type >::value >::type *=nullptr)
         
        +
        void write_view (Device &device, View const &view, image_write_info< FormatTag, Log > const &info, typename std::enable_if< mp11::mp_and< typename detail::is_write_device< FormatTag, Device >::type, typename is_format_tag< FormatTag >::type, typename is_write_supported< typename get_pixel_type< View >::type, FormatTag >::type >::value >::type *=nullptr)
         
        template<typename String , typename View , typename FormatTag , typename Log >
        void write_view (String const &file_name, View const &view, image_write_info< FormatTag, Log > const &info, typename std::enable_if< mp11::mp_and< typename detail::is_supported_path_spec< String >::type, typename is_format_tag< FormatTag >::type, typename is_write_supported< typename get_pixel_type< View >::type, FormatTag >::type >::value >::type *=nullptr)
         
        +
        void write_view (String const &file_name, View const &view, image_write_info< FormatTag, Log > const &info, typename std::enable_if< mp11::mp_and< typename detail::is_supported_path_spec< String >::type, typename is_format_tag< FormatTag >::type, typename is_write_supported< typename get_pixel_type< View >::type, FormatTag >::type >::value >::type *=nullptr)
         
        template<typename Device , typename ... Views, typename FormatTag , typename Log >
        void write_view (Device &device, any_image_view< Views... > const &views, image_write_info< FormatTag, Log > const &info, typename std::enable_if< mp11::mp_and< typename detail::is_write_device< FormatTag, Device >::type, typename is_format_tag< FormatTag >::type >::value >::type *=0)
         
        void write_view (Device &device, any_image_view< Views... > const &views, image_write_info< FormatTag, Log > const &info, typename std::enable_if< mp11::mp_and< typename detail::is_write_device< FormatTag, Device >::type, typename is_format_tag< FormatTag >::type >::value >::type *=0)
         

        Detailed Description

        Support for reading and writing images to file.

        Function Documentation

        - -

        ◆ read_and_convert_image()

        + +

        ◆ read_and_convert_image()

        +
        +template<typename Reader , typename Image >

        Normalized cardinal sine

        normalized_sinc(x) = sin(pi * x) / (pi * x)

        Function Documentation

        - -

        ◆ compute_hessian_entries()

        + +

        ◆ compute_hessian_entries()

        +
        +template<typename GradientView , typename OutputView >
        - + @@ -171,17 +173,19 @@ template<typename Device , typename ... Views, typename FormatTag , typename - -

        ◆ read_and_convert_view()

        + +

        ◆ read_and_convert_view()

        +
        +template<typename Reader , typename View >
        void boost::gil::read_and_convert_image void read_and_convert_image ( Reader &  reader,
        @@ -198,23 +198,25 @@ template<typename SrcView , typename DstView >

        TODO.

        - + @@ -230,17 +234,19 @@ template<typename Device , typename ... Views, typename FormatTag , typename - -

        ◆ read_image()

        + +

        ◆ read_image()

        +
        +template<typename Reader , typename Image >
        void boost::gil::read_and_convert_view void read_and_convert_view ( Reader &  reader,
        @@ -170,14 +170,14 @@ template<typename SrcView , typename DstView >

        Method of optimal threshold value calculation.

        - + @@ -287,17 +293,19 @@ template<typename Device , typename ... Views, typename FormatTag , typename - -

        ◆ read_image_info()

        + +

        ◆ read_image_info()

        +
        +template<typename Device , typename FormatTag >
        void boost::gil::read_image void read_image ( Reader  reader,
        @@ -140,16 +140,16 @@ template<typename SrcView , typename DstView >
        - + @@ -346,17 +354,19 @@ template<typename Device , typename ... Views, typename FormatTag , typename - -

        ◆ read_view()

        + +

        ◆ read_view()

        +
        +template<typename Reader , typename View >
        auto boost::gil::read_image_info auto read_image_info ( Device &  file,
        diff --git a/html/reference/group___image_concept.html b/html/reference/group___image_concept.html index f6ececc02..0c3dae4ee 100644 --- a/html/reference/group___image_concept.html +++ b/html/reference/group___image_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        Concepts
        +
        Concepts

        Image concepts. More...

        - + @@ -410,7 +420,7 @@ template<typename Device , typename ... Views, typename FormatTag , typename diff --git a/html/reference/group___image.html b/html/reference/group___image.html index 993639eb0..e98253ed5 100644 --- a/html/reference/group___image.html +++ b/html/reference/group___image.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image @@ -27,34 +27,34 @@
        - + +/* @license-end */ +
        -
        -
        Image
        +
        Image

        N-dimensional container. More...

        void boost::gil::read_view void read_view ( Reader  reader,
        - - + - +

        +

        Modules

         Concepts
         Concepts
         Image concepts.
         
         Models
         Models
         Image models.
         
        @@ -70,7 +70,7 @@ Modules
        - @@ -69,7 +69,7 @@ Classes diff --git a/html/reference/group___image_model.html b/html/reference/group___image_model.html index a9b10b378..994207c5b 100644 --- a/html/reference/group___image_model.html +++ b/html/reference/group___image_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        Models
        +
        Models

        Image models. More...

        +

        Classes

        struct  RandomAccessNDImageConcept< Image >
         N-dimensional container of values. More...
        - @@ -59,38 +59,40 @@ Classes

        +

        Classes

        class  image< Pixel, IsPlanar, Alloc >
         container interface over image view. Models ImageConcept, PixelBasedConcept More...
         
        - - - - - - - - - - - - - - + + + + + + + + + + + - - - + + +

        view, const_view

        Get an image view from a run-time instantiated image

        +

        Get an image view from a run-time instantiated image

        +
        template<typename Pixel , bool IsPlanar, typename Alloc >
        auto view (image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
         Returns the non-constant-pixel view of an image.
         
        template<typename ... Images>
        BOOST_FORCEINLINE auto view (any_image< Images... > &img) -> typename any_image< Images... >::view_t
         Returns the non-constant-pixel view of any image. The returned view is any view. More...
         
        template<typename ... Images>
        BOOST_FORCEINLINE auto const_view (any_image< Images... > const &img) -> typename any_image< Images... >::const_view_t
         Returns the constant-pixel view of any image. The returned view is any view. More...
         
        +
        auto view (image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
         Returns the non-constant-pixel view of an image.
         
        template<typename ... Images>
        BOOST_FORCEINLINE auto view (any_image< Images... > &img) -> typename any_image< Images... >::view_t
         Returns the non-constant-pixel view of any image. The returned view is any view.
         
        template<typename ... Images>
        BOOST_FORCEINLINE auto const_view (any_image< Images... > const &img) -> typename any_image< Images... >::const_view_t
         Returns the constant-pixel view of any image. The returned view is any view.
         
        template<typename Pixel , bool IsPlanar, typename Alloc >
        auto const_view (const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
         Returns the constant-pixel view of an image.
         
        auto const_view (const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
         Returns the constant-pixel view of an image.
         

        Detailed Description

        Image models.

        Function Documentation

        - -

        ◆ const_view()

        + +

        ◆ const_view()

        +
        +template<typename ... Images>
        - + @@ -110,14 +112,16 @@ template<typename Pixel , bool IsPlanar, typename Alloc > - -

        ◆ view()

        + +

        ◆ view()

        +
        +template<typename ... Images>
        BOOST_FORCEINLINE auto boost::gil::const_view BOOST_FORCEINLINE auto const_view ( any_image< Images... > const &  img)
        - + @@ -143,7 +147,7 @@ template<typename Pixel , bool IsPlanar, typename Alloc > diff --git a/html/reference/group___image_processing.html b/html/reference/group___image_processing.html index 5617fa195..144feaa7c 100644 --- a/html/reference/group___image_processing.html +++ b/html/reference/group___image_processing.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image Processing @@ -27,101 +27,101 @@
        - + +/* @license-end */ +
        -
        -
        Image Processing
        +
        Image Processing

        Image Processing algorithms. More...

        BOOST_FORCEINLINE auto boost::gil::view BOOST_FORCEINLINE auto view ( any_image< Images... > &  img)
        - - - - -

        +

        Enumerations

        enum class  threshold_direction { regular +
        enum class  threshold_direction { regular , inverse }
         
        enum class  threshold_optimal_value { otsu +
        enum class  threshold_optimal_value { otsu }
         Method of optimal threshold value calculation. More...
         
        enum class  threshold_truncate_mode { threshold +
        enum class  threshold_truncate_mode { threshold , zero }
         TODO. More...
         
        enum class  threshold_adaptive_method { mean +
        enum class  threshold_adaptive_method { mean , gaussian }
         
        - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - + + + - - - - + + + - - - + + - - - + + - - + +

        +

        Functions

        template<typename SrcView , typename DstView , typename Kernel >
        void morph_impl (SrcView const &src_view, DstView const &dst_view, Kernel const &kernel, morphological_operation identifier)
         Implements morphological operations at pixel level.This function compares neighbouring pixel values according to the kernel and choose minimum/mamximum neighbouring pixel value and assigns it to the pixel under consideration. More...
         
        template<typename SrcView , typename DstView , typename Kernel >
        void morph (SrcView const &src_view, DstView const &dst_view, Kernel const &ker_mat, morphological_operation identifier)
         Checks feasibility of the desired operation and passes parameter values to the function morph_impl alongwith individual channel views of the input image. More...
         
        template<typename SrcView , typename DiffView >
        void difference_impl (SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
         Calculates the difference between pixel values of first image_view and second image_view. More...
         
        template<typename SrcView , typename DiffView >
        void difference (SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
         Passes parameter values to the function 'difference_impl' alongwith individual channel views of input images. More...
         
        template<typename SrcView , typename DstView >
        void threshold_binary (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type threshold_value, typename channel_type< DstView >::type max_value, threshold_direction direction=threshold_direction::regular)
         Applies fixed threshold to each pixel of image view. Performs image binarization by thresholding channel value of each pixel of given image view. More...
         
        +
        template<typename SrcView , typename DstView , typename Kernel >
        void morph_impl (SrcView const &src_view, DstView const &dst_view, Kernel const &kernel, morphological_operation identifier)
         Implements morphological operations at pixel level.This function compares neighbouring pixel values according to the kernel and choose minimum/mamximum neighbouring pixel value and assigns it to the pixel under consideration.
         
        template<typename SrcView , typename DstView , typename Kernel >
        void morph (SrcView const &src_view, DstView const &dst_view, Kernel const &ker_mat, morphological_operation identifier)
         Checks feasibility of the desired operation and passes parameter values to the function morph_impl alongwith individual channel views of the input image.
         
        template<typename SrcView , typename DiffView >
        void difference_impl (SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
         Calculates the difference between pixel values of first image_view and second image_view.
         
        template<typename SrcView , typename DiffView >
        void difference (SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
         Passes parameter values to the function 'difference_impl' alongwith individual channel views of input images.
         
        template<typename SrcView , typename DstView >
        void threshold_binary (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type threshold_value, typename channel_type< DstView >::type max_value, threshold_direction direction=threshold_direction::regular)
         Applies fixed threshold to each pixel of image view. Performs image binarization by thresholding channel value of each pixel of given image view.
         
        template<typename SrcView , typename DstView >
        void threshold_binary (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type threshold_value, threshold_direction direction=threshold_direction::regular)
         Applies fixed threshold to each pixel of image view. Performs image binarization by thresholding channel value of each pixel of given image view. This variant of threshold_binary automatically deduces maximum value for each channel of pixel based on channel type. If direction is regular, values greater than threshold_value will be set to maximum numeric limit of channel else 0. If direction is inverse, values greater than threshold_value will be set to 0 else maximum numeric limit of channel.
         
        +
        void threshold_binary (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type threshold_value, threshold_direction direction=threshold_direction::regular)
         Applies fixed threshold to each pixel of image view. Performs image binarization by thresholding channel value of each pixel of given image view. This variant of threshold_binary automatically deduces maximum value for each channel of pixel based on channel type. If direction is regular, values greater than threshold_value will be set to maximum numeric limit of channel else 0. If direction is inverse, values greater than threshold_value will be set to 0 else maximum numeric limit of channel.
         
        template<typename SrcView , typename DstView >
        void threshold_truncate (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type threshold_value, threshold_truncate_mode mode=threshold_truncate_mode::threshold, threshold_direction direction=threshold_direction::regular)
         Applies truncating threshold to each pixel of image view. Takes an image view and performs truncating threshold operation on each chennel. If mode is threshold and direction is regular: values greater than threshold_value will be set to threshold_value else no change If mode is threshold and direction is inverse: values less than or equal to threshold_value will be set to threshold_value else no change If mode is zero and direction is regular: values less than or equal to threshold_value will be set to 0 else no change If mode is zero and direction is inverse: values more than threshold_value will be set to 0 else no change.
         
        +
        void threshold_truncate (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type threshold_value, threshold_truncate_mode mode=threshold_truncate_mode::threshold, threshold_direction direction=threshold_direction::regular)
         Applies truncating threshold to each pixel of image view. Takes an image view and performs truncating threshold operation on each channel. If mode is threshold and direction is regular: values greater than threshold_value will be set to threshold_value else no change If mode is threshold and direction is inverse: values less than or equal to threshold_value will be set to threshold_value else no change If mode is zero and direction is regular: values less than or equal to threshold_value will be set to 0 else no change If mode is zero and direction is inverse: values more than threshold_value will be set to 0 else no change.
         
        template<typename SrcView , typename DstView >
        void threshold_optimal (SrcView const &src_view, DstView const &dst_view, threshold_optimal_value mode=threshold_optimal_value::otsu, threshold_direction direction=threshold_direction::regular)
         
        +
        void threshold_optimal (SrcView const &src_view, DstView const &dst_view, threshold_optimal_value mode=threshold_optimal_value::otsu, threshold_direction direction=threshold_direction::regular)
         
        template<typename SrcView , typename DstView >
        void threshold_adaptive (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type max_value, std::size_t kernel_size, threshold_adaptive_method method=threshold_adaptive_method::mean, threshold_direction direction=threshold_direction::regular, typename channel_type< DstView >::type constant=0)
         
        +
        void threshold_adaptive (SrcView const &src_view, DstView const &dst_view, typename channel_type< DstView >::type max_value, std::size_t kernel_size, threshold_adaptive_method method=threshold_adaptive_method::mean, threshold_direction direction=threshold_direction::regular, typename channel_type< DstView >::type constant=0)
         
        template<typename SrcView , typename DstView >
        void threshold_adaptive (SrcView const &src_view, DstView const &dst_view, std::size_t kernel_size, threshold_adaptive_method method=threshold_adaptive_method::mean, threshold_direction direction=threshold_direction::regular, int constant=0)
         
        void threshold_adaptive (SrcView const &src_view, DstView const &dst_view, std::size_t kernel_size, threshold_adaptive_method method=threshold_adaptive_method::mean, threshold_direction direction=threshold_direction::regular, int constant=0)
         

        Detailed Description

        Image Processing algorithms.

        Direction of image segmentation. The direction specifies which pixels are considered as corresponding to object and which pixels correspond to background.

        Collection of image processing algorithms currently implemented by GIL.

        Enumeration Type Documentation

        - -

        ◆ threshold_direction

        + +

        ◆ threshold_direction

        @@ -130,7 +130,7 @@ template<typename SrcView , typename DstView >
        - +
        enum threshold_directionenum class threshold_direction
        - -
        Enumerator
        regular 

        Consider values greater than threshold value.

        +
        Enumerator
        regular 

        Consider values greater than threshold value.

        inverse 

        Consider values less than or equal to threshold value.

        +
        inverse 

        Consider values less than or equal to threshold value.

        - -

        ◆ threshold_optimal_value

        + +

        ◆ threshold_optimal_value

        @@ -158,7 +158,7 @@ template<typename SrcView , typename DstView >
        - +
        enum threshold_optimal_valueenum class threshold_optimal_value
        -
        Enumerator
        otsu 
        Todo:
        TODO
        +
        Enumerator
        otsu 
        Todo:
        TODO
        - -

        ◆ threshold_truncate_mode

        + +

        ◆ threshold_truncate_mode

        @@ -186,7 +186,7 @@ template<typename SrcView , typename DstView >
        - +
        enum threshold_truncate_modeenum class threshold_truncate_mode
        - -
        Enumerator
        threshold 
        Todo:
        TODO
        +
        Enumerator
        threshold 
        Todo:
        TODO
        zero 
        Todo:
        TODO
        +
        zero 
        Todo:
        TODO

        Function Documentation

        - -

        ◆ difference()

        + +

        ◆ difference()

        +
        +template<typename SrcView , typename DiffView >
        - + @@ -258,14 +260,16 @@ template<typename SrcView , typename DstView > - -

        ◆ difference_impl()

        + +

        ◆ difference_impl()

        +
        +template<typename SrcView , typename DiffView >
        void boost::gil::detail::difference void difference ( SrcView const &  src_view1,
        - + @@ -309,14 +313,16 @@ template<typename SrcView , typename DstView > - -

        ◆ morph()

        + +

        ◆ morph()

        +
        +template<typename SrcView , typename DstView , typename Kernel >
        void boost::gil::detail::difference_impl void difference_impl ( SrcView const &  src_view1,
        - + @@ -368,14 +374,16 @@ template<typename SrcView , typename DstView > - -

        ◆ morph_impl()

        + +

        ◆ morph_impl()

        +
        +template<typename SrcView , typename DstView , typename Kernel >
        void boost::gil::detail::morph void morph ( SrcView const &  src_view,
        - + @@ -427,14 +435,16 @@ template<typename SrcView , typename DstView > - -

        ◆ threshold_binary()

        + +

        ◆ threshold_binary()

        +
        +template<typename SrcView , typename DstView >
        void boost::gil::detail::morph_impl void morph_impl ( SrcView const &  src_view,
        - + @@ -491,7 +501,7 @@ template<typename SrcView , typename DstView > diff --git a/html/reference/group___image_processing_math.html b/html/reference/group___image_processing_math.html index 21fe37d16..c583584ce 100644 --- a/html/reference/group___image_processing_math.html +++ b/html/reference/group___image_processing_math.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageProcessingMath @@ -27,65 +27,65 @@
        - + +/* @license-end */ +
        -
        -
        ImageProcessingMath
        +
        ImageProcessingMath

        Math operations for IP algorithms. More...

        void boost::gil::threshold_binary void threshold_binary ( SrcView const &  src_view,
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

        +

        Functions

        double lanczos (double x, std::ptrdiff_t a)
         Lanczos response at point x. More...
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_normalized_mean (std::size_t side_length) -> detail::kernel_2d< T, Allocator >
         Generate mean kernel. More...
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_unnormalized_mean (std::size_t side_length) -> detail::kernel_2d< T, Allocator >
         Generate kernel with all 1s. More...
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_gaussian_kernel (std::size_t side_length, double sigma) -> detail::kernel_2d< T, Allocator >
         Generate Gaussian kernel. More...
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_dx_sobel (unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
         Generates Sobel operator in horizontal direction. More...
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_dx_scharr (unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
         Generate Scharr operator in horizontal direction. More...
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_dy_sobel (unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
         Generates Sobel operator in vertical direction. More...
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_dy_scharr (unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
         Generate Scharr operator in vertical direction. More...
         
        template<typename GradientView , typename OutputView >
        void compute_hessian_entries (GradientView dx, GradientView dy, OutputView ddxx, OutputView dxdy, OutputView ddyy)
         Compute xy gradient, and second order x and y gradients. More...
         
        double lanczos (double x, std::ptrdiff_t a)
         Lanczos response at point x.
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_normalized_mean (std::size_t side_length) -> detail::kernel_2d< T, Allocator >
         Generate mean kernel.
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_unnormalized_mean (std::size_t side_length) -> detail::kernel_2d< T, Allocator >
         Generate kernel with all 1s.
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_gaussian_kernel (std::size_t side_length, double sigma) -> detail::kernel_2d< T, Allocator >
         Generate Gaussian kernel.
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_dx_sobel (unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
         Generates Sobel operator in horizontal direction.
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_dx_scharr (unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
         Generate Scharr operator in horizontal direction.
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_dy_sobel (unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
         Generates Sobel operator in vertical direction.
         
        template<typename T = float, typename Allocator = std::allocator<T>>
        auto generate_dy_scharr (unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
         Generate Scharr operator in vertical direction.
         
        template<typename GradientView , typename OutputView >
        void compute_hessian_entries (GradientView dx, GradientView dy, OutputView ddxx, OutputView dxdy, OutputView ddyy)
         Compute xy gradient, and second order x and y gradients.
         

        Detailed Description

        Math operations for IP algorithms.

        @@ -93,17 +93,19 @@ Functions
        diff --git a/html/reference/group___image_view_s_t_l_algorithms_uninitialized_fill_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_uninitialized_fill_pixels.html index ec3174abe..c4dd9d4c9 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_uninitialized_fill_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_uninitialized_fill_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: uninitialized_fill_pixels @@ -27,35 +27,35 @@
        - + +/* @license-end */ +

        std::uninitialized_fill for image views More...

        - + @@ -150,17 +152,19 @@ Functions - -

        ◆ generate_dx_scharr()

        + +

        ◆ generate_dx_scharr()

        +
        +template<typename T = float, typename Allocator = std::allocator<T>>
        void boost::gil::compute_hessian_entries void compute_hessian_entries ( GradientView  dx,
        diff --git a/html/reference/group___image_view_s_t_l_algorithms_transform_pixel_positions.html b/html/reference/group___image_view_s_t_l_algorithms_transform_pixel_positions.html index 70ee8877a..305703480 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_transform_pixel_positions.html +++ b/html/reference/group___image_view_s_t_l_algorithms_transform_pixel_positions.html @@ -4,7 +4,7 @@ - + Generic Image Library: transform_pixel_positions @@ -27,40 +27,40 @@
        - + +/* @license-end */ +

        adobe::transform_positions for image views (passes locators, instead of pixel references, to the function object) More...

        - + @@ -180,17 +184,19 @@ Functions - -

        ◆ generate_dx_sobel()

        + +

        ◆ generate_dx_sobel()

        +
        +template<typename T = float, typename Allocator = std::allocator<T>>
        auto boost::gil::generate_dx_scharr auto generate_dx_scharr ( unsigned int  degree = 1)
        diff --git a/html/reference/group___image_view_s_t_l_algorithms_generate_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_generate_pixels.html index 3f884eaa9..2d7330ec7 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_generate_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_generate_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: generate_pixels @@ -27,35 +27,35 @@
        - + +/* @license-end */ +

        std::generate for image views More...

        - + @@ -210,17 +216,19 @@ Functions - -

        ◆ generate_dy_scharr()

        + +

        ◆ generate_dy_scharr()

        +
        +template<typename T = float, typename Allocator = std::allocator<T>>
        auto boost::gil::generate_dx_sobel auto generate_dx_sobel ( unsigned int  degree = 1)
        diff --git a/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel_position.html b/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel_position.html index a53399e39..f333cd2cd 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel_position.html +++ b/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel_position.html @@ -4,7 +4,7 @@ - + Generic Image Library: for_each_pixel_position @@ -27,34 +27,34 @@
        - + +/* @license-end */ +

        adobe::for_each_position for image views (passes locators, instead of pixel references, to the function object) More...

        - + @@ -240,17 +248,19 @@ Functions - -

        ◆ generate_dy_sobel()

        + +

        ◆ generate_dy_sobel()

        +
        +template<typename T = float, typename Allocator = std::allocator<T>>
        auto boost::gil::generate_dy_scharr auto generate_dy_scharr ( unsigned int  degree = 1)
        diff --git a/html/reference/group___image_view_s_t_l_algorithms_equal_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_equal_pixels.html index 3eabeedbb..9bef67437 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_equal_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_equal_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: equal_pixels @@ -27,56 +27,58 @@
        - + +/* @license-end */ +
        -

        std::equal for image views +

        std::equal for image views More...

        - + @@ -270,17 +280,19 @@ Functions - -

        ◆ generate_gaussian_kernel()

        + +

        ◆ generate_gaussian_kernel()

        +
        +template<typename T = float, typename Allocator = std::allocator<T>>
        auto boost::gil::generate_dy_sobel auto generate_dy_sobel ( unsigned int  degree = 1)
        diff --git a/html/reference/group___image_view_s_t_l_algorithms_destruct_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_destruct_pixels.html index 9b437ef7b..879e55c7a 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_destruct_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_destruct_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: destruct_pixels @@ -27,35 +27,35 @@
        - + +/* @license-end */ +

        invokes the destructor on every pixel of an image view More...

        - + @@ -310,17 +322,19 @@ Functions - -

        ◆ generate_normalized_mean()

        + +

        ◆ generate_normalized_mean()

        +
        +template<typename T = float, typename Allocator = std::allocator<T>>
        auto boost::gil::generate_gaussian_kernel auto generate_gaussian_kernel ( std::size_t  side_length,
        diff --git a/html/reference/group___image_view_model.html b/html/reference/group___image_view_model.html index 73d094b8b..bc92f6dbd 100644 --- a/html/reference/group___image_view_model.html +++ b/html/reference/group___image_view_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        +

        Image view models. More...

        - + @@ -340,17 +354,19 @@ Functions - -

        ◆ generate_unnormalized_mean()

        + +

        ◆ generate_unnormalized_mean()

        +
        +template<typename T = float, typename Allocator = std::allocator<T>>
        auto boost::gil::generate_normalized_mean auto generate_normalized_mean ( std::size_t  side_length)
        diff --git a/html/reference/group___image_view_concept.html b/html/reference/group___image_view_concept.html index 28f8c5957..30a9d11be 100644 --- a/html/reference/group___image_view_concept.html +++ b/html/reference/group___image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,42 +27,42 @@
        - + +/* @license-end */ +
        -
        -
        Concepts
        +
        Concepts

        Image view concepts. More...

        - + @@ -370,8 +386,8 @@ Functions - -

        ◆ lanczos()

        + +

        ◆ lanczos()

        @@ -380,7 +396,7 @@ Functions
        diff --git a/html/reference/group___image_view2_d_concept.html b/html/reference/group___image_view2_d_concept.html index a21d8f693..c6b62426c 100644 --- a/html/reference/group___image_view2_d_concept.html +++ b/html/reference/group___image_view2_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageView2DLocatorConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        ImageView2DLocatorConcept
        +
        ImageView2DLocatorConcept

        2-dimensional range More...

        auto boost::gil::generate_unnormalized_mean auto generate_unnormalized_mean ( std::size_t  side_length)
        - + @@ -415,7 +431,7 @@ Functions diff --git a/html/reference/group___image_view.html b/html/reference/group___image_view.html index 59a2d8295..ca28e56ad 100644 --- a/html/reference/group___image_view.html +++ b/html/reference/group___image_view.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image View @@ -27,37 +27,37 @@
        - + +/* @license-end */ +
        -
        -
        Image View
        +
        Image View

        N-dimensional range. More...

        double boost::gil::lanczos double lanczos ( double  x,
        - - + - + - +

        +

        Modules

         Concepts
         Concepts
         Image view concepts.
         
         Models
         Models
         Image view models.
         
         Algorithms and Utility Functions
         Algorithms and Utility Functions
         Image view algorithms, metafunctions and utility functions.
         
        @@ -69,7 +69,7 @@ Modules
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___image_view_algorithm.html b/html/reference/group___image_view_algorithm.html index d9f07104c..22ffe57a2 100644 --- a/html/reference/group___image_view_algorithm.html +++ b/html/reference/group___image_view_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,40 +27,40 @@
        - + +/* @license-end */ +
        -
        -
        Algorithms and Utility Functions
        +
        Algorithms and Utility Functions

        Image view algorithms, metafunctions and utility functions. More...

        +

        Classes

        struct  RandomAccess2DImageViewConcept< View >
         2-dimensional view over immutable values More...
        - - + - + - + - +

        +

        Modules

         STL-like Algorithms
         STL-like Algorithms
         Image view-equivalents of STL algorithms.
         
         Performance overloads of STL algorithms
         Performance overloads of STL algorithms
         overloads of STL algorithms allowing more efficient implementation when used with GIL constructs
         
         Image View From Raw Data
         Image View From Raw Data
         Methods for constructing image views from raw data and for getting raw data from views.
         
         Image View Transformations
         Image View Transformations
         Methods for constructing one image view from another.
         
        @@ -72,7 +72,7 @@ Modules
        - - + - + - +

        +

        Modules

         ImageViewNDLocatorConcept
         ImageViewNDLocatorConcept
         N-dimensional range.
         
         ImageView2DLocatorConcept
         ImageView2DLocatorConcept
         2-dimensional range
         
         ImageViewConcept
         ImageViewConcept
         2-dimensional range over pixel data
         
        - @@ -76,7 +76,7 @@ Classes diff --git a/html/reference/group___image_view_constructors.html b/html/reference/group___image_view_constructors.html index c9b764abe..1b84f80b6 100644 --- a/html/reference/group___image_view_constructors.html +++ b/html/reference/group___image_view_constructors.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image View From Raw Data @@ -27,85 +27,85 @@
        - + +/* @license-end */ +
        -
        -
        Image View From Raw Data
        +
        Image View From Raw Data

        Methods for constructing image views from raw data and for getting raw data from views. More...

        +

        Classes

        struct  ViewsCompatibleConcept< V1, V2 >
         Views are compatible if they have the same color spaces and compatible channel values. More...
        - - - - - - + + + - - - - + + + - - - - + + + - - - - + + + - - - - + + + - - - - + + + - - - - + + + - - - - + + + - - - - + + + - - - - + + + - - - + + +

        +

        Functions

        +
        template<typename IC >
        auto planar_cmyk_view (std::size_t width, std::size_t height, IC c, IC m, IC y, IC k, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, cmyk_t >>::view_t
         from raw CMYK planar data
         
        +
        auto planar_cmyk_view (std::size_t width, std::size_t height, IC c, IC m, IC y, IC k, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, cmyk_t > >::view_t
         from raw CMYK planar data
         
        template<typename IC >
        auto planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 2 >>>::view_t
         from 2-channel planar data
         
        +
        auto planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 2 > > >::view_t
         from 2-channel planar data
         
        template<typename IC >
        auto planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 3 >>>::view_t
         from 3-channel planar data
         
        +
        auto planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 3 > > >::view_t
         from 3-channel planar data
         
        template<typename IC >
        auto planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 4 >>>::view_t
         from 4-channel planar data
         
        +
        auto planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 4 > > >::view_t
         from 4-channel planar data
         
        template<typename IC >
        auto planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, IC c4, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 5 >>>::view_t
         from 5-channel planar data
         
        +
        auto planar_devicen_view (std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, IC c4, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 5 > > >::view_t
         from 5-channel planar data
         
        template<typename Iterator >
        auto interleaved_view (std::size_t width, std::size_t height, Iterator pixels, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< Iterator >::view_t
         Constructing image views from raw interleaved pixel data.
         
        +
        auto interleaved_view (std::size_t width, std::size_t height, Iterator pixels, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< Iterator >::view_t
         Constructing image views from raw interleaved pixel data.
         
        template<typename Iterator >
        auto interleaved_view (point< std::ptrdiff_t > dim, Iterator pixels, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< Iterator >::view_t
         Constructing image views from raw interleaved pixel data.
         
        +
        auto interleaved_view (point< std::ptrdiff_t > dim, Iterator pixels, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< Iterator >::view_t
         Constructing image views from raw interleaved pixel data.
         
        template<typename HomogeneousView >
        auto interleaved_view_get_raw_data (HomogeneousView const &view) -> typename detail::channel_pointer_type< HomogeneousView >::type
         Returns C pointer to the the channels of an interleaved homogeneous view.
         
        +
        auto interleaved_view_get_raw_data (HomogeneousView const &view) -> typename detail::channel_pointer_type< HomogeneousView >::type
         Returns C pointer to the the channels of an interleaved homogeneous view.
         
        template<typename HomogeneousView >
        auto planar_view_get_raw_data (HomogeneousView const &view, int plane_index) -> typename detail::channel_pointer_type< HomogeneousView >::type
         Returns C pointer to the the channels of a given color plane of a planar homogeneous view.
         
        +
        auto planar_view_get_raw_data (HomogeneousView const &view, int plane_index) -> typename detail::channel_pointer_type< HomogeneousView >::type
         Returns C pointer to the the channels of a given color plane of a planar homogeneous view.
         
        template<typename IC >
        auto planar_rgb_view (std::size_t width, std::size_t height, IC r, IC g, IC b, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, rgb_t > >::view_t
         from raw RGB planar data
         
        +
        auto planar_rgb_view (std::size_t width, std::size_t height, IC r, IC g, IC b, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, rgb_t > >::view_t
         from raw RGB planar data
         
        template<typename ChannelPtr >
        auto planar_rgba_view (std::size_t width, std::size_t height, ChannelPtr r, ChannelPtr g, ChannelPtr b, ChannelPtr a, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< ChannelPtr, rgba_t > >::view_t
         from raw RGBA planar data
         
        auto planar_rgba_view (std::size_t width, std::size_t height, ChannelPtr r, ChannelPtr g, ChannelPtr b, ChannelPtr a, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< ChannelPtr, rgba_t > >::view_t
         from raw RGBA planar data
         

        Detailed Description

        Methods for constructing image views from raw data and for getting raw data from views.

        @@ -116,7 +116,7 @@ template<typename ChannelPtr >
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___image_view_n_d_concept.html b/html/reference/group___image_view_n_d_concept.html index d12d34724..4068ebcdc 100644 --- a/html/reference/group___image_view_n_d_concept.html +++ b/html/reference/group___image_view_n_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageViewNDLocatorConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        ImageViewNDLocatorConcept
        +
        ImageViewNDLocatorConcept

        N-dimensional range. More...

        +

        Classes

        class  any_image_view< Views >
         Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, Note that this class does NOT model ImageViewConcept. More...
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___image_view_s_t_l_algorithms.html b/html/reference/group___image_view_s_t_l_algorithms.html index a59e908f0..1d1dfc50d 100644 --- a/html/reference/group___image_view_s_t_l_algorithms.html +++ b/html/reference/group___image_view_s_t_l_algorithms.html @@ -4,7 +4,7 @@ - + Generic Image Library: STL-like Algorithms @@ -27,72 +27,72 @@
        - + +/* @license-end */ +

        Image view-equivalents of STL algorithms. More...

        +

        Classes

        struct  RandomAccessNDImageViewConcept< View >
         N-dimensional view over immutable values. More...
        - - + - + - - + + - + - + - + - + - + - + - + - - + + - + - +

        +

        Modules

         copy_pixels
         copy_pixels
         std::copy for image views
         
         copy_and_convert_pixels
         copy_and_convert_pixels
         copies src view into dst view, color converting if necessary.
         
         fill_pixels
         std::fill for image views
         fill_pixels
         std::fill for image views
         
         destruct_pixels
         destruct_pixels
         invokes the destructor on every pixel of an image view
         
         uninitialized_fill_pixels
         uninitialized_fill_pixels
         std::uninitialized_fill for image views
         
         default_construct_pixels
         default_construct_pixels
         invokes the default constructor on every pixel of an image view
         
         uninitialized_copy_pixels
         uninitialized_copy_pixels
         std::uninitialized_copy for image views
         
         for_each_pixel
         for_each_pixel
         std::for_each for image views
         
         for_each_pixel_position
         for_each_pixel_position
         adobe::for_each_position for image views (passes locators, instead of pixel references, to the function object)
         
         generate_pixels
         generate_pixels
         std::generate for image views
         
         equal_pixels
         std::equal for image views
         equal_pixels
         std::equal for image views
         
         transform_pixels
         transform_pixels
         std::transform for image views
         
         transform_pixel_positions
         transform_pixel_positions
         adobe::transform_positions for image views (passes locators, instead of pixel references, to the function object)
         
        - @@ -111,7 +111,7 @@ Classes diff --git a/html/reference/group___image_view_s_t_l_algorithms_copy_and_convert_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_copy_and_convert_pixels.html index 63a16634c..548a699be 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_copy_and_convert_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_copy_and_convert_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: copy_and_convert_pixels @@ -27,69 +27,71 @@
        - + +/* @license-end */ +

        copies src view into dst view, color converting if necessary. More...

        +

        Classes

        struct  binary_operation_obj< Derived, Result >
         A generic binary operation on views. More...
        - - - - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +

        +

        Functions

        +
        template<typename V1 , typename V2 , typename CC >
        BOOST_FORCEINLINE void copy_and_convert_pixels (const V1 &src, const V2 &dst, CC cc)
         
        +
        BOOST_FORCEINLINE void copy_and_convert_pixels (const V1 &src, const V2 &dst, CC cc)
         
        template<typename View1 , typename View2 >
        BOOST_FORCEINLINE void copy_and_convert_pixels (const View1 &src, const View2 &dst)
         
        template<typename ... Types, typename View , typename CC >
        void copy_and_convert_pixels (any_image_view< Types... > const &src, View const &dst, CC cc)
         
        template<typename ... Types, typename View >
        void copy_and_convert_pixels (any_image_view< Types... > const &src, View const &dst)
         
        template<typename View , typename ... Types, typename CC >
        void copy_and_convert_pixels (View const &src, any_image_view< Types... > const &dst, CC cc)
         
        template<typename View , typename ... Types>
        void copy_and_convert_pixels (View const &src, any_image_view< Types... > const &dst)
         
        template<typename ... Types1, typename ... Types2, typename CC >
        void copy_and_convert_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst, CC cc)
         
        template<typename ... Types1, typename ... Types2>
        void copy_and_convert_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
         
        BOOST_FORCEINLINE void copy_and_convert_pixels (const View1 &src, const View2 &dst)
         
        template<typename ... Types, typename View , typename CC >
        void copy_and_convert_pixels (any_image_view< Types... > const &src, View const &dst, CC cc)
         
        template<typename ... Types, typename View >
        void copy_and_convert_pixels (any_image_view< Types... > const &src, View const &dst)
         
        template<typename View , typename ... Types, typename CC >
        void copy_and_convert_pixels (View const &src, any_image_view< Types... > const &dst, CC cc)
         
        template<typename View , typename ... Types>
        void copy_and_convert_pixels (View const &src, any_image_view< Types... > const &dst)
         
        template<typename ... Types1, typename ... Types2, typename CC >
        void copy_and_convert_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst, CC cc)
         
        template<typename ... Types1, typename ... Types2>
        void copy_and_convert_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
         

        Detailed Description

        copies src view into dst view, color converting if necessary.

        Versions taking static and runtime views are provided. Versions taking user-defined color convered are provided.

        Function Documentation

        - -

        ◆ copy_and_convert_pixels() [1/6]

        + +

        ◆ copy_and_convert_pixels() [1/6]

        +
        +template<typename ... Types, typename View >
        - + @@ -117,14 +119,16 @@ template<typename View1 , typename View2 > - -

        ◆ copy_and_convert_pixels() [2/6]

        + +

        ◆ copy_and_convert_pixels() [2/6]

        +
        +template<typename ... Types, typename View , typename CC >
        void boost::gil::copy_and_convert_pixels void copy_and_convert_pixels ( any_image_view< Types... > const &  src,
        - + @@ -159,14 +163,16 @@ template<typename View1 , typename View2 > - -

        ◆ copy_and_convert_pixels() [3/6]

        + +

        ◆ copy_and_convert_pixels() [3/6]

        +
        +template<typename ... Types1, typename ... Types2>
        void boost::gil::copy_and_convert_pixels void copy_and_convert_pixels ( any_image_view< Types... > const &  src,
        - + @@ -194,14 +200,16 @@ template<typename View1 , typename View2 > - -

        ◆ copy_and_convert_pixels() [4/6]

        + +

        ◆ copy_and_convert_pixels() [4/6]

        +
        +template<typename ... Types1, typename ... Types2, typename CC >
        void boost::gil::copy_and_convert_pixels void copy_and_convert_pixels ( any_image_view< Types1... > const &  src,
        - + @@ -236,14 +244,16 @@ template<typename View1 , typename View2 > - -

        ◆ copy_and_convert_pixels() [5/6]

        + +

        ◆ copy_and_convert_pixels() [5/6]

        +
        +template<typename View , typename ... Types>
        void boost::gil::copy_and_convert_pixels void copy_and_convert_pixels ( any_image_view< Types1... > const &  src,
        - + @@ -271,14 +281,16 @@ template<typename View1 , typename View2 > - -

        ◆ copy_and_convert_pixels() [6/6]

        + +

        ◆ copy_and_convert_pixels() [6/6]

        +
        +template<typename View , typename ... Types, typename CC >
        void boost::gil::copy_and_convert_pixels void copy_and_convert_pixels ( View const &  src,
        - + @@ -319,7 +331,7 @@ template<typename View1 , typename View2 > diff --git a/html/reference/group___image_view_s_t_l_algorithms_copy_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_copy_pixels.html index b3a4ff31e..cfa1a01c5 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_copy_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_copy_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: copy_pixels @@ -27,56 +27,58 @@
        - + +/* @license-end */ +

        std::copy for image views More...

        void boost::gil::copy_and_convert_pixels void copy_and_convert_pixels ( View const &  src,
        - - - - - - - - - - - - - - + + + + + + + + + + + +

        +

        Functions

        +
        template<typename View1 , typename View2 >
        BOOST_FORCEINLINE void copy_pixels (const View1 &src, const View2 &dst)
         std::copy for image views
         
        template<typename ... Types, typename View >
        void copy_pixels (any_image_view< Types... > const &src, View const &dst)
         
        template<typename ... Types, typename View >
        void copy_pixels (View const &src, any_image_view< Types... > const &dst)
         
        template<typename ... Types1, typename ... Types2>
        void copy_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
         
        BOOST_FORCEINLINE void copy_pixels (const View1 &src, const View2 &dst)
         std::copy for image views
         
        template<typename ... Types, typename View >
        void copy_pixels (any_image_view< Types... > const &src, View const &dst)
         
        template<typename ... Types, typename View >
        void copy_pixels (View const &src, any_image_view< Types... > const &dst)
         
        template<typename ... Types1, typename ... Types2>
        void copy_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst)
         

        Detailed Description

        std::copy for image views

        Function Documentation

        - -

        ◆ copy_pixels() [1/3]

        + +

        ◆ copy_pixels() [1/3]

        +
        +template<typename ... Types, typename View >
        - + @@ -104,14 +106,16 @@ template<typename View1 , typename View2 > - -

        ◆ copy_pixels() [2/3]

        + +

        ◆ copy_pixels() [2/3]

        +
        +template<typename ... Types1, typename ... Types2>
        void boost::gil::copy_pixels void copy_pixels ( any_image_view< Types... > const &  src,
        - + @@ -139,14 +143,16 @@ template<typename View1 , typename View2 > - -

        ◆ copy_pixels() [3/3]

        + +

        ◆ copy_pixels() [3/3]

        +
        +template<typename ... Types, typename View >
        void boost::gil::copy_pixels void copy_pixels ( any_image_view< Types1... > const &  src,
        - + @@ -180,7 +186,7 @@ template<typename View1 , typename View2 > diff --git a/html/reference/group___image_view_s_t_l_algorithms_default_construct_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_default_construct_pixels.html index 9fd384a41..39c9406db 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_default_construct_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_default_construct_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: default_construct_pixels @@ -27,35 +27,35 @@
        - + +/* @license-end */ +

        invokes the default constructor on every pixel of an image view More...

        void boost::gil::copy_pixels void copy_pixels ( View const &  src,
        - - - - - + + +

        +

        Functions

        +
        template<typename View >
        void default_construct_pixels (View const &view)
         Invokes the in-place default constructor on every pixel of the (uninitialized) view. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place default-constructed pixels.
         
        void default_construct_pixels (View const &view)
         Invokes the in-place default constructor on every pixel of the (uninitialized) view. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place default-constructed pixels.
         

        Detailed Description

        invokes the default constructor on every pixel of an image view

        @@ -65,7 +65,7 @@ template<typename View >
        - - - - - + + +

        +

        Functions

        +
        template<typename View >
        BOOST_FORCEINLINE void destruct_pixels (View const &view)
         Invokes the in-place destructor on every pixel of the view.
         
        BOOST_FORCEINLINE void destruct_pixels (View const &view)
         Invokes the in-place destructor on every pixel of the view.
         

        Detailed Description

        invokes the destructor on every pixel of an image view

        @@ -65,7 +65,7 @@ template<typename View >
        - - - - - - - - - - - - - - + + + + + + + + + + + +

        +

        Functions

        +
        template<typename View1 , typename View2 >
        BOOST_FORCEINLINE bool equal_pixels (const View1 &v1, const View2 &v2)
         std::equal for image views
         
        template<typename ... Types, typename View >
        auto equal_pixels (any_image_view< Types... > const &src, View const &dst) -> bool
         
        template<typename View , typename ... Types>
        auto equal_pixels (View const &src, any_image_view< Types... > const &dst) -> bool
         
        template<typename ... Types1, typename ... Types2>
        auto equal_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst) -> bool
         
        BOOST_FORCEINLINE bool equal_pixels (const View1 &v1, const View2 &v2)
         std::equal for image views
         
        template<typename ... Types, typename View >
        auto equal_pixels (any_image_view< Types... > const &src, View const &dst) -> bool
         
        template<typename View , typename ... Types>
        auto equal_pixels (View const &src, any_image_view< Types... > const &dst) -> bool
         
        template<typename ... Types1, typename ... Types2>
        auto equal_pixels (any_image_view< Types1... > const &src, any_image_view< Types2... > const &dst) -> bool
         

        Detailed Description

        -

        std::equal for image views

        +

        std::equal for image views

        Function Documentation

        - -

        ◆ equal_pixels() [1/3]

        + +

        ◆ equal_pixels() [1/3]

        +
        +template<typename ... Types, typename View >
        - + @@ -105,14 +107,16 @@ template<typename View1 , typename View2 > - -

        ◆ equal_pixels() [2/3]

        + +

        ◆ equal_pixels() [2/3]

        +
        +template<typename ... Types1, typename ... Types2>
        auto boost::gil::equal_pixels auto equal_pixels ( any_image_view< Types... > const &  src,
        - + @@ -141,14 +145,16 @@ template<typename View1 , typename View2 > - -

        ◆ equal_pixels() [3/3]

        + +

        ◆ equal_pixels() [3/3]

        +
        +template<typename View , typename ... Types>
        auto boost::gil::equal_pixels auto equal_pixels ( any_image_view< Types1... > const &  src,
        - + @@ -183,7 +189,7 @@ template<typename View1 , typename View2 > diff --git a/html/reference/group___image_view_s_t_l_algorithms_fill_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_fill_pixels.html index 91c756a20..4a8c8fed8 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_fill_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_fill_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: fill_pixels @@ -27,51 +27,53 @@
        - + +/* @license-end */ +
        -

        std::fill for image views +

        std::fill for image views More...

        auto boost::gil::equal_pixels auto equal_pixels ( View const &  src,
        - - - - - - - - - + + + + + + +

        +

        Functions

        +
        template<typename View , typename Value >
        BOOST_FORCEINLINE void fill_pixels (View const &view, Value const &value)
         std::fill for image views
         
        template<typename ... Types, typename Value >
        void fill_pixels (any_image_view< Types... > const &view, Value const &val)
         fill_pixels for any image view. The pixel to fill with must be compatible with the current view More...
         
        BOOST_FORCEINLINE void fill_pixels (View const &view, Value const &value)
         std::fill for image views
         
        template<typename ... Types, typename Value >
        void fill_pixels (any_image_view< Types... > const &view, Value const &val)
         fill_pixels for any image view. The pixel to fill with must be compatible with the current view
         

        Detailed Description

        -

        std::fill for image views

        +

        std::fill for image views

        Function Documentation

        - -

        ◆ fill_pixels()

        + +

        ◆ fill_pixels()

        +
        +template<typename ... Types, typename Value >
        - + @@ -106,7 +108,7 @@ template<typename View , typename Value > diff --git a/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel.html b/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel.html index 509f1829d..91c35b9a6 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel.html +++ b/html/reference/group___image_view_s_t_l_algorithms_for_each_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: for_each_pixel @@ -27,34 +27,34 @@
        - + +/* @license-end */ +

        std::for_each for image views More...

        void boost::gil::fill_pixels void fill_pixels ( any_image_view< Types... > const &  view,
        - - - - + +

        +

        Functions

        +
        template<typename View , typename F >
        for_each_pixel (View const &view, F fun)
         
        for_each_pixel (View const &view, F fun)
         

        Detailed Description

        std::for_each for image views

        @@ -66,7 +66,7 @@ template<typename View , typename F >
        - - - - + +

        +

        Functions

        +
        template<typename View , typename F >
        for_each_pixel_position (View const &view, F fun)
         
        for_each_pixel_position (View const &view, F fun)
         

        Detailed Description

        adobe::for_each_position for image views (passes locators, instead of pixel references, to the function object)

        @@ -64,7 +64,7 @@ template<typename View , typename F >
        - - - - - + + +

        +

        Functions

        +
        template<typename View , typename F >
        void generate_pixels (View const &view, F fun)
         std::generate for image views
         
        void generate_pixels (View const &view, F fun)
         std::generate for image views
         

        Detailed Description

        std::generate for image views

        @@ -65,7 +65,7 @@ template<typename View , typename F >
        - - - - - - + + + - - - + + +

        +

        Functions

        +
        template<typename View1 , typename View2 , typename F >
        BOOST_FORCEINLINE F transform_pixel_positions (const View1 &src, const View2 &dst, F fun)
         Like transform_pixels but passes to the function object pixel locators instead of pixel references.
         
        +
        BOOST_FORCEINLINE F transform_pixel_positions (const View1 &src, const View2 &dst, F fun)
         Like transform_pixels but passes to the function object pixel locators instead of pixel references.
         
        template<typename View1 , typename View2 , typename View3 , typename F >
        BOOST_FORCEINLINE F transform_pixel_positions (const View1 &src1, const View2 &src2, const View3 &dst, F fun)
         transform_pixel_positions with two sources
         
        BOOST_FORCEINLINE F transform_pixel_positions (const View1 &src1, const View2 &src2, const View3 &dst, F fun)
         transform_pixel_positions with two sources
         

        Detailed Description

        adobe::transform_positions for image views (passes locators, instead of pixel references, to the function object)

        @@ -70,7 +70,7 @@ template<typename View1 , typename View2 , typename View3 , typename F > < diff --git a/html/reference/group___image_view_s_t_l_algorithms_transform_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_transform_pixels.html index ba29f4621..e53ac3649 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_transform_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_transform_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: transform_pixels @@ -27,40 +27,40 @@
        - + +/* @license-end */ +

        std::transform for image views More...

        - - - - - - + + + - - - + + +

        +

        Functions

        +
        template<typename View1 , typename View2 , typename F >
        BOOST_FORCEINLINE F transform_pixels (const View1 &src, const View2 &dst, F fun)
         std::transform for image views
         
        +
        BOOST_FORCEINLINE F transform_pixels (const View1 &src, const View2 &dst, F fun)
         std::transform for image views
         
        template<typename View1 , typename View2 , typename View3 , typename F >
        BOOST_FORCEINLINE F transform_pixels (const View1 &src1, const View2 &src2, const View3 &dst, F fun)
         transform_pixels with two sources
         
        BOOST_FORCEINLINE F transform_pixels (const View1 &src1, const View2 &src2, const View3 &dst, F fun)
         transform_pixels with two sources
         

        Detailed Description

        std::transform for image views

        @@ -71,7 +71,7 @@ template<typename View1 , typename View2 , typename View3 , typename F > < diff --git a/html/reference/group___image_view_s_t_l_algorithms_uninitialized_copy_pixels.html b/html/reference/group___image_view_s_t_l_algorithms_uninitialized_copy_pixels.html index 8682f5f3f..9c157a3ce 100644 --- a/html/reference/group___image_view_s_t_l_algorithms_uninitialized_copy_pixels.html +++ b/html/reference/group___image_view_s_t_l_algorithms_uninitialized_copy_pixels.html @@ -4,7 +4,7 @@ - + Generic Image Library: uninitialized_copy_pixels @@ -27,35 +27,35 @@

        - + +/* @license-end */ +

        std::uninitialized_copy for image views More...

        - - - - - + + +

        +

        Functions

        +
        template<typename View1 , typename View2 >
        void uninitialized_copy_pixels (View1 const &view1, View2 const &view2)
         std::uninitialized_copy for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed objects
         
        void uninitialized_copy_pixels (View1 const &view1, View2 const &view2)
         std::uninitialized_copy for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed objects
         

        Detailed Description

        std::uninitialized_copy for image views

        @@ -65,7 +65,7 @@ template<typename View1 , typename View2 >
        - - - - - + + +

        +

        Functions

        +
        template<typename View , typename Value >
        void uninitialized_fill_pixels (const View &view, const Value &val)
         std::uninitialized_fill for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed pixels
         
        void uninitialized_fill_pixels (const View &view, const Value &val)
         std::uninitialized_fill for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed pixels
         

        Detailed Description

        std::uninitialized_fill for image views

        @@ -65,7 +65,7 @@ template<typename View , typename Value > diff --git a/html/reference/group___image_view_transformations.html b/html/reference/group___image_view_transformations.html index d74552afa..fe0fd1a37 100644 --- a/html/reference/group___image_view_transformations.html +++ b/html/reference/group___image_view_transformations.html @@ -4,7 +4,7 @@ - + Generic Image Library: Image View Transformations @@ -27,66 +27,66 @@

        - + +/* @license-end */ +
        -
        -
        Image View Transformations
        +
        Image View Transformations

        Methods for constructing one image view from another. More...

        - - + - + - + - + - + - + - + - + - + - + - +

        +

        Modules

         color_converted_view
         color_converted_view
         Color converted view of another view.
         
         flipped_up_down_view
         flipped_up_down_view
         view of a view flipped up-to-down
         
         flipped_left_right_view
         flipped_left_right_view
         view of a view flipped left-to-right
         
         transposed_view
         transposed_view
         view of a view transposed
         
         rotated90cw_view
         rotated90cw_view
         view of a view rotated 90 degrees clockwise
         
         rotated90ccw_view
         rotated90ccw_view
         view of a view rotated 90 degrees counter-clockwise
         
         rotated180_view
         rotated180_view
         view of a view rotated 180 degrees
         
         subimage_view
         subimage_view
         view of an axis-aligned rectangular area within an image_view
         
         subsampled_view
         subsampled_view
         view of a subsampled version of an image_view, stepping over a number of channels in X and number of rows in Y
         
         nth_channel_view
         nth_channel_view
         single-channel (grayscale) view of the N-th channel of a given image_view
         
         kth_channel_view
         kth_channel_view
         single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter
         
        - @@ -103,7 +103,7 @@ Classes diff --git a/html/reference/group___image_view_transformations180.html b/html/reference/group___image_view_transformations180.html index d1317d93a..56e5d94e3 100644 --- a/html/reference/group___image_view_transformations180.html +++ b/html/reference/group___image_view_transformations180.html @@ -4,7 +4,7 @@ - + Generic Image Library: rotated180_view @@ -27,52 +27,54 @@
        - + +/* @license-end */ +

        view of a view rotated 180 degrees More...

        +

        Classes

        struct  dynamic_xy_step_type< View >
         Returns the type of a view that has a dynamic step along both X and Y. More...
        - - - - - - - + + + + +

        +

        Functions

        +
        template<typename View >
        auto rotated180_view (View const &src) -> typename dynamic_xy_step_type< View >::type
         
        template<typename ... Views>
        auto rotated180_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_type< any_image_view< Views... >>::type
         
        auto rotated180_view (View const &src) -> typename dynamic_xy_step_type< View >::type
         
        template<typename ... Views>
        auto rotated180_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_type< any_image_view< Views... > >::type
         

        Detailed Description

        view of a view rotated 180 degrees

        Function Documentation

        - -

        ◆ rotated180_view()

        + +

        ◆ rotated180_view()

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___point_algorithm.html b/html/reference/group___point_algorithm.html index 274b57f8f..a203b148b 100644 --- a/html/reference/group___point_algorithm.html +++ b/html/reference/group___point_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,52 +27,52 @@
        - + +/* @license-end */ +
        -
        -
        Algorithms and Utility Functions
        +
        Algorithms and Utility Functions

        Algorithms and Utility Functions for points. More...

        - + @@ -101,7 +103,7 @@ template<typename View > diff --git a/html/reference/group___image_view_transformations90_c_c_w.html b/html/reference/group___image_view_transformations90_c_c_w.html index a3b2df11c..cf790d085 100644 --- a/html/reference/group___image_view_transformations90_c_c_w.html +++ b/html/reference/group___image_view_transformations90_c_c_w.html @@ -4,7 +4,7 @@ - + Generic Image Library: rotated90ccw_view @@ -27,52 +27,54 @@
        - + +/* @license-end */ +

        view of a view rotated 90 degrees counter-clockwise More...

        auto boost::gil::rotated180_view auto rotated180_view ( any_image_view< Views... > const &  src)
        - - - - - - - + + + + +

        +

        Functions

        +
        template<typename View >
        auto rotated90ccw_view (View const &src) -> typename dynamic_xy_step_transposed_type< View >::type
         
        template<typename ... Views>
        auto rotated90ccw_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
         
        auto rotated90ccw_view (View const &src) -> typename dynamic_xy_step_transposed_type< View >::type
         
        template<typename ... Views>
        auto rotated90ccw_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... > >::type
         

        Detailed Description

        view of a view rotated 90 degrees counter-clockwise

        Function Documentation

        - -

        ◆ rotated90ccw_view()

        + +

        ◆ rotated90ccw_view()

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___point.html b/html/reference/group___point.html index d7a4effb0..f9d81525c 100644 --- a/html/reference/group___point.html +++ b/html/reference/group___point.html @@ -4,7 +4,7 @@ - + Generic Image Library: Point @@ -27,37 +27,37 @@
        - + +/* @license-end */ +
        -
        -
        Point
        +
        Point

        N-dimensional point. More...

        - + @@ -101,7 +103,7 @@ template<typename View > diff --git a/html/reference/group___image_view_transformations90_c_w.html b/html/reference/group___image_view_transformations90_c_w.html index d07e09173..9a853c4b4 100644 --- a/html/reference/group___image_view_transformations90_c_w.html +++ b/html/reference/group___image_view_transformations90_c_w.html @@ -4,7 +4,7 @@ - + Generic Image Library: rotated90cw_view @@ -27,52 +27,54 @@
        - + +/* @license-end */ +

        view of a view rotated 90 degrees clockwise More...

        auto boost::gil::rotated90ccw_view auto rotated90ccw_view ( any_image_view< Views... > const &  src)
        - - - - - - - + + + + +

        +

        Functions

        +
        template<typename View >
        auto rotated90cw_view (View const &src) -> typename dynamic_xy_step_transposed_type< View >::type
         
        template<typename ... Views>
        auto rotated90cw_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
         
        auto rotated90cw_view (View const &src) -> typename dynamic_xy_step_transposed_type< View >::type
         
        template<typename ... Views>
        auto rotated90cw_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... > >::type
         

        Detailed Description

        view of a view rotated 90 degrees clockwise

        Function Documentation

        - -

        ◆ rotated90cw_view()

        + +

        ◆ rotated90cw_view()

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___pixel_model_non_aligned_pixel.html b/html/reference/group___pixel_model_non_aligned_pixel.html index 9bf946225..ecb6f3315 100644 --- a/html/reference/group___pixel_model_non_aligned_pixel.html +++ b/html/reference/group___pixel_model_non_aligned_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_reference @@ -27,20 +27,20 @@
        - + +/* @license-end */ +
        -
        -
        bit_aligned_pixel_reference
        +
        bit_aligned_pixel_reference
        @@ -50,18 +50,18 @@ $(function() {

        Example:

        unsigned char data=0;
        // A mutable reference to a 6-bit BGR pixel in "123" format (1 bit for red, 2 bits for green, 3 bits for blue)
        -
        using rgb123_ref_t = bit_aligned_pixel_reference<unsigned char, mp11::mp_list_c<int,1,2,3>, rgb_layout_t, true> const;
        +
        using rgb123_ref_t = bit_aligned_pixel_reference<unsigned char, mp11::mp_list_c<int,1,2,3>, rgb_layout_t, true> const;
        // create the pixel reference at bit offset 2
        // (i.e. red = [2], green = [3,4], blue = [5,6,7] bits)
        rgb123_ref_t ref(&data, 2);
        -
        get_color(ref, red_t()) = 1;
        +
        get_color(ref, red_t()) = 1;
        assert(data == 0x04);
        -
        get_color(ref, green_t()) = 3;
        +
        get_color(ref, green_t()) = 3;
        assert(data == 0x1C);
        -
        get_color(ref, blue_t()) = 7;
        +
        get_color(ref, blue_t()) = 7;
        assert(data == 0xFC);
        -
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition: color_base_algorithm.hpp:190
        +
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition color_base_algorithm.hpp:190

        Heterogeneous pixel reference corresponding to non-byte-aligned bit range. Models ColorBaseConcept, PixelConcept, PixelBasedConcept

        Template Parameters
        - + @@ -101,7 +103,7 @@ template<typename View > diff --git a/html/reference/group___image_view_transformations_color_convert.html b/html/reference/group___image_view_transformations_color_convert.html index 71aa3ed1f..b59eb6f95 100644 --- a/html/reference/group___image_view_transformations_color_convert.html +++ b/html/reference/group___image_view_transformations_color_convert.html @@ -4,7 +4,7 @@ - + Generic Image Library: color_converted_view @@ -27,30 +27,30 @@
        - + +/* @license-end */ +

        Color converted view of another view. More...

        auto boost::gil::rotated90cw_view auto rotated90cw_view ( any_image_view< Views... > const &  src)
        - @@ -65,49 +65,51 @@ Classes

        +

        Classes

        class  color_convert_deref_fn< SrcConstRefP, DstP, CC >
         Function object that given a source pixel, returns it converted to a given color space and channel depth. Models: PixelDereferenceAdaptorConcept. More...
         Returns the type of a runtime-specified view, color-converted to a given pixel type with the default coor converter. More...
         
        - - - - - - + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +

        +

        Functions

        +
        template<typename DstP , typename View , typename CC >
        auto color_converted_view (View const &src, CC cc) -> typename color_converted_view_type< View, DstP, CC >::type
         view of a different color space with a user defined color-converter
         
        +
        auto color_converted_view (View const &src, CC cc) -> typename color_converted_view_type< View, DstP, CC >::type
         view of a different color space with a user defined color-converter
         
        template<typename DstP , typename View >
        auto color_converted_view (View const &src) -> typename color_converted_view_type< View, DstP >::type
         overload of generic color_converted_view with the default color-converter
         
        template<typename DstP , typename ... Views, typename CC >
        auto color_converted_view (any_image_view< Views... > const &src, CC cc) -> typename color_converted_view_type< any_image_view< Views... >, DstP, CC >::type
         overload of generic color_converted_view with user defined color-converter More...
         
        template<typename DstP , typename ... Views>
        auto color_converted_view (any_image_view< Views... > const &src) -> typename color_converted_view_type< any_image_view< Views... >, DstP >::type
         overload of generic color_converted_view with the default color-converter More...
         
        template<typename DstP , typename ... Views, typename CC >
        auto any_color_converted_view (const any_image_view< Views... > &src, CC cc) -> typename color_converted_view_type< any_image_view< Views... >, DstP, CC >::type
         overload of generic color_converted_view with user defined color-converter These are workarounds for GCC 3.4, which thinks color_converted_view is ambiguous with the same method for templated views (in gil/image_view_factory.hpp) More...
         
        template<typename DstP , typename ... Views>
        auto any_color_converted_view (const any_image_view< Views... > &src) -> typename color_converted_view_type< any_image_view< Views... >, DstP >::type
         overload of generic color_converted_view with the default color-converter These are workarounds for GCC 3.4, which thinks color_converted_view is ambiguous with the same method for templated views (in gil/image_view_factory.hpp) More...
         
        auto color_converted_view (View const &src) -> typename color_converted_view_type< View, DstP >::type
         overload of generic color_converted_view with the default color-converter
         
        template<typename DstP , typename ... Views, typename CC >
        auto color_converted_view (any_image_view< Views... > const &src, CC cc) -> typename color_converted_view_type< any_image_view< Views... >, DstP, CC >::type
         overload of generic color_converted_view with user defined color-converter
         
        template<typename DstP , typename ... Views>
        auto color_converted_view (any_image_view< Views... > const &src) -> typename color_converted_view_type< any_image_view< Views... >, DstP >::type
         overload of generic color_converted_view with the default color-converter
         
        template<typename DstP , typename ... Views, typename CC >
        auto any_color_converted_view (const any_image_view< Views... > &src, CC cc) -> typename color_converted_view_type< any_image_view< Views... >, DstP, CC >::type
         overload of generic color_converted_view with user defined color-converter These are workarounds for GCC 3.4, which thinks color_converted_view is ambiguous with the same method for templated views (in gil/image_view_factory.hpp)
         
        template<typename DstP , typename ... Views>
        auto any_color_converted_view (const any_image_view< Views... > &src) -> typename color_converted_view_type< any_image_view< Views... >, DstP >::type
         overload of generic color_converted_view with the default color-converter These are workarounds for GCC 3.4, which thinks color_converted_view is ambiguous with the same method for templated views (in gil/image_view_factory.hpp)
         

        Detailed Description

        Color converted view of another view.

        Function Documentation

        - -

        ◆ any_color_converted_view() [1/2]

        + +

        ◆ any_color_converted_view() [1/2]

        +
        +template<typename DstP , typename ... Views>
        diff --git a/html/reference/group___pixel_locator2_d_concept.html b/html/reference/group___pixel_locator2_d_concept.html index 6b7b8dfaa..b22aa22f8 100644 --- a/html/reference/group___pixel_locator2_d_concept.html +++ b/html/reference/group___pixel_locator2_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelLocatorConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        PixelLocatorConcept
        +
        PixelLocatorConcept

        2-dimensional locator over pixel data More...

        - + @@ -132,17 +134,19 @@ template<typename DstP , typename View > - -

        ◆ any_color_converted_view() [2/2]

        + +

        ◆ any_color_converted_view() [2/2]

        +
        +template<typename DstP , typename ... Views, typename CC >
        auto boost::gil::any_color_converted_view auto any_color_converted_view ( const any_image_view< Views... > &  src)
        diff --git a/html/reference/group___pixel_iterator_model_deref_ptr.html b/html/reference/group___pixel_iterator_model_deref_ptr.html index 41c0e56d5..027247d34 100644 --- a/html/reference/group___pixel_iterator_model_deref_ptr.html +++ b/html/reference/group___pixel_iterator_model_deref_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: dereference_iterator_adaptor @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        dereference_iterator_adaptor
        +
        dereference_iterator_adaptor

        An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept. More...

        - + @@ -177,17 +181,19 @@ template<typename DstP , typename View > - -

        ◆ color_converted_view() [1/2]

        + +

        ◆ color_converted_view() [1/2]

        +
        +template<typename DstP , typename ... Views>
        auto boost::gil::any_color_converted_view auto any_color_converted_view ( const any_image_view< Views... > &  src,
        diff --git a/html/reference/group___pixel_iterator_concept.html b/html/reference/group___pixel_iterator_concept.html index dfd0efc9d..79acb2793 100644 --- a/html/reference/group___pixel_iterator_concept.html +++ b/html/reference/group___pixel_iterator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,42 +27,42 @@
        - + +/* @license-end */ +
        -
        -
        +

        Pixel iterator concepts. More...

        - + @@ -212,17 +218,19 @@ template<typename DstP , typename View > - -

        ◆ color_converted_view() [2/2]

        + +

        ◆ color_converted_view() [2/2]

        +
        +template<typename DstP , typename ... Views, typename CC >
        auto boost::gil::color_converted_view auto color_converted_view ( any_image_view< Views... > const &  src)
        diff --git a/html/reference/group___pixel_dereference_adaptor_concept.html b/html/reference/group___pixel_dereference_adaptor_concept.html index edd8f078d..d89fb4ab5 100644 --- a/html/reference/group___pixel_dereference_adaptor_concept.html +++ b/html/reference/group___pixel_dereference_adaptor_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,26 +27,26 @@
        - + +/* @license-end */ +
        - + @@ -263,7 +271,7 @@ template<typename DstP , typename View > diff --git a/html/reference/group___image_view_transformations_flip_l_r.html b/html/reference/group___image_view_transformations_flip_l_r.html index 3596604cb..02987fad3 100644 --- a/html/reference/group___image_view_transformations_flip_l_r.html +++ b/html/reference/group___image_view_transformations_flip_l_r.html @@ -4,7 +4,7 @@ - + Generic Image Library: flipped_left_right_view @@ -27,52 +27,54 @@
        - + +/* @license-end */ +

        view of a view flipped left-to-right More...

        auto boost::gil::color_converted_view auto color_converted_view ( any_image_view< Views... > const &  src,
        - - - - - - - + + + + +

        +

        Functions

        +
        template<typename View >
        auto flipped_left_right_view (View const &src) -> typename dynamic_x_step_type< View >::type
         
        template<typename ... Views>
        auto flipped_left_right_view (any_image_view< Views... > const &src) -> typename dynamic_x_step_type< any_image_view< Views... >>::type
         
        auto flipped_left_right_view (View const &src) -> typename dynamic_x_step_type< View >::type
         
        template<typename ... Views>
        auto flipped_left_right_view (any_image_view< Views... > const &src) -> typename dynamic_x_step_type< any_image_view< Views... > >::type
         

        Detailed Description

        view of a view flipped left-to-right

        Function Documentation

        - -

        ◆ flipped_left_right_view()

        + +

        ◆ flipped_left_right_view()

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___pixel_based_algorithm.html b/html/reference/group___pixel_based_algorithm.html index 74dc0c64b..191dbc9d6 100644 --- a/html/reference/group___pixel_based_algorithm.html +++ b/html/reference/group___pixel_based_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        Algorithms and Utility Functions
        +
        Algorithms and Utility Functions

        PixelBased algorithms, metafunctions and utility functions. More...

        - + @@ -101,7 +103,7 @@ template<typename View > diff --git a/html/reference/group___image_view_transformations_flip_u_d.html b/html/reference/group___image_view_transformations_flip_u_d.html index 7b3fadb61..25b0e65bb 100644 --- a/html/reference/group___image_view_transformations_flip_u_d.html +++ b/html/reference/group___image_view_transformations_flip_u_d.html @@ -4,7 +4,7 @@ - + Generic Image Library: flipped_up_down_view @@ -27,52 +27,54 @@
        - + +/* @license-end */ +

        view of a view flipped up-to-down More...

        auto boost::gil::flipped_left_right_view auto flipped_left_right_view ( any_image_view< Views... > const &  src)
        - - - - - - - + + + + +

        +

        Functions

        +
        template<typename View >
        auto flipped_up_down_view (View const &src) -> typename dynamic_y_step_type< View >::type
         
        template<typename ... Views>
        auto flipped_up_down_view (any_image_view< Views... > const &src) -> typename dynamic_y_step_type< any_image_view< Views... >>::type
         
        auto flipped_up_down_view (View const &src) -> typename dynamic_y_step_type< View >::type
         
        template<typename ... Views>
        auto flipped_up_down_view (any_image_view< Views... > const &src) -> typename dynamic_y_step_type< any_image_view< Views... > >::type
         

        Detailed Description

        view of a view flipped up-to-down

        Function Documentation

        - -

        ◆ flipped_up_down_view()

        + +

        ◆ flipped_up_down_view()

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___image_view_transformations_nth_channel.html b/html/reference/group___image_view_transformations_nth_channel.html index 433df34b5..af70297d5 100644 --- a/html/reference/group___image_view_transformations_nth_channel.html +++ b/html/reference/group___image_view_transformations_nth_channel.html @@ -4,7 +4,7 @@ - + Generic Image Library: nth_channel_view @@ -27,30 +27,30 @@
        - + +/* @license-end */ +

        single-channel (grayscale) view of the N-th channel of a given image_view More...

        - + @@ -101,7 +103,7 @@ template<typename View > diff --git a/html/reference/group___image_view_transformations_kth_channel.html b/html/reference/group___image_view_transformations_kth_channel.html index 91bcddb0b..775aff77f 100644 --- a/html/reference/group___image_view_transformations_kth_channel.html +++ b/html/reference/group___image_view_transformations_kth_channel.html @@ -4,7 +4,7 @@ - + Generic Image Library: kth_channel_view @@ -27,41 +27,41 @@
        - + +/* @license-end */ +

        single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter More...

        auto boost::gil::flipped_up_down_view auto flipped_up_down_view ( any_image_view< Views... > const &  src)
        -

        +

        Classes

        struct  kth_channel_view_type< K, View >
         Given a source image view type View, returns the type of an image view over a given channel of View. More...
         
        - - - - + +

        +

        Functions

        +
        template<int K, typename View >
        auto kth_channel_view (View const &src) -> typename kth_channel_view_type< K, View >::type
         
        auto kth_channel_view (View const &src) -> typename kth_channel_view_type< K, View >::type
         

        Detailed Description

        single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter

        @@ -71,7 +71,7 @@ template<int K, typename View >
        - @@ -59,30 +59,32 @@ Classes

        +

        Classes

        struct  nth_channel_view_type< View >
         Given a source image view type View, returns the type of an image view over a single channel of View. More...
         Given a runtime source image view, returns the type of a runtime image view over a single channel of the source view. More...
         
        - - - - - - - + + + + +

        +

        Functions

        +
        template<typename View >
        nth_channel_view_type< View >::type nth_channel_view (View const &src, int n)
         
        template<typename ... Views>
        auto nth_channel_view (any_image_view< Views... > const &src, int n) -> typename nth_channel_view_type< any_image_view< Views... >>::type
         
        nth_channel_view_type< View >::type nth_channel_view (View const &src, int n)
         
        template<typename ... Views>
        auto nth_channel_view (any_image_view< Views... > const &src, int n) -> typename nth_channel_view_type< any_image_view< Views... > >::type
         

        Detailed Description

        single-channel (grayscale) view of the N-th channel of a given image_view

        Function Documentation

        - -

        ◆ nth_channel_view()

        + +

        ◆ nth_channel_view()

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___pixel_based.html b/html/reference/group___pixel_based.html index 046f0b9e7..c13de5cb1 100644 --- a/html/reference/group___pixel_based.html +++ b/html/reference/group___pixel_based.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelBased @@ -27,37 +27,37 @@
        - + +/* @license-end */ +
        -
        -
        PixelBased
        +
        PixelBased

        Concepts for all GIL constructs that are pixel-based (pixels, pixel iterators, locators, views, images). More...

        - + @@ -121,7 +123,7 @@ template<typename View > diff --git a/html/reference/group___image_view_transformations_subimage.html b/html/reference/group___image_view_transformations_subimage.html index 515785434..7cb842fc1 100644 --- a/html/reference/group___image_view_transformations_subimage.html +++ b/html/reference/group___image_view_transformations_subimage.html @@ -4,7 +4,7 @@ - + Generic Image Library: subimage_view @@ -27,59 +27,61 @@
        - + +/* @license-end */ +

        view of an axis-aligned rectangular area within an image_view More...

        auto boost::gil::nth_channel_view auto nth_channel_view ( any_image_view< Views... > const &  src,
        - - - - - + + - - - - - - - - + + + + + + + +

        +

        Functions

        +
        template<typename View >
        View subimage_view (View const &src, typename View::point_t const &topleft, typename View::point_t const &dimensions)
         
        +
        View subimage_view (View const &src, typename View::point_t const &topleft, typename View::point_t const &dimensions)
         
        template<typename View >
        View subimage_view (View const &src, typename View::coord_t x_min, typename View::coord_t y_min, typename View::coord_t width, typename View::coord_t height)
         
        template<typename ... Views>
        auto subimage_view (any_image_view< Views... > const &src, point_t const &topleft, point_t const &dimensions) -> any_image_view< Views... >
         
        template<typename ... Views>
        auto subimage_view (any_image_view< Views... > const &src, std::ptrdiff_t x_min, std::ptrdiff_t y_min, std::ptrdiff_t width, std::ptrdiff_t height) -> any_image_view< Views... >
         
        View subimage_view (View const &src, typename View::coord_t x_min, typename View::coord_t y_min, typename View::coord_t width, typename View::coord_t height)
         
        template<typename ... Views>
        auto subimage_view (any_image_view< Views... > const &src, point_t const &topleft, point_t const &dimensions) -> any_image_view< Views... >
         
        template<typename ... Views>
        auto subimage_view (any_image_view< Views... > const &src, std::ptrdiff_t x_min, std::ptrdiff_t y_min, std::ptrdiff_t width, std::ptrdiff_t height) -> any_image_view< Views... >
         

        Detailed Description

        view of an axis-aligned rectangular area within an image_view

        Function Documentation

        - -

        ◆ subimage_view() [1/2]

        + +

        ◆ subimage_view() [1/2]

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___pixel_algorithm.html b/html/reference/group___pixel_algorithm.html index 71641a52d..85152dfa1 100644 --- a/html/reference/group___pixel_algorithm.html +++ b/html/reference/group___pixel_algorithm.html @@ -4,7 +4,7 @@ - + Generic Image Library: Algorithms and Utility Functions @@ -27,30 +27,30 @@
        - + +/* @license-end */ +
        -
        -
        Algorithms and Utility Functions
        +
        Algorithms and Utility Functions

        Pixel algorithms, metafunctions and utility functions. More...

        - + @@ -118,17 +120,19 @@ template<typename View > - -

        ◆ subimage_view() [2/2]

        + +

        ◆ subimage_view() [2/2]

        +
        +template<typename ... Views>
        auto boost::gil::subimage_view auto subimage_view ( any_image_view< Views... > const &  src,

        Represents the value of an unsigned integral channel operating over a bit range. Models: ChannelValueConcept Example:

        // A 4-bit unsigned integral channel.
        -
        using bits4 = packed_channel_value<4>;
        +
        using bits4 = packed_channel_value<4>;
        assert(channel_traits<bits4>::min_value()==0);
        assert(channel_traits<bits4>::max_value()==15);
        assert(sizeof(bits4)==1);
        -
        static_assert(gil::is_channel_integral<bits4>::value, "");
        +
        static_assert(gil::is_channel_integral<bits4>::value, "");
        diff --git a/html/reference/group___pixel.html b/html/reference/group___pixel.html index 056b53131..00406dfc4 100644 --- a/html/reference/group___pixel.html +++ b/html/reference/group___pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pixel @@ -27,37 +27,37 @@
        - + +/* @license-end */ +
        -
        -
        Pixel
        +
        Pixel

        A pixel is a set of channels defining the color at a given point in an image. More...

        - + @@ -185,7 +189,7 @@ template<typename View > diff --git a/html/reference/group___image_view_transformations_subsampled.html b/html/reference/group___image_view_transformations_subsampled.html index 995e377a6..a86829b86 100644 --- a/html/reference/group___image_view_transformations_subsampled.html +++ b/html/reference/group___image_view_transformations_subsampled.html @@ -4,7 +4,7 @@ - + Generic Image Library: subsampled_view @@ -27,59 +27,61 @@
        - + +/* @license-end */ +

        view of a subsampled version of an image_view, stepping over a number of channels in X and number of rows in Y More...

        auto boost::gil::subimage_view auto subimage_view ( any_image_view< Views... > const &  src,
        - - - - - + + - - - - - - - - + + + + + + + +

        +

        Functions

        +
        template<typename View >
        auto subsampled_view (View const &src, typename View::coord_t x_step, typename View::coord_t y_step) -> typename dynamic_xy_step_type< View >::type
         
        +
        auto subsampled_view (View const &src, typename View::coord_t x_step, typename View::coord_t y_step) -> typename dynamic_xy_step_type< View >::type
         
        template<typename View >
        auto subsampled_view (View const &src, typename View::point_t const &step) -> typename dynamic_xy_step_type< View >::type
         
        template<typename ... Views>
        auto subsampled_view (any_image_view< Views... > const &src, point_t const &step) -> typename dynamic_xy_step_type< any_image_view< Views... >>::type
         
        template<typename ... Views>
        auto subsampled_view (any_image_view< Views... > const &src, std::ptrdiff_t x_step, std::ptrdiff_t y_step) -> typename dynamic_xy_step_type< any_image_view< Views... >>::type
         
        auto subsampled_view (View const &src, typename View::point_t const &step) -> typename dynamic_xy_step_type< View >::type
         
        template<typename ... Views>
        auto subsampled_view (any_image_view< Views... > const &src, point_t const &step) -> typename dynamic_xy_step_type< any_image_view< Views... > >::type
         
        template<typename ... Views>
        auto subsampled_view (any_image_view< Views... > const &src, std::ptrdiff_t x_step, std::ptrdiff_t y_step) -> typename dynamic_xy_step_type< any_image_view< Views... > >::type
         

        Detailed Description

        view of a subsampled version of an image_view, stepping over a number of channels in X and number of rows in Y

        Function Documentation

        - -

        ◆ subsampled_view() [1/2]

        + +

        ◆ subsampled_view() [1/2]

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___packed_channel_value_model.html b/html/reference/group___packed_channel_value_model.html index 2e00496be..2009ad074 100644 --- a/html/reference/group___packed_channel_value_model.html +++ b/html/reference/group___packed_channel_value_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_channel_value @@ -27,28 +27,28 @@
        - + +/* @license-end */ +
        -
        -
        packed_channel_value
        +
        packed_channel_value
        - + @@ -112,17 +114,19 @@ template<typename View > - -

        ◆ subsampled_view() [2/2]

        + +

        ◆ subsampled_view() [2/2]

        +
        +template<typename ... Views>
        auto boost::gil::subsampled_view auto subsampled_view ( any_image_view< Views... > const &  src,
        diff --git a/html/reference/group___packed_channel_reference_model.html b/html/reference/group___packed_channel_reference_model.html index 2c459f13f..4e3f22505 100644 --- a/html/reference/group___packed_channel_reference_model.html +++ b/html/reference/group___packed_channel_reference_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_channel_reference @@ -27,47 +27,47 @@
        - + +/* @license-end */ +
        -
        -
        packed_channel_reference
        +
        packed_channel_reference
        - + @@ -167,7 +171,7 @@ template<typename View > diff --git a/html/reference/group___image_view_transformations_transposed.html b/html/reference/group___image_view_transformations_transposed.html index 1c92a2ac4..36597913b 100644 --- a/html/reference/group___image_view_transformations_transposed.html +++ b/html/reference/group___image_view_transformations_transposed.html @@ -4,7 +4,7 @@ - + Generic Image Library: transposed_view @@ -27,52 +27,54 @@
        - + +/* @license-end */ +

        view of a view transposed More...

        auto boost::gil::subsampled_view auto subsampled_view ( any_image_view< Views... > const &  src,
        - - - - - - - + + + + +

        +

        Functions

        +
        template<typename View >
        auto transposed_view (View const &src) -> typename dynamic_xy_step_transposed_type< View >::type
         
        template<typename ... Views>
        auto transposed_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... >>::type
         
        auto transposed_view (View const &src) -> typename dynamic_xy_step_transposed_type< View >::type
         
        template<typename ... Views>
        auto transposed_view (any_image_view< Views... > const &src) -> typename dynamic_xy_step_transposed_type< any_image_view< Views... > >::type
         

        Detailed Description

        view of a view transposed

        Function Documentation

        - -

        ◆ transposed_view()

        + +

        ◆ transposed_view()

        +
        +template<typename ... Views>
        diff --git a/html/reference/group___p_n_g___i_o.html b/html/reference/group___p_n_g___i_o.html index 8b9cee4d5..f153ceaf5 100644 --- a/html/reference/group___p_n_g___i_o.html +++ b/html/reference/group___p_n_g___i_o.html @@ -4,7 +4,7 @@ - + Generic Image Library: PNG I/O @@ -27,20 +27,20 @@
        - + +/* @license-end */ +
        -
        -
        PNG I/O
        +
        PNG I/O
        @@ -53,7 +53,7 @@ $(function() { diff --git a/html/reference/group___packed_channel_dynamic_reference_model.html b/html/reference/group___packed_channel_dynamic_reference_model.html index 77f03df46..b78732ec6 100644 --- a/html/reference/group___packed_channel_dynamic_reference_model.html +++ b/html/reference/group___packed_channel_dynamic_reference_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_dynamic_channel_reference @@ -27,30 +27,30 @@

        - + +/* @license-end */ +
        -
        -
        packed_dynamic_channel_reference
        +
        packed_dynamic_channel_reference

        Represents a reference proxy to a channel operating over a bit range whose offset is specified at run time. Models ChannelConcept. More...

        - + @@ -101,7 +103,7 @@ template<typename View > diff --git a/html/reference/group___j_p_e_g___i_o.html b/html/reference/group___j_p_e_g___i_o.html index 17013dd24..c9b5cca45 100644 --- a/html/reference/group___j_p_e_g___i_o.html +++ b/html/reference/group___j_p_e_g___i_o.html @@ -4,7 +4,7 @@ - + Generic Image Library: JPEG I/O @@ -27,20 +27,20 @@
        - + +/* @license-end */ +
        -
        -
        JPEG I/O
        +
        JPEG I/O
        @@ -53,7 +53,7 @@ $(function() { diff --git a/html/reference/group___layout_model.html b/html/reference/group___layout_model.html index 10599cd5c..95dc54e95 100644 --- a/html/reference/group___layout_model.html +++ b/html/reference/group___layout_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Layouts @@ -27,56 +27,56 @@

        - + +/* @license-end */ +
        auto boost::gil::transposed_view auto transposed_view ( any_image_view< Views... > const &  src)
        -

        +

        Classes

        struct  devicen_layout_t< N >
         unnamed color layout of up to five channels More...
         
        - - - - - - - - -

        +

        Typedefs

        +
        using cmyk_layout_t = layout< cmyk_t >
         
        +
        using gray_layout_t = layout< gray_t >
         
        +
        using rgb_layout_t = layout< rgb_t >
         
        +
        using bgr_layout_t = layout< rgb_t, mp11::mp_list_c< int, 2, 1, 0 > >
         
        +
        using rgba_layout_t = layout< rgba_t >
         
        +
        using bgra_layout_t = layout< rgba_t, mp11::mp_list_c< int, 2, 1, 0, 3 > >
         
        +
        using argb_layout_t = layout< rgba_t, mp11::mp_list_c< int, 1, 2, 3, 0 > >
         
        +
        using abgr_layout_t = layout< rgba_t, mp11::mp_list_c< int, 3, 2, 1, 0 > >
         
        @@ -87,7 +87,7 @@ using 
        abgr_layout_t = diff --git a/html/reference/group___locator2_d_concept.html b/html/reference/group___locator2_d_concept.html index fee87112f..505235e1d 100644 --- a/html/reference/group___locator2_d_concept.html +++ b/html/reference/group___locator2_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccess2DLocatorConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        RandomAccess2DLocatorConcept
        +
        RandomAccess2DLocatorConcept

        2-dimensional locator More...

        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___locator_n_d_concept.html b/html/reference/group___locator_n_d_concept.html index 8c995d067..9233fa69b 100644 --- a/html/reference/group___locator_n_d_concept.html +++ b/html/reference/group___locator_n_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccessNDLocatorConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        RandomAccessNDLocatorConcept
        +
        RandomAccessNDLocatorConcept

        N-dimensional locator. More...

        +

        Classes

        struct  RandomAccess2DLocatorConcept< Loc >
         2-dimensional locator over immutable values More...
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___metafunctions.html b/html/reference/group___metafunctions.html index b6be73a07..87f7f141d 100644 --- a/html/reference/group___metafunctions.html +++ b/html/reference/group___metafunctions.html @@ -4,7 +4,7 @@ - + Generic Image Library: Metafunctions @@ -27,34 +27,34 @@
        - + +/* @license-end */ +
        -
        -
        Metafunctions
        +
        Metafunctions

        Metafunctions to construct or query GIL types. More...

        +

        Classes

        struct  RandomAccessNDLocatorConcept< Loc >
         N-dimensional locator over immutable values. More...
        - - + - +

        +

        Modules

         Type Factory Metafunctions
         Type Factory Metafunctions
         Metafunctions that construct GIL types from related types or from components.
         
         Type Analysis Metafunctions
         Type Analysis Metafunctions
         Metafunctions that determine properties of GIL types.
         
        @@ -66,7 +66,7 @@ Modules
        - @@ -59,28 +59,28 @@ Classes

        +

        Classes

        class  packed_dynamic_channel_reference< BitField, NumBits, false >
         Models a constant subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter. More...
         Models a mutable subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter. More...
         
        - - - - - - + + + - - - - + + + - - - + + +

        +

        Functions

        +
        template<typename BF , int NB, bool M, typename R >
        void swap (const boost::gil::packed_dynamic_channel_reference< BF, NB, M > x, R &y)
         swap for packed_dynamic_channel_reference
         
        +
        void swap (const boost::gil::packed_dynamic_channel_reference< BF, NB, M > x, R &y)
         swap for packed_dynamic_channel_reference
         
        template<typename BF , int NB, bool M>
        void swap (typename boost::gil::packed_dynamic_channel_reference< BF, NB, M >::value_type &x, const boost::gil::packed_dynamic_channel_reference< BF, NB, M > y)
         swap for packed_dynamic_channel_reference
         
        +
        void swap (typename boost::gil::packed_dynamic_channel_reference< BF, NB, M >::value_type &x, const boost::gil::packed_dynamic_channel_reference< BF, NB, M > y)
         swap for packed_dynamic_channel_reference
         
        template<typename BF , int NB, bool M>
        void swap (const boost::gil::packed_dynamic_channel_reference< BF, NB, M > x, const boost::gil::packed_dynamic_channel_reference< BF, NB, M > y)
         swap for packed_dynamic_channel_reference
         
        void swap (const boost::gil::packed_dynamic_channel_reference< BF, NB, M > x, const boost::gil::packed_dynamic_channel_reference< BF, NB, M > y)
         swap for packed_dynamic_channel_reference
         

        Detailed Description

        Represents a reference proxy to a channel operating over a bit range whose offset is specified at run time. Models ChannelConcept.

        Example:

        // Reference to a 2-bit channel whose offset is specified at construction time
        -
        using bits2_dynamic_ref_t = packed_dynamic_channel_reference<uint8_t,2,true> const;
        +
        using bits2_dynamic_ref_t = packed_dynamic_channel_reference<uint8_t,2,true> const;
        uint16_t data=0;
        bits2_dynamic_ref_t channel_ref(&data,1);
        @@ -92,7 +92,7 @@ template<typename BF , int NB, bool M>
        - - - - - - + + + - - - - + + + - - - + + +

        +

        Functions

        +
        template<typename BF , int FB, int NB, bool M, typename R >
        void swap (boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
         swap for packed_channel_reference
         
        +
        void swap (boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
         swap for packed_channel_reference
         
        template<typename BF , int FB, int NB, bool M>
        void swap (typename boost::gil::packed_channel_reference< BF, FB, NB, M >::value_type &x, boost::gil::packed_channel_reference< BF, FB, NB, M > const y)
         swap for packed_channel_reference
         
        +
        void swap (typename boost::gil::packed_channel_reference< BF, FB, NB, M >::value_type &x, boost::gil::packed_channel_reference< BF, FB, NB, M > const y)
         swap for packed_channel_reference
         
        template<typename BF , int FB, int NB, bool M>
        void swap (boost::gil::packed_channel_reference< BF, FB, NB, M > const x, boost::gil::packed_channel_reference< BF, FB, NB, M > const y)
         swap for packed_channel_reference
         
        void swap (boost::gil::packed_channel_reference< BF, FB, NB, M > const x, boost::gil::packed_channel_reference< BF, FB, NB, M > const y)
         swap for packed_channel_reference
         

        Detailed Description

        The value of a subbyte channel. Models: ChannelValueConcept

        Represents a reference proxy to a channel operating over a bit range whose offset is fixed at compile time. Models ChannelConcept Example:

        // Reference to a 2-bit channel starting at bit 1 (i.e. the second bit)
        -
        using bits2_1_ref_t = packed_channel_reference<uint16_t,1,2,true> const;
        +
        using bits2_1_ref_t = packed_channel_reference<uint16_t,1,2,true> const;
        uint16_t data=0;
        bits2_1_ref_t channel_ref(&data);
        @@ -79,7 +79,7 @@ template<typename BF , int FB, int NB, bool M>
        - - +

        +

        Modules

         packed_channel_reference
         packed_channel_reference
         

        Detailed Description

        @@ -61,19 +61,19 @@ Modules
        - - + - + - +

        +

        Modules

         Concepts
         Concepts
         Pixel concepts.
         
         Models
         Models
         Pixel models.
         
         Algorithms and Utility Functions
         Algorithms and Utility Functions
         Pixel algorithms, metafunctions and utility functions.
         
        @@ -70,7 +70,7 @@ Modules
        - @@ -59,13 +59,13 @@ Classes

        +

        Classes

        struct  default_color_converter
         class for color-converting one pixel to another More...
         Returns whether two pixels are compatible Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another. More...
         
        - - - - - + + +

        +

        Functions

        +
        template<typename SrcP , typename DstP >
        void color_convert (const SrcP &src, DstP &dst)
         helper function for converting one pixel to another using GIL default color-converters where ScrP models HomogeneousPixelConcept DstP models HomogeneousPixelValueConcept
         
        void color_convert (const SrcP &src, DstP &dst)
         helper function for converting one pixel to another using GIL default color-converters where ScrP models HomogeneousPixelConcept DstP models HomogeneousPixelValueConcept
         

        Detailed Description

        Pixel algorithms, metafunctions and utility functions.

        @@ -76,7 +76,7 @@ template<typename SrcP , typename DstP >
        - - + - + - +

        +

        Modules

         Concepts
         Concepts
         PixelBased concepts.
         
         Models
         Models
         PixelBased models.
         
         Algorithms and Utility Functions
         Algorithms and Utility Functions
         PixelBased algorithms, metafunctions and utility functions.
         
        @@ -70,7 +70,7 @@ Modules
        - @@ -57,21 +57,21 @@ Classes

        +

        Classes

        struct  num_channels< PixelBased >
         Returns the number of channels of a pixel-based GIL construct. More...

        Detailed Description

        PixelBased algorithms, metafunctions and utility functions.

        -

        Example:

        static_assert(num_channels<rgb8_view_t>::value == 3, "");
        -
        static_assert(num_channels<cmyk16_planar_ptr_t>::value == 4, "");
        +

        Example:

        static_assert(num_channels<rgb8_view_t>::value == 3, "");
        +
        static_assert(num_channels<cmyk16_planar_ptr_t>::value == 4, "");
        -
        static_assert(is_planar<rgb16_planar_image_t>::value));
        -
        static_assert(std::is_same<color_space_type<rgb8_planar_ref_t>::type, rgb_t>::value, "");
        -
        static_assert(std::is_same<channel_mapping_type<cmyk8_pixel_t>::type,
        +
        static_assert(is_planar<rgb16_planar_image_t>::value));
        +
        static_assert(std::is_same<color_space_type<rgb8_planar_ref_t>::type, rgb_t>::value, "");
        +
        static_assert(std::is_same<channel_mapping_type<cmyk8_pixel_t>::type,
        channel_mapping_type<rgba8_pixel_t>::type>::value, "");
        -
        static_assert(std::is_same<channel_type<bgr8_pixel_t>::type, uint8_t>::value, "");
        +
        static_assert(std::is_same<channel_type<bgr8_pixel_t>::type, uint8_t>::value, "");
        diff --git a/html/reference/group___pixel_based_concept.html b/html/reference/group___pixel_based_concept.html index fd0213e50..161f61060 100644 --- a/html/reference/group___pixel_based_concept.html +++ b/html/reference/group___pixel_based_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,29 +27,29 @@

        - + +/* @license-end */ +
        -
        -
        Concepts
        +
        Concepts

        PixelBased concepts. More...

        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___pixel_based_model.html b/html/reference/group___pixel_based_model.html index 266df3a9e..3bb9728cd 100644 --- a/html/reference/group___pixel_based_model.html +++ b/html/reference/group___pixel_based_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,36 +27,36 @@
        - + +/* @license-end */ +
        -
        -
        +

        PixelBased models. More...

        +

        Classes

        struct  PixelBasedConcept< P >
         Concept for all pixel-based GIL constructs. More...
        - - +

        +

        Modules

         bit_aligned_pixel_reference
         bit_aligned_pixel_reference
         A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
         
        - @@ -109,7 +109,7 @@ Classes diff --git a/html/reference/group___pixel_concept.html b/html/reference/group___pixel_concept.html index 9632edc6a..c16529a42 100644 --- a/html/reference/group___pixel_concept.html +++ b/html/reference/group___pixel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        Concepts
        +
        Concepts

        Pixel concepts. More...

        +

        Classes

        struct  bit_aligned_pixel_iterator< NonAlignedPixelReference >
         An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
        - @@ -84,7 +84,7 @@ Classes diff --git a/html/reference/group___pixel_dereference_adaptor.html b/html/reference/group___pixel_dereference_adaptor.html index b5222de98..9aa47be95 100644 --- a/html/reference/group___pixel_dereference_adaptor.html +++ b/html/reference/group___pixel_dereference_adaptor.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pixel Dereference Adaptor @@ -27,33 +27,33 @@
        - + +/* @license-end */ +
        -
        -
        Pixel Dereference Adaptor
        +
        Pixel Dereference Adaptor

        A function object invoked upon accessing of the pixel of a pixel iterator/locator/view. More...

        +

        Classes

        struct  PixelConcept< P >
         Pixel concept - A color base whose elements are channels. More...
        - - + - +

        +

        Modules

         Concepts
         Concepts
         
         Models
         Models
         

        Detailed Description

        @@ -64,7 +64,7 @@ Modules
        - @@ -59,7 +59,7 @@ Classes diff --git a/html/reference/group___pixel_dereference_adaptor_model.html b/html/reference/group___pixel_dereference_adaptor_model.html index 119897018..0d8316264 100644 --- a/html/reference/group___pixel_dereference_adaptor_model.html +++ b/html/reference/group___pixel_dereference_adaptor_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,26 +27,26 @@
        - + +/* @license-end */ +

        +

        Classes

        struct  PixelDereferenceAdaptorConcept< D >
         Represents a unary function object that can be invoked upon dereferencing a pixel iterator. More...
        - @@ -71,7 +71,7 @@ Classes diff --git a/html/reference/group___pixel_image_view_concept.html b/html/reference/group___pixel_image_view_concept.html index 4a1aceffd..5c9e24d74 100644 --- a/html/reference/group___pixel_image_view_concept.html +++ b/html/reference/group___pixel_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageViewConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        ImageViewConcept
        +
        ImageViewConcept

        2-dimensional range over pixel data More...

        +

        Classes

        class  color_convert_deref_fn< SrcConstRefP, DstP, CC >
         Function object that given a source pixel, returns it converted to a given color space and channel depth. Models: PixelDereferenceAdaptorConcept. More...
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___pixel_iterator.html b/html/reference/group___pixel_iterator.html index 659598665..23bb62e82 100644 --- a/html/reference/group___pixel_iterator.html +++ b/html/reference/group___pixel_iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pixel Iterator @@ -27,34 +27,34 @@
        - + +/* @license-end */ +
        -
        -
        Pixel Iterator
        +
        Pixel Iterator

        STL Iterators over models of PixelConcept. More...

        +

        Classes

        struct  ImageViewConcept< View >
         GIL's 2-dimensional view over immutable GIL pixels. More...
        - - + - +

        +

        Modules

         Concepts
         Concepts
         Pixel iterator concepts.
         
         Models
         Models
         Pixel iterator models.
         
        @@ -66,7 +66,7 @@ Modules
        - - + - + - +

        +

        Modules

         PixelIteratorConcept
         PixelIteratorConcept
         STL iterator over pixels.
         
         StepIteratorConcept
         StepIteratorConcept
         Iterator that advances by a specified step.
         
         IteratorAdaptorConcept
         IteratorAdaptorConcept
         Adaptor over another iterator.
         
        - @@ -76,7 +76,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_concept_iterator_adaptor.html b/html/reference/group___pixel_iterator_concept_iterator_adaptor.html index edfc6f8ac..a15b92fd3 100644 --- a/html/reference/group___pixel_iterator_concept_iterator_adaptor.html +++ b/html/reference/group___pixel_iterator_concept_iterator_adaptor.html @@ -4,7 +4,7 @@ - + Generic Image Library: IteratorAdaptorConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        IteratorAdaptorConcept
        +
        IteratorAdaptorConcept

        Adaptor over another iterator. More...

        +

        Classes

        struct  HasDynamicXStepTypeConcept< T >
         Concept for iterators, locators and views that can define a type just like the given iterator, locator or view, except it supports runtime specified step along the X navigation. More...
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_concept_pixel_iterator.html b/html/reference/group___pixel_iterator_concept_pixel_iterator.html index 8cec692fb..c39617f50 100644 --- a/html/reference/group___pixel_iterator_concept_pixel_iterator.html +++ b/html/reference/group___pixel_iterator_concept_pixel_iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelIteratorConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        PixelIteratorConcept
        +
        PixelIteratorConcept

        STL iterator over pixels. More...

        +

        Classes

        struct  IteratorAdaptorConcept< Iterator >
         Iterator adaptor is a forward iterator adapting another forward iterator. More...
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_concept_step_iterator.html b/html/reference/group___pixel_iterator_concept_step_iterator.html index 01dcb4281..5fb995a6a 100644 --- a/html/reference/group___pixel_iterator_concept_step_iterator.html +++ b/html/reference/group___pixel_iterator_concept_step_iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: StepIteratorConcept @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        StepIteratorConcept
        +
        StepIteratorConcept

        Iterator that advances by a specified step. More...

        +

        Classes

        struct  PixelIteratorConcept< Iterator >
         An STL random access traversal iterator over a model of PixelConcept. More...
        - @@ -69,7 +69,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_model.html b/html/reference/group___pixel_iterator_model.html index bf9f19bba..98a7b0f35 100644 --- a/html/reference/group___pixel_iterator_model.html +++ b/html/reference/group___pixel_iterator_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,52 +27,52 @@
        - + +/* @license-end */ +

        Pixel iterator models. More...

        +

        Classes

        struct  MemoryBasedIteratorConcept< Iterator >
         Concept of a random-access iterator that can be advanced in memory units (bytes or bits) More...
        - - + - + - + - + - + - + - + - +

        +

        Modules

         bit_aligned_pixel_iterator
         bit_aligned_pixel_iterator
         An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
         
         iterator_from_2d
         iterator_from_2d
         pixel step iterator, pixel image iterator and pixel dereference iterator
         
         Pointer to packed_pixel<P,CR,Layout>
         Pointer to packed_pixel<P,CR,Layout>
         Support for interleaved iterators over packed pixel.
         
         C pointer to a pixel
         C pointer to a pixel
         Iterators over interleaved pixels. A C pointer to a model of PixelValueConcept is used as an iterator over interleaved pixels. Models PixelIteratorConcept, HomogeneousPixelBasedConcept, HasDynamicXStepTypeConcept, MemoryBasedIteratorConcept.
         
         dereference_iterator_adaptor
         dereference_iterator_adaptor
         An iterator that invokes a provided function object upon dereference. Models: IteratorAdaptorConcept, PixelIteratorConcept.
         
         planar_pixel_iterator
         planar_pixel_iterator
         An iterator over planar pixels. Models PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
         
         position_iterator
         position_iterator
         An iterator that remembers its current X,Y position and invokes a function object with it upon dereferencing. Models PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. Used to create virtual image views.
         
         step iterators
         step iterators
         Iterators that allow for specifying the step between two adjacent values.
         
        @@ -84,7 +84,7 @@ Modules
        - @@ -69,7 +69,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_model_from_locator.html b/html/reference/group___pixel_iterator_model_from_locator.html index ab1d493ac..340b74013 100644 --- a/html/reference/group___pixel_iterator_model_from_locator.html +++ b/html/reference/group___pixel_iterator_model_from_locator.html @@ -4,7 +4,7 @@ - + Generic Image Library: iterator_from_2d @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        iterator_from_2d
        +
        iterator_from_2d

        pixel step iterator, pixel image iterator and pixel dereference iterator More...

        +

        Classes

        class  dereference_iterator_adaptor< Iterator, DFn >
         An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept. More...
        - @@ -65,7 +65,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_model_interleaved_ptr.html b/html/reference/group___pixel_iterator_model_interleaved_ptr.html index 931740c2e..dbca073a1 100644 --- a/html/reference/group___pixel_iterator_model_interleaved_ptr.html +++ b/html/reference/group___pixel_iterator_model_interleaved_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: C pointer to a pixel @@ -27,20 +27,20 @@
        - + +/* @license-end */ +
        -
        -
        C pointer to a pixel
        +
        C pointer to a pixel
        @@ -54,7 +54,7 @@ $(function() { diff --git a/html/reference/group___pixel_iterator_model_packed_interleaved_ptr.html b/html/reference/group___pixel_iterator_model_packed_interleaved_ptr.html index 91537f57e..6dceb1b7e 100644 --- a/html/reference/group___pixel_iterator_model_packed_interleaved_ptr.html +++ b/html/reference/group___pixel_iterator_model_packed_interleaved_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pointer to packed_pixel<P,CR,Layout> @@ -27,20 +27,20 @@

        - + +/* @license-end */ +
        -
        -
        Pointer to packed_pixel<P,CR,Layout>
        +
        Pointer to packed_pixel<P,CR,Layout>
        @@ -54,7 +54,7 @@ $(function() { diff --git a/html/reference/group___pixel_iterator_model_planar_ptr.html b/html/reference/group___pixel_iterator_model_planar_ptr.html index 97ab300af..f98af2347 100644 --- a/html/reference/group___pixel_iterator_model_planar_ptr.html +++ b/html/reference/group___pixel_iterator_model_planar_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_iterator @@ -27,29 +27,29 @@

        - + +/* @license-end */ +
        -
        -
        planar_pixel_iterator
        +
        planar_pixel_iterator

        +

        Classes

        class  iterator_from_2d< Loc2 >
         Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. More...
        - @@ -63,7 +63,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_model_step_ptr.html b/html/reference/group___pixel_iterator_model_step_ptr.html index 3fd36aa0f..828f170f3 100644 --- a/html/reference/group___pixel_iterator_model_step_ptr.html +++ b/html/reference/group___pixel_iterator_model_step_ptr.html @@ -4,7 +4,7 @@ - + Generic Image Library: step iterators @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        step iterators
        +
        step iterators

        Iterators that allow for specifying the step between two adjacent values. More...

        +

        Classes

        struct  planar_pixel_iterator< ChannelPtr, ColorSpace >
         An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
        - @@ -69,7 +69,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_model_virtual.html b/html/reference/group___pixel_iterator_model_virtual.html index be49abbde..5c6bac323 100644 --- a/html/reference/group___pixel_iterator_model_virtual.html +++ b/html/reference/group___pixel_iterator_model_virtual.html @@ -4,7 +4,7 @@ - + Generic Image Library: position_iterator @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        position_iterator
        +
        position_iterator

        An iterator that remembers its current X,Y position and invokes a function object with it upon dereferencing. Models PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. Used to create virtual image views. More...

        +

        Classes

        class  step_iterator_adaptor< Derived, Iterator, SFn >
         An adaptor over an existing iterator that changes the step unit. More...
        - @@ -63,7 +63,7 @@ Classes diff --git a/html/reference/group___pixel_iterator_non_aligned_pixel_iterator.html b/html/reference/group___pixel_iterator_non_aligned_pixel_iterator.html index e361c1017..6f5db7dc2 100644 --- a/html/reference/group___pixel_iterator_non_aligned_pixel_iterator.html +++ b/html/reference/group___pixel_iterator_non_aligned_pixel_iterator.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_pixel_iterator @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        bit_aligned_pixel_iterator
        +
        bit_aligned_pixel_iterator

        +

        Classes

        struct  position_iterator< Deref, Dim >
         An iterator that remembers its current X,Y position and invokes a function object with it upon dereferencing. Used to create virtual image views. Models: StepIteratorConcept, PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept. More...
        - @@ -64,7 +64,7 @@ Classes diff --git a/html/reference/group___pixel_locator.html b/html/reference/group___pixel_locator.html index 8af67ad20..1d85242ca 100644 --- a/html/reference/group___pixel_locator.html +++ b/html/reference/group___pixel_locator.html @@ -4,7 +4,7 @@ - + Generic Image Library: Pixel Locator @@ -27,34 +27,34 @@
        - + +/* @license-end */ +
        -
        -
        Pixel Locator
        +
        Pixel Locator

        Generalization of an iterator to multiple dimensions. More...

        +

        Classes

        struct  bit_aligned_pixel_iterator< NonAlignedPixelReference >
         An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More...
        - - + - +

        +

        Modules

         Concepts
         Concepts
         Pixel locator concepts.
         
         Models
         Models
         Pixel locator models.
         
        @@ -66,7 +66,7 @@ Modules
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___pixel_locator_concept.html b/html/reference/group___pixel_locator_concept.html index 41e4303f5..3ce08498b 100644 --- a/html/reference/group___pixel_locator_concept.html +++ b/html/reference/group___pixel_locator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,42 +27,42 @@
        - + +/* @license-end */ +
        -
        -
        +

        Pixel locator concepts. More...

        +

        Classes

        struct  PixelLocatorConcept< Loc >
         GIL's 2-dimensional locator over immutable GIL pixels. More...
        - - + - + - +

        +

        Modules

         RandomAccessNDLocatorConcept
         RandomAccessNDLocatorConcept
         N-dimensional locator.
         
         RandomAccess2DLocatorConcept
         RandomAccess2DLocatorConcept
         2-dimensional locator
         
         PixelLocatorConcept
         PixelLocatorConcept
         2-dimensional locator over pixel data
         
        - @@ -79,7 +79,7 @@ Classes diff --git a/html/reference/group___pixel_locator_model.html b/html/reference/group___pixel_locator_model.html index fdb72ba6f..9209992c3 100644 --- a/html/reference/group___pixel_locator_model.html +++ b/html/reference/group___pixel_locator_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,29 +27,29 @@
        - + +/* @license-end */ +

        Pixel locator models. More...

        +

        Classes

        struct  HasDynamicYStepTypeConcept< T >
         Concept for locators and views that can define a type just like the given locator or view, except it supports runtime specified step along the Y navigation. More...
        - @@ -69,7 +69,7 @@ Classes diff --git a/html/reference/group___pixel_model.html b/html/reference/group___pixel_model.html index 1bc151f15..5b63f69ee 100644 --- a/html/reference/group___pixel_model.html +++ b/html/reference/group___pixel_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,40 +27,40 @@
        - + +/* @license-end */ +
        -
        -
        Models
        +
        Models

        Pixel models. More...

        +

        Classes

        class  virtual_2d_locator< DerefFn, IsTransposed >
         A 2D locator over a virtual image Upon dereferencing, invokes a given function object passing it its coordinates. Models: PixelLocatorConcept, HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, HasTransposedTypeConcept. More...
        - - + - + - + - +

        +

        Modules

         bit_aligned_pixel_reference
         bit_aligned_pixel_reference
         A heterogeneous pixel reference used to represent non-byte-aligned pixels. Models PixelConcept.
         
         packed_pixel
         packed_pixel
         A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept.
         
         pixel
         pixel
         A homogeneous pixel value. Models HomogeneousPixelValueConcept.
         
         planar_pixel_reference
         planar_pixel_reference
         A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept.
         
        @@ -72,7 +72,7 @@ Modules
        @@ -78,7 +78,7 @@ $(function() { diff --git a/html/reference/group___pixel_model_packed_pixel.html b/html/reference/group___pixel_model_packed_pixel.html index 11e578f21..9213094fc 100644 --- a/html/reference/group___pixel_model_packed_pixel.html +++ b/html/reference/group___pixel_model_packed_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_pixel @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        packed_pixel
        +
        packed_pixel

        A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept. More...

        - @@ -57,22 +57,22 @@ Classes

        +

        Classes

        struct  packed_pixel< BitField, ChannelRefs, Layout >
         Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and their index. Models ColorBaseValueConcept, PixelValueConcept, PixelBasedConcept Typical use for this is a model of a packed pixel (like 565 RGB) More...

        Detailed Description

        A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept.

        -

        Example:

        using rgb565_pixel_t = packed_pixel_type<uint16_t, mp11::mp_list-c<unsigned,5,6,5>, rgb_layout_t>::type;
        -
        static_assert(sizeof(rgb565_pixel_t) == 2, "");
        +

        Example:

        using rgb565_pixel_t = packed_pixel_type<uint16_t, mp11::mp_list-c<unsigned,5,6,5>, rgb_layout_t>::type;
        +
        static_assert(sizeof(rgb565_pixel_t) == 2, "");
        rgb565_pixel_t r565;
        -
        get_color(r565,red_t()) = 31;
        -
        get_color(r565,green_t()) = 63;
        -
        get_color(r565,blue_t()) = 31;
        +
        get_color(r565,red_t()) = 31;
        +
        get_color(r565,green_t()) = 63;
        +
        get_color(r565,blue_t()) = 31;
        assert(r565 == rgb565_pixel_t((uint16_t)0xFFFF));
        -
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition: color_base_algorithm.hpp:190
        +
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition color_base_algorithm.hpp:190
        diff --git a/html/reference/group___pixel_model_pixel.html b/html/reference/group___pixel_model_pixel.html index 8262e43ce..4ab6ca203 100644 --- a/html/reference/group___pixel_model_pixel.html +++ b/html/reference/group___pixel_model_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel @@ -27,29 +27,29 @@

        - + +/* @license-end */ +
        -
        -
        pixel
        +
        pixel

        A homogeneous pixel value. Models HomogeneousPixelValueConcept. More...

        - @@ -63,7 +63,7 @@ Classes diff --git a/html/reference/group___pixel_model_planar_ref.html b/html/reference/group___pixel_model_planar_ref.html index d92353cf0..92e08ec7e 100644 --- a/html/reference/group___pixel_model_planar_ref.html +++ b/html/reference/group___pixel_model_planar_ref.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_reference @@ -27,30 +27,30 @@
        - + +/* @license-end */ +
        -
        -
        planar_pixel_reference
        +
        planar_pixel_reference

        A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept. More...

        +

        Classes

        struct  pixel< ChannelValue, Layout >
         Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
        - @@ -71,23 +71,23 @@ Classes

        +

        Classes

        struct  planar_pixel_reference< ChannelReference, ColorSpace >
         A reference proxy to a planar pixel. More...
         Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept. More...
         
        - - - - - - + + + - - - - + + + - - - + + +

        +

        Functions

        +
        template<typename CR , typename CS , typename R >
        void swap (const boost::gil::planar_pixel_reference< CR, CS > x, R &y)
         swap for planar_pixel_reference
         
        +
        void swap (const boost::gil::planar_pixel_reference< CR, CS > x, R &y)
         swap for planar_pixel_reference
         
        template<typename CR , typename CS >
        void swap (typename boost::gil::planar_pixel_reference< CR, CS >::value_type &x, const boost::gil::planar_pixel_reference< CR, CS > y)
         swap for planar_pixel_reference
         
        +
        void swap (typename boost::gil::planar_pixel_reference< CR, CS >::value_type &x, const boost::gil::planar_pixel_reference< CR, CS > y)
         swap for planar_pixel_reference
         
        template<typename CR , typename CS >
        void swap (const boost::gil::planar_pixel_reference< CR, CS > x, const boost::gil::planar_pixel_reference< CR, CS > y)
         swap for planar_pixel_reference
         
        void swap (const boost::gil::planar_pixel_reference< CR, CS > x, const boost::gil::planar_pixel_reference< CR, CS > y)
         swap for planar_pixel_reference
         

        Detailed Description

        A reference proxy to a planar pixel. Models HomogeneousColorBaseConcept, HomogeneousPixelConcept.

        @@ -97,7 +97,7 @@ template<typename CR , typename CS >
        - - + - + - +

        +

        Modules

         Concepts
         Concepts
         Concepts for points.
         
         Models
         Models
         Models for points.
         
         Algorithms and Utility Functions
         Algorithms and Utility Functions
         Algorithms and Utility Functions for points.
         
        @@ -69,7 +69,7 @@ Modules
        - - - - - + + - - + - - + - - + - - + - - + - +

        +

        Functions

        +
        template<typename T >
        auto iround (point< T > const &p) -> point< std::ptrdiff_t >
         
        +
        auto iround (point< T > const &p) -> point< std::ptrdiff_t >
         
        auto iround (point< float > const &p) -> point< std::ptrdiff_t >
         
        +
         
        auto iround (point< double > const &p) -> point< std::ptrdiff_t >
         
        +
         
        auto ifloor (point< float > const &p) -> point< std::ptrdiff_t >
         
        +
         
        auto ifloor (point< double > const &p) -> point< std::ptrdiff_t >
         
        +
         
        auto iceil (point< float > const &p) -> point< std::ptrdiff_t >
         
        +
         
        auto iceil (point< double > const &p) -> point< std::ptrdiff_t >
         
         

        Detailed Description

        Algorithms and Utility Functions for points.

        @@ -83,7 +83,7 @@ auto iceil ( diff --git a/html/reference/group___point_concept.html b/html/reference/group___point_concept.html index e229d72a7..3d540b2a0 100644 --- a/html/reference/group___point_concept.html +++ b/html/reference/group___point_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Concepts @@ -27,29 +27,29 @@

        - + +/* @license-end */ +
        -
        -
        Concepts
        +
        Concepts

        Concepts for points. More...

        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___point_model.html b/html/reference/group___point_model.html index 7c9bc5987..a0223fdd0 100644 --- a/html/reference/group___point_model.html +++ b/html/reference/group___point_model.html @@ -4,7 +4,7 @@ - + Generic Image Library: Models @@ -27,77 +27,77 @@
        - + +/* @license-end */ +
        -
        -
        Models
        +
        Models

        Models for points. More...

        +

        Classes

        struct  PointNDConcept< P >
         N-dimensional point concept. More...
        -

        +

        Classes

        class  point< T >
         2D point both axes of which have the same dimension typeModels: Point2DConcept More...
         
        - - - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - - + + - - + +

        +

        Functions

        +
        template<typename T >
        BOOST_FORCEINLINE bool operator== (const point< T > &p1, const point< T > &p2)
         
        +
        BOOST_FORCEINLINE bool operator== (const point< T > &p1, const point< T > &p2)
         
        template<typename T >
        BOOST_FORCEINLINE bool operator!= (const point< T > &p1, const point< T > &p2)
         
        +
        BOOST_FORCEINLINE bool operator!= (const point< T > &p1, const point< T > &p2)
         
        template<typename T >
        BOOST_FORCEINLINE point< T > operator+ (const point< T > &p1, const point< T > &p2)
         
        +
        BOOST_FORCEINLINE point< T > operator+ (const point< T > &p1, const point< T > &p2)
         
        template<typename T >
        BOOST_FORCEINLINE point< T > operator- (const point< T > &p)
         
        +
        BOOST_FORCEINLINE point< T > operator- (const point< T > &p)
         
        template<typename T >
        BOOST_FORCEINLINE point< T > operator- (const point< T > &p1, const point< T > &p2)
         
        +
        BOOST_FORCEINLINE point< T > operator- (const point< T > &p1, const point< T > &p2)
         
        template<typename T , typename D >
        BOOST_FORCEINLINE auto operator/ (point< T > const &p, D d) -> typename std::enable_if< std::is_arithmetic< D >::value, point< typename detail::std_common_type< T, D >::type > >::type
         
        +
        BOOST_FORCEINLINE auto operator/ (point< T > const &p, D d) -> typename std::enable_if< std::is_arithmetic< D >::value, point< typename detail::std_common_type< T, D >::type > >::type
         
        template<typename T , typename M >
        BOOST_FORCEINLINE auto operator* (point< T > const &p, M m) -> typename std::enable_if< std::is_arithmetic< M >::value, point< typename detail::std_common_type< T, M >::type > >::type
         
        +
        BOOST_FORCEINLINE auto operator* (point< T > const &p, M m) -> typename std::enable_if< std::is_arithmetic< M >::value, point< typename detail::std_common_type< T, M >::type > >::type
         
        template<typename T , typename M >
        BOOST_FORCEINLINE auto operator* (M m, point< T > const &p) -> typename std::enable_if< std::is_arithmetic< M >::value, point< typename detail::std_common_type< T, M >::type > >::type
         
        +
        BOOST_FORCEINLINE auto operator* (M m, point< T > const &p) -> typename std::enable_if< std::is_arithmetic< M >::value, point< typename detail::std_common_type< T, M >::type > >::type
         
        template<std::size_t K, typename T >
        BOOST_FORCEINLINE T const & axis_value (point< T > const &p)
         
        +
        BOOST_FORCEINLINE T const & axis_value (point< T > const &p)
         
        template<std::size_t K, typename T >
        BOOST_FORCEINLINE T & axis_value (point< T > &p)
         
        BOOST_FORCEINLINE T & axis_value (point< T > &p)
         

        Detailed Description

        Models for points.

        @@ -111,7 +111,7 @@ template<std::size_t K, typename T > diff --git a/html/reference/group___s_t_l_optimizations.html b/html/reference/group___s_t_l_optimizations.html index 2e60be9ac..a8bcf19ca 100644 --- a/html/reference/group___s_t_l_optimizations.html +++ b/html/reference/group___s_t_l_optimizations.html @@ -4,7 +4,7 @@ - + Generic Image Library: Performance overloads of STL algorithms @@ -27,70 +27,62 @@

        - + +/* @license-end */ +
        -
        -
        Performance overloads of STL algorithms
        +
        Performance overloads of STL algorithms

        overloads of STL algorithms allowing more efficient implementation when used with GIL constructs More...

        - - - - - - - - - - - - - - + + + - - - - - - - - - - - + + + + + + + + + + +

        +

        Functions

        -template<typename T , typename CS >
        BOOST_FORCEINLINE auto copy (boost::gil::pixel< T, CS > *first, boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
         Copy when both src and dst are interleaved and of the same type can be just memmove.
         
        -template<typename T , typename CS >
        BOOST_FORCEINLINE auto copy (const boost::gil::pixel< T, CS > *first, const boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
         Copy when both src and dst are interleaved and of the same type can be just memmove.
         
        +
        template<typename CS , typename IC1 , typename IC2 >
        BOOST_FORCEINLINE auto copy (boost::gil::planar_pixel_iterator< IC1, CS > first, boost::gil::planar_pixel_iterator< IC1, CS > last, boost::gil::planar_pixel_iterator< IC2, CS > dst) -> boost::gil::planar_pixel_iterator< IC2, CS >
         Copy when both src and dst are planar pointers is copy for each channel.
         
        +
        BOOST_FORCEINLINE auto copy (boost::gil::planar_pixel_iterator< IC1, CS > first, boost::gil::planar_pixel_iterator< IC1, CS > last, boost::gil::planar_pixel_iterator< IC2, CS > dst) -> boost::gil::planar_pixel_iterator< IC2, CS >
         Copy when both src and dst are planar pointers is copy for each channel.
         
        template<typename IL , typename OL >
        BOOST_FORCEINLINE auto copy1 (boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst) -> boost::gil::iterator_from_2d< OL >
         std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
         
        template<typename IL , typename V >
        void fill (boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
         std::fill(I,I,V) with I being a iterator_from_2d More...
         
        template<typename Loc1 , typename Loc2 >
        BOOST_FORCEINLINE bool equal (boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
         std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d More...
         
        BOOST_FORCEINLINE auto copy1 (boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst) -> boost::gil::iterator_from_2d< OL >
         std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
         
        template<typename IL , typename V >
        void fill (boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
         std::fill(I,I,V) with I being a iterator_from_2d
         
        template<typename Loc1 , typename Loc2 >
        BOOST_FORCEINLINE bool equal (boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
         std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
         

        Detailed Description

        overloads of STL algorithms allowing more efficient implementation when used with GIL constructs

        Function Documentation

        - -

        ◆ equal()

        + +

        ◆ equal()

        +
        +template<typename Loc1 , typename Loc2 >
        - + @@ -120,14 +112,16 @@ template<typename IL , typename OL > - -

        ◆ fill()

        + +

        ◆ fill()

        +
        +template<typename IL , typename V >
        BOOST_FORCEINLINE bool std::equal BOOST_FORCEINLINE bool equal ( boost::gil::iterator_from_2d< Loc1 >  first,
        - + @@ -163,7 +157,7 @@ template<typename IL , typename OL > diff --git a/html/reference/group___scaling_algorithms.html b/html/reference/group___scaling_algorithms.html index 07f7dba92..55afda2b5 100644 --- a/html/reference/group___scaling_algorithms.html +++ b/html/reference/group___scaling_algorithms.html @@ -4,7 +4,7 @@ - + Generic Image Library: ScalingAlgorithms @@ -27,36 +27,36 @@
        - + +/* @license-end */ +
        -
        -
        ScalingAlgorithms
        +
        ScalingAlgorithms
        -

        Algorthims suitable for rescaling. +

        Algorithms suitable for rescaling. More...

        void std::fill void fill ( boost::gil::iterator_from_2d< IL >  first,
        - - - + +

        +

        Modules

         DownScalingAlgorithms
         Algorthims suitable for downscaling.
         DownScalingAlgorithms
         Algorithms suitable for downscaling.
         

        Detailed Description

        -

        Algorthims suitable for rescaling.

        +

        Algorithms suitable for rescaling.

        These algorithms are used to improve image quality after image resizing is made.

        @@ -64,7 +64,7 @@ Modules diff --git a/html/reference/group___scoped_channel_value.html b/html/reference/group___scoped_channel_value.html index 4403ae113..dfced2758 100644 --- a/html/reference/group___scoped_channel_value.html +++ b/html/reference/group___scoped_channel_value.html @@ -4,7 +4,7 @@ - + Generic Image Library: scoped_channel_value @@ -27,38 +27,38 @@

        - + +/* @license-end */ +
        -
        -
        scoped_channel_value
        +
        scoped_channel_value
        - - +

        +

        Modules

         packed_channel_value
         packed_channel_value
         

        Detailed Description

        Traits for channels. Contains the following members:

        template <typename Channel>
        struct channel_traits {
        -
        using value_type = ...;
        -
        using reference = ...;
        -
        using pointer = ...;
        -
        using const_reference = ...;
        -
        using const_pointer = ...;
        +
        using value_type = ...;
        +
        using reference = ...;
        +
        using pointer = ...;
        +
        using const_reference = ...;
        +
        using const_pointer = ...;
        static const bool is_mutable;
        static value_type min_value();
        @@ -68,7 +68,7 @@ Modules

        Example:

        // Create a double channel with range [-0.5 .. 0.5]
        struct double_minus_half { static double apply() { return -0.5; } };
        struct double_plus_half { static double apply() { return 0.5; } };
        -
        using bits64custom_t = scoped_channel_value<double, double_minus_half, double_plus_half>;
        +
        using bits64custom_t = scoped_channel_value<double, double_minus_half, double_plus_half>;
        // channel_convert its maximum should map to the maximum
        bits64custom_t x = channel_traits<bits64custom_t>::max_value();
        @@ -81,7 +81,7 @@ Modules diff --git a/html/reference/group___t_i_f_f___i_o.html b/html/reference/group___t_i_f_f___i_o.html index ccc0f23f7..acb9b54fd 100644 --- a/html/reference/group___t_i_f_f___i_o.html +++ b/html/reference/group___t_i_f_f___i_o.html @@ -4,7 +4,7 @@ - + Generic Image Library: TIFF I/O @@ -27,20 +27,20 @@

        - + +/* @license-end */ +
        -
        -
        TIFF I/O
        +
        TIFF I/O
        @@ -53,7 +53,7 @@ $(function() { diff --git a/html/reference/group___type_analysis.html b/html/reference/group___type_analysis.html index 68a2c9f5c..15b7857c0 100644 --- a/html/reference/group___type_analysis.html +++ b/html/reference/group___type_analysis.html @@ -4,7 +4,7 @@ - + Generic Image Library: Type Analysis Metafunctions @@ -27,42 +27,42 @@

        - + +/* @license-end */ +
        -
        -
        Type Analysis Metafunctions
        +
        Type Analysis Metafunctions

        Metafunctions that determine properties of GIL types. More...

        - - + - + - +

        +

        Modules

         xxx_is_basic
         xxx_is_basic
         Determines if GIL constructs are basic. Basic constructs are the ones that can be generated with the type factory methods pixel_reference_type, iterator_type, locator_type, view_type and image_type They can be mutable/immutable, planar/interleaved, step/nonstep. They must use GIL-provided models.
         
         xxx_is_step
         xxx_is_step
         Determines if the given iterator/locator/view has a step that could be set dynamically.
         
         xxx_is_mutable
         xxx_is_mutable
         Determines if the given pixel reference/iterator/locator/view is mutable (i.e. its pixels can be changed)
         
        - @@ -79,7 +79,7 @@ Classes diff --git a/html/reference/group___type_factory.html b/html/reference/group___type_factory.html index 4535e3ce5..df5fb57c4 100644 --- a/html/reference/group___type_factory.html +++ b/html/reference/group___type_factory.html @@ -4,7 +4,7 @@ - + Generic Image Library: Type Factory Metafunctions @@ -27,42 +27,42 @@
        - + +/* @license-end */ +
        -
        -
        Type Factory Metafunctions
        +
        Type Factory Metafunctions

        Metafunctions that construct GIL types from related types or from components. More...

        +

        Classes

        struct  pixel_reference_is_proxy< PixelReference >
         Determines whether the given pixel reference is a proxy class or a native C++ reference. More...
        - - + - + - +

        +

        Modules

         xxx_type
         xxx_type
         Returns the type of a homogeneous GIL construct given its elements (channel, layout, whether it is planar, step, mutable, etc.)
         
         xxx_type_from_pixel
         xxx_type_from_pixel
         Returns the type of a GIL construct given its pixel type, whether it is planar, step, mutable, etc.
         
         derived_xxx_type
         derived_xxx_type
         Returns the type of a homogeneous GIL construct given a related construct by changing some of its properties.
         
        - @@ -76,7 +76,7 @@ Classes diff --git a/html/reference/group___type_factory_derived.html b/html/reference/group___type_factory_derived.html index 75020f700..c6169d104 100644 --- a/html/reference/group___type_factory_derived.html +++ b/html/reference/group___type_factory_derived.html @@ -4,7 +4,7 @@ - + Generic Image Library: derived_xxx_type @@ -27,29 +27,29 @@
        - + +/* @license-end */ +

        Returns the type of a homogeneous GIL construct given a related construct by changing some of its properties. More...

        +

        Classes

        struct  type_from_x_iterator< XIterator >
         Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding built-in step_iterator, xy_locator, image_view. More...
        - @@ -72,7 +72,7 @@ Classes diff --git a/html/reference/group___type_factory_from_elements.html b/html/reference/group___type_factory_from_elements.html index b282f17f9..44ce29afe 100644 --- a/html/reference/group___type_factory_from_elements.html +++ b/html/reference/group___type_factory_from_elements.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_type @@ -27,36 +27,36 @@
        - + +/* @license-end */ +

        Returns the type of a homogeneous GIL construct given its elements (channel, layout, whether it is planar, step, mutable, etc.) More...

        +

        Classes

        class  derived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutable >
         Constructs a pixel reference type from a source pixel reference type by changing some of the properties.Use use_default for the properties of the source view that you want to keep. More...
        - - +

        +

        Modules

         packed_image_type,bit_aligned_image_type
         packed_image_type,bit_aligned_image_type
         Returns the type of an image whose channels are not byte-aligned.
         
        - @@ -89,7 +89,7 @@ Classes diff --git a/html/reference/group___type_factory_from_pixel.html b/html/reference/group___type_factory_from_pixel.html index d9a023731..8c005384f 100644 --- a/html/reference/group___type_factory_from_pixel.html +++ b/html/reference/group___type_factory_from_pixel.html @@ -4,7 +4,7 @@ - + Generic Image Library: xxx_type_from_pixel @@ -27,29 +27,29 @@
        - + +/* @license-end */ +

        Returns the type of a GIL construct given its pixel type, whether it is planar, step, mutable, etc. More...

        +

        Classes

        struct  pixel_reference_type< T, L, IsPlanar, IsMutable >
         Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates on planar data and whether it is mutable. More...
        - @@ -66,7 +66,7 @@ Classes diff --git a/html/reference/group___type_factory_packed.html b/html/reference/group___type_factory_packed.html index 09ec2a3a8..adbce5f2a 100644 --- a/html/reference/group___type_factory_packed.html +++ b/html/reference/group___type_factory_packed.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_image_type,bit_aligned_image_type @@ -27,29 +27,29 @@
        - + +/* @license-end */ +
        -
        -
        packed_image_type,bit_aligned_image_type
        +
        packed_image_type,bit_aligned_image_type

        Returns the type of an image whose channels are not byte-aligned. More...

        +

        Classes

        struct  iterator_type_from_pixel< Pixel, IsPlanar, IsStep, IsMutable >
         Returns the type of a pixel iterator given the pixel type, whether it operates on planar data, whether it is a step iterator, and whether it is mutable. More...
        - @@ -100,7 +100,7 @@ Classes diff --git a/html/reference/group___variant.html b/html/reference/group___variant.html index 64b731308..cab21f153 100644 --- a/html/reference/group___variant.html +++ b/html/reference/group___variant.html @@ -4,7 +4,7 @@ - + Generic Image Library: Variant @@ -27,40 +27,40 @@
        - + +/* @license-end */ +
        -
        -
        Variant
        +
        Variant

        A holder of a runtime instantiated type. Used to provide runtime-specified images and views. More...

        +

        Classes

        struct  packed_image_type< BitField, ChannelBitSizes, Layout, Alloc >
         Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned, but whose pixels are byte aligned. More...
        - - - - - - + + + - - - + + +

        +

        Functions

        +
        template<typename Variant1 , typename Visitor >
        BOOST_FORCEINLINE auto apply_operation (Variant1 &&arg1, Visitor &&op)
         Applies the visitor op to the variants.
         
        +
        BOOST_FORCEINLINE auto apply_operation (Variant1 &&arg1, Visitor &&op)
         Applies the visitor op to the variants.
         
        template<typename Variant1 , typename Variant2 , typename Visitor >
        BOOST_FORCEINLINE auto apply_operation (Variant1 &&arg1, Variant2 &&arg2, Visitor &&op)
         Applies the visitor op to the variants.
         
        BOOST_FORCEINLINE auto apply_operation (Variant1 &&arg1, Variant2 &&arg2, Visitor &&op)
         Applies the visitor op to the variants.
         

        Detailed Description

        A holder of a runtime instantiated type. Used to provide runtime-specified images and views.

        @@ -70,7 +70,7 @@ template<typename Variant1 , typename Variant2 , typename Visitor > < diff --git a/html/reference/harris_8hpp_source.html b/html/reference/harris_8hpp_source.html index d7a69f418..ed37b2c70 100644 --- a/html/reference/harris_8hpp_source.html +++ b/html/reference/harris_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: harris.hpp Source File @@ -27,103 +27,110 @@

        - + +/* @license-end */ + +
        -
        -
        harris.hpp
        +
        harris.hpp
        -
        1 //
        -
        2 // Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
        -
        3 //
        -
        4 // Use, modification and distribution are subject to the Boost Software License,
        -
        5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt)
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IMAGE_PROCESSING_HARRIS_HPP
        -
        9 #define BOOST_GIL_IMAGE_PROCESSING_HARRIS_HPP
        -
        10 
        -
        11 #include <boost/gil/image_view.hpp>
        -
        12 #include <boost/gil/typedefs.hpp>
        -
        13 #include <boost/gil/image_processing/kernel.hpp>
        -
        14 
        -
        15 namespace boost { namespace gil {
        -
        21 
        -
        22 
        -
        33 template <typename T, typename Allocator>
        - -
        35  boost::gil::gray32f_view_t m11,
        -
        36  boost::gil::gray32f_view_t m12_21,
        -
        37  boost::gil::gray32f_view_t m22,
        - -
        39  float k,
        -
        40  boost::gil::gray32f_view_t harris_response)
        -
        41 {
        -
        42  if (m11.dimensions() != m12_21.dimensions() || m12_21.dimensions() != m22.dimensions()) {
        -
        43  throw std::invalid_argument("m prefixed arguments must represent"
        -
        44  " tensor from the same image");
        -
        45  }
        -
        46 
        -
        47  std::ptrdiff_t const window_length = weights.size();
        -
        48  auto const width = m11.width();
        -
        49  auto const height = m11.height();
        -
        50  auto const half_length = window_length / 2;
        -
        51 
        -
        52  for (auto y = half_length; y < height - half_length; ++y)
        -
        53  {
        -
        54  for (auto x = half_length; x < width - half_length; ++x)
        -
        55  {
        -
        56  float ddxx = 0;
        -
        57  float dxdy = 0;
        -
        58  float ddyy = 0;
        -
        59  for (gil::gray32f_view_t::coord_t y_kernel = 0;
        -
        60  y_kernel < window_length;
        -
        61  ++y_kernel) {
        -
        62  for (gil::gray32f_view_t::coord_t x_kernel = 0;
        -
        63  x_kernel < window_length;
        -
        64  ++x_kernel) {
        -
        65  ddxx += m11(x + x_kernel - half_length, y + y_kernel - half_length)
        -
        66  .at(std::integral_constant<int, 0>{}) * weights.at(x_kernel, y_kernel);
        -
        67  dxdy += m12_21(x + x_kernel - half_length, y + y_kernel - half_length)
        -
        68  .at(std::integral_constant<int, 0>{}) * weights.at(x_kernel, y_kernel);
        -
        69  ddyy += m22(x + x_kernel - half_length, y + y_kernel - half_length)
        -
        70  .at(std::integral_constant<int, 0>{}) * weights.at(x_kernel, y_kernel);
        -
        71  }
        -
        72  }
        -
        73  auto det = (ddxx * ddyy) - dxdy * dxdy;
        -
        74  auto trace = ddxx + ddyy;
        -
        75  auto harris_value = det - k * trace * trace;
        -
        76  harris_response(x, y).at(std::integral_constant<int, 0>{}) = harris_value;
        -
        77  }
        -
        78  }
        -
        79 }
        -
        80 
        -
        81 }} //namespace boost::gil
        -
        82 #endif
        -
        variable-size kernel
        Definition: kernel.hpp:273
        -
        void compute_harris_responses(boost::gil::gray32f_view_t m11, boost::gil::gray32f_view_t m12_21, boost::gil::gray32f_view_t m22, boost::gil::detail::kernel_2d< T, Allocator > weights, float k, boost::gil::gray32f_view_t harris_response)
        function to record Harris responses
        Definition: harris.hpp:34
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
        +
        3//
        +
        4// Use, modification and distribution are subject to the Boost Software License,
        +
        5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt)
        +
        7//
        +
        8#ifndef BOOST_GIL_IMAGE_PROCESSING_HARRIS_HPP
        +
        9#define BOOST_GIL_IMAGE_PROCESSING_HARRIS_HPP
        +
        10
        +
        11#include <boost/gil/image_view.hpp>
        +
        12#include <boost/gil/typedefs.hpp>
        +
        13#include <boost/gil/image_processing/kernel.hpp>
        +
        14
        +
        15namespace boost { namespace gil {
        +
        21
        +
        22
        +
        33template <typename T, typename Allocator>
        +
        + +
        35 boost::gil::gray32f_view_t m11,
        +
        36 boost::gil::gray32f_view_t m12_21,
        +
        37 boost::gil::gray32f_view_t m22,
        + +
        39 float k,
        +
        40 boost::gil::gray32f_view_t harris_response)
        +
        41{
        +
        42 if (m11.dimensions() != m12_21.dimensions() || m12_21.dimensions() != m22.dimensions()) {
        +
        43 throw std::invalid_argument("m prefixed arguments must represent"
        +
        44 " tensor from the same image");
        +
        45 }
        +
        46
        +
        47 std::ptrdiff_t const window_length = weights.size();
        +
        48 auto const width = m11.width();
        +
        49 auto const height = m11.height();
        +
        50 auto const half_length = window_length / 2;
        +
        51
        +
        52 for (auto y = half_length; y < height - half_length; ++y)
        +
        53 {
        +
        54 for (auto x = half_length; x < width - half_length; ++x)
        +
        55 {
        +
        56 float ddxx = 0;
        +
        57 float dxdy = 0;
        +
        58 float ddyy = 0;
        +
        59 for (gil::gray32f_view_t::coord_t y_kernel = 0;
        +
        60 y_kernel < window_length;
        +
        61 ++y_kernel) {
        +
        62 for (gil::gray32f_view_t::coord_t x_kernel = 0;
        +
        63 x_kernel < window_length;
        +
        64 ++x_kernel) {
        +
        65 ddxx += m11(x + x_kernel - half_length, y + y_kernel - half_length)
        +
        66 .at(std::integral_constant<int, 0>{}) * weights.at(x_kernel, y_kernel);
        +
        67 dxdy += m12_21(x + x_kernel - half_length, y + y_kernel - half_length)
        +
        68 .at(std::integral_constant<int, 0>{}) * weights.at(x_kernel, y_kernel);
        +
        69 ddyy += m22(x + x_kernel - half_length, y + y_kernel - half_length)
        +
        70 .at(std::integral_constant<int, 0>{}) * weights.at(x_kernel, y_kernel);
        +
        71 }
        +
        72 }
        +
        73 auto det = (ddxx * ddyy) - dxdy * dxdy;
        +
        74 auto trace = ddxx + ddyy;
        +
        75 auto harris_value = det - k * trace * trace;
        +
        76 harris_response(x, y).at(std::integral_constant<int, 0>{}) = harris_value;
        +
        77 }
        +
        78 }
        +
        79}
        +
        +
        80
        +
        81}} //namespace boost::gil
        +
        82#endif
        +
        variable-size kernel
        Definition kernel.hpp:273
        +
        void compute_harris_responses(boost::gil::gray32f_view_t m11, boost::gil::gray32f_view_t m12_21, boost::gil::gray32f_view_t m22, boost::gil::detail::kernel_2d< T, Allocator > weights, float k, boost::gil::gray32f_view_t harris_response)
        function to record Harris responses
        Definition harris.hpp:34
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/hessian_8hpp_source.html b/html/reference/hessian_8hpp_source.html index 21faeb3be..7a8164596 100644 --- a/html/reference/hessian_8hpp_source.html +++ b/html/reference/hessian_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: hessian.hpp Source File @@ -27,106 +27,111 @@

        - + +/* @license-end */ + +
        -
        -
        hessian.hpp
        +
        hessian.hpp
        -
        1 //
        -
        2 // Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
        -
        3 // Copyright 2021 Scramjet911 <36035352+Scramjet911@users.noreply.github.com>
        -
        4 // Use, modification and distribution are subject to the Boost Software License,
        -
        5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt)
        -
        7 
        -
        8 #ifndef BOOST_GIL_IMAGE_PROCESSING_HESSIAN_HPP
        -
        9 #define BOOST_GIL_IMAGE_PROCESSING_HESSIAN_HPP
        -
        10 
        -
        11 #include <boost/gil/image_view.hpp>
        -
        12 #include <boost/gil/typedefs.hpp>
        -
        13 #include <boost/gil/image_processing/kernel.hpp>
        -
        14 #include <stdexcept>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        26 template <typename GradientView, typename T, typename Allocator, typename OutputView>
        -
        27 inline void compute_hessian_responses(
        -
        28  GradientView ddxx,
        -
        29  GradientView dxdy,
        -
        30  GradientView ddyy,
        -
        31  const detail::kernel_2d<T, Allocator>& weights,
        -
        32  OutputView dst)
        -
        33 {
        -
        34  if (ddxx.dimensions() != ddyy.dimensions()
        -
        35  || ddyy.dimensions() != dxdy.dimensions()
        -
        36  || dxdy.dimensions() != dst.dimensions()
        -
        37  || weights.center_x() != weights.center_y())
        -
        38  {
        -
        39  throw std::invalid_argument("dimensions of views are not the same"
        -
        40  " or weights don't have equal width and height"
        -
        41  " or weights' dimensions are not odd");
        -
        42  }
        -
        43  // Use pixel type of output, as values will be written to output
        -
        44  using pixel_t = typename std::remove_reference<decltype(std::declval<OutputView>()(0, 0))>::type;
        -
        45 
        -
        46  using channel_t = typename std::remove_reference
        -
        47  <
        -
        48  decltype(std::declval<pixel_t>().at(std::integral_constant<int, 0>{}))
        -
        49  >::type;
        -
        50 
        -
        51 
        -
        52  auto center = weights.center_y();
        -
        53  for (auto y = center; y < dst.height() - center; ++y)
        -
        54  {
        -
        55  for (auto x = center; x < dst.width() - center; ++x)
        -
        56  {
        -
        57  auto ddxx_i = channel_t();
        -
        58  auto ddyy_i = channel_t();
        -
        59  auto dxdy_i = channel_t();
        -
        60  for (typename OutputView::coord_t w_y = 0; w_y < static_cast<std::ptrdiff_t>(weights.size()); ++w_y)
        -
        61  {
        -
        62  for (typename OutputView::coord_t w_x = 0; w_x < static_cast<std::ptrdiff_t>(weights.size()); ++w_x)
        -
        63  {
        -
        64  ddxx_i += ddxx(x + w_x - center, y + w_y - center)
        -
        65  .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
        -
        66  ddyy_i += ddyy(x + w_x - center, y + w_y - center)
        -
        67  .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
        -
        68  dxdy_i += dxdy(x + w_x - center, y + w_y - center)
        -
        69  .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
        -
        70  }
        -
        71  }
        -
        72  auto determinant = ddxx_i * ddyy_i - dxdy_i * dxdy_i;
        -
        73  dst(x, y).at(std::integral_constant<int, 0>{}) = determinant;
        -
        74  }
        -
        75  }
        -
        76 }
        -
        77 
        -
        78 }} // namespace boost::gil
        -
        79 
        -
        80 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
        +
        3// Copyright 2021 Scramjet911 <36035352+Scramjet911@users.noreply.github.com>
        +
        4// Use, modification and distribution are subject to the Boost Software License,
        +
        5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt)
        +
        7
        +
        8#ifndef BOOST_GIL_IMAGE_PROCESSING_HESSIAN_HPP
        +
        9#define BOOST_GIL_IMAGE_PROCESSING_HESSIAN_HPP
        +
        10
        +
        11#include <boost/gil/image_view.hpp>
        +
        12#include <boost/gil/typedefs.hpp>
        +
        13#include <boost/gil/image_processing/kernel.hpp>
        +
        14#include <stdexcept>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        26template <typename GradientView, typename T, typename Allocator, typename OutputView>
        +
        27inline void compute_hessian_responses(
        +
        28 GradientView ddxx,
        +
        29 GradientView dxdy,
        +
        30 GradientView ddyy,
        +
        31 const detail::kernel_2d<T, Allocator>& weights,
        +
        32 OutputView dst)
        +
        33{
        +
        34 if (ddxx.dimensions() != ddyy.dimensions()
        +
        35 || ddyy.dimensions() != dxdy.dimensions()
        +
        36 || dxdy.dimensions() != dst.dimensions()
        +
        37 || weights.center_x() != weights.center_y())
        +
        38 {
        +
        39 throw std::invalid_argument("dimensions of views are not the same"
        +
        40 " or weights don't have equal width and height"
        +
        41 " or weights' dimensions are not odd");
        +
        42 }
        +
        43 // Use pixel type of output, as values will be written to output
        +
        44 using pixel_t = typename std::remove_reference<decltype(std::declval<OutputView>()(0, 0))>::type;
        +
        45
        +
        46 using channel_t = typename std::remove_reference
        +
        47 <
        +
        48 decltype(std::declval<pixel_t>().at(std::integral_constant<int, 0>{}))
        +
        49 >::type;
        +
        50
        +
        51
        +
        52 auto center = weights.center_y();
        +
        53 for (auto y = center; y < dst.height() - center; ++y)
        +
        54 {
        +
        55 for (auto x = center; x < dst.width() - center; ++x)
        +
        56 {
        +
        57 auto ddxx_i = channel_t();
        +
        58 auto ddyy_i = channel_t();
        +
        59 auto dxdy_i = channel_t();
        +
        60 for (typename OutputView::coord_t w_y = 0; w_y < static_cast<std::ptrdiff_t>(weights.size()); ++w_y)
        +
        61 {
        +
        62 for (typename OutputView::coord_t w_x = 0; w_x < static_cast<std::ptrdiff_t>(weights.size()); ++w_x)
        +
        63 {
        +
        64 ddxx_i += ddxx(x + w_x - center, y + w_y - center)
        +
        65 .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
        +
        66 ddyy_i += ddyy(x + w_x - center, y + w_y - center)
        +
        67 .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
        +
        68 dxdy_i += dxdy(x + w_x - center, y + w_y - center)
        +
        69 .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y);
        +
        70 }
        +
        71 }
        +
        72 auto determinant = ddxx_i * ddyy_i - dxdy_i * dxdy_i;
        +
        73 dst(x, y).at(std::integral_constant<int, 0>{}) = determinant;
        +
        74 }
        +
        75 }
        +
        76}
        +
        77
        +
        78}} // namespace boost::gil
        +
        79
        +
        80#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/hierarchy.html b/html/reference/hierarchy.html index 00dd9d933..785eeb3c2 100644 --- a/html/reference/hierarchy.html +++ b/html/reference/hierarchy.html @@ -4,7 +4,7 @@ - + Generic Image Library: Class Hierarchy @@ -27,381 +27,382 @@

        - + +/* @license-end */ +
        -
        -
        Class Hierarchy
        +
        Class Hierarchy
        This inheritance list is sorted roughly, but not completely, alphabetically:
        [detail level 123]
        - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - - - - + + + + - - + + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
         Calpha_tAlpha
         Cany_image< Images >Represents a run-time specified image. Note it does NOT model ImageConcept
         Cany_image< Images >Represents a run-time specified image. Note it does NOT model ImageConcept
         Cany_image_view< Views >Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeConcept, Note that this class does NOT model ImageViewConcept
         CAssignable< T >Concept of copy assignment requirement
         CAssignable< T >Concept of copy assignment requirement
         Cbinary_operation_obj< Derived, Result >A generic binary operation on views
         Cbinary_operation_obj< copy_and_convert_pixels_fn< CC > >
         Cbinary_operation_obj< copy_and_convert_pixels_fn< CC > >
         Cbinary_operation_obj< copy_pixels_fn >
         Cbinary_operation_obj< equal_pixels_fn, bool >
         Cbit_aligned_image_type< ChannelBitSizes, Layout, Alloc >Returns the type of a packed image whose pixels may not be byte aligned. For example, an "rgb222" image is bit-aligned because its pixel spans six bits
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1, Size2 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1, Size2, Size3 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4, Size5 >, Layout, std::allocator< unsigned char > >
         Cbinary_operation_obj< equal_pixels_fn, bool >
         Cbit_aligned_image_type< ChannelBitSizes, Layout, Alloc >Returns the type of a packed image whose pixels may not be byte aligned. For example, an "rgb222" image is bit-aligned because its pixel spans six bits
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1, Size2 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1, Size2, Size3 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_image_type< mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4, Size5 >, Layout, std::allocator< unsigned char > >
         Cbit_aligned_pixel_iterator< NonAlignedPixelReference >An iterator over non-byte-aligned pixels. Models PixelIteratorConcept, PixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
         Cbit_range< RangeSize, IsMutable >
         Cbit_range< RangeSize, IsMutable >
         Cbit_range< bit_size, IsMutable >
         Cblack_tBlack
         Cblack_tBlack
         Cblue_tBlue
         Cbyte_to_memunit< T >
         Cbyte_to_memunit< T >
         Cbyte_to_memunit< Iterator >
         Cchannel_assigns_t< Channel1, Channel2 >
         Cchannel_assigns_t< Channel1, Channel2 >
         Cchannel_converter< SrcChannelV, DstChannelV >A unary function object converting between channel types
         Cchannel_converter_unsigned< float32_t, DstChannelV >Float32_t conversion
         Cchannel_converter_unsigned< float32_t, DstChannelV >Float32_t conversion
         Cchannel_converter_unsigned< float32_t, uint32_t >32 bit <-> float channel conversion
         Cchannel_converter_unsigned< uint32_t, float32_t >32 bit <-> float channel conversion
         Cchannel_converter_unsigned< uint32_t, float32_t >32 bit <-> float channel conversion
         Cchannel_converter_unsigned_impl< SrcChannelV, DstChannelV, SrcIsIntegral, DstIsIntegral >This is the default implementation. Performance specializatons are provided
         Cchannel_converter_unsigned_impl< SrcChannelV, DstChannelV, detail::is_channel_integral< SrcChannelV >::value, detail::is_channel_integral< DstChannelV >::value >
         Cchannel_converter_unsigned_impl< SrcChannelV, DstChannelV, detail::is_channel_integral< SrcChannelV >::value, detail::is_channel_integral< DstChannelV >::value >
         Cchannel_divides_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of dividing channel value by scalar
         Cchannel_divides_t< Channel1, Channel2, ChannelResult >Arithmetic operation of division of two channel values
         Cchannel_divides_t< Channel1, Channel2, ChannelResult >Arithmetic operation of division of two channel values
         Cchannel_halves_t< Channel >Arithmetic operation of dividing channel value by 2
         Cchannel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept
         Cchannel_mapping_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept
         Cchannel_minus_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of subtracting scalar from channel value
         Cchannel_minus_t< Channel1, Channel2, ChannelResult >Arithmetic operation of subtraction of two channel values
         Cchannel_minus_t< Channel1, Channel2, ChannelResult >Arithmetic operation of subtraction of two channel values
         Cchannel_multiplier< ChannelValue >A function object to multiply two channels. result = a * b / max_value
         Cchannel_multiplier_unsigned< ChannelValue >This is the default implementation. Performance specializatons are provided
         Cchannel_multiplier_unsigned< ChannelValue >This is the default implementation. Performance specializatons are provided
         Cchannel_multiplier_unsigned< float32_t >Specialization of channel_multiply for float 0..1 channels
         Cchannel_multiplier_unsigned< uint16_t >Specialization of channel_multiply for 16-bit unsigned channels
         Cchannel_multiplier_unsigned< uint16_t >Specialization of channel_multiply for 16-bit unsigned channels
         Cchannel_multiplier_unsigned< uint8_t >Specialization of channel_multiply for 8-bit unsigned channels
         Cchannel_multiplies_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of channel value by a scalar
         Cchannel_multiplies_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of channel value by a scalar
         Cchannel_multiplies_t< Channel1, Channel2, ChannelResult >Arithmetic operation of multiplication of two channel values
         Cchannel_plus_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of adding scalar to channel value
         Cchannel_plus_scalar_t< Channel, Scalar, ChannelResult >Arithmetic operation of adding scalar to channel value
         Cchannel_plus_t< Channel1, Channel2, ChannelResult >Arithmetic operation of addition of two channel values
         Cchannel_type< P >
         Cchannel_type< P >
         Cchannel_type< Deref::value_type >
         Cchannel_type< DFn::value_type >
         Cchannel_type< DFn::value_type >
         Cchannel_type< Iterator >
         Cchannel_type< L >
         Cchannel_type< L >
         Cchannel_type< Loc >
         Cchannel_type< memory_based_2d_locator< SI >::parent_t >
         Cchannel_type< memory_based_2d_locator< SI >::parent_t >
         Cchannel_type< Pixel >
         Cchannel_type< PixelBased >
         Cchannel_type< PixelBased >
         Cchannel_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by HomogeneousPixelBasedConcept
         Cchannel_type< virtual_2d_locator< D, TR >::parent_t >
         Cchannel_type< virtual_2d_locator< D, TR >::parent_t >
         Cchannel_type< XIt >
         Cchannel_zeros_t< Channel >Operation of setting channel value to zero
         Cchannel_zeros_t< Channel >Operation of setting channel value to zero
         CChannelConcept< T >A channel is the building block of a color. Color is defined as a mixture of primary colors and a channel defines the degree to which each primary color is used in the mixture
         CChannelConvertibleConcept< SrcChannel, DstChannel >A channel is convertible to another one if the channel_convert algorithm is defined for the two channels
         CChannelConvertibleConcept< SrcChannel, DstChannel >A channel is convertible to another one if the channel_convert algorithm is defined for the two channels
         CChannelIsMutableConcept< T >
         CChannelMappingConcept< CM >Channel mapping concept
         CChannelMappingConcept< CM >Channel mapping concept
         Cchannels_are_compatible< T1, T2 >Predicate metafunction returning whether two channels are compatible
         CChannelsCompatibleConcept< Channel1, Channel2 >Channels are compatible if their associated value types (ignoring constness and references) are the same
         CChannelsCompatibleConcept< Channel1, Channel2 >Channels are compatible if their associated value types (ignoring constness and references) are the same
         CChannelValueConcept< T >A channel that supports default construction
         CCollectionImageViewConcept< View >GIL view as Collection
         CCollectionImageViewConcept< View >GIL view as Collection
         Ccolor_converted_view_type< SrcView, DstP, CC >Returns the type of a view that does color conversion upon dereferencing its pixels
         Ccolor_converted_view_type< any_image_view< Views... >, DstP >Returns the type of a runtime-specified view, color-converted to a given pixel type with the default coor converter
         Ccolor_converted_view_type< any_image_view< Views... >, DstP >Returns the type of a runtime-specified view, color-converted to a given pixel type with the default coor converter
         Ccolor_converted_view_type< any_image_view< Views... >, DstP, CC >Returns the type of a runtime-specified view, color-converted to a given pixel type with user specified color converter
         Ccolor_space_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept
         Ccolor_space_type< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies the color space type of a planar pixel reference. Required by PixelBasedConcept
         CColorBaseConcept< ColorBase >A color base is a container of color elements (such as channels, channel references or channel pointers)
         CColorBasesCompatibleConcept< ColorBase1, ColorBase2 >Two color bases are compatible if they have the same color space and their elements are compatible, semantic-pairwise
         CColorBasesCompatibleConcept< ColorBase1, ColorBase2 >Two color bases are compatible if they have the same color space and their elements are compatible, semantic-pairwise
         CColorBaseValueConcept< ColorBase >Color base that also has a default-constructor. Refines Regular
         CColorSpaceConcept< CS >Color space type concept
         CColorSpaceConcept< CS >Color space type concept
         CColorSpacesCompatibleConcept< CS1, CS2 >Two color spaces are compatible if they are the same
         Cconst_iterator_type< It >Returns the type of an iterator just like the input iterator, except operating over immutable values
         Cconst_iterator_type< It >Returns the type of an iterator just like the input iterator, except operating over immutable values
         Ccontains_color< ColorBase, Color >A predicate metafunction determining whether a given color base contains a given color
         Ccopier_n< I, O >
         Ccopier_n< I, O >
         Ccopier_n< I, iterator_from_2d< OL > >Destination range is delimited by image iterators
         Ccopier_n< iterator_from_2d< IL >, iterator_from_2d< OL > >Both source and destination ranges are delimited by image iterators
         Ccopier_n< iterator_from_2d< IL >, iterator_from_2d< OL > >Both source and destination ranges are delimited by image iterators
         Ccopier_n< iterator_from_2d< IL >, O >Source range is delimited by image iterators
         CCopyConstructible< T >Concept of copy construction requirement
         CCopyConstructible< T >Concept of copy construction requirement
         Ccorrelator_k< Size, PixelAccum >Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is a template parameter and must be compulsorily specified while using
         Ccorrelator_n< PixelAccum >Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is to be provided through constructor for all instances
         Ccorrelator_n< PixelAccum >Provides functionality for performing 1D correlation between the kernel and a buffer storing row pixels of source image. Kernel size is to be provided through constructor for all instances
         Ccyan_tCyan
         Cdec< T >Operator– wrapped in a function object
         Cdec< T >Operator– wrapped in a function object
         Cdefault_channel_converterSame as channel_converter, except it takes the destination channel by reference, which allows us to move the templates from the class level to the method level. This is important when invoking it on heterogeneous pixels
         Cdefault_color_converterClass for color-converting one pixel to another
         Cdefault_color_converter_impl< C1, C2 >Color Convertion function object. To be specialized for every src/dst color space
         Cdefault_color_converter_impl< C, C >When the color space is the same, color convertion performs channel depth conversion
         Cdefault_color_converterClass for color-converting one pixel to another
         Cdefault_color_converter_impl< C1, C2 >Color Conversion function object. To be specialized for every src/dst color space
         Cdefault_color_converter_impl< C, C >When the color space is the same, color conversion performs channel depth conversion
         Cdefault_color_converter_impl< C1, rgba_t >Converting any pixel type to RGBA. Note: Supports homogeneous pixels only
         Cdefault_color_converter_impl< cmyk_t, gray_t >CMYK to Gray
         Cdefault_color_converter_impl< cmyk_t, gray_t >CMYK to Gray
         Cdefault_color_converter_impl< cmyk_t, rgb_t >CMYK to RGB (not the fastest code in the world)
         Cdefault_color_converter_impl< gray_t, cmyk_t >Gray to CMYK
         Cdefault_color_converter_impl< gray_t, cmyk_t >Gray to CMYK
         Cdefault_color_converter_impl< gray_t, rgb_t >Gray to RGB
         Cdefault_color_converter_impl< rgb_t, cmyk_t >RGB to CMYK (not the fastest code in the world)
         Cdefault_color_converter_impl< rgb_t, cmyk_t >RGB to CMYK (not the fastest code in the world)
         Cdefault_color_converter_impl< rgb_t, gray_t >RGB to Gray
         Cdefault_color_converter_impl< rgba_t, C2 >Converting RGBA to any pixel type. Note: Supports homogeneous pixels only
         Cdefault_color_converter_impl< rgba_t, C2 >Converting RGBA to any pixel type. Note: Supports homogeneous pixels only
         Cdefault_color_converter_impl< rgba_t, rgba_t >Unfortunately RGBA to RGBA must be explicitly provided - otherwise we get ambiguous specialization error
         CDefaultConstructible< T >Concept of default construction requirement
         Cderef_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >Helper base class for pixel dereference adaptors
         Cderef_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
         CDefaultConstructible< T >Concept of default construction requirement
         Cderef_base< ConstT, Value, Reference, ConstReference, ArgType, ResultType, IsMutable >Helper base class for pixel dereference adaptors
         Cderef_base< color_convert_deref_fn< SrcConstRefP, DstP, default_color_converter >, DstP, DstP, const DstP &, SrcConstRefP, DstP, false >
         Cderef_base< deref_compose< D1::const_t, D2::const_t >, D1::value_type, D1::reference, D1::const_reference, D2::argument_type, D1::result_type, D1::is_mutable &&D2::is_mutable >
         Cdereference_iterator_adaptor< Iterator, DFn >An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept
         Cdereference_iterator_adaptor< Iterator, DFn >An adaptor over an existing iterator that provides for custom filter on dereferencing the object. Models: IteratorAdaptorConcept, PixelIteratorConcept
         Cderived_image_type< Image, T, L, IsPlanar >Constructs a homogeneous image type from a source image type by changing some of the properties.Use use_default for the properties of the source image that you want to keep
         Cderived_iterator_type< Iterator, T, L, IsPlanar, IsStep, IsMutable >Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties.Use use_default for the properties of the source view that you want to keep
         Cderived_iterator_type< Iterator, T, L, IsPlanar, IsStep, IsMutable >Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties.Use use_default for the properties of the source view that you want to keep
         Cderived_pixel_reference_type< Ref, T, L, IsPlanar, IsMutable >Constructs a pixel reference type from a source pixel reference type by changing some of the properties.Use use_default for the properties of the source view that you want to keep
         Cderived_view_type< View, T, L, IsPlanar, StepX, IsMutable >Constructs an image view type from a source view type by changing some of the properties.Use use_default for the properties of the source view that you want to keep
         Cderived_view_type< View, T, L, IsPlanar, StepX, IsMutable >Constructs an image view type from a source view type by changing some of the properties.Use use_default for the properties of the source view that you want to keep
         Cdevicen_color_t< N >Unnamed color
         Cdevicen_t< N >Unnamed color space of 1, 2, 3, 4, or 5 channels
         Cdevicen_t< N >Unnamed color space of 1, 2, 3, 4, or 5 channels
         Cdynamic_x_step_type< IteratorOrLocatorOrView >Base template for types that model HasDynamicXStepTypeConcept
         Cdynamic_y_step_type< LocatorOrView >Base template for types that model HasDynamicYStepTypeConcept
         Cdynamic_y_step_type< LocatorOrView >Base template for types that model HasDynamicYStepTypeConcept
         Cdynamic_y_step_type< dynamic_x_step_type< View >::type >
         Celement_const_reference_type< ColorBase >Specifies the return type of the constant element accessor at_c of a homogeneous color base
         Celement_reference_type< ColorBase >Specifies the return type of the mutable element accessor at_c of a homogeneous color base
         Celement_type< ColorBase >Specifies the element type of a homogeneous color base
         Celement_type< P >
         Cequal_n_fn< boost::gil::iterator_from_2d< Loc >, It >
         Cequal_n_fn< boost::gil::iterator_from_2d< Loc1 >, boost::gil::iterator_from_2d< Loc2 > >Both source and destination ranges are delimited by image iterators
         Cequal_n_fn< It, boost::gil::iterator_from_2d< Loc > >
         Cequal_n_fn< pixel< T, CS > const *, pixel< T, CS > const * >
         Cequal_n_fn< planar_pixel_iterator< IC, CS >, planar_pixel_iterator< IC, CS > >
         CEqualityComparable< T >Concept of == and != comparability requirement
         Cfile_stream_device< FormatTag >
         Cfiller< Dimension >Filler is used to fill the histogram class with all values between a specified range This functor is used when sparsefill is false, since all the keys need to be present in that case. Currently on 1D implementation is available, extend by adding specialization for 2D and higher dimensional cases
         Cfiller< 1 >Specialisation for 1D histogram
         CForwardCollectionImageViewConcept< View >GIL view as ForwardCollection
         Cget_dynamic_image_reader< T, FormatTag, Enable >Helper metafunction to generate dynamic image reader type
         Cget_dynamic_image_writer< T, FormatTag, Enable >Helper metafunction to generate dynamic image writer type
         Cget_reader< T, FormatTag, ConversionPolicy, Enable >Helper metafunction to generate image reader type
         Cget_reader_backend< T, FormatTag, Enable >Helper metafunction to generate image backend type
         Cget_scanline_reader< T, FormatTag >Helper metafunction to generate image scanline_reader type
         Cget_writer< T, FormatTag, Enable >Helper metafunction to generate writer type
         Cgray_color_tGray
         Cgreen_tGreen
         CHasDynamicXStepTypeConcept< T >Concept for iterators, locators and views that can define a type just like the given iterator, locator or view, except it supports runtime specified step along the X navigation
         CHasDynamicYStepTypeConcept< T >Concept for locators and views that can define a type just like the given locator or view, except it supports runtime specified step along the Y navigation
         Chash_tuple< T >Functor provided for the hashing of tuples. The following approach makes use hash_combine from boost::container_hash. Although there is a direct hashing available for tuples, this approach will ease adopting in future to a std::hash_combine. In case std::hash extends support to tuples this functor as well as the helper implementation hash_tuple_impl can be removed
         CHasTransposedTypeConcept< T >Concept for locators and views that can define a type just like the given locator or view, except X and Y is swapped
         Chistogram< T >Default histogram class provided by boost::gil
         Chomogeneous_color_base< Element, Layout, 1 >A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         Chomogeneous_color_base< Element, Layout, 2 >A homogeneous color base holding two color elements Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         Chomogeneous_color_base< Element, Layout, 3 >A homogeneous color base holding three color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         Chomogeneous_color_base< Element, Layout, 4 >A homogeneous color base holding four color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         Chomogeneous_color_base< Element, Layout, 5 >A homogeneous color base holding five color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         CHomogeneousColorBaseConcept< ColorBase >Color base whose elements all have the same type
         CHomogeneousColorBaseValueConcept< ColorBase >Homogeneous color base that also has a default constructor. Refines Regular
         CHomogeneousPixelBasedConcept< P >Concept for homogeneous pixel-based GIL constructs
         CHomogeneousPixelConcept< P >Homogeneous pixel concept
         CHomogeneousPixelValueConcept< P >Homogeneous pixel concept that is a Regular type
         Cidentity< T >Identity taken from SGI STL
         Cidentity< ChannelValue >
         Cimage< Pixel, IsPlanar, Alloc >Container interface over image view. Models ImageConcept, PixelBasedConcept
         Cimage_is_basic< Img >Basic images must use basic views and std::allocator
         Cimage_type< T, L, IsPlanar, Alloc >Returns the type of a homogeneous image given the channel type, layout, and whether it operates on planar data
         Cimage_view< Loc >A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept
         CImageConcept< Image >2-dimensional image whose value type models PixelValueConcept
         CImageViewConcept< View >GIL's 2-dimensional view over immutable GIL pixels
         Cinc< T >Operator++ wrapped in a function object
         Cis_input_device< IODevice >
         Cis_iterator_adaptor< It >Metafunction predicate determining whether the given iterator is a plain one or an adaptor over another iterator. Examples of adaptors are the step iterator and the dereference iterator adaptor
         Cis_output_device< IODevice >
         Cis_pixel< bit_aligned_pixel_reference< B, C, L, M > >Metafunction predicate that flags bit_aligned_pixel_reference as a model of PixelConcept. Required by PixelConcept
         Cis_pixel< planar_pixel_reference< ChannelReference, ColorSpace > >Metafunction predicate that flags planar_pixel_reference as a model of PixelConcept. Required by PixelConcept
         Cis_planar< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies that planar_pixel_reference represents a planar construct. Required by PixelBasedConcept
         Cis_read_device< FormatTag, T, D >
         Cis_read_only< Conversion_Policy >Determines if reader type is read only ( no conversion )
         Cis_read_supported< Pixel, FormatTag >
         Cis_write_device< FormatTag, T, D >
         Cistream_device< FormatTag >
         Citerator_adaptor_get_base< It >Returns the base iterator for a given iterator adaptor. Provide an specialization when introducing new iterator adaptors
         Citerator_adaptor_rebind< It, NewBaseIt >Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iterator adaptors
         Citerator_add_deref< Iterator, Deref >Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor upon dereferencing
         Citerator_add_deref< dereference_iterator_adaptor< Iterator, PREV_DEREF >, Deref >For dereference iterator adaptors, compose the new function object after the old one
         Citerator_from_2d< Loc2 >Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept
         Citerator_is_basic< Iterator >Determines if a given pixel iterator is basic Basic iterators must use gil::pixel (if interleaved), gil::planar_pixel_iterator (if planar) and gil::memory_based_step_iterator (if step). They must use the standard constness rules
         Citerator_is_basic< memory_based_step_iterator< pixel< T, L > * > >
         Citerator_is_basic< memory_based_step_iterator< pixel< T, L > const * > >
         Citerator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T *, CS > > >
         Citerator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T const *, CS > > >
         Citerator_is_basic< pixel< T, L > * >
         Citerator_is_basic< pixel< T, L > const * >
         Citerator_is_basic< planar_pixel_iterator< T *, CS > >
         Citerator_is_basic< planar_pixel_iterator< T const *, CS > >
         Citerator_is_mutable< It >Metafunction predicate returning whether the given iterator allows for changing its values
         Citerator_is_mutable< Iterator >
         Citerator_is_mutable< L::x_iterator >
         Citerator_is_mutable< Loc::x_iterator >
         Citerator_is_mutable< V::x_iterator >
         Citerator_is_step< I >Determines if the given iterator has a step that could be set dynamically
         Citerator_is_step< iterator_adaptor_get_base< It >::type >
         Citerator_is_step< L::x_iterator >
         Citerator_is_step< L::y_iterator >
         Citerator_type< T, L, IsPlanar, IsStep, IsMutable >Returns the type of a homogeneous iterator given the channel type, layout, whether it operates on planar data, whether it is a step iterator, and whether it is mutable
         Citerator_type_from_pixel< Pixel, IsPlanar, IsStep, IsMutable >Returns the type of a pixel iterator given the pixel type, whether it operates on planar data, whether it is a step iterator, and whether it is mutable
         Citerator_type_from_pixel< const bit_aligned_pixel_reference< B, C, L, M >, IsPlanar, IsStep, IsMutable >
         CIteratorAdaptorConcept< Iterator >Iterator adaptor is a forward iterator adapting another forward iterator
         Ckernel_1d_adaptor< Core >Kernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),operator[], value_type,iterator,const_iterator,reference,const_reference
         Ckernel_1d_adaptor< std::array< T, Size > >
         Ckernel_1d_adaptor< std::vector< T, std::allocator< T > > >
         Ckernel_2d< T, Allocator >Variable-size kernel
         Ckernel_2d_fixed< T, Size >Static-size kernel
         Ckth_channel_deref_fn< K, SrcP >Function object that returns a grayscale reference of the K-th channel (specified as a template parameter) of a given reference. Models: PixelDereferenceAdaptorConcept
         Ckth_channel_view_type< K, View >Given a source image view type View, returns the type of an image view over a given channel of View
         Ckth_semantic_element_const_reference_type< ColorBase, K >Specifies the return type of the constant semantic_at_c<K>(color_base);
         Ckth_semantic_element_const_reference_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Ckth_semantic_element_reference_type< ColorBase, K >Specifies the return type of the mutable semantic_at_c<K>(color_base);
         Ckth_semantic_element_reference_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Ckth_semantic_element_type< ColorBase, K >Specifies the type of the K-th semantic element of a color base
         Ckth_semantic_element_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Clayout< ColorSpace, ChannelMapping >Represents a color space and ordering of channels in memory
         Clayout< devicen_t< N >::type >
         Clocator_is_basic< Loc >Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and y_iterator
         Clocator_type< T, L, IsPlanar, IsStepX, IsMutable >Returns the type of a homogeneous locator given the channel type, layout, whether it operates on planar data and whether it has a step horizontally
         Cmagenta_tMagenta
         CMemoryBasedIteratorConcept< Iterator >Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
         Cmemunit_step_fn< Iterator >Function object that returns the memory unit distance between two iterators and advances a given iterator a given number of mem units (bytes or bits)
         CMetafunction< T >Concept for type as metafunction requirement
         CMutableChannelConcept< T >A channel that allows for modifying its value
         CMutableColorBaseConcept< ColorBase >Color base which allows for modifying its elements
         CMutableHomogeneousColorBaseConcept< ColorBase >Homogeneous color base that allows for modifying its elements
         CMutableHomogeneousPixelConcept< P >Homogeneous pixel concept that allows for changing its channels
         CMutableImageViewConcept< View >GIL's 2-dimensional view over mutable GIL pixels
         CMutableIteratorAdaptorConcept< Iterator >Iterator adaptor that is mutable
         CMutablePixelConcept< P >Pixel concept that allows for changing its channels
         CMutablePixelIteratorConcept< Iterator >Pixel iterator that allows for changing its pixel
         CMutablePixelLocatorConcept< Loc >GIL's 2-dimensional locator over mutable GIL pixels
         CMutableRandomAccess2DImageViewConcept< View >2-dimensional view over mutable values
         CMutableRandomAccess2DLocatorConcept< Loc >2-dimensional locator over mutable pixels
         CMutableRandomAccessNDImageViewConcept< View >N-dimensional view over mutable values
         CMutableRandomAccessNDLocatorConcept< Loc >N-dimensional locator over mutable pixels
         CMutableStepIteratorConcept< Iterator >Step iterator that allows for modifying its current value
         Cnth_channel_deref_fn< SrcP >Function object that returns a grayscale reference of the N-th channel of a given reference. Models: PixelDereferenceAdaptorConcept
         Cnth_channel_view_type< View >Given a source image view type View, returns the type of an image view over a single channel of View
         Cnth_channel_view_type< any_image_view< Views... > >Given a runtime source image view, returns the type of a runtime image view over a single channel of the source view
         Cnum_channels< PixelBased >Returns the number of channels of a pixel-based GIL construct
         Costream_device< FormatTag >
         Cpacked_dynamic_channel_reference< BitField, NumBits, false >Models a constant subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter
         Cpacked_dynamic_channel_reference< BitField, NumBits, true >Models a mutable subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter
         Cpacked_image_type< BitField, ChannelBitSizes, Layout, Alloc >Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned, but whose pixels are byte aligned
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1 >, Layout, std::allocator< unsigned char > >
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2 >, Layout, std::allocator< unsigned char > >
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3 >, Layout, std::allocator< unsigned char > >
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4 >, Layout, std::allocator< unsigned char > >
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4, Size5 >, Layout, std::allocator< unsigned char > >
         Cpacked_pixel< BitField, ChannelRefs, Layout >Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and their index. Models ColorBaseValueConcept, PixelValueConcept, PixelBasedConcept Typical use for this is a model of a packed pixel (like 565 RGB)
         Cpacked_pixel_type< BitField, ChannelBitSizes, Layout >Returns the type of a packed pixel given its bitfield type, the bit size of its channels and its layout
         Cpacked_pixel_type< BitField, mp11::mp_list_c< unsigned, NumBits >, Layout >
         Cpacked_pixel_type< detail::min_fast_uint< NumBits >::type, mp11::mp_list_c< unsigned, NumBits >, Layout >
         Cpixel< ChannelValue, Layout >Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept
         Cpixel_2d_locator_base< Loc, XIterator, YIterator >Base class for models of PixelLocatorConcept
         Cpixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >
         Cpixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
         Cpixel_assigns_t< PixelRef, PixelResult >Casts and assigns a pixel to another
         Cpixel_divides_scalar_t< PixelRef, Scalar, PixelResult >Performs channel-wise division of pixel elements by scalar
         Cpixel_divides_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise division of two pixels
         Cpixel_halves_t< PixelRef >Performs channel-wise division by 2
         Cpixel_is_reference< Pixel >Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value)
         Cpixel_minus_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise subtraction of two pixels
         Cpixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult >Performs channel-wise multiplication of pixel elements by scalar
         Cpixel_multiplies_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise multiplication of two pixels
         Cpixel_plus_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise addition of two pixels
         Cpixel_proxy< T >Reference proxy associated with a type that has a "reference" member type alias
         Cpixel_reference_is_basic< PixelRef >Determines if a given pixel reference is basic Basic references must use gil::pixel& (if interleaved), gil::planar_pixel_reference (if planar). They must use the standard constness rules
         Cpixel_reference_is_mutable< R >Determines if the given pixel reference is mutable (i.e. its channels can be changed)
         Cpixel_reference_is_proxy< PixelReference >Determines whether the given pixel reference is a proxy class or a native C++ reference
         Cpixel_reference_type< T, L, IsPlanar, IsMutable >Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates on planar data and whether it is mutable
         Cpixel_value_type< Channel, Layout >Returns the type of a homogeneous pixel given the channel type and layout
         Cpixel_zeros_t< PixelRef >Sets pixel elements to zero (for whatever zero means)
         CPixelBasedConcept< P >Concept for all pixel-based GIL constructs
         CPixelConcept< P >Pixel concept - A color base whose elements are channels
         CPixelConvertibleConcept< SrcP, DstP >Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted to another, approximating the color. Conversion is explicit and sometimes lossy
         CPixelDereferenceAdaptorConcept< D >Represents a unary function object that can be invoked upon dereferencing a pixel iterator
         CPixelImageViewIsMutableConcept< View >
         CPixelIteratorConcept< Iterator >An STL random access traversal iterator over a model of PixelConcept
         CPixelIteratorIsMutableConcept< Iterator >
         CPixelLocatorConcept< Loc >GIL's 2-dimensional locator over immutable GIL pixels
         Cpixels_are_compatible< P1, P2 >Returns whether two pixels are compatible Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another
         Cpixels_are_compatible< V1::value_type, V2::value_type >
         CPixelsCompatibleConcept< P1, P2 >Concept for pixel compatibility Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another
         CPixelValueConcept< P >Pixel concept that is a Regular type
         Cplanar_pixel_iterator< ChannelPtr, ColorSpace >An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
         Cplanar_pixel_reference< ChannelReference, ColorSpace >A reference proxy to a planar pixel
         Cplus_asymmetric< T1, T2 >Plus function object whose arguments may be of different type
         Cpoint< T >2D point both axes of which have the same dimension typeModels: Point2DConcept
         CPoint2DConcept< P >2-dimensional point concept
         Cpoint< std::ptrdiff_t >
         Cpoint< std::size_t >
         CPointNDConcept< P >N-dimensional point concept
         Cposition_iterator< Deref, Dim >An iterator that remembers its current X,Y position and invokes a function object with it upon dereferencing. Used to create virtual image views. Models: StepIteratorConcept, PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept
         Cpromote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >Meta-function to define an integral type with size than is (roughly) twice the bit size of T
         CRandomAccess2DImageConcept< Image >2-dimensional container of values
         CRandomAccess2DImageViewConcept< View >2-dimensional view over immutable values
         CRandomAccess2DImageViewIsMutableConcept< View >
         CRandomAccess2DLocatorConcept< Loc >2-dimensional locator over immutable values
         CRandomAccessNDImageConcept< Image >N-dimensional container of values
         CRandomAccessNDImageViewConcept< View >N-dimensional view over immutable values
         CRandomAccessNDImageViewIsMutableConcept< View >
         CRandomAccessNDLocatorConcept< Loc >N-dimensional locator over immutable values
         CRandomAccessNDLocatorIsMutableConcept< Loc >
         Cfile_stream_device< FormatTag >::read_tagUsed to overload the constructor
         Creader_base< FormatTag, ConversionPolicy >
         Cred_tRed
         CRegular< T >Concept for type regularity requirement
         CReversibleCollectionImageViewConcept< View >GIL view as ReversibleCollection
         Crgb_to_luminance_fn< RedChannel, GreenChannel, BlueChannel, GrayChannelValue >Red * .3 + green * .59 + blue * .11 + .5
         CSameType< T, U >Concept of types equivalence requirement
         Cscanline_read_iterator< Reader >Input iterator to read images
         Csize< ColorBase >Returns an integral constant type specifying the number of elements in a color base
         Cstd_fill_tStruct to do std::fill
         Cstep_iterator_adaptor< Derived, Iterator, SFn >An adaptor over an existing iterator that changes the step unit
         Cstep_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >
         CStepIteratorConcept< Iterator >Step iterator concept
         CSwappable< T >Concept of swap operation requirement
         Ctransposed_type< LocatorOrView >
         Ctuple_limit< Tuple >Provides equivalent of std::numeric_limits for type std::tuple tuple_limit gets called with only tuples having integral elements
         Ctype_from_x_iterator< XIterator >Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding built-in step_iterator, xy_locator, image_view
         Ctype_to_index< Types, T >Returns the index corresponding to the first occurrance of a given given type in
         Ctype_to_index< ColorBase::layout_t::color_space_t, Color >
         Cview_is_basic< View >Basic views must be over basic locators
         Cview_type< T, L, IsPlanar, IsStepX, IsMutable >Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar data and whether it has a step horizontally
         Cview_type_from_pixel< Pixel, IsPlanar, IsStepX, IsMutable >Returns the type of a view the pixel type, whether it operates on planar data and whether it has a step horizontally
         Cview_type_from_pixel< Pixel, IsPlanar >
         CViewsCompatibleConcept< V1, V2 >Views are compatible if they have the same color spaces and compatible channel values
         Cyellow_tYellow
         Cdynamic_y_step_type< dynamic_x_step_type< transposed_type< View >::type >::type >
         Cdynamic_y_step_type< dynamic_x_step_type< View >::type >
         Celement_const_reference_type< ColorBase >Specifies the return type of the constant element accessor at_c of a homogeneous color base
         Celement_reference_type< ColorBase >Specifies the return type of the mutable element accessor at_c of a homogeneous color base
         Celement_type< ColorBase >Specifies the element type of a homogeneous color base
         Celement_type< P >
         Cequal_n_fn< boost::gil::iterator_from_2d< Loc >, It >
         Cequal_n_fn< boost::gil::iterator_from_2d< Loc1 >, boost::gil::iterator_from_2d< Loc2 > >Both source and destination ranges are delimited by image iterators
         Cequal_n_fn< It, boost::gil::iterator_from_2d< Loc > >
         Cequal_n_fn< pixel< T, CS > const *, pixel< T, CS > const * >
         Cequal_n_fn< planar_pixel_iterator< IC, CS >, planar_pixel_iterator< IC, CS > >
         CEqualityComparable< T >Concept of == and != comparability requirement
         Cfile_stream_device< FormatTag >
         Cfiller< Dimension >Filler is used to fill the histogram class with all values between a specified range This functor is used when sparsefill is false, since all the keys need to be present in that case. Currently on 1D implementation is available, extend by adding specialization for 2D and higher dimensional cases
         Cfiller< 1 >Specialisation for 1D histogram
         CForwardCollectionImageViewConcept< View >GIL view as ForwardCollection
         Cget_dynamic_image_reader< T, FormatTag, Enable >Helper metafunction to generate dynamic image reader type
         Cget_dynamic_image_writer< T, FormatTag, Enable >Helper metafunction to generate dynamic image writer type
         Cget_reader< T, FormatTag, ConversionPolicy, Enable >Helper metafunction to generate image reader type
         Cget_reader_backend< T, FormatTag, Enable >Helper metafunction to generate image backend type
         Cget_scanline_reader< T, FormatTag >Helper metafunction to generate image scanline_reader type
         Cget_writer< T, FormatTag, Enable >Helper metafunction to generate writer type
         Cgray_color_tGray
         Cgreen_tGreen
         CHasDynamicXStepTypeConcept< T >Concept for iterators, locators and views that can define a type just like the given iterator, locator or view, except it supports runtime specified step along the X navigation
         CHasDynamicYStepTypeConcept< T >Concept for locators and views that can define a type just like the given locator or view, except it supports runtime specified step along the Y navigation
         Chash_tuple< T >Functor provided for the hashing of tuples. The following approach makes use hash_combine from boost::container_hash. Although there is a direct hashing available for tuples, this approach will ease adopting in future to a std::hash_combine. In case std::hash extends support to tuples this functor as well as the helper implementation hash_tuple_impl can be removed
         CHasTransposedTypeConcept< T >Concept for locators and views that can define a type just like the given locator or view, except X and Y is swapped
         Chistogram< T >Default histogram class provided by boost::gil
         Chomogeneous_color_base< Element, Layout, 1 >A homogeneous color base holding one color element. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         Chomogeneous_color_base< Element, Layout, 2 >A homogeneous color base holding two color elements Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         Chomogeneous_color_base< Element, Layout, 3 >A homogeneous color base holding three color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         Chomogeneous_color_base< Element, Layout, 4 >A homogeneous color base holding four color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         Chomogeneous_color_base< Element, Layout, 5 >A homogeneous color base holding five color elements. Models HomogeneousColorBaseConcept or HomogeneousColorBaseValueConcept
         CHomogeneousColorBaseConcept< ColorBase >Color base whose elements all have the same type
         CHomogeneousColorBaseValueConcept< ColorBase >Homogeneous color base that also has a default constructor. Refines Regular
         CHomogeneousPixelBasedConcept< P >Concept for homogeneous pixel-based GIL constructs
         CHomogeneousPixelConcept< P >Homogeneous pixel concept
         CHomogeneousPixelValueConcept< P >Homogeneous pixel concept that is a Regular type
         Cidentity< T >Identity taken from SGI STL
         Cidentity< ChannelValue >
         Cimage< Pixel, IsPlanar, Alloc >Container interface over image view. Models ImageConcept, PixelBasedConcept
         Cimage_is_basic< Img >Basic images must use basic views and std::allocator
         Cimage_type< T, L, IsPlanar, Alloc >Returns the type of a homogeneous image given the channel type, layout, and whether it operates on planar data
         Cimage_view< Loc >A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,PixelBasedConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConcept
         CImageConcept< Image >2-dimensional image whose value type models PixelValueConcept
         CImageViewConcept< View >GIL's 2-dimensional view over immutable GIL pixels
         Cinc< T >Operator++ wrapped in a function object
         Cis_input_device< IODevice >
         Cis_iterator_adaptor< It >Metafunction predicate determining whether the given iterator is a plain one or an adaptor over another iterator. Examples of adaptors are the step iterator and the dereference iterator adaptor
         Cis_output_device< IODevice >
         Cis_pixel< bit_aligned_pixel_reference< B, C, L, M > >Metafunction predicate that flags bit_aligned_pixel_reference as a model of PixelConcept. Required by PixelConcept
         Cis_pixel< planar_pixel_reference< ChannelReference, ColorSpace > >Metafunction predicate that flags planar_pixel_reference as a model of PixelConcept. Required by PixelConcept
         Cis_planar< planar_pixel_reference< ChannelReference, ColorSpace > >Specifies that planar_pixel_reference represents a planar construct. Required by PixelBasedConcept
         Cis_read_device< FormatTag, T, D >
         Cis_read_only< Conversion_Policy >Determines if reader type is read only ( no conversion )
         Cis_read_supported< Pixel, FormatTag >
         Cis_write_device< FormatTag, T, D >
         Cistream_device< FormatTag >
         Citerator_adaptor_get_base< It >Returns the base iterator for a given iterator adaptor. Provide an specialization when introducing new iterator adaptors
         Citerator_adaptor_rebind< It, NewBaseIt >Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iterator adaptors
         Citerator_add_deref< Iterator, Deref >Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor upon dereferencing
         Citerator_add_deref< dereference_iterator_adaptor< Iterator, PREV_DEREF >, Deref >For dereference iterator adaptors, compose the new function object after the old one
         Citerator_from_2d< Loc2 >Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept
         Citerator_is_basic< Iterator >Determines if a given pixel iterator is basic Basic iterators must use gil::pixel (if interleaved), gil::planar_pixel_iterator (if planar) and gil::memory_based_step_iterator (if step). They must use the standard constness rules
         Citerator_is_basic< memory_based_step_iterator< pixel< T, L > * > >
         Citerator_is_basic< memory_based_step_iterator< pixel< T, L > const * > >
         Citerator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T *, CS > > >
         Citerator_is_basic< memory_based_step_iterator< planar_pixel_iterator< T const *, CS > > >
         Citerator_is_basic< pixel< T, L > * >
         Citerator_is_basic< pixel< T, L > const * >
         Citerator_is_basic< planar_pixel_iterator< T *, CS > >
         Citerator_is_basic< planar_pixel_iterator< T const *, CS > >
         Citerator_is_mutable< It >Metafunction predicate returning whether the given iterator allows for changing its values
         Citerator_is_mutable< Iterator >
         Citerator_is_mutable< L::x_iterator >
         Citerator_is_mutable< Loc::x_iterator >
         Citerator_is_mutable< V::x_iterator >
         Citerator_is_step< I >Determines if the given iterator has a step that could be set dynamically
         Citerator_is_step< iterator_adaptor_get_base< It >::type >
         Citerator_is_step< L::x_iterator >
         Citerator_is_step< L::y_iterator >
         Citerator_type< T, L, IsPlanar, IsStep, IsMutable >Returns the type of a homogeneous iterator given the channel type, layout, whether it operates on planar data, whether it is a step iterator, and whether it is mutable
         Citerator_type_from_pixel< Pixel, IsPlanar, IsStep, IsMutable >Returns the type of a pixel iterator given the pixel type, whether it operates on planar data, whether it is a step iterator, and whether it is mutable
         Citerator_type_from_pixel< const bit_aligned_pixel_reference< B, C, L, M >, IsPlanar, IsStep, IsMutable >
         CIteratorAdaptorConcept< Iterator >Iterator adaptor is a forward iterator adapting another forward iterator
         Ckernel_1d_adaptor< Core >Kernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),operator[], value_type,iterator,const_iterator,reference,const_reference
         Ckernel_1d_adaptor< std::array< T, Size > >
         Ckernel_1d_adaptor< std::vector< T, std::allocator< T > > >
         Ckernel_2d< T, Allocator >Variable-size kernel
         Ckernel_2d_fixed< T, Size >Static-size kernel
         Ckth_channel_deref_fn< K, SrcP >Function object that returns a grayscale reference of the K-th channel (specified as a template parameter) of a given reference. Models: PixelDereferenceAdaptorConcept
         Ckth_channel_view_type< K, View >Given a source image view type View, returns the type of an image view over a given channel of View
         Ckth_semantic_element_const_reference_type< ColorBase, K >Specifies the return type of the constant semantic_at_c<K>(color_base);
         Ckth_semantic_element_const_reference_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Ckth_semantic_element_reference_type< ColorBase, K >Specifies the return type of the mutable semantic_at_c<K>(color_base);
         Ckth_semantic_element_reference_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Ckth_semantic_element_type< ColorBase, K >Specifies the type of the K-th semantic element of a color base
         Ckth_semantic_element_type< ColorBase, color_index_type< ColorBase, Color >::value >
         Clayout< ColorSpace, ChannelMapping >Represents a color space and ordering of channels in memory
         Clayout< devicen_t< N >::type >
         Clocator_is_basic< Loc >Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and y_iterator
         Clocator_type< T, L, IsPlanar, IsStepX, IsMutable >Returns the type of a homogeneous locator given the channel type, layout, whether it operates on planar data and whether it has a step horizontally
         Cmagenta_tMagenta
         CMemoryBasedIteratorConcept< Iterator >Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
         Cmemunit_step_fn< Iterator >Function object that returns the memory unit distance between two iterators and advances a given iterator a given number of mem units (bytes or bits)
         CMetafunction< T >Concept for type as metafunction requirement
         CMutableChannelConcept< T >A channel that allows for modifying its value
         CMutableColorBaseConcept< ColorBase >Color base which allows for modifying its elements
         CMutableHomogeneousColorBaseConcept< ColorBase >Homogeneous color base that allows for modifying its elements
         CMutableHomogeneousPixelConcept< P >Homogeneous pixel concept that allows for changing its channels
         CMutableImageViewConcept< View >GIL's 2-dimensional view over mutable GIL pixels
         CMutableIteratorAdaptorConcept< Iterator >Iterator adaptor that is mutable
         CMutablePixelConcept< P >Pixel concept that allows for changing its channels
         CMutablePixelIteratorConcept< Iterator >Pixel iterator that allows for changing its pixel
         CMutablePixelLocatorConcept< Loc >GIL's 2-dimensional locator over mutable GIL pixels
         CMutableRandomAccess2DImageViewConcept< View >2-dimensional view over mutable values
         CMutableRandomAccess2DLocatorConcept< Loc >2-dimensional locator over mutable pixels
         CMutableRandomAccessNDImageViewConcept< View >N-dimensional view over mutable values
         CMutableRandomAccessNDLocatorConcept< Loc >N-dimensional locator over mutable pixels
         CMutableStepIteratorConcept< Iterator >Step iterator that allows for modifying its current value
         Cnth_channel_deref_fn< SrcP >Function object that returns a grayscale reference of the N-th channel of a given reference. Models: PixelDereferenceAdaptorConcept
         Cnth_channel_view_type< View >Given a source image view type View, returns the type of an image view over a single channel of View
         Cnth_channel_view_type< any_image_view< Views... > >Given a runtime source image view, returns the type of a runtime image view over a single channel of the source view
         Cnum_channels< PixelBased >Returns the number of channels of a pixel-based GIL construct
         Costream_device< FormatTag >
         Cpacked_dynamic_channel_reference< BitField, NumBits, false >Models a constant subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter
         Cpacked_dynamic_channel_reference< BitField, NumBits, true >Models a mutable subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter
         Cpacked_image_type< BitField, ChannelBitSizes, Layout, Alloc >Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned, but whose pixels are byte aligned
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1 >, Layout, std::allocator< unsigned char > >
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2 >, Layout, std::allocator< unsigned char > >
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3 >, Layout, std::allocator< unsigned char > >
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4 >, Layout, std::allocator< unsigned char > >
         Cpacked_image_type< BitField, mp11::mp_list_c< unsigned, Size1, Size2, Size3, Size4, Size5 >, Layout, std::allocator< unsigned char > >
         Cpacked_pixel< BitField, ChannelRefs, Layout >Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and their index. Models ColorBaseValueConcept, PixelValueConcept, PixelBasedConcept Typical use for this is a model of a packed pixel (like 565 RGB)
         Cpacked_pixel_type< BitField, ChannelBitSizes, Layout >Returns the type of a packed pixel given its bitfield type, the bit size of its channels and its layout
         Cpacked_pixel_type< BitField, mp11::mp_list_c< unsigned, NumBits >, Layout >
         Cpacked_pixel_type< detail::min_fast_uint< NumBits >::type, mp11::mp_list_c< unsigned, NumBits >, Layout >
         Cpixel< ChannelValue, Layout >Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept
         Cpixel_2d_locator_base< Loc, XIterator, YIterator >Base class for models of PixelLocatorConcept
         Cpixel_2d_locator_base< memory_based_2d_locator< StepIterator >, iterator_adaptor_get_base< StepIterator >::type, StepIterator >
         Cpixel_2d_locator_base< virtual_2d_locator< DerefFn, IsTransposed >, position_iterator< DerefFn, IsTransposed >, position_iterator< DerefFn, 1-IsTransposed > >
         Cpixel_assigns_t< PixelRef, PixelResult >Casts and assigns a pixel to another
         Cpixel_divides_scalar_t< PixelRef, Scalar, PixelResult >Performs channel-wise division of pixel elements by scalar
         Cpixel_divides_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise division of two pixels
         Cpixel_halves_t< PixelRef >Performs channel-wise division by 2
         Cpixel_is_reference< Pixel >Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value)
         Cpixel_minus_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise subtraction of two pixels
         Cpixel_multiplies_scalar_t< PixelRef, Scalar, PixelResult >Performs channel-wise multiplication of pixel elements by scalar
         Cpixel_multiplies_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise multiplication of two pixels
         Cpixel_plus_t< PixelRef1, PixelRef2, PixelResult >Performs channel-wise addition of two pixels
         Cpixel_proxy< T >Reference proxy associated with a type that has a "reference" member type alias
         Cpixel_reference_is_basic< PixelRef >Determines if a given pixel reference is basic Basic references must use gil::pixel& (if interleaved), gil::planar_pixel_reference (if planar). They must use the standard constness rules
         Cpixel_reference_is_mutable< R >Determines if the given pixel reference is mutable (i.e. its channels can be changed)
         Cpixel_reference_is_proxy< PixelReference >Determines whether the given pixel reference is a proxy class or a native C++ reference
         Cpixel_reference_type< T, L, IsPlanar, IsMutable >Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates on planar data and whether it is mutable
         Cpixel_value_type< Channel, Layout >Returns the type of a homogeneous pixel given the channel type and layout
         Cpixel_zeros_t< PixelRef >Sets pixel elements to zero (for whatever zero means)
         CPixelBasedConcept< P >Concept for all pixel-based GIL constructs
         CPixelConcept< P >Pixel concept - A color base whose elements are channels
         CPixelConvertibleConcept< SrcP, DstP >Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted to another, approximating the color. Conversion is explicit and sometimes lossy
         CPixelDereferenceAdaptorConcept< D >Represents a unary function object that can be invoked upon dereferencing a pixel iterator
         CPixelImageViewIsMutableConcept< View >
         CPixelIteratorConcept< Iterator >An STL random access traversal iterator over a model of PixelConcept
         CPixelIteratorIsMutableConcept< Iterator >
         CPixelLocatorConcept< Loc >GIL's 2-dimensional locator over immutable GIL pixels
         Cpixels_are_compatible< P1, P2 >Returns whether two pixels are compatible Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another
         Cpixels_are_compatible< V1::value_type, V2::value_type >
         CPixelsCompatibleConcept< P1, P2 >Concept for pixel compatibility Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another
         CPixelValueConcept< P >Pixel concept that is a Regular type
         Cplanar_pixel_iterator< ChannelPtr, ColorSpace >An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
         Cplanar_pixel_reference< ChannelReference, ColorSpace >A reference proxy to a planar pixel
         Cplus_asymmetric< T1, T2 >Plus function object whose arguments may be of different type
         Cpoint< T >2D point both axes of which have the same dimension typeModels: Point2DConcept
         CPoint2DConcept< P >2-dimensional point concept
         Cpoint< std::ptrdiff_t >
         Cpoint< std::size_t >
         CPointNDConcept< P >N-dimensional point concept
         Cposition_iterator< Deref, Dim >An iterator that remembers its current X,Y position and invokes a function object with it upon dereferencing. Used to create virtual image views. Models: StepIteratorConcept, PixelIteratorConcept, PixelBasedConcept, HasDynamicXStepTypeConcept
         Cpromote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >Meta-function to define an integral type with size than is (roughly) twice the bit size of T
         CRandomAccess2DImageConcept< Image >2-dimensional container of values
         CRandomAccess2DImageViewConcept< View >2-dimensional view over immutable values
         CRandomAccess2DImageViewIsMutableConcept< View >
         CRandomAccess2DLocatorConcept< Loc >2-dimensional locator over immutable values
         CRandomAccessNDImageConcept< Image >N-dimensional container of values
         CRandomAccessNDImageViewConcept< View >N-dimensional view over immutable values
         CRandomAccessNDImageViewIsMutableConcept< View >
         CRandomAccessNDLocatorConcept< Loc >N-dimensional locator over immutable values
         CRandomAccessNDLocatorIsMutableConcept< Loc >
         Cfile_stream_device< FormatTag >::read_tagUsed to overload the constructor
         Creader_base< FormatTag, ConversionPolicy >
         Cred_tRed
         CRegular< T >Concept for type regularity requirement
         CReversibleCollectionImageViewConcept< View >GIL view as ReversibleCollection
         Crgb_to_luminance_fn< RedChannel, GreenChannel, BlueChannel, GrayChannelValue >Red * .3 + green * .59 + blue * .11 + .5
         CSameType< T, U >Concept of types equivalence requirement
         Cscanline_read_iterator< Reader >Input iterator to read images
         Csize< ColorBase >Returns an integral constant type specifying the number of elements in a color base
         Cstd_fill_tStruct to do std::fill
         Cstep_iterator_adaptor< Derived, Iterator, SFn >An adaptor over an existing iterator that changes the step unit
         Cstep_iterator_adaptor< memory_based_step_iterator< Iterator >, Iterator, memunit_step_fn< Iterator > >
         CStepIteratorConcept< Iterator >Step iterator concept
         CSwappable< T >Concept of swap operation requirement
         Ctransposed_type< LocatorOrView >
         Ctuple_limit< Tuple >Provides equivalent of std::numeric_limits for type std::tuple tuple_limit gets called with only tuples having integral elements
         Ctype_from_x_iterator< XIterator >Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding built-in step_iterator, xy_locator, image_view
         Ctype_to_index< Types, T >Returns the index corresponding to the first occurrence of a given given type in
         Ctype_to_index< ColorBase::layout_t::color_space_t, Color >
         Cview_is_basic< View >Basic views must be over basic locators
         Cview_type< T, L, IsPlanar, IsStepX, IsMutable >Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar data and whether it has a step horizontally
         Cview_type_from_pixel< Pixel, IsPlanar, IsStepX, IsMutable >Returns the type of a view the pixel type, whether it operates on planar data and whether it has a step horizontally
         Cview_type_from_pixel< Pixel, IsPlanar >
         CViewsCompatibleConcept< V1, V2 >Views are compatible if they have the same color spaces and compatible channel values
         Cyellow_tYellow
        @@ -410,7 +411,7 @@ $(function() { diff --git a/html/reference/histogram_8hpp_source.html b/html/reference/histogram_8hpp_source.html index ce92ced48..e4e7d1d0a 100644 --- a/html/reference/histogram_8hpp_source.html +++ b/html/reference/histogram_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: histogram.hpp Source File @@ -27,647 +27,699 @@

        - + +/* @license-end */ + +
        -
        -
        histogram.hpp
        +
        histogram.hpp
        -
        1 //
        -
        2 // Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 
        -
        9 #ifndef BOOST_GIL_HISTOGRAM_HPP
        -
        10 #define BOOST_GIL_HISTOGRAM_HPP
        -
        11 
        -
        12 #include <boost/gil/concepts/concept_check.hpp>
        -
        13 #include <boost/gil/metafunctions.hpp>
        -
        14 #include <boost/gil/pixel.hpp>
        -
        15 
        -
        16 #include <boost/mp11.hpp>
        -
        17 #include <boost/type_traits.hpp>
        -
        18 #include <boost/functional/hash.hpp>
        -
        19 
        -
        20 #include <array>
        -
        21 #include <iostream>
        -
        22 #include <tuple>
        -
        23 #include <utility>
        -
        24 #include <vector>
        -
        25 #include <type_traits>
        -
        26 #include <map>
        -
        27 #include <unordered_map>
        -
        28 
        -
        29 namespace boost { namespace gil {
        -
        30 
        -
        39 
        -
        40 namespace detail {
        -
        41 
        -
        44 
        -
        47 template <std::size_t Index, typename... T>
        -
        48 inline auto hash_tuple_impl(std::size_t&, std::tuple<T...> const&)
        -
        49  -> typename std::enable_if<Index == sizeof...(T), void>::type
        -
        50 {
        -
        51  // terminating case
        -
        52 }
        -
        53 
        -
        56 template <std::size_t Index, typename... T>
        -
        57 inline auto hash_tuple_impl(std::size_t& seed, std::tuple<T...> const& t)
        -
        58  -> typename std::enable_if<Index != sizeof...(T), void>::type
        -
        59 {
        -
        60  boost::hash_combine(seed, std::get<Index>(t));
        -
        61  hash_tuple_impl<Index + 1>(seed, t);
        -
        62 }
        -
        63 
        -
        73 template <typename... T>
        -
        74 struct hash_tuple
        -
        75 {
        -
        76  auto operator()(std::tuple<T...> const& t) const -> std::size_t
        -
        77  {
        -
        78  std::size_t seed = 0;
        -
        79  hash_tuple_impl<0>(seed, t);
        -
        80  return seed;
        -
        81  }
        -
        82 };
        -
        83 
        -
        87 template <typename Pixel, std::size_t... I>
        -
        88 auto pixel_to_tuple(Pixel const& p, boost::mp11::index_sequence<I...>)
        -
        89  -> decltype(std::make_tuple(p[I]...))
        -
        90 {
        -
        91  return std::make_tuple(p[I]...);
        -
        92 }
        -
        93 
        -
        97 template <typename Tuple, std::size_t... I>
        -
        98 auto tuple_to_tuple(Tuple const& t, boost::mp11::index_sequence<I...>)
        -
        99  -> decltype(std::make_tuple(std::get<I>(t)...))
        -
        100 {
        -
        101  return std::make_tuple(std::get<I>(t)...);
        -
        102 }
        -
        103 
        -
        106 template <typename Tuple, std::size_t... I>
        -
        107 bool tuple_compare(Tuple const& t1, Tuple const& t2, boost::mp11::index_sequence<I...>)
        -
        108 {
        -
        109  std::array<bool, std::tuple_size<Tuple>::value> comp_list;
        -
        110  comp_list = {std::get<I>(t1) <= std::get<I>(t2)...};
        -
        111  bool comp = true;
        -
        112  for (std::size_t i = 0; i < comp_list.size(); i++)
        -
        113  {
        -
        114  comp = comp & comp_list[i];
        -
        115  }
        -
        116  return comp;
        -
        117 }
        -
        118 
        -
        124 template <typename Tuple>
        -
        125 bool tuple_compare(Tuple const& t1, Tuple const& t2)
        -
        126 {
        -
        127  std::size_t const tuple_size = std::tuple_size<Tuple>::value;
        -
        128  auto index_list = boost::mp11::make_index_sequence<tuple_size>{};
        -
        129  return tuple_compare(t1, t2, index_list);
        -
        130 }
        -
        131 
        -
        136 template <typename Tuple>
        - -
        138 {
        -
        139  static constexpr Tuple (min)()
        -
        140  {
        -
        141  return min_impl(boost::mp11::make_index_sequence<std::tuple_size<Tuple>::value>{});
        -
        142  }
        -
        143  static constexpr Tuple (max)()
        -
        144  {
        -
        145  return max_impl(boost::mp11::make_index_sequence<std::tuple_size<Tuple>::value>{});
        -
        146  }
        -
        147 
        -
        148 private:
        -
        149  template <std::size_t... I>
        -
        150  static constexpr Tuple min_impl(boost::mp11::index_sequence<I...>)
        -
        151  {
        -
        152  return std::make_tuple(
        -
        153  (std::numeric_limits<typename std::tuple_element<I, Tuple>::type>::min)()...);
        -
        154  }
        -
        155 
        -
        156  template <std::size_t... I>
        -
        157  static constexpr Tuple max_impl(boost::mp11::index_sequence<I...>)
        -
        158  {
        -
        159  return std::make_tuple(
        -
        160  (std::numeric_limits<typename std::tuple_element<I, Tuple>::type>::max)()...);
        -
        161  }
        -
        162 };
        -
        163 
        -
        171 template <std::size_t Dimension>
        -
        172 struct filler
        -
        173 {
        -
        174  template <typename Container, typename Tuple>
        -
        175  void operator()(Container&, Tuple&, Tuple&, std::size_t)
        -
        176  {
        -
        177  }
        -
        178 };
        -
        179 
        -
        182 template <>
        -
        183 struct filler<1>
        -
        184 {
        -
        185  template <typename Container, typename Tuple>
        -
        186  void operator()(Container& hist, Tuple& lower, Tuple& upper, std::size_t bin_width = 1)
        -
        187  {
        -
        188  for (auto i = std::get<0>(lower); static_cast<std::size_t>(std::get<0>(upper) - i) >= bin_width; i += bin_width)
        -
        189  {
        -
        190  hist(i / bin_width) = 0;
        -
        191  }
        -
        192  hist(std::get<0>(upper) / bin_width) = 0;
        -
        193  }
        -
        194 };
        -
        195 
        -
        196 } //namespace detail
        -
        197 
        -
        213 template <typename... T>
        -
        214 class histogram : public std::unordered_map<std::tuple<T...>, double, detail::hash_tuple<T...>>
        -
        215 {
        -
        216  using base_t = std::unordered_map<std::tuple<T...>, double, detail::hash_tuple<T...>>;
        -
        217  using bin_t = boost::mp11::mp_list<T...>;
        -
        218  using key_t = typename base_t::key_type;
        -
        219  using mapped_t = typename base_t::mapped_type;
        -
        220  using value_t = typename base_t::value_type;
        -
        221 
        -
        222 public:
        -
        223  histogram() = default;
        -
        224 
        -
        226  static constexpr std::size_t dimension()
        -
        227  {
        -
        228  return std::tuple_size<key_t>::value;
        -
        229  }
        -
        230 
        -
        232  mapped_t& operator()(T... indices)
        -
        233  {
        -
        234  auto key = std::make_tuple(indices...);
        -
        235  std::size_t const index_dimension = std::tuple_size<std::tuple<T...>>::value;
        -
        236  std::size_t const histogram_dimension = dimension();
        -
        237  static_assert(histogram_dimension == index_dimension, "Dimensions do not match.");
        -
        238 
        -
        239  return base_t::operator[](key);
        -
        240  }
        -
        241 
        -
        244  template <typename OtherType>
        -
        245  bool equals(OtherType const& otherhist) const
        -
        246  {
        -
        247  bool check = (dimension() == otherhist.dimension());
        -
        248 
        -
        249  using other_value_t = typename OtherType::value_type;
        -
        250  std::for_each(otherhist.begin(), otherhist.end(), [&](other_value_t const& v) {
        -
        251  key_t key = key_from_tuple(v.first);
        -
        252  if (base_t::find(key) != base_t::end())
        -
        253  {
        -
        254  check = check & (base_t::at(key) == otherhist.at(v.first));
        -
        255  }
        -
        256  else
        -
        257  {
        -
        258  check = false;
        -
        259  }
        -
        260  });
        -
        261  return check;
        -
        262  }
        -
        263 
        -
        266  static constexpr bool is_pixel_compatible()
        -
        267  {
        -
        268  using bin_types = boost::mp11::mp_list<T...>;
        -
        269  return boost::mp11::mp_all_of<bin_types, std::is_arithmetic>::value;
        -
        270  }
        -
        271 
        -
        274  template <typename Tuple>
        -
        275  bool is_tuple_compatible(Tuple const&)
        -
        276  {
        -
        277  std::size_t const tuple_size = std::tuple_size<Tuple>::value;
        -
        278  std::size_t const histogram_size = dimension();
        -
        279  // TODO : Explore consequence of using if-constexpr
        -
        280  using sequence_type = typename std::conditional
        -
        281  <
        -
        282  tuple_size >= histogram_size,
        -
        283  boost::mp11::make_index_sequence<histogram_size>,
        -
        284  boost::mp11::make_index_sequence<tuple_size>
        -
        285  >::type;
        -
        286 
        -
        287  if (is_tuple_size_compatible<Tuple>())
        -
        288  return is_tuple_type_compatible<Tuple>(sequence_type{});
        -
        289  else
        -
        290  return false;
        -
        291  }
        -
        292 
        -
        295  template <std::size_t... Dimensions, typename Tuple>
        -
        296  key_t key_from_tuple(Tuple const& t) const
        -
        297  {
        -
        298  using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
        -
        299  std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
        -
        300  std::size_t const tuple_size = std::tuple_size<Tuple>::value;
        -
        301  std::size_t const histogram_dimension = dimension();
        -
        302 
        -
        303  static_assert(
        -
        304  ((index_list_size != 0 && index_list_size == histogram_dimension) ||
        -
        305  (tuple_size == histogram_dimension)),
        -
        306  "Tuple and histogram key of different sizes");
        -
        307 
        -
        308  using new_index_list = typename std::conditional
        -
        309  <
        -
        310  index_list_size == 0,
        -
        311  boost::mp11::mp_list_c<std::size_t, 0>,
        -
        312  index_list
        -
        313  >::type;
        -
        314 
        -
        315  std::size_t const min =
        -
        316  boost::mp11::mp_min_element<new_index_list, boost::mp11::mp_less>::value;
        -
        317 
        -
        318  std::size_t const max =
        -
        319  boost::mp11::mp_max_element<new_index_list, boost::mp11::mp_less>::value;
        -
        320 
        -
        321  static_assert((0 <= min && max < tuple_size) || index_list_size == 0, "Index out of Range");
        -
        322 
        -
        323  using seq1 = boost::mp11::make_index_sequence<histogram_dimension>;
        -
        324  using seq2 = boost::mp11::index_sequence<Dimensions...>;
        -
        325  // TODO : Explore consequence of using if-constexpr
        -
        326  using sequence_type = typename std::conditional<index_list_size == 0, seq1, seq2>::type;
        -
        327 
        -
        328  auto key = detail::tuple_to_tuple(t, sequence_type{});
        -
        329  static_assert(
        -
        330  is_tuple_type_compatible<Tuple>(seq1{}),
        -
        331  "Tuple type and histogram type not compatible.");
        -
        332 
        -
        333  return make_histogram_key(key, seq1{});
        -
        334  }
        -
        335 
        -
        338  template <std::size_t... Dimensions, typename Pixel>
        -
        339  key_t key_from_pixel(Pixel const& p) const
        -
        340  {
        -
        341  using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
        -
        342  std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
        -
        343  std::size_t const pixel_dimension = num_channels<Pixel>::value;
        -
        344  std::size_t const histogram_dimension = dimension();
        -
        345 
        -
        346  static_assert(
        -
        347  ((index_list_size != 0 && index_list_size == histogram_dimension) ||
        -
        348  (index_list_size == 0 && pixel_dimension == histogram_dimension)) &&
        -
        349  is_pixel_compatible(),
        -
        350  "Pixels and histogram key are not compatible.");
        -
        351 
        -
        352  using new_index_list = typename std::conditional
        -
        353  <
        -
        354  index_list_size == 0,
        -
        355  boost::mp11::mp_list_c<std::size_t, 0>,
        -
        356  index_list
        -
        357  >::type;
        -
        358 
        -
        359  std::size_t const min =
        -
        360  boost::mp11::mp_min_element<new_index_list, boost::mp11::mp_less>::value;
        -
        361 
        -
        362  std::size_t const max =
        -
        363  boost::mp11::mp_max_element<new_index_list, boost::mp11::mp_less>::value;
        -
        364 
        -
        365  static_assert(
        -
        366  (0 <= min && max < pixel_dimension) || index_list_size == 0, "Index out of Range");
        -
        367 
        -
        368  using seq1 = boost::mp11::make_index_sequence<histogram_dimension>;
        -
        369  using seq2 = boost::mp11::index_sequence<Dimensions...>;
        -
        370  using sequence_type = typename std::conditional<index_list_size == 0, seq1, seq2>::type;
        -
        371 
        -
        372  auto key = detail::pixel_to_tuple(p, sequence_type{});
        -
        373  return make_histogram_key(key, seq1{});
        -
        374  }
        -
        375 
        -
        377  key_t nearest_key(key_t const& k) const
        -
        378  {
        -
        379  using check_list = boost::mp11::mp_list<boost::has_less<T>...>;
        -
        380  static_assert(
        -
        381  boost::mp11::mp_all_of<check_list, boost::mp11::mp_to_bool>::value,
        -
        382  "Keys are not comparable.");
        -
        383  auto nearest_k = k;
        -
        384  if (base_t::find(k) != base_t::end())
        -
        385  {
        -
        386  return nearest_k;
        -
        387  }
        -
        388  else
        -
        389  {
        -
        390  bool once = true;
        -
        391  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        -
        392  if (v.first <= k)
        -
        393  {
        -
        394  if (once)
        -
        395  {
        -
        396  once = !once;
        -
        397  nearest_k = v.first;
        -
        398  }
        -
        399  else if (nearest_k < v.first)
        -
        400  nearest_k = v.first;
        -
        401  }
        -
        402  });
        -
        403  return nearest_k;
        -
        404  }
        -
        405  }
        -
        406 
        -
        408  template <std::size_t... Dimensions, typename SrcView>
        -
        409  void fill(
        -
        410  SrcView const& srcview,
        -
        411  std::size_t bin_width = 1,
        -
        412  bool applymask = false,
        -
        413  std::vector<std::vector<bool>> mask = {},
        -
        414  key_t lower = key_t(),
        -
        415  key_t upper = key_t(),
        -
        416  bool setlimits = false)
        -
        417  {
        -
        418  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        419  using channel_t = typename channel_type<SrcView>::type;
        -
        420 
        -
        421  for (std::ptrdiff_t src_y = 0; src_y < srcview.height(); ++src_y)
        -
        422  {
        -
        423  auto src_it = srcview.row_begin(src_y);
        -
        424  for (std::ptrdiff_t src_x = 0; src_x < srcview.width(); ++src_x)
        -
        425  {
        -
        426  if (applymask && !mask[src_y][src_x])
        -
        427  continue;
        -
        428  auto scaled_px = src_it[src_x];
        -
        429  static_for_each(scaled_px, [&](channel_t& ch) {
        -
        430  ch = ch / bin_width;
        -
        431  });
        -
        432  auto key = key_from_pixel<Dimensions...>(scaled_px);
        -
        433  if (!setlimits ||
        -
        434  (detail::tuple_compare(lower, key) && detail::tuple_compare(key, upper)))
        -
        435  base_t::operator[](key)++;
        -
        436  }
        -
        437  }
        -
        438  }
        -
        439 
        -
        441  template <std::size_t... Dimensions, typename Tuple>
        -
        442  histogram sub_histogram(Tuple const& t1, Tuple const& t2)
        -
        443  {
        -
        444  using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
        -
        445  std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
        -
        446  std::size_t const histogram_dimension = dimension();
        -
        447 
        -
        448  std::size_t const min =
        -
        449  boost::mp11::mp_min_element<index_list, boost::mp11::mp_less>::value;
        -
        450 
        -
        451  std::size_t const max =
        -
        452  boost::mp11::mp_max_element<index_list, boost::mp11::mp_less>::value;
        -
        453 
        -
        454  static_assert(
        -
        455  (0 <= min && max < histogram_dimension) && index_list_size < histogram_dimension,
        -
        456  "Index out of Range");
        -
        457 
        -
        458  using seq1 = boost::mp11::make_index_sequence<dimension()>;
        -
        459  using seq2 = boost::mp11::index_sequence<Dimensions...>;
        -
        460 
        -
        461  static_assert(
        -
        462  is_tuple_type_compatible<Tuple>(seq1{}),
        -
        463  "Tuple type and histogram type not compatible.");
        -
        464 
        -
        465  auto low = make_histogram_key(t1, seq1{});
        -
        466  auto low_key = detail::tuple_to_tuple(low, seq2{});
        -
        467  auto high = make_histogram_key(t2, seq1{});
        -
        468  auto high_key = detail::tuple_to_tuple(high, seq2{});
        -
        469 
        -
        470  histogram sub_h;
        -
        471  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& k) {
        -
        472  auto tmp_key = detail::tuple_to_tuple(k.first, seq2{});
        -
        473  if (low_key <= tmp_key && tmp_key <= high_key)
        -
        474  sub_h[k.first] += base_t::operator[](k.first);
        -
        475  });
        -
        476  return sub_h;
        -
        477  }
        -
        478 
        -
        480  template <std::size_t... Dimensions>
        - -
        482  {
        -
        483  using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
        -
        484  std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
        -
        485  std::size_t const histogram_dimension = dimension();
        -
        486 
        -
        487  std::size_t const min =
        -
        488  boost::mp11::mp_min_element<index_list, boost::mp11::mp_less>::value;
        -
        489 
        -
        490  std::size_t const max =
        -
        491  boost::mp11::mp_max_element<index_list, boost::mp11::mp_less>::value;
        -
        492 
        -
        493  static_assert(
        -
        494  (0 <= min && max < histogram_dimension) && index_list_size < histogram_dimension,
        -
        495  "Index out of Range");
        -
        496 
        - -
        498 
        -
        499  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        -
        500  auto sub_key =
        -
        501  detail::tuple_to_tuple(v.first, boost::mp11::index_sequence<Dimensions...>{});
        -
        502  sub_h[sub_key] += base_t::operator[](v.first);
        -
        503  });
        -
        504  return sub_h;
        -
        505  }
        -
        506 
        -
        508  void normalize()
        -
        509  {
        -
        510  double sum = 0.0;
        -
        511  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        -
        512  sum += v.second;
        -
        513  });
        -
        514  // std::cout<<(long int)sum<<"asfe";
        -
        515  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        -
        516  base_t::operator[](v.first) = v.second / sum;
        -
        517  });
        -
        518  }
        -
        519 
        -
        521  double sum() const
        -
        522  {
        -
        523  double sum = 0.0;
        -
        524  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        -
        525  sum += v.second;
        -
        526  });
        -
        527  return sum;
        -
        528  }
        -
        529 
        -
        531  key_t min_key() const
        -
        532  {
        -
        533  key_t min_key = base_t::begin()->first;
        -
        534  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        -
        535  if (v.first < min_key)
        -
        536  min_key = v.first;
        -
        537  });
        -
        538  return min_key;
        -
        539  }
        -
        540 
        -
        542  key_t max_key() const
        -
        543  {
        -
        544  key_t max_key = base_t::begin()->first;
        -
        545  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        -
        546  if (v.first > max_key)
        -
        547  max_key = v.first;
        -
        548  });
        -
        549  return max_key;
        -
        550  }
        -
        551 
        -
        553  std::vector<key_t> sorted_keys() const
        -
        554  {
        -
        555  std::vector<key_t> sorted_keys;
        -
        556  std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        -
        557  sorted_keys.push_back(v.first);
        -
        558  });
        -
        559  std::sort(sorted_keys.begin(), sorted_keys.end());
        -
        560  return sorted_keys;
        -
        561  }
        -
        562 
        -
        563 private:
        -
        564  template <typename Tuple, std::size_t... I>
        -
        565  key_t make_histogram_key(Tuple const& t, boost::mp11::index_sequence<I...>) const
        -
        566  {
        -
        567  return std::make_tuple(
        -
        568  static_cast<typename boost::mp11::mp_at<bin_t, boost::mp11::mp_size_t<I>>>(
        -
        569  std::get<I>(t))...);
        -
        570  }
        -
        571 
        -
        572  template <typename Tuple, std::size_t... I>
        -
        573  static constexpr bool is_tuple_type_compatible(boost::mp11::index_sequence<I...>)
        -
        574  {
        -
        575  using tp = boost::mp11::mp_list
        -
        576  <
        -
        577  typename std::is_convertible
        -
        578  <
        -
        579  boost::mp11::mp_at<bin_t, boost::mp11::mp_size_t<I>>,
        -
        580  typename std::tuple_element<I, Tuple>::type
        -
        581  >::type...
        -
        582  >;
        -
        583  return boost::mp11::mp_all_of<tp, boost::mp11::mp_to_bool>::value;
        -
        584  }
        -
        585 
        -
        586  template <typename Tuple>
        -
        587  static constexpr bool is_tuple_size_compatible()
        -
        588  {
        -
        589  return (std::tuple_size<Tuple>::value == dimension());
        -
        590  }
        -
        591 };
        -
        592 
        -
        607 template <typename SrcView, typename Container>
        -
        608 void fill_histogram(SrcView const&, Container&);
        -
        609 
        -
        631 template <std::size_t... Dimensions, typename SrcView, typename... T>
        -
        632 void fill_histogram(
        -
        633  SrcView const& srcview,
        -
        634  histogram<T...>& hist,
        -
        635  std::size_t bin_width = 1,
        -
        636  bool accumulate = false,
        -
        637  bool sparsefill = true,
        -
        638  bool applymask = false,
        -
        639  std::vector<std::vector<bool>> mask = {},
        -
        640  typename histogram<T...>::key_type lower =
        -
        641  (detail::tuple_limit<typename histogram<T...>::key_type>::min)(),
        -
        642  typename histogram<T...>::key_type upper =
        -
        643  (detail::tuple_limit<typename histogram<T...>::key_type>::max)(),
        -
        644  bool setlimits = false)
        -
        645 {
        -
        646  if (!accumulate)
        -
        647  hist.clear();
        -
        648 
        -
        649  detail::filler<histogram<T...>::dimension()> f;
        -
        650  if (!sparsefill)
        -
        651  f(hist, lower, upper, bin_width);
        -
        652 
        -
        653  hist.template fill<Dimensions...>(srcview, bin_width, applymask, mask, lower, upper, setlimits);
        -
        654 }
        -
        655 
        -
        668 template <typename Container>
        -
        669 auto cumulative_histogram(Container const&) -> Container;
        -
        670 
        -
        671 template <typename... T>
        -
        672 auto cumulative_histogram(histogram<T...> const& hist) -> histogram<T...>
        -
        673 {
        -
        674  using check_list = boost::mp11::mp_list<boost::has_less<T>...>;
        -
        675  static_assert(
        -
        676  boost::mp11::mp_all_of<check_list, boost::mp11::mp_to_bool>::value,
        -
        677  "Cumulative histogram not possible of this type");
        -
        678 
        -
        679  using histogram_t = histogram<T...>;
        -
        680  using pair_t = std::pair<typename histogram_t::key_type, typename histogram_t::mapped_type>;
        -
        681  using value_t = typename histogram_t::value_type;
        -
        682 
        -
        683  histogram_t cumulative_hist;
        -
        684  std::size_t const dims = histogram_t::dimension();
        -
        685  if (dims == 1)
        -
        686  {
        -
        687  std::vector<pair_t> sorted_keys(hist.size());
        -
        688  std::size_t counter = 0;
        -
        689  std::for_each(hist.begin(), hist.end(), [&](value_t const& v) {
        -
        690  sorted_keys[counter++] = std::make_pair(v.first, v.second);
        -
        691  });
        -
        692  std::sort(sorted_keys.begin(), sorted_keys.end());
        -
        693  auto cumulative_counter = static_cast<typename histogram_t::mapped_type>(0);
        -
        694  for (std::size_t i = 0; i < sorted_keys.size(); ++i)
        -
        695  {
        -
        696  cumulative_counter += sorted_keys[i].second;
        -
        697  cumulative_hist[(sorted_keys[i].first)] = cumulative_counter;
        -
        698  }
        -
        699  }
        -
        700  else
        -
        701  {
        -
        702  std::for_each(hist.begin(), hist.end(), [&](value_t const& v1) {
        -
        703  auto cumulative_counter = static_cast<typename histogram_t::mapped_type>(0);
        -
        704  std::for_each(hist.begin(), hist.end(), [&](value_t const& v2) {
        -
        705  bool comp = detail::tuple_compare(
        -
        706  v2.first, v1.first,
        -
        707  boost::mp11::make_index_sequence<histogram_t::dimension()>{});
        -
        708  if (comp)
        -
        709  cumulative_counter += hist.at(v2.first);
        -
        710  });
        -
        711  cumulative_hist[v1.first] = cumulative_counter;
        -
        712  });
        -
        713  }
        -
        714  return cumulative_hist;
        -
        715 }
        -
        716 
        -
        717 }} //namespace boost::gil
        -
        718 
        -
        719 #endif
        -
        Default histogram class provided by boost::gil.
        Definition: histogram.hpp:215
        -
        static constexpr bool is_pixel_compatible()
        Checks if the histogram class is compatible to be used with a GIL image type.
        Definition: histogram.hpp:266
        -
        key_t key_from_tuple(Tuple const &t) const
        Returns a key compatible to be used as the histogram key from the input tuple.
        Definition: histogram.hpp:296
        -
        histogram< boost::mp11::mp_at< bin_t, boost::mp11::mp_size_t< Dimensions > >... > sub_histogram()
        Returns a sub-histogram over specified axes.
        Definition: histogram.hpp:481
        -
        mapped_t & operator()(T... indices)
        Returns bin value corresponding to specified tuple.
        Definition: histogram.hpp:232
        -
        static constexpr std::size_t dimension()
        Returns the number of dimensions(axes) the class supports.
        Definition: histogram.hpp:226
        -
        histogram sub_histogram(Tuple const &t1, Tuple const &t2)
        Can return a subset or a mask over the current histogram.
        Definition: histogram.hpp:442
        -
        key_t min_key() const
        Return the minimum key in histogram.
        Definition: histogram.hpp:531
        -
        key_t key_from_pixel(Pixel const &p) const
        Returns a histogram compatible key from the input pixel which can be directly used.
        Definition: histogram.hpp:339
        -
        std::vector< key_t > sorted_keys() const
        Return sorted keys in a vector.
        Definition: histogram.hpp:553
        -
        key_t nearest_key(key_t const &k) const
        Return nearest smaller key to specified histogram key.
        Definition: histogram.hpp:377
        -
        void normalize()
        Normalize this histogram class.
        Definition: histogram.hpp:508
        -
        void fill(SrcView const &srcview, std::size_t bin_width=1, bool applymask=false, std::vector< std::vector< bool >> mask={}, key_t lower=key_t(), key_t upper=key_t(), bool setlimits=false)
        Fills the histogram with the input image view.
        Definition: histogram.hpp:409
        -
        bool is_tuple_compatible(Tuple const &)
        Checks if the histogram class is compatible to be used with the specified tuple type.
        Definition: histogram.hpp:275
        -
        double sum() const
        Return the sum count of all bins.
        Definition: histogram.hpp:521
        -
        key_t max_key() const
        Return the maximum key in histogram.
        Definition: histogram.hpp:542
        -
        bool equals(OtherType const &otherhist) const
        Checks if 2 histograms are equal. Ignores type, and checks if the keys (after type casting) match.
        Definition: histogram.hpp:245
        -
        auto tuple_to_tuple(Tuple const &t, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(std::get< I >(t)...))
        Definition: histogram.hpp:98
        -
        auto pixel_to_tuple(Pixel const &p, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(p[I]...))
        Definition: histogram.hpp:88
        -
        bool tuple_compare(Tuple const &t1, Tuple const &t2)
        Compares 2 tuples and outputs t1 <= t2 Comparison is not in a lexicographic manner but on every eleme...
        Definition: histogram.hpp:125
        -
        void fill(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
        std::fill(I,I,V) with I being a iterator_from_2d
        Definition: algorithm.hpp:369
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: color_convert.hpp:31
        -
        Filler is used to fill the histogram class with all values between a specified range This functor is ...
        Definition: histogram.hpp:173
        -
        Functor provided for the hashing of tuples. The following approach makes use hash_combine from boost:...
        Definition: histogram.hpp:75
        -
        Provides equivalent of std::numeric_limits for type std::tuple tuple_limit gets called with only tupl...
        Definition: histogram.hpp:138
        -
        Returns the number of channels of a pixel-based GIL construct.
        Definition: pixel.hpp:54
        +
        1//
        +
        2// Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8
        +
        9#ifndef BOOST_GIL_HISTOGRAM_HPP
        +
        10#define BOOST_GIL_HISTOGRAM_HPP
        +
        11
        +
        12#include <boost/gil/concepts/concept_check.hpp>
        +
        13#include <boost/gil/metafunctions.hpp>
        +
        14#include <boost/gil/pixel.hpp>
        +
        15
        +
        16#include <boost/mp11.hpp>
        +
        17#include <boost/type_traits.hpp>
        +
        18#include <boost/functional/hash.hpp>
        +
        19
        +
        20#include <array>
        +
        21#include <iostream>
        +
        22#include <tuple>
        +
        23#include <utility>
        +
        24#include <vector>
        +
        25#include <type_traits>
        +
        26#include <map>
        +
        27#include <unordered_map>
        +
        28
        +
        29namespace boost { namespace gil {
        +
        30
        +
        39
        +
        40namespace detail {
        +
        41
        +
        44
        +
        47template <std::size_t Index, typename... T>
        +
        48inline auto hash_tuple_impl(std::size_t&, std::tuple<T...> const&)
        +
        49 -> typename std::enable_if<Index == sizeof...(T), void>::type
        +
        50{
        +
        51 // terminating case
        +
        52}
        +
        53
        +
        56template <std::size_t Index, typename... T>
        +
        57inline auto hash_tuple_impl(std::size_t& seed, std::tuple<T...> const& t)
        +
        58 -> typename std::enable_if<Index != sizeof...(T), void>::type
        +
        59{
        +
        60 boost::hash_combine(seed, std::get<Index>(t));
        +
        61 hash_tuple_impl<Index + 1>(seed, t);
        +
        62}
        +
        63
        +
        73template <typename... T>
        +
        + +
        75{
        +
        76 auto operator()(std::tuple<T...> const& t) const -> std::size_t
        +
        77 {
        +
        78 std::size_t seed = 0;
        +
        79 hash_tuple_impl<0>(seed, t);
        +
        80 return seed;
        +
        81 }
        +
        82};
        +
        +
        83
        +
        87template <typename Pixel, std::size_t... I>
        +
        +
        88auto pixel_to_tuple(Pixel const& p, boost::mp11::index_sequence<I...>)
        +
        89 -> decltype(std::make_tuple(p[I]...))
        +
        90{
        +
        91 return std::make_tuple(p[I]...);
        +
        92}
        +
        +
        93
        +
        97template <typename Tuple, std::size_t... I>
        +
        +
        98auto tuple_to_tuple(Tuple const& t, boost::mp11::index_sequence<I...>)
        +
        99 -> decltype(std::make_tuple(std::get<I>(t)...))
        +
        100{
        +
        101 return std::make_tuple(std::get<I>(t)...);
        +
        102}
        +
        +
        103
        +
        106template <typename Tuple, std::size_t... I>
        +
        107bool tuple_compare(Tuple const& t1, Tuple const& t2, boost::mp11::index_sequence<I...>)
        +
        108{
        +
        109 std::array<bool, std::tuple_size<Tuple>::value> comp_list;
        +
        110 comp_list = {std::get<I>(t1) <= std::get<I>(t2)...};
        +
        111 bool comp = true;
        +
        112 for (std::size_t i = 0; i < comp_list.size(); i++)
        +
        113 {
        +
        114 comp = comp & comp_list[i];
        +
        115 }
        +
        116 return comp;
        +
        117}
        +
        118
        +
        124template <typename Tuple>
        +
        +
        125bool tuple_compare(Tuple const& t1, Tuple const& t2)
        +
        126{
        +
        127 std::size_t const tuple_size = std::tuple_size<Tuple>::value;
        +
        128 auto index_list = boost::mp11::make_index_sequence<tuple_size>{};
        +
        129 return tuple_compare(t1, t2, index_list);
        +
        130}
        +
        +
        131
        +
        136template <typename Tuple>
        +
        + +
        138{
        +
        139 static constexpr Tuple (min)()
        +
        140 {
        +
        141 return min_impl(boost::mp11::make_index_sequence<std::tuple_size<Tuple>::value>{});
        +
        142 }
        +
        143 static constexpr Tuple (max)()
        +
        144 {
        +
        145 return max_impl(boost::mp11::make_index_sequence<std::tuple_size<Tuple>::value>{});
        +
        146 }
        +
        147
        +
        148private:
        +
        149 template <std::size_t... I>
        +
        150 static constexpr Tuple min_impl(boost::mp11::index_sequence<I...>)
        +
        151 {
        +
        152 return std::make_tuple(
        +
        153 (std::numeric_limits<typename std::tuple_element<I, Tuple>::type>::min)()...);
        +
        154 }
        +
        155
        +
        156 template <std::size_t... I>
        +
        157 static constexpr Tuple max_impl(boost::mp11::index_sequence<I...>)
        +
        158 {
        +
        159 return std::make_tuple(
        +
        160 (std::numeric_limits<typename std::tuple_element<I, Tuple>::type>::max)()...);
        +
        161 }
        +
        162};
        +
        +
        163
        +
        171template <std::size_t Dimension>
        +
        +
        172struct filler
        +
        173{
        +
        174 template <typename Container, typename Tuple>
        +
        175 void operator()(Container&, Tuple&, Tuple&, std::size_t)
        +
        176 {
        +
        177 }
        +
        178};
        +
        +
        179
        +
        182template <>
        +
        +
        183struct filler<1>
        +
        184{
        +
        185 template <typename Container, typename Tuple>
        +
        186 void operator()(Container& hist, Tuple& lower, Tuple& upper, std::size_t bin_width = 1)
        +
        187 {
        +
        188 for (auto i = std::get<0>(lower); static_cast<std::size_t>(std::get<0>(upper) - i) >= bin_width; i += bin_width)
        +
        189 {
        +
        190 hist(i / bin_width) = 0;
        +
        191 }
        +
        192 hist(std::get<0>(upper) / bin_width) = 0;
        +
        193 }
        +
        194};
        +
        +
        195
        +
        196} //namespace detail
        +
        197
        +
        213template <typename... T>
        +
        +
        214class histogram : public std::unordered_map<std::tuple<T...>, double, detail::hash_tuple<T...>>
        +
        215{
        +
        216 using base_t = std::unordered_map<std::tuple<T...>, double, detail::hash_tuple<T...>>;
        +
        217 using bin_t = boost::mp11::mp_list<T...>;
        +
        218 using key_t = typename base_t::key_type;
        +
        219 using mapped_t = typename base_t::mapped_type;
        +
        220 using value_t = typename base_t::value_type;
        +
        221
        +
        222public:
        +
        223 histogram() = default;
        +
        224
        +
        +
        226 static constexpr std::size_t dimension()
        +
        227 {
        +
        228 return std::tuple_size<key_t>::value;
        +
        229 }
        +
        +
        230
        +
        +
        232 mapped_t& operator()(T... indices)
        +
        233 {
        +
        234 auto key = std::make_tuple(indices...);
        +
        235 std::size_t const index_dimension = std::tuple_size<std::tuple<T...>>::value;
        +
        236 std::size_t const histogram_dimension = dimension();
        +
        237 static_assert(histogram_dimension == index_dimension, "Dimensions do not match.");
        +
        238
        +
        239 return base_t::operator[](key);
        +
        240 }
        +
        +
        241
        +
        244 template <typename OtherType>
        +
        +
        245 bool equals(OtherType const& otherhist) const
        +
        246 {
        +
        247 bool check = (dimension() == otherhist.dimension());
        +
        248
        +
        249 using other_value_t = typename OtherType::value_type;
        +
        250 std::for_each(otherhist.begin(), otherhist.end(), [&](other_value_t const& v) {
        +
        251 key_t key = key_from_tuple(v.first);
        +
        252 if (base_t::find(key) != base_t::end())
        +
        253 {
        +
        254 check = check & (base_t::at(key) == otherhist.at(v.first));
        +
        255 }
        +
        256 else
        +
        257 {
        +
        258 check = false;
        +
        259 }
        +
        260 });
        +
        261 return check;
        +
        262 }
        +
        +
        263
        +
        +
        266 static constexpr bool is_pixel_compatible()
        +
        267 {
        +
        268 using bin_types = boost::mp11::mp_list<T...>;
        +
        269 return boost::mp11::mp_all_of<bin_types, std::is_arithmetic>::value;
        +
        270 }
        +
        +
        271
        +
        274 template <typename Tuple>
        +
        +
        275 bool is_tuple_compatible(Tuple const&)
        +
        276 {
        +
        277 std::size_t const tuple_size = std::tuple_size<Tuple>::value;
        +
        278 std::size_t const histogram_size = dimension();
        +
        279 // TODO : Explore consequence of using if-constexpr
        +
        280 using sequence_type = typename std::conditional
        +
        281 <
        +
        282 tuple_size >= histogram_size,
        +
        283 boost::mp11::make_index_sequence<histogram_size>,
        +
        284 boost::mp11::make_index_sequence<tuple_size>
        +
        285 >::type;
        +
        286
        +
        287 if (is_tuple_size_compatible<Tuple>())
        +
        288 return is_tuple_type_compatible<Tuple>(sequence_type{});
        +
        289 else
        +
        290 return false;
        +
        291 }
        +
        +
        292
        +
        295 template <std::size_t... Dimensions, typename Tuple>
        +
        +
        296 key_t key_from_tuple(Tuple const& t) const
        +
        297 {
        +
        298 using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
        +
        299 std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
        +
        300 std::size_t const tuple_size = std::tuple_size<Tuple>::value;
        +
        301 std::size_t const histogram_dimension = dimension();
        +
        302
        +
        303 static_assert(
        +
        304 ((index_list_size != 0 && index_list_size == histogram_dimension) ||
        +
        305 (tuple_size == histogram_dimension)),
        +
        306 "Tuple and histogram key of different sizes");
        +
        307
        +
        308 using new_index_list = typename std::conditional
        +
        309 <
        +
        310 index_list_size == 0,
        +
        311 boost::mp11::mp_list_c<std::size_t, 0>,
        +
        312 index_list
        +
        313 >::type;
        +
        314
        +
        315 std::size_t const min =
        +
        316 boost::mp11::mp_min_element<new_index_list, boost::mp11::mp_less>::value;
        +
        317
        +
        318 std::size_t const max =
        +
        319 boost::mp11::mp_max_element<new_index_list, boost::mp11::mp_less>::value;
        +
        320
        +
        321 static_assert((0 <= min && max < tuple_size) || index_list_size == 0, "Index out of Range");
        +
        322
        +
        323 using seq1 = boost::mp11::make_index_sequence<histogram_dimension>;
        +
        324 using seq2 = boost::mp11::index_sequence<Dimensions...>;
        +
        325 // TODO : Explore consequence of using if-constexpr
        +
        326 using sequence_type = typename std::conditional<index_list_size == 0, seq1, seq2>::type;
        +
        327
        +
        328 auto key = detail::tuple_to_tuple(t, sequence_type{});
        +
        329 static_assert(
        +
        330 is_tuple_type_compatible<Tuple>(seq1{}),
        +
        331 "Tuple type and histogram type not compatible.");
        +
        332
        +
        333 return make_histogram_key(key, seq1{});
        +
        334 }
        +
        +
        335
        +
        338 template <std::size_t... Dimensions, typename Pixel>
        +
        +
        339 key_t key_from_pixel(Pixel const& p) const
        +
        340 {
        +
        341 using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
        +
        342 std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
        +
        343 std::size_t const pixel_dimension = num_channels<Pixel>::value;
        +
        344 std::size_t const histogram_dimension = dimension();
        +
        345
        +
        346 static_assert(
        +
        347 ((index_list_size != 0 && index_list_size == histogram_dimension) ||
        +
        348 (index_list_size == 0 && pixel_dimension == histogram_dimension)) &&
        +
        349 is_pixel_compatible(),
        +
        350 "Pixels and histogram key are not compatible.");
        +
        351
        +
        352 using new_index_list = typename std::conditional
        +
        353 <
        +
        354 index_list_size == 0,
        +
        355 boost::mp11::mp_list_c<std::size_t, 0>,
        +
        356 index_list
        +
        357 >::type;
        +
        358
        +
        359 std::size_t const min =
        +
        360 boost::mp11::mp_min_element<new_index_list, boost::mp11::mp_less>::value;
        +
        361
        +
        362 std::size_t const max =
        +
        363 boost::mp11::mp_max_element<new_index_list, boost::mp11::mp_less>::value;
        +
        364
        +
        365 static_assert(
        +
        366 (0 <= min && max < pixel_dimension) || index_list_size == 0, "Index out of Range");
        +
        367
        +
        368 using seq1 = boost::mp11::make_index_sequence<histogram_dimension>;
        +
        369 using seq2 = boost::mp11::index_sequence<Dimensions...>;
        +
        370 using sequence_type = typename std::conditional<index_list_size == 0, seq1, seq2>::type;
        +
        371
        +
        372 auto key = detail::pixel_to_tuple(p, sequence_type{});
        +
        373 return make_histogram_key(key, seq1{});
        +
        374 }
        +
        +
        375
        +
        +
        377 key_t nearest_key(key_t const& k) const
        +
        378 {
        +
        379 using check_list = boost::mp11::mp_list<boost::has_less<T>...>;
        +
        380 static_assert(
        +
        381 boost::mp11::mp_all_of<check_list, boost::mp11::mp_to_bool>::value,
        +
        382 "Keys are not comparable.");
        +
        383 auto nearest_k = k;
        +
        384 if (base_t::find(k) != base_t::end())
        +
        385 {
        +
        386 return nearest_k;
        +
        387 }
        +
        388 else
        +
        389 {
        +
        390 bool once = true;
        +
        391 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        +
        392 if (v.first <= k)
        +
        393 {
        +
        394 if (once)
        +
        395 {
        +
        396 once = !once;
        +
        397 nearest_k = v.first;
        +
        398 }
        +
        399 else if (nearest_k < v.first)
        +
        400 nearest_k = v.first;
        +
        401 }
        +
        402 });
        +
        403 return nearest_k;
        +
        404 }
        +
        405 }
        +
        +
        406
        +
        408 template <std::size_t... Dimensions, typename SrcView>
        +
        +
        409 void fill(
        +
        410 SrcView const& srcview,
        +
        411 std::size_t bin_width = 1,
        +
        412 bool applymask = false,
        +
        413 std::vector<std::vector<bool>> mask = {},
        +
        414 key_t lower = key_t(),
        +
        415 key_t upper = key_t(),
        +
        416 bool setlimits = false)
        +
        417 {
        +
        418 gil_function_requires<ImageViewConcept<SrcView>>();
        +
        419 using channel_t = typename channel_type<SrcView>::type;
        +
        420
        +
        421 for (std::ptrdiff_t src_y = 0; src_y < srcview.height(); ++src_y)
        +
        422 {
        +
        423 auto src_it = srcview.row_begin(src_y);
        +
        424 for (std::ptrdiff_t src_x = 0; src_x < srcview.width(); ++src_x)
        +
        425 {
        +
        426 if (applymask && !mask[src_y][src_x])
        +
        427 continue;
        +
        428 auto scaled_px = src_it[src_x];
        +
        429 static_for_each(scaled_px, [&](channel_t& ch) {
        +
        430 ch = ch / bin_width;
        +
        431 });
        +
        432 auto key = key_from_pixel<Dimensions...>(scaled_px);
        +
        433 if (!setlimits ||
        +
        434 (detail::tuple_compare(lower, key) && detail::tuple_compare(key, upper)))
        +
        435 base_t::operator[](key)++;
        +
        436 }
        +
        437 }
        +
        438 }
        +
        +
        439
        +
        441 template <std::size_t... Dimensions, typename Tuple>
        +
        +
        442 histogram sub_histogram(Tuple const& t1, Tuple const& t2)
        +
        443 {
        +
        444 using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
        +
        445 std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
        +
        446 std::size_t const histogram_dimension = dimension();
        +
        447
        +
        448 std::size_t const min =
        +
        449 boost::mp11::mp_min_element<index_list, boost::mp11::mp_less>::value;
        +
        450
        +
        451 std::size_t const max =
        +
        452 boost::mp11::mp_max_element<index_list, boost::mp11::mp_less>::value;
        +
        453
        +
        454 static_assert(
        +
        455 (0 <= min && max < histogram_dimension) && index_list_size < histogram_dimension,
        +
        456 "Index out of Range");
        +
        457
        +
        458 using seq1 = boost::mp11::make_index_sequence<dimension()>;
        +
        459 using seq2 = boost::mp11::index_sequence<Dimensions...>;
        +
        460
        +
        461 static_assert(
        +
        462 is_tuple_type_compatible<Tuple>(seq1{}),
        +
        463 "Tuple type and histogram type not compatible.");
        +
        464
        +
        465 auto low = make_histogram_key(t1, seq1{});
        +
        466 auto low_key = detail::tuple_to_tuple(low, seq2{});
        +
        467 auto high = make_histogram_key(t2, seq1{});
        +
        468 auto high_key = detail::tuple_to_tuple(high, seq2{});
        +
        469
        +
        470 histogram sub_h;
        +
        471 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& k) {
        +
        472 auto tmp_key = detail::tuple_to_tuple(k.first, seq2{});
        +
        473 if (low_key <= tmp_key && tmp_key <= high_key)
        +
        474 sub_h[k.first] += base_t::operator[](k.first);
        +
        475 });
        +
        476 return sub_h;
        +
        477 }
        +
        +
        478
        +
        480 template <std::size_t... Dimensions>
        +
        + +
        482 {
        +
        483 using index_list = boost::mp11::mp_list_c<std::size_t, Dimensions...>;
        +
        484 std::size_t const index_list_size = boost::mp11::mp_size<index_list>::value;
        +
        485 std::size_t const histogram_dimension = dimension();
        +
        486
        +
        487 std::size_t const min =
        +
        488 boost::mp11::mp_min_element<index_list, boost::mp11::mp_less>::value;
        +
        489
        +
        490 std::size_t const max =
        +
        491 boost::mp11::mp_max_element<index_list, boost::mp11::mp_less>::value;
        +
        492
        +
        493 static_assert(
        +
        494 (0 <= min && max < histogram_dimension) && index_list_size < histogram_dimension,
        +
        495 "Index out of Range");
        +
        496
        + +
        498
        +
        499 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        +
        500 auto sub_key =
        +
        501 detail::tuple_to_tuple(v.first, boost::mp11::index_sequence<Dimensions...>{});
        +
        502 sub_h[sub_key] += base_t::operator[](v.first);
        +
        503 });
        +
        504 return sub_h;
        +
        505 }
        +
        +
        506
        +
        + +
        509 {
        +
        510 double sum = 0.0;
        +
        511 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        +
        512 sum += v.second;
        +
        513 });
        +
        514 // std::cout<<(long int)sum<<"asfe";
        +
        515 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        +
        516 base_t::operator[](v.first) = v.second / sum;
        +
        517 });
        +
        518 }
        +
        +
        519
        +
        +
        521 double sum() const
        +
        522 {
        +
        523 double sum = 0.0;
        +
        524 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        +
        525 sum += v.second;
        +
        526 });
        +
        527 return sum;
        +
        528 }
        +
        +
        529
        +
        +
        531 key_t min_key() const
        +
        532 {
        +
        533 key_t min_key = base_t::begin()->first;
        +
        534 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        +
        535 if (v.first < min_key)
        +
        536 min_key = v.first;
        +
        537 });
        +
        538 return min_key;
        +
        539 }
        +
        +
        540
        +
        +
        542 key_t max_key() const
        +
        543 {
        +
        544 key_t max_key = base_t::begin()->first;
        +
        545 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        +
        546 if (v.first > max_key)
        +
        547 max_key = v.first;
        +
        548 });
        +
        549 return max_key;
        +
        550 }
        +
        +
        551
        +
        +
        553 std::vector<key_t> sorted_keys() const
        +
        554 {
        +
        555 std::vector<key_t> sorted_keys;
        +
        556 std::for_each(base_t::begin(), base_t::end(), [&](value_t const& v) {
        +
        557 sorted_keys.push_back(v.first);
        +
        558 });
        +
        559 std::sort(sorted_keys.begin(), sorted_keys.end());
        +
        560 return sorted_keys;
        +
        561 }
        +
        +
        562
        +
        563private:
        +
        564 template <typename Tuple, std::size_t... I>
        +
        565 key_t make_histogram_key(Tuple const& t, boost::mp11::index_sequence<I...>) const
        +
        566 {
        +
        567 return std::make_tuple(
        +
        568 static_cast<typename boost::mp11::mp_at<bin_t, boost::mp11::mp_size_t<I>>>(
        +
        569 std::get<I>(t))...);
        +
        570 }
        +
        571
        +
        572 template <typename Tuple, std::size_t... I>
        +
        573 static constexpr bool is_tuple_type_compatible(boost::mp11::index_sequence<I...>)
        +
        574 {
        +
        575 using tp = boost::mp11::mp_list
        +
        576 <
        +
        577 typename std::is_convertible
        +
        578 <
        +
        579 boost::mp11::mp_at<bin_t, boost::mp11::mp_size_t<I>>,
        +
        580 typename std::tuple_element<I, Tuple>::type
        +
        581 >::type...
        +
        582 >;
        +
        583 return boost::mp11::mp_all_of<tp, boost::mp11::mp_to_bool>::value;
        +
        584 }
        +
        585
        +
        586 template <typename Tuple>
        +
        587 static constexpr bool is_tuple_size_compatible()
        +
        588 {
        +
        589 return (std::tuple_size<Tuple>::value == dimension());
        +
        590 }
        +
        591};
        +
        +
        592
        +
        607template <typename SrcView, typename Container>
        +
        608void fill_histogram(SrcView const&, Container&);
        +
        609
        +
        631template <std::size_t... Dimensions, typename SrcView, typename... T>
        +
        632void fill_histogram(
        +
        633 SrcView const& srcview,
        +
        634 histogram<T...>& hist,
        +
        635 std::size_t bin_width = 1,
        +
        636 bool accumulate = false,
        +
        637 bool sparsefill = true,
        +
        638 bool applymask = false,
        +
        639 std::vector<std::vector<bool>> mask = {},
        +
        640 typename histogram<T...>::key_type lower =
        +
        641 (detail::tuple_limit<typename histogram<T...>::key_type>::min)(),
        +
        642 typename histogram<T...>::key_type upper =
        +
        643 (detail::tuple_limit<typename histogram<T...>::key_type>::max)(),
        +
        644 bool setlimits = false)
        +
        645{
        +
        646 if (!accumulate)
        +
        647 hist.clear();
        +
        648
        +
        649 detail::filler<histogram<T...>::dimension()> f;
        +
        650 if (!sparsefill)
        +
        651 f(hist, lower, upper, bin_width);
        +
        652
        +
        653 hist.template fill<Dimensions...>(srcview, bin_width, applymask, mask, lower, upper, setlimits);
        +
        654}
        +
        655
        +
        668template <typename Container>
        +
        669auto cumulative_histogram(Container const&) -> Container;
        +
        670
        +
        671template <typename... T>
        +
        672auto cumulative_histogram(histogram<T...> const& hist) -> histogram<T...>
        +
        673{
        +
        674 using check_list = boost::mp11::mp_list<boost::has_less<T>...>;
        +
        675 static_assert(
        +
        676 boost::mp11::mp_all_of<check_list, boost::mp11::mp_to_bool>::value,
        +
        677 "Cumulative histogram not possible of this type");
        +
        678
        +
        679 using histogram_t = histogram<T...>;
        +
        680 using pair_t = std::pair<typename histogram_t::key_type, typename histogram_t::mapped_type>;
        +
        681 using value_t = typename histogram_t::value_type;
        +
        682
        +
        683 histogram_t cumulative_hist;
        +
        684 std::size_t const dims = histogram_t::dimension();
        +
        685 if (dims == 1)
        +
        686 {
        +
        687 std::vector<pair_t> sorted_keys(hist.size());
        +
        688 std::size_t counter = 0;
        +
        689 std::for_each(hist.begin(), hist.end(), [&](value_t const& v) {
        +
        690 sorted_keys[counter++] = std::make_pair(v.first, v.second);
        +
        691 });
        +
        692 std::sort(sorted_keys.begin(), sorted_keys.end());
        +
        693 auto cumulative_counter = static_cast<typename histogram_t::mapped_type>(0);
        +
        694 for (std::size_t i = 0; i < sorted_keys.size(); ++i)
        +
        695 {
        +
        696 cumulative_counter += sorted_keys[i].second;
        +
        697 cumulative_hist[(sorted_keys[i].first)] = cumulative_counter;
        +
        698 }
        +
        699 }
        +
        700 else
        +
        701 {
        +
        702 std::for_each(hist.begin(), hist.end(), [&](value_t const& v1) {
        +
        703 auto cumulative_counter = static_cast<typename histogram_t::mapped_type>(0);
        +
        704 std::for_each(hist.begin(), hist.end(), [&](value_t const& v2) {
        +
        705 bool comp = detail::tuple_compare(
        +
        706 v2.first, v1.first,
        +
        707 boost::mp11::make_index_sequence<histogram_t::dimension()>{});
        +
        708 if (comp)
        +
        709 cumulative_counter += hist.at(v2.first);
        +
        710 });
        +
        711 cumulative_hist[v1.first] = cumulative_counter;
        +
        712 });
        +
        713 }
        +
        714 return cumulative_hist;
        +
        715}
        +
        716
        +
        717}} //namespace boost::gil
        +
        718
        +
        719#endif
        +
        Default histogram class provided by boost::gil.
        Definition histogram.hpp:215
        +
        histogram< boost::mp11::mp_at< bin_t, boost::mp11::mp_size_t< Dimensions > >... > sub_histogram()
        Returns a sub-histogram over specified axes.
        Definition histogram.hpp:481
        +
        static constexpr bool is_pixel_compatible()
        Checks if the histogram class is compatible to be used with a GIL image type.
        Definition histogram.hpp:266
        +
        key_t key_from_tuple(Tuple const &t) const
        Returns a key compatible to be used as the histogram key from the input tuple.
        Definition histogram.hpp:296
        +
        void fill(SrcView const &srcview, std::size_t bin_width=1, bool applymask=false, std::vector< std::vector< bool > > mask={}, key_t lower=key_t(), key_t upper=key_t(), bool setlimits=false)
        Fills the histogram with the input image view.
        Definition histogram.hpp:409
        +
        static constexpr std::size_t dimension()
        Returns the number of dimensions(axes) the class supports.
        Definition histogram.hpp:226
        +
        histogram sub_histogram(Tuple const &t1, Tuple const &t2)
        Can return a subset or a mask over the current histogram.
        Definition histogram.hpp:442
        +
        key_t min_key() const
        Return the minimum key in histogram.
        Definition histogram.hpp:531
        +
        key_t key_from_pixel(Pixel const &p) const
        Returns a histogram compatible key from the input pixel which can be directly used.
        Definition histogram.hpp:339
        +
        std::vector< key_t > sorted_keys() const
        Return sorted keys in a vector.
        Definition histogram.hpp:553
        +
        key_t nearest_key(key_t const &k) const
        Return nearest smaller key to specified histogram key.
        Definition histogram.hpp:377
        +
        mapped_t & operator()(T... indices)
        Returns bin value corresponding to specified tuple.
        Definition histogram.hpp:232
        +
        void normalize()
        Normalize this histogram class.
        Definition histogram.hpp:508
        +
        bool is_tuple_compatible(Tuple const &)
        Checks if the histogram class is compatible to be used with the specified tuple type.
        Definition histogram.hpp:275
        +
        double sum() const
        Return the sum count of all bins.
        Definition histogram.hpp:521
        +
        key_t max_key() const
        Return the maximum key in histogram.
        Definition histogram.hpp:542
        +
        bool equals(OtherType const &otherhist) const
        Checks if 2 histograms are equal. Ignores type, and checks if the keys (after type casting) match.
        Definition histogram.hpp:245
        +
        auto pixel_to_tuple(Pixel const &p, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(p[I]...))
        Definition histogram.hpp:88
        +
        auto tuple_to_tuple(Tuple const &t, boost::mp11::index_sequence< I... >) -> decltype(std::make_tuple(std::get< I >(t)...))
        Definition histogram.hpp:98
        +
        void fill(boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
        std::fill(I,I,V) with I being a iterator_from_2d
        Definition algorithm.hpp:369
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition color_convert.hpp:31
        +
        Filler is used to fill the histogram class with all values between a specified range This functor is ...
        Definition histogram.hpp:173
        +
        Functor provided for the hashing of tuples. The following approach makes use hash_combine from boost:...
        Definition histogram.hpp:75
        +
        Provides equivalent of std::numeric_limits for type std::tuple tuple_limit gets called with only tupl...
        Definition histogram.hpp:138
        +
        Returns the number of channels of a pixel-based GIL construct.
        Definition pixel.hpp:54
        diff --git a/html/reference/histogram__equalization_8hpp_source.html b/html/reference/histogram__equalization_8hpp_source.html index 86e4be21a..336f79729 100644 --- a/html/reference/histogram__equalization_8hpp_source.html +++ b/html/reference/histogram__equalization_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: histogram_equalization.hpp Source File @@ -27,142 +27,147 @@

        - + +/* @license-end */ + +
        -
        -
        histogram_equalization.hpp
        +
        histogram_equalization.hpp
        -
        1 //
        -
        2 // Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
        -
        3 //
        -
        4 // Use, modification and distribution are subject to the Boost Software License,
        -
        5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt)
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IMAGE_PROCESSING_HISTOGRAM_EQUALIZATION_HPP
        -
        9 #define BOOST_GIL_IMAGE_PROCESSING_HISTOGRAM_EQUALIZATION_HPP
        -
        10 
        -
        11 #include <boost/gil/histogram.hpp>
        -
        12 #include <boost/gil/image.hpp>
        -
        13 
        -
        14 #include <cmath>
        -
        15 #include <map>
        -
        16 #include <vector>
        -
        17 
        -
        18 namespace boost { namespace gil {
        -
        19 
        -
        35 
        -
        43 template <typename SrcKeyType>
        -
        44 auto histogram_equalization(histogram<SrcKeyType> const& src_hist)
        -
        45  -> std::map<SrcKeyType, SrcKeyType>
        -
        46 {
        -
        47  histogram<SrcKeyType> dst_hist;
        -
        48  return histogram_equalization(src_hist, dst_hist);
        -
        49 }
        -
        50 
        -
        61 template <typename SrcKeyType, typename DstKeyType>
        -
        62 auto histogram_equalization(histogram<SrcKeyType> const& src_hist, histogram<DstKeyType>& dst_hist)
        -
        63  -> std::map<SrcKeyType, DstKeyType>
        -
        64 {
        -
        65  static_assert(
        -
        66  std::is_integral<SrcKeyType>::value &&
        -
        67  std::is_integral<DstKeyType>::value,
        -
        68  "Source and destination histogram types are not appropriate");
        -
        69 
        -
        70  using value_t = typename histogram<SrcKeyType>::value_type;
        -
        71  dst_hist.clear();
        -
        72  double sum = src_hist.sum();
        -
        73  SrcKeyType min_key = (std::numeric_limits<DstKeyType>::min)();
        -
        74  SrcKeyType max_key = (std::numeric_limits<DstKeyType>::max)();
        -
        75  auto cumltv_srchist = cumulative_histogram(src_hist);
        -
        76  std::map<SrcKeyType, DstKeyType> color_map;
        -
        77  std::for_each(cumltv_srchist.begin(), cumltv_srchist.end(), [&](value_t const& v) {
        -
        78  DstKeyType trnsfrmd_key =
        -
        79  static_cast<DstKeyType>((v.second * (max_key - min_key)) / sum + min_key);
        -
        80  color_map[std::get<0>(v.first)] = trnsfrmd_key;
        -
        81  });
        -
        82  std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        -
        83  dst_hist[color_map[std::get<0>(v.first)]] += v.second;
        -
        84  });
        -
        85  return color_map;
        -
        86 }
        -
        87 
        -
        98 template <typename SrcView, typename DstView>
        -
        99 void histogram_equalization(
        -
        100  SrcView const& src_view,
        -
        101  DstView const& dst_view,
        -
        102  std::size_t bin_width = 1,
        -
        103  bool mask = false,
        -
        104  std::vector<std::vector<bool>> src_mask = {})
        -
        105 {
        -
        106  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        107  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        108 
        -
        109  static_assert(
        -
        110  color_spaces_are_compatible<
        -
        111  typename color_space_type<SrcView>::type,
        -
        112  typename color_space_type<DstView>::type>::value,
        -
        113  "Source and destination views must have same color space");
        -
        114 
        -
        115  // Defining channel type
        -
        116  using source_channel_t = typename channel_type<SrcView>::type;
        -
        117  using dst_channel_t = typename channel_type<DstView>::type;
        -
        118  using coord_t = typename SrcView::x_coord_t;
        -
        119 
        -
        120  std::size_t const channels = num_channels<SrcView>::value;
        -
        121  coord_t const width = src_view.width();
        -
        122  coord_t const height = src_view.height();
        -
        123  std::size_t pixel_max = (std::numeric_limits<dst_channel_t>::max)();
        -
        124  std::size_t pixel_min = (std::numeric_limits<dst_channel_t>::min)();
        -
        125 
        -
        126  for (std::size_t i = 0; i < channels; i++)
        -
        127  {
        -
        128  histogram<source_channel_t> h;
        -
        129  fill_histogram(nth_channel_view(src_view, i), h, bin_width, false, false, mask, src_mask);
        -
        130  h.normalize();
        -
        131  auto h2 = cumulative_histogram(h);
        -
        132  for (std::ptrdiff_t src_y = 0; src_y < height; ++src_y)
        -
        133  {
        -
        134  auto src_it = nth_channel_view(src_view, i).row_begin(src_y);
        -
        135  auto dst_it = nth_channel_view(dst_view, i).row_begin(src_y);
        -
        136  for (std::ptrdiff_t src_x = 0; src_x < width; ++src_x)
        -
        137  {
        -
        138  if (mask && !src_mask[src_y][src_x])
        -
        139  dst_it[src_x][0] = channel_convert<dst_channel_t>(src_it[src_x][0]);
        -
        140  else
        -
        141  dst_it[src_x][0] = static_cast<dst_channel_t>(
        -
        142  h2[src_it[src_x][0]] * (pixel_max - pixel_min) + pixel_min);
        -
        143  }
        -
        144  }
        -
        145  }
        -
        146 }
        -
        147 
        -
        148 }} //namespace boost::gil
        -
        149 
        -
        150 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
        +
        3//
        +
        4// Use, modification and distribution are subject to the Boost Software License,
        +
        5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt)
        +
        7//
        +
        8#ifndef BOOST_GIL_IMAGE_PROCESSING_HISTOGRAM_EQUALIZATION_HPP
        +
        9#define BOOST_GIL_IMAGE_PROCESSING_HISTOGRAM_EQUALIZATION_HPP
        +
        10
        +
        11#include <boost/gil/histogram.hpp>
        +
        12#include <boost/gil/image.hpp>
        +
        13
        +
        14#include <cmath>
        +
        15#include <map>
        +
        16#include <vector>
        +
        17
        +
        18namespace boost { namespace gil {
        +
        19
        +
        35
        +
        43template <typename SrcKeyType>
        +
        44auto histogram_equalization(histogram<SrcKeyType> const& src_hist)
        +
        45 -> std::map<SrcKeyType, SrcKeyType>
        +
        46{
        +
        47 histogram<SrcKeyType> dst_hist;
        +
        48 return histogram_equalization(src_hist, dst_hist);
        +
        49}
        +
        50
        +
        61template <typename SrcKeyType, typename DstKeyType>
        +
        62auto histogram_equalization(histogram<SrcKeyType> const& src_hist, histogram<DstKeyType>& dst_hist)
        +
        63 -> std::map<SrcKeyType, DstKeyType>
        +
        64{
        +
        65 static_assert(
        +
        66 std::is_integral<SrcKeyType>::value &&
        +
        67 std::is_integral<DstKeyType>::value,
        +
        68 "Source and destination histogram types are not appropriate");
        +
        69
        +
        70 using value_t = typename histogram<SrcKeyType>::value_type;
        +
        71 dst_hist.clear();
        +
        72 double sum = src_hist.sum();
        +
        73 SrcKeyType min_key = (std::numeric_limits<DstKeyType>::min)();
        +
        74 SrcKeyType max_key = (std::numeric_limits<DstKeyType>::max)();
        +
        75 auto cumltv_srchist = cumulative_histogram(src_hist);
        +
        76 std::map<SrcKeyType, DstKeyType> color_map;
        +
        77 std::for_each(cumltv_srchist.begin(), cumltv_srchist.end(), [&](value_t const& v) {
        +
        78 DstKeyType trnsfrmd_key =
        +
        79 static_cast<DstKeyType>((v.second * (max_key - min_key)) / sum + min_key);
        +
        80 color_map[std::get<0>(v.first)] = trnsfrmd_key;
        +
        81 });
        +
        82 std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        +
        83 dst_hist[color_map[std::get<0>(v.first)]] += v.second;
        +
        84 });
        +
        85 return color_map;
        +
        86}
        +
        87
        +
        98template <typename SrcView, typename DstView>
        +
        99void histogram_equalization(
        +
        100 SrcView const& src_view,
        +
        101 DstView const& dst_view,
        +
        102 std::size_t bin_width = 1,
        +
        103 bool mask = false,
        +
        104 std::vector<std::vector<bool>> src_mask = {})
        +
        105{
        +
        106 gil_function_requires<ImageViewConcept<SrcView>>();
        +
        107 gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        108
        +
        109 static_assert(
        +
        110 color_spaces_are_compatible<
        +
        111 typename color_space_type<SrcView>::type,
        +
        112 typename color_space_type<DstView>::type>::value,
        +
        113 "Source and destination views must have same color space");
        +
        114
        +
        115 // Defining channel type
        +
        116 using source_channel_t = typename channel_type<SrcView>::type;
        +
        117 using dst_channel_t = typename channel_type<DstView>::type;
        +
        118 using coord_t = typename SrcView::x_coord_t;
        +
        119
        +
        120 std::size_t const channels = num_channels<SrcView>::value;
        +
        121 coord_t const width = src_view.width();
        +
        122 coord_t const height = src_view.height();
        +
        123 std::size_t pixel_max = (std::numeric_limits<dst_channel_t>::max)();
        +
        124 std::size_t pixel_min = (std::numeric_limits<dst_channel_t>::min)();
        +
        125
        +
        126 for (std::size_t i = 0; i < channels; i++)
        +
        127 {
        +
        128 histogram<source_channel_t> h;
        +
        129 fill_histogram(nth_channel_view(src_view, i), h, bin_width, false, false, mask, src_mask);
        +
        130 h.normalize();
        +
        131 auto h2 = cumulative_histogram(h);
        +
        132 for (std::ptrdiff_t src_y = 0; src_y < height; ++src_y)
        +
        133 {
        +
        134 auto src_it = nth_channel_view(src_view, i).row_begin(src_y);
        +
        135 auto dst_it = nth_channel_view(dst_view, i).row_begin(src_y);
        +
        136 for (std::ptrdiff_t src_x = 0; src_x < width; ++src_x)
        +
        137 {
        +
        138 if (mask && !src_mask[src_y][src_x])
        +
        139 dst_it[src_x][0] = channel_convert<dst_channel_t>(src_it[src_x][0]);
        +
        140 else
        +
        141 dst_it[src_x][0] = static_cast<dst_channel_t>(
        +
        142 h2[src_it[src_x][0]] * (pixel_max - pixel_min) + pixel_min);
        +
        143 }
        +
        144 }
        +
        145 }
        +
        146}
        +
        147
        +
        148}} //namespace boost::gil
        +
        149
        +
        150#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/histogram__matching_8hpp_source.html b/html/reference/histogram__matching_8hpp_source.html index d6904e82f..0a329b21a 100644 --- a/html/reference/histogram__matching_8hpp_source.html +++ b/html/reference/histogram__matching_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: histogram_matching.hpp Source File @@ -27,193 +27,198 @@

        - + +/* @license-end */ + +
        -
        -
        histogram_matching.hpp
        +
        histogram_matching.hpp
        -
        1 //
        -
        2 // Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
        -
        3 //
        -
        4 // Use, modification and distribution are subject to the Boost Software License,
        -
        5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt)
        -
        7 //
        -
        8 
        -
        9 #ifndef BOOST_GIL_IMAGE_PROCESSING_HISTOGRAM_MATCHING_HPP
        -
        10 #define BOOST_GIL_IMAGE_PROCESSING_HISTOGRAM_MATCHING_HPP
        -
        11 
        -
        12 #include <boost/gil/algorithm.hpp>
        -
        13 #include <boost/gil/histogram.hpp>
        -
        14 #include <boost/gil/image.hpp>
        -
        15 
        -
        16 #include <algorithm>
        -
        17 #include <cmath>
        -
        18 #include <map>
        -
        19 #include <vector>
        -
        20 
        -
        21 namespace boost { namespace gil {
        -
        22 
        -
        36 
        -
        45 template <typename SrcKeyType, typename RefKeyType>
        -
        46 auto histogram_matching(histogram<SrcKeyType> const& src_hist, histogram<RefKeyType> const& ref_hist)
        -
        47  -> std::map<SrcKeyType, SrcKeyType>
        -
        48 {
        -
        49  histogram<SrcKeyType> dst_hist;
        -
        50  return histogram_matching(src_hist, ref_hist, dst_hist);
        -
        51 }
        -
        52 
        -
        65 template <typename SrcKeyType, typename RefKeyType, typename DstKeyType>
        -
        66 auto histogram_matching(
        -
        67  histogram<SrcKeyType> const& src_hist,
        -
        68  histogram<RefKeyType> const& ref_hist,
        -
        69  histogram<DstKeyType>& dst_hist)
        -
        70  -> std::map<SrcKeyType, DstKeyType>
        -
        71 {
        -
        72  static_assert(
        -
        73  std::is_integral<SrcKeyType>::value &&
        -
        74  std::is_integral<RefKeyType>::value &&
        -
        75  std::is_integral<DstKeyType>::value,
        -
        76  "Source, Refernce or Destination histogram type is not appropriate.");
        -
        77 
        -
        78  using value_t = typename histogram<SrcKeyType>::value_type;
        -
        79  dst_hist.clear();
        -
        80  double src_sum = src_hist.sum();
        -
        81  double ref_sum = ref_hist.sum();
        -
        82  auto cumltv_srchist = cumulative_histogram(src_hist);
        -
        83  auto cumltv_refhist = cumulative_histogram(ref_hist);
        -
        84  std::map<SrcKeyType, RefKeyType> inverse_mapping;
        -
        85 
        -
        86  std::vector<typename histogram<RefKeyType>::key_type> src_keys, ref_keys;
        -
        87  src_keys = src_hist.sorted_keys();
        -
        88  ref_keys = ref_hist.sorted_keys();
        -
        89  std::ptrdiff_t start = ref_keys.size() - 1;
        -
        90  RefKeyType ref_max;
        -
        91  if (start >= 0)
        -
        92  ref_max = std::get<0>(ref_keys[start]);
        -
        93 
        -
        94  for (std::ptrdiff_t j = src_keys.size() - 1; j >= 0; --j)
        -
        95  {
        -
        96  double src_val = (cumltv_srchist[src_keys[j]] * ref_sum) / src_sum;
        -
        97  while (cumltv_refhist[ref_keys[start]] > src_val && start > 0)
        -
        98  {
        -
        99  start--;
        -
        100  }
        -
        101  if (std::abs(cumltv_refhist[ref_keys[start]] - src_val) >
        -
        102  std::abs(cumltv_refhist(std::min<RefKeyType>(ref_max, std::get<0>(ref_keys[start + 1]))) -
        -
        103  src_val))
        -
        104  {
        -
        105  inverse_mapping[std::get<0>(src_keys[j])] =
        -
        106  std::min<RefKeyType>(ref_max, std::get<0>(ref_keys[start + 1]));
        -
        107  }
        -
        108  else
        -
        109  {
        -
        110  inverse_mapping[std::get<0>(src_keys[j])] = std::get<0>(ref_keys[start]);
        -
        111  }
        -
        112  if (j == 0)
        -
        113  break;
        -
        114  }
        -
        115  std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        -
        116  dst_hist[inverse_mapping[std::get<0>(v.first)]] += v.second;
        -
        117  });
        -
        118  return inverse_mapping;
        -
        119 }
        -
        120 
        -
        134 template <typename SrcView, typename ReferenceView, typename DstView>
        -
        135 void histogram_matching(
        -
        136  SrcView const& src_view,
        -
        137  ReferenceView const& ref_view,
        -
        138  DstView const& dst_view,
        -
        139  std::size_t bin_width = 1,
        -
        140  bool mask = false,
        -
        141  std::vector<std::vector<bool>> src_mask = {},
        -
        142  std::vector<std::vector<bool>> ref_mask = {})
        -
        143 {
        -
        144  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        145  gil_function_requires<ImageViewConcept<ReferenceView>>();
        -
        146  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        147 
        -
        148  static_assert(
        -
        149  color_spaces_are_compatible<
        -
        150  typename color_space_type<SrcView>::type,
        -
        151  typename color_space_type<ReferenceView>::type>::value,
        -
        152  "Source and reference view must have same color space");
        -
        153 
        -
        154  static_assert(
        -
        155  color_spaces_are_compatible<
        -
        156  typename color_space_type<SrcView>::type,
        -
        157  typename color_space_type<DstView>::type>::value,
        -
        158  "Source and destination view must have same color space");
        -
        159 
        -
        160  // Defining channel type
        -
        161  using source_channel_t = typename channel_type<SrcView>::type;
        -
        162  using ref_channel_t = typename channel_type<ReferenceView>::type;
        -
        163  using dst_channel_t = typename channel_type<DstView>::type;
        -
        164  using coord_t = typename SrcView::x_coord_t;
        -
        165 
        -
        166  std::size_t const channels = num_channels<SrcView>::value;
        -
        167  coord_t const width = src_view.width();
        -
        168  coord_t const height = src_view.height();
        -
        169  source_channel_t src_pixel_min = (std::numeric_limits<source_channel_t>::min)();
        -
        170  source_channel_t src_pixel_max = (std::numeric_limits<source_channel_t>::max)();
        -
        171  ref_channel_t ref_pixel_min = (std::numeric_limits<ref_channel_t>::min)();
        -
        172  ref_channel_t ref_pixel_max = (std::numeric_limits<ref_channel_t>::max)();
        -
        173 
        -
        174  for (std::size_t i = 0; i < channels; i++)
        -
        175  {
        -
        176  histogram<source_channel_t> src_histogram;
        -
        177  histogram<ref_channel_t> ref_histogram;
        -
        178  fill_histogram(
        -
        179  nth_channel_view(src_view, i), src_histogram, bin_width, false, false, mask, src_mask,
        -
        180  std::tuple<source_channel_t>(src_pixel_min),
        -
        181  std::tuple<source_channel_t>(src_pixel_max), true);
        -
        182  fill_histogram(
        -
        183  nth_channel_view(ref_view, i), ref_histogram, bin_width, false, false, mask, ref_mask,
        -
        184  std::tuple<ref_channel_t>(ref_pixel_min), std::tuple<ref_channel_t>(ref_pixel_max),
        -
        185  true);
        -
        186  auto inverse_mapping = histogram_matching(src_histogram, ref_histogram);
        -
        187  for (std::ptrdiff_t src_y = 0; src_y < height; ++src_y)
        -
        188  {
        -
        189  auto src_it = nth_channel_view(src_view, i).row_begin(src_y);
        -
        190  auto dst_it = nth_channel_view(dst_view, i).row_begin(src_y);
        -
        191  for (std::ptrdiff_t src_x = 0; src_x < width; ++src_x)
        -
        192  {
        -
        193  if (mask && !src_mask[src_y][src_x])
        -
        194  dst_it[src_x][0] = src_it[src_x][0];
        -
        195  else
        -
        196  dst_it[src_x][0] =
        -
        197  static_cast<dst_channel_t>(inverse_mapping[src_it[src_x][0]]);
        -
        198  }
        -
        199  }
        -
        200  }
        -
        201 }
        -
        202 
        -
        203 }} //namespace boost::gil
        -
        204 
        -
        205 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2020 Debabrata Mandal <mandaldebabrata123@gmail.com>
        +
        3//
        +
        4// Use, modification and distribution are subject to the Boost Software License,
        +
        5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt)
        +
        7//
        +
        8
        +
        9#ifndef BOOST_GIL_IMAGE_PROCESSING_HISTOGRAM_MATCHING_HPP
        +
        10#define BOOST_GIL_IMAGE_PROCESSING_HISTOGRAM_MATCHING_HPP
        +
        11
        +
        12#include <boost/gil/algorithm.hpp>
        +
        13#include <boost/gil/histogram.hpp>
        +
        14#include <boost/gil/image.hpp>
        +
        15
        +
        16#include <algorithm>
        +
        17#include <cmath>
        +
        18#include <map>
        +
        19#include <vector>
        +
        20
        +
        21namespace boost { namespace gil {
        +
        22
        +
        36
        +
        45template <typename SrcKeyType, typename RefKeyType>
        +
        46auto histogram_matching(histogram<SrcKeyType> const& src_hist, histogram<RefKeyType> const& ref_hist)
        +
        47 -> std::map<SrcKeyType, SrcKeyType>
        +
        48{
        +
        49 histogram<SrcKeyType> dst_hist;
        +
        50 return histogram_matching(src_hist, ref_hist, dst_hist);
        +
        51}
        +
        52
        +
        65template <typename SrcKeyType, typename RefKeyType, typename DstKeyType>
        +
        66auto histogram_matching(
        +
        67 histogram<SrcKeyType> const& src_hist,
        +
        68 histogram<RefKeyType> const& ref_hist,
        +
        69 histogram<DstKeyType>& dst_hist)
        +
        70 -> std::map<SrcKeyType, DstKeyType>
        +
        71{
        +
        72 static_assert(
        +
        73 std::is_integral<SrcKeyType>::value &&
        +
        74 std::is_integral<RefKeyType>::value &&
        +
        75 std::is_integral<DstKeyType>::value,
        +
        76 "Source, Reference or Destination histogram type is not appropriate.");
        +
        77
        +
        78 using value_t = typename histogram<SrcKeyType>::value_type;
        +
        79 dst_hist.clear();
        +
        80 double src_sum = src_hist.sum();
        +
        81 double ref_sum = ref_hist.sum();
        +
        82 auto cumltv_srchist = cumulative_histogram(src_hist);
        +
        83 auto cumltv_refhist = cumulative_histogram(ref_hist);
        +
        84 std::map<SrcKeyType, RefKeyType> inverse_mapping;
        +
        85
        +
        86 std::vector<typename histogram<RefKeyType>::key_type> src_keys, ref_keys;
        +
        87 src_keys = src_hist.sorted_keys();
        +
        88 ref_keys = ref_hist.sorted_keys();
        +
        89 std::ptrdiff_t start = ref_keys.size() - 1;
        +
        90 RefKeyType ref_max;
        +
        91 if (start >= 0)
        +
        92 ref_max = std::get<0>(ref_keys[start]);
        +
        93
        +
        94 for (std::ptrdiff_t j = src_keys.size() - 1; j >= 0; --j)
        +
        95 {
        +
        96 double src_val = (cumltv_srchist[src_keys[j]] * ref_sum) / src_sum;
        +
        97 while (cumltv_refhist[ref_keys[start]] > src_val && start > 0)
        +
        98 {
        +
        99 start--;
        +
        100 }
        +
        101 if (std::abs(cumltv_refhist[ref_keys[start]] - src_val) >
        +
        102 std::abs(cumltv_refhist(std::min<RefKeyType>(ref_max, std::get<0>(ref_keys[start + 1]))) -
        +
        103 src_val))
        +
        104 {
        +
        105 inverse_mapping[std::get<0>(src_keys[j])] =
        +
        106 std::min<RefKeyType>(ref_max, std::get<0>(ref_keys[start + 1]));
        +
        107 }
        +
        108 else
        +
        109 {
        +
        110 inverse_mapping[std::get<0>(src_keys[j])] = std::get<0>(ref_keys[start]);
        +
        111 }
        +
        112 if (j == 0)
        +
        113 break;
        +
        114 }
        +
        115 std::for_each(src_hist.begin(), src_hist.end(), [&](value_t const& v) {
        +
        116 dst_hist[inverse_mapping[std::get<0>(v.first)]] += v.second;
        +
        117 });
        +
        118 return inverse_mapping;
        +
        119}
        +
        120
        +
        134template <typename SrcView, typename ReferenceView, typename DstView>
        +
        135void histogram_matching(
        +
        136 SrcView const& src_view,
        +
        137 ReferenceView const& ref_view,
        +
        138 DstView const& dst_view,
        +
        139 std::size_t bin_width = 1,
        +
        140 bool mask = false,
        +
        141 std::vector<std::vector<bool>> src_mask = {},
        +
        142 std::vector<std::vector<bool>> ref_mask = {})
        +
        143{
        +
        144 gil_function_requires<ImageViewConcept<SrcView>>();
        +
        145 gil_function_requires<ImageViewConcept<ReferenceView>>();
        +
        146 gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        147
        +
        148 static_assert(
        +
        149 color_spaces_are_compatible<
        +
        150 typename color_space_type<SrcView>::type,
        +
        151 typename color_space_type<ReferenceView>::type>::value,
        +
        152 "Source and reference view must have same color space");
        +
        153
        +
        154 static_assert(
        +
        155 color_spaces_are_compatible<
        +
        156 typename color_space_type<SrcView>::type,
        +
        157 typename color_space_type<DstView>::type>::value,
        +
        158 "Source and destination view must have same color space");
        +
        159
        +
        160 // Defining channel type
        +
        161 using source_channel_t = typename channel_type<SrcView>::type;
        +
        162 using ref_channel_t = typename channel_type<ReferenceView>::type;
        +
        163 using dst_channel_t = typename channel_type<DstView>::type;
        +
        164 using coord_t = typename SrcView::x_coord_t;
        +
        165
        +
        166 std::size_t const channels = num_channels<SrcView>::value;
        +
        167 coord_t const width = src_view.width();
        +
        168 coord_t const height = src_view.height();
        +
        169 source_channel_t src_pixel_min = (std::numeric_limits<source_channel_t>::min)();
        +
        170 source_channel_t src_pixel_max = (std::numeric_limits<source_channel_t>::max)();
        +
        171 ref_channel_t ref_pixel_min = (std::numeric_limits<ref_channel_t>::min)();
        +
        172 ref_channel_t ref_pixel_max = (std::numeric_limits<ref_channel_t>::max)();
        +
        173
        +
        174 for (std::size_t i = 0; i < channels; i++)
        +
        175 {
        +
        176 histogram<source_channel_t> src_histogram;
        +
        177 histogram<ref_channel_t> ref_histogram;
        +
        178 fill_histogram(
        +
        179 nth_channel_view(src_view, i), src_histogram, bin_width, false, false, mask, src_mask,
        +
        180 std::tuple<source_channel_t>(src_pixel_min),
        +
        181 std::tuple<source_channel_t>(src_pixel_max), true);
        +
        182 fill_histogram(
        +
        183 nth_channel_view(ref_view, i), ref_histogram, bin_width, false, false, mask, ref_mask,
        +
        184 std::tuple<ref_channel_t>(ref_pixel_min), std::tuple<ref_channel_t>(ref_pixel_max),
        +
        185 true);
        +
        186 auto inverse_mapping = histogram_matching(src_histogram, ref_histogram);
        +
        187 for (std::ptrdiff_t src_y = 0; src_y < height; ++src_y)
        +
        188 {
        +
        189 auto src_it = nth_channel_view(src_view, i).row_begin(src_y);
        +
        190 auto dst_it = nth_channel_view(dst_view, i).row_begin(src_y);
        +
        191 for (std::ptrdiff_t src_x = 0; src_x < width; ++src_x)
        +
        192 {
        +
        193 if (mask && !src_mask[src_y][src_x])
        +
        194 dst_it[src_x][0] = src_it[src_x][0];
        +
        195 else
        +
        196 dst_it[src_x][0] =
        +
        197 static_cast<dst_channel_t>(inverse_mapping[src_it[src_x][0]]);
        +
        198 }
        +
        199 }
        +
        200 }
        +
        201}
        +
        202
        +
        203}} //namespace boost::gil
        +
        204
        +
        205#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/image_8hpp_source.html b/html/reference/image_8hpp_source.html index fd13d641d..ff03263e1 100644 --- a/html/reference/image_8hpp_source.html +++ b/html/reference/image_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image.hpp Source File @@ -27,623 +27,632 @@

        - + +/* @license-end */ + +
        -
        -
        image.hpp
        +
        image.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_IMAGE_HPP
        -
        10 #define BOOST_GIL_IMAGE_HPP
        -
        11 
        -
        12 #include <boost/gil/algorithm.hpp>
        -
        13 #include <boost/gil/image_view.hpp>
        -
        14 #include <boost/gil/metafunctions.hpp>
        -
        15 #include <boost/gil/detail/mp11.hpp>
        -
        16 
        -
        17 #include <boost/assert.hpp>
        -
        18 #include <boost/core/exchange.hpp>
        -
        19 
        -
        20 #include <cstddef>
        -
        21 #include <memory>
        -
        22 #include <utility>
        -
        23 #include <type_traits>
        -
        24 
        -
        25 namespace boost { namespace gil {
        -
        26 
        -
        40 
        -
        41 template< typename Pixel, bool IsPlanar, typename Alloc>
        -
        42 class image
        -
        43 {
        -
        44 public:
        -
        45 #if defined(BOOST_NO_CXX11_ALLOCATOR)
        -
        46  using allocator_type = typename Alloc::template rebind<unsigned char>::other;
        -
        47 #else
        -
        48  using allocator_type = typename std::allocator_traits<Alloc>::template rebind_alloc<unsigned char>;
        -
        49 #endif
        -
        50  using view_t = typename view_type_from_pixel<Pixel, IsPlanar>::type;
        -
        51  using const_view_t = typename view_t::const_t;
        -
        52  using point_t = typename view_t::point_t;
        -
        53  using coord_t = typename view_t::coord_t;
        -
        54  using value_type = typename view_t::value_type;
        -
        55  using x_coord_t = coord_t;
        -
        56  using y_coord_t = coord_t;
        -
        57 
        -
        58  point_t const& dimensions() const { return _view.dimensions(); }
        -
        59  x_coord_t width() const { return _view.width(); }
        -
        60  y_coord_t height() const { return _view.height(); }
        -
        61 
        -
        62  explicit image(std::size_t alignment=0,
        -
        63  const Alloc alloc_in = Alloc()) :
        -
        64  _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {}
        -
        65 
        -
        66  // Create with dimensions and optional initial value and alignment
        -
        67  image(point_t const& dimensions,
        -
        68  std::size_t alignment=0,
        -
        69  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        -
        70  , _allocated_bytes( 0 )
        -
        71  {
        -
        72  allocate_and_default_construct(dimensions);
        -
        73  }
        -
        74 
        -
        75  image(x_coord_t width, y_coord_t height,
        -
        76  std::size_t alignment=0,
        -
        77  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        -
        78  , _allocated_bytes( 0 )
        -
        79  {
        -
        80  allocate_and_default_construct(point_t(width,height));
        -
        81  }
        -
        82 
        -
        83  image(point_t const& dimensions,
        -
        84  const Pixel& p_in,
        -
        85  std::size_t alignment = 0,
        -
        86  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        -
        87  , _allocated_bytes( 0 )
        -
        88  {
        -
        89  allocate_and_fill(dimensions, p_in);
        -
        90  }
        -
        91 
        -
        92  image(x_coord_t width, y_coord_t height,
        -
        93  const Pixel& p_in,
        -
        94  std::size_t alignment = 0,
        -
        95  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        -
        96  , _allocated_bytes ( 0 )
        -
        97  {
        -
        98  allocate_and_fill(point_t(width,height),p_in);
        -
        99  }
        -
        100 
        -
        101  image(const image& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
        -
        102  , _allocated_bytes( img._allocated_bytes )
        -
        103  {
        -
        104  allocate_and_copy(img.dimensions(),img._view);
        -
        105  }
        -
        106 
        -
        107  template <typename P2, bool IP2, typename Alloc2>
        -
        108  image(const image<P2,IP2,Alloc2>& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
        -
        109  , _allocated_bytes( img._allocated_bytes )
        -
        110  {
        -
        111  allocate_and_copy(img.dimensions(),img._view);
        -
        112  }
        -
        113 
        -
        114  template <typename Loc,
        -
        115  typename std::enable_if<pixels_are_compatible<typename Loc::value_type, Pixel>::value, int>::type = 0>
        -
        116  image(const image_view<Loc>& view,
        -
        117  std::size_t alignment = 0,
        -
        118  const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        -
        119  , _allocated_bytes( 0 )
        -
        120  {
        -
        121  allocate_and_copy(view.dimensions(),view);
        -
        122  }
        -
        123 
        -
        124  // TODO Optimization: use noexcept (requires _view to be nothrow copy constructible)
        -
        125  image(image&& img) :
        -
        126  _view(img._view),
        -
        127  _memory(img._memory),
        -
        128  _align_in_bytes(img._align_in_bytes),
        -
        129  _alloc(std::move(img._alloc)),
        -
        130  _allocated_bytes(img._allocated_bytes)
        -
        131  {
        -
        132  img._view = view_t();
        -
        133  img._memory = nullptr;
        -
        134  img._align_in_bytes = 0;
        -
        135  img._allocated_bytes = 0;
        -
        136  }
        -
        137 
        -
        138  image& operator=(const image& img)
        -
        139  {
        -
        140  if (dimensions() == img.dimensions())
        -
        141  copy_pixels(img._view,_view);
        -
        142  else
        -
        143  {
        -
        144  image tmp(img);
        -
        145  swap(tmp);
        -
        146  }
        -
        147  return *this;
        -
        148  }
        -
        149 
        -
        150  template <typename Img>
        -
        151  image& operator=(const Img& img)
        -
        152  {
        -
        153  if (dimensions() == img.dimensions())
        -
        154  copy_pixels(img._view,_view);
        -
        155  else
        -
        156  {
        -
        157  image tmp(img);
        -
        158  swap(tmp);
        -
        159  }
        -
        160  return *this;
        -
        161  }
        -
        162 
        -
        163  private:
        -
        164  using propagate_allocators = std::true_type;
        -
        165  using no_propagate_allocators = std::false_type;
        -
        166 
        -
        167  template <class Alloc2>
        -
        168  using choose_pocma = typename std::conditional<
        -
        169  // TODO: Use std::allocator_traits<Allocator>::is_always_equal if available
        -
        170  std::is_empty<Alloc2>::value,
        -
        171  std::true_type,
        -
        172  typename std::allocator_traits<Alloc2>::propagate_on_container_move_assignment::type
        -
        173  >::type;
        -
        174 
        -
        175  static void exchange_memory(image& lhs, image& rhs)
        -
        176  {
        -
        177  lhs._memory = boost::exchange(rhs._memory, nullptr);
        -
        178  lhs._align_in_bytes = boost::exchange(rhs._align_in_bytes, 0);
        -
        179  lhs._allocated_bytes = boost::exchange(rhs._allocated_bytes, 0);
        -
        180  lhs._view = boost::exchange(rhs._view, image::view_t{});
        -
        181  };
        -
        182 
        -
        183  void move_assign(image& img, propagate_allocators) noexcept {
        -
        184  // non-sticky allocator, can adopt the memory, fast
        -
        185  destruct_pixels(_view);
        -
        186  this->deallocate();
        -
        187  this->_alloc = img._alloc;
        -
        188  exchange_memory(*this, img);
        -
        189  }
        -
        190 
        -
        191  void move_assign(image& img, no_propagate_allocators) {
        -
        192  if (_alloc == img._alloc) {
        -
        193  // allocator stuck to the rhs, but it's equivalent of ours, we can still adopt the memory
        -
        194  destruct_pixels(_view);
        -
        195  this->deallocate();
        -
        196  exchange_memory(*this, img);
        -
        197  } else {
        -
        198  // cannot propagate the allocator and cannot adopt the memory
        -
        199  if (img._memory)
        -
        200  {
        -
        201  allocate_and_copy(img.dimensions(), img._view);
        -
        202  destruct_pixels(img._view);
        -
        203  img.deallocate();
        -
        204  img._view = image::view_t{};
        -
        205  }
        -
        206  else
        -
        207  {
        -
        208  destruct_pixels(this->_view);
        -
        209  this->deallocate();
        -
        210  this->_view = view_t{};
        -
        211  }
        -
        212  }
        -
        213  }
        -
        214 
        -
        215  public:
        -
        216  // TODO: Use noexcept(noexcept(move_assign(img, choose_pocma<allocator_type>{})))
        -
        217  // But https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869 prevents it (fixed in GCC > 9)
        -
        218  image& operator=(image&& img) {
        -
        219  if (this != std::addressof(img))
        -
        220  // Use rebinded alloc to choose pocma
        -
        221  move_assign(img, choose_pocma<allocator_type>{});
        -
        222 
        -
        223  return *this;
        -
        224  }
        -
        225 
        -
        226  ~image()
        -
        227  {
        -
        228  destruct_pixels(_view);
        -
        229  deallocate();
        -
        230  }
        -
        231 
        -
        232  Alloc& allocator() { return _alloc; }
        -
        233  Alloc const& allocator() const { return _alloc; }
        -
        234 
        -
        235  void swap(image& img) // required by MutableContainerConcept
        -
        236  {
        -
        237  using std::swap;
        -
        238  swap(_align_in_bytes, img._align_in_bytes);
        -
        239  swap(_memory, img._memory);
        -
        240  swap(_view, img._view);
        -
        241 #ifdef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
        -
        242  swap(_alloc, img._alloc);
        -
        243 #else
        -
        244  if constexpr (std::allocator_traits<Alloc>::propagate_on_container_swap::value)
        -
        245  swap(_alloc, img._alloc);
        -
        246  else
        -
        247  BOOST_ASSERT(_alloc == img._alloc);
        -
        248 #endif
        -
        249  swap(_allocated_bytes, img._allocated_bytes );
        -
        250  }
        -
        251 
        -
        253  // recreate
        -
        255 
        -
        256  // without Allocator
        -
        257  void recreate(point_t const& dims, std::size_t alignment = 0)
        -
        258  {
        -
        259  if (dims == _view.dimensions() && _align_in_bytes == alignment)
        -
        260  return;
        -
        261 
        -
        262  _align_in_bytes = alignment;
        -
        263 
        -
        264  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        -
        265  {
        -
        266  destruct_pixels(_view);
        -
        267  create_view(dims, std::integral_constant<bool, IsPlanar>());
        - -
        269  }
        -
        270  else
        -
        271  {
        -
        272  image tmp(dims, alignment);
        -
        273  swap(tmp);
        -
        274  }
        -
        275  }
        -
        276 
        -
        277  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment = 0)
        -
        278  {
        -
        279  recreate(point_t(width, height), alignment);
        -
        280  }
        -
        281 
        -
        282  void recreate(point_t const& dims, const Pixel& p_in, std::size_t alignment = 0)
        -
        283  {
        -
        284  if (dims == _view.dimensions() && _align_in_bytes == alignment)
        -
        285  return;
        -
        286 
        -
        287  _align_in_bytes = alignment;
        -
        288 
        -
        289  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        -
        290  {
        -
        291  destruct_pixels(_view);
        -
        292  create_view(dims, typename std::integral_constant<bool, IsPlanar>());
        -
        293  uninitialized_fill_pixels(_view, p_in);
        -
        294  }
        -
        295  else
        -
        296  {
        -
        297  image tmp(dims, p_in, alignment);
        -
        298  swap(tmp);
        -
        299  }
        -
        300  }
        -
        301 
        -
        302  void recreate( x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment = 0 )
        -
        303  {
        -
        304  recreate( point_t( width, height ), p_in, alignment );
        -
        305  }
        -
        306 
        -
        307  // with Allocator
        -
        308  void recreate(point_t const& dims, std::size_t alignment, const Alloc alloc_in)
        -
        309  {
        -
        310  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
        -
        311  return;
        -
        312 
        -
        313  _align_in_bytes = alignment;
        -
        314 
        -
        315  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        -
        316  {
        -
        317  destruct_pixels(_view);
        -
        318  create_view(dims, std::integral_constant<bool, IsPlanar>());
        - -
        320  }
        -
        321  else
        -
        322  {
        -
        323  image tmp(dims, alignment, alloc_in);
        -
        324  swap(tmp);
        -
        325  }
        -
        326  }
        -
        327 
        -
        328  void recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in)
        -
        329  {
        -
        330  recreate(point_t(width, height), alignment, alloc_in);
        -
        331  }
        -
        332 
        -
        333  void recreate(point_t const& dims, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in)
        -
        334  {
        -
        335  if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
        -
        336  return;
        -
        337 
        -
        338  _align_in_bytes = alignment;
        -
        339 
        -
        340  if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        -
        341  {
        -
        342  destruct_pixels(_view);
        -
        343  create_view(dims, std::integral_constant<bool, IsPlanar>());
        -
        344  uninitialized_fill_pixels(_view, p_in);
        -
        345  }
        -
        346  else
        -
        347  {
        -
        348  image tmp(dims, p_in, alignment, alloc_in);
        -
        349  swap(tmp);
        -
        350  }
        -
        351  }
        -
        352 
        -
        353  void recreate(x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in )
        -
        354  {
        -
        355  recreate(point_t(width, height), p_in, alignment, alloc_in);
        -
        356  }
        -
        357 
        -
        358  view_t _view; // contains pointer to the pixels, the image size and ways to navigate pixels
        -
        359 
        -
        360  // for construction from other type
        -
        361  template <typename P2, bool IP2, typename Alloc2> friend class image;
        -
        362 private:
        -
        363  unsigned char* _memory;
        -
        364  std::size_t _align_in_bytes;
        -
        365  allocator_type _alloc;
        -
        366 
        -
        367  std::size_t _allocated_bytes;
        -
        368 
        -
        369  void allocate_and_default_construct(point_t const& dimensions)
        -
        370  {
        -
        371  try
        -
        372  {
        -
        373  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        - -
        375  }
        -
        376  catch (...) { deallocate(); throw; }
        -
        377  }
        -
        378 
        -
        379  void allocate_and_fill(point_t const& dimensions, Pixel const& p_in)
        -
        380  {
        -
        381  try
        -
        382  {
        -
        383  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        -
        384  uninitialized_fill_pixels(_view, p_in);
        -
        385  }
        -
        386  catch(...) { deallocate(); throw; }
        -
        387  }
        -
        388 
        -
        389  template <typename View>
        -
        390  void allocate_and_copy(point_t const& dimensions, View const& v)
        -
        391  {
        -
        392  try
        -
        393  {
        -
        394  allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        -
        395  uninitialized_copy_pixels(v, _view);
        -
        396  }
        -
        397  catch(...) { deallocate(); throw; }
        -
        398  }
        -
        399 
        -
        400  void deallocate()
        -
        401  {
        -
        402  if (_memory && _allocated_bytes > 0)
        -
        403  _alloc.deallocate(_memory, _allocated_bytes);
        -
        404  }
        -
        405 
        -
        406  std::size_t is_planar_impl(
        -
        407  std::size_t const size_in_units,
        -
        408  std::size_t const channels_in_image,
        -
        409  std::true_type) const
        -
        410  {
        -
        411  return size_in_units * channels_in_image;
        -
        412  }
        -
        413 
        -
        414  std::size_t is_planar_impl(
        -
        415  std::size_t const size_in_units,
        -
        416  std::size_t const,
        -
        417  std::false_type) const
        -
        418  {
        -
        419  return size_in_units;
        -
        420  }
        -
        421 
        -
        422  std::size_t total_allocated_size_in_bytes(point_t const& dimensions) const
        -
        423  {
        -
        424  using x_iterator = typename view_t::x_iterator;
        -
        425 
        -
        426  // when value_type is a non-pixel, like int or float, num_channels< ... > doesn't work.
        -
        427  constexpr std::size_t _channels_in_image =
        -
        428  std::conditional
        -
        429  <
        -
        430  is_pixel<value_type>::value,
        - -
        432  std::integral_constant<std::size_t, 1>
        -
        433  >::type::value;
        -
        434 
        -
        435  std::size_t size_in_units = is_planar_impl(
        -
        436  get_row_size_in_memunits(dimensions.x) * dimensions.y,
        -
        437  _channels_in_image,
        -
        438  std::integral_constant<bool, IsPlanar>());
        -
        439 
        -
        440  // return the size rounded up to the nearest byte
        -
        441  return ( size_in_units + byte_to_memunit< x_iterator >::value - 1 )
        - -
        443  + ( _align_in_bytes > 0 ? _align_in_bytes - 1 : 0 ); // add extra padding in case we need to align the first image pixel
        -
        444  }
        -
        445 
        -
        446  std::size_t get_row_size_in_memunits(x_coord_t width) const { // number of units per row
        -
        447  std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());
        -
        448  if (_align_in_bytes>0) {
        -
        449  std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit<typename view_t::x_iterator>::value;
        -
        450  return align(size_in_memunits, alignment_in_memunits);
        -
        451  }
        -
        452  return size_in_memunits;
        -
        453  }
        -
        454 
        -
        455  void allocate_(point_t const& dimensions, std::false_type)
        -
        456  {
        -
        457  // if it throws and _memory!=0 the client must deallocate _memory
        -
        458  _allocated_bytes = total_allocated_size_in_bytes(dimensions);
        -
        459  if (_allocated_bytes == 0)
        -
        460  {
        -
        461  return;
        -
        462  }
        -
        463 
        -
        464  _memory=_alloc.allocate( _allocated_bytes );
        -
        465 
        -
        466  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
        -
        467  _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp), get_row_size_in_memunits(dimensions.x)));
        -
        468 
        -
        469  BOOST_ASSERT(_view.width() == dimensions.x);
        -
        470  BOOST_ASSERT(_view.height() == dimensions.y);
        -
        471  }
        -
        472 
        -
        473  void allocate_(point_t const& dimensions, std::true_type)
        -
        474  {
        -
        475  // if it throws and _memory!=0 the client must deallocate _memory
        -
        476  std::size_t row_size=get_row_size_in_memunits(dimensions.x);
        -
        477  std::size_t plane_size=row_size*dimensions.y;
        -
        478 
        -
        479  _allocated_bytes = total_allocated_size_in_bytes( dimensions );
        -
        480  if (_allocated_bytes == 0)
        -
        481  {
        -
        482  return;
        -
        483  }
        -
        484 
        -
        485  _memory = _alloc.allocate( _allocated_bytes );
        -
        486 
        -
        487  unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
        -
        488  typename view_t::x_iterator first;
        -
        489  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
        -
        490  {
        -
        491  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
        -
        492  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
        -
        493  }
        -
        494  _view=view_t(dimensions, typename view_t::locator(first, row_size));
        -
        495 
        -
        496  BOOST_ASSERT(_view.width() == dimensions.x);
        -
        497  BOOST_ASSERT(_view.height() == dimensions.y);
        -
        498  }
        -
        499 
        -
        500  void create_view(point_t const& dims, std::true_type) // is planar
        -
        501  {
        -
        502  std::size_t row_size=get_row_size_in_memunits(dims.x);
        -
        503  std::size_t plane_size=row_size*dims.y;
        -
        504 
        -
        505  unsigned char* tmp = ( _align_in_bytes > 0 ) ? (unsigned char*) align( (std::size_t) _memory
        -
        506  ,_align_in_bytes
        -
        507  )
        -
        508  : _memory;
        -
        509  typename view_t::x_iterator first;
        -
        510 
        -
        511  for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
        -
        512  {
        -
        513  dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
        -
        514  memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
        -
        515  }
        -
        516 
        -
        517  _view = view_t(dims, typename view_t::locator(first, row_size));
        -
        518 
        -
        519  BOOST_ASSERT(_view.width() == dims.x);
        -
        520  BOOST_ASSERT(_view.height() == dims.y);
        -
        521  }
        -
        522 
        -
        523  void create_view(point_t const& dims, std::false_type) // is planar
        -
        524  {
        -
        525  unsigned char* tmp = ( _align_in_bytes > 0 ) ? ( unsigned char* ) align( (std::size_t) _memory
        -
        526  , _align_in_bytes
        -
        527  )
        -
        528  : _memory;
        -
        529 
        -
        530  _view = view_t( dims
        -
        531  , typename view_t::locator( typename view_t::x_iterator( tmp )
        -
        532  , get_row_size_in_memunits( dims.x )
        -
        533  )
        -
        534  );
        -
        535 
        -
        536  BOOST_ASSERT(_view.width() == dims.x);
        -
        537  BOOST_ASSERT(_view.height() == dims.y);
        -
        538  }
        -
        539 };
        -
        540 
        -
        541 template <typename Pixel, bool IsPlanar, typename Alloc>
        - -
        543 {
        -
        544  im1.swap(im2);
        -
        545 }
        -
        546 
        -
        547 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
        -
        548 bool operator==(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2)
        -
        549 {
        -
        550  if ((void*)(&im1)==(void*)(&im2)) return true;
        -
        551  if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false;
        -
        552  return equal_pixels(const_view(im1),const_view(im2));
        -
        553 }
        -
        554 template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
        -
        555 bool operator!=(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2) {return !(im1==im2);}
        -
        556 
        -
        560 
        -
        562 
        -
        564 template <typename Pixel, bool IsPlanar, typename Alloc>
        - -
        566  -> typename image<Pixel,IsPlanar,Alloc>::view_t const&
        -
        567 {
        -
        568  return img._view;
        -
        569 }
        -
        570 
        -
        572 template <typename Pixel, bool IsPlanar, typename Alloc>
        - -
        574  -> typename image<Pixel,IsPlanar,Alloc>::const_view_t const
        -
        575 {
        -
        576  return static_cast<const typename image<Pixel,IsPlanar,Alloc>::const_view_t>(img._view);
        -
        577 }
        -
        579 
        -
        581 // PixelBasedConcept
        -
        583 
        -
        584 template <typename Pixel, bool IsPlanar, typename Alloc>
        -
        585 struct channel_type<image<Pixel, IsPlanar, Alloc>> : channel_type<Pixel> {};
        -
        586 
        -
        587 template <typename Pixel, bool IsPlanar, typename Alloc>
        -
        588 struct color_space_type<image<Pixel, IsPlanar, Alloc>> : color_space_type<Pixel> {};
        -
        589 
        -
        590 template <typename Pixel, bool IsPlanar, typename Alloc>
        -
        591 struct channel_mapping_type<image<Pixel, IsPlanar, Alloc>> : channel_mapping_type<Pixel> {};
        -
        592 
        -
        593 template <typename Pixel, bool IsPlanar, typename Alloc>
        -
        594 struct is_planar<image<Pixel, IsPlanar, Alloc>> : std::integral_constant<bool, IsPlanar> {};
        -
        595 
        -
        596 }} // namespace boost::gil
        -
        597 
        -
        598 #endif
        -
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition: image_view.hpp:54
        -
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:43
        -
        auto const_view(const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
        Returns the constant-pixel view of an image.
        Definition: image.hpp:573
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition: algorithm.hpp:292
        -
        void default_construct_pixels(View const &view)
        Invokes the in-place default constructor on every pixel of the (uninitialized) view....
        Definition: algorithm.hpp:724
        -
        BOOST_FORCEINLINE void destruct_pixels(View const &view)
        Invokes the in-place destructor on every pixel of the view.
        Definition: algorithm.hpp:518
        -
        BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
        std::equal for image views
        Definition: algorithm.hpp:1109
        -
        void uninitialized_copy_pixels(View1 const &view1, View2 const &view2)
        std::uninitialized_copy for image views. Does not support planar heterogeneous views....
        Definition: algorithm.hpp:823
        -
        void uninitialized_fill_pixels(const View &view, const Value &val)
        std::uninitialized_fill for image views. Does not support planar heterogeneous views....
        Definition: algorithm.hpp:587
        -
        void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
        swap for packed_channel_reference
        Definition: channel.hpp:583
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: pixel_iterator.hpp:124
        -
        Definition: color_convert.hpp:31
        -
        Returns the number of channels of a pixel-based GIL construct.
        Definition: pixel.hpp:54
        -
        Returns the type of a view the pixel type, whether it operates on planar data and whether it has a st...
        Definition: metafunctions.hpp:557
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_IMAGE_HPP
        +
        10#define BOOST_GIL_IMAGE_HPP
        +
        11
        +
        12#include <boost/gil/algorithm.hpp>
        +
        13#include <boost/gil/image_view.hpp>
        +
        14#include <boost/gil/metafunctions.hpp>
        +
        15#include <boost/gil/detail/mp11.hpp>
        +
        16
        +
        17#include <boost/assert.hpp>
        +
        18#include <boost/core/exchange.hpp>
        +
        19
        +
        20#include <cstddef>
        +
        21#include <memory>
        +
        22#include <utility>
        +
        23#include <type_traits>
        +
        24
        +
        25namespace boost { namespace gil {
        +
        26
        +
        40
        +
        41template< typename Pixel, bool IsPlanar, typename Alloc>
        +
        +
        42class image
        +
        43{
        +
        44public:
        +
        45#if defined(BOOST_NO_CXX11_ALLOCATOR)
        +
        46 using allocator_type = typename Alloc::template rebind<unsigned char>::other;
        +
        47#else
        +
        48 using allocator_type = typename std::allocator_traits<Alloc>::template rebind_alloc<unsigned char>;
        +
        49#endif
        +
        50 using view_t = typename view_type_from_pixel<Pixel, IsPlanar>::type;
        +
        51 using const_view_t = typename view_t::const_t;
        +
        52 using point_t = typename view_t::point_t;
        +
        53 using coord_t = typename view_t::coord_t;
        +
        54 using value_type = typename view_t::value_type;
        +
        55 using x_coord_t = coord_t;
        +
        56 using y_coord_t = coord_t;
        +
        57
        +
        58 point_t const& dimensions() const { return _view.dimensions(); }
        +
        59 x_coord_t width() const { return _view.width(); }
        +
        60 y_coord_t height() const { return _view.height(); }
        +
        61
        +
        62 explicit image(std::size_t alignment=0,
        +
        63 const Alloc alloc_in = Alloc()) :
        +
        64 _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {}
        +
        65
        +
        66 // Create with dimensions and optional initial value and alignment
        +
        67 image(point_t const& dimensions,
        +
        68 std::size_t alignment=0,
        +
        69 const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        70 , _allocated_bytes( 0 )
        +
        71 {
        +
        72 allocate_and_default_construct(dimensions);
        +
        73 }
        +
        74
        +
        75 image(x_coord_t width, y_coord_t height,
        +
        76 std::size_t alignment=0,
        +
        77 const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        78 , _allocated_bytes( 0 )
        +
        79 {
        +
        80 allocate_and_default_construct(point_t(width,height));
        +
        81 }
        +
        82
        +
        83 image(point_t const& dimensions,
        +
        84 const Pixel& p_in,
        +
        85 std::size_t alignment = 0,
        +
        86 const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        87 , _allocated_bytes( 0 )
        +
        88 {
        +
        89 allocate_and_fill(dimensions, p_in);
        +
        90 }
        +
        91
        +
        92 image(x_coord_t width, y_coord_t height,
        +
        93 const Pixel& p_in,
        +
        94 std::size_t alignment = 0,
        +
        95 const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        96 , _allocated_bytes ( 0 )
        +
        97 {
        +
        98 allocate_and_fill(point_t(width,height),p_in);
        +
        99 }
        +
        100
        +
        101 image(const image& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
        +
        102 , _allocated_bytes( img._allocated_bytes )
        +
        103 {
        +
        104 allocate_and_copy(img.dimensions(),img._view);
        +
        105 }
        +
        106
        +
        107 template <typename P2, bool IP2, typename Alloc2>
        +
        108 image(const image<P2,IP2,Alloc2>& img) : _memory(nullptr), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc)
        +
        109 , _allocated_bytes( img._allocated_bytes )
        +
        110 {
        +
        111 allocate_and_copy(img.dimensions(),img._view);
        +
        112 }
        +
        113
        +
        114 template <typename Loc,
        +
        115 typename std::enable_if<pixels_are_compatible<typename Loc::value_type, Pixel>::value, int>::type = 0>
        + +
        117 std::size_t alignment = 0,
        +
        118 const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
        +
        119 , _allocated_bytes( 0 )
        +
        120 {
        +
        121 allocate_and_copy(view.dimensions(),view);
        +
        122 }
        +
        123
        +
        124 // TODO Optimization: use noexcept (requires _view to be nothrow copy constructible)
        +
        125 image(image&& img) :
        +
        126 _view(img._view),
        +
        127 _memory(img._memory),
        +
        128 _align_in_bytes(img._align_in_bytes),
        +
        129 _alloc(std::move(img._alloc)),
        +
        130 _allocated_bytes(img._allocated_bytes)
        +
        131 {
        +
        132 img._view = view_t();
        +
        133 img._memory = nullptr;
        +
        134 img._align_in_bytes = 0;
        +
        135 img._allocated_bytes = 0;
        +
        136 }
        +
        137
        +
        138 image& operator=(const image& img)
        +
        139 {
        +
        140 if (dimensions() == img.dimensions())
        +
        141 copy_pixels(img._view,_view);
        +
        142 else
        +
        143 {
        +
        144 image tmp(img);
        +
        145 swap(tmp);
        +
        146 }
        +
        147 return *this;
        +
        148 }
        +
        149
        +
        150 template <typename Img>
        +
        151 image& operator=(const Img& img)
        +
        152 {
        +
        153 if (dimensions() == img.dimensions())
        +
        154 copy_pixels(img._view,_view);
        +
        155 else
        +
        156 {
        +
        157 image tmp(img);
        +
        158 swap(tmp);
        +
        159 }
        +
        160 return *this;
        +
        161 }
        +
        162
        +
        163 private:
        +
        164 using propagate_allocators = std::true_type;
        +
        165 using no_propagate_allocators = std::false_type;
        +
        166
        +
        167 template <class Alloc2>
        +
        168 using choose_pocma = typename std::conditional<
        +
        169 // TODO: Use std::allocator_traits<Allocator>::is_always_equal if available
        +
        170 std::is_empty<Alloc2>::value,
        +
        171 std::true_type,
        +
        172 typename std::allocator_traits<Alloc2>::propagate_on_container_move_assignment::type
        +
        173 >::type;
        +
        174
        +
        175 static void exchange_memory(image& lhs, image& rhs)
        +
        176 {
        +
        177 lhs._memory = boost::exchange(rhs._memory, nullptr);
        +
        178 lhs._align_in_bytes = boost::exchange(rhs._align_in_bytes, 0);
        +
        179 lhs._allocated_bytes = boost::exchange(rhs._allocated_bytes, 0);
        +
        180 lhs._view = boost::exchange(rhs._view, image::view_t{});
        +
        181 };
        +
        182
        +
        183 void move_assign(image& img, propagate_allocators) noexcept {
        +
        184 // non-sticky allocator, can adopt the memory, fast
        +
        185 destruct_pixels(_view);
        +
        186 this->deallocate();
        +
        187 this->_alloc = img._alloc;
        +
        188 exchange_memory(*this, img);
        +
        189 }
        +
        190
        +
        191 void move_assign(image& img, no_propagate_allocators) {
        +
        192 if (_alloc == img._alloc) {
        +
        193 // allocator stuck to the rhs, but it's equivalent of ours, we can still adopt the memory
        +
        194 destruct_pixels(_view);
        +
        195 this->deallocate();
        +
        196 exchange_memory(*this, img);
        +
        197 } else {
        +
        198 // cannot propagate the allocator and cannot adopt the memory
        +
        199 if (img._memory)
        +
        200 {
        +
        201 allocate_and_copy(img.dimensions(), img._view);
        +
        202 destruct_pixels(img._view);
        +
        203 img.deallocate();
        +
        204 img._view = image::view_t{};
        +
        205 }
        +
        206 else
        +
        207 {
        +
        208 destruct_pixels(this->_view);
        +
        209 this->deallocate();
        +
        210 this->_view = view_t{};
        +
        211 }
        +
        212 }
        +
        213 }
        +
        214
        +
        215 public:
        +
        216 // TODO: Use noexcept(noexcept(move_assign(img, choose_pocma<allocator_type>{})))
        +
        217 // But https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869 prevents it (fixed in GCC > 9)
        +
        218 image& operator=(image&& img) {
        +
        219 if (this != std::addressof(img))
        +
        220 // Use rebinded alloc to choose pocma
        +
        221 move_assign(img, choose_pocma<allocator_type>{});
        +
        222
        +
        223 return *this;
        +
        224 }
        +
        225
        +
        226 ~image()
        +
        227 {
        +
        228 destruct_pixels(_view);
        +
        229 deallocate();
        +
        230 }
        +
        231
        +
        232 Alloc& allocator() { return _alloc; }
        +
        233 Alloc const& allocator() const { return _alloc; }
        +
        234
        +
        235 void swap(image& img) // required by MutableContainerConcept
        +
        236 {
        +
        237 using std::swap;
        +
        238 swap(_align_in_bytes, img._align_in_bytes);
        +
        239 swap(_memory, img._memory);
        +
        240 swap(_view, img._view);
        +
        241#ifdef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
        +
        242 swap(_alloc, img._alloc);
        +
        243#else
        +
        244 if constexpr (std::allocator_traits<Alloc>::propagate_on_container_swap::value)
        +
        245 swap(_alloc, img._alloc);
        +
        246 else
        +
        247 BOOST_ASSERT(_alloc == img._alloc);
        +
        248#endif
        +
        249 swap(_allocated_bytes, img._allocated_bytes );
        +
        250 }
        +
        251
        +
        253 // recreate
        +
        255
        +
        256 // without Allocator
        +
        257 void recreate(point_t const& dims, std::size_t alignment = 0)
        +
        258 {
        +
        259 if (dims == _view.dimensions() && _align_in_bytes == alignment)
        +
        260 return;
        +
        261
        +
        262 _align_in_bytes = alignment;
        +
        263
        +
        264 if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        +
        265 {
        +
        266 destruct_pixels(_view);
        +
        267 create_view(dims, std::integral_constant<bool, IsPlanar>());
        + +
        269 }
        +
        270 else
        +
        271 {
        +
        272 image tmp(dims, alignment);
        +
        273 swap(tmp);
        +
        274 }
        +
        275 }
        +
        276
        +
        277 void recreate(x_coord_t width, y_coord_t height, std::size_t alignment = 0)
        +
        278 {
        +
        279 recreate(point_t(width, height), alignment);
        +
        280 }
        +
        281
        +
        282 void recreate(point_t const& dims, const Pixel& p_in, std::size_t alignment = 0)
        +
        283 {
        +
        284 if (dims == _view.dimensions() && _align_in_bytes == alignment)
        +
        285 return;
        +
        286
        +
        287 _align_in_bytes = alignment;
        +
        288
        +
        289 if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        +
        290 {
        +
        291 destruct_pixels(_view);
        +
        292 create_view(dims, typename std::integral_constant<bool, IsPlanar>());
        +
        293 uninitialized_fill_pixels(_view, p_in);
        +
        294 }
        +
        295 else
        +
        296 {
        +
        297 image tmp(dims, p_in, alignment);
        +
        298 swap(tmp);
        +
        299 }
        +
        300 }
        +
        301
        +
        302 void recreate( x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment = 0 )
        +
        303 {
        +
        304 recreate( point_t( width, height ), p_in, alignment );
        +
        305 }
        +
        306
        +
        307 // with Allocator
        +
        308 void recreate(point_t const& dims, std::size_t alignment, const Alloc alloc_in)
        +
        309 {
        +
        310 if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
        +
        311 return;
        +
        312
        +
        313 _align_in_bytes = alignment;
        +
        314
        +
        315 if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        +
        316 {
        +
        317 destruct_pixels(_view);
        +
        318 create_view(dims, std::integral_constant<bool, IsPlanar>());
        + +
        320 }
        +
        321 else
        +
        322 {
        +
        323 image tmp(dims, alignment, alloc_in);
        +
        324 swap(tmp);
        +
        325 }
        +
        326 }
        +
        327
        +
        328 void recreate(x_coord_t width, y_coord_t height, std::size_t alignment, const Alloc alloc_in)
        +
        329 {
        +
        330 recreate(point_t(width, height), alignment, alloc_in);
        +
        331 }
        +
        332
        +
        333 void recreate(point_t const& dims, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in)
        +
        334 {
        +
        335 if (dims == _view.dimensions() && _align_in_bytes == alignment && alloc_in == _alloc)
        +
        336 return;
        +
        337
        +
        338 _align_in_bytes = alignment;
        +
        339
        +
        340 if (_allocated_bytes >= total_allocated_size_in_bytes(dims))
        +
        341 {
        +
        342 destruct_pixels(_view);
        +
        343 create_view(dims, std::integral_constant<bool, IsPlanar>());
        +
        344 uninitialized_fill_pixels(_view, p_in);
        +
        345 }
        +
        346 else
        +
        347 {
        +
        348 image tmp(dims, p_in, alignment, alloc_in);
        +
        349 swap(tmp);
        +
        350 }
        +
        351 }
        +
        352
        +
        353 void recreate(x_coord_t width, y_coord_t height, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in )
        +
        354 {
        +
        355 recreate(point_t(width, height), p_in, alignment, alloc_in);
        +
        356 }
        +
        357
        +
        358 view_t _view; // contains pointer to the pixels, the image size and ways to navigate pixels
        +
        359
        +
        360 // for construction from other type
        +
        361 template <typename P2, bool IP2, typename Alloc2> friend class image;
        +
        362private:
        +
        363 unsigned char* _memory;
        +
        364 std::size_t _align_in_bytes;
        +
        365 allocator_type _alloc;
        +
        366
        +
        367 std::size_t _allocated_bytes;
        +
        368
        +
        369 void allocate_and_default_construct(point_t const& dimensions)
        +
        370 {
        +
        371 try
        +
        372 {
        +
        373 allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        + +
        375 }
        +
        376 catch (...) { deallocate(); throw; }
        +
        377 }
        +
        378
        +
        379 void allocate_and_fill(point_t const& dimensions, Pixel const& p_in)
        +
        380 {
        +
        381 try
        +
        382 {
        +
        383 allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        +
        384 uninitialized_fill_pixels(_view, p_in);
        +
        385 }
        +
        386 catch(...) { deallocate(); throw; }
        +
        387 }
        +
        388
        +
        389 template <typename View>
        +
        390 void allocate_and_copy(point_t const& dimensions, View const& v)
        +
        391 {
        +
        392 try
        +
        393 {
        +
        394 allocate_(dimensions, std::integral_constant<bool, IsPlanar>());
        + +
        396 }
        +
        397 catch(...) { deallocate(); throw; }
        +
        398 }
        +
        399
        +
        400 void deallocate()
        +
        401 {
        +
        402 if (_memory && _allocated_bytes > 0)
        +
        403 _alloc.deallocate(_memory, _allocated_bytes);
        +
        404 }
        +
        405
        +
        406 std::size_t is_planar_impl(
        +
        407 std::size_t const size_in_units,
        +
        408 std::size_t const channels_in_image,
        +
        409 std::true_type) const
        +
        410 {
        +
        411 return size_in_units * channels_in_image;
        +
        412 }
        +
        413
        +
        414 std::size_t is_planar_impl(
        +
        415 std::size_t const size_in_units,
        +
        416 std::size_t const,
        +
        417 std::false_type) const
        +
        418 {
        +
        419 return size_in_units;
        +
        420 }
        +
        421
        +
        422 std::size_t total_allocated_size_in_bytes(point_t const& dimensions) const
        +
        423 {
        +
        424 using x_iterator = typename view_t::x_iterator;
        +
        425
        +
        426 // when value_type is a non-pixel, like int or float, num_channels< ... > doesn't work.
        +
        427 constexpr std::size_t _channels_in_image =
        +
        428 std::conditional
        +
        429 <
        +
        430 is_pixel<value_type>::value,
        + +
        432 std::integral_constant<std::size_t, 1>
        +
        433 >::type::value;
        +
        434
        +
        435 std::size_t size_in_units = is_planar_impl(
        +
        436 get_row_size_in_memunits(dimensions.x) * dimensions.y,
        +
        437 _channels_in_image,
        +
        438 std::integral_constant<bool, IsPlanar>());
        +
        439
        +
        440 // return the size rounded up to the nearest byte
        +
        441 return ( size_in_units + byte_to_memunit< x_iterator >::value - 1 )
        + +
        443 + ( _align_in_bytes > 0 ? _align_in_bytes - 1 : 0 ); // add extra padding in case we need to align the first image pixel
        +
        444 }
        +
        445
        +
        446 std::size_t get_row_size_in_memunits(x_coord_t width) const { // number of units per row
        +
        447 std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());
        +
        448 if (_align_in_bytes>0) {
        +
        449 std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit<typename view_t::x_iterator>::value;
        +
        450 return align(size_in_memunits, alignment_in_memunits);
        +
        451 }
        +
        452 return size_in_memunits;
        +
        453 }
        +
        454
        +
        455 void allocate_(point_t const& dimensions, std::false_type)
        +
        456 {
        +
        457 // if it throws and _memory!=0 the client must deallocate _memory
        +
        458 _allocated_bytes = total_allocated_size_in_bytes(dimensions);
        +
        459 if (_allocated_bytes == 0)
        +
        460 {
        +
        461 return;
        +
        462 }
        +
        463
        +
        464 _memory=_alloc.allocate( _allocated_bytes );
        +
        465
        +
        466 unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
        +
        467 _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp), get_row_size_in_memunits(dimensions.x)));
        +
        468
        +
        469 BOOST_ASSERT(_view.width() == dimensions.x);
        +
        470 BOOST_ASSERT(_view.height() == dimensions.y);
        +
        471 }
        +
        472
        +
        473 void allocate_(point_t const& dimensions, std::true_type)
        +
        474 {
        +
        475 // if it throws and _memory!=0 the client must deallocate _memory
        +
        476 std::size_t row_size=get_row_size_in_memunits(dimensions.x);
        +
        477 std::size_t plane_size=row_size*dimensions.y;
        +
        478
        +
        479 _allocated_bytes = total_allocated_size_in_bytes( dimensions );
        +
        480 if (_allocated_bytes == 0)
        +
        481 {
        +
        482 return;
        +
        483 }
        +
        484
        +
        485 _memory = _alloc.allocate( _allocated_bytes );
        +
        486
        +
        487 unsigned char* tmp=(_align_in_bytes>0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
        +
        488 typename view_t::x_iterator first;
        +
        489 for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
        +
        490 {
        +
        491 dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
        +
        492 memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
        +
        493 }
        +
        494 _view=view_t(dimensions, typename view_t::locator(first, row_size));
        +
        495
        +
        496 BOOST_ASSERT(_view.width() == dimensions.x);
        +
        497 BOOST_ASSERT(_view.height() == dimensions.y);
        +
        498 }
        +
        499
        +
        500 void create_view(point_t const& dims, std::true_type) // is planar
        +
        501 {
        +
        502 std::size_t row_size=get_row_size_in_memunits(dims.x);
        +
        503 std::size_t plane_size=row_size*dims.y;
        +
        504
        +
        505 unsigned char* tmp = ( _align_in_bytes > 0 ) ? (unsigned char*) align( (std::size_t) _memory
        +
        506 ,_align_in_bytes
        +
        507 )
        +
        508 : _memory;
        +
        509 typename view_t::x_iterator first;
        +
        510
        +
        511 for (std::size_t i = 0; i < num_channels<view_t>::value; ++i)
        +
        512 {
        +
        513 dynamic_at_c(first, i) = (typename channel_type<view_t>::type*)tmp;
        +
        514 memunit_advance(dynamic_at_c(first, i), static_cast<std::ptrdiff_t>(plane_size * i));
        +
        515 }
        +
        516
        +
        517 _view = view_t(dims, typename view_t::locator(first, row_size));
        +
        518
        +
        519 BOOST_ASSERT(_view.width() == dims.x);
        +
        520 BOOST_ASSERT(_view.height() == dims.y);
        +
        521 }
        +
        522
        +
        523 void create_view(point_t const& dims, std::false_type) // is planar
        +
        524 {
        +
        525 unsigned char* tmp = ( _align_in_bytes > 0 ) ? ( unsigned char* ) align( (std::size_t) _memory
        +
        526 , _align_in_bytes
        +
        527 )
        +
        528 : _memory;
        +
        529
        +
        530 _view = view_t( dims
        +
        531 , typename view_t::locator( typename view_t::x_iterator( tmp )
        +
        532 , get_row_size_in_memunits( dims.x )
        +
        533 )
        +
        534 );
        +
        535
        +
        536 BOOST_ASSERT(_view.width() == dims.x);
        +
        537 BOOST_ASSERT(_view.height() == dims.y);
        +
        538 }
        +
        539};
        +
        +
        540
        +
        541template <typename Pixel, bool IsPlanar, typename Alloc>
        + +
        543{
        +
        544 im1.swap(im2);
        +
        545}
        +
        546
        +
        547template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
        +
        548bool operator==(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2)
        +
        549{
        +
        550 if ((void*)(&im1)==(void*)(&im2)) return true;
        +
        551 if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false;
        +
        552 return equal_pixels(const_view(im1),const_view(im2));
        +
        553}
        +
        554template <typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2>
        +
        555bool operator!=(const image<Pixel1,IsPlanar1,Alloc1>& im1,const image<Pixel2,IsPlanar2,Alloc2>& im2) {return !(im1==im2);}
        +
        556
        +
        560
        +
        562
        +
        564template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        + +
        566 -> typename image<Pixel,IsPlanar,Alloc>::view_t const&
        +
        567{
        +
        568 return img._view;
        +
        569}
        +
        +
        570
        +
        572template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        + +
        574 -> typename image<Pixel,IsPlanar,Alloc>::const_view_t const
        +
        575{
        +
        576 return static_cast<const typename image<Pixel,IsPlanar,Alloc>::const_view_t>(img._view);
        +
        577}
        +
        +
        579
        +
        581// PixelBasedConcept
        +
        583
        +
        584template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        585struct channel_type<image<Pixel, IsPlanar, Alloc>> : channel_type<Pixel> {};
        +
        586
        +
        587template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        588struct color_space_type<image<Pixel, IsPlanar, Alloc>> : color_space_type<Pixel> {};
        +
        589
        +
        590template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        591struct channel_mapping_type<image<Pixel, IsPlanar, Alloc>> : channel_mapping_type<Pixel> {};
        +
        592
        +
        593template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        594struct is_planar<image<Pixel, IsPlanar, Alloc>> : std::integral_constant<bool, IsPlanar> {};
        +
        595
        +
        596}} // namespace boost::gil
        +
        597
        +
        598#endif
        +
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition image_view.hpp:54
        +
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition image.hpp:43
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        auto const_view(const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
        Returns the constant-pixel view of an image.
        Definition image.hpp:573
        +
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition algorithm.hpp:292
        +
        void default_construct_pixels(View const &view)
        Invokes the in-place default constructor on every pixel of the (uninitialized) view....
        Definition algorithm.hpp:724
        +
        BOOST_FORCEINLINE void destruct_pixels(View const &view)
        Invokes the in-place destructor on every pixel of the view.
        Definition algorithm.hpp:518
        +
        BOOST_FORCEINLINE bool equal_pixels(const View1 &v1, const View2 &v2)
        std::equal for image views
        Definition algorithm.hpp:1109
        +
        void uninitialized_copy_pixels(View1 const &view1, View2 const &view2)
        std::uninitialized_copy for image views. Does not support planar heterogeneous views....
        Definition algorithm.hpp:823
        +
        void uninitialized_fill_pixels(const View &view, const Value &val)
        std::uninitialized_fill for image views. Does not support planar heterogeneous views....
        Definition algorithm.hpp:587
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition pixel_iterator.hpp:124
        +
        Definition color_convert.hpp:31
        +
        Returns the number of channels of a pixel-based GIL construct.
        Definition pixel.hpp:54
        diff --git a/html/reference/image__view_8hpp_source.html b/html/reference/image__view_8hpp_source.html index 0db08525c..6226e3c76 100644 --- a/html/reference/image__view_8hpp_source.html +++ b/html/reference/image__view_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_view.hpp Source File @@ -27,416 +27,430 @@

        - + +/* @license-end */ + +
        -
        -
        image_view.hpp
        +
        image_view.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IMAGE_VIEW_HPP
        -
        9 #define BOOST_GIL_IMAGE_VIEW_HPP
        -
        10 
        -
        11 #include <boost/gil/dynamic_step.hpp>
        -
        12 #include <boost/gil/iterator_from_2d.hpp>
        -
        13 
        -
        14 #include <boost/assert.hpp>
        -
        15 
        -
        16 #include <cstddef>
        -
        17 #include <iterator>
        -
        18 
        -
        19 namespace boost { namespace gil {
        -
        20 
        -
        52 template <typename Loc> // Models 2D Pixel Locator
        - -
        54 {
        -
        55 public:
        -
        56  // aliases required by ConstRandomAccessNDImageViewConcept
        -
        57  static const std::size_t num_dimensions=2;
        -
        58  using value_type = typename Loc::value_type;
        -
        59  using reference = typename Loc::reference; // result of dereferencing
        -
        60  using coord_t = typename Loc::coord_t; // 1D difference type (same for all dimensions)
        -
        61  using difference_type = coord_t; // result of operator-(1d_iterator,1d_iterator)
        -
        62  using point_t = typename Loc::point_t;
        -
        63  using locator = Loc;
        -
        64  using const_t = image_view<typename Loc::const_t>; // same as this type, but over const values
        -
        65  template <std::size_t D> struct axis
        -
        66  {
        -
        67  using coord_t = typename Loc::template axis<D>::coord_t; // difference_type along each dimension
        -
        68  using iterator = typename Loc::template axis<D>::iterator; // 1D iterator type along each dimension
        -
        69  };
        -
        70  using iterator = iterator_from_2d<Loc>; // 1D iterator type for each pixel left-to-right inside top-to-bottom
        -
        71  using const_iterator = typename const_t::iterator; // may be used to examine, but not to modify values
        -
        72  using const_reference = typename const_t::reference; // behaves as a const reference
        -
        73  using pointer = typename std::iterator_traits<iterator>::pointer; // behaves as a pointer to the value type
        -
        74  using reverse_iterator = std::reverse_iterator<iterator>;
        -
        75  using size_type = std::size_t;
        -
        76 
        -
        77  // aliases required by ConstRandomAccess2DImageViewConcept
        -
        78  using xy_locator = locator;
        -
        79  using x_iterator = typename xy_locator::x_iterator; // pixel iterator along a row
        -
        80  using y_iterator = typename xy_locator::y_iterator; // pixel iterator along a column
        -
        81  using x_coord_t = typename xy_locator::x_coord_t;
        -
        82  using y_coord_t = typename xy_locator::y_coord_t;
        -
        83 
        -
        84  template <typename Deref>
        -
        85  struct add_deref
        -
        86  {
        - -
        88  static type make(image_view<Loc> const& view, Deref const& d)
        -
        89  {
        -
        90  return type(view.dimensions(), Loc::template add_deref<Deref>::make(view.pixels(), d));
        -
        91  }
        -
        92  };
        -
        93 
        -
        94  image_view() : _dimensions(0,0) {}
        -
        95  image_view(image_view const& img_view)
        -
        96  : _dimensions(img_view.dimensions()), _pixels(img_view.pixels())
        -
        97  {}
        -
        98 
        -
        99  template <typename View>
        -
        100  image_view(View const& view) : _dimensions(view.dimensions()), _pixels(view.pixels()) {}
        -
        101 
        -
        102  template <typename L2>
        -
        103  image_view(point_t const& dims, L2 const& loc) : _dimensions(dims), _pixels(loc) {}
        -
        104 
        -
        105  template <typename L2>
        -
        106  image_view(coord_t width, coord_t height, L2 const& loc)
        -
        107  : _dimensions(x_coord_t(width), y_coord_t(height)), _pixels(loc)
        -
        108  {}
        -
        109 
        -
        110  template <typename View>
        -
        111  image_view& operator=(View const& view)
        -
        112  {
        -
        113  _pixels = view.pixels();
        -
        114  _dimensions = view.dimensions();
        -
        115  return *this;
        -
        116  }
        -
        117 
        -
        118  image_view& operator=(image_view const& view)
        -
        119  {
        -
        120  // TODO: Self-assignment protection?
        -
        121  _pixels = view.pixels();
        -
        122  _dimensions = view.dimensions();
        -
        123  return *this;
        -
        124  }
        -
        125 
        -
        126  template <typename View>
        -
        127  bool operator==(View const &view) const
        -
        128  {
        -
        129  return pixels() == view.pixels() && dimensions() == view.dimensions();
        -
        130  }
        -
        131 
        -
        132  template <typename View>
        -
        133  bool operator!=(View const& view) const
        -
        134  {
        -
        135  return !(*this == view);
        -
        136  }
        -
        137 
        -
        138  template <typename L2>
        -
        139  friend void swap(image_view<L2> &lhs, image_view<L2> &rhs);
        -
        140 
        -
        146  void swap(image_view<Loc>& other)
        -
        147  {
        -
        148  using boost::gil::swap;
        -
        149  swap(*this, other);
        -
        150  }
        -
        151 
        -
        152  auto dimensions() const -> point_t const&
        -
        153  {
        -
        154  return _dimensions;
        -
        155  }
        -
        156 
        -
        157  auto pixels() const -> locator const&
        -
        158  {
        -
        159  return _pixels;
        -
        160  }
        -
        161 
        -
        162  auto width() const -> x_coord_t
        -
        163  {
        -
        164  return dimensions().x;
        -
        165  }
        -
        166 
        -
        167  auto height() const -> y_coord_t
        -
        168  {
        -
        169  return dimensions().y;
        -
        170  }
        -
        171 
        -
        172  auto num_channels() const -> std::size_t
        -
        173  {
        -
        174  return gil::num_channels<value_type>::value;
        -
        175  }
        -
        176 
        -
        177  bool is_1d_traversable() const
        -
        178  {
        -
        179  return _pixels.is_1d_traversable(width());
        -
        180  }
        -
        181 
        -
        186  bool empty() const
        -
        187  {
        -
        188  return !(width() > 0 && height() > 0);
        -
        189  }
        -
        190 
        -
        195  auto front() const -> reference
        -
        196  {
        -
        197  BOOST_ASSERT(!empty());
        -
        198  return *begin();
        -
        199  }
        -
        200 
        -
        205  auto back() const -> reference
        -
        206  {
        -
        207  BOOST_ASSERT(!empty());
        -
        208  return *rbegin();
        -
        209  }
        -
        210 
        -
        211  //\{@
        -
        213  auto size() const -> size_type
        -
        214  {
        -
        215  return width() * height();
        -
        216  }
        -
        217 
        -
        218  auto begin() const -> iterator
        -
        219  {
        -
        220  return iterator(_pixels, _dimensions.x);
        -
        221  }
        -
        222 
        -
        223  auto end() const -> iterator
        -
        224  {
        -
        225  // potential performance problem!
        -
        226  return begin() + static_cast<difference_type>(size());
        -
        227  }
        -
        228 
        -
        229  auto rbegin() const -> reverse_iterator
        -
        230  {
        -
        231  return reverse_iterator(end());
        -
        232  }
        -
        233 
        -
        234  auto rend() const -> reverse_iterator
        -
        235  {
        -
        236  return reverse_iterator(begin());
        -
        237  }
        -
        238 
        -
        239  auto operator[](difference_type i) const -> reference
        -
        240  {
        -
        241  BOOST_ASSERT(i < static_cast<difference_type>(size()));
        -
        242  return begin()[i]; // potential performance problem!
        -
        243  }
        -
        244 
        -
        245  auto at(difference_type i) const -> iterator
        -
        246  {
        -
        247  // UB if the specified increment advances non-incrementable iterator (i.e. past-the-end)
        -
        248  BOOST_ASSERT(i < static_cast<difference_type>(size()));
        -
        249  return begin() + i;
        -
        250  }
        -
        251 
        -
        252  auto at(point_t const& p) const -> iterator
        -
        253  {
        -
        254  // UB if the specified coordinates advance non-incrementable iterator (i.e. past-the-end)
        -
        255  BOOST_ASSERT(0 <= p.x && p.x < width());
        -
        256  BOOST_ASSERT(0 <= p.y && p.y < height());
        -
        257  return begin() + p.y * width() + p.x;
        -
        258  }
        -
        259 
        -
        260  auto at(x_coord_t x, y_coord_t y) const -> iterator
        -
        261  {
        -
        262  // UB if the specified coordinates advance non-incrementable iterator (i.e. past-the-end)
        -
        263  BOOST_ASSERT(0 <= x && x < width());
        -
        264  BOOST_ASSERT(0 <= y && y < height());
        -
        265  return begin() + y * width() + x;
        -
        266  }
        -
        267  //\}@
        -
        268 
        -
        269  //\{@
        -
        271  auto operator()(point_t const& p) const -> reference
        -
        272  {
        -
        273  BOOST_ASSERT(0 <= p.x && p.x < width());
        -
        274  BOOST_ASSERT(0 <= p.y && p.y < height());
        -
        275  return _pixels(p.x, p.y);
        -
        276  }
        -
        277 
        -
        278  auto operator()(x_coord_t x, y_coord_t y) const -> reference
        -
        279  {
        -
        280  BOOST_ASSERT(0 <= x && x < width());
        -
        281  BOOST_ASSERT(0 <= y && y < height());
        -
        282  return _pixels(x, y);
        -
        283  }
        -
        284 
        -
        285  template <std::size_t D>
        -
        286  auto axis_iterator(point_t const& p) const -> typename axis<D>::iterator
        -
        287  {
        -
        288  // Allow request for iterators from inclusive range of [begin, end]
        -
        289  BOOST_ASSERT(0 <= p.x && p.x <= width());
        -
        290  BOOST_ASSERT(0 <= p.y && p.y <= height());
        -
        291  return _pixels.template axis_iterator<D>(p);
        -
        292  }
        -
        293 
        -
        294  auto xy_at(x_coord_t x, y_coord_t y) const -> xy_locator
        -
        295  {
        -
        296  // TODO: Are relative locations of neighbors with negative offsets valid? Sampling?
        -
        297  BOOST_ASSERT(x < width());
        -
        298  BOOST_ASSERT(y <= height());
        -
        299  return _pixels + point_t(x, y);
        -
        300  }
        -
        301 
        -
        302  auto xy_at(point_t const& p) const -> xy_locator
        -
        303  {
        -
        304  // TODO: Are relative locations of neighbors with negative offsets valid? Sampling?
        -
        305  BOOST_ASSERT(p.x < width());
        -
        306  BOOST_ASSERT(p.y < height());
        -
        307  return _pixels + p;
        -
        308  }
        -
        309  //\}@
        -
        310 
        -
        311  //\{@
        -
        313  auto x_at(x_coord_t x, y_coord_t y) const -> x_iterator
        -
        314  {
        -
        315  BOOST_ASSERT(0 <= x && x <= width()); // allow request for [begin, end] inclusive
        -
        316  BOOST_ASSERT(0 <= y && y < height()); // TODO: For empty image/view, shouldn't we accept: row_begin(0) == view.row_end(0) ?
        -
        317  return _pixels.x_at(x, y);
        -
        318  }
        -
        319 
        -
        320  auto x_at(point_t const& p) const -> x_iterator
        -
        321  {
        -
        322  BOOST_ASSERT(0 <= p.x && p.x <= width()); // allow request for [begin, end] inclusive
        -
        323  BOOST_ASSERT(0 <= p.y && p.y < height()); // TODO: For empty image/view, shouldn't we accept: row_begin(0) == view.row_end(0) ?
        -
        324  return _pixels.x_at(p);
        -
        325  }
        -
        326 
        -
        327  auto row_begin(y_coord_t y) const -> x_iterator
        -
        328  {
        -
        329  BOOST_ASSERT(0 <= y && y < height());
        -
        330  return x_at(0, y);
        -
        331  }
        -
        332 
        -
        333  auto row_end(y_coord_t y) const -> x_iterator
        -
        334  {
        -
        335  BOOST_ASSERT(0 <= y && y < height());
        -
        336  return x_at(width(), y);
        -
        337  }
        -
        338  //\}@
        -
        339 
        -
        340  //\{@
        -
        342  auto y_at(x_coord_t x, y_coord_t y) const -> y_iterator
        -
        343  {
        -
        344  BOOST_ASSERT(0 <= x && x < width()); // TODO: For empty image/view, shouldn't we accept: view.col_begin(0) == view.col_end(0) ?
        -
        345  BOOST_ASSERT(0 <= y && y <= height()); // allow request for [begin, end] inclusive
        -
        346  return xy_at(x, y).y();
        -
        347  }
        -
        348 
        -
        349  auto y_at(point_t const& p) const -> y_iterator
        -
        350  {
        -
        351  BOOST_ASSERT(0 <= p.x && p.x < width()); // TODO: For empty image/view, shouldn't we accept: view.col_begin(0) == view.col_end(0) ?
        -
        352  BOOST_ASSERT(0 <= p.y && p.y <= height()); // allow request for [begin, end] inclusive
        -
        353  return xy_at(p).y();
        -
        354  }
        -
        355 
        -
        356  auto col_begin(x_coord_t x) const -> y_iterator
        -
        357  {
        -
        358  BOOST_ASSERT(0 <= x && x < width());
        -
        359  return y_at(x, 0);
        -
        360  }
        -
        361 
        -
        362  auto col_end(x_coord_t x) const -> y_iterator
        -
        363  {
        -
        364  BOOST_ASSERT(0 <= x && x < width());
        -
        365  return y_at(x, height());
        -
        366  }
        -
        367  //\}@
        -
        368 
        -
        369 private:
        -
        370  template <typename L2>
        -
        371  friend class image_view;
        -
        372 
        -
        373  point_t _dimensions;
        -
        374  xy_locator _pixels;
        -
        375 };
        -
        376 
        -
        377 template <typename L2>
        -
        378 inline void swap(image_view<L2>& x, image_view<L2>& y) {
        -
        379  using std::swap;
        -
        380  swap(x._dimensions,y._dimensions);
        -
        381  swap(x._pixels, y._pixels); // TODO: Extend further
        -
        382 }
        -
        383 
        -
        385 // PixelBasedConcept
        -
        387 
        -
        388 template <typename L>
        -
        389 struct channel_type<image_view<L> > : public channel_type<L> {};
        -
        390 
        -
        391 template <typename L>
        -
        392 struct color_space_type<image_view<L> > : public color_space_type<L> {};
        -
        393 
        -
        394 template <typename L>
        -
        395 struct channel_mapping_type<image_view<L> > : public channel_mapping_type<L> {};
        -
        396 
        -
        397 template <typename L>
        -
        398 struct is_planar<image_view<L> > : public is_planar<L> {};
        -
        399 
        -
        401 // HasDynamicXStepTypeConcept
        -
        403 
        -
        404 template <typename L>
        -
        405 struct dynamic_x_step_type<image_view<L>>
        -
        406 {
        -
        407  using type = image_view<typename gil::dynamic_x_step_type<L>::type>;
        -
        408 };
        -
        409 
        -
        411 // HasDynamicYStepTypeConcept
        -
        413 
        -
        414 template <typename L>
        -
        415 struct dynamic_y_step_type<image_view<L>>
        -
        416 {
        -
        417  using type = image_view<typename gil::dynamic_y_step_type<L>::type>;
        -
        418 };
        -
        419 
        -
        421 // HasTransposedTypeConcept
        -
        423 
        -
        424 template <typename L>
        -
        425 struct transposed_type<image_view<L>>
        -
        426 {
        -
        427  using type = image_view<typename transposed_type<L>::type>;
        -
        428 };
        -
        429 
        -
        430 }} // namespace boost::gil
        -
        431 
        -
        432 #endif
        -
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition: image_view.hpp:54
        -
        auto back() const -> reference
        Returns a reference to the last element in raster order.
        Definition: image_view.hpp:205
        -
        auto front() const -> reference
        Returns a reference to the first element in raster order.
        Definition: image_view.hpp:195
        -
        bool empty() const
        Returns true if the view has no elements, false otherwise.
        Definition: image_view.hpp:186
        -
        void swap(image_view< Loc > &other)
        Exchanges the elements of the current view with those of other in constant time.
        Definition: image_view.hpp:146
        -
        Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
        Definition: iterator_from_2d.hpp:46
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IMAGE_VIEW_HPP
        +
        9#define BOOST_GIL_IMAGE_VIEW_HPP
        +
        10
        +
        11#include <boost/gil/dynamic_step.hpp>
        +
        12#include <boost/gil/iterator_from_2d.hpp>
        +
        13
        +
        14#include <boost/assert.hpp>
        +
        15
        +
        16#include <cstddef>
        +
        17#include <iterator>
        +
        18
        +
        19namespace boost { namespace gil {
        +
        20
        +
        52template <typename Loc> // Models 2D Pixel Locator
        +
        + +
        54{
        +
        55public:
        +
        56 // aliases required by ConstRandomAccessNDImageViewConcept
        +
        57 static const std::size_t num_dimensions=2;
        +
        58 using value_type = typename Loc::value_type;
        +
        59 using reference = typename Loc::reference; // result of dereferencing
        +
        60 using coord_t = typename Loc::coord_t; // 1D difference type (same for all dimensions)
        +
        61 using difference_type = coord_t; // result of operator-(1d_iterator,1d_iterator)
        +
        62 using point_t = typename Loc::point_t;
        +
        63 using locator = Loc;
        +
        64 using const_t = image_view<typename Loc::const_t>; // same as this type, but over const values
        +
        65 template <std::size_t D> struct axis
        +
        66 {
        +
        67 using coord_t = typename Loc::template axis<D>::coord_t; // difference_type along each dimension
        +
        68 using iterator = typename Loc::template axis<D>::iterator; // 1D iterator type along each dimension
        +
        69 };
        +
        70 using iterator = iterator_from_2d<Loc>; // 1D iterator type for each pixel left-to-right inside top-to-bottom
        +
        71 using const_iterator = typename const_t::iterator; // may be used to examine, but not to modify values
        +
        72 using const_reference = typename const_t::reference; // behaves as a const reference
        +
        73 using pointer = typename std::iterator_traits<iterator>::pointer; // behaves as a pointer to the value type
        +
        74 using reverse_iterator = std::reverse_iterator<iterator>;
        +
        75 using size_type = std::size_t;
        +
        76
        +
        77 // aliases required by ConstRandomAccess2DImageViewConcept
        +
        78 using xy_locator = locator;
        +
        79 using x_iterator = typename xy_locator::x_iterator; // pixel iterator along a row
        +
        80 using y_iterator = typename xy_locator::y_iterator; // pixel iterator along a column
        +
        81 using x_coord_t = typename xy_locator::x_coord_t;
        +
        82 using y_coord_t = typename xy_locator::y_coord_t;
        +
        83
        +
        84 template <typename Deref>
        +
        85 struct add_deref
        +
        86 {
        + +
        88 static type make(image_view<Loc> const& view, Deref const& d)
        +
        89 {
        +
        90 return type(view.dimensions(), Loc::template add_deref<Deref>::make(view.pixels(), d));
        +
        91 }
        +
        92 };
        +
        93
        +
        94 image_view() : _dimensions(0,0) {}
        +
        95 image_view(image_view const& img_view)
        +
        96 : _dimensions(img_view.dimensions()), _pixels(img_view.pixels())
        +
        97 {}
        +
        98
        +
        99 template <typename View>
        +
        100 image_view(View const& view) : _dimensions(view.dimensions()), _pixels(view.pixels()) {}
        +
        101
        +
        102 template <typename L2>
        +
        103 image_view(point_t const& dims, L2 const& loc) : _dimensions(dims), _pixels(loc) {}
        +
        104
        +
        105 template <typename L2>
        +
        106 image_view(coord_t width, coord_t height, L2 const& loc)
        +
        107 : _dimensions(x_coord_t(width), y_coord_t(height)), _pixels(loc)
        +
        108 {}
        +
        109
        +
        110 template <typename View>
        +
        111 image_view& operator=(View const& view)
        +
        112 {
        +
        113 _pixels = view.pixels();
        +
        114 _dimensions = view.dimensions();
        +
        115 return *this;
        +
        116 }
        +
        117
        +
        118 image_view& operator=(image_view const& view)
        +
        119 {
        +
        120 // TODO: Self-assignment protection?
        +
        121 _pixels = view.pixels();
        +
        122 _dimensions = view.dimensions();
        +
        123 return *this;
        +
        124 }
        +
        125
        +
        126 template <typename View>
        +
        127 bool operator==(View const &view) const
        +
        128 {
        +
        129 return pixels() == view.pixels() && dimensions() == view.dimensions();
        +
        130 }
        +
        131
        +
        132 template <typename View>
        +
        133 bool operator!=(View const& view) const
        +
        134 {
        +
        135 return !(*this == view);
        +
        136 }
        +
        137
        +
        138 template <typename L2>
        +
        139 friend void swap(image_view<L2> &lhs, image_view<L2> &rhs);
        +
        140
        +
        + +
        147 {
        +
        148 using boost::gil::swap;
        +
        149 swap(*this, other);
        +
        150 }
        +
        +
        151
        +
        152 auto dimensions() const -> point_t const&
        +
        153 {
        +
        154 return _dimensions;
        +
        155 }
        +
        156
        +
        157 auto pixels() const -> locator const&
        +
        158 {
        +
        159 return _pixels;
        +
        160 }
        +
        161
        +
        162 auto width() const -> x_coord_t
        +
        163 {
        +
        164 return dimensions().x;
        +
        165 }
        +
        166
        +
        167 auto height() const -> y_coord_t
        +
        168 {
        +
        169 return dimensions().y;
        +
        170 }
        +
        171
        +
        172 auto num_channels() const -> std::size_t
        +
        173 {
        +
        174 return gil::num_channels<value_type>::value;
        +
        175 }
        +
        176
        +
        177 bool is_1d_traversable() const
        +
        178 {
        +
        179 return _pixels.is_1d_traversable(width());
        +
        180 }
        +
        181
        +
        +
        186 bool empty() const
        +
        187 {
        +
        188 return !(width() > 0 && height() > 0);
        +
        189 }
        +
        +
        190
        +
        +
        195 auto front() const -> reference
        +
        196 {
        +
        197 BOOST_ASSERT(!empty());
        +
        198 return *begin();
        +
        199 }
        +
        +
        200
        +
        +
        205 auto back() const -> reference
        +
        206 {
        +
        207 BOOST_ASSERT(!empty());
        +
        208 return *rbegin();
        +
        209 }
        +
        +
        210
        +
        211 //\{@
        +
        213 auto size() const -> size_type
        +
        214 {
        +
        215 return width() * height();
        +
        216 }
        +
        217
        +
        218 auto begin() const -> iterator
        +
        219 {
        +
        220 return iterator(_pixels, _dimensions.x);
        +
        221 }
        +
        222
        +
        223 auto end() const -> iterator
        +
        224 {
        +
        225 // potential performance problem!
        +
        226 return begin() + static_cast<difference_type>(size());
        +
        227 }
        +
        228
        +
        229 auto rbegin() const -> reverse_iterator
        +
        230 {
        +
        231 return reverse_iterator(end());
        +
        232 }
        +
        233
        +
        234 auto rend() const -> reverse_iterator
        +
        235 {
        +
        236 return reverse_iterator(begin());
        +
        237 }
        +
        238
        +
        239 auto operator[](difference_type i) const -> reference
        +
        240 {
        +
        241 BOOST_ASSERT(i < static_cast<difference_type>(size()));
        +
        242 return begin()[i]; // potential performance problem!
        +
        243 }
        +
        244
        +
        245 auto at(difference_type i) const -> iterator
        +
        246 {
        +
        247 // UB if the specified increment advances non-incrementable iterator (i.e. past-the-end)
        +
        248 BOOST_ASSERT(i < static_cast<difference_type>(size()));
        +
        249 return begin() + i;
        +
        250 }
        +
        251
        +
        252 auto at(point_t const& p) const -> iterator
        +
        253 {
        +
        254 // UB if the specified coordinates advance non-incrementable iterator (i.e. past-the-end)
        +
        255 BOOST_ASSERT(0 <= p.x && p.x < width());
        +
        256 BOOST_ASSERT(0 <= p.y && p.y < height());
        +
        257 return begin() + p.y * width() + p.x;
        +
        258 }
        +
        259
        +
        260 auto at(x_coord_t x, y_coord_t y) const -> iterator
        +
        261 {
        +
        262 // UB if the specified coordinates advance non-incrementable iterator (i.e. past-the-end)
        +
        263 BOOST_ASSERT(0 <= x && x < width());
        +
        264 BOOST_ASSERT(0 <= y && y < height());
        +
        265 return begin() + y * width() + x;
        +
        266 }
        +
        267 //\}@
        +
        268
        +
        269 //\{@
        +
        271 auto operator()(point_t const& p) const -> reference
        +
        272 {
        +
        273 BOOST_ASSERT(0 <= p.x && p.x < width());
        +
        274 BOOST_ASSERT(0 <= p.y && p.y < height());
        +
        275 return _pixels(p.x, p.y);
        +
        276 }
        +
        277
        +
        278 auto operator()(x_coord_t x, y_coord_t y) const -> reference
        +
        279 {
        +
        280 BOOST_ASSERT(0 <= x && x < width());
        +
        281 BOOST_ASSERT(0 <= y && y < height());
        +
        282 return _pixels(x, y);
        +
        283 }
        +
        284
        +
        285 template <std::size_t D>
        +
        286 auto axis_iterator(point_t const& p) const -> typename axis<D>::iterator
        +
        287 {
        +
        288 // Allow request for iterators from inclusive range of [begin, end]
        +
        289 BOOST_ASSERT(0 <= p.x && p.x <= width());
        +
        290 BOOST_ASSERT(0 <= p.y && p.y <= height());
        +
        291 return _pixels.template axis_iterator<D>(p);
        +
        292 }
        +
        293
        +
        294 auto xy_at(x_coord_t x, y_coord_t y) const -> xy_locator
        +
        295 {
        +
        296 // TODO: Are relative locations of neighbors with negative offsets valid? Sampling?
        +
        297 BOOST_ASSERT(x < width());
        +
        298 BOOST_ASSERT(y <= height());
        +
        299 return _pixels + point_t(x, y);
        +
        300 }
        +
        301
        +
        302 auto xy_at(point_t const& p) const -> xy_locator
        +
        303 {
        +
        304 // TODO: Are relative locations of neighbors with negative offsets valid? Sampling?
        +
        305 BOOST_ASSERT(p.x < width());
        +
        306 BOOST_ASSERT(p.y < height());
        +
        307 return _pixels + p;
        +
        308 }
        +
        309 //\}@
        +
        310
        +
        311 //\{@
        +
        313 auto x_at(x_coord_t x, y_coord_t y) const -> x_iterator
        +
        314 {
        +
        315 BOOST_ASSERT(0 <= x && x <= width()); // allow request for [begin, end] inclusive
        +
        316 BOOST_ASSERT(0 <= y && y < height()); // TODO: For empty image/view, shouldn't we accept: row_begin(0) == view.row_end(0) ?
        +
        317 return _pixels.x_at(x, y);
        +
        318 }
        +
        319
        +
        320 auto x_at(point_t const& p) const -> x_iterator
        +
        321 {
        +
        322 BOOST_ASSERT(0 <= p.x && p.x <= width()); // allow request for [begin, end] inclusive
        +
        323 BOOST_ASSERT(0 <= p.y && p.y < height()); // TODO: For empty image/view, shouldn't we accept: row_begin(0) == view.row_end(0) ?
        +
        324 return _pixels.x_at(p);
        +
        325 }
        +
        326
        +
        327 auto row_begin(y_coord_t y) const -> x_iterator
        +
        328 {
        +
        329 BOOST_ASSERT(0 <= y && y < height());
        +
        330 return x_at(0, y);
        +
        331 }
        +
        332
        +
        333 auto row_end(y_coord_t y) const -> x_iterator
        +
        334 {
        +
        335 BOOST_ASSERT(0 <= y && y < height());
        +
        336 return x_at(width(), y);
        +
        337 }
        +
        338 //\}@
        +
        339
        +
        340 //\{@
        +
        342 auto y_at(x_coord_t x, y_coord_t y) const -> y_iterator
        +
        343 {
        +
        344 BOOST_ASSERT(0 <= x && x < width()); // TODO: For empty image/view, shouldn't we accept: view.col_begin(0) == view.col_end(0) ?
        +
        345 BOOST_ASSERT(0 <= y && y <= height()); // allow request for [begin, end] inclusive
        +
        346 return xy_at(x, y).y();
        +
        347 }
        +
        348
        +
        349 auto y_at(point_t const& p) const -> y_iterator
        +
        350 {
        +
        351 BOOST_ASSERT(0 <= p.x && p.x < width()); // TODO: For empty image/view, shouldn't we accept: view.col_begin(0) == view.col_end(0) ?
        +
        352 BOOST_ASSERT(0 <= p.y && p.y <= height()); // allow request for [begin, end] inclusive
        +
        353 return xy_at(p).y();
        +
        354 }
        +
        355
        +
        356 auto col_begin(x_coord_t x) const -> y_iterator
        +
        357 {
        +
        358 BOOST_ASSERT(0 <= x && x < width());
        +
        359 return y_at(x, 0);
        +
        360 }
        +
        361
        +
        362 auto col_end(x_coord_t x) const -> y_iterator
        +
        363 {
        +
        364 BOOST_ASSERT(0 <= x && x < width());
        +
        365 return y_at(x, height());
        +
        366 }
        +
        367 //\}@
        +
        368
        +
        369private:
        +
        370 template <typename L2>
        +
        371 friend class image_view;
        +
        372
        +
        373 point_t _dimensions;
        +
        374 xy_locator _pixels;
        +
        375};
        +
        +
        376
        +
        377template <typename L2>
        +
        378inline void swap(image_view<L2>& x, image_view<L2>& y) {
        +
        379 using std::swap;
        +
        380 swap(x._dimensions,y._dimensions);
        +
        381 swap(x._pixels, y._pixels); // TODO: Extend further
        +
        382}
        +
        383
        +
        385// PixelBasedConcept
        +
        387
        +
        388template <typename L>
        +
        389struct channel_type<image_view<L> > : public channel_type<L> {};
        +
        390
        +
        391template <typename L>
        +
        392struct color_space_type<image_view<L> > : public color_space_type<L> {};
        +
        393
        +
        394template <typename L>
        +
        395struct channel_mapping_type<image_view<L> > : public channel_mapping_type<L> {};
        +
        396
        +
        397template <typename L>
        +
        398struct is_planar<image_view<L> > : public is_planar<L> {};
        +
        399
        +
        401// HasDynamicXStepTypeConcept
        +
        403
        +
        404template <typename L>
        +
        405struct dynamic_x_step_type<image_view<L>>
        +
        406{
        +
        407 using type = image_view<typename gil::dynamic_x_step_type<L>::type>;
        +
        408};
        +
        409
        +
        411// HasDynamicYStepTypeConcept
        +
        413
        +
        414template <typename L>
        +
        415struct dynamic_y_step_type<image_view<L>>
        +
        416{
        +
        417 using type = image_view<typename gil::dynamic_y_step_type<L>::type>;
        +
        418};
        +
        419
        +
        421// HasTransposedTypeConcept
        +
        423
        +
        424template <typename L>
        +
        425struct transposed_type<image_view<L>>
        +
        426{
        +
        427 using type = image_view<typename transposed_type<L>::type>;
        +
        428};
        +
        429
        +
        430}} // namespace boost::gil
        +
        431
        +
        432#endif
        +
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition image_view.hpp:54
        +
        auto back() const -> reference
        Returns a reference to the last element in raster order.
        Definition image_view.hpp:205
        +
        auto front() const -> reference
        Returns a reference to the first element in raster order.
        Definition image_view.hpp:195
        +
        bool empty() const
        Returns true if the view has no elements, false otherwise.
        Definition image_view.hpp:186
        +
        void swap(image_view< Loc > &other)
        Exchanges the elements of the current view with those of other in constant time.
        Definition image_view.hpp:146
        +
        Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
        Definition iterator_from_2d.hpp:46
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
        swap for packed_channel_reference
        Definition: channel.hpp:583
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Returns an integral constant type specifying the number of elements in a color base.
        Definition: color_base_algorithm.hpp:42
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Returns an integral constant type specifying the number of elements in a color base.
        Definition color_base_algorithm.hpp:42
        diff --git a/html/reference/image__view__factory_8hpp_source.html b/html/reference/image__view__factory_8hpp_source.html index 9d3b625d6..2efd1edc3 100644 --- a/html/reference/image__view__factory_8hpp_source.html +++ b/html/reference/image__view__factory_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: image_view_factory.hpp Source File @@ -27,545 +27,578 @@

        - + +/* @license-end */ + +
        -
        -
        image_view_factory.hpp
        +
        image_view_factory.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IMAGE_VIEW_FACTORY_HPP
        -
        9 #define BOOST_GIL_IMAGE_VIEW_FACTORY_HPP
        -
        10 
        -
        11 #include <boost/gil/color_convert.hpp>
        -
        12 #include <boost/gil/dynamic_step.hpp>
        -
        13 #include <boost/gil/gray.hpp>
        -
        14 #include <boost/gil/image_view.hpp>
        -
        15 #include <boost/gil/metafunctions.hpp>
        -
        16 #include <boost/gil/point.hpp>
        -
        17 #include <boost/gil/detail/mp11.hpp>
        -
        18 
        -
        19 #include <boost/assert.hpp>
        -
        20 
        -
        21 #include <cstddef>
        -
        22 #include <type_traits>
        -
        23 
        -
        27 
        -
        31 
        -
        35 
        -
        36 namespace boost { namespace gil {
        -
        37 
        -
        38 struct default_color_converter;
        -
        39 
        -
        40 template <typename T> struct transposed_type;
        -
        41 
        -
        44 template <typename View>
        - -
        46  : dynamic_y_step_type<typename dynamic_x_step_type<View>::type> {};
        -
        47 
        -
        50 template <typename View>
        - -
        52  : dynamic_xy_step_type<typename transposed_type<View>::type> {};
        -
        53 
        -
        56 template <typename Iterator>
        - -
        58  std::size_t width, std::size_t height,
        -
        59  Iterator pixels, std::ptrdiff_t rowsize_in_bytes)
        - -
        61 {
        -
        62  using RView = typename type_from_x_iterator<Iterator>::view_t;
        -
        63  return RView(width, height, typename RView::locator(pixels, rowsize_in_bytes));
        -
        64 }
        -
        65 
        -
        68 template <typename Iterator>
        - -
        70  point<std::ptrdiff_t> dim, Iterator pixels,
        -
        71  std::ptrdiff_t rowsize_in_bytes)
        - -
        73 {
        -
        74  using RView = typename type_from_x_iterator<Iterator>::view_t;
        -
        75  return RView(dim, typename RView::locator(pixels, rowsize_in_bytes));
        -
        76 }
        -
        77 
        -
        79 // interleaved_view_get_raw_data, planar_view_get_raw_data - return pointers to the raw data (the channels) of a basic homogeneous view.
        -
        81 
        -
        82 namespace detail {
        -
        83  template <typename View, bool IsMutable>
        -
        84  struct channel_pointer_type_impl;
        -
        85 
        -
        86  template <typename View>
        -
        87  struct channel_pointer_type_impl<View, true>
        -
        88  {
        -
        89  using type = typename channel_type<View>::type*;
        -
        90  };
        -
        91 
        -
        92  template <typename View>
        -
        93  struct channel_pointer_type_impl<View, false>
        -
        94  {
        -
        95  using type = const typename channel_type<View>::type*;
        -
        96  };
        -
        97 
        -
        98  template <typename View>
        -
        99  struct channel_pointer_type
        -
        100  : public channel_pointer_type_impl<View, view_is_mutable<View>::value> {};
        -
        101 } // namespace detail
        -
        102 
        -
        105 template <typename HomogeneousView>
        -
        106 auto interleaved_view_get_raw_data(HomogeneousView const& view)
        -
        107  -> typename detail::channel_pointer_type<HomogeneousView>::type
        -
        108 {
        -
        109  static_assert(!is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value, "");
        -
        110  static_assert(std::is_pointer<typename HomogeneousView::x_iterator>::value, "");
        -
        111 
        -
        112  return &gil::at_c<0>(view(0,0));
        -
        113 }
        -
        114 
        -
        117 template <typename HomogeneousView>
        -
        118 auto planar_view_get_raw_data(HomogeneousView const& view, int plane_index)
        -
        119  -> typename detail::channel_pointer_type<HomogeneousView>::type
        -
        120 {
        -
        121  static_assert(is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value, "");
        -
        122  return dynamic_at_c(view.row_begin(0),plane_index);
        -
        123 }
        -
        124 
        -
        125 
        -
        129 
        -
        134 template <typename SrcConstRefP, typename DstP, typename CC=default_color_converter > // const_reference to the source pixel and destination pixel value
        -
        135 class color_convert_deref_fn : public deref_base<color_convert_deref_fn<SrcConstRefP,DstP,CC>, DstP, DstP, const DstP&, SrcConstRefP, DstP, false> {
        -
        136 private:
        -
        137  CC _cc; // color-converter
        -
        138 public:
        - -
        140  color_convert_deref_fn(CC cc_in) : _cc(cc_in) {}
        -
        141 
        -
        142  DstP operator()(SrcConstRefP srcP) const {
        -
        143  DstP dstP;
        -
        144  _cc(srcP,dstP);
        -
        145  return dstP;
        -
        146  }
        -
        147 };
        -
        148 
        -
        149 namespace detail {
        -
        150  // Add color converter upon dereferencing
        -
        151  template <typename SrcView, typename CC, typename DstP, typename SrcP>
        -
        152  struct _color_converted_view_type {
        -
        153  private:
        - -
        155  using add_ref_t = typename SrcView::template add_deref<deref_t>;
        -
        156  public:
        -
        157  using type = typename add_ref_t::type;
        -
        158  static type make(const SrcView& sv,CC cc) {return add_ref_t::make(sv,deref_t(cc));}
        -
        159  };
        -
        160 
        -
        161  // If the Src view has the same pixel type as the target, there is no need for color conversion
        -
        162  template <typename SrcView, typename CC, typename DstP>
        -
        163  struct _color_converted_view_type<SrcView,CC,DstP,DstP> {
        -
        164  using type = SrcView;
        -
        165  static type make(const SrcView& sv,CC) {return sv;}
        -
        166  };
        -
        167 } // namespace detail
        -
        168 
        -
        169 
        -
        172 template <typename SrcView, typename DstP, typename CC=default_color_converter>
        -
        173 struct color_converted_view_type : public detail::_color_converted_view_type<SrcView,
        -
        174  CC,
        -
        175  DstP,
        -
        176  typename SrcView::value_type> {
        -
        177  BOOST_GIL_CLASS_REQUIRE(DstP, boost::gil, MutablePixelConcept)//why does it have to be mutable???
        -
        178 };
        -
        179 
        -
        180 
        -
        183 template <typename DstP, typename View, typename CC>
        -
        184 inline auto color_converted_view(View const& src,CC cc)
        -
        185  -> typename color_converted_view_type<View,DstP,CC>::type
        -
        186 {
        - -
        188 }
        -
        189 
        -
        192 template <typename DstP, typename View>
        -
        193 inline auto color_converted_view(View const& src)
        -
        194  -> typename color_converted_view_type<View,DstP>::type
        -
        195 {
        -
        196  return color_converted_view<DstP>(src,default_color_converter());
        -
        197 }
        -
        198 
        -
        202 
        -
        204 template <typename View>
        -
        205 inline auto flipped_up_down_view(View const& src)
        -
        206  -> typename dynamic_y_step_type<View>::type
        -
        207 {
        -
        208  using RView = typename dynamic_y_step_type<View>::type;
        -
        209  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1));
        -
        210 }
        -
        211 
        -
        215 
        -
        217 template <typename View>
        -
        218 inline auto flipped_left_right_view(View const& src)
        -
        219  -> typename dynamic_x_step_type<View>::type
        -
        220 {
        -
        221  using RView = typename dynamic_x_step_type<View>::type;
        -
        222  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,0),-1,1));
        -
        223 }
        -
        224 
        -
        228 
        -
        230 template <typename View>
        -
        231 inline auto transposed_view(View const& src)
        -
        232  -> typename dynamic_xy_step_transposed_type<View>::type
        -
        233 {
        -
        234  using RView = typename dynamic_xy_step_transposed_type<View>::type;
        -
        235  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,0),1,1,true));
        -
        236 }
        -
        237 
        -
        241 
        -
        243 template <typename View>
        -
        244 inline auto rotated90cw_view(View const& src)
        -
        245  -> typename dynamic_xy_step_transposed_type<View>::type
        -
        246 {
        -
        247  using RView = typename dynamic_xy_step_transposed_type<View>::type;
        -
        248  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1,1,true));
        -
        249 }
        -
        250 
        -
        254 
        -
        256 template <typename View>
        -
        257 inline auto rotated90ccw_view(View const& src)
        -
        258  -> typename dynamic_xy_step_transposed_type<View>::type
        -
        259 {
        -
        260  using RView = typename dynamic_xy_step_transposed_type<View>::type;
        -
        261  return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(src.width()-1,0),1,-1,true));
        -
        262 }
        -
        263 
        -
        267 
        -
        269 template <typename View>
        -
        270 inline auto rotated180_view(View const& src)
        -
        271  -> typename dynamic_xy_step_type<View>::type
        -
        272 {
        -
        273  using RView = typename dynamic_xy_step_type<View>::type;
        -
        274  return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,src.height()-1),-1,-1));
        -
        275 }
        -
        276 
        -
        280 
        -
        282 template <typename View>
        -
        283 inline View subimage_view(
        -
        284  View const& src,
        -
        285  typename View::point_t const& topleft,
        -
        286  typename View::point_t const& dimensions)
        -
        287 {
        -
        288  return View(dimensions, src.xy_at(topleft));
        -
        289 }
        -
        290 
        -
        292 template <typename View>
        -
        293 inline View subimage_view(View const& src,
        -
        294  typename View::coord_t x_min,
        -
        295  typename View::coord_t y_min,
        -
        296  typename View::coord_t width,
        -
        297  typename View::coord_t height)
        -
        298 {
        -
        299  return View(width, height, src.xy_at(x_min, y_min));
        -
        300 }
        -
        301 
        -
        305 
        -
        307 template <typename View>
        -
        308 inline
        -
        309 auto subsampled_view(View const& src, typename View::coord_t x_step, typename View::coord_t y_step)
        -
        310  -> typename dynamic_xy_step_type<View>::type
        -
        311 {
        -
        312  BOOST_ASSERT(x_step > 0 && y_step > 0);
        -
        313  using view_t =typename dynamic_xy_step_type<View>::type;
        -
        314  return view_t(
        -
        315  (src.width() + (x_step - 1)) / x_step,
        -
        316  (src.height() + (y_step - 1)) / y_step,
        -
        317  typename view_t::xy_locator(src.xy_at(0,0), x_step, y_step));
        -
        318 }
        -
        319 
        -
        321 template <typename View>
        -
        322 inline auto subsampled_view(View const& src, typename View::point_t const& step)
        -
        323  -> typename dynamic_xy_step_type<View>::type
        -
        324 {
        -
        325  return subsampled_view(src, step.x, step.y);
        -
        326 }
        -
        327 
        -
        331 
        -
        332 namespace detail {
        -
        333  template <typename View, bool AreChannelsTogether> struct __nth_channel_view_basic;
        -
        334 
        -
        335  // nth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
        -
        336  // or images with a step
        -
        337  template <typename View>
        -
        338  struct __nth_channel_view_basic<View,false> {
        -
        339  using type = typename view_type<typename channel_type<View>::type, gray_layout_t, false, true, view_is_mutable<View>::value>::type;
        -
        340 
        -
        341  static type make(View const& src, int n) {
        -
        342  using locator_t = typename type::xy_locator;
        -
        343  using x_iterator_t = typename type::x_iterator;
        -
        344  using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t>::type;
        -
        345  x_iterator_t sit(x_iterator_base_t(&(src(0,0)[n])),src.pixels().pixel_size());
        -
        346  return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
        -
        347  }
        -
        348  };
        -
        349 
        -
        350  // nth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
        -
        351  template <typename View>
        -
        352  struct __nth_channel_view_basic<View,true> {
        -
        353  using type = typename view_type<typename channel_type<View>::type, gray_layout_t, false, false, view_is_mutable<View>::value>::type;
        -
        354  static type make(View const& src, int n) {
        -
        355  using x_iterator_t = typename type::x_iterator;
        -
        356  return interleaved_view(src.width(),src.height(),(x_iterator_t)&(src(0,0)[n]), src.pixels().row_size());
        -
        357  }
        -
        358  };
        -
        359 
        -
        360  template <typename View, bool IsBasic> struct __nth_channel_view;
        -
        361 
        -
        362  // For basic (memory-based) views dispatch to __nth_channel_view_basic
        -
        363  template <typename View>
        -
        364  struct __nth_channel_view<View,true>
        -
        365  {
        -
        366  private:
        -
        367  using src_x_iterator = typename View::x_iterator;
        -
        368 
        -
        369  // Determines whether the channels of a given pixel iterator are adjacent in memory.
        -
        370  // Planar and grayscale iterators have channels adjacent in memory, whereas multi-channel interleaved and iterators with non-fundamental step do not.
        -
        371  static constexpr bool adjacent =
        -
        372  !iterator_is_step<src_x_iterator>::value &&
        -
        373  (is_planar<src_x_iterator>::value || num_channels<View>::value == 1);
        -
        374 
        -
        375  public:
        -
        376  using type = typename __nth_channel_view_basic<View,adjacent>::type;
        -
        377 
        -
        378  static type make(View const& src, int n) {
        -
        379  return __nth_channel_view_basic<View,adjacent>::make(src,n);
        -
        380  }
        -
        381  };
        -
        382 
        -
        387  template <typename SrcP> // SrcP is a reference to PixelConcept (could be pixel value or const/non-const reference)
        -
        388  // Examples: pixel<T,L>, pixel<T,L>&, const pixel<T,L>&, planar_pixel_reference<T&,L>, planar_pixel_reference<const T&,L>
        - -
        390  {
        -
        391  static constexpr bool is_mutable =
        - -
        393  private:
        -
        394  using src_pixel_t = typename std::remove_reference<SrcP>::type;
        -
        395  using channel_t = typename channel_type<src_pixel_t>::type;
        -
        396  using const_ref_t = typename src_pixel_t::const_reference;
        - -
        398  public:
        - -
        400  using value_type = typename pixel_value_type<channel_t,gray_layout_t>::type;
        - -
        402  using argument_type = SrcP;
        -
        403  using reference = mp11::mp_if_c<is_mutable, ref_t, value_type>;
        -
        404  using result_type = reference;
        -
        405 
        -
        406  nth_channel_deref_fn(int n=0) : _n(n) {}
        -
        407  template <typename P>
        -
        408  nth_channel_deref_fn(const nth_channel_deref_fn<P>& d) : _n(d._n) {}
        -
        409 
        -
        410  int _n; // the channel to use
        -
        411 
        -
        412  auto operator()(argument_type srcP) const -> result_type
        -
        413  {
        -
        414  return result_type(srcP[_n]);
        -
        415  }
        -
        416  };
        -
        417 
        -
        418  template <typename View> struct __nth_channel_view<View,false> {
        -
        419  private:
        - -
        421  using AD = typename View::template add_deref<deref_t>;
        -
        422  public:
        -
        423  using type = typename AD::type;
        -
        424  static type make(View const& src, int n) {
        -
        425  return AD::make(src, deref_t(n));
        -
        426  }
        -
        427  };
        -
        428 } // namespace detail
        -
        429 
        -
        436 template <typename View>
        - -
        438 private:
        -
        439  BOOST_GIL_CLASS_REQUIRE(View, boost::gil, ImageViewConcept)
        -
        440  using VB = detail::__nth_channel_view<View,view_is_basic<View>::value>;
        -
        441 public:
        -
        442  using type = typename VB::type;
        -
        443  static type make(View const& src, int n) { return VB::make(src,n); }
        -
        444 };
        -
        445 
        -
        447 template <typename View>
        -
        448 typename nth_channel_view_type<View>::type nth_channel_view(View const& src, int n) {
        -
        449  return nth_channel_view_type<View>::make(src,n);
        -
        450 }
        -
        451 
        -
        455 
        -
        456 namespace detail {
        -
        457  template <int K, typename View, bool AreChannelsTogether> struct __kth_channel_view_basic;
        -
        458 
        -
        459  // kth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
        -
        460  // or images with a step
        -
        461  template <int K, typename View>
        -
        462  struct __kth_channel_view_basic<K,View,false> {
        -
        463  private:
        -
        464  using channel_t = typename kth_element_type<typename View::value_type,K>::type;
        -
        465  public:
        -
        466  using type = typename view_type<channel_t, gray_layout_t, false, true, view_is_mutable<View>::value>::type;
        -
        467 
        -
        468  static type make(View const& src) {
        -
        469  using locator_t = typename type::xy_locator;
        -
        470  using x_iterator_t = typename type::x_iterator;
        -
        471  using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t>::type;
        -
        472  x_iterator_t sit(x_iterator_base_t(&gil::at_c<K>(src(0,0))),src.pixels().pixel_size());
        -
        473  return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
        -
        474  }
        -
        475  };
        -
        476 
        -
        477  // kth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
        -
        478  template <int K, typename View>
        -
        479  struct __kth_channel_view_basic<K,View,true> {
        -
        480  private:
        -
        481  using channel_t = typename kth_element_type<typename View::value_type, K>::type;
        -
        482  public:
        -
        483  using type = typename view_type<channel_t, gray_layout_t, false, false, view_is_mutable<View>::value>::type;
        -
        484  static type make(View const& src) {
        -
        485  using x_iterator_t = typename type::x_iterator;
        -
        486  return interleaved_view(src.width(),src.height(),(x_iterator_t)&gil::at_c<K>(src(0,0)), src.pixels().row_size());
        -
        487  }
        -
        488  };
        -
        489 
        -
        490  template <int K, typename View, bool IsBasic> struct __kth_channel_view;
        -
        491 
        -
        492  // For basic (memory-based) views dispatch to __kth_channel_view_basic
        -
        493  template <int K, typename View> struct __kth_channel_view<K,View,true>
        -
        494  {
        -
        495  private:
        -
        496  using src_x_iterator = typename View::x_iterator;
        -
        497 
        -
        498  // Determines whether the channels of a given pixel iterator are adjacent in memory.
        -
        499  // Planar and grayscale iterators have channels adjacent in memory, whereas multi-channel interleaved and iterators with non-fundamental step do not.
        -
        500  static constexpr bool adjacent =
        -
        501  !iterator_is_step<src_x_iterator>::value &&
        -
        502  (is_planar<src_x_iterator>::value || num_channels<View>::value == 1);
        -
        503 
        -
        504  public:
        -
        505  using type = typename __kth_channel_view_basic<K,View,adjacent>::type;
        -
        506 
        -
        507  static type make(View const& src) {
        -
        508  return __kth_channel_view_basic<K,View,adjacent>::make(src);
        -
        509  }
        -
        510  };
        -
        511 
        -
        518  template <int K, typename SrcP>
        - -
        520  {
        -
        521  static constexpr bool is_mutable =
        - -
        523 
        -
        524  private:
        -
        525  using src_pixel_t = typename std::remove_reference<SrcP>::type;
        -
        526  using channel_t = typename kth_element_type<src_pixel_t, K>::type;
        -
        527  using const_ref_t = typename src_pixel_t::const_reference;
        - -
        529 
        -
        530  public:
        - -
        532  using value_type = typename pixel_value_type<channel_t,gray_layout_t>::type;
        - -
        534  using argument_type = SrcP;
        -
        535  using reference = mp11::mp_if_c<is_mutable, ref_t, value_type>;
        -
        536  using result_type = reference;
        -
        537 
        - -
        539  template <typename P>
        - -
        541 
        -
        542  result_type operator()(argument_type srcP) const {
        -
        543  return result_type(gil::at_c<K>(srcP));
        -
        544  }
        -
        545  };
        -
        546 
        -
        547  template <int K, typename View> struct __kth_channel_view<K,View,false> {
        -
        548  private:
        - -
        550  using AD = typename View::template add_deref<deref_t>;
        -
        551  public:
        -
        552  using type = typename AD::type;
        -
        553  static type make(View const& src) {
        -
        554  return AD::make(src, deref_t());
        -
        555  }
        -
        556  };
        -
        557 } // namespace detail
        -
        558 
        -
        565 template <int K, typename View>
        - -
        567 private:
        -
        568  BOOST_GIL_CLASS_REQUIRE(View, boost::gil, ImageViewConcept)
        -
        569  using VB = detail::__kth_channel_view<K,View,view_is_basic<View>::value>;
        -
        570 public:
        -
        571  using type = typename VB::type;
        -
        572  static type make(View const& src) { return VB::make(src); }
        -
        573 };
        -
        574 
        -
        576 template <int K, typename View>
        -
        577 auto kth_channel_view(View const& src)
        -
        578  -> typename kth_channel_view_type<K,View>::type
        -
        579 {
        - -
        581 }
        -
        582 
        -
        583 } } // namespace boost::gil
        -
        584 
        -
        585 #endif
        -
        Function object that given a source pixel, returns it converted to a given color space and channel de...
        Definition: image_view_factory.hpp:135
        -
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition: image_view.hpp:54
        - -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        auto interleaved_view_get_raw_data(HomogeneousView const &view) -> typename detail::channel_pointer_type< HomogeneousView >::type
        Returns C pointer to the the channels of an interleaved homogeneous view.
        Definition: image_view_factory.hpp:106
        -
        auto planar_view_get_raw_data(HomogeneousView const &view, int plane_index) -> typename detail::channel_pointer_type< HomogeneousView >::type
        Returns C pointer to the the channels of a given color plane of a planar homogeneous view.
        Definition: image_view_factory.hpp:118
        -
        auto interleaved_view(point< std::ptrdiff_t > dim, Iterator pixels, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< Iterator >::view_t
        Constructing image views from raw interleaved pixel data.
        Definition: image_view_factory.hpp:69
        -
        auto color_converted_view(View const &src) -> typename color_converted_view_type< View, DstP >::type
        overload of generic color_converted_view with the default color-converter
        Definition: image_view_factory.hpp:193
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        GIL's 2-dimensional view over immutable GIL pixels.
        Definition: concepts/image_view.hpp:376
        -
        Pixel concept that allows for changing its channels.
        Definition: concepts/pixel.hpp:102
        -
        Definition: color_convert.hpp:31
        -
        Returns the type of a view that does color conversion upon dereferencing its pixels.
        Definition: image_view_factory.hpp:176
        -
        class for color-converting one pixel to another
        Definition: color_convert.hpp:328
        -
        Helper base class for pixel dereference adaptors.
        Definition: utilities.hpp:107
        -
        Function object that returns a grayscale reference of the K-th channel (specified as a template param...
        Definition: image_view_factory.hpp:520
        -
        Function object that returns a grayscale reference of the N-th channel of a given reference....
        Definition: image_view_factory.hpp:390
        -
        Returns the type of a transposed view that has a dynamic step along both X and Y.
        Definition: image_view_factory.hpp:52
        -
        Returns the type of a view that has a dynamic step along both X and Y.
        Definition: image_view_factory.hpp:46
        -
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition: dynamic_step.hpp:21
        -
        Given a source image view type View, returns the type of an image view over a given channel of View.
        Definition: image_view_factory.hpp:566
        -
        Given a source image view type View, returns the type of an image view over a single channel of View.
        Definition: image_view_factory.hpp:437
        -
        Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
        Definition: metafunctions.hpp:218
        -
        Determines if the given pixel reference is mutable (i.e. its channels can be changed)
        Definition: metafunctions.hpp:231
        -
        Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
        Definition: metafunctions.hpp:267
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: pixel.hpp:106
        -
        Basic views must be over basic locators.
        Definition: metafunctions.hpp:130
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IMAGE_VIEW_FACTORY_HPP
        +
        9#define BOOST_GIL_IMAGE_VIEW_FACTORY_HPP
        +
        10
        +
        11#include <boost/gil/color_convert.hpp>
        +
        12#include <boost/gil/dynamic_step.hpp>
        +
        13#include <boost/gil/gray.hpp>
        +
        14#include <boost/gil/image_view.hpp>
        +
        15#include <boost/gil/metafunctions.hpp>
        +
        16#include <boost/gil/point.hpp>
        +
        17#include <boost/gil/detail/mp11.hpp>
        +
        18
        +
        19#include <boost/assert.hpp>
        +
        20
        +
        21#include <cstddef>
        +
        22#include <type_traits>
        +
        23
        +
        27
        +
        31
        +
        35
        +
        36namespace boost { namespace gil {
        +
        37
        +
        38struct default_color_converter;
        +
        39
        +
        40template <typename T> struct transposed_type;
        +
        41
        +
        44template <typename View>
        +
        + +
        46 : dynamic_y_step_type<typename dynamic_x_step_type<View>::type> {};
        +
        +
        47
        +
        50template <typename View>
        +
        + +
        52 : dynamic_xy_step_type<typename transposed_type<View>::type> {};
        +
        +
        53
        +
        56template <typename Iterator>
        +
        + +
        58 std::size_t width, std::size_t height,
        +
        59 Iterator pixels, std::ptrdiff_t rowsize_in_bytes)
        + +
        61{
        +
        62 using RView = typename type_from_x_iterator<Iterator>::view_t;
        +
        63 return RView(width, height, typename RView::locator(pixels, rowsize_in_bytes));
        +
        64}
        +
        +
        65
        +
        68template <typename Iterator>
        +
        + +
        70 point<std::ptrdiff_t> dim, Iterator pixels,
        +
        71 std::ptrdiff_t rowsize_in_bytes)
        + +
        73{
        +
        74 using RView = typename type_from_x_iterator<Iterator>::view_t;
        +
        75 return RView(dim, typename RView::locator(pixels, rowsize_in_bytes));
        +
        76}
        +
        +
        77
        +
        79// interleaved_view_get_raw_data, planar_view_get_raw_data - return pointers to the raw data (the channels) of a basic homogeneous view.
        +
        81
        +
        82namespace detail {
        +
        83 template <typename View, bool IsMutable>
        +
        84 struct channel_pointer_type_impl;
        +
        85
        +
        86 template <typename View>
        +
        87 struct channel_pointer_type_impl<View, true>
        +
        88 {
        +
        89 using type = typename channel_type<View>::type*;
        +
        90 };
        +
        91
        +
        92 template <typename View>
        +
        93 struct channel_pointer_type_impl<View, false>
        +
        94 {
        +
        95 using type = const typename channel_type<View>::type*;
        +
        96 };
        +
        97
        +
        98 template <typename View>
        +
        99 struct channel_pointer_type
        +
        100 : public channel_pointer_type_impl<View, view_is_mutable<View>::value> {};
        +
        101} // namespace detail
        +
        102
        +
        105template <typename HomogeneousView>
        +
        +
        106auto interleaved_view_get_raw_data(HomogeneousView const& view)
        +
        107 -> typename detail::channel_pointer_type<HomogeneousView>::type
        +
        108{
        +
        109 static_assert(!is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value, "");
        +
        110 static_assert(std::is_pointer<typename HomogeneousView::x_iterator>::value, "");
        +
        111
        +
        112 return &gil::at_c<0>(view(0,0));
        +
        113}
        +
        +
        114
        +
        117template <typename HomogeneousView>
        +
        +
        118auto planar_view_get_raw_data(HomogeneousView const& view, int plane_index)
        +
        119 -> typename detail::channel_pointer_type<HomogeneousView>::type
        +
        120{
        +
        121 static_assert(is_planar<HomogeneousView>::value && view_is_basic<HomogeneousView>::value, "");
        +
        122 return dynamic_at_c(view.row_begin(0),plane_index);
        +
        123}
        +
        +
        124
        +
        125
        +
        129
        +
        134template <typename SrcConstRefP, typename DstP, typename CC=default_color_converter > // const_reference to the source pixel and destination pixel value
        +
        +
        135class color_convert_deref_fn : public deref_base<color_convert_deref_fn<SrcConstRefP,DstP,CC>, DstP, DstP, const DstP&, SrcConstRefP, DstP, false> {
        +
        136private:
        +
        137 CC _cc; // color-converter
        +
        138public:
        + +
        140 color_convert_deref_fn(CC cc_in) : _cc(cc_in) {}
        +
        141
        +
        142 DstP operator()(SrcConstRefP srcP) const {
        +
        143 DstP dstP;
        +
        144 _cc(srcP,dstP);
        +
        145 return dstP;
        +
        146 }
        +
        147};
        +
        +
        148
        +
        149namespace detail {
        +
        150 // Add color converter upon dereferencing
        +
        151 template <typename SrcView, typename CC, typename DstP, typename SrcP>
        +
        152 struct _color_converted_view_type {
        +
        153 private:
        + +
        155 using add_ref_t = typename SrcView::template add_deref<deref_t>;
        +
        156 public:
        +
        157 using type = typename add_ref_t::type;
        +
        158 static type make(const SrcView& sv,CC cc) {return add_ref_t::make(sv,deref_t(cc));}
        +
        159 };
        +
        160
        +
        161 // If the Src view has the same pixel type as the target, there is no need for color conversion
        +
        162 template <typename SrcView, typename CC, typename DstP>
        +
        163 struct _color_converted_view_type<SrcView,CC,DstP,DstP> {
        +
        164 using type = SrcView;
        +
        165 static type make(const SrcView& sv,CC) {return sv;}
        +
        166 };
        +
        167} // namespace detail
        +
        168
        +
        169
        +
        172template <typename SrcView, typename DstP, typename CC=default_color_converter>
        +
        +
        173struct color_converted_view_type : public detail::_color_converted_view_type<SrcView,
        +
        174 CC,
        +
        175 DstP,
        +
        176 typename SrcView::value_type> {
        +
        177 BOOST_GIL_CLASS_REQUIRE(DstP, boost::gil, MutablePixelConcept)//why does it have to be mutable???
        +
        178};
        +
        +
        179
        +
        180
        +
        183template <typename DstP, typename View, typename CC>
        +
        +
        184inline auto color_converted_view(View const& src,CC cc)
        +
        185 -> typename color_converted_view_type<View,DstP,CC>::type
        +
        186{
        + +
        188}
        +
        +
        189
        +
        192template <typename DstP, typename View>
        +
        +
        193inline auto color_converted_view(View const& src)
        +
        194 -> typename color_converted_view_type<View,DstP>::type
        +
        195{
        +
        196 return color_converted_view<DstP>(src,default_color_converter());
        +
        197}
        +
        +
        198
        +
        202
        +
        204template <typename View>
        +
        205inline auto flipped_up_down_view(View const& src)
        +
        206 -> typename dynamic_y_step_type<View>::type
        +
        207{
        +
        208 using RView = typename dynamic_y_step_type<View>::type;
        +
        209 return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1));
        +
        210}
        +
        211
        +
        215
        +
        217template <typename View>
        +
        218inline auto flipped_left_right_view(View const& src)
        +
        219 -> typename dynamic_x_step_type<View>::type
        +
        220{
        +
        221 using RView = typename dynamic_x_step_type<View>::type;
        +
        222 return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,0),-1,1));
        +
        223}
        +
        224
        +
        228
        +
        230template <typename View>
        +
        231inline auto transposed_view(View const& src)
        +
        232 -> typename dynamic_xy_step_transposed_type<View>::type
        +
        233{
        +
        234 using RView = typename dynamic_xy_step_transposed_type<View>::type;
        +
        235 return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,0),1,1,true));
        +
        236}
        +
        237
        +
        241
        +
        243template <typename View>
        +
        244inline auto rotated90cw_view(View const& src)
        +
        245 -> typename dynamic_xy_step_transposed_type<View>::type
        +
        246{
        +
        247 using RView = typename dynamic_xy_step_transposed_type<View>::type;
        +
        248 return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(0,src.height()-1),-1,1,true));
        +
        249}
        +
        250
        +
        254
        +
        256template <typename View>
        +
        257inline auto rotated90ccw_view(View const& src)
        +
        258 -> typename dynamic_xy_step_transposed_type<View>::type
        +
        259{
        +
        260 using RView = typename dynamic_xy_step_transposed_type<View>::type;
        +
        261 return RView(src.height(),src.width(),typename RView::xy_locator(src.xy_at(src.width()-1,0),1,-1,true));
        +
        262}
        +
        263
        +
        267
        +
        269template <typename View>
        +
        270inline auto rotated180_view(View const& src)
        +
        271 -> typename dynamic_xy_step_type<View>::type
        +
        272{
        +
        273 using RView = typename dynamic_xy_step_type<View>::type;
        +
        274 return RView(src.dimensions(),typename RView::xy_locator(src.xy_at(src.width()-1,src.height()-1),-1,-1));
        +
        275}
        +
        276
        +
        280
        +
        282template <typename View>
        +
        283inline View subimage_view(
        +
        284 View const& src,
        +
        285 typename View::point_t const& topleft,
        +
        286 typename View::point_t const& dimensions)
        +
        287{
        +
        288 return View(dimensions, src.xy_at(topleft));
        +
        289}
        +
        290
        +
        292template <typename View>
        +
        293inline View subimage_view(View const& src,
        +
        294 typename View::coord_t x_min,
        +
        295 typename View::coord_t y_min,
        +
        296 typename View::coord_t width,
        +
        297 typename View::coord_t height)
        +
        298{
        +
        299 return View(width, height, src.xy_at(x_min, y_min));
        +
        300}
        +
        301
        +
        305
        +
        307template <typename View>
        +
        308inline
        +
        309auto subsampled_view(View const& src, typename View::coord_t x_step, typename View::coord_t y_step)
        +
        310 -> typename dynamic_xy_step_type<View>::type
        +
        311{
        +
        312 BOOST_ASSERT(x_step > 0 && y_step > 0);
        +
        313 using view_t =typename dynamic_xy_step_type<View>::type;
        +
        314 return view_t(
        +
        315 (src.width() + (x_step - 1)) / x_step,
        +
        316 (src.height() + (y_step - 1)) / y_step,
        +
        317 typename view_t::xy_locator(src.xy_at(0,0), x_step, y_step));
        +
        318}
        +
        319
        +
        321template <typename View>
        +
        322inline auto subsampled_view(View const& src, typename View::point_t const& step)
        +
        323 -> typename dynamic_xy_step_type<View>::type
        +
        324{
        +
        325 return subsampled_view(src, step.x, step.y);
        +
        326}
        +
        327
        +
        331
        +
        332namespace detail {
        +
        333 template <typename View, bool AreChannelsTogether> struct __nth_channel_view_basic;
        +
        334
        +
        335 // nth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
        +
        336 // or images with a step
        +
        337 template <typename View>
        +
        338 struct __nth_channel_view_basic<View,false> {
        +
        339 using type = typename view_type<typename channel_type<View>::type, gray_layout_t, false, true, view_is_mutable<View>::value>::type;
        +
        340
        +
        341 static type make(View const& src, int n) {
        +
        342 using locator_t = typename type::xy_locator;
        +
        343 using x_iterator_t = typename type::x_iterator;
        +
        344 using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t>::type;
        +
        345 x_iterator_t sit(x_iterator_base_t(&(src(0,0)[n])),src.pixels().pixel_size());
        +
        346 return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
        +
        347 }
        +
        348 };
        +
        349
        +
        350 // nth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
        +
        351 template <typename View>
        +
        352 struct __nth_channel_view_basic<View,true> {
        +
        353 using type = typename view_type<typename channel_type<View>::type, gray_layout_t, false, false, view_is_mutable<View>::value>::type;
        +
        354 static type make(View const& src, int n) {
        +
        355 using x_iterator_t = typename type::x_iterator;
        +
        356 return interleaved_view(src.width(),src.height(),(x_iterator_t)&(src(0,0)[n]), src.pixels().row_size());
        +
        357 }
        +
        358 };
        +
        359
        +
        360 template <typename View, bool IsBasic> struct __nth_channel_view;
        +
        361
        +
        362 // For basic (memory-based) views dispatch to __nth_channel_view_basic
        +
        363 template <typename View>
        +
        364 struct __nth_channel_view<View,true>
        +
        365 {
        +
        366 private:
        +
        367 using src_x_iterator = typename View::x_iterator;
        +
        368
        +
        369 // Determines whether the channels of a given pixel iterator are adjacent in memory.
        +
        370 // Planar and grayscale iterators have channels adjacent in memory, whereas multi-channel interleaved and iterators with non-fundamental step do not.
        +
        371 static constexpr bool adjacent =
        +
        372 !iterator_is_step<src_x_iterator>::value &&
        +
        373 (is_planar<src_x_iterator>::value || num_channels<View>::value == 1);
        +
        374
        +
        375 public:
        +
        376 using type = typename __nth_channel_view_basic<View,adjacent>::type;
        +
        377
        +
        378 static type make(View const& src, int n) {
        +
        379 return __nth_channel_view_basic<View,adjacent>::make(src,n);
        +
        380 }
        +
        381 };
        +
        382
        +
        387 template <typename SrcP> // SrcP is a reference to PixelConcept (could be pixel value or const/non-const reference)
        +
        388 // Examples: pixel<T,L>, pixel<T,L>&, const pixel<T,L>&, planar_pixel_reference<T&,L>, planar_pixel_reference<const T&,L>
        +
        + +
        390 {
        +
        391 static constexpr bool is_mutable =
        + +
        393 private:
        +
        394 using src_pixel_t = typename std::remove_reference<SrcP>::type;
        +
        395 using channel_t = typename channel_type<src_pixel_t>::type;
        +
        396 using const_ref_t = typename src_pixel_t::const_reference;
        + +
        398 public:
        + +
        400 using value_type = typename pixel_value_type<channel_t,gray_layout_t>::type;
        + +
        402 using argument_type = SrcP;
        +
        403 using reference = mp11::mp_if_c<is_mutable, ref_t, value_type>;
        +
        404 using result_type = reference;
        +
        405
        +
        406 nth_channel_deref_fn(int n=0) : _n(n) {}
        +
        407 template <typename P>
        +
        408 nth_channel_deref_fn(const nth_channel_deref_fn<P>& d) : _n(d._n) {}
        +
        409
        +
        410 int _n; // the channel to use
        +
        411
        +
        412 auto operator()(argument_type srcP) const -> result_type
        +
        413 {
        +
        414 return result_type(srcP[_n]);
        +
        415 }
        +
        416 };
        +
        +
        417
        +
        418 template <typename View> struct __nth_channel_view<View,false> {
        +
        419 private:
        + +
        421 using AD = typename View::template add_deref<deref_t>;
        +
        422 public:
        +
        423 using type = typename AD::type;
        +
        424 static type make(View const& src, int n) {
        +
        425 return AD::make(src, deref_t(n));
        +
        426 }
        +
        427 };
        +
        428} // namespace detail
        +
        429
        +
        436template <typename View>
        +
        + +
        438private:
        +
        439 BOOST_GIL_CLASS_REQUIRE(View, boost::gil, ImageViewConcept)
        +
        440 using VB = detail::__nth_channel_view<View,view_is_basic<View>::value>;
        +
        441public:
        +
        442 using type = typename VB::type;
        +
        443 static type make(View const& src, int n) { return VB::make(src,n); }
        +
        444};
        +
        +
        445
        +
        447template <typename View>
        +
        448typename nth_channel_view_type<View>::type nth_channel_view(View const& src, int n) {
        + +
        450}
        +
        451
        +
        455
        +
        456namespace detail {
        +
        457 template <int K, typename View, bool AreChannelsTogether> struct __kth_channel_view_basic;
        +
        458
        +
        459 // kth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
        +
        460 // or images with a step
        +
        461 template <int K, typename View>
        +
        462 struct __kth_channel_view_basic<K,View,false> {
        +
        463 private:
        +
        464 using channel_t = typename kth_element_type<typename View::value_type,K>::type;
        +
        465 public:
        +
        466 using type = typename view_type<channel_t, gray_layout_t, false, true, view_is_mutable<View>::value>::type;
        +
        467
        +
        468 static type make(View const& src) {
        +
        469 using locator_t = typename type::xy_locator;
        +
        470 using x_iterator_t = typename type::x_iterator;
        +
        471 using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t>::type;
        +
        472 x_iterator_t sit(x_iterator_base_t(&gil::at_c<K>(src(0,0))),src.pixels().pixel_size());
        +
        473 return type(src.dimensions(),locator_t(sit, src.pixels().row_size()));
        +
        474 }
        +
        475 };
        +
        476
        +
        477 // kth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
        +
        478 template <int K, typename View>
        +
        479 struct __kth_channel_view_basic<K,View,true> {
        +
        480 private:
        +
        481 using channel_t = typename kth_element_type<typename View::value_type, K>::type;
        +
        482 public:
        +
        483 using type = typename view_type<channel_t, gray_layout_t, false, false, view_is_mutable<View>::value>::type;
        +
        484 static type make(View const& src) {
        +
        485 using x_iterator_t = typename type::x_iterator;
        +
        486 return interleaved_view(src.width(),src.height(),(x_iterator_t)&gil::at_c<K>(src(0,0)), src.pixels().row_size());
        +
        487 }
        +
        488 };
        +
        489
        +
        490 template <int K, typename View, bool IsBasic> struct __kth_channel_view;
        +
        491
        +
        492 // For basic (memory-based) views dispatch to __kth_channel_view_basic
        +
        493 template <int K, typename View> struct __kth_channel_view<K,View,true>
        +
        494 {
        +
        495 private:
        +
        496 using src_x_iterator = typename View::x_iterator;
        +
        497
        +
        498 // Determines whether the channels of a given pixel iterator are adjacent in memory.
        +
        499 // Planar and grayscale iterators have channels adjacent in memory, whereas multi-channel interleaved and iterators with non-fundamental step do not.
        +
        500 static constexpr bool adjacent =
        +
        501 !iterator_is_step<src_x_iterator>::value &&
        +
        502 (is_planar<src_x_iterator>::value || num_channels<View>::value == 1);
        +
        503
        +
        504 public:
        +
        505 using type = typename __kth_channel_view_basic<K,View,adjacent>::type;
        +
        506
        +
        507 static type make(View const& src) {
        +
        508 return __kth_channel_view_basic<K,View,adjacent>::make(src);
        +
        509 }
        +
        510 };
        +
        511
        +
        518 template <int K, typename SrcP>
        +
        + +
        520 {
        +
        521 static constexpr bool is_mutable =
        + +
        523
        +
        524 private:
        +
        525 using src_pixel_t = typename std::remove_reference<SrcP>::type;
        +
        526 using channel_t = typename kth_element_type<src_pixel_t, K>::type;
        +
        527 using const_ref_t = typename src_pixel_t::const_reference;
        + +
        529
        +
        530 public:
        + +
        532 using value_type = typename pixel_value_type<channel_t,gray_layout_t>::type;
        + +
        534 using argument_type = SrcP;
        +
        535 using reference = mp11::mp_if_c<is_mutable, ref_t, value_type>;
        +
        536 using result_type = reference;
        +
        537
        + +
        539 template <typename P>
        + +
        541
        +
        542 result_type operator()(argument_type srcP) const {
        +
        543 return result_type(gil::at_c<K>(srcP));
        +
        544 }
        +
        545 };
        +
        +
        546
        +
        547 template <int K, typename View> struct __kth_channel_view<K,View,false> {
        +
        548 private:
        + +
        550 using AD = typename View::template add_deref<deref_t>;
        +
        551 public:
        +
        552 using type = typename AD::type;
        +
        553 static type make(View const& src) {
        +
        554 return AD::make(src, deref_t());
        +
        555 }
        +
        556 };
        +
        557} // namespace detail
        +
        558
        +
        565template <int K, typename View>
        +
        + +
        567private:
        +
        568 BOOST_GIL_CLASS_REQUIRE(View, boost::gil, ImageViewConcept)
        +
        569 using VB = detail::__kth_channel_view<K,View,view_is_basic<View>::value>;
        +
        570public:
        +
        571 using type = typename VB::type;
        +
        572 static type make(View const& src) { return VB::make(src); }
        +
        573};
        +
        +
        574
        +
        576template <int K, typename View>
        +
        577auto kth_channel_view(View const& src)
        +
        578 -> typename kth_channel_view_type<K,View>::type
        +
        579{
        + +
        581}
        +
        582
        +
        583} } // namespace boost::gil
        +
        584
        +
        585#endif
        +
        Function object that given a source pixel, returns it converted to a given color space and channel de...
        Definition image_view_factory.hpp:135
        +
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition image_view.hpp:54
        +
        2D point both axes of which have the same dimension typeModels: Point2DConcept
        Definition point.hpp:36
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        auto interleaved_view(std::size_t width, std::size_t height, Iterator pixels, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< Iterator >::view_t
        Constructing image views from raw interleaved pixel data.
        Definition image_view_factory.hpp:57
        +
        auto planar_view_get_raw_data(HomogeneousView const &view, int plane_index) -> typename detail::channel_pointer_type< HomogeneousView >::type
        Returns C pointer to the the channels of a given color plane of a planar homogeneous view.
        Definition image_view_factory.hpp:118
        +
        auto interleaved_view_get_raw_data(HomogeneousView const &view) -> typename detail::channel_pointer_type< HomogeneousView >::type
        Returns C pointer to the the channels of an interleaved homogeneous view.
        Definition image_view_factory.hpp:106
        +
        auto color_converted_view(View const &src, CC cc) -> typename color_converted_view_type< View, DstP, CC >::type
        view of a different color space with a user defined color-converter
        Definition image_view_factory.hpp:184
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        GIL's 2-dimensional view over immutable GIL pixels.
        Definition concepts/image_view.hpp:376
        +
        Pixel concept that allows for changing its channels.
        Definition concepts/pixel.hpp:102
        +
        Definition color_convert.hpp:31
        +
        Returns the type of a view that does color conversion upon dereferencing its pixels.
        Definition image_view_factory.hpp:176
        +
        class for color-converting one pixel to another
        Definition color_convert.hpp:328
        +
        Helper base class for pixel dereference adaptors.
        Definition utilities.hpp:107
        +
        Function object that returns a grayscale reference of the K-th channel (specified as a template param...
        Definition image_view_factory.hpp:520
        +
        Function object that returns a grayscale reference of the N-th channel of a given reference....
        Definition image_view_factory.hpp:390
        +
        Returns the type of a transposed view that has a dynamic step along both X and Y.
        Definition image_view_factory.hpp:52
        +
        Returns the type of a view that has a dynamic step along both X and Y.
        Definition image_view_factory.hpp:46
        +
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition dynamic_step.hpp:21
        +
        Given a source image view type View, returns the type of an image view over a given channel of View.
        Definition image_view_factory.hpp:566
        +
        Given a source image view type View, returns the type of an image view over a single channel of View.
        Definition image_view_factory.hpp:437
        +
        Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
        Definition metafunctions.hpp:218
        +
        Determines if the given pixel reference is mutable (i.e. its channels can be changed)
        Definition metafunctions.hpp:231
        +
        Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
        Definition metafunctions.hpp:267
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition pixel.hpp:106
        +
        Basic views must be over basic locators.
        Definition metafunctions.hpp:130
        diff --git a/html/reference/index.html b/html/reference/index.html index 816c3404d..c99eb90bd 100644 --- a/html/reference/index.html +++ b/html/reference/index.html @@ -4,7 +4,7 @@ - + Generic Image Library: API Reference @@ -27,20 +27,20 @@

        - + +/* @license-end */ +
        -
        -
        -
        API Reference
        +
        +
        API Reference

        @@ -129,7 +129,7 @@ Modules

        diff --git a/html/reference/io_2typedefs_8hpp_source.html b/html/reference/io_2typedefs_8hpp_source.html index 300eee0cb..ec042d0bf 100644 --- a/html/reference/io_2typedefs_8hpp_source.html +++ b/html/reference/io_2typedefs_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: typedefs.hpp Source File @@ -27,116 +27,121 @@

        - + +/* @license-end */ + +
        -
        -
        io/typedefs.hpp
        +
        io/typedefs.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_TYPEDEFS_HPP
        -
        9 #define BOOST_GIL_IO_TYPEDEFS_HPP
        -
        10 
        -
        11 #ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        -
        12 #include <boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp>
        -
        13 #endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        -
        14 
        -
        15 #include <boost/gil/image.hpp>
        -
        16 #include <boost/gil/point.hpp>
        -
        17 #include <boost/gil/utilities.hpp>
        -
        18 
        -
        19 #include <type_traits>
        -
        20 #include <vector>
        -
        21 
        -
        22 namespace boost { namespace gil {
        -
        23 
        -
        24 struct double_zero { static double apply() { return 0.0; } };
        -
        25 struct double_one { static double apply() { return 1.0; } };
        -
        26 
        -
        27 using byte_t = unsigned char;
        -
        28 using byte_vector_t = std::vector<byte_t>;
        -
        29 
        -
        30 }} // namespace boost::gil
        -
        31 
        -
        32 namespace boost {
        -
        33 
        -
        34 template<> struct is_floating_point<gil::float32_t> : std::true_type {};
        -
        35 template<> struct is_floating_point<gil::float64_t> : std::true_type {};
        -
        36 
        -
        37 } // namespace boost
        -
        38 
        -
        39 namespace boost { namespace gil {
        -
        40 
        -
        43 
        -
        44 using gray1_image_t = bit_aligned_image1_type<1, gray_layout_t>::type;
        -
        45 using gray2_image_t = bit_aligned_image1_type<2, gray_layout_t>::type;
        -
        46 using gray4_image_t = bit_aligned_image1_type<4, gray_layout_t>::type;
        -
        47 using gray6_image_t = bit_aligned_image1_type<6, gray_layout_t>::type;
        -
        48 using gray10_image_t = bit_aligned_image1_type<10, gray_layout_t>::type;
        -
        49 using gray12_image_t = bit_aligned_image1_type<12, gray_layout_t>::type;
        -
        50 using gray14_image_t = bit_aligned_image1_type<14, gray_layout_t>::type;
        -
        51 using gray24_image_t = bit_aligned_image1_type<24, gray_layout_t>::type;
        -
        52 
        -
        53 using gray64f_pixel_t = pixel<double, gray_layout_t>;
        -
        54 
        -
        55 #ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        -
        56 using gray_alpha8_pixel_t = pixel<uint8_t, gray_alpha_layout_t>;
        -
        57 using gray_alpha16_pixel_t = pixel<uint16_t, gray_alpha_layout_t>;
        -
        58 using gray_alpha64f_pixel_t = pixel<double, gray_alpha_layout_t>;
        -
        59 #endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        -
        60 
        -
        61 using rgb64f_pixel_t = pixel<double, rgb_layout_t>;
        -
        62 using rgba64f_pixel_t = pixel<double, rgba_layout_t>;
        -
        63 using gray64f_image_t = image<gray64f_pixel_t, false>;
        -
        64 
        -
        65 #ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        -
        66 using gray_alpha8_image_t = image<gray_alpha8_pixel_t, false>;
        -
        67 using gray_alpha16_image_t = image<gray_alpha16_pixel_t, false>;
        -
        68 using gray_alpha32f_image_t = image<gray_alpha32f_pixel_t, false>;
        -
        69 using gray_alpha32f_planar_image_t = image<gray_alpha32f_pixel_t, true>;
        -
        70 using gray_alpha64f_image_t = image<gray_alpha64f_pixel_t, false>;
        -
        71 using gray_alpha64f_planar_image_t = image<gray_alpha64f_pixel_t, true>;
        -
        72 
        -
        73 #endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        -
        74 
        -
        75 using rgb64f_image_t = image<rgb64f_pixel_t, false>;
        -
        76 using rgb64f_planar_image_t = image<rgb64f_pixel_t, true>;
        -
        77 using rgba64f_image_t = image<rgba64f_pixel_t, false>;
        -
        78 using rgba64f_planar_image_t = image<rgba64f_pixel_t, true>;
        -
        79 
        -
        80 }} // namespace boost::gil
        -
        81 
        -
        82 #endif
        -
        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
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_TYPEDEFS_HPP
        +
        9#define BOOST_GIL_IO_TYPEDEFS_HPP
        +
        10
        +
        11#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        +
        12#include <boost/gil/extension/toolbox/color_spaces/gray_alpha.hpp>
        +
        13#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        +
        14
        +
        15#include <boost/gil/image.hpp>
        +
        16#include <boost/gil/point.hpp>
        +
        17#include <boost/gil/utilities.hpp>
        +
        18
        +
        19#include <type_traits>
        +
        20#include <vector>
        +
        21
        +
        22namespace boost { namespace gil {
        +
        23
        +
        24struct double_zero { static double apply() { return 0.0; } };
        +
        25struct double_one { static double apply() { return 1.0; } };
        +
        26
        +
        27using byte_t = unsigned char;
        +
        28using byte_vector_t = std::vector<byte_t>;
        +
        29
        +
        30}} // namespace boost::gil
        +
        31
        +
        32namespace boost {
        +
        33
        +
        34template<> struct is_floating_point<gil::float32_t> : std::true_type {};
        +
        35template<> struct is_floating_point<gil::float64_t> : std::true_type {};
        +
        36
        +
        37} // namespace boost
        +
        38
        +
        39namespace boost { namespace gil {
        +
        40
        +
        43
        +
        44using gray1_image_t = bit_aligned_image1_type<1, gray_layout_t>::type;
        +
        45using gray2_image_t = bit_aligned_image1_type<2, gray_layout_t>::type;
        +
        46using gray4_image_t = bit_aligned_image1_type<4, gray_layout_t>::type;
        +
        47using gray6_image_t = bit_aligned_image1_type<6, gray_layout_t>::type;
        +
        48using gray10_image_t = bit_aligned_image1_type<10, gray_layout_t>::type;
        +
        49using gray12_image_t = bit_aligned_image1_type<12, gray_layout_t>::type;
        +
        50using gray14_image_t = bit_aligned_image1_type<14, gray_layout_t>::type;
        +
        51using gray24_image_t = bit_aligned_image1_type<24, gray_layout_t>::type;
        +
        52
        +
        53using gray64f_pixel_t = pixel<double, gray_layout_t>;
        +
        54
        +
        55#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        +
        56using gray_alpha8_pixel_t = pixel<uint8_t, gray_alpha_layout_t>;
        +
        57using gray_alpha16_pixel_t = pixel<uint16_t, gray_alpha_layout_t>;
        +
        58using gray_alpha64f_pixel_t = pixel<double, gray_alpha_layout_t>;
        +
        59#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        +
        60
        +
        61using rgb64f_pixel_t = pixel<double, rgb_layout_t>;
        +
        62using rgba64f_pixel_t = pixel<double, rgba_layout_t>;
        +
        63using gray64f_image_t = image<gray64f_pixel_t, false>;
        +
        64
        +
        65#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        +
        66using gray_alpha8_image_t = image<gray_alpha8_pixel_t, false>;
        +
        67using gray_alpha16_image_t = image<gray_alpha16_pixel_t, false>;
        +
        68using gray_alpha32f_image_t = image<gray_alpha32f_pixel_t, false>;
        +
        69using gray_alpha32f_planar_image_t = image<gray_alpha32f_pixel_t, true>;
        +
        70using gray_alpha64f_image_t = image<gray_alpha64f_pixel_t, false>;
        +
        71using gray_alpha64f_planar_image_t = image<gray_alpha64f_pixel_t, true>;
        +
        72
        +
        73#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA
        +
        74
        +
        75using rgb64f_image_t = image<rgb64f_pixel_t, false>;
        +
        76using rgb64f_planar_image_t = image<rgb64f_pixel_t, true>;
        +
        77using rgba64f_image_t = image<rgba64f_pixel_t, false>;
        +
        78using rgba64f_planar_image_t = image<rgba64f_pixel_t, true>;
        +
        79
        +
        80}} // namespace boost::gil
        +
        81
        +
        82#endif
        +
        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
        diff --git a/html/reference/io_8hpp_source.html b/html/reference/io_8hpp_source.html index 97cadc89a..06114fd3e 100644 --- a/html/reference/io_8hpp_source.html +++ b/html/reference/io_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: io.hpp Source File @@ -27,44 +27,49 @@

        - + +/* @license-end */ + +
        -
        -
        io.hpp
        +
        io.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning, Andreas Pokorny
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_IO_HPP
        -
        9 #define BOOST_GIL_IO_IO_HPP
        -
        10 
        -
        95 #endif
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning, Andreas Pokorny
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_IO_HPP
        +
        9#define BOOST_GIL_IO_IO_HPP
        +
        10
        +
        95#endif
        diff --git a/html/reference/iobackend.html b/html/reference/iobackend.html index 4cb3ac8b1..7d6d724a3 100644 --- a/html/reference/iobackend.html +++ b/html/reference/iobackend.html @@ -4,7 +4,7 @@ - + Generic Image Library: Adding a new io backend @@ -27,20 +27,20 @@

        - + +/* @license-end */ +
        -
        -
        -
        Adding a new io backend
        +
        +
        Adding a new io backend

        @@ -57,14 +57,14 @@ of backend requirements

        reader( IODevice & device, typename ConversionPolicy::color_converter_type const& cc )
        image_read_info<FormatTag> get_info();
        template<typename Image>
        -
        void read_image( Image &, point_t const& top_left );
        +
        void read_image( Image &, point_t const& top_left );
        template<typename View>
        -
        void read_view( View &, point_t const& top_left );
        +
        void read_view( View &, point_t const& top_left );
        };
        -
        void read_view(Reader reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, typename is_format_tag< typename Reader::format_tag_t >::type, typename is_read_supported< typename get_pixel_type< View >::type, typename Reader::format_tag_t >::type >::value >::type *=nullptr)
        Reads an image view without conversion. No memory is allocated.
        Definition: read_view.hpp:31
        -
        void read_image(Reader reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t >, is_read_supported< typename get_pixel_type< typename Image::view_t >::type, typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads an image without conversion. Image memory is allocated.
        Definition: read_image.hpp:32
        +
        void read_image(Reader reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t >, is_read_supported< typename get_pixel_type< typename Image::view_t >::type, typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads an image without conversion. Image memory is allocated.
        Definition read_image.hpp:32
        +
        void read_view(Reader reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, typename is_format_tag< typename Reader::format_tag_t >::type, typename is_read_supported< typename get_pixel_type< View >::type, typename Reader::format_tag_t >::type >::value >::type *=nullptr)
        Reads an image view without conversion. No memory is allocated.
        Definition read_view.hpp:31
        -
      16. An image writer must be specialized:
        \template <typename IODevice>
        +
      17. An image writer must be specialized:
        \template <typename IODevice>
        struct boost::gil::writer<IODevice,FormatTag>
        {
        writer( IODevice & device )
        @@ -88,19 +88,19 @@ Interface of the ConversionPolicy

        Methods like read_view and read_image are supposed to bail out with an exception instead of converting the image

        Concept of IO Device

        -

        A Device is simply an object used to read and write data to and from a stream. The IODevice was added as a template paramter to be able to replace the file_name access functionality. This is only an interim solution, as soon as boost provides a good IO library, interfaces/constraints provided by that library could be used.

        -
        concept IODevice
        +

        A Device is simply an object used to read and write data to and from a stream. The IODevice was added as a template parameter to be able to replace the file_name access functionality. This is only an interim solution, as soon as boost provides a good IO library, interfaces/constraints provided by that library could be used.

        +
        concept IODevice
        {
        -
        void IODevice::read( unsigned char* data, int count );
        -
        void IODevice::write( unsigned char* data, int count );
        -
        void IODevice::seek(long count, int whence);
        -
        void IODevice::flush();
        +
        void IODevice::read( unsigned char* data, int count );
        +
        void IODevice::write( unsigned char* data, int count );
        +
        void IODevice::seek(long count, int whence);
        +
        void IODevice::flush();
        };
        -

        For the time being a boolean meta function must be specialized:

        namespace boost{namespace gil{namespace detail{
        +

        For the time being a boolean meta function must be specialized:

        namespace boost{namespace gil{namespace detail{
        template<typename Device>
        struct detail::is_input_device;
        }}}
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
      18. @@ -108,7 +108,7 @@ Concept of IO Device diff --git a/html/reference/iterator__from__2d_8hpp_source.html b/html/reference/iterator__from__2d_8hpp_source.html index 27767b8eb..8f17ff733 100644 --- a/html/reference/iterator__from__2d_8hpp_source.html +++ b/html/reference/iterator__from__2d_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: iterator_from_2d.hpp Source File @@ -27,185 +27,191 @@

        - + +/* @license-end */ + +
        -
        -
        iterator_from_2d.hpp
        +
        iterator_from_2d.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_ITERATOR_FROM_2D_HPP
        -
        9 #define BOOST_GIL_ITERATOR_FROM_2D_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts.hpp>
        -
        12 #include <boost/gil/locator.hpp>
        -
        13 #include <boost/gil/pixel_iterator.hpp>
        -
        14 #include <boost/gil/point.hpp>
        -
        15 
        -
        16 #include <boost/assert.hpp>
        -
        17 #include <boost/iterator/iterator_facade.hpp>
        -
        18 
        -
        19 namespace boost { namespace gil {
        -
        20 
        -
        22 
        -
        28 
        -
        29 
        -
        33 
        -
        34 
        -
        40 
        -
        41 template <typename Loc2> // Models PixelLocatorConcept
        -
        42 class iterator_from_2d : public iterator_facade<iterator_from_2d<Loc2>,
        -
        43  typename Loc2::value_type,
        -
        44  std::random_access_iterator_tag,
        -
        45  typename Loc2::reference,
        -
        46  typename Loc2::coord_t> {
        -
        47  BOOST_GIL_CLASS_REQUIRE(Loc2, boost::gil, PixelLocatorConcept)
        -
        48 public:
        -
        49  using parent_t = iterator_facade<iterator_from_2d<Loc2>,
        -
        50  typename Loc2::value_type,
        -
        51  std::random_access_iterator_tag,
        -
        52  typename Loc2::reference,
        -
        53  typename Loc2::coord_t>;
        -
        54  using reference = typename parent_t::reference;
        -
        55  using difference_type = typename parent_t::difference_type;
        -
        56  using x_iterator = typename Loc2::x_iterator;
        -
        57  using point_t = typename Loc2::point_t;
        -
        58 
        -
        59  std::ptrdiff_t width() const { return _width; } // number of pixels per image row
        -
        60  std::ptrdiff_t x_pos() const { return _coords.x; } // current x position
        -
        61  std::ptrdiff_t y_pos() const { return _coords.y; } // current y position
        -
        62 
        -
        65  reference operator[](difference_type d) const { return *(*this+d); }
        -
        66 
        -
        67  bool is_1d_traversable() const { return _p.is_1d_traversable(width()); } // is there no gap at the end of each row?
        -
        68  x_iterator& x() { return _p.x(); }
        -
        69 
        -
        70  iterator_from_2d() = default;
        -
        71  iterator_from_2d(const Loc2& p, std::ptrdiff_t width, std::ptrdiff_t x=0, std::ptrdiff_t y=0) : _coords(x,y), _width(width), _p(p) {}
        -
        72  iterator_from_2d(const iterator_from_2d& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {}
        -
        73  template <typename Loc> iterator_from_2d(const iterator_from_2d<Loc>& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {}
        -
        74  iterator_from_2d& operator=(iterator_from_2d const& other) = default;
        -
        75 
        -
        76 private:
        -
        77  template <typename Loc> friend class iterator_from_2d;
        -
        78  friend class boost::iterator_core_access;
        -
        79  reference dereference() const { return *_p; }
        -
        80  void increment() {
        -
        81  ++_coords.x;
        -
        82  ++_p.x();
        -
        83  if (_coords.x>=_width) {
        -
        84  _coords.x=0;
        -
        85  ++_coords.y;
        -
        86  _p+=point_t(-_width,1);
        -
        87  }
        -
        88  }
        -
        89  void decrement() {
        -
        90  --_coords.x;
        -
        91  --_p.x();
        -
        92  if (_coords.x<0) {
        -
        93  _coords.x=_width-1;
        -
        94  --_coords.y;
        -
        95  _p+=point_t(_width,-1);
        -
        96  }
        -
        97  }
        -
        98 
        -
        99  BOOST_FORCEINLINE void advance(difference_type d) {
        -
        100  if (_width==0) return; // unfortunately we need to check for that. Default-constructed images have width of 0 and the code below will throw if executed.
        -
        101  point_t delta;
        -
        102  if (_coords.x+d>=0) { // not going back to a previous row?
        -
        103  delta.x=(_coords.x+(std::ptrdiff_t)d)%_width - _coords.x;
        -
        104  delta.y=(_coords.x+(std::ptrdiff_t)d)/_width;
        -
        105  } else {
        -
        106  delta.x=(_coords.x+(std::ptrdiff_t)d*(1-_width))%_width -_coords.x;
        -
        107  delta.y=-(_width-_coords.x-(std::ptrdiff_t)d-1)/_width;
        -
        108  }
        -
        109  _p+=delta;
        -
        110  _coords.x+=delta.x;
        -
        111  _coords.y+=delta.y;
        -
        112  }
        -
        113 
        -
        114  difference_type distance_to(const iterator_from_2d& it) const {
        -
        115  if (_width==0) return 0;
        -
        116  return (it.y_pos()-_coords.y)*_width + (it.x_pos()-_coords.x);
        -
        117  }
        -
        118 
        -
        119  bool equal(iterator_from_2d const& it) const
        -
        120  {
        -
        121  BOOST_ASSERT(_width == it.width()); // they must belong to the same image
        -
        122  return _coords == it._coords && _p == it._p;
        -
        123  }
        -
        124 
        -
        125  point_t _coords;
        -
        126  std::ptrdiff_t _width;
        -
        127  Loc2 _p;
        -
        128 };
        -
        129 
        -
        130 template <typename Loc> // Models PixelLocatorConcept
        -
        131 struct const_iterator_type<iterator_from_2d<Loc> > {
        -
        132  using type = iterator_from_2d<typename Loc::const_t>;
        -
        133 };
        -
        134 
        -
        135 template <typename Loc> // Models PixelLocatorConcept
        -
        136 struct iterator_is_mutable<iterator_from_2d<Loc> > : public iterator_is_mutable<typename Loc::x_iterator> {};
        -
        137 
        -
        138 
        -
        140 // HasDynamicXStepTypeConcept
        -
        142 
        -
        143 template <typename Loc>
        -
        144 struct dynamic_x_step_type<iterator_from_2d<Loc> > {
        -
        145  using type = iterator_from_2d<typename dynamic_x_step_type<Loc>::type>;
        -
        146 };
        -
        147 
        -
        148 
        -
        150 // PixelBasedConcept
        -
        152 
        -
        153 template <typename Loc> // Models PixelLocatorConcept
        -
        154 struct color_space_type<iterator_from_2d<Loc> > : public color_space_type<Loc> {};
        -
        155 
        -
        156 template <typename Loc> // Models PixelLocatorConcept
        -
        157 struct channel_mapping_type<iterator_from_2d<Loc> > : public channel_mapping_type<Loc> {};
        -
        158 
        -
        159 template <typename Loc> // Models PixelLocatorConcept
        -
        160 struct is_planar<iterator_from_2d<Loc> > : public is_planar<Loc> {};
        -
        161 
        -
        162 template <typename Loc> // Models PixelLocatorConcept
        -
        163 struct channel_type<iterator_from_2d<Loc> > : public channel_type<Loc> {};
        -
        164 
        -
        165 } } // namespace boost::gil
        -
        166 
        -
        167 #endif
        -
        Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
        Definition: iterator_from_2d.hpp:46
        -
        reference operator[](difference_type d) const
        Definition: iterator_from_2d.hpp:65
        -
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition: algorithm.hpp:1087
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        GIL's 2-dimensional locator over immutable GIL pixels.
        Definition: pixel_locator.hpp:292
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_ITERATOR_FROM_2D_HPP
        +
        9#define BOOST_GIL_ITERATOR_FROM_2D_HPP
        +
        10
        +
        11#include <boost/gil/concepts.hpp>
        +
        12#include <boost/gil/locator.hpp>
        +
        13#include <boost/gil/pixel_iterator.hpp>
        +
        14#include <boost/gil/point.hpp>
        +
        15
        +
        16#include <boost/assert.hpp>
        +
        17#include <boost/iterator/iterator_facade.hpp>
        +
        18
        +
        19namespace boost { namespace gil {
        +
        20
        +
        22
        +
        28
        +
        29
        +
        33
        +
        34
        +
        40
        +
        41template <typename Loc2> // Models PixelLocatorConcept
        +
        +
        42class iterator_from_2d : public iterator_facade<iterator_from_2d<Loc2>,
        +
        43 typename Loc2::value_type,
        +
        44 std::random_access_iterator_tag,
        +
        45 typename Loc2::reference,
        +
        46 typename Loc2::coord_t> {
        +
        47 BOOST_GIL_CLASS_REQUIRE(Loc2, boost::gil, PixelLocatorConcept)
        +
        48public:
        +
        49 using parent_t = iterator_facade<iterator_from_2d<Loc2>,
        +
        50 typename Loc2::value_type,
        +
        51 std::random_access_iterator_tag,
        +
        52 typename Loc2::reference,
        +
        53 typename Loc2::coord_t>;
        +
        54 using reference = typename parent_t::reference;
        +
        55 using difference_type = typename parent_t::difference_type;
        +
        56 using x_iterator = typename Loc2::x_iterator;
        +
        57 using point_t = typename Loc2::point_t;
        +
        58
        +
        59 std::ptrdiff_t width() const { return _width; } // number of pixels per image row
        +
        60 std::ptrdiff_t x_pos() const { return _coords.x; } // current x position
        +
        61 std::ptrdiff_t y_pos() const { return _coords.y; } // current y position
        +
        62
        +
        65 reference operator[](difference_type d) const { return *(*this+d); }
        +
        66
        +
        67 bool is_1d_traversable() const { return _p.is_1d_traversable(width()); } // is there no gap at the end of each row?
        +
        68 x_iterator& x() { return _p.x(); }
        +
        69
        +
        70 iterator_from_2d() = default;
        +
        71 iterator_from_2d(const Loc2& p, std::ptrdiff_t width, std::ptrdiff_t x=0, std::ptrdiff_t y=0) : _coords(x,y), _width(width), _p(p) {}
        +
        72 iterator_from_2d(const iterator_from_2d& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {}
        +
        73 template <typename Loc> iterator_from_2d(const iterator_from_2d<Loc>& pit) : _coords(pit._coords), _width(pit._width), _p(pit._p) {}
        +
        74 iterator_from_2d& operator=(iterator_from_2d const& other) = default;
        +
        75
        +
        76private:
        +
        77 template <typename Loc> friend class iterator_from_2d;
        +
        78 friend class boost::iterator_core_access;
        +
        79 reference dereference() const { return *_p; }
        +
        80 void increment() {
        +
        81 ++_coords.x;
        +
        82 ++_p.x();
        +
        83 if (_coords.x>=_width) {
        +
        84 _coords.x=0;
        +
        85 ++_coords.y;
        +
        86 _p+=point_t(-_width,1);
        +
        87 }
        +
        88 }
        +
        89 void decrement() {
        +
        90 --_coords.x;
        +
        91 --_p.x();
        +
        92 if (_coords.x<0) {
        +
        93 _coords.x=_width-1;
        +
        94 --_coords.y;
        +
        95 _p+=point_t(_width,-1);
        +
        96 }
        +
        97 }
        +
        98
        +
        99 BOOST_FORCEINLINE void advance(difference_type d) {
        +
        100 if (_width==0) return; // unfortunately we need to check for that. Default-constructed images have width of 0 and the code below will throw if executed.
        +
        101 point_t delta;
        +
        102 if (_coords.x+d>=0) { // not going back to a previous row?
        +
        103 delta.x=(_coords.x+(std::ptrdiff_t)d)%_width - _coords.x;
        +
        104 delta.y=(_coords.x+(std::ptrdiff_t)d)/_width;
        +
        105 } else {
        +
        106 delta.x=(_coords.x+(std::ptrdiff_t)d*(1-_width))%_width -_coords.x;
        +
        107 delta.y=-(_width-_coords.x-(std::ptrdiff_t)d-1)/_width;
        +
        108 }
        +
        109 _p+=delta;
        +
        110 _coords.x+=delta.x;
        +
        111 _coords.y+=delta.y;
        +
        112 }
        +
        113
        +
        114 difference_type distance_to(const iterator_from_2d& it) const {
        +
        115 if (_width==0) return 0;
        +
        116 return (it.y_pos()-_coords.y)*_width + (it.x_pos()-_coords.x);
        +
        117 }
        +
        118
        +
        119 bool equal(iterator_from_2d const& it) const
        +
        120 {
        +
        121 BOOST_ASSERT(_width == it.width()); // they must belong to the same image
        +
        122 return _coords == it._coords && _p == it._p;
        +
        123 }
        +
        124
        +
        125 point_t _coords;
        +
        126 std::ptrdiff_t _width;
        +
        127 Loc2 _p;
        +
        128};
        +
        +
        129
        +
        130template <typename Loc> // Models PixelLocatorConcept
        +
        131struct const_iterator_type<iterator_from_2d<Loc> > {
        +
        132 using type = iterator_from_2d<typename Loc::const_t>;
        +
        133};
        +
        134
        +
        135template <typename Loc> // Models PixelLocatorConcept
        +
        136struct iterator_is_mutable<iterator_from_2d<Loc> > : public iterator_is_mutable<typename Loc::x_iterator> {};
        +
        137
        +
        138
        +
        140// HasDynamicXStepTypeConcept
        +
        142
        +
        143template <typename Loc>
        +
        144struct dynamic_x_step_type<iterator_from_2d<Loc> > {
        +
        145 using type = iterator_from_2d<typename dynamic_x_step_type<Loc>::type>;
        +
        146};
        +
        147
        +
        148
        +
        150// PixelBasedConcept
        +
        152
        +
        153template <typename Loc> // Models PixelLocatorConcept
        +
        154struct color_space_type<iterator_from_2d<Loc> > : public color_space_type<Loc> {};
        +
        155
        +
        156template <typename Loc> // Models PixelLocatorConcept
        +
        157struct channel_mapping_type<iterator_from_2d<Loc> > : public channel_mapping_type<Loc> {};
        +
        158
        +
        159template <typename Loc> // Models PixelLocatorConcept
        +
        160struct is_planar<iterator_from_2d<Loc> > : public is_planar<Loc> {};
        +
        161
        +
        162template <typename Loc> // Models PixelLocatorConcept
        +
        163struct channel_type<iterator_from_2d<Loc> > : public channel_type<Loc> {};
        +
        164
        +
        165} } // namespace boost::gil
        +
        166
        +
        167#endif
        +
        Provides 1D random-access navigation to the pixels of the image. Models: PixelIteratorConcept,...
        Definition iterator_from_2d.hpp:46
        +
        reference operator[](difference_type d) const
        Definition iterator_from_2d.hpp:65
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        GIL's 2-dimensional locator over immutable GIL pixels.
        Definition pixel_locator.hpp:292
        diff --git a/html/reference/jpeg_8hpp_source.html b/html/reference/jpeg_8hpp_source.html index c8872eaa6..e016dd90a 100644 --- a/html/reference/jpeg_8hpp_source.html +++ b/html/reference/jpeg_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: jpeg.hpp Source File @@ -27,47 +27,52 @@

        - + +/* @license-end */ + +
        -
        -
        jpeg.hpp
        +
        jpeg.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_IO_JPEG_HPP
        -
        9 #define BOOST_GIL_EXTENSION_IO_JPEG_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/io/jpeg/read.hpp>
        -
        12 #include <boost/gil/extension/io/jpeg/write.hpp>
        -
        13 
        -
        14 #endif
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_IO_JPEG_HPP
        +
        9#define BOOST_GIL_EXTENSION_IO_JPEG_HPP
        +
        10
        +
        11#include <boost/gil/extension/io/jpeg/read.hpp>
        +
        12#include <boost/gil/extension/io/jpeg/write.hpp>
        +
        13
        +
        14#endif
        diff --git a/html/reference/jquery.js b/html/reference/jquery.js index 103c32d79..1dffb65b5 100644 --- a/html/reference/jquery.js +++ b/html/reference/jquery.js @@ -1,12 +1,11 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
        "],col:[2,"","
        "],tr:[2,"","
        "],td:[3,"","
        "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
        ",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
        "],col:[2,"","
        "],tr:[2,"","
        "],td:[3,"","
        "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
        ",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):h=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
        ",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
        "),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
        ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("
        "),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
        "),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element -},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),m&&(p-=l),g&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable});/** +!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(y){"use strict";y.ui=y.ui||{};y.ui.version="1.13.2";var n,i=0,h=Array.prototype.hasOwnProperty,a=Array.prototype.slice;y.cleanData=(n=y.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=y._data(i,"events"))&&e.remove&&y(i).triggerHandler("remove");n(t)}),y.widget=function(t,i,e){var s,n,o,h={},a=t.split(".")[0],r=a+"-"+(t=t.split(".")[1]);return e||(e=i,i=y.Widget),Array.isArray(e)&&(e=y.extend.apply(null,[{}].concat(e))),y.expr.pseudos[r.toLowerCase()]=function(t){return!!y.data(t,r)},y[a]=y[a]||{},s=y[a][t],n=y[a][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},y.extend(n,s,{version:e.version,_proto:y.extend({},e),_childConstructors:[]}),(o=new i).options=y.widget.extend({},o.options),y.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}h[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=y.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},h,{constructor:n,namespace:a,widgetName:t,widgetFullName:r}),s?(y.each(s._childConstructors,function(t,e){var i=e.prototype;y.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),y.widget.bridge(t,n),n},y.widget.extend=function(t){for(var e,i,s=a.call(arguments,1),n=0,o=s.length;n",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=y.widget.extend({},this.options[t]),n=0;n
        "),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n
        ").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e
        ").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0 - + Generic Image Library: kernel.hpp Source File @@ -27,392 +27,407 @@

        - + +/* @license-end */ + +
        -
        -
        kernel.hpp
        +
        kernel.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2019 Miral Shah <miralshah2211@gmail.com>
        -
        4 // Copyright 2022 Pranam Lashkari <plashkari628@gmail.com>
        -
        5 //
        -
        6 // Distributed under the Boost Software License, Version 1.0
        -
        7 // See accompanying file LICENSE_1_0.txt or copy at
        -
        8 // http://www.boost.org/LICENSE_1_0.txt
        -
        9 //
        -
        10 
        -
        11 #ifndef BOOST_GIL_IMAGE_PROCESSING_KERNEL_HPP
        -
        12 #define BOOST_GIL_IMAGE_PROCESSING_KERNEL_HPP
        -
        13 
        -
        14 #include <boost/gil/utilities.hpp>
        -
        15 #include <boost/gil/point.hpp>
        -
        16 
        -
        17 #include <boost/assert.hpp>
        -
        18 
        -
        19 #include <algorithm>
        -
        20 #include <array>
        -
        21 #include <cstddef>
        -
        22 #include <memory>
        -
        23 #include <vector>
        -
        24 #include <cmath>
        -
        25 #include <stdexcept>
        -
        26 
        -
        27 namespace boost { namespace gil {
        -
        28 
        -
        29 // Definitions of 1D fixed-size and variable-size kernels and related operations
        -
        30 
        -
        31 namespace detail {
        -
        32 
        -
        36 template <typename Core>
        -
        37 class kernel_1d_adaptor : public Core
        -
        38 {
        -
        39 public:
        -
        40  kernel_1d_adaptor() = default;
        -
        41 
        -
        42  explicit kernel_1d_adaptor(std::size_t center)
        -
        43  : center_(center)
        -
        44  {
        -
        45  BOOST_ASSERT(center_ < this->size());
        -
        46  }
        -
        47 
        -
        48  kernel_1d_adaptor(std::size_t size, std::size_t center)
        -
        49  : Core(size) , center_(center)
        -
        50  {
        -
        51  BOOST_ASSERT(this->size() > 0);
        -
        52  BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0`
        -
        53  }
        -
        54 
        - -
        56  : Core(other), center_(other.center_)
        -
        57  {
        -
        58  BOOST_ASSERT(this->size() > 0);
        -
        59  BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0`
        -
        60  }
        -
        61 
        -
        62  kernel_1d_adaptor& operator=(kernel_1d_adaptor const& other)
        -
        63  {
        -
        64  Core::operator=(other);
        -
        65  center_ = other.center_;
        -
        66  return *this;
        -
        67  }
        -
        68 
        -
        69  std::size_t left_size() const
        -
        70  {
        -
        71  BOOST_ASSERT(center_ < this->size());
        -
        72  return center_;
        -
        73  }
        -
        74 
        -
        75  std::size_t right_size() const
        -
        76  {
        -
        77  BOOST_ASSERT(center_ < this->size());
        -
        78  return this->size() - center_ - 1;
        -
        79  }
        -
        80 
        -
        81  auto center() -> std::size_t&
        -
        82  {
        -
        83  BOOST_ASSERT(center_ < this->size());
        -
        84  return center_;
        -
        85  }
        -
        86 
        -
        87  auto center() const -> std::size_t const&
        -
        88  {
        -
        89  BOOST_ASSERT(center_ < this->size());
        -
        90  return center_;
        -
        91  }
        -
        92 
        -
        93 private:
        -
        94  std::size_t center_{0};
        -
        95 };
        -
        96 
        -
        97 } // namespace detail
        -
        98 
        -
        100 template <typename T, typename Allocator = std::allocator<T> >
        -
        101 class kernel_1d : public detail::kernel_1d_adaptor<std::vector<T, Allocator>>
        -
        102 {
        - -
        104 public:
        -
        105 
        -
        106  kernel_1d() = default;
        -
        107  kernel_1d(std::size_t size, std::size_t center) : parent_t(size, center) {}
        -
        108 
        -
        109  template <typename FwdIterator>
        -
        110  kernel_1d(FwdIterator elements, std::size_t size, std::size_t center)
        -
        111  : parent_t(size, center)
        -
        112  {
        -
        113  detail::copy_n(elements, size, this->begin());
        -
        114  }
        -
        115 
        -
        116  kernel_1d(kernel_1d const& other) : parent_t(other) {}
        -
        117  kernel_1d& operator=(kernel_1d const& other) = default;
        -
        118 };
        -
        119 
        -
        121 template <typename T,std::size_t Size>
        -
        122 class kernel_1d_fixed : public detail::kernel_1d_adaptor<std::array<T, Size>>
        -
        123 {
        - -
        125 public:
        -
        126  static constexpr std::size_t static_size = Size;
        -
        127  static_assert(static_size > 0, "kernel must have size greater than 0");
        -
        128  static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center");
        -
        129 
        -
        130  kernel_1d_fixed() = default;
        -
        131  explicit kernel_1d_fixed(std::size_t center) : parent_t(center) {}
        -
        132 
        -
        133  template <typename FwdIterator>
        -
        134  explicit kernel_1d_fixed(FwdIterator elements, std::size_t center)
        -
        135  : parent_t(center)
        -
        136  {
        -
        137  detail::copy_n(elements, Size, this->begin());
        -
        138  }
        -
        139 
        -
        140  kernel_1d_fixed(kernel_1d_fixed const& other) : parent_t(other) {}
        -
        141  kernel_1d_fixed& operator=(kernel_1d_fixed const& other) = default;
        -
        142 };
        -
        143 
        -
        144 // TODO: This data member is odr-used and definition at namespace scope
        -
        145 // is required by C++11. Redundant and deprecated in C++17.
        -
        146 template <typename T,std::size_t Size>
        -
        147 constexpr std::size_t kernel_1d_fixed<T, Size>::static_size;
        -
        148 
        -
        150 template <typename Kernel>
        -
        151 inline Kernel reverse_kernel(Kernel const& kernel)
        -
        152 {
        -
        153  Kernel result(kernel);
        -
        154  result.center() = kernel.right_size();
        -
        155  std::reverse(result.begin(), result.end());
        -
        156  return result;
        -
        157 }
        -
        158 
        -
        159 
        -
        160 namespace detail {
        -
        161 
        -
        162 template <typename Core>
        -
        163 class kernel_2d_adaptor : public Core
        -
        164 {
        -
        165 public:
        -
        166  kernel_2d_adaptor() = default;
        -
        167 
        -
        168  explicit kernel_2d_adaptor(std::size_t center_y, std::size_t center_x)
        -
        169  : center_(center_x, center_y)
        -
        170  {
        -
        171  BOOST_ASSERT(center_.y < this->size() && center_.x < this->size());
        -
        172  }
        -
        173 
        -
        174  kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x)
        -
        175  : Core(size * size), square_size(size), center_(center_x, center_y)
        -
        176  {
        -
        177  BOOST_ASSERT(this->size() > 0);
        -
        178  BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0`
        -
        179  }
        -
        180 
        -
        181  kernel_2d_adaptor(kernel_2d_adaptor const& other)
        -
        182  : Core(other), square_size(other.square_size), center_(other.center_.x, other.center_.y)
        -
        183  {
        -
        184  BOOST_ASSERT(this->size() > 0);
        -
        185  BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0`
        -
        186  }
        -
        187 
        -
        188  kernel_2d_adaptor& operator=(kernel_2d_adaptor const& other)
        -
        189  {
        -
        190  Core::operator=(other);
        -
        191  center_.y = other.center_.y;
        -
        192  center_.x = other.center_.x;
        -
        193  square_size = other.square_size;
        -
        194  return *this;
        -
        195  }
        -
        196 
        -
        197  std::size_t upper_size() const
        -
        198  {
        -
        199  BOOST_ASSERT(center_.y < this->size());
        -
        200  return center_.y;
        -
        201  }
        -
        202 
        -
        203  std::size_t lower_size() const
        -
        204  {
        -
        205  BOOST_ASSERT(center_.y < this->size());
        -
        206  return this->size() - center_.y - 1;
        -
        207  }
        -
        208 
        -
        209  std::size_t left_size() const
        -
        210  {
        -
        211  BOOST_ASSERT(center_.x < this->size());
        -
        212  return center_.x;
        -
        213  }
        -
        214 
        -
        215  std::size_t right_size() const
        -
        216  {
        -
        217  BOOST_ASSERT(center_.x < this->size());
        -
        218  return this->size() - center_.x - 1;
        -
        219  }
        -
        220 
        -
        221  auto center_y() -> std::size_t&
        -
        222  {
        -
        223  BOOST_ASSERT(center_.y < this->size());
        -
        224  return center_.y;
        -
        225  }
        -
        226 
        -
        227  auto center_y() const -> std::size_t const&
        -
        228  {
        -
        229  BOOST_ASSERT(center_.y < this->size());
        -
        230  return center_.y;
        -
        231  }
        -
        232 
        -
        233  auto center_x() -> std::size_t&
        -
        234  {
        -
        235  BOOST_ASSERT(center_.x < this->size());
        -
        236  return center_.x;
        -
        237  }
        -
        238 
        -
        239  auto center_x() const -> std::size_t const&
        -
        240  {
        -
        241  BOOST_ASSERT(center_.x < this->size());
        -
        242  return center_.x;
        -
        243  }
        -
        244 
        -
        245  std::size_t size() const
        -
        246  {
        -
        247  return square_size;
        -
        248  }
        -
        249 
        -
        250  typename Core::value_type at(std::size_t x, std::size_t y) const
        -
        251  {
        -
        252  if (x >= this->size() || y >= this->size())
        -
        253  {
        -
        254  throw std::out_of_range("Index out of range");
        -
        255  }
        -
        256  return this->begin()[y * this->size() + x];
        -
        257  }
        -
        258 
        -
        259 protected:
        -
        260  std::size_t square_size{0};
        -
        261 
        -
        262 private:
        -
        263  point<std::size_t> center_{0, 0};
        -
        264 };
        -
        265 
        -
        267 template
        -
        268 <
        -
        269  typename T,
        -
        270  typename Allocator = std::allocator<T>
        -
        271 >
        -
        272 class kernel_2d : public detail::kernel_2d_adaptor<std::vector<T, Allocator>>
        -
        273 {
        -
        274  using parent_t = detail::kernel_2d_adaptor<std::vector<T, Allocator>>;
        -
        275 
        -
        276 public:
        -
        277 
        -
        278  kernel_2d() = default;
        -
        279  kernel_2d(std::size_t size,std::size_t center_y, std::size_t center_x)
        -
        280  : parent_t(size, center_y, center_x)
        -
        281  {}
        -
        282 
        -
        283  template <typename FwdIterator>
        -
        284  kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x)
        -
        285  : parent_t(static_cast<int>(std::sqrt(size)), center_y, center_x)
        -
        286  {
        -
        287  detail::copy_n(elements, size, this->begin());
        -
        288  }
        -
        289 
        -
        290  kernel_2d(kernel_2d const& other) : parent_t(other) {}
        -
        291  kernel_2d& operator=(kernel_2d const& other) = default;
        -
        292 };
        -
        293 
        -
        295 template <typename T, std::size_t Size>
        - -
        297  public detail::kernel_2d_adaptor<std::array<T, Size * Size>>
        -
        298 {
        -
        299  using parent_t = detail::kernel_2d_adaptor<std::array<T, Size * Size>>;
        -
        300 public:
        -
        301  static constexpr std::size_t static_size = Size;
        -
        302  static_assert(static_size > 0, "kernel must have size greater than 0");
        -
        303  static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center");
        -
        304 
        - -
        306  {
        -
        307  this->square_size = Size;
        -
        308  }
        -
        309 
        -
        310  explicit kernel_2d_fixed(std::size_t center_y, std::size_t center_x) :
        -
        311  parent_t(center_y, center_x)
        -
        312  {
        -
        313  this->square_size = Size;
        -
        314  }
        -
        315 
        -
        316  template <typename FwdIterator>
        -
        317  explicit kernel_2d_fixed(FwdIterator elements, std::size_t center_y, std::size_t center_x)
        -
        318  : parent_t(center_y, center_x)
        -
        319  {
        -
        320  this->square_size = Size;
        -
        321  detail::copy_n(elements, Size * Size, this->begin());
        -
        322  }
        -
        323 
        -
        324  kernel_2d_fixed(kernel_2d_fixed const& other) : parent_t(other) {}
        -
        325  kernel_2d_fixed& operator=(kernel_2d_fixed const& other) = default;
        -
        326 };
        -
        327 
        -
        328 // TODO: This data member is odr-used and definition at namespace scope
        -
        329 // is required by C++11. Redundant and deprecated in C++17.
        -
        330 template <typename T, std::size_t Size>
        -
        331 constexpr std::size_t kernel_2d_fixed<T, Size>::static_size;
        -
        332 
        -
        333 template <typename Kernel>
        -
        334 inline Kernel reverse_kernel_2d(Kernel const& kernel)
        -
        335 {
        -
        336  Kernel result(kernel);
        -
        337  result.center_x() = kernel.lower_size();
        -
        338  result.center_y() = kernel.right_size();
        -
        339  std::reverse(result.begin(), result.end());
        -
        340  return result;
        -
        341 }
        -
        342 
        -
        343 
        -
        345 template<typename T, typename Allocator>
        -
        346 inline kernel_2d<T, Allocator> reverse_kernel(kernel_2d<T, Allocator> const& kernel)
        -
        347 {
        -
        348  return reverse_kernel_2d(kernel);
        -
        349 }
        -
        350 
        -
        352 template<typename T, std::size_t Size>
        -
        353 inline kernel_2d_fixed<T, Size> reverse_kernel(kernel_2d_fixed<T, Size> const& kernel)
        -
        354 {
        -
        355  return reverse_kernel_2d(kernel);
        -
        356 }
        -
        357 
        -
        358 } //namespace detail
        -
        359 
        -
        360 }} // namespace boost::gil
        -
        361 
        -
        362 #endif
        -
        kernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),...
        Definition: kernel.hpp:38
        -
        static-size kernel
        Definition: kernel.hpp:298
        -
        variable-size kernel
        Definition: kernel.hpp:273
        -
        static-size kernel
        Definition: kernel.hpp:123
        -
        variable-size kernel
        Definition: kernel.hpp:102
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Returns an integral constant type specifying the number of elements in a color base.
        Definition: color_base_algorithm.hpp:42
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2019 Miral Shah <miralshah2211@gmail.com>
        +
        4// Copyright 2022 Pranam Lashkari <plashkari628@gmail.com>
        +
        5//
        +
        6// Distributed under the Boost Software License, Version 1.0
        +
        7// See accompanying file LICENSE_1_0.txt or copy at
        +
        8// http://www.boost.org/LICENSE_1_0.txt
        +
        9//
        +
        10
        +
        11#ifndef BOOST_GIL_IMAGE_PROCESSING_KERNEL_HPP
        +
        12#define BOOST_GIL_IMAGE_PROCESSING_KERNEL_HPP
        +
        13
        +
        14#include <boost/gil/utilities.hpp>
        +
        15#include <boost/gil/point.hpp>
        +
        16
        +
        17#include <boost/assert.hpp>
        +
        18
        +
        19#include <algorithm>
        +
        20#include <array>
        +
        21#include <cstddef>
        +
        22#include <memory>
        +
        23#include <vector>
        +
        24#include <cmath>
        +
        25#include <stdexcept>
        +
        26
        +
        27namespace boost { namespace gil {
        +
        28
        +
        29// Definitions of 1D fixed-size and variable-size kernels and related operations
        +
        30
        +
        31namespace detail {
        +
        32
        +
        36template <typename Core>
        +
        +
        37class kernel_1d_adaptor : public Core
        +
        38{
        +
        39public:
        +
        40 kernel_1d_adaptor() = default;
        +
        41
        +
        42 explicit kernel_1d_adaptor(std::size_t center)
        +
        43 : center_(center)
        +
        44 {
        +
        45 BOOST_ASSERT(center_ < this->size());
        +
        46 }
        +
        47
        +
        48 kernel_1d_adaptor(std::size_t size, std::size_t center)
        +
        49 : Core(size) , center_(center)
        +
        50 {
        +
        51 BOOST_ASSERT(this->size() > 0);
        +
        52 BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0`
        +
        53 }
        +
        54
        + +
        56 : Core(other), center_(other.center_)
        +
        57 {
        +
        58 BOOST_ASSERT(this->size() > 0);
        +
        59 BOOST_ASSERT(center_ < this->size()); // also implies `size() > 0`
        +
        60 }
        +
        61
        +
        62 kernel_1d_adaptor& operator=(kernel_1d_adaptor const& other)
        +
        63 {
        +
        64 Core::operator=(other);
        +
        65 center_ = other.center_;
        +
        66 return *this;
        +
        67 }
        +
        68
        +
        69 std::size_t left_size() const
        +
        70 {
        +
        71 BOOST_ASSERT(center_ < this->size());
        +
        72 return center_;
        +
        73 }
        +
        74
        +
        75 std::size_t right_size() const
        +
        76 {
        +
        77 BOOST_ASSERT(center_ < this->size());
        +
        78 return this->size() - center_ - 1;
        +
        79 }
        +
        80
        +
        81 auto center() -> std::size_t&
        +
        82 {
        +
        83 BOOST_ASSERT(center_ < this->size());
        +
        84 return center_;
        +
        85 }
        +
        86
        +
        87 auto center() const -> std::size_t const&
        +
        88 {
        +
        89 BOOST_ASSERT(center_ < this->size());
        +
        90 return center_;
        +
        91 }
        +
        92
        +
        93private:
        +
        94 std::size_t center_{0};
        +
        95};
        +
        +
        96
        +
        97} // namespace detail
        +
        98
        +
        100template <typename T, typename Allocator = std::allocator<T> >
        +
        +
        101class kernel_1d : public detail::kernel_1d_adaptor<std::vector<T, Allocator>>
        +
        102{
        + +
        104public:
        +
        105
        +
        106 kernel_1d() = default;
        +
        107 kernel_1d(std::size_t size, std::size_t center) : parent_t(size, center) {}
        +
        108
        +
        109 template <typename FwdIterator>
        +
        110 kernel_1d(FwdIterator elements, std::size_t size, std::size_t center)
        +
        111 : parent_t(size, center)
        +
        112 {
        +
        113 detail::copy_n(elements, size, this->begin());
        +
        114 }
        +
        115
        +
        116 kernel_1d(kernel_1d const& other) : parent_t(other) {}
        +
        117 kernel_1d& operator=(kernel_1d const& other) = default;
        +
        118};
        +
        +
        119
        +
        121template <typename T,std::size_t Size>
        +
        +
        122class kernel_1d_fixed : public detail::kernel_1d_adaptor<std::array<T, Size>>
        +
        123{
        + +
        125public:
        +
        126 static constexpr std::size_t static_size = Size;
        +
        127 static_assert(static_size > 0, "kernel must have size greater than 0");
        +
        128 static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center");
        +
        129
        +
        130 kernel_1d_fixed() = default;
        +
        131 explicit kernel_1d_fixed(std::size_t center) : parent_t(center) {}
        +
        132
        +
        133 template <typename FwdIterator>
        +
        134 explicit kernel_1d_fixed(FwdIterator elements, std::size_t center)
        +
        135 : parent_t(center)
        +
        136 {
        +
        137 detail::copy_n(elements, Size, this->begin());
        +
        138 }
        +
        139
        +
        140 kernel_1d_fixed(kernel_1d_fixed const& other) : parent_t(other) {}
        +
        141 kernel_1d_fixed& operator=(kernel_1d_fixed const& other) = default;
        +
        142};
        +
        +
        143
        +
        144// TODO: This data member is odr-used and definition at namespace scope
        +
        145// is required by C++11. Redundant and deprecated in C++17.
        +
        146template <typename T,std::size_t Size>
        +
        147constexpr std::size_t kernel_1d_fixed<T, Size>::static_size;
        +
        148
        +
        150template <typename Kernel>
        +
        151inline Kernel reverse_kernel(Kernel const& kernel)
        +
        152{
        +
        153 Kernel result(kernel);
        +
        154 result.center() = kernel.right_size();
        +
        155 std::reverse(result.begin(), result.end());
        +
        156 return result;
        +
        157}
        +
        158
        +
        159
        +
        160namespace detail {
        +
        161
        +
        162template <typename Core>
        +
        163class kernel_2d_adaptor : public Core
        +
        164{
        +
        165public:
        +
        166 kernel_2d_adaptor() = default;
        +
        167
        +
        168 explicit kernel_2d_adaptor(std::size_t center_y, std::size_t center_x)
        +
        169 : center_(center_x, center_y)
        +
        170 {
        +
        171 BOOST_ASSERT(center_.y < this->size() && center_.x < this->size());
        +
        172 }
        +
        173
        +
        174 kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x)
        +
        175 : Core(size * size), square_size(size), center_(center_x, center_y)
        +
        176 {
        +
        177 BOOST_ASSERT(this->size() > 0);
        +
        178 BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0`
        +
        179 }
        +
        180
        +
        181 kernel_2d_adaptor(kernel_2d_adaptor const& other)
        +
        182 : Core(other), square_size(other.square_size), center_(other.center_.x, other.center_.y)
        +
        183 {
        +
        184 BOOST_ASSERT(this->size() > 0);
        +
        185 BOOST_ASSERT(center_.y < this->size() && center_.x < this->size()); // implies `size() > 0`
        +
        186 }
        +
        187
        +
        188 kernel_2d_adaptor& operator=(kernel_2d_adaptor const& other)
        +
        189 {
        +
        190 Core::operator=(other);
        +
        191 center_.y = other.center_.y;
        +
        192 center_.x = other.center_.x;
        +
        193 square_size = other.square_size;
        +
        194 return *this;
        +
        195 }
        +
        196
        +
        197 std::size_t upper_size() const
        +
        198 {
        +
        199 BOOST_ASSERT(center_.y < this->size());
        +
        200 return center_.y;
        +
        201 }
        +
        202
        +
        203 std::size_t lower_size() const
        +
        204 {
        +
        205 BOOST_ASSERT(center_.y < this->size());
        +
        206 return this->size() - center_.y - 1;
        +
        207 }
        +
        208
        +
        209 std::size_t left_size() const
        +
        210 {
        +
        211 BOOST_ASSERT(center_.x < this->size());
        +
        212 return center_.x;
        +
        213 }
        +
        214
        +
        215 std::size_t right_size() const
        +
        216 {
        +
        217 BOOST_ASSERT(center_.x < this->size());
        +
        218 return this->size() - center_.x - 1;
        +
        219 }
        +
        220
        +
        221 auto center_y() -> std::size_t&
        +
        222 {
        +
        223 BOOST_ASSERT(center_.y < this->size());
        +
        224 return center_.y;
        +
        225 }
        +
        226
        +
        227 auto center_y() const -> std::size_t const&
        +
        228 {
        +
        229 BOOST_ASSERT(center_.y < this->size());
        +
        230 return center_.y;
        +
        231 }
        +
        232
        +
        233 auto center_x() -> std::size_t&
        +
        234 {
        +
        235 BOOST_ASSERT(center_.x < this->size());
        +
        236 return center_.x;
        +
        237 }
        +
        238
        +
        239 auto center_x() const -> std::size_t const&
        +
        240 {
        +
        241 BOOST_ASSERT(center_.x < this->size());
        +
        242 return center_.x;
        +
        243 }
        +
        244
        +
        245 std::size_t size() const
        +
        246 {
        +
        247 return square_size;
        +
        248 }
        +
        249
        +
        250 typename Core::value_type at(std::size_t x, std::size_t y) const
        +
        251 {
        +
        252 if (x >= this->size() || y >= this->size())
        +
        253 {
        +
        254 throw std::out_of_range("Index out of range");
        +
        255 }
        +
        256 return this->begin()[y * this->size() + x];
        +
        257 }
        +
        258
        +
        259protected:
        +
        260 std::size_t square_size{0};
        +
        261
        +
        262private:
        +
        263 point<std::size_t> center_{0, 0};
        +
        264};
        +
        265
        +
        267template
        +
        268<
        +
        269 typename T,
        +
        270 typename Allocator = std::allocator<T>
        +
        271>
        +
        +
        272class kernel_2d : public detail::kernel_2d_adaptor<std::vector<T, Allocator>>
        +
        273{
        +
        274 using parent_t = detail::kernel_2d_adaptor<std::vector<T, Allocator>>;
        +
        275
        +
        276public:
        +
        277
        +
        278 kernel_2d() = default;
        +
        279 kernel_2d(std::size_t size,std::size_t center_y, std::size_t center_x)
        +
        280 : parent_t(size, center_y, center_x)
        +
        281 {}
        +
        282
        +
        283 template <typename FwdIterator>
        +
        284 kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x)
        +
        285 : parent_t(static_cast<int>(std::sqrt(size)), center_y, center_x)
        +
        286 {
        +
        287 detail::copy_n(elements, size, this->begin());
        +
        288 }
        +
        289
        +
        290 kernel_2d(kernel_2d const& other) : parent_t(other) {}
        +
        291 kernel_2d& operator=(kernel_2d const& other) = default;
        +
        292};
        +
        +
        293
        +
        295template <typename T, std::size_t Size>
        +
        + +
        297 public detail::kernel_2d_adaptor<std::array<T, Size * Size>>
        +
        298{
        +
        299 using parent_t = detail::kernel_2d_adaptor<std::array<T, Size * Size>>;
        +
        300public:
        +
        301 static constexpr std::size_t static_size = Size;
        +
        302 static_assert(static_size > 0, "kernel must have size greater than 0");
        +
        303 static_assert(static_size % 2 == 1, "kernel size must be odd to ensure validity at the center");
        +
        304
        + +
        306 {
        +
        307 this->square_size = Size;
        +
        308 }
        +
        309
        +
        310 explicit kernel_2d_fixed(std::size_t center_y, std::size_t center_x) :
        +
        311 parent_t(center_y, center_x)
        +
        312 {
        +
        313 this->square_size = Size;
        +
        314 }
        +
        315
        +
        316 template <typename FwdIterator>
        +
        317 explicit kernel_2d_fixed(FwdIterator elements, std::size_t center_y, std::size_t center_x)
        +
        318 : parent_t(center_y, center_x)
        +
        319 {
        +
        320 this->square_size = Size;
        +
        321 detail::copy_n(elements, Size * Size, this->begin());
        +
        322 }
        +
        323
        +
        324 kernel_2d_fixed(kernel_2d_fixed const& other) : parent_t(other) {}
        +
        325 kernel_2d_fixed& operator=(kernel_2d_fixed const& other) = default;
        +
        326};
        +
        +
        327
        +
        328// TODO: This data member is odr-used and definition at namespace scope
        +
        329// is required by C++11. Redundant and deprecated in C++17.
        +
        330template <typename T, std::size_t Size>
        +
        331constexpr std::size_t kernel_2d_fixed<T, Size>::static_size;
        +
        332
        +
        333template <typename Kernel>
        +
        334inline Kernel reverse_kernel_2d(Kernel const& kernel)
        +
        335{
        +
        336 Kernel result(kernel);
        +
        337 result.center_x() = kernel.lower_size();
        +
        338 result.center_y() = kernel.right_size();
        +
        339 std::reverse(result.begin(), result.end());
        +
        340 return result;
        +
        341}
        +
        342
        +
        343
        +
        345template<typename T, typename Allocator>
        +
        346inline kernel_2d<T, Allocator> reverse_kernel(kernel_2d<T, Allocator> const& kernel)
        +
        347{
        +
        348 return reverse_kernel_2d(kernel);
        +
        349}
        +
        350
        +
        352template<typename T, std::size_t Size>
        +
        353inline kernel_2d_fixed<T, Size> reverse_kernel(kernel_2d_fixed<T, Size> const& kernel)
        +
        354{
        +
        355 return reverse_kernel_2d(kernel);
        +
        356}
        +
        357
        +
        358} //namespace detail
        +
        359
        +
        360}} // namespace boost::gil
        +
        361
        +
        362#endif
        +
        kernel adaptor for one-dimensional cores Core needs to provide size(),begin(),end(),...
        Definition kernel.hpp:38
        +
        static-size kernel
        Definition kernel.hpp:298
        +
        variable-size kernel
        Definition kernel.hpp:273
        +
        static-size kernel
        Definition kernel.hpp:123
        +
        variable-size kernel
        Definition kernel.hpp:102
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Returns an integral constant type specifying the number of elements in a color base.
        Definition color_base_algorithm.hpp:42
        diff --git a/html/reference/locator_8hpp_source.html b/html/reference/locator_8hpp_source.html index 057ecb47d..4bf4f32ce 100644 --- a/html/reference/locator_8hpp_source.html +++ b/html/reference/locator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: locator.hpp Source File @@ -27,306 +27,317 @@

        - + +/* @license-end */ + +
        -
        -
        locator.hpp
        +
        locator.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_LOCATOR_HPP
        -
        9 #define BOOST_GIL_LOCATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/step_iterator.hpp>
        -
        12 #include <boost/gil/point.hpp>
        -
        13 
        -
        14 #include <boost/assert.hpp>
        -
        15 
        -
        16 #include <cstddef>
        -
        17 
        -
        18 namespace boost { namespace gil {
        -
        19 
        -
        21 
        -
        22 //forward declarations
        -
        23 template <typename P> std::ptrdiff_t memunit_step(const P*);
        -
        24 template <typename P> P* memunit_advanced(const P* p, std::ptrdiff_t diff);
        -
        25 template <typename P> P& memunit_advanced_ref(P* p, std::ptrdiff_t diff);
        -
        26 template <typename Iterator, typename D> struct iterator_add_deref;
        -
        27 template <typename T> class point;
        -
        28 namespace detail {
        -
        29  // helper class specialized for each axis of pixel_2d_locator
        -
        30  template <std::size_t D, typename Loc> class locator_axis;
        -
        31 }
        -
        32 
        -
        33 template <typename T> struct channel_type;
        -
        34 template <typename T> struct color_space_type;
        -
        35 template <typename T> struct channel_mapping_type;
        -
        36 template <typename T> struct is_planar;
        -
        37 template <typename T> struct num_channels;
        -
        38 
        -
        42 template <typename LocatorOrView>
        - -
        44 {
        -
        45  using type = LocatorOrView;
        -
        46 };
        -
        47 
        -
        106 
        -
        107 template <typename Loc, typename XIterator, typename YIterator> // The concrete subclass, the X-iterator and the Y-iterator
        - -
        109 {
        -
        110 public:
        -
        111  using x_iterator = XIterator;
        -
        112  using y_iterator = YIterator;
        -
        113 
        -
        114  // aliasesrequired by ConstRandomAccessNDLocatorConcept
        -
        115  static const std::size_t num_dimensions=2;
        -
        116  using value_type = typename std::iterator_traits<x_iterator>::value_type;
        -
        117  using reference = typename std::iterator_traits<x_iterator>::reference; // result of dereferencing
        -
        118  using coord_t = typename std::iterator_traits<x_iterator>::difference_type; // 1D difference type (same for all dimensions)
        -
        119  using difference_type = point<coord_t>; // result of operator-(locator,locator)
        -
        120  using point_t = difference_type;
        -
        121  template <std::size_t D> struct axis
        -
        122  {
        -
        123  using coord_t = typename detail::locator_axis<D,Loc>::coord_t;
        -
        124  using iterator = typename detail::locator_axis<D,Loc>::iterator;
        -
        125  };
        -
        126 
        -
        127 // aliases required by ConstRandomAccess2DLocatorConcept
        -
        128  using x_coord_t = typename point_t::template axis<0>::coord_t;
        -
        129  using y_coord_t = typename point_t::template axis<1>::coord_t;
        -
        130 
        -
        131  bool operator!=(const Loc& p) const { return !(concrete()==p); }
        -
        132 
        -
        133  x_iterator x_at(x_coord_t dx, y_coord_t dy) const { Loc tmp=concrete(); tmp+=point_t(dx,dy); return tmp.x(); }
        -
        134  x_iterator x_at(const difference_type& d) const { Loc tmp=concrete(); tmp+=d; return tmp.x(); }
        -
        135  y_iterator y_at(x_coord_t dx, y_coord_t dy) const { Loc tmp=concrete(); tmp+=point_t(dx,dy); return tmp.y(); }
        -
        136  y_iterator y_at(const difference_type& d) const { Loc tmp=concrete(); tmp+=d; return tmp.y(); }
        -
        137  Loc xy_at(x_coord_t dx, y_coord_t dy) const { Loc tmp=concrete(); tmp+=point_t(dx,dy); return tmp; }
        -
        138  Loc xy_at(const difference_type& d) const { Loc tmp=concrete(); tmp+=d; return tmp; }
        -
        139 
        -
        140  template <std::size_t D> typename axis<D>::iterator& axis_iterator() { return detail::locator_axis<D,Loc>()(concrete()); }
        -
        141  template <std::size_t D> typename axis<D>::iterator const& axis_iterator() const { return detail::locator_axis<D,Loc>()(concrete()); }
        -
        142  template <std::size_t D> typename axis<D>::iterator axis_iterator(point_t const& p) const { return detail::locator_axis<D,Loc>()(concrete(),p); }
        -
        143 
        -
        144  reference operator()(x_coord_t dx, y_coord_t dy) const { return *x_at(dx,dy); }
        -
        145  reference operator[](const difference_type& d) const { return *x_at(d.x,d.y); }
        -
        146 
        -
        147  reference operator*() const { return *concrete().x(); }
        -
        148 
        -
        149  Loc& operator+=(const difference_type& d) { concrete().x()+=d.x; concrete().y()+=d.y; return concrete(); }
        -
        150  Loc& operator-=(const difference_type& d) { concrete().x()-=d.x; concrete().y()-=d.y; return concrete(); }
        -
        151 
        -
        152  Loc operator+(const difference_type& d) const { return xy_at(d); }
        -
        153  Loc operator-(const difference_type& d) const { return xy_at(-d); }
        -
        154 
        -
        155  // Some locators can cache 2D coordinates for faster subsequent access. By default there is no caching
        - -
        157  cached_location_t cache_location(const difference_type& d) const { return d; }
        -
        158  cached_location_t cache_location(x_coord_t dx, y_coord_t dy)const { return difference_type(dx,dy); }
        -
        159 
        -
        160 private:
        -
        161  Loc& concrete() { return (Loc&)*this; }
        -
        162  const Loc& concrete() const { return (const Loc&)*this; }
        -
        163 
        -
        164  template <typename X> friend class pixel_2d_locator;
        -
        165 };
        -
        166 
        -
        167 // helper classes for each axis of pixel_2d_locator_base
        -
        168 namespace detail {
        -
        169  template <typename Loc>
        -
        170  class locator_axis<0,Loc> {
        -
        171  using point_t = typename Loc::point_t;
        -
        172  public:
        -
        173  using coord_t = typename point_t::template axis<0>::coord_t;
        -
        174  using iterator = typename Loc::x_iterator;
        -
        175 
        -
        176  inline iterator& operator()( Loc& loc) const { return loc.x(); }
        -
        177  inline iterator const& operator()(const Loc& loc) const { return loc.x(); }
        -
        178  inline iterator operator()( Loc& loc, point_t const& d) const { return loc.x_at(d); }
        -
        179  inline iterator operator()(const Loc& loc, point_t const& d) const { return loc.x_at(d); }
        -
        180  };
        -
        181 
        -
        182  template <typename Loc>
        -
        183  class locator_axis<1,Loc> {
        -
        184  using point_t = typename Loc::point_t;
        -
        185  public:
        -
        186  using coord_t = typename point_t::template axis<1>::coord_t;
        -
        187  using iterator = typename Loc::y_iterator;
        -
        188 
        -
        189  inline iterator& operator()( Loc& loc) const { return loc.y(); }
        -
        190  inline iterator const& operator()(const Loc& loc) const { return loc.y(); }
        -
        191  inline iterator operator()( Loc& loc, point_t const& d) const { return loc.y_at(d); }
        -
        192  inline iterator operator()(const Loc& loc, point_t const& d) const { return loc.y_at(d); }
        -
        193  };
        -
        194 }
        -
        195 
        -
        196 template <typename Loc, typename XIt, typename YIt>
        -
        197 struct channel_type<pixel_2d_locator_base<Loc,XIt,YIt> > : public channel_type<XIt> {};
        -
        198 
        -
        199 template <typename Loc, typename XIt, typename YIt>
        -
        200 struct color_space_type<pixel_2d_locator_base<Loc,XIt,YIt> > : public color_space_type<XIt> {};
        -
        201 
        -
        202 template <typename Loc, typename XIt, typename YIt>
        -
        203 struct channel_mapping_type<pixel_2d_locator_base<Loc,XIt,YIt> > : public channel_mapping_type<XIt> {};
        -
        204 
        -
        205 template <typename Loc, typename XIt, typename YIt>
        -
        206 struct is_planar<pixel_2d_locator_base<Loc,XIt,YIt> > : public is_planar<XIt> {};
        -
        207 
        -
        228 
        -
        229 template <typename StepIterator>
        -
        230 class memory_based_2d_locator : public pixel_2d_locator_base<memory_based_2d_locator<StepIterator>, typename iterator_adaptor_get_base<StepIterator>::type, StepIterator> {
        - -
        232  BOOST_GIL_CLASS_REQUIRE(StepIterator, boost::gil, StepIteratorConcept)
        -
        233 public:
        - -
        235  using const_t = memory_based_2d_locator<typename const_iterator_type<StepIterator>::type>; // same as this type, but over const values
        -
        236 
        -
        237  using coord_t = typename parent_t::coord_t;
        -
        238  using x_coord_t = typename parent_t::x_coord_t;
        -
        239  using y_coord_t = typename parent_t::y_coord_t;
        -
        240  using x_iterator = typename parent_t::x_iterator;
        -
        241  using y_iterator = typename parent_t::y_iterator;
        -
        242  using difference_type = typename parent_t::difference_type;
        -
        243  using reference = typename parent_t::reference;
        -
        244 
        -
        245  template <typename Deref> struct add_deref
        -
        246  {
        - -
        248  static type make(const memory_based_2d_locator<StepIterator>& loc, const Deref& nderef) {
        -
        249  return type(iterator_add_deref<StepIterator,Deref>::make(loc.y(),nderef));
        -
        250  }
        -
        251  };
        -
        252 
        - -
        254  memory_based_2d_locator(const StepIterator& yit) : _p(yit) {}
        -
        255  template <typename SI> memory_based_2d_locator(const memory_based_2d_locator<SI>& loc, coord_t y_step) : _p(loc.x(), loc.row_size()*y_step) {}
        -
        256  template <typename SI> memory_based_2d_locator(const memory_based_2d_locator<SI>& loc, coord_t x_step, coord_t y_step, bool transpose=false)
        -
        257  : _p(make_step_iterator(loc.x(),(transpose ? loc.row_size() : loc.pixel_size())*x_step),
        -
        258  (transpose ? loc.pixel_size() : loc.row_size())*y_step ) {}
        -
        259 
        -
        260  memory_based_2d_locator(x_iterator xit, std::ptrdiff_t row_bytes) : _p(xit,row_bytes) {}
        -
        261  template <typename X> memory_based_2d_locator(const memory_based_2d_locator<X>& pl) : _p(pl._p) {}
        -
        262  memory_based_2d_locator(const memory_based_2d_locator& pl) : _p(pl._p) {}
        -
        263  memory_based_2d_locator& operator=(memory_based_2d_locator const& other) = default;
        -
        264 
        -
        265  bool operator==(const this_t& p) const { return _p==p._p; }
        -
        266 
        -
        267  x_iterator const& x() const { return _p.base(); }
        -
        268  y_iterator const& y() const { return _p; }
        -
        269  x_iterator& x() { return _p.base(); }
        -
        270  y_iterator& y() { return _p; }
        -
        271 
        -
        272  // These are faster versions of functions already provided in the superclass
        -
        273  x_iterator x_at (x_coord_t dx, y_coord_t dy) const { return memunit_advanced(x(), offset(dx,dy)); }
        -
        274  x_iterator x_at (const difference_type& d) const { return memunit_advanced(x(), offset(d.x,d.y)); }
        -
        275  this_t xy_at (x_coord_t dx, y_coord_t dy) const { return this_t(x_at( dx , dy ), row_size()); }
        -
        276  this_t xy_at (const difference_type& d) const { return this_t(x_at( d.x, d.y), row_size()); }
        -
        277  reference operator()(x_coord_t dx, y_coord_t dy) const { return memunit_advanced_ref(x(),offset(dx,dy)); }
        -
        278  reference operator[](const difference_type& d) const { return memunit_advanced_ref(x(),offset(d.x,d.y)); }
        -
        279  this_t& operator+=(const difference_type& d) { memunit_advance(x(),offset(d.x,d.y)); return *this; }
        -
        280  this_t& operator-=(const difference_type& d) { memunit_advance(x(),offset(-d.x,-d.y)); return *this; }
        -
        281 
        -
        282  // Memory-based locators can have 1D caching of 2D relative coordinates
        -
        283  using cached_location_t = std::ptrdiff_t; // type used to store relative location (to allow for more efficient repeated access)
        -
        284  cached_location_t cache_location(const difference_type& d) const { return offset(d.x,d.y); }
        -
        285  cached_location_t cache_location(x_coord_t dx, y_coord_t dy)const { return offset(dx,dy); }
        -
        286  reference operator[](const cached_location_t& loc) const { return memunit_advanced_ref(x(),loc); }
        -
        287 
        -
        288  // Only make sense for memory-based locators
        -
        289  std::ptrdiff_t row_size() const { return memunit_step(y()); } // distance in mem units (bytes or bits) between adjacent rows
        -
        290  std::ptrdiff_t pixel_size() const { return memunit_step(x()); } // distance in mem units (bytes or bits) between adjacent pixels on the same row
        -
        291 
        -
        292  bool is_1d_traversable(x_coord_t width) const { return row_size()-pixel_size()*width==0; } // is there no gap at the end of each row?
        -
        293 
        -
        294  // Returns the vertical distance (it2.y-it1.y) between two x_iterators given the difference of their x positions
        -
        295  std::ptrdiff_t y_distance_to(this_t const& p2, x_coord_t xDiff) const
        -
        296  {
        -
        297  std::ptrdiff_t rowDiff = memunit_distance(x(), p2.x()) - pixel_size() * xDiff;
        -
        298  BOOST_ASSERT((rowDiff % row_size()) == 0);
        -
        299  return rowDiff / row_size();
        -
        300  }
        -
        301 
        -
        302 private:
        -
        303  template <typename X> friend class memory_based_2d_locator;
        -
        304  std::ptrdiff_t offset(x_coord_t x, y_coord_t y) const { return y*row_size() + x*pixel_size(); }
        -
        305  StepIterator _p;
        -
        306 };
        -
        307 
        -
        309 // PixelBasedConcept
        -
        311 
        -
        312 template <typename SI>
        -
        313 struct color_space_type<memory_based_2d_locator<SI> > : public color_space_type<typename memory_based_2d_locator<SI>::parent_t> {
        -
        314 };
        -
        315 
        -
        316 template <typename SI>
        -
        317 struct channel_mapping_type<memory_based_2d_locator<SI> > : public channel_mapping_type<typename memory_based_2d_locator<SI>::parent_t> {
        -
        318 };
        -
        319 
        -
        320 template <typename SI>
        -
        321 struct is_planar<memory_based_2d_locator<SI> > : public is_planar<typename memory_based_2d_locator<SI>::parent_t> {
        -
        322 };
        -
        323 
        -
        324 template <typename SI>
        -
        325 struct channel_type<memory_based_2d_locator<SI> > : public channel_type<typename memory_based_2d_locator<SI>::parent_t> {
        -
        326 };
        -
        327 
        -
        329 // HasDynamicXStepTypeConcept
        -
        331 
        -
        332 // Take the base iterator of SI (which is typically a step iterator) and change it to have a step in x
        -
        333 template <typename SI>
        -
        334 struct dynamic_x_step_type<memory_based_2d_locator<SI> > {
        -
        335 private:
        -
        336  using base_iterator_t = typename iterator_adaptor_get_base<SI>::type;
        -
        337  using base_iterator_step_t = typename dynamic_x_step_type<base_iterator_t>::type;
        -
        338  using dynamic_step_base_t = typename iterator_adaptor_rebind<SI, base_iterator_step_t>::type;
        -
        339 public:
        -
        340  using type = memory_based_2d_locator<dynamic_step_base_t>;
        -
        341 };
        -
        342 
        -
        344 // HasDynamicYStepTypeConcept
        -
        346 
        -
        347 template <typename SI>
        -
        348 struct dynamic_y_step_type<memory_based_2d_locator<SI> > {
        -
        349  using type = memory_based_2d_locator<SI>;
        -
        350 };
        -
        351 } } // namespace boost::gil
        -
        352 
        -
        353 #endif
        -
        Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,...
        Definition: locator.hpp:230
        -
        base class for models of PixelLocatorConcept
        Definition: locator.hpp:109
        -
        2D point both axes of which have the same dimension typeModels: Point2DConcept
        Definition: point.hpp:36
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Step iterator concept.
        Definition: concepts/pixel_iterator.hpp:258
        -
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition: metafunctions.hpp:36
        -
        Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor ...
        Definition: pixel_iterator_adaptor.hpp:176
        -
        Definition: locator.hpp:44
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_LOCATOR_HPP
        +
        9#define BOOST_GIL_LOCATOR_HPP
        +
        10
        +
        11#include <boost/gil/step_iterator.hpp>
        +
        12#include <boost/gil/point.hpp>
        +
        13
        +
        14#include <boost/assert.hpp>
        +
        15
        +
        16#include <cstddef>
        +
        17
        +
        18namespace boost { namespace gil {
        +
        19
        +
        21
        +
        22//forward declarations
        +
        23template <typename P> std::ptrdiff_t memunit_step(const P*);
        +
        24template <typename P> P* memunit_advanced(const P* p, std::ptrdiff_t diff);
        +
        25template <typename P> P& memunit_advanced_ref(P* p, std::ptrdiff_t diff);
        +
        26template <typename Iterator, typename D> struct iterator_add_deref;
        +
        27template <typename T> class point;
        +
        28namespace detail {
        +
        29 // helper class specialized for each axis of pixel_2d_locator
        +
        30 template <std::size_t D, typename Loc> class locator_axis;
        +
        31}
        +
        32
        +
        33template <typename T> struct channel_type;
        +
        34template <typename T> struct color_space_type;
        +
        35template <typename T> struct channel_mapping_type;
        +
        36template <typename T> struct is_planar;
        +
        37template <typename T> struct num_channels;
        +
        38
        +
        42template <typename LocatorOrView>
        +
        + +
        44{
        +
        45 using type = LocatorOrView;
        +
        46};
        +
        +
        47
        +
        106
        +
        107template <typename Loc, typename XIterator, typename YIterator> // The concrete subclass, the X-iterator and the Y-iterator
        +
        + +
        109{
        +
        110public:
        +
        111 using x_iterator = XIterator;
        +
        112 using y_iterator = YIterator;
        +
        113
        +
        114 // aliasesrequired by ConstRandomAccessNDLocatorConcept
        +
        115 static const std::size_t num_dimensions=2;
        +
        116 using value_type = typename std::iterator_traits<x_iterator>::value_type;
        +
        117 using reference = typename std::iterator_traits<x_iterator>::reference; // result of dereferencing
        +
        118 using coord_t = typename std::iterator_traits<x_iterator>::difference_type; // 1D difference type (same for all dimensions)
        +
        119 using difference_type = point<coord_t>; // result of operator-(locator,locator)
        +
        120 using point_t = difference_type;
        +
        121 template <std::size_t D> struct axis
        +
        122 {
        +
        123 using coord_t = typename detail::locator_axis<D,Loc>::coord_t;
        +
        124 using iterator = typename detail::locator_axis<D,Loc>::iterator;
        +
        125 };
        +
        126
        +
        127// aliases required by ConstRandomAccess2DLocatorConcept
        +
        128 using x_coord_t = typename point_t::template axis<0>::coord_t;
        +
        129 using y_coord_t = typename point_t::template axis<1>::coord_t;
        +
        130
        +
        131 bool operator!=(const Loc& p) const { return !(concrete()==p); }
        +
        132
        +
        133 x_iterator x_at(x_coord_t dx, y_coord_t dy) const { Loc tmp=concrete(); tmp+=point_t(dx,dy); return tmp.x(); }
        +
        134 x_iterator x_at(const difference_type& d) const { Loc tmp=concrete(); tmp+=d; return tmp.x(); }
        +
        135 y_iterator y_at(x_coord_t dx, y_coord_t dy) const { Loc tmp=concrete(); tmp+=point_t(dx,dy); return tmp.y(); }
        +
        136 y_iterator y_at(const difference_type& d) const { Loc tmp=concrete(); tmp+=d; return tmp.y(); }
        +
        137 Loc xy_at(x_coord_t dx, y_coord_t dy) const { Loc tmp=concrete(); tmp+=point_t(dx,dy); return tmp; }
        +
        138 Loc xy_at(const difference_type& d) const { Loc tmp=concrete(); tmp+=d; return tmp; }
        +
        139
        +
        140 template <std::size_t D> typename axis<D>::iterator& axis_iterator() { return detail::locator_axis<D,Loc>()(concrete()); }
        +
        141 template <std::size_t D> typename axis<D>::iterator const& axis_iterator() const { return detail::locator_axis<D,Loc>()(concrete()); }
        +
        142 template <std::size_t D> typename axis<D>::iterator axis_iterator(point_t const& p) const { return detail::locator_axis<D,Loc>()(concrete(),p); }
        +
        143
        +
        144 reference operator()(x_coord_t dx, y_coord_t dy) const { return *x_at(dx,dy); }
        +
        145 reference operator[](const difference_type& d) const { return *x_at(d.x,d.y); }
        +
        146
        +
        147 reference operator*() const { return *concrete().x(); }
        +
        148
        +
        149 Loc& operator+=(const difference_type& d) { concrete().x()+=d.x; concrete().y()+=d.y; return concrete(); }
        +
        150 Loc& operator-=(const difference_type& d) { concrete().x()-=d.x; concrete().y()-=d.y; return concrete(); }
        +
        151
        +
        152 Loc operator+(const difference_type& d) const { return xy_at(d); }
        +
        153 Loc operator-(const difference_type& d) const { return xy_at(-d); }
        +
        154
        +
        155 // Some locators can cache 2D coordinates for faster subsequent access. By default there is no caching
        + +
        157 cached_location_t cache_location(const difference_type& d) const { return d; }
        +
        158 cached_location_t cache_location(x_coord_t dx, y_coord_t dy)const { return difference_type(dx,dy); }
        +
        159
        +
        160private:
        +
        161 Loc& concrete() { return (Loc&)*this; }
        +
        162 const Loc& concrete() const { return (const Loc&)*this; }
        +
        163
        +
        164 template <typename X> friend class pixel_2d_locator;
        +
        165};
        +
        +
        166
        +
        167// helper classes for each axis of pixel_2d_locator_base
        +
        168namespace detail {
        +
        169 template <typename Loc>
        +
        170 class locator_axis<0,Loc> {
        +
        171 using point_t = typename Loc::point_t;
        +
        172 public:
        +
        173 using coord_t = typename point_t::template axis<0>::coord_t;
        +
        174 using iterator = typename Loc::x_iterator;
        +
        175
        +
        176 inline iterator& operator()( Loc& loc) const { return loc.x(); }
        +
        177 inline iterator const& operator()(const Loc& loc) const { return loc.x(); }
        +
        178 inline iterator operator()( Loc& loc, point_t const& d) const { return loc.x_at(d); }
        +
        179 inline iterator operator()(const Loc& loc, point_t const& d) const { return loc.x_at(d); }
        +
        180 };
        +
        181
        +
        182 template <typename Loc>
        +
        183 class locator_axis<1,Loc> {
        +
        184 using point_t = typename Loc::point_t;
        +
        185 public:
        +
        186 using coord_t = typename point_t::template axis<1>::coord_t;
        +
        187 using iterator = typename Loc::y_iterator;
        +
        188
        +
        189 inline iterator& operator()( Loc& loc) const { return loc.y(); }
        +
        190 inline iterator const& operator()(const Loc& loc) const { return loc.y(); }
        +
        191 inline iterator operator()( Loc& loc, point_t const& d) const { return loc.y_at(d); }
        +
        192 inline iterator operator()(const Loc& loc, point_t const& d) const { return loc.y_at(d); }
        +
        193 };
        +
        194}
        +
        195
        +
        196template <typename Loc, typename XIt, typename YIt>
        +
        197struct channel_type<pixel_2d_locator_base<Loc,XIt,YIt> > : public channel_type<XIt> {};
        +
        198
        +
        199template <typename Loc, typename XIt, typename YIt>
        +
        200struct color_space_type<pixel_2d_locator_base<Loc,XIt,YIt> > : public color_space_type<XIt> {};
        +
        201
        +
        202template <typename Loc, typename XIt, typename YIt>
        +
        203struct channel_mapping_type<pixel_2d_locator_base<Loc,XIt,YIt> > : public channel_mapping_type<XIt> {};
        +
        204
        +
        205template <typename Loc, typename XIt, typename YIt>
        +
        206struct is_planar<pixel_2d_locator_base<Loc,XIt,YIt> > : public is_planar<XIt> {};
        +
        207
        +
        228
        +
        229template <typename StepIterator>
        +
        +
        230class memory_based_2d_locator : public pixel_2d_locator_base<memory_based_2d_locator<StepIterator>, typename iterator_adaptor_get_base<StepIterator>::type, StepIterator> {
        + +
        232 BOOST_GIL_CLASS_REQUIRE(StepIterator, boost::gil, StepIteratorConcept)
        +
        233public:
        + +
        235 using const_t = memory_based_2d_locator<typename const_iterator_type<StepIterator>::type>; // same as this type, but over const values
        +
        236
        +
        237 using coord_t = typename parent_t::coord_t;
        +
        238 using x_coord_t = typename parent_t::x_coord_t;
        +
        239 using y_coord_t = typename parent_t::y_coord_t;
        +
        240 using x_iterator = typename parent_t::x_iterator;
        +
        241 using y_iterator = typename parent_t::y_iterator;
        +
        242 using difference_type = typename parent_t::difference_type;
        +
        243 using reference = typename parent_t::reference;
        +
        244
        +
        245 template <typename Deref> struct add_deref
        +
        246 {
        + +
        248 static type make(const memory_based_2d_locator<StepIterator>& loc, const Deref& nderef) {
        +
        249 return type(iterator_add_deref<StepIterator,Deref>::make(loc.y(),nderef));
        +
        250 }
        +
        251 };
        +
        252
        + +
        254 memory_based_2d_locator(const StepIterator& yit) : _p(yit) {}
        +
        255 template <typename SI> memory_based_2d_locator(const memory_based_2d_locator<SI>& loc, coord_t y_step) : _p(loc.x(), loc.row_size()*y_step) {}
        +
        256 template <typename SI> memory_based_2d_locator(const memory_based_2d_locator<SI>& loc, coord_t x_step, coord_t y_step, bool transpose=false)
        +
        257 : _p(make_step_iterator(loc.x(),(transpose ? loc.row_size() : loc.pixel_size())*x_step),
        +
        258 (transpose ? loc.pixel_size() : loc.row_size())*y_step ) {}
        +
        259
        +
        260 memory_based_2d_locator(x_iterator xit, std::ptrdiff_t row_bytes) : _p(xit,row_bytes) {}
        +
        261 template <typename X> memory_based_2d_locator(const memory_based_2d_locator<X>& pl) : _p(pl._p) {}
        +
        262 memory_based_2d_locator(const memory_based_2d_locator& pl) : _p(pl._p) {}
        +
        263 memory_based_2d_locator& operator=(memory_based_2d_locator const& other) = default;
        +
        264
        +
        265 bool operator==(const this_t& p) const { return _p==p._p; }
        +
        266
        +
        267 x_iterator const& x() const { return _p.base(); }
        +
        268 y_iterator const& y() const { return _p; }
        +
        269 x_iterator& x() { return _p.base(); }
        +
        270 y_iterator& y() { return _p; }
        +
        271
        +
        272 // These are faster versions of functions already provided in the superclass
        +
        273 x_iterator x_at (x_coord_t dx, y_coord_t dy) const { return memunit_advanced(x(), offset(dx,dy)); }
        +
        274 x_iterator x_at (const difference_type& d) const { return memunit_advanced(x(), offset(d.x,d.y)); }
        +
        275 this_t xy_at (x_coord_t dx, y_coord_t dy) const { return this_t(x_at( dx , dy ), row_size()); }
        +
        276 this_t xy_at (const difference_type& d) const { return this_t(x_at( d.x, d.y), row_size()); }
        +
        277 reference operator()(x_coord_t dx, y_coord_t dy) const { return memunit_advanced_ref(x(),offset(dx,dy)); }
        +
        278 reference operator[](const difference_type& d) const { return memunit_advanced_ref(x(),offset(d.x,d.y)); }
        +
        279 this_t& operator+=(const difference_type& d) { memunit_advance(x(),offset(d.x,d.y)); return *this; }
        +
        280 this_t& operator-=(const difference_type& d) { memunit_advance(x(),offset(-d.x,-d.y)); return *this; }
        +
        281
        +
        282 // Memory-based locators can have 1D caching of 2D relative coordinates
        +
        283 using cached_location_t = std::ptrdiff_t; // type used to store relative location (to allow for more efficient repeated access)
        +
        284 cached_location_t cache_location(const difference_type& d) const { return offset(d.x,d.y); }
        +
        285 cached_location_t cache_location(x_coord_t dx, y_coord_t dy)const { return offset(dx,dy); }
        +
        286 reference operator[](const cached_location_t& loc) const { return memunit_advanced_ref(x(),loc); }
        +
        287
        +
        288 // Only make sense for memory-based locators
        +
        289 std::ptrdiff_t row_size() const { return memunit_step(y()); } // distance in mem units (bytes or bits) between adjacent rows
        +
        290 std::ptrdiff_t pixel_size() const { return memunit_step(x()); } // distance in mem units (bytes or bits) between adjacent pixels on the same row
        +
        291
        +
        292 bool is_1d_traversable(x_coord_t width) const { return row_size()-pixel_size()*width==0; } // is there no gap at the end of each row?
        +
        293
        +
        294 // Returns the vertical distance (it2.y-it1.y) between two x_iterators given the difference of their x positions
        +
        295 std::ptrdiff_t y_distance_to(this_t const& p2, x_coord_t xDiff) const
        +
        296 {
        +
        297 std::ptrdiff_t rowDiff = memunit_distance(x(), p2.x()) - pixel_size() * xDiff;
        +
        298 BOOST_ASSERT((rowDiff % row_size()) == 0);
        +
        299 return rowDiff / row_size();
        +
        300 }
        +
        301
        +
        302private:
        +
        303 template <typename X> friend class memory_based_2d_locator;
        +
        304 std::ptrdiff_t offset(x_coord_t x, y_coord_t y) const { return y*row_size() + x*pixel_size(); }
        +
        305 StepIterator _p;
        +
        306};
        +
        +
        307
        +
        309// PixelBasedConcept
        +
        311
        +
        312template <typename SI>
        +
        313struct color_space_type<memory_based_2d_locator<SI> > : public color_space_type<typename memory_based_2d_locator<SI>::parent_t> {
        +
        314};
        +
        315
        +
        316template <typename SI>
        +
        317struct channel_mapping_type<memory_based_2d_locator<SI> > : public channel_mapping_type<typename memory_based_2d_locator<SI>::parent_t> {
        +
        318};
        +
        319
        +
        320template <typename SI>
        +
        321struct is_planar<memory_based_2d_locator<SI> > : public is_planar<typename memory_based_2d_locator<SI>::parent_t> {
        +
        322};
        +
        323
        +
        324template <typename SI>
        +
        325struct channel_type<memory_based_2d_locator<SI> > : public channel_type<typename memory_based_2d_locator<SI>::parent_t> {
        +
        326};
        +
        327
        +
        329// HasDynamicXStepTypeConcept
        +
        331
        +
        332// Take the base iterator of SI (which is typically a step iterator) and change it to have a step in x
        +
        333template <typename SI>
        +
        334struct dynamic_x_step_type<memory_based_2d_locator<SI> > {
        +
        335private:
        +
        336 using base_iterator_t = typename iterator_adaptor_get_base<SI>::type;
        +
        337 using base_iterator_step_t = typename dynamic_x_step_type<base_iterator_t>::type;
        +
        338 using dynamic_step_base_t = typename iterator_adaptor_rebind<SI, base_iterator_step_t>::type;
        +
        339public:
        +
        340 using type = memory_based_2d_locator<dynamic_step_base_t>;
        +
        341};
        +
        342
        +
        344// HasDynamicYStepTypeConcept
        +
        346
        +
        347template <typename SI>
        +
        348struct dynamic_y_step_type<memory_based_2d_locator<SI> > {
        +
        349 using type = memory_based_2d_locator<SI>;
        +
        350};
        +
        351} } // namespace boost::gil
        +
        352
        +
        353#endif
        +
        Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,...
        Definition locator.hpp:230
        +
        base class for models of PixelLocatorConcept
        Definition locator.hpp:109
        +
        2D point both axes of which have the same dimension typeModels: Point2DConcept
        Definition point.hpp:36
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Step iterator concept.
        Definition concepts/pixel_iterator.hpp:258
        +
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition metafunctions.hpp:36
        +
        Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor ...
        Definition pixel_iterator_adaptor.hpp:176
        +
        Definition locator.hpp:44
        diff --git a/html/reference/make__backend_8hpp_source.html b/html/reference/make__backend_8hpp_source.html index f9b2f1373..751537f27 100644 --- a/html/reference/make__backend_8hpp_source.html +++ b/html/reference/make__backend_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: make_backend.hpp Source File @@ -27,155 +27,160 @@

        - + +/* @license-end */ + +
        -
        -
        make_backend.hpp
        +
        make_backend.hpp
        -
        1 //
        -
        2 //
        -
        3 // Copyright 2012 Christian Henning
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_IO_MAKE_BACKEND_HPP
        -
        10 #define BOOST_GIL_IO_MAKE_BACKEND_HPP
        -
        11 
        -
        12 #include <boost/gil/detail/mp11.hpp>
        -
        13 #include <boost/gil/io/get_reader.hpp>
        -
        14 
        -
        15 #include <type_traits>
        -
        16 
        -
        17 namespace boost { namespace gil {
        -
        18 
        -
        19 template <typename String, typename FormatTag>
        -
        20 inline
        -
        21 auto make_reader_backend(
        -
        22  String const& file_name, image_read_settings<FormatTag> const& settings,
        -
        23  typename std::enable_if
        -
        24  <
        -
        25  mp11::mp_and
        -
        26  <
        -
        27  detail::is_supported_path_spec<String>,
        -
        28  is_format_tag<FormatTag>
        -
        29  >::value
        -
        30  >::type* /*dummy*/ = nullptr)
        -
        31  -> typename get_reader_backend<String, FormatTag>::type
        -
        32 {
        -
        33  using device_t = typename get_read_device<String, FormatTag>::type;
        -
        34 
        -
        35  device_t device(
        -
        36  detail::convert_to_native_string(file_name),
        -
        37  typename detail::file_stream_device<FormatTag>::read_tag());
        -
        38 
        -
        39  return reader_backend<device_t, FormatTag>(device, settings);
        -
        40 }
        -
        41 
        -
        42 template <typename FormatTag>
        -
        43 inline
        -
        44 auto make_reader_backend(
        -
        45  std::wstring const& file_name, image_read_settings<FormatTag> const& settings)
        -
        46  -> typename get_reader_backend<std::wstring, FormatTag>::type
        -
        47 {
        -
        48  char const* str = detail::convert_to_native_string(file_name);
        -
        49 
        -
        50  using device_t = typename get_read_device<std::wstring, FormatTag>::type;
        -
        51  device_t device(str, typename detail::file_stream_device<FormatTag>::read_tag());
        -
        52 
        -
        53  delete[] str; // TODO: RAII
        -
        54 
        -
        55  return reader_backend<device_t, FormatTag>(device, settings);
        -
        56 }
        -
        57 
        -
        58 template <typename FormatTag>
        -
        59 inline
        -
        60 auto make_reader_backend(
        -
        61  detail::filesystem::path const& path,
        -
        62  image_read_settings<FormatTag> const& settings)
        -
        63  -> typename get_reader_backend<std::wstring, FormatTag>::type
        -
        64 {
        -
        65  return make_reader_backend(path.wstring(), settings);
        -
        66 }
        -
        67 
        -
        68 template <typename Device, typename FormatTag>
        -
        69 inline
        -
        70 auto make_reader_backend(Device& io_dev, image_read_settings<FormatTag> const& settings,
        -
        71  typename std::enable_if
        -
        72  <
        -
        73  mp11::mp_and
        -
        74  <
        -
        75  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        76  is_format_tag<FormatTag>
        -
        77  >::value
        -
        78  >::type* /*dummy*/ = nullptr)
        -
        79  -> typename get_reader_backend<Device, FormatTag>::type
        -
        80 {
        -
        81  using device_t = typename get_read_device<Device, FormatTag>::type;
        -
        82  device_t device(io_dev);
        -
        83 
        -
        84  return reader_backend<device_t, FormatTag>(device, settings);
        -
        85 }
        -
        86 
        -
        87 template <typename String, typename FormatTag>
        -
        88 inline
        -
        89 auto make_reader_backend(String const& file_name, FormatTag const&,
        -
        90  typename std::enable_if
        -
        91  <
        -
        92  mp11::mp_and
        -
        93  <
        -
        94  detail::is_supported_path_spec<String>,
        -
        95  is_format_tag<FormatTag>
        -
        96  >::value
        -
        97  >::type* /*dummy*/ = nullptr)
        -
        98  -> typename get_reader_backend<String, FormatTag>::type
        -
        99 {
        -
        100  return make_reader_backend(file_name, image_read_settings<FormatTag>());
        -
        101 }
        -
        102 
        -
        103 template <typename Device, typename FormatTag>
        -
        104 inline
        -
        105 auto make_reader_backend(Device& io_dev, FormatTag const&,
        -
        106  typename std::enable_if
        -
        107  <
        -
        108  mp11::mp_and
        -
        109  <
        -
        110  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        111  is_format_tag<FormatTag>
        -
        112  >::value
        -
        113  >::type* /*dummy*/ = nullptr)
        -
        114  -> typename get_reader_backend<Device, FormatTag>::type
        -
        115 {
        -
        116  return make_reader_backend(io_dev, image_read_settings<FormatTag>());
        -
        117 }
        -
        118 
        -
        119 }} // namespace boost::gil
        -
        120 
        -
        121 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2//
        +
        3// Copyright 2012 Christian Henning
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_IO_MAKE_BACKEND_HPP
        +
        10#define BOOST_GIL_IO_MAKE_BACKEND_HPP
        +
        11
        +
        12#include <boost/gil/detail/mp11.hpp>
        +
        13#include <boost/gil/io/get_reader.hpp>
        +
        14
        +
        15#include <type_traits>
        +
        16
        +
        17namespace boost { namespace gil {
        +
        18
        +
        19template <typename String, typename FormatTag>
        +
        20inline
        +
        21auto make_reader_backend(
        +
        22 String const& file_name, image_read_settings<FormatTag> const& settings,
        +
        23 typename std::enable_if
        +
        24 <
        +
        25 mp11::mp_and
        +
        26 <
        +
        27 detail::is_supported_path_spec<String>,
        +
        28 is_format_tag<FormatTag>
        +
        29 >::value
        +
        30 >::type* /*dummy*/ = nullptr)
        +
        31 -> typename get_reader_backend<String, FormatTag>::type
        +
        32{
        +
        33 using device_t = typename get_read_device<String, FormatTag>::type;
        +
        34
        +
        35 device_t device(
        +
        36 detail::convert_to_native_string(file_name),
        +
        37 typename detail::file_stream_device<FormatTag>::read_tag());
        +
        38
        +
        39 return reader_backend<device_t, FormatTag>(device, settings);
        +
        40}
        +
        41
        +
        42template <typename FormatTag>
        +
        43inline
        +
        44auto make_reader_backend(
        +
        45 std::wstring const& file_name, image_read_settings<FormatTag> const& settings)
        +
        46 -> typename get_reader_backend<std::wstring, FormatTag>::type
        +
        47{
        +
        48 char const* str = detail::convert_to_native_string(file_name);
        +
        49
        +
        50 using device_t = typename get_read_device<std::wstring, FormatTag>::type;
        +
        51 device_t device(str, typename detail::file_stream_device<FormatTag>::read_tag());
        +
        52
        +
        53 delete[] str; // TODO: RAII
        +
        54
        +
        55 return reader_backend<device_t, FormatTag>(device, settings);
        +
        56}
        +
        57
        +
        58template <typename FormatTag>
        +
        59inline
        +
        60auto make_reader_backend(
        +
        61 detail::filesystem::path const& path,
        +
        62 image_read_settings<FormatTag> const& settings)
        +
        63 -> typename get_reader_backend<std::wstring, FormatTag>::type
        +
        64{
        +
        65 return make_reader_backend(path.wstring(), settings);
        +
        66}
        +
        67
        +
        68template <typename Device, typename FormatTag>
        +
        69inline
        +
        70auto make_reader_backend(Device& io_dev, image_read_settings<FormatTag> const& settings,
        +
        71 typename std::enable_if
        +
        72 <
        +
        73 mp11::mp_and
        +
        74 <
        +
        75 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        76 is_format_tag<FormatTag>
        +
        77 >::value
        +
        78 >::type* /*dummy*/ = nullptr)
        +
        79 -> typename get_reader_backend<Device, FormatTag>::type
        +
        80{
        +
        81 using device_t = typename get_read_device<Device, FormatTag>::type;
        +
        82 device_t device(io_dev);
        +
        83
        +
        84 return reader_backend<device_t, FormatTag>(device, settings);
        +
        85}
        +
        86
        +
        87template <typename String, typename FormatTag>
        +
        88inline
        +
        89auto make_reader_backend(String const& file_name, FormatTag const&,
        +
        90 typename std::enable_if
        +
        91 <
        +
        92 mp11::mp_and
        +
        93 <
        +
        94 detail::is_supported_path_spec<String>,
        +
        95 is_format_tag<FormatTag>
        +
        96 >::value
        +
        97 >::type* /*dummy*/ = nullptr)
        +
        98 -> typename get_reader_backend<String, FormatTag>::type
        +
        99{
        +
        100 return make_reader_backend(file_name, image_read_settings<FormatTag>());
        +
        101}
        +
        102
        +
        103template <typename Device, typename FormatTag>
        +
        104inline
        +
        105auto make_reader_backend(Device& io_dev, FormatTag const&,
        +
        106 typename std::enable_if
        +
        107 <
        +
        108 mp11::mp_and
        +
        109 <
        +
        110 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        111 is_format_tag<FormatTag>
        +
        112 >::value
        +
        113 >::type* /*dummy*/ = nullptr)
        +
        114 -> typename get_reader_backend<Device, FormatTag>::type
        +
        115{
        +
        116 return make_reader_backend(io_dev, image_read_settings<FormatTag>());
        +
        117}
        +
        118
        +
        119}} // namespace boost::gil
        +
        120
        +
        121#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/make__dynamic__image__reader_8hpp_source.html b/html/reference/make__dynamic__image__reader_8hpp_source.html index 170b5ff9f..80eb45d47 100644 --- a/html/reference/make__dynamic__image__reader_8hpp_source.html +++ b/html/reference/make__dynamic__image__reader_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: make_dynamic_image_reader.hpp Source File @@ -27,170 +27,175 @@

        - + +/* @license-end */ + +
        -
        -
        make_dynamic_image_reader.hpp
        +
        make_dynamic_image_reader.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_READER_HPP
        -
        9 #define BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_READER_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 #include <boost/gil/io/get_reader.hpp>
        -
        13 
        -
        14 #include <type_traits>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        18 template <typename String, typename FormatTag>
        -
        19 inline
        -
        20 auto make_dynamic_image_reader(
        -
        21  String const& file_name, image_read_settings<FormatTag> const& settings,
        -
        22  typename std::enable_if
        -
        23  <
        -
        24  mp11::mp_and
        -
        25  <
        -
        26  detail::is_supported_path_spec<String>,
        -
        27  is_format_tag<FormatTag>
        -
        28  >::value
        -
        29  >::type* /*dummy*/ = nullptr)
        -
        30  -> typename get_dynamic_image_reader<String, FormatTag>::type
        -
        31 {
        -
        32  using device_t = typename get_read_device<String, FormatTag>::type;
        -
        33  device_t device(
        -
        34  detail::convert_to_native_string(file_name),
        -
        35  typename detail::file_stream_device<FormatTag>::read_tag());
        -
        36 
        -
        37  return typename get_dynamic_image_reader<String, FormatTag>::type(device, settings);
        -
        38 }
        -
        39 
        -
        40 template <typename FormatTag>
        -
        41 inline
        -
        42 auto make_dynamic_image_reader(
        -
        43  std::wstring const& file_name, image_read_settings<FormatTag> const& settings)
        -
        44  -> typename get_dynamic_image_reader<std::wstring, FormatTag>::type
        -
        45 {
        -
        46  char const* str = detail::convert_to_native_string(file_name);
        -
        47 
        -
        48  using device_t = typename get_read_device<std::wstring, FormatTag>::type;
        -
        49  device_t device(str, typename detail::file_stream_device<FormatTag>::read_tag());
        -
        50 
        -
        51  delete[] str; // TODO: RAII
        -
        52 
        -
        53  return
        -
        54  typename get_dynamic_image_reader<std::wstring, FormatTag>::type(device, settings);
        -
        55 }
        -
        56 
        -
        57 template <typename FormatTag>
        -
        58 inline
        -
        59 auto make_dynamic_image_reader(
        -
        60  detail::filesystem::path const& path, image_read_settings<FormatTag> const& settings)
        -
        61  -> typename get_dynamic_image_reader<std::wstring, FormatTag>::type
        -
        62 {
        -
        63  return make_dynamic_image_reader(path.wstring(), settings);
        -
        64 }
        -
        65 
        -
        66 template <typename Device, typename FormatTag>
        -
        67 inline
        -
        68 auto make_dynamic_image_reader(
        -
        69  Device& file, image_read_settings<FormatTag> const& settings,
        -
        70  typename std::enable_if
        -
        71  <
        -
        72  mp11::mp_and
        -
        73  <
        -
        74  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        75  is_format_tag<FormatTag>
        -
        76  >::value
        -
        77  >::type* /*dummy*/ = nullptr)
        -
        78  -> typename get_dynamic_image_reader<Device, FormatTag>::type
        -
        79 {
        -
        80  typename get_read_device<Device, FormatTag>::type device(file);
        -
        81  return typename get_dynamic_image_reader<Device, FormatTag>::type(device, settings);
        -
        82 }
        -
        83 
        -
        84 // without image_read_settings
        -
        85 
        -
        86 template <typename String, typename FormatTag>
        -
        87 inline
        -
        88 auto make_dynamic_image_reader(String const& file_name, FormatTag const&,
        -
        89  typename std::enable_if
        -
        90  <
        -
        91  mp11::mp_and
        -
        92  <
        -
        93  detail::is_supported_path_spec<String>,
        -
        94  is_format_tag<FormatTag>
        -
        95  >::value
        -
        96  >::type* /*dummy*/ = nullptr)
        -
        97  -> typename get_dynamic_image_reader<String, FormatTag>::type
        -
        98 {
        -
        99  return make_dynamic_image_reader(file_name, image_read_settings<FormatTag>());
        -
        100 }
        -
        101 
        -
        102 template <typename FormatTag>
        -
        103 inline
        -
        104 auto make_dynamic_image_reader(std::wstring const& file_name, FormatTag const&)
        -
        105  -> typename get_dynamic_image_reader<std::wstring, FormatTag>::type
        -
        106 {
        -
        107  return make_dynamic_image_reader(file_name, image_read_settings<FormatTag>());
        -
        108 }
        -
        109 
        -
        110 template <typename FormatTag>
        -
        111 inline
        -
        112 auto make_dynamic_image_reader(detail::filesystem::path const& path, FormatTag const&)
        -
        113  -> typename get_dynamic_image_reader<std::wstring, FormatTag>::type
        -
        114 {
        -
        115  return make_dynamic_image_reader(path.wstring(), image_read_settings<FormatTag>());
        -
        116 }
        -
        117 
        -
        118 template <typename Device, typename FormatTag>
        -
        119 inline
        -
        120 auto make_dynamic_image_reader(Device& file, FormatTag const&,
        -
        121  typename std::enable_if
        -
        122  <
        -
        123  mp11::mp_and
        -
        124  <
        -
        125  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        126  is_format_tag<FormatTag>
        -
        127  >::value
        -
        128  >::type* /*dummy*/ = nullptr)
        -
        129  -> typename get_dynamic_image_reader<Device, FormatTag>::type
        -
        130 {
        -
        131  return make_dynamic_image_reader(file, image_read_settings<FormatTag>());
        -
        132 }
        -
        133 
        -
        134 }} // namespace boost::gil
        -
        135 
        -
        136 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_READER_HPP
        +
        9#define BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_READER_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12#include <boost/gil/io/get_reader.hpp>
        +
        13
        +
        14#include <type_traits>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        18template <typename String, typename FormatTag>
        +
        19inline
        +
        20auto make_dynamic_image_reader(
        +
        21 String const& file_name, image_read_settings<FormatTag> const& settings,
        +
        22 typename std::enable_if
        +
        23 <
        +
        24 mp11::mp_and
        +
        25 <
        +
        26 detail::is_supported_path_spec<String>,
        +
        27 is_format_tag<FormatTag>
        +
        28 >::value
        +
        29 >::type* /*dummy*/ = nullptr)
        +
        30 -> typename get_dynamic_image_reader<String, FormatTag>::type
        +
        31{
        +
        32 using device_t = typename get_read_device<String, FormatTag>::type;
        +
        33 device_t device(
        +
        34 detail::convert_to_native_string(file_name),
        +
        35 typename detail::file_stream_device<FormatTag>::read_tag());
        +
        36
        +
        37 return typename get_dynamic_image_reader<String, FormatTag>::type(device, settings);
        +
        38}
        +
        39
        +
        40template <typename FormatTag>
        +
        41inline
        +
        42auto make_dynamic_image_reader(
        +
        43 std::wstring const& file_name, image_read_settings<FormatTag> const& settings)
        +
        44 -> typename get_dynamic_image_reader<std::wstring, FormatTag>::type
        +
        45{
        +
        46 char const* str = detail::convert_to_native_string(file_name);
        +
        47
        +
        48 using device_t = typename get_read_device<std::wstring, FormatTag>::type;
        +
        49 device_t device(str, typename detail::file_stream_device<FormatTag>::read_tag());
        +
        50
        +
        51 delete[] str; // TODO: RAII
        +
        52
        +
        53 return
        +
        54 typename get_dynamic_image_reader<std::wstring, FormatTag>::type(device, settings);
        +
        55}
        +
        56
        +
        57template <typename FormatTag>
        +
        58inline
        +
        59auto make_dynamic_image_reader(
        +
        60 detail::filesystem::path const& path, image_read_settings<FormatTag> const& settings)
        +
        61 -> typename get_dynamic_image_reader<std::wstring, FormatTag>::type
        +
        62{
        +
        63 return make_dynamic_image_reader(path.wstring(), settings);
        +
        64}
        +
        65
        +
        66template <typename Device, typename FormatTag>
        +
        67inline
        +
        68auto make_dynamic_image_reader(
        +
        69 Device& file, image_read_settings<FormatTag> const& settings,
        +
        70 typename std::enable_if
        +
        71 <
        +
        72 mp11::mp_and
        +
        73 <
        +
        74 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        75 is_format_tag<FormatTag>
        +
        76 >::value
        +
        77 >::type* /*dummy*/ = nullptr)
        +
        78 -> typename get_dynamic_image_reader<Device, FormatTag>::type
        +
        79{
        +
        80 typename get_read_device<Device, FormatTag>::type device(file);
        +
        81 return typename get_dynamic_image_reader<Device, FormatTag>::type(device, settings);
        +
        82}
        +
        83
        +
        84// without image_read_settings
        +
        85
        +
        86template <typename String, typename FormatTag>
        +
        87inline
        +
        88auto make_dynamic_image_reader(String const& file_name, FormatTag const&,
        +
        89 typename std::enable_if
        +
        90 <
        +
        91 mp11::mp_and
        +
        92 <
        +
        93 detail::is_supported_path_spec<String>,
        +
        94 is_format_tag<FormatTag>
        +
        95 >::value
        +
        96 >::type* /*dummy*/ = nullptr)
        +
        97 -> typename get_dynamic_image_reader<String, FormatTag>::type
        +
        98{
        +
        99 return make_dynamic_image_reader(file_name, image_read_settings<FormatTag>());
        +
        100}
        +
        101
        +
        102template <typename FormatTag>
        +
        103inline
        +
        104auto make_dynamic_image_reader(std::wstring const& file_name, FormatTag const&)
        +
        105 -> typename get_dynamic_image_reader<std::wstring, FormatTag>::type
        +
        106{
        +
        107 return make_dynamic_image_reader(file_name, image_read_settings<FormatTag>());
        +
        108}
        +
        109
        +
        110template <typename FormatTag>
        +
        111inline
        +
        112auto make_dynamic_image_reader(detail::filesystem::path const& path, FormatTag const&)
        +
        113 -> typename get_dynamic_image_reader<std::wstring, FormatTag>::type
        +
        114{
        +
        115 return make_dynamic_image_reader(path.wstring(), image_read_settings<FormatTag>());
        +
        116}
        +
        117
        +
        118template <typename Device, typename FormatTag>
        +
        119inline
        +
        120auto make_dynamic_image_reader(Device& file, FormatTag const&,
        +
        121 typename std::enable_if
        +
        122 <
        +
        123 mp11::mp_and
        +
        124 <
        +
        125 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        126 is_format_tag<FormatTag>
        +
        127 >::value
        +
        128 >::type* /*dummy*/ = nullptr)
        +
        129 -> typename get_dynamic_image_reader<Device, FormatTag>::type
        +
        130{
        +
        131 return make_dynamic_image_reader(file, image_read_settings<FormatTag>());
        +
        132}
        +
        133
        +
        134}} // namespace boost::gil
        +
        135
        +
        136#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/make__dynamic__image__writer_8hpp_source.html b/html/reference/make__dynamic__image__writer_8hpp_source.html index ca63c0a21..d78ef9e4a 100644 --- a/html/reference/make__dynamic__image__writer_8hpp_source.html +++ b/html/reference/make__dynamic__image__writer_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: make_dynamic_image_writer.hpp Source File @@ -27,175 +27,180 @@

        - + +/* @license-end */ + +
        -
        -
        make_dynamic_image_writer.hpp
        +
        make_dynamic_image_writer.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_WRITER_HPP
        -
        9 #define BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_WRITER_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 #include <boost/gil/io/get_writer.hpp>
        -
        13 
        -
        14 #include <type_traits>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        18 template <typename String, typename FormatTag>
        -
        19 inline
        -
        20 auto make_dynamic_image_writer(
        -
        21  String const& file_name, image_write_info<FormatTag> const& info,
        -
        22  typename std::enable_if
        -
        23  <
        -
        24  mp11::mp_and
        -
        25  <
        -
        26  detail::is_supported_path_spec<String>,
        -
        27  is_format_tag<FormatTag>
        -
        28  >::value
        -
        29  >::type* /*dummy*/ = nullptr)
        -
        30  -> typename get_dynamic_image_writer<String, FormatTag>::type
        -
        31 {
        -
        32  using deveice_t = typename get_write_device<String, FormatTag>::type;
        -
        33  deveice_t device(
        -
        34  detail::convert_to_native_string(file_name),
        -
        35  typename detail::file_stream_device<FormatTag>::write_tag());
        -
        36 
        -
        37  return typename get_dynamic_image_writer<String, FormatTag>::type(device, info);
        -
        38 }
        -
        39 
        -
        40 template< typename FormatTag >
        -
        41 inline
        -
        42 auto make_dynamic_image_writer(std::wstring const& file_name, image_write_info<FormatTag> const& info)
        -
        43  -> typename get_dynamic_image_writer< std::wstring, FormatTag>::type
        -
        44 {
        -
        45  const char* str = detail::convert_to_native_string( file_name );
        -
        46 
        -
        47  typename get_write_device< std::wstring
        -
        48  , FormatTag
        -
        49  >::type device( str
        -
        50  , typename detail::file_stream_device< FormatTag >::write_tag()
        -
        51  );
        -
        52 
        -
        53  delete[] str; // TODO: RAII
        -
        54 
        -
        55  return typename get_dynamic_image_writer< std::wstring
        -
        56  , FormatTag
        -
        57  >::type( device
        -
        58  , info
        -
        59  );
        -
        60 }
        -
        61 
        -
        62 template <typename FormatTag>
        -
        63 inline
        -
        64 auto make_dynamic_image_writer(detail::filesystem::path const& path, image_write_info<FormatTag> const& info)
        -
        65  -> typename get_dynamic_image_writer<std::wstring, FormatTag>::type
        -
        66 {
        -
        67  return make_dynamic_image_writer(path.wstring(), info);
        -
        68 }
        -
        69 
        -
        70 template <typename Device, typename FormatTag>
        -
        71 inline
        -
        72 auto make_dynamic_image_writer(Device& file, image_write_info<FormatTag> const& info,
        -
        73  typename std::enable_if
        -
        74  <
        -
        75  mp11::mp_and
        -
        76  <
        -
        77  typename detail::is_adaptable_output_device<FormatTag, Device>::type,
        -
        78  is_format_tag<FormatTag>
        -
        79  >::value
        -
        80  >::type* /*dummy*/ = nullptr)
        -
        81  -> typename get_dynamic_image_writer<Device, FormatTag>::type
        -
        82 {
        -
        83  typename get_write_device<Device, FormatTag>::type device(file);
        -
        84  return typename get_dynamic_image_writer<Device, FormatTag>::type(device, info);
        -
        85 }
        -
        86 
        -
        87 // no image_write_info
        -
        88 
        -
        89 template <typename String, typename FormatTag>
        -
        90 inline
        -
        91 auto make_dynamic_image_writer(String const& file_name, FormatTag const&,
        -
        92  typename std::enable_if
        -
        93  <
        -
        94  mp11::mp_and
        -
        95  <
        -
        96  detail::is_supported_path_spec<String>,
        -
        97  is_format_tag<FormatTag>
        -
        98  >::value
        -
        99  >::type* /*dummy*/ = nullptr)
        -
        100  -> typename get_dynamic_image_writer<String, FormatTag>::type
        -
        101 {
        -
        102  return make_dynamic_image_writer(file_name, image_write_info<FormatTag>());
        -
        103 }
        -
        104 
        -
        105 template <typename FormatTag>
        -
        106 inline
        -
        107 auto make_dynamic_image_writer(std::wstring const& file_name, FormatTag const&)
        -
        108  -> typename get_dynamic_image_writer<std::wstring, FormatTag>::type
        -
        109 {
        -
        110  return make_dynamic_image_writer( file_name
        -
        111  , image_write_info< FormatTag >()
        -
        112  );
        -
        113 }
        -
        114 
        -
        115 template <typename FormatTag>
        -
        116 inline
        -
        117 auto make_dynamic_image_writer(detail::filesystem::path const& path, FormatTag const&)
        -
        118  -> typename get_dynamic_image_writer<std::wstring, FormatTag>::type
        -
        119 {
        -
        120  return make_dynamic_image_writer(path.wstring(), image_write_info<FormatTag>());
        -
        121 }
        -
        122 
        -
        123 template <typename Device, typename FormatTag>
        -
        124 inline
        -
        125 auto make_dynamic_image_writer(Device& file, FormatTag const&,
        -
        126  typename std::enable_if
        -
        127  <
        -
        128  mp11::mp_and
        -
        129  <
        -
        130  typename detail::is_adaptable_output_device<FormatTag, Device>::type,
        -
        131  is_format_tag<FormatTag>
        -
        132  >::value
        -
        133  >::type* /*dummy*/ = nullptr)
        -
        134  -> typename get_dynamic_image_writer<Device, FormatTag>::type
        -
        135 {
        -
        136  return make_dynamic_image_writer(file, image_write_info<FormatTag>());
        -
        137 }
        -
        138 
        -
        139 }} // namespace boost::gil
        -
        140 
        -
        141 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_WRITER_HPP
        +
        9#define BOOST_GIL_IO_MAKE_DYNAMIC_IMAGE_WRITER_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12#include <boost/gil/io/get_writer.hpp>
        +
        13
        +
        14#include <type_traits>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        18template <typename String, typename FormatTag>
        +
        19inline
        +
        20auto make_dynamic_image_writer(
        +
        21 String const& file_name, image_write_info<FormatTag> const& info,
        +
        22 typename std::enable_if
        +
        23 <
        +
        24 mp11::mp_and
        +
        25 <
        +
        26 detail::is_supported_path_spec<String>,
        +
        27 is_format_tag<FormatTag>
        +
        28 >::value
        +
        29 >::type* /*dummy*/ = nullptr)
        +
        30 -> typename get_dynamic_image_writer<String, FormatTag>::type
        +
        31{
        +
        32 using deveice_t = typename get_write_device<String, FormatTag>::type;
        +
        33 deveice_t device(
        +
        34 detail::convert_to_native_string(file_name),
        +
        35 typename detail::file_stream_device<FormatTag>::write_tag());
        +
        36
        +
        37 return typename get_dynamic_image_writer<String, FormatTag>::type(device, info);
        +
        38}
        +
        39
        +
        40template< typename FormatTag >
        +
        41inline
        +
        42auto make_dynamic_image_writer(std::wstring const& file_name, image_write_info<FormatTag> const& info)
        +
        43 -> typename get_dynamic_image_writer< std::wstring, FormatTag>::type
        +
        44{
        +
        45 const char* str = detail::convert_to_native_string( file_name );
        +
        46
        +
        47 typename get_write_device< std::wstring
        +
        48 , FormatTag
        +
        49 >::type device( str
        +
        50 , typename detail::file_stream_device< FormatTag >::write_tag()
        +
        51 );
        +
        52
        +
        53 delete[] str; // TODO: RAII
        +
        54
        +
        55 return typename get_dynamic_image_writer< std::wstring
        +
        56 , FormatTag
        +
        57 >::type( device
        +
        58 , info
        +
        59 );
        +
        60}
        +
        61
        +
        62template <typename FormatTag>
        +
        63inline
        +
        64auto make_dynamic_image_writer(detail::filesystem::path const& path, image_write_info<FormatTag> const& info)
        +
        65 -> typename get_dynamic_image_writer<std::wstring, FormatTag>::type
        +
        66{
        +
        67 return make_dynamic_image_writer(path.wstring(), info);
        +
        68}
        +
        69
        +
        70template <typename Device, typename FormatTag>
        +
        71inline
        +
        72auto make_dynamic_image_writer(Device& file, image_write_info<FormatTag> const& info,
        +
        73 typename std::enable_if
        +
        74 <
        +
        75 mp11::mp_and
        +
        76 <
        +
        77 typename detail::is_adaptable_output_device<FormatTag, Device>::type,
        +
        78 is_format_tag<FormatTag>
        +
        79 >::value
        +
        80 >::type* /*dummy*/ = nullptr)
        +
        81 -> typename get_dynamic_image_writer<Device, FormatTag>::type
        +
        82{
        +
        83 typename get_write_device<Device, FormatTag>::type device(file);
        +
        84 return typename get_dynamic_image_writer<Device, FormatTag>::type(device, info);
        +
        85}
        +
        86
        +
        87// no image_write_info
        +
        88
        +
        89template <typename String, typename FormatTag>
        +
        90inline
        +
        91auto make_dynamic_image_writer(String const& file_name, FormatTag const&,
        +
        92 typename std::enable_if
        +
        93 <
        +
        94 mp11::mp_and
        +
        95 <
        +
        96 detail::is_supported_path_spec<String>,
        +
        97 is_format_tag<FormatTag>
        +
        98 >::value
        +
        99 >::type* /*dummy*/ = nullptr)
        +
        100 -> typename get_dynamic_image_writer<String, FormatTag>::type
        +
        101{
        +
        102 return make_dynamic_image_writer(file_name, image_write_info<FormatTag>());
        +
        103}
        +
        104
        +
        105template <typename FormatTag>
        +
        106inline
        +
        107auto make_dynamic_image_writer(std::wstring const& file_name, FormatTag const&)
        +
        108 -> typename get_dynamic_image_writer<std::wstring, FormatTag>::type
        +
        109{
        +
        110 return make_dynamic_image_writer( file_name
        +
        111 , image_write_info< FormatTag >()
        +
        112 );
        +
        113}
        +
        114
        +
        115template <typename FormatTag>
        +
        116inline
        +
        117auto make_dynamic_image_writer(detail::filesystem::path const& path, FormatTag const&)
        +
        118 -> typename get_dynamic_image_writer<std::wstring, FormatTag>::type
        +
        119{
        +
        120 return make_dynamic_image_writer(path.wstring(), image_write_info<FormatTag>());
        +
        121}
        +
        122
        +
        123template <typename Device, typename FormatTag>
        +
        124inline
        +
        125auto make_dynamic_image_writer(Device& file, FormatTag const&,
        +
        126 typename std::enable_if
        +
        127 <
        +
        128 mp11::mp_and
        +
        129 <
        +
        130 typename detail::is_adaptable_output_device<FormatTag, Device>::type,
        +
        131 is_format_tag<FormatTag>
        +
        132 >::value
        +
        133 >::type* /*dummy*/ = nullptr)
        +
        134 -> typename get_dynamic_image_writer<Device, FormatTag>::type
        +
        135{
        +
        136 return make_dynamic_image_writer(file, image_write_info<FormatTag>());
        +
        137}
        +
        138
        +
        139}} // namespace boost::gil
        +
        140
        +
        141#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/make__reader_8hpp_source.html b/html/reference/make__reader_8hpp_source.html index 3b066a4ae..56d0011d7 100644 --- a/html/reference/make__reader_8hpp_source.html +++ b/html/reference/make__reader_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: make_reader.hpp Source File @@ -27,190 +27,195 @@

        - + +/* @license-end */ + +
        -
        -
        make_reader.hpp
        +
        make_reader.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_MAKE_READER_HPP
        -
        9 #define BOOST_GIL_IO_MAKE_READER_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 #include <boost/gil/io/get_reader.hpp>
        -
        13 
        -
        14 #include <type_traits>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        18 template <typename String, typename FormatTag, typename ConversionPolicy>
        -
        19 inline
        -
        20 auto make_reader(
        -
        21  String const&file_name,
        -
        22  image_read_settings<FormatTag> const& settings,
        -
        23  ConversionPolicy const&,
        -
        24  typename std::enable_if
        -
        25  <
        -
        26  mp11::mp_and
        -
        27  <
        -
        28  detail::is_supported_path_spec<String>,
        -
        29  is_format_tag<FormatTag>
        -
        30  >::value
        -
        31  >::type* /*dummy*/ = nullptr)
        -
        32  -> typename get_reader<String, FormatTag, ConversionPolicy>::type
        -
        33 {
        -
        34  typename get_read_device<String, FormatTag>::type device(
        -
        35  detail::convert_to_native_string(file_name),
        -
        36  typename detail::file_stream_device<FormatTag>::read_tag());
        -
        37 
        -
        38  return
        -
        39  typename get_reader<String, FormatTag, ConversionPolicy>::type(device, settings);
        -
        40 }
        -
        41 
        -
        42 template <typename FormatTag, typename ConversionPolicy>
        -
        43 inline
        -
        44 auto make_reader(std::wstring const &file_name, image_read_settings<FormatTag> const& settings, ConversionPolicy const&)
        -
        45  -> typename get_reader<std::wstring, FormatTag, ConversionPolicy>::type
        -
        46 {
        -
        47  const char* str = detail::convert_to_native_string( file_name );
        -
        48 
        -
        49  typename get_read_device< std::wstring
        -
        50  , FormatTag
        -
        51  >::type device( str
        -
        52  , typename detail::file_stream_device< FormatTag >::read_tag()
        -
        53  );
        -
        54 
        -
        55  delete[] str; // TODO: RAII
        -
        56 
        -
        57  return typename get_reader< std::wstring
        -
        58  , FormatTag
        -
        59  , ConversionPolicy
        -
        60  >::type( device
        -
        61  , settings
        -
        62  );
        -
        63 }
        -
        64 
        -
        65 template <typename FormatTag, typename ConversionPolicy>
        -
        66 inline
        -
        67 auto make_reader(detail::filesystem::path const& path, image_read_settings<FormatTag> const& settings, ConversionPolicy const& cc)
        -
        68  -> typename get_reader<std::wstring, FormatTag, ConversionPolicy>::type
        -
        69 {
        -
        70  return make_reader(path.wstring(), settings, cc);
        -
        71 }
        -
        72 
        -
        73 template <typename Device, typename FormatTag, typename ConversionPolicy>
        -
        74 inline
        -
        75 auto make_reader(
        -
        76  Device& file,
        -
        77  image_read_settings<FormatTag> const& settings,
        -
        78  ConversionPolicy const&,
        -
        79  typename std::enable_if
        -
        80  <
        -
        81  mp11::mp_and
        -
        82  <
        -
        83  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        84  is_format_tag<FormatTag>
        -
        85  >::value
        -
        86  >::type* /*dummy*/ = nullptr)
        -
        87  -> typename get_reader<Device, FormatTag, ConversionPolicy>::type
        -
        88 {
        -
        89  typename get_read_device<Device, FormatTag>::type device(file);
        -
        90 
        -
        91  return
        -
        92  typename get_reader<Device, FormatTag, ConversionPolicy>::type(device, settings);
        -
        93 }
        -
        94 
        -
        95 // no image_read_settings
        -
        96 
        -
        97 template <typename String, typename FormatTag, typename ConversionPolicy>
        -
        98 inline
        -
        99 auto make_reader(
        -
        100  String const&file_name,
        -
        101  FormatTag const&,
        -
        102  ConversionPolicy const& cc,
        -
        103  typename std::enable_if
        -
        104  <
        -
        105  mp11::mp_and
        -
        106  <
        -
        107  detail::is_supported_path_spec<String>,
        -
        108  is_format_tag<FormatTag>
        -
        109  >::value
        -
        110  >::type* /*dummy*/ = nullptr)
        -
        111  -> typename get_reader<String, FormatTag, ConversionPolicy>::type
        -
        112 {
        -
        113  return make_reader(file_name, image_read_settings<FormatTag>(), cc);
        -
        114 }
        -
        115 
        -
        116 template <typename FormatTag, typename ConversionPolicy>
        -
        117 inline
        -
        118 auto make_reader(std::wstring const &file_name, FormatTag const&, ConversionPolicy const& cc)
        -
        119  -> typename get_reader<std::wstring, FormatTag, ConversionPolicy>::type
        -
        120 {
        -
        121  return make_reader( file_name
        -
        122  , image_read_settings< FormatTag >()
        -
        123  , cc
        -
        124  );
        -
        125 }
        -
        126 
        -
        127 template <typename FormatTag, typename ConversionPolicy>
        -
        128 inline
        -
        129 auto make_reader(detail::filesystem::path const& path, FormatTag const&, ConversionPolicy const& cc)
        -
        130  -> typename get_reader<std::wstring, FormatTag, ConversionPolicy>::type
        -
        131 {
        -
        132  return make_reader(path.wstring(), image_read_settings<FormatTag>(), cc);
        -
        133 }
        -
        134 
        -
        135 template <typename Device, typename FormatTag, typename ConversionPolicy>
        -
        136 inline
        -
        137 auto make_reader(
        -
        138  Device& file,
        -
        139  FormatTag const&,
        -
        140  ConversionPolicy const& cc,
        -
        141  typename std::enable_if
        -
        142  <
        -
        143  mp11::mp_and
        -
        144  <
        -
        145  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        146  is_format_tag<FormatTag>
        -
        147  >::value
        -
        148  >::type* /*dummy*/ = nullptr)
        -
        149  -> typename get_reader<Device, FormatTag, ConversionPolicy>::type
        -
        150 {
        -
        151  return make_reader(file, image_read_settings<FormatTag>(), cc);
        -
        152 }
        -
        153 
        -
        154 }} // namespace boost::gil
        -
        155 
        -
        156 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_MAKE_READER_HPP
        +
        9#define BOOST_GIL_IO_MAKE_READER_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12#include <boost/gil/io/get_reader.hpp>
        +
        13
        +
        14#include <type_traits>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        18template <typename String, typename FormatTag, typename ConversionPolicy>
        +
        19inline
        +
        20auto make_reader(
        +
        21 String const&file_name,
        +
        22 image_read_settings<FormatTag> const& settings,
        +
        23 ConversionPolicy const&,
        +
        24 typename std::enable_if
        +
        25 <
        +
        26 mp11::mp_and
        +
        27 <
        +
        28 detail::is_supported_path_spec<String>,
        +
        29 is_format_tag<FormatTag>
        +
        30 >::value
        +
        31 >::type* /*dummy*/ = nullptr)
        +
        32 -> typename get_reader<String, FormatTag, ConversionPolicy>::type
        +
        33{
        +
        34 typename get_read_device<String, FormatTag>::type device(
        +
        35 detail::convert_to_native_string(file_name),
        +
        36 typename detail::file_stream_device<FormatTag>::read_tag());
        +
        37
        +
        38 return
        +
        39 typename get_reader<String, FormatTag, ConversionPolicy>::type(device, settings);
        +
        40}
        +
        41
        +
        42template <typename FormatTag, typename ConversionPolicy>
        +
        43inline
        +
        44auto make_reader(std::wstring const &file_name, image_read_settings<FormatTag> const& settings, ConversionPolicy const&)
        +
        45 -> typename get_reader<std::wstring, FormatTag, ConversionPolicy>::type
        +
        46{
        +
        47 const char* str = detail::convert_to_native_string( file_name );
        +
        48
        +
        49 typename get_read_device< std::wstring
        +
        50 , FormatTag
        +
        51 >::type device( str
        +
        52 , typename detail::file_stream_device< FormatTag >::read_tag()
        +
        53 );
        +
        54
        +
        55 delete[] str; // TODO: RAII
        +
        56
        +
        57 return typename get_reader< std::wstring
        +
        58 , FormatTag
        +
        59 , ConversionPolicy
        +
        60 >::type( device
        +
        61 , settings
        +
        62 );
        +
        63}
        +
        64
        +
        65template <typename FormatTag, typename ConversionPolicy>
        +
        66inline
        +
        67auto make_reader(detail::filesystem::path const& path, image_read_settings<FormatTag> const& settings, ConversionPolicy const& cc)
        +
        68 -> typename get_reader<std::wstring, FormatTag, ConversionPolicy>::type
        +
        69{
        +
        70 return make_reader(path.wstring(), settings, cc);
        +
        71}
        +
        72
        +
        73template <typename Device, typename FormatTag, typename ConversionPolicy>
        +
        74inline
        +
        75auto make_reader(
        +
        76 Device& file,
        +
        77 image_read_settings<FormatTag> const& settings,
        +
        78 ConversionPolicy const&,
        +
        79 typename std::enable_if
        +
        80 <
        +
        81 mp11::mp_and
        +
        82 <
        +
        83 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        84 is_format_tag<FormatTag>
        +
        85 >::value
        +
        86 >::type* /*dummy*/ = nullptr)
        +
        87 -> typename get_reader<Device, FormatTag, ConversionPolicy>::type
        +
        88{
        +
        89 typename get_read_device<Device, FormatTag>::type device(file);
        +
        90
        +
        91 return
        +
        92 typename get_reader<Device, FormatTag, ConversionPolicy>::type(device, settings);
        +
        93}
        +
        94
        +
        95// no image_read_settings
        +
        96
        +
        97template <typename String, typename FormatTag, typename ConversionPolicy>
        +
        98inline
        +
        99auto make_reader(
        +
        100 String const&file_name,
        +
        101 FormatTag const&,
        +
        102 ConversionPolicy const& cc,
        +
        103 typename std::enable_if
        +
        104 <
        +
        105 mp11::mp_and
        +
        106 <
        +
        107 detail::is_supported_path_spec<String>,
        +
        108 is_format_tag<FormatTag>
        +
        109 >::value
        +
        110 >::type* /*dummy*/ = nullptr)
        +
        111 -> typename get_reader<String, FormatTag, ConversionPolicy>::type
        +
        112{
        +
        113 return make_reader(file_name, image_read_settings<FormatTag>(), cc);
        +
        114}
        +
        115
        +
        116template <typename FormatTag, typename ConversionPolicy>
        +
        117inline
        +
        118auto make_reader(std::wstring const &file_name, FormatTag const&, ConversionPolicy const& cc)
        +
        119 -> typename get_reader<std::wstring, FormatTag, ConversionPolicy>::type
        +
        120{
        +
        121 return make_reader( file_name
        +
        122 , image_read_settings< FormatTag >()
        +
        123 , cc
        +
        124 );
        +
        125}
        +
        126
        +
        127template <typename FormatTag, typename ConversionPolicy>
        +
        128inline
        +
        129auto make_reader(detail::filesystem::path const& path, FormatTag const&, ConversionPolicy const& cc)
        +
        130 -> typename get_reader<std::wstring, FormatTag, ConversionPolicy>::type
        +
        131{
        +
        132 return make_reader(path.wstring(), image_read_settings<FormatTag>(), cc);
        +
        133}
        +
        134
        +
        135template <typename Device, typename FormatTag, typename ConversionPolicy>
        +
        136inline
        +
        137auto make_reader(
        +
        138 Device& file,
        +
        139 FormatTag const&,
        +
        140 ConversionPolicy const& cc,
        +
        141 typename std::enable_if
        +
        142 <
        +
        143 mp11::mp_and
        +
        144 <
        +
        145 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        146 is_format_tag<FormatTag>
        +
        147 >::value
        +
        148 >::type* /*dummy*/ = nullptr)
        +
        149 -> typename get_reader<Device, FormatTag, ConversionPolicy>::type
        +
        150{
        +
        151 return make_reader(file, image_read_settings<FormatTag>(), cc);
        +
        152}
        +
        153
        +
        154}} // namespace boost::gil
        +
        155
        +
        156#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/make__scanline__reader_8hpp_source.html b/html/reference/make__scanline__reader_8hpp_source.html index d28ac6a40..cb8195d64 100644 --- a/html/reference/make__scanline__reader_8hpp_source.html +++ b/html/reference/make__scanline__reader_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: make_scanline_reader.hpp Source File @@ -27,122 +27,127 @@

        - + +/* @license-end */ + +
        -
        -
        make_scanline_reader.hpp
        +
        make_scanline_reader.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_MAKE_SCANLINE_READER_HPP
        -
        9 #define BOOST_GIL_IO_MAKE_SCANLINE_READER_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 #include <boost/gil/io/get_reader.hpp>
        -
        13 
        -
        14 #include <type_traits>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        18 template <typename String, typename FormatTag>
        -
        19 inline
        -
        20 auto make_scanline_reader(String const& file_name, FormatTag const&,
        -
        21  typename std::enable_if
        -
        22  <
        -
        23  mp11::mp_and
        -
        24  <
        -
        25  detail::is_supported_path_spec<String>,
        -
        26  is_format_tag<FormatTag>
        -
        27  >::value
        -
        28  >::type* /*dummy*/ = nullptr)
        -
        29  -> typename get_scanline_reader<String, FormatTag>::type
        -
        30 {
        -
        31  using device_t = typename get_read_device<String, FormatTag>::type;
        -
        32  device_t device(
        -
        33  detail::convert_to_native_string(file_name),
        -
        34  typename detail::file_stream_device<FormatTag>::read_tag());
        -
        35 
        -
        36  return typename get_scanline_reader<String, FormatTag>::type(
        -
        37  device, image_read_settings<FormatTag>());
        -
        38 }
        -
        39 
        -
        40 template <typename FormatTag>
        -
        41 inline
        -
        42 auto make_scanline_reader(std::wstring const& file_name, FormatTag const&)
        -
        43  -> typename get_scanline_reader<std::wstring, FormatTag>::type
        -
        44 {
        -
        45  const char* str = detail::convert_to_native_string( file_name );
        -
        46 
        -
        47  typename get_read_device< std::wstring
        -
        48  , FormatTag
        -
        49  >::type device( str
        -
        50  , typename detail::file_stream_device< FormatTag >::read_tag()
        -
        51  );
        -
        52 
        -
        53  delete[] str;
        -
        54 
        -
        55  return typename get_scanline_reader< std::wstring
        -
        56  , FormatTag
        -
        57  >::type( device
        -
        58  , image_read_settings< FormatTag >()
        -
        59  );
        -
        60 }
        -
        61 
        -
        62 template <typename FormatTag>
        -
        63 inline
        -
        64 auto make_scanline_reader(detail::filesystem::path const& path, FormatTag const&)
        -
        65  -> typename get_scanline_reader<std::wstring, FormatTag>::type
        -
        66 {
        -
        67  return make_scanline_reader(path.wstring(), image_read_settings<FormatTag>());
        -
        68 }
        -
        69 
        -
        70 template <typename Device, typename FormatTag>
        -
        71 inline
        -
        72 auto make_scanline_reader(Device& io_dev, FormatTag const&,
        -
        73  typename std::enable_if
        -
        74  <
        -
        75  mp11::mp_and
        -
        76  <
        -
        77  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        78  is_format_tag<FormatTag>
        -
        79  >::value
        -
        80  >::type* /*dummy*/ = nullptr)
        -
        81  -> typename get_scanline_reader<Device, FormatTag>::type
        -
        82 {
        -
        83  return make_scanline_reader(io_dev, image_read_settings<FormatTag>());
        -
        84 }
        -
        85 
        -
        86 }} // namespace boost::gil
        -
        87 
        -
        88 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_MAKE_SCANLINE_READER_HPP
        +
        9#define BOOST_GIL_IO_MAKE_SCANLINE_READER_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12#include <boost/gil/io/get_reader.hpp>
        +
        13
        +
        14#include <type_traits>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        18template <typename String, typename FormatTag>
        +
        19inline
        +
        20auto make_scanline_reader(String const& file_name, FormatTag const&,
        +
        21 typename std::enable_if
        +
        22 <
        +
        23 mp11::mp_and
        +
        24 <
        +
        25 detail::is_supported_path_spec<String>,
        +
        26 is_format_tag<FormatTag>
        +
        27 >::value
        +
        28 >::type* /*dummy*/ = nullptr)
        +
        29 -> typename get_scanline_reader<String, FormatTag>::type
        +
        30{
        +
        31 using device_t = typename get_read_device<String, FormatTag>::type;
        +
        32 device_t device(
        +
        33 detail::convert_to_native_string(file_name),
        +
        34 typename detail::file_stream_device<FormatTag>::read_tag());
        +
        35
        +
        36 return typename get_scanline_reader<String, FormatTag>::type(
        +
        37 device, image_read_settings<FormatTag>());
        +
        38}
        +
        39
        +
        40template <typename FormatTag>
        +
        41inline
        +
        42auto make_scanline_reader(std::wstring const& file_name, FormatTag const&)
        +
        43 -> typename get_scanline_reader<std::wstring, FormatTag>::type
        +
        44{
        +
        45 const char* str = detail::convert_to_native_string( file_name );
        +
        46
        +
        47 typename get_read_device< std::wstring
        +
        48 , FormatTag
        +
        49 >::type device( str
        +
        50 , typename detail::file_stream_device< FormatTag >::read_tag()
        +
        51 );
        +
        52
        +
        53 delete[] str;
        +
        54
        +
        55 return typename get_scanline_reader< std::wstring
        +
        56 , FormatTag
        +
        57 >::type( device
        +
        58 , image_read_settings< FormatTag >()
        +
        59 );
        +
        60}
        +
        61
        +
        62template <typename FormatTag>
        +
        63inline
        +
        64auto make_scanline_reader(detail::filesystem::path const& path, FormatTag const&)
        +
        65 -> typename get_scanline_reader<std::wstring, FormatTag>::type
        +
        66{
        +
        67 return make_scanline_reader(path.wstring(), image_read_settings<FormatTag>());
        +
        68}
        +
        69
        +
        70template <typename Device, typename FormatTag>
        +
        71inline
        +
        72auto make_scanline_reader(Device& io_dev, FormatTag const&,
        +
        73 typename std::enable_if
        +
        74 <
        +
        75 mp11::mp_and
        +
        76 <
        +
        77 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        78 is_format_tag<FormatTag>
        +
        79 >::value
        +
        80 >::type* /*dummy*/ = nullptr)
        +
        81 -> typename get_scanline_reader<Device, FormatTag>::type
        +
        82{
        +
        83 return make_scanline_reader(io_dev, image_read_settings<FormatTag>());
        +
        84}
        +
        85
        +
        86}} // namespace boost::gil
        +
        87
        +
        88#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/make__writer_8hpp_source.html b/html/reference/make__writer_8hpp_source.html index bfea23eb5..e4253d119 100644 --- a/html/reference/make__writer_8hpp_source.html +++ b/html/reference/make__writer_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: make_writer.hpp Source File @@ -27,172 +27,177 @@

        - + +/* @license-end */ + +
        -
        -
        make_writer.hpp
        +
        make_writer.hpp
        -
        1 //
        -
        2 // Copyright 2012 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_MAKE_WRITER_HPP
        -
        9 #define BOOST_GIL_IO_MAKE_WRITER_HPP
        -
        10 
        -
        11 #include <boost/gil/detail/mp11.hpp>
        -
        12 #include <boost/gil/io/get_writer.hpp>
        -
        13 
        -
        14 #include <type_traits>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        18 template <typename String, typename FormatTag>
        -
        19 inline
        -
        20 auto make_writer(String const& file_name, image_write_info<FormatTag> const& info,
        -
        21  typename std::enable_if
        -
        22  <
        -
        23  mp11::mp_and
        -
        24  <
        -
        25  detail::is_supported_path_spec<String>,
        -
        26  is_format_tag<FormatTag>
        -
        27  >::value>::type* /*dummy*/ = nullptr)
        -
        28  -> typename get_writer<String, FormatTag>::type
        -
        29 {
        -
        30  typename get_write_device<String, FormatTag>::type device(
        -
        31  detail::convert_to_native_string(file_name),
        -
        32  typename detail::file_stream_device<FormatTag>::write_tag());
        -
        33 
        -
        34  return typename get_writer<String, FormatTag>::type(device, info);
        -
        35 }
        -
        36 
        -
        37 template <typename FormatTag>
        -
        38 inline
        -
        39 auto make_writer(std::wstring const& file_name, image_write_info<FormatTag> const& info)
        -
        40  -> typename get_writer<std::wstring, FormatTag>::type
        -
        41 {
        -
        42  const char* str = detail::convert_to_native_string( file_name );
        -
        43 
        -
        44  typename get_write_device< std::wstring
        -
        45  , FormatTag
        -
        46  >::type device( str
        -
        47  , typename detail::file_stream_device< FormatTag >::write_tag()
        -
        48  );
        -
        49 
        -
        50  delete[] str;
        -
        51 
        -
        52  return typename get_writer< std::wstring
        -
        53  , FormatTag
        -
        54  >::type( device
        -
        55  , info
        -
        56  );
        -
        57 }
        -
        58 
        -
        59 template <typename FormatTag>
        -
        60 inline
        -
        61 auto make_writer(detail::filesystem::path const& path, image_write_info<FormatTag> const& info)
        -
        62  -> typename get_writer<std::wstring, FormatTag>::type
        -
        63 {
        -
        64  return make_writer(path.wstring(), info);
        -
        65 }
        -
        66 
        -
        67 template <typename Device, typename FormatTag>
        -
        68 inline
        -
        69 auto make_writer(Device& file, image_write_info<FormatTag> const& info,
        -
        70  typename std::enable_if
        -
        71  <
        -
        72  mp11::mp_and
        -
        73  <
        -
        74  typename detail::is_adaptable_output_device<FormatTag, Device>::type,
        -
        75  is_format_tag<FormatTag>
        -
        76  >::value
        -
        77  >::type* /*dummy*/ = nullptr)
        -
        78  -> typename get_writer<Device, FormatTag>::type
        -
        79 {
        -
        80  typename get_write_device<Device, FormatTag>::type device(file);
        -
        81  return typename get_writer<Device, FormatTag>::type(device, info);
        -
        82 }
        -
        83 
        -
        84 // no image_write_info
        -
        85 
        -
        86 template <typename String, typename FormatTag>
        -
        87 inline
        -
        88 auto make_writer(String const& file_name, FormatTag const&,
        -
        89  typename std::enable_if
        -
        90  <
        -
        91  mp11::mp_and
        -
        92  <
        -
        93  detail::is_supported_path_spec<String>,
        -
        94  is_format_tag<FormatTag>
        -
        95  >::value
        -
        96  >::type* /*dummy*/ = nullptr)
        -
        97  -> typename get_writer<String, FormatTag>::type
        -
        98 {
        -
        99  return make_writer(file_name, image_write_info<FormatTag>());
        -
        100 }
        -
        101 
        -
        102 template <typename FormatTag>
        -
        103 inline
        -
        104 auto make_writer(std::wstring const &file_name, FormatTag const&)
        -
        105  -> typename get_writer<std::wstring, FormatTag>::type
        -
        106 {
        -
        107  return make_writer( file_name
        -
        108  , image_write_info< FormatTag >()
        -
        109  );
        -
        110 }
        -
        111 
        -
        112 template <typename FormatTag>
        -
        113 inline
        -
        114 auto make_writer(detail::filesystem::path const& path, FormatTag const& tag)
        -
        115  -> typename get_writer<std::wstring, FormatTag>::type
        -
        116 {
        -
        117  return make_writer(path.wstring(), tag);
        -
        118 }
        -
        119 
        -
        120 template <typename Device, typename FormatTag>
        -
        121 inline
        -
        122 auto make_writer(Device& file, FormatTag const&,
        -
        123  typename std::enable_if
        -
        124  <
        -
        125  mp11::mp_and
        -
        126  <
        -
        127  typename detail::is_adaptable_output_device<FormatTag, Device>::type,
        -
        128  is_format_tag<FormatTag>
        -
        129  >::value
        -
        130  >::type* /*dummy*/ = nullptr)
        -
        131  -> typename get_writer<Device, FormatTag>::type
        -
        132 {
        -
        133  return make_writer(file, image_write_info<FormatTag>());
        -
        134 }
        -
        135 
        -
        136 }} // namespace boost::gil
        -
        137 
        -
        138 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2012 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_MAKE_WRITER_HPP
        +
        9#define BOOST_GIL_IO_MAKE_WRITER_HPP
        +
        10
        +
        11#include <boost/gil/detail/mp11.hpp>
        +
        12#include <boost/gil/io/get_writer.hpp>
        +
        13
        +
        14#include <type_traits>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        18template <typename String, typename FormatTag>
        +
        19inline
        +
        20auto make_writer(String const& file_name, image_write_info<FormatTag> const& info,
        +
        21 typename std::enable_if
        +
        22 <
        +
        23 mp11::mp_and
        +
        24 <
        +
        25 detail::is_supported_path_spec<String>,
        +
        26 is_format_tag<FormatTag>
        +
        27 >::value>::type* /*dummy*/ = nullptr)
        +
        28 -> typename get_writer<String, FormatTag>::type
        +
        29{
        +
        30 typename get_write_device<String, FormatTag>::type device(
        +
        31 detail::convert_to_native_string(file_name),
        +
        32 typename detail::file_stream_device<FormatTag>::write_tag());
        +
        33
        +
        34 return typename get_writer<String, FormatTag>::type(device, info);
        +
        35}
        +
        36
        +
        37template <typename FormatTag>
        +
        38inline
        +
        39auto make_writer(std::wstring const& file_name, image_write_info<FormatTag> const& info)
        +
        40 -> typename get_writer<std::wstring, FormatTag>::type
        +
        41{
        +
        42 const char* str = detail::convert_to_native_string( file_name );
        +
        43
        +
        44 typename get_write_device< std::wstring
        +
        45 , FormatTag
        +
        46 >::type device( str
        +
        47 , typename detail::file_stream_device< FormatTag >::write_tag()
        +
        48 );
        +
        49
        +
        50 delete[] str;
        +
        51
        +
        52 return typename get_writer< std::wstring
        +
        53 , FormatTag
        +
        54 >::type( device
        +
        55 , info
        +
        56 );
        +
        57}
        +
        58
        +
        59template <typename FormatTag>
        +
        60inline
        +
        61auto make_writer(detail::filesystem::path const& path, image_write_info<FormatTag> const& info)
        +
        62 -> typename get_writer<std::wstring, FormatTag>::type
        +
        63{
        +
        64 return make_writer(path.wstring(), info);
        +
        65}
        +
        66
        +
        67template <typename Device, typename FormatTag>
        +
        68inline
        +
        69auto make_writer(Device& file, image_write_info<FormatTag> const& info,
        +
        70 typename std::enable_if
        +
        71 <
        +
        72 mp11::mp_and
        +
        73 <
        +
        74 typename detail::is_adaptable_output_device<FormatTag, Device>::type,
        +
        75 is_format_tag<FormatTag>
        +
        76 >::value
        +
        77 >::type* /*dummy*/ = nullptr)
        +
        78 -> typename get_writer<Device, FormatTag>::type
        +
        79{
        +
        80 typename get_write_device<Device, FormatTag>::type device(file);
        +
        81 return typename get_writer<Device, FormatTag>::type(device, info);
        +
        82}
        +
        83
        +
        84// no image_write_info
        +
        85
        +
        86template <typename String, typename FormatTag>
        +
        87inline
        +
        88auto make_writer(String const& file_name, FormatTag const&,
        +
        89 typename std::enable_if
        +
        90 <
        +
        91 mp11::mp_and
        +
        92 <
        +
        93 detail::is_supported_path_spec<String>,
        +
        94 is_format_tag<FormatTag>
        +
        95 >::value
        +
        96 >::type* /*dummy*/ = nullptr)
        +
        97 -> typename get_writer<String, FormatTag>::type
        +
        98{
        +
        99 return make_writer(file_name, image_write_info<FormatTag>());
        +
        100}
        +
        101
        +
        102template <typename FormatTag>
        +
        103inline
        +
        104auto make_writer(std::wstring const &file_name, FormatTag const&)
        +
        105 -> typename get_writer<std::wstring, FormatTag>::type
        +
        106{
        +
        107 return make_writer( file_name
        +
        108 , image_write_info< FormatTag >()
        +
        109 );
        +
        110}
        +
        111
        +
        112template <typename FormatTag>
        +
        113inline
        +
        114auto make_writer(detail::filesystem::path const& path, FormatTag const& tag)
        +
        115 -> typename get_writer<std::wstring, FormatTag>::type
        +
        116{
        +
        117 return make_writer(path.wstring(), tag);
        +
        118}
        +
        119
        +
        120template <typename Device, typename FormatTag>
        +
        121inline
        +
        122auto make_writer(Device& file, FormatTag const&,
        +
        123 typename std::enable_if
        +
        124 <
        +
        125 mp11::mp_and
        +
        126 <
        +
        127 typename detail::is_adaptable_output_device<FormatTag, Device>::type,
        +
        128 is_format_tag<FormatTag>
        +
        129 >::value
        +
        130 >::type* /*dummy*/ = nullptr)
        +
        131 -> typename get_writer<Device, FormatTag>::type
        +
        132{
        +
        133 return make_writer(file, image_write_info<FormatTag>());
        +
        134}
        +
        135
        +
        136}} // namespace boost::gil
        +
        137
        +
        138#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/menu.js b/html/reference/menu.js index 2fe2214f2..b0b26936a 100644 --- a/html/reference/menu.js +++ b/html/reference/menu.js @@ -28,7 +28,15 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { if ('children' in data) { result+='
          '; for (var i in data.children) { - result+='
        • '+ + var url; + var link; + link = data.children[i].url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + } else { + url = relPath+link; + } + result+='
        • '+ data.children[i].text+''+ makeTree(data.children[i],relPath)+'
        • '; } @@ -36,16 +44,93 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { } return result; } - - $('#main-nav').append(makeTree(menudata,relPath)); - $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + var searchBoxHtml; if (searchEnabled) { if (serverSide) { - $('#main-menu').append('
        • '); + searchBoxHtml='
          '+ + '
          '+ + '
           '+ + ''+ + '
          '+ + '
          '+ + '
          '+ + '
          '; } else { - $('#main-menu').append('
        • '); + searchBoxHtml='
          '+ + ''+ + ' '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
          '; } } + + $('#main-nav').before('
          '+ + ''+ + ''+ + '
          '); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBoxHtml) { + $('#main-menu').append('
        • '); + } + var $mainMenuState = $('#main-menu-state'); + var prevWidth = 0; + if ($mainMenuState.length) { + function initResizableIfExists() { + if (typeof initResizable==='function') initResizable(); + } + // animate mobile menu + $mainMenuState.change(function(e) { + var $menu = $('#main-menu'); + var options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = function() { $menu.css('display', 'block') }; + $menu.hide().slideDown(options); + } else { + options['complete'] = function() { $menu.css('display', 'none') }; + $menu.show().slideUp(options); + } + }); + // set default menu visibility + function resetState() { + var $menu = $('#main-menu'); + var $mainMenuState = $('#main-menu-state'); + var newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBoxHtml); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBoxHtml); + $('#searchBoxPos2').show(); + } + if (typeof searchBox!=='undefined') { + searchBox.CloseResultsWindow(); + } + prevWidth = newWidth; + } + } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); + } $('#main-menu').smartmenus(); } /* @license-end */ diff --git a/html/reference/menudata.js b/html/reference/menudata.js index 770862ea7..15ec1bffe 100644 --- a/html/reference/menudata.js +++ b/html/reference/menudata.js @@ -25,7 +25,7 @@ var menudata={children:[ {text:"Main Page",url:"index.html"}, {text:"Related Pages",url:"pages.html"}, -{text:"Modules",url:"modules.html"}, +{text:"Topics",url:"topics.html"}, {text:"Namespaces",url:"namespaces.html",children:[ {text:"Namespace List",url:"namespaces.html"}]}, {text:"Classes",url:"annotated.html",children:[ diff --git a/html/reference/metafunctions_8hpp_source.html b/html/reference/metafunctions_8hpp_source.html index 37317164a..a57e87005 100644 --- a/html/reference/metafunctions_8hpp_source.html +++ b/html/reference/metafunctions_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: metafunctions.hpp Source File @@ -27,691 +27,744 @@

        - + +/* @license-end */ + +
        -
        -
        metafunctions.hpp
        +
        metafunctions.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_METAFUNCTIONS_HPP
        -
        10 #define BOOST_GIL_METAFUNCTIONS_HPP
        -
        11 
        -
        12 #include <boost/gil/channel.hpp>
        -
        13 #include <boost/gil/dynamic_step.hpp>
        -
        14 #include <boost/gil/concepts.hpp>
        -
        15 #include <boost/gil/concepts/detail/type_traits.hpp>
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 
        -
        18 #include <iterator>
        -
        19 #include <type_traits>
        -
        20 
        -
        21 namespace boost { namespace gil {
        -
        22 
        -
        23 // forward declarations
        -
        24 template <typename T, typename L> struct pixel;
        -
        25 template <typename BitField,typename ChannelRefs,typename Layout> struct packed_pixel;
        -
        26 template <typename T, typename C> struct planar_pixel_reference;
        -
        27 template <typename IC, typename C> struct planar_pixel_iterator;
        -
        28 template <typename I> class memory_based_step_iterator;
        -
        29 template <typename I> class memory_based_2d_locator;
        -
        30 template <typename L> class image_view;
        -
        31 template <typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> > class image;
        -
        32 template <typename T> struct channel_type;
        -
        33 template <typename T> struct color_space_type;
        -
        34 template <typename T> struct channel_mapping_type;
        -
        35 template <typename It> struct is_iterator_adaptor;
        -
        36 template <typename It> struct iterator_adaptor_get_base;
        -
        37 template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable> struct bit_aligned_pixel_reference;
        -
        38 
        -
        45 
        -
        46 
        -
        53 
        -
        57 template <typename PixelRef>
        -
        58 struct pixel_reference_is_basic : public std::false_type {};
        -
        59 
        -
        60 template <typename T, typename L>
        -
        61 struct pixel_reference_is_basic<pixel<T, L>&> : std::true_type {};
        -
        62 
        -
        63 template <typename T, typename L>
        -
        64 struct pixel_reference_is_basic<const pixel<T, L>&> : std::true_type {};
        -
        65 
        -
        66 template <typename TR, typename CS>
        -
        67 struct pixel_reference_is_basic<planar_pixel_reference<TR, CS>> : std::true_type {};
        -
        68 
        -
        69 template <typename TR, typename CS>
        -
        70 struct pixel_reference_is_basic<const planar_pixel_reference<TR, CS>> : std::true_type {};
        -
        71 
        -
        75 template <typename Iterator>
        -
        76 struct iterator_is_basic : std::false_type {};
        -
        77 
        -
        79 template <typename T, typename L>
        -
        80 struct iterator_is_basic<pixel<T, L>*> : std::true_type {};
        -
        81 
        -
        83 template <typename T, typename L>
        -
        84 struct iterator_is_basic<pixel<T, L> const*> : std::true_type {};
        -
        85 
        -
        87 template <typename T, typename CS>
        -
        88 struct iterator_is_basic<planar_pixel_iterator<T*, CS>> : std::true_type {};
        -
        89 
        -
        91 template <typename T, typename CS>
        -
        92 struct iterator_is_basic<planar_pixel_iterator<T const*, CS>> : std::true_type {};
        -
        93 
        -
        95 template <typename T, typename L>
        -
        96 struct iterator_is_basic<memory_based_step_iterator<pixel<T, L>*>> : std::true_type {};
        -
        97 
        -
        99 template <typename T, typename L>
        -
        100 struct iterator_is_basic<memory_based_step_iterator<pixel<T, L> const*>> : std::true_type {};
        -
        101 
        -
        103 template <typename T, typename CS>
        - -
        105  : std::true_type
        -
        106 {};
        -
        107 
        -
        109 template <typename T, typename CS>
        - -
        111  : std::true_type
        -
        112 {};
        -
        113 
        -
        114 
        -
        117 template <typename Loc>
        -
        118 struct locator_is_basic : std::false_type {};
        -
        119 
        -
        120 template <typename Iterator>
        -
        121 struct locator_is_basic
        -
        122  <
        - -
        124  > : iterator_is_basic<Iterator>
        -
        125 {};
        -
        126 
        -
        129 template <typename View>
        -
        130 struct view_is_basic : std::false_type {};
        -
        131 
        -
        132 template <typename Loc>
        -
        133 struct view_is_basic<image_view<Loc>> : locator_is_basic<Loc> {};
        -
        134 
        -
        137 template <typename Img>
        -
        138 struct image_is_basic : std::false_type {};
        -
        139 
        -
        140 template <typename Pixel, bool IsPlanar, typename Alloc>
        -
        141 struct image_is_basic<image<Pixel, IsPlanar, Alloc>> : std::true_type {};
        -
        142 
        -
        143 
        -
        147 
        -
        148 template <typename I>
        -
        149 struct iterator_is_step;
        -
        150 
        -
        151 namespace detail {
        -
        152 
        -
        153 template <typename It, bool IsBase, bool EqualsStepType>
        -
        154 struct iterator_is_step_impl;
        -
        155 
        -
        156 // iterator that has the same type as its dynamic_x_step_type must be a step iterator
        -
        157 template <typename It, bool IsBase>
        -
        158 struct iterator_is_step_impl<It, IsBase, true> : std::true_type {};
        -
        159 
        -
        160 // base iterator can never be a step iterator
        -
        161 template <typename It>
        -
        162 struct iterator_is_step_impl<It, true, false> : std::false_type {};
        -
        163 
        -
        164 // for an iterator adaptor, see if its base is step
        -
        165 template <typename It>
        -
        166 struct iterator_is_step_impl<It, false, false>
        -
        167  : public iterator_is_step<typename iterator_adaptor_get_base<It>::type> {};
        -
        168 
        -
        169 } // namespace detail
        -
        170 
        -
        173 template <typename I>
        - -
        175  : detail::iterator_is_step_impl
        -
        176  <
        -
        177  I,
        -
        178  !is_iterator_adaptor<I>::value,
        -
        179  std::is_same<I, typename dynamic_x_step_type<I>::type
        -
        180  >::value
        -
        181 >
        -
        182 {};
        -
        183 
        -
        186 template <typename L> struct locator_is_step_in_x : public iterator_is_step<typename L::x_iterator> {};
        -
        187 
        -
        190 template <typename L> struct locator_is_step_in_y : public iterator_is_step<typename L::y_iterator> {};
        -
        191 
        -
        194 template <typename V> struct view_is_step_in_x : public locator_is_step_in_x<typename V::xy_locator> {};
        -
        195 
        -
        198 template <typename V> struct view_is_step_in_y : public locator_is_step_in_y<typename V::xy_locator> {};
        -
        199 
        -
        202 template <typename PixelReference>
        - -
        204  : mp11::mp_not
        -
        205  <
        -
        206  std::is_same
        -
        207  <
        -
        208  typename detail::remove_const_and_reference<PixelReference>::type,
        -
        209  typename detail::remove_const_and_reference<PixelReference>::type::value_type
        -
        210  >
        -
        211  >
        -
        212 {};
        -
        213 
        -
        216 template <typename Pixel>
        - -
        218  : mp11::mp_or<is_reference<Pixel>, pixel_reference_is_proxy<Pixel>> {};
        -
        219 
        -
        223 
        -
        228 template <typename R>
        - -
        230  : std::integral_constant<bool, std::remove_reference<R>::type::is_mutable>
        -
        231 {};
        -
        232 
        -
        233 template <typename R>
        -
        234 struct pixel_reference_is_mutable<R const&>
        -
        235  : mp11::mp_and<pixel_reference_is_proxy<R>, pixel_reference_is_mutable<R>>
        -
        236 {};
        -
        237 
        -
        240 template <typename L> struct locator_is_mutable : public iterator_is_mutable<typename L::x_iterator> {};
        -
        243 template <typename V> struct view_is_mutable : public iterator_is_mutable<typename V::x_iterator> {};
        -
        244 
        -
        245 
        -
        252 
        -
        256 
        -
        260 
        -
        264 
        -
        267 template <typename T, typename L, bool IsPlanar=false, bool IsMutable=true> struct pixel_reference_type{};
        -
        268 template <typename T, typename L> struct pixel_reference_type<T,L,false,true > { using type = pixel<T,L>&; };
        -
        269 template <typename T, typename L> struct pixel_reference_type<T,L,false,false> { using type = pixel<T,L> const&; };
        -
        270 template <typename T, typename L> struct pixel_reference_type<T,L,true,true> { using type = planar_pixel_reference<typename channel_traits<T>::reference,typename color_space_type<L>::type> const; }; // TODO: Assert M=identity
        -
        271 template <typename T, typename L> struct pixel_reference_type<T,L,true,false> { using type = planar_pixel_reference<typename channel_traits<T>::const_reference,typename color_space_type<L>::type> const; };// TODO: Assert M=identity
        -
        272 
        -
        275 template <typename Pixel, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type_from_pixel{};
        -
        276 template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,true > { using type = Pixel *; };
        -
        277 template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,false> { using type = const Pixel *; };
        -
        278 template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,true> {
        -
        279  using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::pointer,typename color_space_type<Pixel>::type>;
        -
        280 };
        -
        281 template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,false> {
        -
        282  using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::const_pointer,typename color_space_type<Pixel>::type>;
        -
        283 };
        -
        284 template <typename Pixel, bool IsPlanar, bool IsMutable> struct iterator_type_from_pixel<Pixel,IsPlanar,true,IsMutable> {
        -
        285  using type = memory_based_step_iterator<typename iterator_type_from_pixel<Pixel,IsPlanar,false,IsMutable>::type>;
        -
        286 };
        -
        287 
        -
        290 template <typename T, typename L, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type{};
        -
        291 template <typename T, typename L> struct iterator_type<T,L,false,false,true > { using type = pixel<T,L>*; };
        -
        292 template <typename T, typename L> struct iterator_type<T,L,false,false,false> { using type = pixel<T,L> const*; };
        -
        293 template <typename T, typename L> struct iterator_type<T,L,true,false,true> { using type = planar_pixel_iterator<T*,typename L::color_space_t>; }; // TODO: Assert M=identity
        -
        294 template <typename T, typename L> struct iterator_type<T,L,true,false,false> { using type = planar_pixel_iterator<const T*,typename L::color_space_t>; }; // TODO: Assert M=identity
        -
        295 template <typename T, typename L, bool IsPlanar, bool IsMutable> struct iterator_type<T,L,IsPlanar,true,IsMutable> {
        -
        296  using type = memory_based_step_iterator<typename iterator_type<T,L,IsPlanar,false,IsMutable>::type>;
        -
        297 };
        -
        298 
        -
        301 template <typename XIterator>
        - -
        303 {
        - - - -
        307 };
        -
        308 
        -
        309 namespace detail {
        -
        310 
        -
        311 template <typename BitField, typename FirstBit, typename NumBits>
        -
        312 struct packed_channel_reference_type
        -
        313 {
        -
        314  using type = packed_channel_reference
        -
        315  <
        -
        316  BitField, FirstBit::value, NumBits::value, true
        -
        317  > const;
        -
        318 };
        -
        319 
        -
        320 template <typename BitField, typename ChannelBitSizes>
        -
        321 class packed_channel_references_vector_type
        -
        322 {
        -
        323  template <typename FirstBit, typename NumBits>
        -
        324  using reference_type = typename packed_channel_reference_type<BitField, FirstBit, NumBits>::type;
        -
        325 
        -
        326  // If ChannelBitSizesVector is mp11::mp_list_c<int,7,7,2>
        -
        327  // Then first_bits_vector will be mp11::mp_list_c<int,0,7,14,16>
        -
        328  using first_bit_list = mp11::mp_fold_q
        -
        329  <
        -
        330  ChannelBitSizes,
        -
        331  mp11::mp_list<std::integral_constant<int, 0>>,
        -
        332  mp11::mp_bind
        -
        333  <
        -
        334  mp11::mp_push_back,
        -
        335  mp11::_1,
        -
        336  mp11::mp_bind
        -
        337  <
        -
        338  mp11::mp_plus,
        -
        339  mp11::mp_bind<mp_back, mp11::_1>,
        -
        340  mp11::_2
        -
        341  >
        -
        342  >
        -
        343  >;
        -
        344 
        -
        345  static_assert(mp11::mp_at_c<first_bit_list, 0>::value == 0, "packed channel first bit must be 0");
        -
        346 
        -
        347 public:
        -
        348  using type = mp11::mp_transform
        -
        349  <
        -
        350  reference_type,
        -
        351  mp_pop_back<first_bit_list>,
        -
        352  ChannelBitSizes
        -
        353  >;
        -
        354 };
        -
        355 
        -
        356 } // namespace detail
        -
        357 
        -
        366 template <typename BitField, typename ChannelBitSizes, typename Layout>
        - -
        368 {
        -
        369  using type = packed_pixel
        -
        370  <
        -
        371  BitField,
        -
        372  typename detail::packed_channel_references_vector_type
        -
        373  <
        -
        374  BitField,
        -
        375  ChannelBitSizes
        -
        376  >::type,
        -
        377  Layout>;
        -
        378 };
        -
        379 
        -
        388 
        -
        391 template <typename BitField, typename ChannelBitSizes, typename Layout, typename Alloc=std::allocator<unsigned char>>
        - -
        393 {
        - -
        395 };
        -
        396 
        -
        399 template <typename BitField, unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        401  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1>, Layout, Alloc>
        -
        402 {};
        -
        403 
        -
        406 template <typename BitField, unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        408  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc>
        -
        409 {};
        -
        410 
        -
        413 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        415  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc>
        -
        416 {};
        -
        417 
        -
        420 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        422  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc>
        -
        423 {};
        -
        424 
        -
        427 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
        - -
        429  : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
        -
        430 
        -
        431 
        -
        438 template
        -
        439 <
        -
        440  typename ChannelBitSizes,
        -
        441  typename Layout,
        -
        442  typename Alloc = std::allocator<unsigned char>
        -
        443 >
        - -
        445 {
        -
        446 private:
        -
        447 
        -
        448  static constexpr int bit_size =
        -
        449  mp11::mp_fold
        -
        450  <
        -
        451  ChannelBitSizes,
        -
        452  std::integral_constant<int, 0>,
        -
        453  mp11::mp_plus
        -
        454  >::value;
        -
        455 
        -
        456  using bitfield_t = typename detail::min_fast_uint<bit_size + 7>::type;
        -
        457  using bit_alignedref_t = bit_aligned_pixel_reference<bitfield_t, ChannelBitSizes, Layout, true> const;
        -
        458 
        -
        459 public:
        - -
        461 };
        -
        462 
        -
        465 template <unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        466 struct bit_aligned_image1_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1>, Layout, Alloc> {};
        -
        467 
        -
        470 template <unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        471 struct bit_aligned_image2_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc> {};
        -
        472 
        -
        475 template <unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        476 struct bit_aligned_image3_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc> {};
        -
        477 
        -
        480 template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        481 struct bit_aligned_image4_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc> {};
        -
        482 
        -
        485 template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -
        486 struct bit_aligned_image5_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
        -
        487 
        -
        488 
        -
        491 template <typename Channel, typename Layout>
        - -
        493 {
        -
        494  // by default use gil::pixel. Specializations are provided for
        - -
        496 };
        -
        497 
        -
        498 // Specializations for packed channels
        -
        499 template <typename BitField, int NumBits, bool IsMutable, typename Layout>
        -
        500 struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable>, Layout>
        -
        501  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        502 {};
        -
        503 
        -
        504 template <typename BitField, int NumBits, bool IsMutable, typename Layout>
        -
        505 struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable> const, Layout>
        -
        506  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        507 {};
        -
        508 
        -
        509 template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
        -
        510 struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable>, Layout>
        -
        511  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        512 {};
        -
        513 
        -
        514 template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
        -
        515 struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable> const, Layout>
        -
        516  : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        517 {};
        -
        518 
        -
        519 template <int NumBits, typename Layout>
        -
        520 struct pixel_value_type<packed_channel_value<NumBits>, Layout>
        -
        521  : packed_pixel_type<typename detail::min_fast_uint<NumBits>::type, mp11::mp_list_c<unsigned, NumBits>, Layout>
        -
        522 {};
        -
        523 
        -
        526 template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
        - -
        528 {
        -
        529  using type = typename type_from_x_iterator
        -
        530  <
        - -
        532  >::xy_locator_type;
        -
        533 };
        -
        534 
        -
        537 template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
        -
        538 struct view_type
        -
        539 {
        -
        540  using type = typename type_from_x_iterator
        -
        541  <
        - -
        543  >::view_t;
        -
        544 };
        -
        545 
        -
        548 template <typename T, typename L, bool IsPlanar = false, typename Alloc = std::allocator<unsigned char>>
        - -
        550 {
        -
        551  using type = image<pixel<T, L>, IsPlanar, Alloc>;
        -
        552 };
        -
        553 
        -
        556 template <typename Pixel, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true>
        - - -
        559 };
        -
        560 
        -
        561 
        -
        565 template
        -
        566 <
        -
        567  typename Ref,
        -
        568  typename T = use_default,
        -
        569  typename L = use_default,
        -
        570  typename IsPlanar = use_default,
        -
        571  typename IsMutable = use_default>
        - -
        573 {
        -
        574  using pixel_t = typename std::remove_reference<Ref>::type;
        -
        575 
        -
        576  using channel_t = typename mp11::mp_if
        -
        577  <
        -
        578  std::is_same<T, use_default>,
        - -
        580  T
        -
        581  >::type;
        -
        582 
        -
        583  using layout_t = typename mp11::mp_if
        -
        584  <
        -
        585  std::is_same<L, use_default>,
        -
        586  layout
        -
        587  <
        -
        588  typename color_space_type<pixel_t>::type,
        -
        589  typename channel_mapping_type<pixel_t>::type
        -
        590  >,
        -
        591  L
        -
        592  >::type;
        -
        593 
        -
        594  static bool const mut = mp11::mp_if
        -
        595  <
        -
        596  std::is_same<IsMutable, use_default>,
        - -
        598  IsMutable
        -
        599  >::value;
        -
        600 
        -
        601  static bool const planar = mp11::mp_if
        -
        602  <
        -
        603  std::is_same<IsPlanar, use_default>,
        -
        604  is_planar<pixel_t>,
        -
        605  IsPlanar
        -
        606  >::value;
        -
        607 
        -
        608 public:
        - -
        610 };
        -
        611 
        -
        615 template
        -
        616 <
        -
        617  typename Iterator,
        -
        618  typename T = use_default,
        -
        619  typename L = use_default,
        -
        620  typename IsPlanar = use_default,
        -
        621  typename IsStep = use_default,
        -
        622  typename IsMutable = use_default
        -
        623 >
        - -
        625 {
        -
        626  using channel_t = typename mp11::mp_if
        -
        627  <
        -
        628  std::is_same<T, use_default>,
        - -
        630  T
        -
        631  >::type;
        -
        632 
        -
        633  using layout_t = typename mp11::mp_if
        -
        634  <
        -
        635  std::is_same<L, use_default>,
        -
        636  layout
        -
        637  <
        -
        638  typename color_space_type<Iterator>::type,
        -
        639  typename channel_mapping_type<Iterator>::type
        -
        640  >,
        -
        641  L
        -
        642  >::type;
        -
        643 
        -
        644  static const bool mut = mp11::mp_if
        -
        645  <
        -
        646  std::is_same<IsMutable, use_default>,
        - -
        648  IsMutable
        -
        649  >::value;
        -
        650 
        -
        651  static bool const planar = mp11::mp_if
        -
        652  <
        -
        653  std::is_same<IsPlanar, use_default>,
        -
        654  is_planar<Iterator>,
        -
        655  IsPlanar
        -
        656  >::value;
        -
        657 
        -
        658  static bool const step = mp11::mp_if
        -
        659  <
        -
        660  std::is_same<IsStep, use_default>,
        - -
        662  IsStep
        -
        663  >::type::value;
        -
        664 
        -
        665 public:
        - -
        667 };
        -
        668 
        -
        672 template <typename View, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename StepX = use_default, typename IsMutable = use_default>
        - -
        674 {
        -
        675  using channel_t = typename mp11::mp_if
        -
        676  <
        -
        677  std::is_same<T, use_default>,
        -
        678  typename channel_type<View>::type,
        -
        679  T
        -
        680  >;
        -
        681 
        -
        682  using layout_t = typename mp11::mp_if
        -
        683  <
        -
        684  std::is_same<L, use_default>,
        -
        685  layout
        -
        686  <
        -
        687  typename color_space_type<View>::type,
        -
        688  typename channel_mapping_type<View>::type
        -
        689  >,
        -
        690  L
        -
        691  >;
        -
        692 
        -
        693  static bool const mut = mp11::mp_if
        -
        694  <
        -
        695  std::is_same<IsMutable, use_default>,
        - -
        697  IsMutable
        -
        698  >::value;
        -
        699 
        -
        700  static bool const planar = mp11::mp_if
        -
        701  <
        -
        702  std::is_same<IsPlanar, use_default>,
        -
        703  is_planar<View>,
        -
        704  IsPlanar
        -
        705  >::value;
        -
        706 
        -
        707  static bool const step = mp11::mp_if
        -
        708  <
        -
        709  std::is_same<StepX, use_default>,
        - -
        711  StepX
        -
        712  >::value;
        -
        713 
        -
        714 public:
        -
        715  using type = typename view_type<channel_t, layout_t, planar, step, mut>::type;
        -
        716 };
        -
        717 
        -
        721 template <typename Image, typename T = use_default, typename L = use_default, typename IsPlanar = use_default>
        - -
        723 {
        -
        724  using channel_t = typename mp11::mp_if
        -
        725  <
        -
        726  std::is_same<T, use_default>,
        -
        727  typename channel_type<Image>::type,
        -
        728  T
        -
        729  >::type;
        -
        730 
        -
        731  using layout_t = typename mp11::mp_if
        -
        732  <
        -
        733  std::is_same<L, use_default>,
        -
        734  layout
        -
        735  <
        -
        736  typename color_space_type<Image>::type,
        -
        737  typename channel_mapping_type<Image>::type>,
        -
        738  L
        -
        739  >::type;
        -
        740 
        -
        741  static bool const planar = mp11::mp_if
        -
        742  <
        -
        743  std::is_same<IsPlanar, use_default>,
        -
        744  is_planar<Image>,
        -
        745  IsPlanar
        -
        746  >::value;
        -
        747 
        -
        748 public:
        -
        749  using type = typename image_type<channel_t, layout_t, planar>::type;
        -
        750 };
        -
        751 
        -
        752 }} // namespace boost::gil
        -
        753 
        -
        754 #endif
        -
        Constructs a homogeneous image type from a source image type by changing some of the properties....
        Definition: metafunctions.hpp:723
        -
        Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties...
        Definition: metafunctions.hpp:625
        -
        Constructs a pixel reference type from a source pixel reference type by changing some of the properti...
        Definition: metafunctions.hpp:573
        -
        Constructs an image view type from a source view type by changing some of the properties....
        Definition: metafunctions.hpp:674
        -
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition: image_view.hpp:54
        -
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:43
        -
        Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,...
        Definition: locator.hpp:230
        -
        MEMORY-BASED STEP ITERATOR.
        Definition: step_iterator.hpp:149
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Returns the type of a single-channel bit-aligned image given the bit size of its channel and its layo...
        Definition: metafunctions.hpp:466
        -
        Returns the type of a two channel bit-aligned image given the bit size of its channels and its layout...
        Definition: metafunctions.hpp:471
        -
        Returns the type of a three channel bit-aligned image given the bit size of its channels and its layo...
        Definition: metafunctions.hpp:476
        -
        Returns the type of a four channel bit-aligned image given the bit size of its channels and its layou...
        Definition: metafunctions.hpp:481
        -
        Returns the type of a five channel bit-aligned image given the bit size of its channels and its layou...
        Definition: metafunctions.hpp:486
        -
        Returns the type of a packed image whose pixels may not be byte aligned. For example,...
        Definition: metafunctions.hpp:445
        -
        Definition: color_convert.hpp:31
        -
        Basic images must use basic views and std::allocator.
        Definition: metafunctions.hpp:138
        -
        Returns the type of a homogeneous image given the channel type, layout, and whether it operates on pl...
        Definition: metafunctions.hpp:550
        -
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition: metafunctions.hpp:36
        -
        Determines if a given pixel iterator is basic Basic iterators must use gil::pixel (if interleaved),...
        Definition: metafunctions.hpp:76
        -
        Metafunction predicate returning whether the given iterator allows for changing its values.
        Definition: pixel_iterator.hpp:49
        -
        Determines if the given iterator has a step that could be set dynamically.
        Definition: metafunctions.hpp:182
        -
        Returns the type of a pixel iterator given the pixel type, whether it operates on planar data,...
        Definition: metafunctions.hpp:275
        -
        Returns the type of a homogeneous iterator given the channel type, layout, whether it operates on pla...
        Definition: metafunctions.hpp:290
        -
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:268
        -
        Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and ...
        Definition: metafunctions.hpp:118
        -
        Determines if the given locator is mutable (i.e. its pixels can be changed)
        Definition: metafunctions.hpp:240
        -
        Determines if the given locator has a horizontal step that could be set dynamically.
        Definition: metafunctions.hpp:186
        -
        Determines if the given locator has a vertical step that could be set dynamically.
        Definition: metafunctions.hpp:190
        -
        Returns the type of a homogeneous locator given the channel type, layout, whether it operates on plan...
        Definition: metafunctions.hpp:528
        -
        Returns the type of a single-channel image given its bitfield type, the bit size of its channel and i...
        Definition: metafunctions.hpp:402
        -
        Returns the type of a two channel image given its bitfield type, the bit size of its channels and its...
        Definition: metafunctions.hpp:409
        -
        Returns the type of a three channel image given its bitfield type, the bit size of its channels and i...
        Definition: metafunctions.hpp:416
        -
        Returns the type of a four channel image given its bitfield type, the bit size of its channels and it...
        Definition: metafunctions.hpp:423
        -
        Returns the type of a five channel image given its bitfield type, the bit size of its channels and it...
        Definition: metafunctions.hpp:429
        -
        Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned,...
        Definition: metafunctions.hpp:393
        -
        Returns the type of a packed pixel given its bitfield type, the bit size of its channels and its layo...
        Definition: metafunctions.hpp:368
        -
        Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
        Definition: packed_pixel.hpp:50
        -
        Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
        Definition: metafunctions.hpp:218
        -
        Determines if a given pixel reference is basic Basic references must use gil::pixel& (if interleaved)...
        Definition: metafunctions.hpp:58
        -
        Determines if the given pixel reference is mutable (i.e. its channels can be changed)
        Definition: metafunctions.hpp:231
        -
        Determines whether the given pixel reference is a proxy class or a native C++ reference.
        Definition: metafunctions.hpp:212
        -
        Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
        Definition: metafunctions.hpp:267
        -
        Returns the type of a homogeneous pixel given the channel type and layout.
        Definition: metafunctions.hpp:493
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: pixel.hpp:106
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: planar_pixel_iterator.hpp:58
        -
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:303
        -
        Basic views must be over basic locators.
        Definition: metafunctions.hpp:130
        -
        Determines if the given view is mutable (i.e. its pixels can be changed)
        Definition: metafunctions.hpp:243
        -
        Determines if the given view has a horizontal step that could be set dynamically.
        Definition: metafunctions.hpp:194
        -
        Determines if the given view has a vertical step that could be set dynamically.
        Definition: metafunctions.hpp:198
        -
        Returns the type of a view the pixel type, whether it operates on planar data and whether it has a st...
        Definition: metafunctions.hpp:557
        -
        Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar ...
        Definition: metafunctions.hpp:539
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_METAFUNCTIONS_HPP
        +
        10#define BOOST_GIL_METAFUNCTIONS_HPP
        +
        11
        +
        12#include <boost/gil/channel.hpp>
        +
        13#include <boost/gil/dynamic_step.hpp>
        +
        14#include <boost/gil/concepts.hpp>
        +
        15#include <boost/gil/concepts/detail/type_traits.hpp>
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17
        +
        18#include <iterator>
        +
        19#include <type_traits>
        +
        20
        +
        21namespace boost { namespace gil {
        +
        22
        +
        23// forward declarations
        +
        24template <typename T, typename L> struct pixel;
        +
        25template <typename BitField,typename ChannelRefs,typename Layout> struct packed_pixel;
        +
        26template <typename T, typename C> struct planar_pixel_reference;
        +
        27template <typename IC, typename C> struct planar_pixel_iterator;
        +
        28template <typename I> class memory_based_step_iterator;
        +
        29template <typename I> class memory_based_2d_locator;
        +
        30template <typename L> class image_view;
        +
        31template <typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> > class image;
        +
        32template <typename T> struct channel_type;
        +
        33template <typename T> struct color_space_type;
        +
        34template <typename T> struct channel_mapping_type;
        +
        35template <typename It> struct is_iterator_adaptor;
        +
        36template <typename It> struct iterator_adaptor_get_base;
        +
        37template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable> struct bit_aligned_pixel_reference;
        +
        38
        +
        45
        +
        46
        +
        53
        +
        57template <typename PixelRef>
        +
        58struct pixel_reference_is_basic : public std::false_type {};
        +
        59
        +
        60template <typename T, typename L>
        +
        61struct pixel_reference_is_basic<pixel<T, L>&> : std::true_type {};
        +
        62
        +
        63template <typename T, typename L>
        +
        64struct pixel_reference_is_basic<const pixel<T, L>&> : std::true_type {};
        +
        65
        +
        66template <typename TR, typename CS>
        +
        67struct pixel_reference_is_basic<planar_pixel_reference<TR, CS>> : std::true_type {};
        +
        68
        +
        69template <typename TR, typename CS>
        +
        70struct pixel_reference_is_basic<const planar_pixel_reference<TR, CS>> : std::true_type {};
        +
        71
        +
        75template <typename Iterator>
        +
        76struct iterator_is_basic : std::false_type {};
        +
        77
        +
        79template <typename T, typename L>
        +
        80struct iterator_is_basic<pixel<T, L>*> : std::true_type {};
        +
        81
        +
        83template <typename T, typename L>
        +
        84struct iterator_is_basic<pixel<T, L> const*> : std::true_type {};
        +
        85
        +
        87template <typename T, typename CS>
        +
        88struct iterator_is_basic<planar_pixel_iterator<T*, CS>> : std::true_type {};
        +
        89
        +
        91template <typename T, typename CS>
        +
        92struct iterator_is_basic<planar_pixel_iterator<T const*, CS>> : std::true_type {};
        +
        93
        +
        95template <typename T, typename L>
        +
        96struct iterator_is_basic<memory_based_step_iterator<pixel<T, L>*>> : std::true_type {};
        +
        97
        +
        99template <typename T, typename L>
        +
        100struct iterator_is_basic<memory_based_step_iterator<pixel<T, L> const*>> : std::true_type {};
        +
        101
        +
        103template <typename T, typename CS>
        +
        + +
        105 : std::true_type
        +
        106{};
        +
        +
        107
        +
        109template <typename T, typename CS>
        +
        + +
        111 : std::true_type
        +
        112{};
        +
        +
        113
        +
        114
        +
        117template <typename Loc>
        +
        118struct locator_is_basic : std::false_type {};
        +
        119
        +
        120template <typename Iterator>
        +
        121struct locator_is_basic
        +
        122 <
        + +
        124 > : iterator_is_basic<Iterator>
        +
        125{};
        +
        126
        +
        129template <typename View>
        +
        130struct view_is_basic : std::false_type {};
        +
        131
        +
        132template <typename Loc>
        +
        133struct view_is_basic<image_view<Loc>> : locator_is_basic<Loc> {};
        +
        134
        +
        137template <typename Img>
        +
        138struct image_is_basic : std::false_type {};
        +
        139
        +
        140template <typename Pixel, bool IsPlanar, typename Alloc>
        +
        141struct image_is_basic<image<Pixel, IsPlanar, Alloc>> : std::true_type {};
        +
        142
        +
        143
        +
        147
        +
        148template <typename I>
        +
        149struct iterator_is_step;
        +
        150
        +
        151namespace detail {
        +
        152
        +
        153template <typename It, bool IsBase, bool EqualsStepType>
        +
        154struct iterator_is_step_impl;
        +
        155
        +
        156// iterator that has the same type as its dynamic_x_step_type must be a step iterator
        +
        157template <typename It, bool IsBase>
        +
        158struct iterator_is_step_impl<It, IsBase, true> : std::true_type {};
        +
        159
        +
        160// base iterator can never be a step iterator
        +
        161template <typename It>
        +
        162struct iterator_is_step_impl<It, true, false> : std::false_type {};
        +
        163
        +
        164// for an iterator adaptor, see if its base is step
        +
        165template <typename It>
        +
        166struct iterator_is_step_impl<It, false, false>
        +
        167 : public iterator_is_step<typename iterator_adaptor_get_base<It>::type> {};
        +
        168
        +
        169} // namespace detail
        +
        170
        +
        173template <typename I>
        +
        + +
        175 : detail::iterator_is_step_impl
        +
        176 <
        +
        177 I,
        +
        178 !is_iterator_adaptor<I>::value,
        +
        179 std::is_same<I, typename dynamic_x_step_type<I>::type
        +
        180 >::value
        +
        181>
        +
        182{};
        +
        +
        183
        +
        186template <typename L> struct locator_is_step_in_x : public iterator_is_step<typename L::x_iterator> {};
        +
        187
        +
        190template <typename L> struct locator_is_step_in_y : public iterator_is_step<typename L::y_iterator> {};
        +
        191
        +
        194template <typename V> struct view_is_step_in_x : public locator_is_step_in_x<typename V::xy_locator> {};
        +
        195
        +
        198template <typename V> struct view_is_step_in_y : public locator_is_step_in_y<typename V::xy_locator> {};
        +
        199
        +
        202template <typename PixelReference>
        +
        + +
        204 : mp11::mp_not
        +
        205 <
        +
        206 std::is_same
        +
        207 <
        +
        208 typename detail::remove_const_and_reference<PixelReference>::type,
        +
        209 typename detail::remove_const_and_reference<PixelReference>::type::value_type
        +
        210 >
        +
        211 >
        +
        212{};
        +
        +
        213
        +
        216template <typename Pixel>
        +
        + +
        218 : mp11::mp_or<is_reference<Pixel>, pixel_reference_is_proxy<Pixel>> {};
        +
        +
        219
        +
        223
        +
        228template <typename R>
        +
        + +
        230 : std::integral_constant<bool, std::remove_reference<R>::type::is_mutable>
        +
        231{};
        +
        +
        232
        +
        233template <typename R>
        +
        234struct pixel_reference_is_mutable<R const&>
        +
        235 : mp11::mp_and<pixel_reference_is_proxy<R>, pixel_reference_is_mutable<R>>
        +
        236{};
        +
        237
        +
        240template <typename L> struct locator_is_mutable : public iterator_is_mutable<typename L::x_iterator> {};
        +
        243template <typename V> struct view_is_mutable : public iterator_is_mutable<typename V::x_iterator> {};
        +
        244
        +
        245
        +
        252
        +
        256
        +
        260
        +
        264
        +
        267template <typename T, typename L, bool IsPlanar=false, bool IsMutable=true> struct pixel_reference_type{};
        +
        268template <typename T, typename L> struct pixel_reference_type<T,L,false,true > { using type = pixel<T,L>&; };
        +
        269template <typename T, typename L> struct pixel_reference_type<T,L,false,false> { using type = pixel<T,L> const&; };
        +
        270template <typename T, typename L> struct pixel_reference_type<T,L,true,true> { using type = planar_pixel_reference<typename channel_traits<T>::reference,typename color_space_type<L>::type> const; }; // TODO: Assert M=identity
        +
        271template <typename T, typename L> struct pixel_reference_type<T,L,true,false> { using type = planar_pixel_reference<typename channel_traits<T>::const_reference,typename color_space_type<L>::type> const; };// TODO: Assert M=identity
        +
        272
        +
        275template <typename Pixel, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type_from_pixel{};
        +
        276template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,true > { using type = Pixel *; };
        +
        277template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,false> { using type = const Pixel *; };
        +
        278template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,true> {
        +
        279 using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::pointer,typename color_space_type<Pixel>::type>;
        +
        280};
        +
        281template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,false> {
        +
        282 using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::const_pointer,typename color_space_type<Pixel>::type>;
        +
        283};
        +
        284template <typename Pixel, bool IsPlanar, bool IsMutable> struct iterator_type_from_pixel<Pixel,IsPlanar,true,IsMutable> {
        +
        285 using type = memory_based_step_iterator<typename iterator_type_from_pixel<Pixel,IsPlanar,false,IsMutable>::type>;
        +
        286};
        +
        287
        +
        290template <typename T, typename L, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type{};
        +
        291template <typename T, typename L> struct iterator_type<T,L,false,false,true > { using type = pixel<T,L>*; };
        +
        292template <typename T, typename L> struct iterator_type<T,L,false,false,false> { using type = pixel<T,L> const*; };
        +
        293template <typename T, typename L> struct iterator_type<T,L,true,false,true> { using type = planar_pixel_iterator<T*,typename L::color_space_t>; }; // TODO: Assert M=identity
        +
        294template <typename T, typename L> struct iterator_type<T,L,true,false,false> { using type = planar_pixel_iterator<const T*,typename L::color_space_t>; }; // TODO: Assert M=identity
        +
        295template <typename T, typename L, bool IsPlanar, bool IsMutable> struct iterator_type<T,L,IsPlanar,true,IsMutable> {
        +
        296 using type = memory_based_step_iterator<typename iterator_type<T,L,IsPlanar,false,IsMutable>::type>;
        +
        297};
        +
        298
        +
        301template <typename XIterator>
        + +
        308
        +
        309namespace detail {
        +
        310
        +
        311template <typename BitField, typename FirstBit, typename NumBits>
        +
        312struct packed_channel_reference_type
        +
        313{
        +
        314 using type = packed_channel_reference
        +
        315 <
        +
        316 BitField, FirstBit::value, NumBits::value, true
        +
        317 > const;
        +
        318};
        +
        319
        +
        320template <typename BitField, typename ChannelBitSizes>
        +
        321class packed_channel_references_vector_type
        +
        322{
        +
        323 template <typename FirstBit, typename NumBits>
        +
        324 using reference_type = typename packed_channel_reference_type<BitField, FirstBit, NumBits>::type;
        +
        325
        +
        326 // If ChannelBitSizesVector is mp11::mp_list_c<int,7,7,2>
        +
        327 // Then first_bits_vector will be mp11::mp_list_c<int,0,7,14,16>
        +
        328 using first_bit_list = mp11::mp_fold_q
        +
        329 <
        +
        330 ChannelBitSizes,
        +
        331 mp11::mp_list<std::integral_constant<int, 0>>,
        +
        332 mp11::mp_bind
        +
        333 <
        +
        334 mp11::mp_push_back,
        +
        335 mp11::_1,
        +
        336 mp11::mp_bind
        +
        337 <
        +
        338 mp11::mp_plus,
        +
        339 mp11::mp_bind<mp_back, mp11::_1>,
        +
        340 mp11::_2
        +
        341 >
        +
        342 >
        +
        343 >;
        +
        344
        +
        345 static_assert(mp11::mp_at_c<first_bit_list, 0>::value == 0, "packed channel first bit must be 0");
        +
        346
        +
        347public:
        +
        348 using type = mp11::mp_transform
        +
        349 <
        +
        350 reference_type,
        +
        351 mp_pop_back<first_bit_list>,
        +
        352 ChannelBitSizes
        +
        353 >;
        +
        354};
        +
        355
        +
        356} // namespace detail
        +
        357
        +
        366template <typename BitField, typename ChannelBitSizes, typename Layout>
        +
        + +
        368{
        +
        369 using type = packed_pixel
        +
        370 <
        +
        371 BitField,
        +
        372 typename detail::packed_channel_references_vector_type
        +
        373 <
        +
        374 BitField,
        +
        375 ChannelBitSizes
        +
        376 >::type,
        +
        377 Layout>;
        +
        378};
        +
        +
        379
        +
        388
        +
        391template <typename BitField, typename ChannelBitSizes, typename Layout, typename Alloc=std::allocator<unsigned char>>
        + +
        396
        +
        399template <typename BitField, unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        + +
        401 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1>, Layout, Alloc>
        +
        402{};
        +
        +
        403
        +
        406template <typename BitField, unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        + +
        408 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc>
        +
        409{};
        +
        +
        410
        +
        413template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        + +
        415 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc>
        +
        416{};
        +
        +
        417
        +
        420template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        + +
        422 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc>
        +
        423{};
        +
        +
        424
        +
        427template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        + +
        429 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
        +
        +
        430
        +
        431
        +
        438template
        +
        439<
        +
        440 typename ChannelBitSizes,
        +
        441 typename Layout,
        +
        442 typename Alloc = std::allocator<unsigned char>
        +
        443>
        +
        + +
        445{
        +
        446private:
        +
        447
        +
        448 static constexpr int bit_size =
        +
        449 mp11::mp_fold
        +
        450 <
        +
        451 ChannelBitSizes,
        +
        452 std::integral_constant<int, 0>,
        +
        453 mp11::mp_plus
        +
        454 >::value;
        +
        455
        +
        456 using bitfield_t = typename detail::min_fast_uint<bit_size + 7>::type;
        +
        457 using bit_alignedref_t = bit_aligned_pixel_reference<bitfield_t, ChannelBitSizes, Layout, true> const;
        +
        458
        +
        459public:
        + +
        461};
        +
        +
        462
        +
        465template <unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        466struct bit_aligned_image1_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1>, Layout, Alloc> {};
        +
        467
        +
        470template <unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        471struct bit_aligned_image2_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc> {};
        +
        472
        +
        475template <unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        476struct bit_aligned_image3_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc> {};
        +
        477
        +
        480template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        481struct bit_aligned_image4_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc> {};
        +
        482
        +
        485template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +
        486struct bit_aligned_image5_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
        +
        487
        +
        488
        +
        491template <typename Channel, typename Layout>
        +
        + +
        493{
        +
        494 // by default use gil::pixel. Specializations are provided for
        + +
        496};
        +
        +
        497
        +
        498// Specializations for packed channels
        +
        499template <typename BitField, int NumBits, bool IsMutable, typename Layout>
        +
        500struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable>, Layout>
        +
        501 : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        502{};
        +
        503
        +
        504template <typename BitField, int NumBits, bool IsMutable, typename Layout>
        +
        505struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable> const, Layout>
        +
        506 : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        507{};
        +
        508
        +
        509template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
        +
        510struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable>, Layout>
        +
        511 : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        512{};
        +
        513
        +
        514template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
        +
        515struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable> const, Layout>
        +
        516 : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        517{};
        +
        518
        +
        519template <int NumBits, typename Layout>
        +
        520struct pixel_value_type<packed_channel_value<NumBits>, Layout>
        +
        521 : packed_pixel_type<typename detail::min_fast_uint<NumBits>::type, mp11::mp_list_c<unsigned, NumBits>, Layout>
        +
        522{};
        +
        523
        +
        526template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
        +
        + +
        528{
        +
        529 using type = typename type_from_x_iterator
        +
        530 <
        + +
        532 >::xy_locator_type;
        +
        533};
        +
        +
        534
        +
        537template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
        +
        + +
        539{
        +
        540 using type = typename type_from_x_iterator
        +
        541 <
        + +
        543 >::view_t;
        +
        544};
        +
        +
        545
        +
        548template <typename T, typename L, bool IsPlanar = false, typename Alloc = std::allocator<unsigned char>>
        +
        + +
        550{
        +
        551 using type = image<pixel<T, L>, IsPlanar, Alloc>;
        +
        552};
        +
        +
        553
        +
        556template <typename Pixel, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true>
        + +
        560
        +
        561
        +
        565template
        +
        566<
        +
        567 typename Ref,
        +
        568 typename T = use_default,
        +
        569 typename L = use_default,
        +
        570 typename IsPlanar = use_default,
        +
        571 typename IsMutable = use_default>
        +
        + +
        573{
        +
        574 using pixel_t = typename std::remove_reference<Ref>::type;
        +
        575
        +
        576 using channel_t = typename mp11::mp_if
        +
        577 <
        +
        578 std::is_same<T, use_default>,
        + +
        580 T
        +
        581 >::type;
        +
        582
        +
        583 using layout_t = typename mp11::mp_if
        +
        584 <
        +
        585 std::is_same<L, use_default>,
        +
        586 layout
        +
        587 <
        +
        588 typename color_space_type<pixel_t>::type,
        +
        589 typename channel_mapping_type<pixel_t>::type
        +
        590 >,
        +
        591 L
        +
        592 >::type;
        +
        593
        +
        594 static bool const mut = mp11::mp_if
        +
        595 <
        +
        596 std::is_same<IsMutable, use_default>,
        + +
        598 IsMutable
        +
        599 >::value;
        +
        600
        +
        601 static bool const planar = mp11::mp_if
        +
        602 <
        +
        603 std::is_same<IsPlanar, use_default>,
        +
        604 is_planar<pixel_t>,
        +
        605 IsPlanar
        +
        606 >::value;
        +
        607
        +
        608public:
        + +
        610};
        +
        +
        611
        +
        615template
        +
        616<
        +
        617 typename Iterator,
        +
        618 typename T = use_default,
        +
        619 typename L = use_default,
        +
        620 typename IsPlanar = use_default,
        +
        621 typename IsStep = use_default,
        +
        622 typename IsMutable = use_default
        +
        623>
        +
        + +
        625{
        +
        626 using channel_t = typename mp11::mp_if
        +
        627 <
        +
        628 std::is_same<T, use_default>,
        + +
        630 T
        +
        631 >::type;
        +
        632
        +
        633 using layout_t = typename mp11::mp_if
        +
        634 <
        +
        635 std::is_same<L, use_default>,
        +
        636 layout
        +
        637 <
        +
        638 typename color_space_type<Iterator>::type,
        +
        639 typename channel_mapping_type<Iterator>::type
        +
        640 >,
        +
        641 L
        +
        642 >::type;
        +
        643
        +
        644 static const bool mut = mp11::mp_if
        +
        645 <
        +
        646 std::is_same<IsMutable, use_default>,
        + +
        648 IsMutable
        +
        649 >::value;
        +
        650
        +
        651 static bool const planar = mp11::mp_if
        +
        652 <
        +
        653 std::is_same<IsPlanar, use_default>,
        +
        654 is_planar<Iterator>,
        +
        655 IsPlanar
        +
        656 >::value;
        +
        657
        +
        658 static bool const step = mp11::mp_if
        +
        659 <
        +
        660 std::is_same<IsStep, use_default>,
        + +
        662 IsStep
        +
        663 >::type::value;
        +
        664
        +
        665public:
        + +
        667};
        +
        +
        668
        +
        672template <typename View, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename StepX = use_default, typename IsMutable = use_default>
        +
        + +
        674{
        +
        675 using channel_t = typename mp11::mp_if
        +
        676 <
        +
        677 std::is_same<T, use_default>,
        + +
        679 T
        +
        680 >;
        +
        681
        +
        682 using layout_t = typename mp11::mp_if
        +
        683 <
        +
        684 std::is_same<L, use_default>,
        +
        685 layout
        +
        686 <
        +
        687 typename color_space_type<View>::type,
        +
        688 typename channel_mapping_type<View>::type
        +
        689 >,
        +
        690 L
        +
        691 >;
        +
        692
        +
        693 static bool const mut = mp11::mp_if
        +
        694 <
        +
        695 std::is_same<IsMutable, use_default>,
        + +
        697 IsMutable
        +
        698 >::value;
        +
        699
        +
        700 static bool const planar = mp11::mp_if
        +
        701 <
        +
        702 std::is_same<IsPlanar, use_default>,
        +
        703 is_planar<View>,
        +
        704 IsPlanar
        +
        705 >::value;
        +
        706
        +
        707 static bool const step = mp11::mp_if
        +
        708 <
        +
        709 std::is_same<StepX, use_default>,
        + +
        711 StepX
        +
        712 >::value;
        +
        713
        +
        714public:
        +
        715 using type = typename view_type<channel_t, layout_t, planar, step, mut>::type;
        +
        716};
        +
        +
        717
        +
        721template <typename Image, typename T = use_default, typename L = use_default, typename IsPlanar = use_default>
        +
        + +
        723{
        +
        724 using channel_t = typename mp11::mp_if
        +
        725 <
        +
        726 std::is_same<T, use_default>,
        + +
        728 T
        +
        729 >::type;
        +
        730
        +
        731 using layout_t = typename mp11::mp_if
        +
        732 <
        +
        733 std::is_same<L, use_default>,
        +
        734 layout
        +
        735 <
        +
        736 typename color_space_type<Image>::type,
        +
        737 typename channel_mapping_type<Image>::type>,
        +
        738 L
        +
        739 >::type;
        +
        740
        +
        741 static bool const planar = mp11::mp_if
        +
        742 <
        +
        743 std::is_same<IsPlanar, use_default>,
        +
        744 is_planar<Image>,
        +
        745 IsPlanar
        +
        746 >::value;
        +
        747
        +
        748public:
        + +
        750};
        +
        +
        751
        +
        752}} // namespace boost::gil
        +
        753
        +
        754#endif
        +
        Constructs a homogeneous image type from a source image type by changing some of the properties....
        Definition metafunctions.hpp:723
        +
        Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties...
        Definition metafunctions.hpp:625
        +
        Constructs a pixel reference type from a source pixel reference type by changing some of the properti...
        Definition metafunctions.hpp:573
        +
        Constructs an image view type from a source view type by changing some of the properties....
        Definition metafunctions.hpp:674
        +
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition image_view.hpp:54
        +
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition image.hpp:43
        +
        Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,...
        Definition locator.hpp:230
        +
        MEMORY-BASED STEP ITERATOR.
        Definition step_iterator.hpp:149
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Returns the type of a single-channel bit-aligned image given the bit size of its channel and its layo...
        Definition metafunctions.hpp:466
        +
        Returns the type of a two channel bit-aligned image given the bit size of its channels and its layout...
        Definition metafunctions.hpp:471
        +
        Returns the type of a three channel bit-aligned image given the bit size of its channels and its layo...
        Definition metafunctions.hpp:476
        +
        Returns the type of a four channel bit-aligned image given the bit size of its channels and its layou...
        Definition metafunctions.hpp:481
        +
        Returns the type of a five channel bit-aligned image given the bit size of its channels and its layou...
        Definition metafunctions.hpp:486
        +
        Returns the type of a packed image whose pixels may not be byte aligned. For example,...
        Definition metafunctions.hpp:445
        +
        Definition color_convert.hpp:31
        +
        Basic images must use basic views and std::allocator.
        Definition metafunctions.hpp:138
        +
        Returns the type of a homogeneous image given the channel type, layout, and whether it operates on pl...
        Definition metafunctions.hpp:550
        +
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition metafunctions.hpp:36
        +
        Determines if a given pixel iterator is basic Basic iterators must use gil::pixel (if interleaved),...
        Definition metafunctions.hpp:76
        +
        Metafunction predicate returning whether the given iterator allows for changing its values.
        Definition pixel_iterator.hpp:49
        +
        Determines if the given iterator has a step that could be set dynamically.
        Definition metafunctions.hpp:182
        +
        Returns the type of a pixel iterator given the pixel type, whether it operates on planar data,...
        Definition metafunctions.hpp:275
        +
        Returns the type of a homogeneous iterator given the channel type, layout, whether it operates on pla...
        Definition metafunctions.hpp:290
        +
        Represents a color space and ordering of channels in memory.
        Definition utilities.hpp:268
        +
        Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and ...
        Definition metafunctions.hpp:118
        +
        Determines if the given locator is mutable (i.e. its pixels can be changed)
        Definition metafunctions.hpp:240
        +
        Determines if the given locator has a horizontal step that could be set dynamically.
        Definition metafunctions.hpp:186
        +
        Determines if the given locator has a vertical step that could be set dynamically.
        Definition metafunctions.hpp:190
        +
        Returns the type of a homogeneous locator given the channel type, layout, whether it operates on plan...
        Definition metafunctions.hpp:528
        +
        Returns the type of a single-channel image given its bitfield type, the bit size of its channel and i...
        Definition metafunctions.hpp:402
        +
        Returns the type of a two channel image given its bitfield type, the bit size of its channels and its...
        Definition metafunctions.hpp:409
        +
        Returns the type of a three channel image given its bitfield type, the bit size of its channels and i...
        Definition metafunctions.hpp:416
        +
        Returns the type of a four channel image given its bitfield type, the bit size of its channels and it...
        Definition metafunctions.hpp:423
        +
        Returns the type of a five channel image given its bitfield type, the bit size of its channels and it...
        Definition metafunctions.hpp:429
        +
        Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned,...
        Definition metafunctions.hpp:393
        +
        Returns the type of a packed pixel given its bitfield type, the bit size of its channels and its layo...
        Definition metafunctions.hpp:368
        +
        Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
        Definition packed_pixel.hpp:50
        +
        Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pi...
        Definition metafunctions.hpp:218
        +
        Determines if a given pixel reference is basic Basic references must use gil::pixel& (if interleaved)...
        Definition metafunctions.hpp:58
        +
        Determines if the given pixel reference is mutable (i.e. its channels can be changed)
        Definition metafunctions.hpp:231
        +
        Determines whether the given pixel reference is a proxy class or a native C++ reference.
        Definition metafunctions.hpp:212
        +
        Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates...
        Definition metafunctions.hpp:267
        +
        Returns the type of a homogeneous pixel given the channel type and layout.
        Definition metafunctions.hpp:493
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition pixel.hpp:106
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition planar_pixel_iterator.hpp:58
        +
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition metafunctions.hpp:303
        +
        Basic views must be over basic locators.
        Definition metafunctions.hpp:130
        +
        Determines if the given view is mutable (i.e. its pixels can be changed)
        Definition metafunctions.hpp:243
        +
        Determines if the given view has a horizontal step that could be set dynamically.
        Definition metafunctions.hpp:194
        +
        Determines if the given view has a vertical step that could be set dynamically.
        Definition metafunctions.hpp:198
        +
        Returns the type of a view the pixel type, whether it operates on planar data and whether it has a st...
        Definition metafunctions.hpp:557
        +
        Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar ...
        Definition metafunctions.hpp:539
        diff --git a/html/reference/minus.svg b/html/reference/minus.svg new file mode 100644 index 000000000..f70d0c1a1 --- /dev/null +++ b/html/reference/minus.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/html/reference/minusd.svg b/html/reference/minusd.svg new file mode 100644 index 000000000..5f8e87962 --- /dev/null +++ b/html/reference/minusd.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/html/reference/modules.html b/html/reference/modules.html deleted file mode 100644 index c58da9f45..000000000 --- a/html/reference/modules.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - Generic Image Library: Modules - - - - - - - -
        - - - - - - -
        -

        Boost GIL

        -

        -
        -
        -
        - - - - - -
        -
        -
        -
        Modules
        -
        -
        -
        Here is a list of all modules:
        -
        [detail level 12345]
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
         Basic ConceptsVarious basic concepts
         PointN-dimensional point
         ConceptsConcepts for points
         ModelsModels for points
         Algorithms and Utility FunctionsAlgorithms and Utility Functions for points
         Color, Color Space, and LayoutThe color space and the layout define the set, ordering and interpretation of channels in a pixel
         Concepts
         Models
         ChannelChannel is the building block of pixel
         ConceptsConcepts for channels
         ModelsChannel models. Although not required by the ChannelConcept, all GIL-provided channels support arithmetic operations
         Algorithms and Utility FunctionsChannel algorithms, metafunctions and utility functions
         ColorBaseA color base is a container of color elements
         ConceptsColorBase concepts
         ModelsColorBase models
         Algorithms and Utility FunctionsColorBase algorithms, metafunctions and utility functions
         PixelBasedConcepts for all GIL constructs that are pixel-based (pixels, pixel iterators, locators, views, images)
         ConceptsPixelBased concepts
         ModelsPixelBased models
         Algorithms and Utility FunctionsPixelBased algorithms, metafunctions and utility functions
         PixelA pixel is a set of channels defining the color at a given point in an image
         ConceptsPixel concepts
         ModelsPixel models
         Algorithms and Utility FunctionsPixel algorithms, metafunctions and utility functions
         Pixel Dereference AdaptorA function object invoked upon accessing of the pixel of a pixel iterator/locator/view
         Concepts
         Models
         Pixel IteratorSTL Iterators over models of PixelConcept
         ConceptsPixel iterator concepts
         ModelsPixel iterator models
         Pixel LocatorGeneralization of an iterator to multiple dimensions
         ConceptsPixel locator concepts
         ModelsPixel locator models
         Image ViewN-dimensional range
         ConceptsImage view concepts
         ModelsImage view models
         Algorithms and Utility FunctionsImage view algorithms, metafunctions and utility functions
         ImageN-dimensional container
         ConceptsImage concepts
         ModelsImage models
         Image ProcessingImage Processing algorithms
         VariantA holder of a runtime instantiated type. Used to provide runtime-specified images and views
         MetafunctionsMetafunctions to construct or query GIL types
         Type Factory MetafunctionsMetafunctions that construct GIL types from related types or from components
         Type Analysis MetafunctionsMetafunctions that determine properties of GIL types
         I/OSupport for reading and writing images to file
         JPEG I/OSupport for reading and writing JPEG image files
         TIFF I/OSupport for reading and writing TIFF image files
         PNG I/OSupport for reading and writing PNG image files
         Color Space ConverionSupport for conversion between pixels of different color spaces and channel depths
         HistogramHistogram
         Histogram-HelpersHelper implementations supporting the histogram class
         AHEAdaptive Histogram Equalization(AHE)
         AHE-helpersAHE helper functions
         CornerDetectionAlgorithmsAlgorithms that are used to find corners in an image
         HEHistogram Equalization(HE)
         HMHistogram Matching(HM)
         ImageProcessingMathMath operations for IP algorithms
         ScalingAlgorithmsAlgorthims suitable for rescaling
         DownScalingAlgorithmsAlgorthims suitable for downscaling
        -
        -
        - - - - - - diff --git a/html/reference/morphology_8hpp_source.html b/html/reference/morphology_8hpp_source.html index f48a20f01..113c8b4cb 100644 --- a/html/reference/morphology_8hpp_source.html +++ b/html/reference/morphology_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: morphology.hpp Source File @@ -27,228 +27,241 @@

        - + +/* @license-end */ + +
        -
        -
        morphology.hpp
        +
        morphology.hpp
        -
        1 //
        -
        2 // Copyright 2021 Prathamesh Tagore <prathameshtagore@gmail.com>
        -
        3 //
        -
        4 // Use, modification and distribution are subject to the Boost Software License,
        -
        5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt)
        -
        7 //
        -
        8 
        -
        9 #ifndef BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        -
        10 #define BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        -
        11 
        -
        12 #include <boost/gil/image_processing/kernel.hpp>
        -
        13 #include <boost/gil/gray.hpp>
        -
        14 #include <boost/gil/image_processing/threshold.hpp>
        -
        15 
        -
        16 namespace boost { namespace gil { namespace detail {
        -
        17 
        -
        18 enum class morphological_operation
        -
        19 {
        -
        20  dilation,
        -
        21  erosion,
        -
        22 };
        -
        23 
        -
        26 
        -
        39 template <typename SrcView, typename DstView, typename Kernel>
        -
        40 void morph_impl(SrcView const& src_view, DstView const& dst_view, Kernel const& kernel,
        -
        41  morphological_operation identifier)
        -
        42 {
        -
        43  std::ptrdiff_t flip_ker_row, flip_ker_col, row_boundary, col_boundary;
        - -
        45  for (std::ptrdiff_t view_row = 0; view_row < src_view.height(); ++view_row)
        -
        46  {
        -
        47  for (std::ptrdiff_t view_col = 0; view_col < src_view.width(); ++view_col)
        -
        48  {
        -
        49  target_element = src_view(view_col, view_row);
        -
        50  for (std::size_t kernel_row = 0; kernel_row < kernel.size(); ++kernel_row)
        -
        51  {
        -
        52  flip_ker_row = kernel.size() - 1 - kernel_row; // row index of flipped kernel
        -
        53 
        -
        54  for (std::size_t kernel_col = 0; kernel_col < kernel.size(); ++kernel_col)
        -
        55  {
        -
        56  flip_ker_col = kernel.size() - 1 - kernel_col; // column index of flipped kernel
        -
        57 
        -
        58  // We ensure that we consider only those pixels which are overlapped
        -
        59  // on a non-zero kernel_element as
        -
        60  if (kernel.at(flip_ker_row, flip_ker_col) == 0)
        -
        61  {
        -
        62  continue;
        -
        63  }
        -
        64  // index of input signal, used for checking boundary
        -
        65  row_boundary = view_row + (kernel.center_y() - flip_ker_row);
        -
        66  col_boundary = view_col + (kernel.center_x() - flip_ker_col);
        -
        67 
        -
        68  // ignore input samples which are out of bound
        -
        69  if (row_boundary >= 0 && row_boundary < src_view.height() &&
        -
        70  col_boundary >= 0 && col_boundary < src_view.width())
        -
        71  {
        -
        72 
        -
        73  if (identifier == morphological_operation::dilation)
        -
        74  {
        -
        75  target_element =
        -
        76  (std::max)(src_view(col_boundary, row_boundary)[0], target_element);
        -
        77  }
        -
        78  else if (identifier == morphological_operation::erosion)
        -
        79  {
        -
        80  target_element =
        -
        81  (std::min)(src_view(col_boundary, row_boundary)[0], target_element);
        -
        82  }
        -
        83  }
        -
        84  }
        -
        85  }
        -
        86  dst_view(view_col, view_row) = target_element;
        -
        87  }
        -
        88  }
        -
        89 }
        -
        90 
        -
        102 template <typename SrcView, typename DstView, typename Kernel>
        -
        103 void morph(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat,
        -
        104  morphological_operation identifier)
        -
        105 {
        -
        106  BOOST_ASSERT(ker_mat.size() != 0 && src_view.dimensions() == dst_view.dimensions());
        -
        107  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        108  gil_function_requires<MutableImageViewConcept<DstView>>();
        -
        109 
        -
        110  gil_function_requires<ColorSpacesCompatibleConcept<typename color_space_type<SrcView>::type,
        -
        111  typename color_space_type<DstView>::type>>();
        -
        112 
        -
        113  gil::image<typename DstView::value_type> intermediate_img(src_view.dimensions());
        -
        114 
        -
        115  for (std::size_t i = 0; i < src_view.num_channels(); i++)
        -
        116  {
        -
        117  morph_impl(nth_channel_view(src_view, i), nth_channel_view(view(intermediate_img), i),
        -
        118  ker_mat, identifier);
        -
        119  }
        -
        120  copy_pixels(view(intermediate_img), dst_view);
        -
        121 }
        -
        122 
        -
        131 template <typename SrcView, typename DiffView>
        -
        132 void difference_impl(SrcView const& src_view1, SrcView const& src_view2, DiffView const& diff_view)
        -
        133 {
        -
        134  for (std::ptrdiff_t view_row = 0; view_row < src_view1.height(); ++view_row)
        -
        135  for (std::ptrdiff_t view_col = 0; view_col < src_view1.width(); ++view_col)
        -
        136  diff_view(view_col, view_row) =
        -
        137  src_view1(view_col, view_row) - src_view2(view_col, view_row);
        -
        138 }
        -
        139 
        -
        147 template <typename SrcView, typename DiffView>
        -
        148 void difference(SrcView const& src_view1, SrcView const& src_view2, DiffView const& diff_view)
        -
        149 {
        -
        150  gil_function_requires<ImageViewConcept<SrcView>>();
        -
        151  gil_function_requires<MutableImageViewConcept<DiffView>>();
        -
        152 
        -
        153  gil_function_requires<ColorSpacesCompatibleConcept<
        -
        154  typename color_space_type<SrcView>::type, typename color_space_type<DiffView>::type>>();
        -
        155 
        -
        156  for (std::size_t i = 0; i < src_view1.num_channels(); i++)
        -
        157  {
        -
        158  difference_impl(nth_channel_view(src_view1, i), nth_channel_view(src_view2, i),
        -
        159  nth_channel_view(diff_view, i));
        -
        160  }
        -
        161 }
        -
        162 } // namespace detail
        -
        163 
        -
        176 template <typename SrcView, typename IntOpView, typename Kernel>
        -
        177 void dilate(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat,
        -
        178  int iterations)
        -
        179 {
        -
        180  copy_pixels(src_view, int_op_view);
        -
        181  for (int i = 0; i < iterations; ++i)
        -
        182  morph(int_op_view, int_op_view, ker_mat, detail::morphological_operation::dilation);
        -
        183 }
        -
        184 
        -
        197 template <typename SrcView, typename IntOpView, typename Kernel>
        -
        198 void erode(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat,
        -
        199  int iterations)
        -
        200 {
        -
        201  copy_pixels(src_view, int_op_view);
        -
        202  for (int i = 0; i < iterations; ++i)
        -
        203  morph(int_op_view, int_op_view, ker_mat, detail::morphological_operation::erosion);
        -
        204 }
        -
        205 
        -
        215 template <typename SrcView, typename IntOpView, typename Kernel>
        -
        216 void opening(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat)
        -
        217 {
        -
        218  erode(src_view, int_op_view, ker_mat, 1);
        -
        219  dilate(int_op_view, int_op_view, ker_mat, 1);
        -
        220 }
        -
        221 
        -
        232 template <typename SrcView, typename IntOpView, typename Kernel>
        -
        233 void closing(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat)
        -
        234 {
        -
        235  dilate(src_view, int_op_view, ker_mat, 1);
        -
        236  erode(int_op_view, int_op_view, ker_mat, 1);
        -
        237 }
        -
        238 
        -
        250 template <typename SrcView, typename DstView, typename Kernel>
        -
        251 void morphological_gradient(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        -
        252 {
        -
        253  using namespace boost::gil;
        -
        254  gil::image<typename DstView::value_type> int_dilate(src_view.dimensions()),
        -
        255  int_erode(src_view.dimensions());
        -
        256  dilate(src_view, view(int_dilate), ker_mat, 1);
        -
        257  erode(src_view, view(int_erode), ker_mat, 1);
        -
        258  difference(view(int_dilate), view(int_erode), dst_view);
        -
        259 }
        -
        260 
        -
        270 template <typename SrcView, typename DstView, typename Kernel>
        -
        271 void top_hat(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        -
        272 {
        -
        273  using namespace boost::gil;
        -
        274  gil::image<typename DstView::value_type> int_opening(src_view.dimensions());
        -
        275  opening(src_view, view(int_opening), ker_mat);
        -
        276  difference(src_view, view(int_opening), dst_view);
        -
        277 }
        -
        278 
        -
        288 template <typename SrcView, typename DstView, typename Kernel>
        -
        289 void black_hat(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        -
        290 {
        -
        291  using namespace boost::gil;
        -
        292  gil::image<typename DstView::value_type> int_closing(src_view.dimensions());
        -
        293  closing(src_view, view(int_closing), ker_mat);
        -
        294  difference(view(int_closing), src_view, dst_view);
        -
        295 }
        -
        297 }} // namespace boost::gil
        -
        298 #endif // BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        -
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition: image.hpp:43
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        void difference(SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
        Passes parameter values to the function 'difference_impl' alongwith individual channel views of input...
        Definition: morphology.hpp:148
        -
        void difference_impl(SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
        Calculates the difference between pixel values of first image_view and second image_view.
        Definition: morphology.hpp:132
        -
        void morph(SrcView const &src_view, DstView const &dst_view, Kernel const &ker_mat, morphological_operation identifier)
        Checks feasibility of the desired operation and passes parameter values to the function morph_impl al...
        Definition: morphology.hpp:103
        -
        void morph_impl(SrcView const &src_view, DstView const &dst_view, Kernel const &kernel, morphological_operation identifier)
        Implements morphological operations at pixel level.This function compares neighbouring pixel values a...
        Definition: morphology.hpp:40
        -
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition: algorithm.hpp:292
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Two color spaces are compatible if they are the same.
        Definition: color.hpp:61
        -
        Definition: color_convert.hpp:31
        +
        1//
        +
        2// Copyright 2021 Prathamesh Tagore <prathameshtagore@gmail.com>
        +
        3//
        +
        4// Use, modification and distribution are subject to the Boost Software License,
        +
        5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt)
        +
        7//
        +
        8
        +
        9#ifndef BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        +
        10#define BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        +
        11
        +
        12#include <boost/gil/image_processing/kernel.hpp>
        +
        13#include <boost/gil/gray.hpp>
        +
        14#include <boost/gil/image_processing/threshold.hpp>
        +
        15
        +
        16namespace boost { namespace gil { namespace detail {
        +
        17
        +
        18enum class morphological_operation
        +
        19{
        +
        20 dilation,
        +
        21 erosion,
        +
        22};
        +
        23
        +
        26
        +
        39template <typename SrcView, typename DstView, typename Kernel>
        +
        +
        40void morph_impl(SrcView const& src_view, DstView const& dst_view, Kernel const& kernel,
        +
        41 morphological_operation identifier)
        +
        42{
        +
        43 std::ptrdiff_t flip_ker_row, flip_ker_col, row_boundary, col_boundary;
        + +
        45 for (std::ptrdiff_t view_row = 0; view_row < src_view.height(); ++view_row)
        +
        46 {
        +
        47 for (std::ptrdiff_t view_col = 0; view_col < src_view.width(); ++view_col)
        +
        48 {
        +
        49 target_element = src_view(view_col, view_row);
        +
        50 for (std::size_t kernel_row = 0; kernel_row < kernel.size(); ++kernel_row)
        +
        51 {
        +
        52 flip_ker_row = kernel.size() - 1 - kernel_row; // row index of flipped kernel
        +
        53
        +
        54 for (std::size_t kernel_col = 0; kernel_col < kernel.size(); ++kernel_col)
        +
        55 {
        +
        56 flip_ker_col = kernel.size() - 1 - kernel_col; // column index of flipped kernel
        +
        57
        +
        58 // We ensure that we consider only those pixels which are overlapped
        +
        59 // on a non-zero kernel_element as
        +
        60 if (kernel.at(flip_ker_row, flip_ker_col) == 0)
        +
        61 {
        +
        62 continue;
        +
        63 }
        +
        64 // index of input signal, used for checking boundary
        +
        65 row_boundary = view_row + (kernel.center_y() - flip_ker_row);
        +
        66 col_boundary = view_col + (kernel.center_x() - flip_ker_col);
        +
        67
        +
        68 // ignore input samples which are out of bound
        +
        69 if (row_boundary >= 0 && row_boundary < src_view.height() &&
        +
        70 col_boundary >= 0 && col_boundary < src_view.width())
        +
        71 {
        +
        72
        +
        73 if (identifier == morphological_operation::dilation)
        +
        74 {
        +
        75 target_element =
        +
        76 (std::max)(src_view(col_boundary, row_boundary)[0], target_element);
        +
        77 }
        +
        78 else if (identifier == morphological_operation::erosion)
        +
        79 {
        +
        80 target_element =
        +
        81 (std::min)(src_view(col_boundary, row_boundary)[0], target_element);
        +
        82 }
        +
        83 }
        +
        84 }
        +
        85 }
        +
        86 dst_view(view_col, view_row) = target_element;
        +
        87 }
        +
        88 }
        +
        89}
        +
        +
        90
        +
        102template <typename SrcView, typename DstView, typename Kernel>
        +
        +
        103void morph(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat,
        +
        104 morphological_operation identifier)
        +
        105{
        +
        106 BOOST_ASSERT(ker_mat.size() != 0 && src_view.dimensions() == dst_view.dimensions());
        +
        107 gil_function_requires<ImageViewConcept<SrcView>>();
        +
        108 gil_function_requires<MutableImageViewConcept<DstView>>();
        +
        109
        +
        110 gil_function_requires<ColorSpacesCompatibleConcept<typename color_space_type<SrcView>::type,
        +
        111 typename color_space_type<DstView>::type>>();
        +
        112
        +
        113 gil::image<typename DstView::value_type> intermediate_img(src_view.dimensions());
        +
        114
        +
        115 for (std::size_t i = 0; i < src_view.num_channels(); i++)
        +
        116 {
        +
        117 morph_impl(nth_channel_view(src_view, i), nth_channel_view(view(intermediate_img), i),
        +
        118 ker_mat, identifier);
        +
        119 }
        +
        120 copy_pixels(view(intermediate_img), dst_view);
        +
        121}
        +
        +
        122
        +
        131template <typename SrcView, typename DiffView>
        +
        +
        132void difference_impl(SrcView const& src_view1, SrcView const& src_view2, DiffView const& diff_view)
        +
        133{
        +
        134 for (std::ptrdiff_t view_row = 0; view_row < src_view1.height(); ++view_row)
        +
        135 for (std::ptrdiff_t view_col = 0; view_col < src_view1.width(); ++view_col)
        +
        136 diff_view(view_col, view_row) =
        +
        137 src_view1(view_col, view_row) - src_view2(view_col, view_row);
        +
        138}
        +
        +
        139
        +
        147template <typename SrcView, typename DiffView>
        +
        +
        148void difference(SrcView const& src_view1, SrcView const& src_view2, DiffView const& diff_view)
        +
        149{
        +
        150 gil_function_requires<ImageViewConcept<SrcView>>();
        +
        151 gil_function_requires<MutableImageViewConcept<DiffView>>();
        +
        152
        +
        153 gil_function_requires<ColorSpacesCompatibleConcept<
        +
        154 typename color_space_type<SrcView>::type, typename color_space_type<DiffView>::type>>();
        +
        155
        +
        156 for (std::size_t i = 0; i < src_view1.num_channels(); i++)
        +
        157 {
        +
        158 difference_impl(nth_channel_view(src_view1, i), nth_channel_view(src_view2, i),
        +
        159 nth_channel_view(diff_view, i));
        +
        160 }
        +
        161}
        +
        +
        162} // namespace detail
        +
        163
        +
        176template <typename SrcView, typename IntOpView, typename Kernel>
        +
        177void dilate(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat,
        +
        178 int iterations)
        +
        179{
        +
        180 copy_pixels(src_view, int_op_view);
        +
        181 for (int i = 0; i < iterations; ++i)
        +
        182 morph(int_op_view, int_op_view, ker_mat, detail::morphological_operation::dilation);
        +
        183}
        +
        184
        +
        197template <typename SrcView, typename IntOpView, typename Kernel>
        +
        198void erode(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat,
        +
        199 int iterations)
        +
        200{
        +
        201 copy_pixels(src_view, int_op_view);
        +
        202 for (int i = 0; i < iterations; ++i)
        +
        203 morph(int_op_view, int_op_view, ker_mat, detail::morphological_operation::erosion);
        +
        204}
        +
        205
        +
        215template <typename SrcView, typename IntOpView, typename Kernel>
        +
        216void opening(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat)
        +
        217{
        +
        218 erode(src_view, int_op_view, ker_mat, 1);
        +
        219 dilate(int_op_view, int_op_view, ker_mat, 1);
        +
        220}
        +
        221
        +
        232template <typename SrcView, typename IntOpView, typename Kernel>
        +
        233void closing(SrcView const& src_view, IntOpView const& int_op_view, Kernel const& ker_mat)
        +
        234{
        +
        235 dilate(src_view, int_op_view, ker_mat, 1);
        +
        236 erode(int_op_view, int_op_view, ker_mat, 1);
        +
        237}
        +
        238
        +
        250template <typename SrcView, typename DstView, typename Kernel>
        +
        251void morphological_gradient(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        +
        252{
        +
        253 using namespace boost::gil;
        +
        254 gil::image<typename DstView::value_type> int_dilate(src_view.dimensions()),
        +
        255 int_erode(src_view.dimensions());
        +
        256 dilate(src_view, view(int_dilate), ker_mat, 1);
        +
        257 erode(src_view, view(int_erode), ker_mat, 1);
        +
        258 difference(view(int_dilate), view(int_erode), dst_view);
        +
        259}
        +
        260
        +
        270template <typename SrcView, typename DstView, typename Kernel>
        +
        271void top_hat(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        +
        272{
        +
        273 using namespace boost::gil;
        +
        274 gil::image<typename DstView::value_type> int_opening(src_view.dimensions());
        +
        275 opening(src_view, view(int_opening), ker_mat);
        +
        276 difference(src_view, view(int_opening), dst_view);
        +
        277}
        +
        278
        +
        288template <typename SrcView, typename DstView, typename Kernel>
        +
        289void black_hat(SrcView const& src_view, DstView const& dst_view, Kernel const& ker_mat)
        +
        290{
        +
        291 using namespace boost::gil;
        +
        292 gil::image<typename DstView::value_type> int_closing(src_view.dimensions());
        +
        293 closing(src_view, view(int_closing), ker_mat);
        +
        294 difference(view(int_closing), src_view, dst_view);
        +
        295}
        +
        297}} // namespace boost::gil
        +
        298#endif // BOOST_GIL_IMAGE_PROCESSING_MORPHOLOGY_HPP
        +
        container interface over image view. Models ImageConcept, PixelBasedConcept
        Definition image.hpp:43
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        void morph_impl(SrcView const &src_view, DstView const &dst_view, Kernel const &kernel, morphological_operation identifier)
        Implements morphological operations at pixel level.This function compares neighbouring pixel values a...
        Definition morphology.hpp:40
        +
        void morph(SrcView const &src_view, DstView const &dst_view, Kernel const &ker_mat, morphological_operation identifier)
        Checks feasibility of the desired operation and passes parameter values to the function morph_impl al...
        Definition morphology.hpp:103
        +
        void difference_impl(SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
        Calculates the difference between pixel values of first image_view and second image_view.
        Definition morphology.hpp:132
        +
        void difference(SrcView const &src_view1, SrcView const &src_view2, DiffView const &diff_view)
        Passes parameter values to the function 'difference_impl' alongwith individual channel views of input...
        Definition morphology.hpp:148
        +
        BOOST_FORCEINLINE void copy_pixels(const View1 &src, const View2 &dst)
        std::copy for image views
        Definition algorithm.hpp:292
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Two color spaces are compatible if they are the same.
        Definition color.hpp:61
        +
        Definition color_convert.hpp:31
        diff --git a/html/reference/namespaceboost.html b/html/reference/namespaceboost.html index c719b3d60..e12434bb2 100644 --- a/html/reference/namespaceboost.html +++ b/html/reference/namespaceboost.html @@ -4,7 +4,7 @@ - + Generic Image Library: boost Namespace Reference @@ -27,20 +27,20 @@

        - + +/* @license-end */ +
        -
        -
        boost Namespace Reference
        +
        boost Namespace Reference
        @@ -54,7 +54,7 @@ $(function() { diff --git a/html/reference/namespaces.html b/html/reference/namespaces.html index 088507210..fef8dfbd3 100644 --- a/html/reference/namespaces.html +++ b/html/reference/namespaces.html @@ -4,7 +4,7 @@ - + Generic Image Library: Namespace List @@ -27,327 +27,25 @@

        - + +/* @license-end */ +
        -
        -
        Namespace List
        +
        Namespace List
        Here is a list of all documented namespaces with brief descriptions:
        -
        [detail level 12345]
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
         NboostDefined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
         Ngil
         Nstd
        +
         NboostDefined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        @@ -356,7 +54,7 @@ $(function() { diff --git a/html/reference/nav_fd.png b/html/reference/nav_fd.png new file mode 100644 index 000000000..032fbdd4c Binary files /dev/null and b/html/reference/nav_fd.png differ diff --git a/html/reference/nav_hd.png b/html/reference/nav_hd.png new file mode 100644 index 000000000..de80f18ad Binary files /dev/null and b/html/reference/nav_hd.png differ diff --git a/html/reference/numeric_8hpp_source.html b/html/reference/numeric_8hpp_source.html index a3db85b04..596acc3dd 100644 --- a/html/reference/numeric_8hpp_source.html +++ b/html/reference/numeric_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: numeric.hpp Source File @@ -27,287 +27,309 @@

        - + +/* @license-end */ + +
        -
        -
        numeric.hpp
        +
        numeric.hpp
        -
        1 //
        -
        2 // Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
        -
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        -
        4 //
        -
        5 // Use, modification and distribution are subject to the Boost Software License,
        -
        6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt)
        -
        8 //
        -
        9 #ifndef BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
        -
        10 #define BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
        -
        11 
        -
        12 #include <boost/gil/image_processing/kernel.hpp>
        -
        13 #include <boost/gil/image_processing/convolve.hpp>
        -
        14 #include <boost/gil/image_view.hpp>
        -
        15 #include <boost/gil/typedefs.hpp>
        -
        16 #include <boost/gil/detail/math.hpp>
        -
        17 // fixes ambigious call to std::abs, https://stackoverflow.com/a/30084734/4593721
        -
        18 #include <cstdlib>
        -
        19 #include <cmath>
        -
        20 
        -
        21 namespace boost { namespace gil {
        -
        22 
        -
        34 inline double normalized_sinc(double x)
        -
        35 {
        -
        36  return std::sin(x * boost::gil::detail::pi) / (x * boost::gil::detail::pi);
        -
        37 }
        -
        38 
        -
        46 inline double lanczos(double x, std::ptrdiff_t a)
        -
        47 {
        -
        48  // means == but <= avoids compiler warning
        -
        49  if (0 <= x && x <= 0)
        -
        50  return 1;
        -
        51 
        -
        52  if (static_cast<double>(-a) < x && x < static_cast<double>(a))
        -
        53  return normalized_sinc(x) / normalized_sinc(x / static_cast<double>(a));
        -
        54 
        -
        55  return 0;
        -
        56 }
        -
        57 
        -
        58 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        59 #pragma warning(push)
        -
        60 #pragma warning(disable:4244) // 'argument': conversion from 'const Channel' to 'BaseChannelValue', possible loss of data
        -
        61 #endif
        -
        62 
        -
        63 inline void compute_tensor_entries(
        -
        64  boost::gil::gray16s_view_t dx,
        -
        65  boost::gil::gray16s_view_t dy,
        -
        66  boost::gil::gray32f_view_t m11,
        -
        67  boost::gil::gray32f_view_t m12_21,
        -
        68  boost::gil::gray32f_view_t m22)
        -
        69 {
        -
        70  for (std::ptrdiff_t y = 0; y < dx.height(); ++y) {
        -
        71  for (std::ptrdiff_t x = 0; x < dx.width(); ++x) {
        -
        72  auto dx_value = dx(x, y);
        -
        73  auto dy_value = dy(x, y);
        -
        74  m11(x, y) = dx_value * dx_value;
        -
        75  m12_21(x, y) = dx_value * dy_value;
        -
        76  m22(x, y) = dy_value * dy_value;
        -
        77  }
        -
        78  }
        -
        79 }
        -
        80 
        -
        81 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        82 #pragma warning(pop)
        -
        83 #endif
        -
        84 
        -
        91 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        92 inline auto generate_normalized_mean(std::size_t side_length)
        - -
        94 {
        -
        95  if (side_length % 2 != 1)
        -
        96  throw std::invalid_argument("kernel dimensions should be odd and equal");
        -
        97  const float entry = 1.0f / static_cast<float>(side_length * side_length);
        -
        98 
        -
        99  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
        -
        100  for (auto& cell: result) {
        -
        101  cell = entry;
        -
        102  }
        -
        103 
        -
        104  return result;
        -
        105 }
        -
        106 
        -
        111 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        112 inline auto generate_unnormalized_mean(std::size_t side_length)
        - -
        114 {
        -
        115  if (side_length % 2 != 1)
        -
        116  throw std::invalid_argument("kernel dimensions should be odd and equal");
        -
        117 
        -
        118  detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
        -
        119  for (auto& cell: result) {
        -
        120  cell = 1.0f;
        -
        121  }
        -
        122 
        -
        123  return result;
        -
        124 }
        -
        125 
        -
        131 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        132 inline auto generate_gaussian_kernel(std::size_t side_length, double sigma)
        - -
        134 {
        -
        135  if (side_length % 2 != 1)
        -
        136  throw std::invalid_argument("kernel dimensions should be odd and equal");
        -
        137 
        -
        138  const double denominator = 2 * boost::gil::detail::pi * sigma * sigma;
        -
        139  auto const middle = side_length / 2;
        -
        140  std::vector<T, Allocator> values(side_length * side_length);
        -
        141  T sum{0};
        -
        142  for (std::size_t y = 0; y < side_length; ++y)
        -
        143  {
        -
        144  for (std::size_t x = 0; x < side_length; ++x)
        -
        145  {
        -
        146  const auto delta_x = x - middle;
        -
        147  const auto delta_y = y - middle;
        -
        148  const auto power = static_cast<double>(delta_x * delta_x + delta_y * delta_y) / (2 * sigma * sigma);
        -
        149  const double nominator = std::exp(-power);
        -
        150  const auto value = static_cast<T>(nominator / denominator);
        -
        151  values[y * side_length + x] = value;
        -
        152  sum += value;
        -
        153  }
        -
        154  }
        -
        155 
        -
        156  // normalize so that Gaussian kernel sums up to 1.
        -
        157  std::transform(values.begin(), values.end(), values.begin(), [&sum](const auto & v) { return v/sum; });
        -
        158 
        -
        159  return detail::kernel_2d<T, Allocator>(values.begin(), values.size(), middle, middle);
        -
        160 }
        -
        161 
        -
        169 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        170 inline auto generate_dx_sobel(unsigned int degree = 1)
        - -
        172 {
        -
        173  switch (degree)
        -
        174  {
        -
        175  case 0:
        -
        176  {
        -
        177  return detail::get_identity_kernel<T, Allocator>();
        -
        178  }
        -
        179  case 1:
        -
        180  {
        -
        181  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        -
        182  std::copy(detail::dx_sobel.begin(), detail::dx_sobel.end(), result.begin());
        -
        183  return result;
        -
        184  }
        -
        185  default:
        -
        186  throw std::logic_error("not supported yet");
        -
        187  }
        -
        188 
        -
        189  //to not upset compiler
        -
        190  throw std::runtime_error("unreachable statement");
        -
        191 }
        -
        192 
        -
        200 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        201 inline auto generate_dx_scharr(unsigned int degree = 1)
        - -
        203 {
        -
        204  switch (degree)
        -
        205  {
        -
        206  case 0:
        -
        207  {
        -
        208  return detail::get_identity_kernel<T, Allocator>();
        -
        209  }
        -
        210  case 1:
        -
        211  {
        -
        212  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        -
        213  std::copy(detail::dx_scharr.begin(), detail::dx_scharr.end(), result.begin());
        -
        214  return result;
        -
        215  }
        -
        216  default:
        -
        217  throw std::logic_error("not supported yet");
        -
        218  }
        -
        219 
        -
        220  //to not upset compiler
        -
        221  throw std::runtime_error("unreachable statement");
        -
        222 }
        -
        223 
        -
        231 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        232 inline auto generate_dy_sobel(unsigned int degree = 1)
        - -
        234 {
        -
        235  switch (degree)
        -
        236  {
        -
        237  case 0:
        -
        238  {
        -
        239  return detail::get_identity_kernel<T, Allocator>();
        -
        240  }
        -
        241  case 1:
        -
        242  {
        -
        243  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        -
        244  std::copy(detail::dy_sobel.begin(), detail::dy_sobel.end(), result.begin());
        -
        245  return result;
        -
        246  }
        -
        247  default:
        -
        248  throw std::logic_error("not supported yet");
        -
        249  }
        -
        250 
        -
        251  //to not upset compiler
        -
        252  throw std::runtime_error("unreachable statement");
        -
        253 }
        -
        254 
        -
        262 template <typename T = float, typename Allocator = std::allocator<T>>
        -
        263 inline auto generate_dy_scharr(unsigned int degree = 1)
        - -
        265 {
        -
        266  switch (degree)
        -
        267  {
        -
        268  case 0:
        -
        269  {
        -
        270  return detail::get_identity_kernel<T, Allocator>();
        -
        271  }
        -
        272  case 1:
        -
        273  {
        -
        274  detail::kernel_2d<T, Allocator> result(3, 1, 1);
        -
        275  std::copy(detail::dy_scharr.begin(), detail::dy_scharr.end(), result.begin());
        -
        276  return result;
        -
        277  }
        -
        278  default:
        -
        279  throw std::logic_error("not supported yet");
        -
        280  }
        -
        281 
        -
        282  //to not upset compiler
        -
        283  throw std::runtime_error("unreachable statement");
        -
        284 }
        -
        285 
        -
        295 template <typename GradientView, typename OutputView>
        - -
        297  GradientView dx,
        -
        298  GradientView dy,
        -
        299  OutputView ddxx,
        -
        300  OutputView dxdy,
        -
        301  OutputView ddyy)
        -
        302 {
        -
        303  auto sobel_x = generate_dx_sobel();
        -
        304  auto sobel_y = generate_dy_sobel();
        -
        305  detail::convolve_2d(dx, sobel_x, ddxx);
        -
        306  detail::convolve_2d(dx, sobel_y, dxdy);
        -
        307  detail::convolve_2d(dy, sobel_y, ddyy);
        -
        308 }
        -
        309 
        -
        310 }} // namespace boost::gil
        -
        311 
        -
        312 #endif
        -
        variable-size kernel
        Definition: kernel.hpp:273
        -
        auto generate_gaussian_kernel(std::size_t side_length, double sigma) -> detail::kernel_2d< T, Allocator >
        Generate Gaussian kernel.
        Definition: numeric.hpp:132
        -
        auto generate_unnormalized_mean(std::size_t side_length) -> detail::kernel_2d< T, Allocator >
        Generate kernel with all 1s.
        Definition: numeric.hpp:112
        -
        void compute_hessian_entries(GradientView dx, GradientView dy, OutputView ddxx, OutputView dxdy, OutputView ddyy)
        Compute xy gradient, and second order x and y gradients.
        Definition: numeric.hpp:296
        -
        auto generate_dy_scharr(unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
        Generate Scharr operator in vertical direction.
        Definition: numeric.hpp:263
        -
        double lanczos(double x, std::ptrdiff_t a)
        Lanczos response at point x.
        Definition: numeric.hpp:46
        -
        auto generate_dx_sobel(unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
        Generates Sobel operator in horizontal direction.
        Definition: numeric.hpp:170
        -
        auto generate_normalized_mean(std::size_t side_length) -> detail::kernel_2d< T, Allocator >
        Generate mean kernel.
        Definition: numeric.hpp:92
        -
        auto generate_dy_sobel(unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
        Generates Sobel operator in vertical direction.
        Definition: numeric.hpp:232
        -
        auto generate_dx_scharr(unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
        Generate Scharr operator in horizontal direction.
        Definition: numeric.hpp:201
        -
        BOOST_FORCEINLINE auto copy(boost::gil::pixel< T, CS > *first, boost::gil::pixel< T, CS > *last, boost::gil::pixel< T, CS > *dst) -> boost::gil::pixel< T, CS > *
        Copy when both src and dst are interleaved and of the same type can be just memmove.
        Definition: algorithm.hpp:145
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
        +
        3// Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4//
        +
        5// Use, modification and distribution are subject to the Boost Software License,
        +
        6// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt)
        +
        8//
        +
        9#ifndef BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
        +
        10#define BOOST_GIL_IMAGE_PROCESSING_NUMERIC_HPP
        +
        11
        +
        12#include <boost/gil/image_processing/kernel.hpp>
        +
        13#include <boost/gil/image_processing/convolve.hpp>
        +
        14#include <boost/gil/image_view.hpp>
        +
        15#include <boost/gil/typedefs.hpp>
        +
        16#include <boost/gil/detail/math.hpp>
        +
        17// fixes ambiguous call to std::abs, https://stackoverflow.com/a/30084734/4593721
        +
        18#include <cstdlib>
        +
        19#include <cmath>
        +
        20
        +
        21namespace boost { namespace gil {
        +
        22
        +
        34inline double normalized_sinc(double x)
        +
        35{
        +
        36 return std::sin(x * boost::gil::detail::pi) / (x * boost::gil::detail::pi);
        +
        37}
        +
        38
        +
        +
        46inline double lanczos(double x, std::ptrdiff_t a)
        +
        47{
        +
        48 // means == but <= avoids compiler warning
        +
        49 if (0 <= x && x <= 0)
        +
        50 return 1;
        +
        51
        +
        52 if (static_cast<double>(-a) < x && x < static_cast<double>(a))
        +
        53 return normalized_sinc(x) / normalized_sinc(x / static_cast<double>(a));
        +
        54
        +
        55 return 0;
        +
        56}
        +
        +
        57
        +
        58#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        59#pragma warning(push)
        +
        60#pragma warning(disable:4244) // 'argument': conversion from 'const Channel' to 'BaseChannelValue', possible loss of data
        +
        61#endif
        +
        62
        +
        63inline void compute_tensor_entries(
        +
        64 boost::gil::gray16s_view_t dx,
        +
        65 boost::gil::gray16s_view_t dy,
        +
        66 boost::gil::gray32f_view_t m11,
        +
        67 boost::gil::gray32f_view_t m12_21,
        +
        68 boost::gil::gray32f_view_t m22)
        +
        69{
        +
        70 for (std::ptrdiff_t y = 0; y < dx.height(); ++y) {
        +
        71 for (std::ptrdiff_t x = 0; x < dx.width(); ++x) {
        +
        72 auto dx_value = dx(x, y);
        +
        73 auto dy_value = dy(x, y);
        +
        74 m11(x, y) = dx_value * dx_value;
        +
        75 m12_21(x, y) = dx_value * dy_value;
        +
        76 m22(x, y) = dy_value * dy_value;
        +
        77 }
        +
        78 }
        +
        79}
        +
        80
        +
        81#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        82#pragma warning(pop)
        +
        83#endif
        +
        84
        +
        91template <typename T = float, typename Allocator = std::allocator<T>>
        +
        +
        92inline auto generate_normalized_mean(std::size_t side_length)
        + +
        94{
        +
        95 if (side_length % 2 != 1)
        +
        96 throw std::invalid_argument("kernel dimensions should be odd and equal");
        +
        97 const float entry = 1.0f / static_cast<float>(side_length * side_length);
        +
        98
        +
        99 detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
        +
        100 for (auto& cell: result) {
        +
        101 cell = entry;
        +
        102 }
        +
        103
        +
        104 return result;
        +
        105}
        +
        +
        106
        +
        111template <typename T = float, typename Allocator = std::allocator<T>>
        +
        +
        112inline auto generate_unnormalized_mean(std::size_t side_length)
        + +
        114{
        +
        115 if (side_length % 2 != 1)
        +
        116 throw std::invalid_argument("kernel dimensions should be odd and equal");
        +
        117
        +
        118 detail::kernel_2d<T, Allocator> result(side_length, side_length / 2, side_length / 2);
        +
        119 for (auto& cell: result) {
        +
        120 cell = 1.0f;
        +
        121 }
        +
        122
        +
        123 return result;
        +
        124}
        +
        +
        125
        +
        131template <typename T = float, typename Allocator = std::allocator<T>>
        +
        +
        132inline auto generate_gaussian_kernel(std::size_t side_length, double sigma)
        + +
        134{
        +
        135 if (side_length % 2 != 1)
        +
        136 throw std::invalid_argument("kernel dimensions should be odd and equal");
        +
        137
        +
        138 const double denominator = 2 * boost::gil::detail::pi * sigma * sigma;
        +
        139 auto const middle = side_length / 2;
        +
        140 std::vector<T, Allocator> values(side_length * side_length);
        +
        141 T sum{0};
        +
        142 for (std::size_t y = 0; y < side_length; ++y)
        +
        143 {
        +
        144 for (std::size_t x = 0; x < side_length; ++x)
        +
        145 {
        +
        146 const auto delta_x = x - middle;
        +
        147 const auto delta_y = y - middle;
        +
        148 const auto power = static_cast<double>(delta_x * delta_x + delta_y * delta_y) / (2 * sigma * sigma);
        +
        149 const double nominator = std::exp(-power);
        +
        150 const auto value = static_cast<T>(nominator / denominator);
        +
        151 values[y * side_length + x] = value;
        +
        152 sum += value;
        +
        153 }
        +
        154 }
        +
        155
        +
        156 // normalize so that Gaussian kernel sums up to 1.
        +
        157 std::transform(values.begin(), values.end(), values.begin(), [&sum](const auto & v) { return v/sum; });
        +
        158
        +
        159 return detail::kernel_2d<T, Allocator>(values.begin(), values.size(), middle, middle);
        +
        160}
        +
        +
        161
        +
        169template <typename T = float, typename Allocator = std::allocator<T>>
        +
        +
        170inline auto generate_dx_sobel(unsigned int degree = 1)
        + +
        172{
        +
        173 switch (degree)
        +
        174 {
        +
        175 case 0:
        +
        176 {
        +
        177 return detail::get_identity_kernel<T, Allocator>();
        +
        178 }
        +
        179 case 1:
        +
        180 {
        +
        181 detail::kernel_2d<T, Allocator> result(3, 1, 1);
        +
        182 std::copy(detail::dx_sobel.begin(), detail::dx_sobel.end(), result.begin());
        +
        183 return result;
        +
        184 }
        +
        185 default:
        +
        186 throw std::logic_error("not supported yet");
        +
        187 }
        +
        188
        +
        189 //to not upset compiler
        +
        190 throw std::runtime_error("unreachable statement");
        +
        191}
        +
        +
        192
        +
        200template <typename T = float, typename Allocator = std::allocator<T>>
        +
        +
        201inline auto generate_dx_scharr(unsigned int degree = 1)
        + +
        203{
        +
        204 switch (degree)
        +
        205 {
        +
        206 case 0:
        +
        207 {
        +
        208 return detail::get_identity_kernel<T, Allocator>();
        +
        209 }
        +
        210 case 1:
        +
        211 {
        +
        212 detail::kernel_2d<T, Allocator> result(3, 1, 1);
        +
        213 std::copy(detail::dx_scharr.begin(), detail::dx_scharr.end(), result.begin());
        +
        214 return result;
        +
        215 }
        +
        216 default:
        +
        217 throw std::logic_error("not supported yet");
        +
        218 }
        +
        219
        +
        220 //to not upset compiler
        +
        221 throw std::runtime_error("unreachable statement");
        +
        222}
        +
        +
        223
        +
        231template <typename T = float, typename Allocator = std::allocator<T>>
        +
        +
        232inline auto generate_dy_sobel(unsigned int degree = 1)
        + +
        234{
        +
        235 switch (degree)
        +
        236 {
        +
        237 case 0:
        +
        238 {
        +
        239 return detail::get_identity_kernel<T, Allocator>();
        +
        240 }
        +
        241 case 1:
        +
        242 {
        +
        243 detail::kernel_2d<T, Allocator> result(3, 1, 1);
        +
        244 std::copy(detail::dy_sobel.begin(), detail::dy_sobel.end(), result.begin());
        +
        245 return result;
        +
        246 }
        +
        247 default:
        +
        248 throw std::logic_error("not supported yet");
        +
        249 }
        +
        250
        +
        251 //to not upset compiler
        +
        252 throw std::runtime_error("unreachable statement");
        +
        253}
        +
        +
        254
        +
        262template <typename T = float, typename Allocator = std::allocator<T>>
        +
        +
        263inline auto generate_dy_scharr(unsigned int degree = 1)
        + +
        265{
        +
        266 switch (degree)
        +
        267 {
        +
        268 case 0:
        +
        269 {
        +
        270 return detail::get_identity_kernel<T, Allocator>();
        +
        271 }
        +
        272 case 1:
        +
        273 {
        +
        274 detail::kernel_2d<T, Allocator> result(3, 1, 1);
        +
        275 std::copy(detail::dy_scharr.begin(), detail::dy_scharr.end(), result.begin());
        +
        276 return result;
        +
        277 }
        +
        278 default:
        +
        279 throw std::logic_error("not supported yet");
        +
        280 }
        +
        281
        +
        282 //to not upset compiler
        +
        283 throw std::runtime_error("unreachable statement");
        +
        284}
        +
        +
        285
        +
        295template <typename GradientView, typename OutputView>
        +
        + +
        297 GradientView dx,
        +
        298 GradientView dy,
        +
        299 OutputView ddxx,
        +
        300 OutputView dxdy,
        +
        301 OutputView ddyy)
        +
        302{
        +
        303 auto sobel_x = generate_dx_sobel();
        +
        304 auto sobel_y = generate_dy_sobel();
        +
        305 detail::convolve_2d(dx, sobel_x, ddxx);
        +
        306 detail::convolve_2d(dx, sobel_y, dxdy);
        +
        307 detail::convolve_2d(dy, sobel_y, ddyy);
        +
        308}
        +
        +
        309
        +
        310}} // namespace boost::gil
        +
        311
        +
        312#endif
        +
        variable-size kernel
        Definition kernel.hpp:273
        +
        auto generate_gaussian_kernel(std::size_t side_length, double sigma) -> detail::kernel_2d< T, Allocator >
        Generate Gaussian kernel.
        Definition numeric.hpp:132
        +
        auto generate_dy_scharr(unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
        Generate Scharr operator in vertical direction.
        Definition numeric.hpp:263
        +
        void compute_hessian_entries(GradientView dx, GradientView dy, OutputView ddxx, OutputView dxdy, OutputView ddyy)
        Compute xy gradient, and second order x and y gradients.
        Definition numeric.hpp:296
        +
        auto generate_dx_scharr(unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
        Generate Scharr operator in horizontal direction.
        Definition numeric.hpp:201
        +
        auto generate_unnormalized_mean(std::size_t side_length) -> detail::kernel_2d< T, Allocator >
        Generate kernel with all 1s.
        Definition numeric.hpp:112
        +
        auto generate_dy_sobel(unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
        Generates Sobel operator in vertical direction.
        Definition numeric.hpp:232
        +
        auto generate_dx_sobel(unsigned int degree=1) -> detail::kernel_2d< T, Allocator >
        Generates Sobel operator in horizontal direction.
        Definition numeric.hpp:170
        +
        double lanczos(double x, std::ptrdiff_t a)
        Lanczos response at point x.
        Definition numeric.hpp:46
        +
        auto generate_normalized_mean(std::size_t side_length) -> detail::kernel_2d< T, Allocator >
        Generate mean kernel.
        Definition numeric.hpp:92
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/packed__pixel_8hpp_source.html b/html/reference/packed__pixel_8hpp_source.html index 4eeea71b5..57b3fdf0f 100644 --- a/html/reference/packed__pixel_8hpp_source.html +++ b/html/reference/packed__pixel_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: packed_pixel.hpp Source File @@ -27,272 +27,278 @@

        - + +/* @license-end */ + +
        -
        -
        packed_pixel.hpp
        +
        packed_pixel.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_PACKED_PIXEL_HPP
        -
        9 #define BOOST_GIL_PACKED_PIXEL_HPP
        -
        10 
        -
        11 #include <boost/gil/pixel.hpp>
        -
        12 #include <boost/gil/detail/mp11.hpp>
        -
        13 
        -
        14 #include <functional>
        -
        15 #include <type_traits>
        -
        16 
        -
        17 namespace boost { namespace gil {
        -
        18 
        -
        21 
        -
        25 
        -
        41 
        -
        48 template <typename BitField, typename ChannelRefs, typename Layout>
        - -
        50 {
        -
        51  BitField _bitfield{0}; // TODO: Make private
        -
        52 
        -
        53  using layout_t = Layout;
        - -
        55  using reference = value_type&;
        -
        56  using const_reference = value_type const&;
        -
        57 
        -
        58  static constexpr bool is_mutable =
        -
        59  channel_traits<mp11::mp_front<ChannelRefs>>::is_mutable;
        -
        60 
        -
        61  packed_pixel() = default;
        -
        62  explicit packed_pixel(const BitField& bitfield) : _bitfield(bitfield) {}
        -
        63 
        -
        64  template <typename Pixel>
        -
        65  packed_pixel(Pixel const& p,
        -
        66  typename std::enable_if<is_pixel<Pixel>::value>::type* /*dummy*/ = nullptr)
        -
        67  {
        -
        68  check_compatible<Pixel>();
        -
        69  static_copy(p, *this);
        -
        70  }
        -
        71 
        -
        72  packed_pixel(int chan0, int chan1)
        -
        73  : _bitfield(0)
        -
        74  {
        -
        75  static_assert(num_channels<packed_pixel>::value == 2, "");
        -
        76  gil::at_c<0>(*this) = chan0;
        -
        77  gil::at_c<1>(*this) = chan1;
        -
        78  }
        -
        79 
        -
        80  packed_pixel(int chan0, int chan1, int chan2)
        -
        81  : _bitfield(0)
        -
        82  {
        -
        83  static_assert(num_channels<packed_pixel>::value == 3, "");
        -
        84  gil::at_c<0>(*this) = chan0;
        -
        85  gil::at_c<1>(*this) = chan1;
        -
        86  gil::at_c<2>(*this) = chan2;
        -
        87  }
        -
        88 
        -
        89  packed_pixel(int chan0, int chan1, int chan2, int chan3)
        -
        90  : _bitfield(0)
        -
        91  {
        -
        92  static_assert(num_channels<packed_pixel>::value == 4, "");
        -
        93  gil::at_c<0>(*this) = chan0;
        -
        94  gil::at_c<1>(*this) = chan1;
        -
        95  gil::at_c<2>(*this) = chan2;
        -
        96  gil::at_c<3>(*this) = chan3;
        -
        97  }
        -
        98 
        -
        99  packed_pixel(int chan0, int chan1, int chan2, int chan3, int chan4)
        -
        100  : _bitfield(0)
        -
        101  {
        -
        102  static_assert(num_channels<packed_pixel>::value == 5, "");
        -
        103  gil::at_c<0>(*this) = chan0;
        -
        104  gil::at_c<1>(*this) = chan1;
        -
        105  gil::at_c<2>(*this) = chan2;
        -
        106  gil::at_c<3>(*this) = chan3;
        -
        107  gil::at_c<4>(*this) = chan4;
        -
        108  }
        -
        109 
        -
        110  template <typename Pixel>
        -
        111  auto operator=(Pixel const& p) -> packed_pixel&
        -
        112  {
        -
        113  assign(p, is_pixel<Pixel>());
        -
        114  return *this;
        -
        115  }
        -
        116 
        -
        117  template <typename Pixel>
        -
        118  bool operator==(Pixel const& p) const
        -
        119  {
        -
        120  return equal(p, is_pixel<Pixel>());
        -
        121  }
        -
        122 
        -
        123  template <typename Pixel>
        -
        124  bool operator!=(Pixel const& p) const { return !(*this==p); }
        -
        125 
        -
        126 private:
        -
        127  template <typename Pixel>
        -
        128  static void check_compatible()
        -
        129  {
        -
        130  gil_function_requires<PixelsCompatibleConcept<Pixel, packed_pixel>>();
        -
        131  }
        -
        132 
        -
        133  template <typename Pixel>
        -
        134  void assign(Pixel const& p, std::true_type)
        -
        135  {
        -
        136  check_compatible<Pixel>();
        -
        137  static_copy(p, *this);
        -
        138  }
        -
        139 
        -
        140  template <typename Pixel>
        -
        141  bool equal(Pixel const& p, std::true_type) const
        -
        142  {
        -
        143  check_compatible<Pixel>();
        -
        144  return static_equal(*this, p);
        -
        145  }
        -
        146 
        -
        147  // Support for assignment/equality comparison of a channel with a grayscale pixel
        -
        148  static void check_gray()
        -
        149  {
        -
        150  static_assert(std::is_same<typename Layout::color_space_t, gray_t>::value, "");
        -
        151  }
        -
        152 
        -
        153  template <typename Channel>
        -
        154  void assign(Channel const& channel, std::false_type)
        -
        155  {
        -
        156  check_gray();
        -
        157  gil::at_c<0>(*this) = channel;
        -
        158  }
        -
        159 
        -
        160  template <typename Channel>
        -
        161  bool equal (Channel const& channel, std::false_type) const
        -
        162  {
        -
        163  check_gray();
        -
        164  return gil::at_c<0>(*this) == channel;
        -
        165  }
        -
        166 
        -
        167 public:
        -
        168  auto operator=(int channel) -> packed_pixel&
        -
        169  {
        -
        170  check_gray();
        -
        171  gil::at_c<0>(*this) = channel;
        -
        172  return *this;
        -
        173  }
        -
        174 
        -
        175  bool operator==(int channel) const
        -
        176  {
        -
        177  check_gray();
        -
        178  return gil::at_c<0>(*this) == channel;
        -
        179  }
        -
        180 };
        -
        181 
        -
        183 // ColorBasedConcept
        -
        185 
        -
        186 template <typename BitField, typename ChannelRefs, typename Layout, int K>
        -
        187 struct kth_element_type<packed_pixel<BitField, ChannelRefs, Layout>, K>
        -
        188 {
        -
        189  using type = typename channel_traits<mp11::mp_at_c<ChannelRefs, K>>::value_type;
        -
        190 };
        -
        191 
        -
        192 template <typename BitField, typename ChannelRefs, typename Layout, int K>
        -
        193 struct kth_element_reference_type<packed_pixel<BitField, ChannelRefs, Layout>, K>
        -
        194 {
        -
        195  using type = typename channel_traits<mp11::mp_at_c<ChannelRefs, K>>::reference;
        -
        196 };
        -
        197 
        -
        198 template <typename BitField, typename ChannelRefs, typename Layout, int K>
        -
        199 struct kth_element_const_reference_type<packed_pixel<BitField, ChannelRefs, Layout>, K>
        -
        200 {
        -
        201  using type = typename channel_traits<mp11::mp_at_c<ChannelRefs, K>>::const_reference;
        -
        202 };
        -
        203 
        -
        204 template <int K, typename P, typename C, typename L>
        -
        205 inline
        -
        206 auto at_c(packed_pixel<P, C, L>& p)
        -
        207  -> typename kth_element_reference_type<packed_pixel<P, C, L>, K>::type
        -
        208 {
        -
        209  return typename kth_element_reference_type
        -
        210  <
        -
        211  packed_pixel<P, C, L>,
        -
        212  K
        -
        213  >::type{&p._bitfield};
        -
        214 }
        -
        215 
        -
        216 template <int K, typename P, typename C, typename L>
        -
        217 inline
        -
        218 auto at_c(const packed_pixel<P, C, L>& p)
        -
        219  -> typename kth_element_const_reference_type<packed_pixel<P, C, L>, K>::type
        -
        220 {
        -
        221  return typename kth_element_const_reference_type
        -
        222  <
        -
        223  packed_pixel<P, C, L>,
        -
        224  K>::type{&p._bitfield};
        -
        225 }
        -
        226 
        -
        228 // PixelConcept
        -
        230 
        -
        231 // Metafunction predicate that flags packed_pixel as a model of PixelConcept.
        -
        232 // Required by PixelConcept
        -
        233 template <typename BitField, typename ChannelRefs, typename Layout>
        -
        234 struct is_pixel<packed_pixel<BitField, ChannelRefs, Layout>> : std::true_type {};
        -
        235 
        -
        237 // PixelBasedConcept
        -
        239 
        -
        240 template <typename P, typename C, typename Layout>
        -
        241 struct color_space_type<packed_pixel<P, C, Layout>>
        -
        242 {
        -
        243  using type = typename Layout::color_space_t;
        -
        244 };
        -
        245 
        -
        246 template <typename P, typename C, typename Layout>
        -
        247 struct channel_mapping_type<packed_pixel<P, C, Layout>>
        -
        248 {
        -
        249  using type = typename Layout::channel_mapping_t;
        -
        250 };
        -
        251 
        -
        252 template <typename P, typename C, typename Layout>
        -
        253 struct is_planar<packed_pixel<P, C, Layout>> : std::false_type {};
        -
        254 
        -
        258 
        -
        265 
        -
        266 template <typename P, typename C, typename L>
        -
        267 struct iterator_is_mutable<packed_pixel<P, C, L>*>
        -
        268  : std::integral_constant<bool, packed_pixel<P, C, L>::is_mutable>
        -
        269 {};
        -
        270 
        -
        271 template <typename P, typename C, typename L>
        -
        272 struct iterator_is_mutable<const packed_pixel<P, C, L>*> : std::false_type {};
        -
        273 
        -
        274 }} // namespace boost::gil
        -
        275 
        -
        276 #endif
        -
        auto at_c(detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
        Provides mutable access to the K-th element, in physical order.
        Definition: color_base.hpp:632
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Returns the number of channels of a pixel-based GIL construct.
        Definition: pixel.hpp:54
        -
        Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
        Definition: packed_pixel.hpp:50
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_PACKED_PIXEL_HPP
        +
        9#define BOOST_GIL_PACKED_PIXEL_HPP
        +
        10
        +
        11#include <boost/gil/pixel.hpp>
        +
        12#include <boost/gil/detail/mp11.hpp>
        +
        13
        +
        14#include <functional>
        +
        15#include <type_traits>
        +
        16
        +
        17namespace boost { namespace gil {
        +
        18
        +
        21
        +
        25
        +
        41
        +
        48template <typename BitField, typename ChannelRefs, typename Layout>
        +
        + +
        50{
        +
        51 BitField _bitfield{0}; // TODO: Make private
        +
        52
        +
        53 using layout_t = Layout;
        + +
        55 using reference = value_type&;
        +
        56 using const_reference = value_type const&;
        +
        57
        +
        58 static constexpr bool is_mutable =
        +
        59 channel_traits<mp11::mp_front<ChannelRefs>>::is_mutable;
        +
        60
        +
        61 packed_pixel() = default;
        +
        62 explicit packed_pixel(const BitField& bitfield) : _bitfield(bitfield) {}
        +
        63
        +
        64 template <typename Pixel>
        +
        65 packed_pixel(Pixel const& p,
        +
        66 typename std::enable_if<is_pixel<Pixel>::value>::type* /*dummy*/ = nullptr)
        +
        67 {
        +
        68 check_compatible<Pixel>();
        +
        69 static_copy(p, *this);
        +
        70 }
        +
        71
        +
        72 packed_pixel(int chan0, int chan1)
        +
        73 : _bitfield(0)
        +
        74 {
        +
        75 static_assert(num_channels<packed_pixel>::value == 2, "");
        +
        76 gil::at_c<0>(*this) = chan0;
        +
        77 gil::at_c<1>(*this) = chan1;
        +
        78 }
        +
        79
        +
        80 packed_pixel(int chan0, int chan1, int chan2)
        +
        81 : _bitfield(0)
        +
        82 {
        +
        83 static_assert(num_channels<packed_pixel>::value == 3, "");
        +
        84 gil::at_c<0>(*this) = chan0;
        +
        85 gil::at_c<1>(*this) = chan1;
        +
        86 gil::at_c<2>(*this) = chan2;
        +
        87 }
        +
        88
        +
        89 packed_pixel(int chan0, int chan1, int chan2, int chan3)
        +
        90 : _bitfield(0)
        +
        91 {
        +
        92 static_assert(num_channels<packed_pixel>::value == 4, "");
        +
        93 gil::at_c<0>(*this) = chan0;
        +
        94 gil::at_c<1>(*this) = chan1;
        +
        95 gil::at_c<2>(*this) = chan2;
        +
        96 gil::at_c<3>(*this) = chan3;
        +
        97 }
        +
        98
        +
        99 packed_pixel(int chan0, int chan1, int chan2, int chan3, int chan4)
        +
        100 : _bitfield(0)
        +
        101 {
        +
        102 static_assert(num_channels<packed_pixel>::value == 5, "");
        +
        103 gil::at_c<0>(*this) = chan0;
        +
        104 gil::at_c<1>(*this) = chan1;
        +
        105 gil::at_c<2>(*this) = chan2;
        +
        106 gil::at_c<3>(*this) = chan3;
        +
        107 gil::at_c<4>(*this) = chan4;
        +
        108 }
        +
        109
        +
        110 template <typename Pixel>
        +
        111 auto operator=(Pixel const& p) -> packed_pixel&
        +
        112 {
        +
        113 assign(p, is_pixel<Pixel>());
        +
        114 return *this;
        +
        115 }
        +
        116
        +
        117 template <typename Pixel>
        +
        118 bool operator==(Pixel const& p) const
        +
        119 {
        +
        120 return equal(p, is_pixel<Pixel>());
        +
        121 }
        +
        122
        +
        123 template <typename Pixel>
        +
        124 bool operator!=(Pixel const& p) const { return !(*this==p); }
        +
        125
        +
        126private:
        +
        127 template <typename Pixel>
        +
        128 static void check_compatible()
        +
        129 {
        +
        130 gil_function_requires<PixelsCompatibleConcept<Pixel, packed_pixel>>();
        +
        131 }
        +
        132
        +
        133 template <typename Pixel>
        +
        134 void assign(Pixel const& p, std::true_type)
        +
        135 {
        +
        136 check_compatible<Pixel>();
        +
        137 static_copy(p, *this);
        +
        138 }
        +
        139
        +
        140 template <typename Pixel>
        +
        141 bool equal(Pixel const& p, std::true_type) const
        +
        142 {
        +
        143 check_compatible<Pixel>();
        +
        144 return static_equal(*this, p);
        +
        145 }
        +
        146
        +
        147 // Support for assignment/equality comparison of a channel with a grayscale pixel
        +
        148 static void check_gray()
        +
        149 {
        +
        150 static_assert(std::is_same<typename Layout::color_space_t, gray_t>::value, "");
        +
        151 }
        +
        152
        +
        153 template <typename Channel>
        +
        154 void assign(Channel const& channel, std::false_type)
        +
        155 {
        +
        156 check_gray();
        +
        157 gil::at_c<0>(*this) = channel;
        +
        158 }
        +
        159
        +
        160 template <typename Channel>
        +
        161 bool equal (Channel const& channel, std::false_type) const
        +
        162 {
        +
        163 check_gray();
        +
        164 return gil::at_c<0>(*this) == channel;
        +
        165 }
        +
        166
        +
        167public:
        +
        168 auto operator=(int channel) -> packed_pixel&
        +
        169 {
        +
        170 check_gray();
        +
        171 gil::at_c<0>(*this) = channel;
        +
        172 return *this;
        +
        173 }
        +
        174
        +
        175 bool operator==(int channel) const
        +
        176 {
        +
        177 check_gray();
        +
        178 return gil::at_c<0>(*this) == channel;
        +
        179 }
        +
        180};
        +
        +
        181
        +
        183// ColorBasedConcept
        +
        185
        +
        186template <typename BitField, typename ChannelRefs, typename Layout, int K>
        +
        187struct kth_element_type<packed_pixel<BitField, ChannelRefs, Layout>, K>
        +
        188{
        +
        189 using type = typename channel_traits<mp11::mp_at_c<ChannelRefs, K>>::value_type;
        +
        190};
        +
        191
        +
        192template <typename BitField, typename ChannelRefs, typename Layout, int K>
        +
        193struct kth_element_reference_type<packed_pixel<BitField, ChannelRefs, Layout>, K>
        +
        194{
        +
        195 using type = typename channel_traits<mp11::mp_at_c<ChannelRefs, K>>::reference;
        +
        196};
        +
        197
        +
        198template <typename BitField, typename ChannelRefs, typename Layout, int K>
        +
        199struct kth_element_const_reference_type<packed_pixel<BitField, ChannelRefs, Layout>, K>
        +
        200{
        +
        201 using type = typename channel_traits<mp11::mp_at_c<ChannelRefs, K>>::const_reference;
        +
        202};
        +
        203
        +
        204template <int K, typename P, typename C, typename L>
        +
        205inline
        +
        206auto at_c(packed_pixel<P, C, L>& p)
        +
        207 -> typename kth_element_reference_type<packed_pixel<P, C, L>, K>::type
        +
        208{
        +
        209 return typename kth_element_reference_type
        +
        210 <
        +
        211 packed_pixel<P, C, L>,
        +
        212 K
        +
        213 >::type{&p._bitfield};
        +
        214}
        +
        215
        +
        216template <int K, typename P, typename C, typename L>
        +
        217inline
        +
        218auto at_c(const packed_pixel<P, C, L>& p)
        +
        219 -> typename kth_element_const_reference_type<packed_pixel<P, C, L>, K>::type
        +
        220{
        +
        221 return typename kth_element_const_reference_type
        +
        222 <
        +
        223 packed_pixel<P, C, L>,
        +
        224 K>::type{&p._bitfield};
        +
        225}
        +
        226
        +
        228// PixelConcept
        +
        230
        +
        231// Metafunction predicate that flags packed_pixel as a model of PixelConcept.
        +
        232// Required by PixelConcept
        +
        233template <typename BitField, typename ChannelRefs, typename Layout>
        +
        234struct is_pixel<packed_pixel<BitField, ChannelRefs, Layout>> : std::true_type {};
        +
        235
        +
        237// PixelBasedConcept
        +
        239
        +
        240template <typename P, typename C, typename Layout>
        +
        241struct color_space_type<packed_pixel<P, C, Layout>>
        +
        242{
        +
        243 using type = typename Layout::color_space_t;
        +
        244};
        +
        245
        +
        246template <typename P, typename C, typename Layout>
        +
        247struct channel_mapping_type<packed_pixel<P, C, Layout>>
        +
        248{
        +
        249 using type = typename Layout::channel_mapping_t;
        +
        250};
        +
        251
        +
        252template <typename P, typename C, typename Layout>
        +
        253struct is_planar<packed_pixel<P, C, Layout>> : std::false_type {};
        +
        254
        +
        258
        +
        265
        +
        266template <typename P, typename C, typename L>
        +
        267struct iterator_is_mutable<packed_pixel<P, C, L>*>
        +
        268 : std::integral_constant<bool, packed_pixel<P, C, L>::is_mutable>
        +
        269{};
        +
        270
        +
        271template <typename P, typename C, typename L>
        +
        272struct iterator_is_mutable<const packed_pixel<P, C, L>*> : std::false_type {};
        +
        273
        +
        274}} // namespace boost::gil
        +
        275
        +
        276#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Returns the number of channels of a pixel-based GIL construct.
        Definition pixel.hpp:54
        +
        Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
        Definition packed_pixel.hpp:50
        diff --git a/html/reference/pages.html b/html/reference/pages.html index 930fe743c..6c3e0d0e7 100644 --- a/html/reference/pages.html +++ b/html/reference/pages.html @@ -4,7 +4,7 @@ - + Generic Image Library: Related Pages @@ -27,26 +27,26 @@

        - + +/* @license-end */ +
        -
        -
        Related Pages
        +
        Related Pages
        Here is a list of all related documentation pages:
        @@ -55,7 +55,7 @@ $(function() { diff --git a/html/reference/path__spec_8hpp_source.html b/html/reference/path__spec_8hpp_source.html index 2f5ba6968..0c241225c 100644 --- a/html/reference/path__spec_8hpp_source.html +++ b/html/reference/path__spec_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: path_spec.hpp Source File @@ -27,142 +27,147 @@

        - + +/* @license-end */ + +
        -
        -
        path_spec.hpp
        +
        path_spec.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Andreas Pokorny, Christian Henning
        -
        3 // Copyright 2024 Dirk Stolle
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_IO_PATH_SPEC_HPP
        -
        10 #define BOOST_GIL_IO_PATH_SPEC_HPP
        -
        11 
        -
        12 #include <boost/gil/io/detail/filesystem.hpp>
        -
        13 
        -
        14 #include <cstdlib>
        -
        15 #include <cwchar>
        -
        16 #include <string>
        -
        17 #include <type_traits>
        -
        18 
        -
        19 namespace boost { namespace gil { namespace detail {
        -
        20 
        -
        21 template<typename P> struct is_supported_path_spec : std::false_type {};
        -
        22 template<> struct is_supported_path_spec< std::string > : std::true_type {};
        -
        23 template<> struct is_supported_path_spec< const std::string > : std::true_type {};
        -
        24 template<> struct is_supported_path_spec< std::wstring > : std::true_type {};
        -
        25 template<> struct is_supported_path_spec< const std::wstring > : std::true_type {};
        -
        26 template<> struct is_supported_path_spec< char const* > : std::true_type {};
        -
        27 template<> struct is_supported_path_spec< char* > : std::true_type {};
        -
        28 template<> struct is_supported_path_spec< const wchar_t* > : std::true_type {};
        -
        29 template<> struct is_supported_path_spec< wchar_t* > : std::true_type {};
        -
        30 
        -
        31 template<int i> struct is_supported_path_spec<const char [i]> : std::true_type {};
        -
        32 template<int i> struct is_supported_path_spec<char [i]> : std::true_type {};
        -
        33 template<int i> struct is_supported_path_spec<const wchar_t [i]> : std::true_type {};
        -
        34 template<int i> struct is_supported_path_spec<wchar_t [i]> : std::true_type {};
        -
        35 
        -
        36 template<> struct is_supported_path_spec<filesystem::path> : std::true_type {};
        -
        37 template<> struct is_supported_path_spec<filesystem::path const> : std::true_type {};
        -
        38 
        -
        39 inline std::string convert_to_string( std::string const& obj)
        -
        40 {
        -
        41  return obj;
        -
        42 }
        -
        43 
        -
        44 inline std::string convert_to_string( std::wstring const& s )
        -
        45 {
        -
        46  std::mbstate_t state = std::mbstate_t();
        -
        47  const wchar_t* str = s.c_str();
        -
        48  const std::size_t len = std::wcsrtombs(nullptr, &str, 0, &state);
        -
        49  std::string result(len, '\0');
        -
        50  std::wcstombs( &result[0], s.c_str(), len );
        -
        51 
        -
        52  return result;
        -
        53 }
        -
        54 
        -
        55 inline std::string convert_to_string( char const* str )
        -
        56 {
        -
        57  return std::string( str );
        -
        58 }
        -
        59 
        -
        60 inline std::string convert_to_string( char* str )
        -
        61 {
        -
        62  return std::string( str );
        -
        63 }
        -
        64 
        -
        65 inline std::string convert_to_string(filesystem::path const& path)
        -
        66 {
        -
        67  return convert_to_string(path.string());
        -
        68 }
        -
        69 
        -
        70 inline char const* convert_to_native_string( char* str )
        -
        71 {
        -
        72  return str;
        -
        73 }
        -
        74 
        -
        75 inline char const* convert_to_native_string( char const* str )
        -
        76 {
        -
        77  return str;
        -
        78 }
        -
        79 
        -
        80 inline char const* convert_to_native_string( const std::string& str )
        -
        81 {
        -
        82  return str.c_str();
        -
        83 }
        -
        84 
        -
        85 inline char const* convert_to_native_string( const wchar_t* str )
        -
        86 {
        -
        87  std::mbstate_t state = std::mbstate_t();
        -
        88  const std::size_t len = std::wcsrtombs(nullptr, &str, 0, &state) + 1;
        -
        89  char* c = new char[len];
        -
        90  std::wcstombs( c, str, len );
        -
        91 
        -
        92  return c;
        -
        93 }
        -
        94 
        -
        95 inline char const* convert_to_native_string( std::wstring const& str )
        -
        96 {
        -
        97  std::mbstate_t state = std::mbstate_t();
        -
        98  const wchar_t* wstr = str.c_str();
        -
        99  const std::size_t len = std::wcsrtombs(nullptr, &wstr, 0, &state) + 1;
        -
        100  char* c = new char[len];
        -
        101  std::wcstombs( c, str.c_str(), len );
        -
        102 
        -
        103  return c;
        -
        104 }
        -
        105 
        -
        106 }}} // namespace boost::gil::detail
        -
        107 
        -
        108 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2007-2008 Andreas Pokorny, Christian Henning
        +
        3// Copyright 2024 Dirk Stolle
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_IO_PATH_SPEC_HPP
        +
        10#define BOOST_GIL_IO_PATH_SPEC_HPP
        +
        11
        +
        12#include <boost/gil/io/detail/filesystem.hpp>
        +
        13
        +
        14#include <cstdlib>
        +
        15#include <cwchar>
        +
        16#include <string>
        +
        17#include <type_traits>
        +
        18
        +
        19namespace boost { namespace gil { namespace detail {
        +
        20
        +
        21template<typename P> struct is_supported_path_spec : std::false_type {};
        +
        22template<> struct is_supported_path_spec< std::string > : std::true_type {};
        +
        23template<> struct is_supported_path_spec< const std::string > : std::true_type {};
        +
        24template<> struct is_supported_path_spec< std::wstring > : std::true_type {};
        +
        25template<> struct is_supported_path_spec< const std::wstring > : std::true_type {};
        +
        26template<> struct is_supported_path_spec< char const* > : std::true_type {};
        +
        27template<> struct is_supported_path_spec< char* > : std::true_type {};
        +
        28template<> struct is_supported_path_spec< const wchar_t* > : std::true_type {};
        +
        29template<> struct is_supported_path_spec< wchar_t* > : std::true_type {};
        +
        30
        +
        31template<int i> struct is_supported_path_spec<const char [i]> : std::true_type {};
        +
        32template<int i> struct is_supported_path_spec<char [i]> : std::true_type {};
        +
        33template<int i> struct is_supported_path_spec<const wchar_t [i]> : std::true_type {};
        +
        34template<int i> struct is_supported_path_spec<wchar_t [i]> : std::true_type {};
        +
        35
        +
        36template<> struct is_supported_path_spec<filesystem::path> : std::true_type {};
        +
        37template<> struct is_supported_path_spec<filesystem::path const> : std::true_type {};
        +
        38
        +
        39inline std::string convert_to_string( std::string const& obj)
        +
        40{
        +
        41 return obj;
        +
        42}
        +
        43
        +
        44inline std::string convert_to_string( std::wstring const& s )
        +
        45{
        +
        46 std::mbstate_t state = std::mbstate_t();
        +
        47 const wchar_t* str = s.c_str();
        +
        48 const std::size_t len = std::wcsrtombs(nullptr, &str, 0, &state);
        +
        49 std::string result(len, '\0');
        +
        50 std::wcstombs( &result[0], s.c_str(), len );
        +
        51
        +
        52 return result;
        +
        53}
        +
        54
        +
        55inline std::string convert_to_string( char const* str )
        +
        56{
        +
        57 return std::string( str );
        +
        58}
        +
        59
        +
        60inline std::string convert_to_string( char* str )
        +
        61{
        +
        62 return std::string( str );
        +
        63}
        +
        64
        +
        65inline std::string convert_to_string(filesystem::path const& path)
        +
        66{
        +
        67 return convert_to_string(path.string());
        +
        68}
        +
        69
        +
        70inline char const* convert_to_native_string( char* str )
        +
        71{
        +
        72 return str;
        +
        73}
        +
        74
        +
        75inline char const* convert_to_native_string( char const* str )
        +
        76{
        +
        77 return str;
        +
        78}
        +
        79
        +
        80inline char const* convert_to_native_string( const std::string& str )
        +
        81{
        +
        82 return str.c_str();
        +
        83}
        +
        84
        +
        85inline char const* convert_to_native_string( const wchar_t* str )
        +
        86{
        +
        87 std::mbstate_t state = std::mbstate_t();
        +
        88 const std::size_t len = std::wcsrtombs(nullptr, &str, 0, &state) + 1;
        +
        89 char* c = new char[len];
        +
        90 std::wcstombs( c, str, len );
        +
        91
        +
        92 return c;
        +
        93}
        +
        94
        +
        95inline char const* convert_to_native_string( std::wstring const& str )
        +
        96{
        +
        97 std::mbstate_t state = std::mbstate_t();
        +
        98 const wchar_t* wstr = str.c_str();
        +
        99 const std::size_t len = std::wcsrtombs(nullptr, &wstr, 0, &state) + 1;
        +
        100 char* c = new char[len];
        +
        101 std::wcstombs( c, str.c_str(), len );
        +
        102
        +
        103 return c;
        +
        104}
        +
        105
        +
        106}}} // namespace boost::gil::detail
        +
        107
        +
        108#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/pixel_8hpp_source.html b/html/reference/pixel_8hpp_source.html index ee4d952c8..0752e3ae3 100644 --- a/html/reference/pixel_8hpp_source.html +++ b/html/reference/pixel_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel.hpp Source File @@ -27,289 +27,296 @@

        - + +/* @license-end */ + +
        -
        -
        pixel.hpp
        +
        pixel.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_PIXEL_HPP
        -
        10 #define BOOST_GIL_PIXEL_HPP
        -
        11 
        -
        12 #include <boost/gil/channel.hpp>
        -
        13 #include <boost/gil/color_base.hpp>
        -
        14 #include <boost/gil/color_base_algorithm.hpp>
        -
        15 #include <boost/gil/concepts.hpp>
        -
        16 #include <boost/gil/metafunctions.hpp>
        -
        17 #include <boost/gil/utilities.hpp>
        -
        18 #include <boost/gil/detail/mp11.hpp>
        -
        19 
        -
        20 #include <functional>
        -
        21 #include <type_traits>
        -
        22 
        -
        23 namespace boost { namespace gil {
        -
        24 
        -
        25 // Forward-declare gray_t
        -
        26 struct gray_color_t;
        -
        27 using gray_t = mp11::mp_list<gray_color_t>;
        -
        28 template <typename PixelBased> struct color_space_type;
        -
        29 template <typename PixelBased> struct channel_mapping_type;
        -
        30 template <typename PixelBased> struct channel_type;
        -
        31 template <typename PixelBased> struct is_planar;
        -
        32 
        -
        33 template <typename PixelBased>
        -
        34 struct color_space_type<PixelBased const> : color_space_type<PixelBased> {};
        -
        35 
        -
        36 template <typename PixelBased>
        -
        37 struct channel_mapping_type<PixelBased const> : channel_mapping_type<PixelBased> {};
        -
        38 
        -
        39 template <typename PixelBased>
        -
        40 struct channel_type<PixelBased const> : channel_type<PixelBased> {};
        -
        41 
        -
        42 template <typename PixelBased>
        -
        43 struct is_planar : std::false_type {};
        -
        44 
        -
        45 template <typename PixelBased>
        -
        46 struct is_planar<PixelBased const> : is_planar<PixelBased> {};
        -
        47 
        -
        48 template <typename T> struct is_pixel : std::false_type {};
        -
        49 template <typename T> struct is_pixel<T const> : is_pixel<T> {};
        -
        50 
        -
        53 template <typename PixelBased>
        -
        54 struct num_channels : mp11::mp_size<typename color_space_type<PixelBased>::type>::type {};
        -
        55 
        -
        75 
        -
        79 
        -
        98 template <typename ChannelValue, typename Layout>
        -
        99 struct pixel :
        -
        100  detail::homogeneous_color_base
        -
        101  <
        -
        102  ChannelValue,
        -
        103  Layout,
        -
        104  mp11::mp_size<typename Layout::color_space_t>::value
        -
        105  >
        -
        106 {
        -
        107 private:
        -
        108  using channel_t = ChannelValue;
        -
        109  using parent_t = detail::homogeneous_color_base
        -
        110  <
        -
        111  ChannelValue,
        -
        112  Layout,
        -
        113  mp11::mp_size<typename Layout::color_space_t>::value
        -
        114  >;
        -
        115 public:
        - -
        117  using reference = value_type&;
        -
        118  using const_reference = value_type const&;
        -
        119  static constexpr bool is_mutable = channel_traits<channel_t>::is_mutable;
        -
        120 
        -
        121  pixel() = default;
        -
        122  explicit pixel(channel_t v) : parent_t(v) {} // sets all channels to v
        -
        123  pixel(channel_t v0, channel_t v1) : parent_t(v0, v1) {}
        -
        124  pixel(channel_t v0, channel_t v1, channel_t v2) : parent_t(v0, v1, v2) {}
        -
        125 
        -
        126  pixel(channel_t v0, channel_t v1, channel_t v2, channel_t v3)
        -
        127  : parent_t(v0, v1, v2, v3)
        -
        128  {}
        -
        129 
        -
        130  pixel(channel_t v0, channel_t v1, channel_t v2, channel_t v3, channel_t v4)
        -
        131  : parent_t(v0, v1, v2, v3, v4)
        -
        132  {}
        -
        133 
        -
        134  pixel(channel_t v0, channel_t v1, channel_t v2, channel_t v3, channel_t v4, channel_t v5)
        -
        135  : parent_t(v0, v1, v2, v3, v4, v5)
        -
        136  {}
        -
        137 
        -
        138  pixel(const pixel& p) : parent_t(p) {}
        -
        139 
        -
        140  pixel& operator=(pixel const& p)
        -
        141  {
        -
        142  static_copy(p,*this);
        -
        143  return *this;
        -
        144  }
        -
        145 
        -
        146  // Construct from another compatible pixel type
        -
        147  template <typename Pixel>
        -
        148  pixel(Pixel const& p,
        -
        149  typename std::enable_if<is_pixel<Pixel>::value>::type* /*dummy*/ = nullptr)
        -
        150  : parent_t(p)
        -
        151  {
        -
        152  check_compatible<Pixel>();
        -
        153  }
        -
        154 
        -
        155  template <typename Pixel>
        -
        156  pixel& operator=(Pixel const& p)
        -
        157  {
        -
        158  assign(p, is_pixel<Pixel>());
        -
        159  return *this;
        -
        160  }
        -
        161 
        -
        162  template <typename Pixel>
        -
        163  bool operator==(Pixel const& p) const { return equal(p, is_pixel<Pixel>()); }
        -
        164 
        -
        165  template <typename Pixel>
        -
        166  bool operator!=(Pixel const& p) const { return !(*this == p); }
        -
        167 
        -
        168  // homogeneous pixels have operator[]
        -
        169  auto operator[](std::size_t index)
        -
        170  -> typename channel_traits<channel_t>::reference
        -
        171  {
        -
        172  return dynamic_at_c(*this, index);
        -
        173  }
        -
        174 
        -
        175  auto operator[](std::size_t index) const
        -
        176  -> typename channel_traits<channel_t>::const_reference
        -
        177  {
        -
        178  return dynamic_at_c(*this, index);
        -
        179  }
        -
        180 
        -
        181 private:
        -
        182  template <typename Pixel>
        -
        183  void assign(Pixel const& p, std::true_type)
        -
        184  {
        -
        185  check_compatible<Pixel>();
        -
        186  static_copy(p, *this);
        -
        187  }
        -
        188 
        -
        189  template <typename Pixel>
        -
        190  bool equal(Pixel const& p, std::true_type) const
        -
        191  {
        -
        192  check_compatible<Pixel>();
        -
        193  return static_equal(*this, p);
        -
        194  }
        -
        195 
        -
        196  template <typename Pixel>
        -
        197  void check_compatible() const
        -
        198  {
        -
        199  gil_function_requires<PixelsCompatibleConcept<Pixel, pixel>>();
        -
        200  }
        -
        201 
        -
        202 // Support for assignment/equality comparison of a channel with a grayscale pixel
        -
        203 
        -
        204 private:
        -
        205  static void check_gray()
        -
        206  {
        -
        207  static_assert(std::is_same<typename Layout::color_space_t, gray_t>::value, "");
        -
        208  }
        -
        209 
        -
        210  template <typename Channel>
        -
        211  void assign(Channel const& channel, std::false_type)
        -
        212  {
        -
        213  check_gray();
        -
        214  gil::at_c<0>(*this) = channel;
        -
        215  }
        -
        216 
        -
        217  template <typename Channel>
        -
        218  bool equal (Channel const& channel, std::false_type) const
        -
        219  {
        -
        220  check_gray();
        -
        221  return gil::at_c<0>(*this) == channel;
        -
        222  }
        -
        223 
        -
        224 public:
        -
        225  pixel& operator= (channel_t channel)
        -
        226  {
        -
        227  check_gray();
        -
        228  gil::at_c<0>(*this) = channel;
        -
        229  return *this;
        -
        230  }
        -
        231 
        -
        232  bool operator==(channel_t channel) const
        -
        233  {
        -
        234  check_gray();
        -
        235  return gil::at_c<0>(*this) == channel;
        -
        236  }
        -
        237 };
        -
        238 
        -
        240 // ColorBasedConcept
        -
        242 
        -
        243 template <typename ChannelValue, typename Layout, int K>
        -
        244 struct kth_element_type<pixel<ChannelValue,Layout>, K>
        -
        245 {
        -
        246  using type = ChannelValue;
        -
        247 };
        -
        248 
        -
        249 template <typename ChannelValue, typename Layout, int K>
        -
        250 struct kth_element_reference_type<pixel<ChannelValue,Layout>, K>
        -
        251 {
        -
        252  using type = typename channel_traits<ChannelValue>::reference;
        -
        253 };
        -
        254 
        -
        255 template <typename ChannelValue, typename Layout, int K>
        -
        256 struct kth_element_reference_type<const pixel<ChannelValue,Layout>, K>
        -
        257 {
        -
        258  using type = typename channel_traits<ChannelValue>::const_reference;
        -
        259 };
        -
        260 
        -
        261 template <typename ChannelValue, typename Layout, int K>
        -
        262 struct kth_element_const_reference_type<pixel<ChannelValue,Layout>, K>
        -
        263 {
        -
        264  using type = typename channel_traits<ChannelValue>::const_reference;
        -
        265 };
        -
        266 
        -
        268 // PixelConcept
        -
        270 
        -
        271 template <typename ChannelValue, typename Layout>
        -
        272 struct is_pixel<pixel<ChannelValue,Layout>> : std::true_type {};
        -
        273 
        -
        275 // HomogeneousPixelBasedConcept
        -
        277 
        -
        278 template <typename ChannelValue, typename Layout>
        -
        279 struct color_space_type<pixel<ChannelValue, Layout>>
        -
        280 {
        -
        281  using type = typename Layout::color_space_t;
        -
        282 };
        -
        283 
        -
        284 template <typename ChannelValue, typename Layout>
        -
        285 struct channel_mapping_type<pixel<ChannelValue, Layout>>
        -
        286 {
        -
        287  using type = typename Layout::channel_mapping_t;
        -
        288 };
        -
        289 
        -
        290 template <typename ChannelValue, typename Layout>
        -
        291 struct is_planar<pixel<ChannelValue, Layout>> : std::false_type {};
        -
        292 
        -
        293 template <typename ChannelValue, typename Layout>
        -
        294 struct channel_type<pixel<ChannelValue, Layout>>
        -
        295 {
        -
        296  using type = ChannelValue;
        -
        297 };
        -
        298 
        -
        299 }} // namespace boost::gil
        -
        300 
        -
        301 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Returns the number of channels of a pixel-based GIL construct.
        Definition: pixel.hpp:54
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: pixel.hpp:106
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_PIXEL_HPP
        +
        10#define BOOST_GIL_PIXEL_HPP
        +
        11
        +
        12#include <boost/gil/channel.hpp>
        +
        13#include <boost/gil/color_base.hpp>
        +
        14#include <boost/gil/color_base_algorithm.hpp>
        +
        15#include <boost/gil/concepts.hpp>
        +
        16#include <boost/gil/metafunctions.hpp>
        +
        17#include <boost/gil/utilities.hpp>
        +
        18#include <boost/gil/detail/mp11.hpp>
        +
        19
        +
        20#include <functional>
        +
        21#include <type_traits>
        +
        22
        +
        23namespace boost { namespace gil {
        +
        24
        +
        25// Forward-declare gray_t
        +
        26struct gray_color_t;
        +
        27using gray_t = mp11::mp_list<gray_color_t>;
        +
        28template <typename PixelBased> struct color_space_type;
        +
        29template <typename PixelBased> struct channel_mapping_type;
        +
        30template <typename PixelBased> struct channel_type;
        +
        31template <typename PixelBased> struct is_planar;
        +
        32
        +
        33template <typename PixelBased>
        +
        34struct color_space_type<PixelBased const> : color_space_type<PixelBased> {};
        +
        35
        +
        36template <typename PixelBased>
        +
        37struct channel_mapping_type<PixelBased const> : channel_mapping_type<PixelBased> {};
        +
        38
        +
        39template <typename PixelBased>
        +
        40struct channel_type<PixelBased const> : channel_type<PixelBased> {};
        +
        41
        +
        42template <typename PixelBased>
        +
        43struct is_planar : std::false_type {};
        +
        44
        +
        45template <typename PixelBased>
        +
        46struct is_planar<PixelBased const> : is_planar<PixelBased> {};
        +
        47
        +
        48template <typename T> struct is_pixel : std::false_type {};
        +
        49template <typename T> struct is_pixel<T const> : is_pixel<T> {};
        +
        50
        +
        53template <typename PixelBased>
        +
        54struct num_channels : mp11::mp_size<typename color_space_type<PixelBased>::type>::type {};
        +
        55
        +
        75
        +
        79
        +
        98template <typename ChannelValue, typename Layout>
        +
        +
        99struct pixel :
        +
        100 detail::homogeneous_color_base
        +
        101 <
        +
        102 ChannelValue,
        +
        103 Layout,
        +
        104 mp11::mp_size<typename Layout::color_space_t>::value
        +
        105 >
        +
        106{
        +
        107private:
        +
        108 using channel_t = ChannelValue;
        +
        109 using parent_t = detail::homogeneous_color_base
        +
        110 <
        +
        111 ChannelValue,
        +
        112 Layout,
        +
        113 mp11::mp_size<typename Layout::color_space_t>::value
        +
        114 >;
        +
        115public:
        + +
        117 using reference = value_type&;
        +
        118 using const_reference = value_type const&;
        +
        119 static constexpr bool is_mutable = channel_traits<channel_t>::is_mutable;
        +
        120
        +
        121 pixel() = default;
        +
        122 explicit pixel(channel_t v) : parent_t(v) {} // sets all channels to v
        +
        123 pixel(channel_t v0, channel_t v1) : parent_t(v0, v1) {}
        +
        124 pixel(channel_t v0, channel_t v1, channel_t v2) : parent_t(v0, v1, v2) {}
        +
        125
        +
        126 pixel(channel_t v0, channel_t v1, channel_t v2, channel_t v3)
        +
        127 : parent_t(v0, v1, v2, v3)
        +
        128 {}
        +
        129
        +
        130 pixel(channel_t v0, channel_t v1, channel_t v2, channel_t v3, channel_t v4)
        +
        131 : parent_t(v0, v1, v2, v3, v4)
        +
        132 {}
        +
        133
        +
        134 pixel(channel_t v0, channel_t v1, channel_t v2, channel_t v3, channel_t v4, channel_t v5)
        +
        135 : parent_t(v0, v1, v2, v3, v4, v5)
        +
        136 {}
        +
        137
        +
        138 pixel(const pixel& p) : parent_t(p) {}
        +
        139
        +
        140 pixel& operator=(pixel const& p)
        +
        141 {
        +
        142 static_copy(p,*this);
        +
        143 return *this;
        +
        144 }
        +
        145
        +
        146 // Construct from another compatible pixel type
        +
        147 template <typename Pixel>
        +
        148 pixel(Pixel const& p,
        +
        149 typename std::enable_if<is_pixel<Pixel>::value>::type* /*dummy*/ = nullptr)
        +
        150 : parent_t(p)
        +
        151 {
        +
        152 check_compatible<Pixel>();
        +
        153 }
        +
        154
        +
        155 template <typename Pixel>
        +
        156 pixel& operator=(Pixel const& p)
        +
        157 {
        +
        158 assign(p, is_pixel<Pixel>());
        +
        159 return *this;
        +
        160 }
        +
        161
        +
        162 template <typename Pixel>
        +
        163 bool operator==(Pixel const& p) const { return equal(p, is_pixel<Pixel>()); }
        +
        164
        +
        165 template <typename Pixel>
        +
        166 bool operator!=(Pixel const& p) const { return !(*this == p); }
        +
        167
        +
        168 // homogeneous pixels have operator[]
        +
        169 auto operator[](std::size_t index)
        +
        170 -> typename channel_traits<channel_t>::reference
        +
        171 {
        +
        172 return dynamic_at_c(*this, index);
        +
        173 }
        +
        174
        +
        175 auto operator[](std::size_t index) const
        +
        176 -> typename channel_traits<channel_t>::const_reference
        +
        177 {
        +
        178 return dynamic_at_c(*this, index);
        +
        179 }
        +
        180
        +
        181private:
        +
        182 template <typename Pixel>
        +
        183 void assign(Pixel const& p, std::true_type)
        +
        184 {
        +
        185 check_compatible<Pixel>();
        +
        186 static_copy(p, *this);
        +
        187 }
        +
        188
        +
        189 template <typename Pixel>
        +
        190 bool equal(Pixel const& p, std::true_type) const
        +
        191 {
        +
        192 check_compatible<Pixel>();
        +
        193 return static_equal(*this, p);
        +
        194 }
        +
        195
        +
        196 template <typename Pixel>
        +
        197 void check_compatible() const
        +
        198 {
        +
        199 gil_function_requires<PixelsCompatibleConcept<Pixel, pixel>>();
        +
        200 }
        +
        201
        +
        202// Support for assignment/equality comparison of a channel with a grayscale pixel
        +
        203
        +
        204private:
        +
        205 static void check_gray()
        +
        206 {
        +
        207 static_assert(std::is_same<typename Layout::color_space_t, gray_t>::value, "");
        +
        208 }
        +
        209
        +
        210 template <typename Channel>
        +
        211 void assign(Channel const& channel, std::false_type)
        +
        212 {
        +
        213 check_gray();
        +
        214 gil::at_c<0>(*this) = channel;
        +
        215 }
        +
        216
        +
        217 template <typename Channel>
        +
        218 bool equal (Channel const& channel, std::false_type) const
        +
        219 {
        +
        220 check_gray();
        +
        221 return gil::at_c<0>(*this) == channel;
        +
        222 }
        +
        223
        +
        224public:
        +
        225 pixel& operator= (channel_t channel)
        +
        226 {
        +
        227 check_gray();
        +
        228 gil::at_c<0>(*this) = channel;
        +
        229 return *this;
        +
        230 }
        +
        231
        +
        232 bool operator==(channel_t channel) const
        +
        233 {
        +
        234 check_gray();
        +
        235 return gil::at_c<0>(*this) == channel;
        +
        236 }
        +
        237};
        +
        +
        238
        +
        240// ColorBasedConcept
        +
        242
        +
        243template <typename ChannelValue, typename Layout, int K>
        +
        244struct kth_element_type<pixel<ChannelValue,Layout>, K>
        +
        245{
        +
        246 using type = ChannelValue;
        +
        247};
        +
        248
        +
        249template <typename ChannelValue, typename Layout, int K>
        +
        250struct kth_element_reference_type<pixel<ChannelValue,Layout>, K>
        +
        251{
        +
        252 using type = typename channel_traits<ChannelValue>::reference;
        +
        253};
        +
        254
        +
        255template <typename ChannelValue, typename Layout, int K>
        +
        256struct kth_element_reference_type<const pixel<ChannelValue,Layout>, K>
        +
        257{
        +
        258 using type = typename channel_traits<ChannelValue>::const_reference;
        +
        259};
        +
        260
        +
        261template <typename ChannelValue, typename Layout, int K>
        +
        262struct kth_element_const_reference_type<pixel<ChannelValue,Layout>, K>
        +
        263{
        +
        264 using type = typename channel_traits<ChannelValue>::const_reference;
        +
        265};
        +
        266
        +
        268// PixelConcept
        +
        270
        +
        271template <typename ChannelValue, typename Layout>
        +
        272struct is_pixel<pixel<ChannelValue,Layout>> : std::true_type {};
        +
        273
        +
        275// HomogeneousPixelBasedConcept
        +
        277
        +
        278template <typename ChannelValue, typename Layout>
        +
        279struct color_space_type<pixel<ChannelValue, Layout>>
        +
        280{
        +
        281 using type = typename Layout::color_space_t;
        +
        282};
        +
        283
        +
        284template <typename ChannelValue, typename Layout>
        +
        285struct channel_mapping_type<pixel<ChannelValue, Layout>>
        +
        286{
        +
        287 using type = typename Layout::channel_mapping_t;
        +
        288};
        +
        289
        +
        290template <typename ChannelValue, typename Layout>
        +
        291struct is_planar<pixel<ChannelValue, Layout>> : std::false_type {};
        +
        292
        +
        293template <typename ChannelValue, typename Layout>
        +
        294struct channel_type<pixel<ChannelValue, Layout>>
        +
        295{
        +
        296 using type = ChannelValue;
        +
        297};
        +
        298
        +
        299}} // namespace boost::gil
        +
        300
        +
        301#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Returns the number of channels of a pixel-based GIL construct.
        Definition pixel.hpp:54
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition pixel.hpp:106
        diff --git a/html/reference/pixel__based_8hpp_source.html b/html/reference/pixel__based_8hpp_source.html index 27643ef8e..e647c64af 100644 --- a/html/reference/pixel__based_8hpp_source.html +++ b/html/reference/pixel__based_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_based.hpp Source File @@ -27,112 +27,121 @@

        - + +/* @license-end */ + +
        -
        -
        pixel_based.hpp
        +
        pixel_based.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/channel.hpp>
        -
        13 #include <boost/gil/concepts/color.hpp>
        -
        14 #include <boost/gil/concepts/concept_check.hpp>
        -
        15 #include <boost/gil/concepts/fwd.hpp>
        -
        16 
        -
        17 #include <cstddef>
        -
        18 
        -
        19 #if defined(BOOST_CLANG)
        -
        20 #pragma clang diagnostic push
        -
        21 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        22 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        23 #endif
        -
        24 
        -
        25 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        26 #pragma GCC diagnostic push
        -
        27 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        28 #endif
        -
        29 
        -
        30 namespace boost { namespace gil {
        -
        31 
        -
        52 template <typename P>
        - -
        54 {
        -
        55  void constraints()
        -
        56  {
        -
        57  using color_space_t = typename color_space_type<P>::type;
        -
        58  gil_function_requires<ColorSpaceConcept<color_space_t>>();
        -
        59 
        -
        60  using channel_mapping_t = typename channel_mapping_type<P>::type ;
        -
        61  gil_function_requires<ChannelMappingConcept<channel_mapping_t>>();
        -
        62 
        -
        63  static const bool planar = is_planar<P>::value;
        -
        64  ignore_unused_variable_warning(planar);
        -
        65 
        -
        66  // This is not part of the concept, but should still work
        -
        67  static const std::size_t nc = num_channels<P>::value;
        -
        68  ignore_unused_variable_warning(nc);
        -
        69  }
        -
        70 };
        -
        71 
        -
        82 template <typename P>
        - -
        84 {
        -
        85  void constraints()
        -
        86  {
        -
        87  gil_function_requires<PixelBasedConcept<P>>();
        -
        88 
        -
        89  using channel_t = typename channel_type<P>::type;
        -
        90  gil_function_requires<ChannelConcept<channel_t>>();
        -
        91  }
        -
        92 };
        -
        93 
        -
        94 }} // namespace boost::gil
        -
        95 
        -
        96 #if defined(BOOST_CLANG)
        -
        97 #pragma clang diagnostic pop
        -
        98 #endif
        -
        99 
        -
        100 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        101 #pragma GCC diagnostic pop
        -
        102 #endif
        -
        103 
        -
        104 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Concept for homogeneous pixel-based GIL constructs.
        Definition: pixel_based.hpp:84
        -
        Concept for all pixel-based GIL constructs.
        Definition: pixel_based.hpp:54
        -
        Definition: color_convert.hpp:31
        -
        Returns the number of channels of a pixel-based GIL construct.
        Definition: pixel.hpp:54
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
        +
        9#define BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/channel.hpp>
        +
        13#include <boost/gil/concepts/color.hpp>
        +
        14#include <boost/gil/concepts/concept_check.hpp>
        +
        15#include <boost/gil/concepts/fwd.hpp>
        +
        16
        +
        17#include <cstddef>
        +
        18
        +
        19#if defined(BOOST_CLANG)
        +
        20#pragma clang diagnostic push
        +
        21#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        22#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        23#endif
        +
        24
        +
        25#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        26#pragma GCC diagnostic push
        +
        27#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        28#endif
        +
        29
        +
        30namespace boost { namespace gil {
        +
        31
        +
        52template <typename P>
        +
        + +
        54{
        +
        55 void constraints()
        +
        56 {
        +
        57 using color_space_t = typename color_space_type<P>::type;
        +
        58 gil_function_requires<ColorSpaceConcept<color_space_t>>();
        +
        59
        +
        60 using channel_mapping_t = typename channel_mapping_type<P>::type ;
        +
        61 gil_function_requires<ChannelMappingConcept<channel_mapping_t>>();
        +
        62
        +
        63 static const bool planar = is_planar<P>::value;
        +
        64 ignore_unused_variable_warning(planar);
        +
        65
        +
        66 // This is not part of the concept, but should still work
        +
        67 static const std::size_t nc = num_channels<P>::value;
        +
        68 ignore_unused_variable_warning(nc);
        +
        69 }
        +
        70};
        +
        +
        71
        +
        82template <typename P>
        +
        + +
        84{
        +
        85 void constraints()
        +
        86 {
        +
        87 gil_function_requires<PixelBasedConcept<P>>();
        +
        88
        +
        89 using channel_t = typename channel_type<P>::type;
        +
        90 gil_function_requires<ChannelConcept<channel_t>>();
        +
        91 }
        +
        92};
        +
        +
        93
        +
        94}} // namespace boost::gil
        +
        95
        +
        96#if defined(BOOST_CLANG)
        +
        97#pragma clang diagnostic pop
        +
        98#endif
        +
        99
        +
        100#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        101#pragma GCC diagnostic pop
        +
        102#endif
        +
        103
        +
        104#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Concept for homogeneous pixel-based GIL constructs.
        Definition pixel_based.hpp:84
        +
        Concept for all pixel-based GIL constructs.
        Definition pixel_based.hpp:54
        +
        Definition color_convert.hpp:31
        +
        Returns the number of channels of a pixel-based GIL construct.
        Definition pixel.hpp:54
        diff --git a/html/reference/pixel__dereference_8hpp_source.html b/html/reference/pixel__dereference_8hpp_source.html index 06a8a619f..0f329dfc7 100644 --- a/html/reference/pixel__dereference_8hpp_source.html +++ b/html/reference/pixel__dereference_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_dereference.hpp Source File @@ -27,134 +27,141 @@

        - + +/* @license-end */ + +
        -
        -
        pixel_dereference.hpp
        +
        pixel_dereference.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/concept_check.hpp>
        -
        13 #include <boost/gil/concepts/fwd.hpp>
        -
        14 #include <boost/gil/concepts/pixel.hpp>
        -
        15 #include <boost/gil/concepts/detail/type_traits.hpp>
        -
        16 
        -
        17 #include <boost/concept_check.hpp>
        -
        18 
        -
        19 #include <cstddef>
        -
        20 #include <type_traits>
        -
        21 
        -
        22 #if defined(BOOST_CLANG)
        -
        23 #pragma clang diagnostic push
        -
        24 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        25 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        26 #endif
        -
        27 
        -
        28 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        29 #pragma GCC diagnostic push
        -
        30 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        31 #endif
        -
        32 
        -
        33 namespace boost { namespace gil {
        -
        34 
        -
        52 template <typename D>
        - -
        54 {
        -
        55  void constraints()
        -
        56  {
        -
        57  gil_function_requires
        -
        58  <
        -
        59  boost::UnaryFunctionConcept
        -
        60  <
        -
        61  D,
        -
        62  typename detail::remove_const_and_reference<typename D::result_type>::type,
        -
        63  typename D::argument_type
        -
        64  >
        -
        65  >();
        -
        66  gil_function_requires<boost::DefaultConstructibleConcept<D>>();
        -
        67  gil_function_requires<boost::CopyConstructibleConcept<D>>();
        -
        68  gil_function_requires<boost::AssignableConcept<D>>();
        -
        69 
        -
        70  gil_function_requires<PixelConcept
        -
        71  <
        -
        72  typename detail::remove_const_and_reference<typename D::result_type>::type
        -
        73  >>();
        -
        74 
        -
        75  using const_t = typename D::const_t;
        -
        76  gil_function_requires<PixelDereferenceAdaptorConcept<const_t>>();
        -
        77 
        -
        78  using value_type = typename D::value_type;
        -
        79  gil_function_requires<PixelValueConcept<value_type>>();
        -
        80 
        -
        81  // TODO: Should this be concept-checked after "if you remove const and reference"? --mloskot
        -
        82  using reference = typename D::reference; // == PixelConcept (if you remove const and reference)
        -
        83  using const_reference = typename D::const_reference; // == PixelConcept (if you remove const and reference)
        -
        84 
        -
        85  bool const is_mutable = D::is_mutable;
        -
        86  ignore_unused_variable_warning(is_mutable);
        -
        87  }
        -
        88  D d;
        -
        89 };
        -
        90 
        -
        91 template <typename P>
        -
        92 struct PixelDereferenceAdaptorArchetype
        -
        93 {
        -
        94  using argument_type = P;
        -
        95  using result_type = P;
        -
        96  using const_t = PixelDereferenceAdaptorArchetype;
        -
        97  using value_type = typename std::remove_reference<P>::type;
        -
        98  using reference = typename std::add_lvalue_reference<P>::type;
        -
        99  using const_reference = reference;
        -
        100 
        -
        101  static const bool is_mutable = false;
        -
        102  P operator()(P) const { throw; }
        -
        103 };
        -
        104 
        -
        105 }} // namespace boost::gil
        -
        106 
        -
        107 #if defined(BOOST_CLANG)
        -
        108 #pragma clang diagnostic pop
        -
        109 #endif
        -
        110 
        -
        111 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        112 #pragma GCC diagnostic pop
        -
        113 #endif
        -
        114 
        -
        115 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Pixel concept - A color base whose elements are channels.
        Definition: concepts/pixel.hpp:64
        -
        Represents a unary function object that can be invoked upon dereferencing a pixel iterator.
        Definition: pixel_dereference.hpp:54
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP
        +
        9#define BOOST_GIL_CONCEPTS_PIXEL_DEREFERENCE_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/concept_check.hpp>
        +
        13#include <boost/gil/concepts/fwd.hpp>
        +
        14#include <boost/gil/concepts/pixel.hpp>
        +
        15#include <boost/gil/concepts/detail/type_traits.hpp>
        +
        16
        +
        17#include <boost/concept_check.hpp>
        +
        18
        +
        19#include <cstddef>
        +
        20#include <type_traits>
        +
        21
        +
        22#if defined(BOOST_CLANG)
        +
        23#pragma clang diagnostic push
        +
        24#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        25#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        26#endif
        +
        27
        +
        28#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        29#pragma GCC diagnostic push
        +
        30#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        31#endif
        +
        32
        +
        33namespace boost { namespace gil {
        +
        34
        +
        52template <typename D>
        +
        + +
        54{
        +
        55 void constraints()
        +
        56 {
        +
        57 gil_function_requires
        +
        58 <
        +
        59 boost::UnaryFunctionConcept
        +
        60 <
        +
        61 D,
        +
        62 typename detail::remove_const_and_reference<typename D::result_type>::type,
        +
        63 typename D::argument_type
        +
        64 >
        +
        65 >();
        +
        66 gil_function_requires<boost::DefaultConstructibleConcept<D>>();
        +
        67 gil_function_requires<boost::CopyConstructibleConcept<D>>();
        +
        68 gil_function_requires<boost::AssignableConcept<D>>();
        +
        69
        +
        70 gil_function_requires<PixelConcept
        +
        71 <
        +
        72 typename detail::remove_const_and_reference<typename D::result_type>::type
        +
        73 >>();
        +
        74
        +
        75 using const_t = typename D::const_t;
        +
        76 gil_function_requires<PixelDereferenceAdaptorConcept<const_t>>();
        +
        77
        +
        78 using value_type = typename D::value_type;
        +
        79 gil_function_requires<PixelValueConcept<value_type>>();
        +
        80
        +
        81 // TODO: Should this be concept-checked after "if you remove const and reference"? --mloskot
        +
        82 using reference = typename D::reference; // == PixelConcept (if you remove const and reference)
        +
        83 using const_reference = typename D::const_reference; // == PixelConcept (if you remove const and reference)
        +
        84
        +
        85 bool const is_mutable = D::is_mutable;
        +
        86 ignore_unused_variable_warning(is_mutable);
        +
        87 }
        +
        88 D d;
        +
        89};
        +
        +
        90
        +
        91template <typename P>
        +
        92struct PixelDereferenceAdaptorArchetype
        +
        93{
        +
        94 using argument_type = P;
        +
        95 using result_type = P;
        +
        96 using const_t = PixelDereferenceAdaptorArchetype;
        +
        97 using value_type = typename std::remove_reference<P>::type;
        +
        98 using reference = typename std::add_lvalue_reference<P>::type;
        +
        99 using const_reference = reference;
        +
        100
        +
        101 static const bool is_mutable = false;
        +
        102 P operator()(P) const { throw; }
        +
        103};
        +
        104
        +
        105}} // namespace boost::gil
        +
        106
        +
        107#if defined(BOOST_CLANG)
        +
        108#pragma clang diagnostic pop
        +
        109#endif
        +
        110
        +
        111#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        112#pragma GCC diagnostic pop
        +
        113#endif
        +
        114
        +
        115#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Pixel concept - A color base whose elements are channels.
        Definition concepts/pixel.hpp:64
        +
        Represents a unary function object that can be invoked upon dereferencing a pixel iterator.
        Definition pixel_dereference.hpp:54
        diff --git a/html/reference/pixel__iterator_8hpp_source.html b/html/reference/pixel__iterator_8hpp_source.html index 4674b48d2..bc387a243 100644 --- a/html/reference/pixel__iterator_8hpp_source.html +++ b/html/reference/pixel__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_iterator.hpp Source File @@ -27,174 +27,179 @@

        - + +/* @license-end */ + +
        -
        -
        pixel_iterator.hpp
        +
        pixel_iterator.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_PIXEL_ITERATOR_HPP
        -
        9 #define BOOST_GIL_PIXEL_ITERATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts.hpp>
        -
        12 #include <boost/gil/dynamic_step.hpp>
        -
        13 #include <boost/gil/utilities.hpp>
        -
        14 #include <boost/gil/pixel.hpp>
        -
        15 
        -
        16 #include <iterator>
        -
        17 #include <type_traits>
        -
        18 
        -
        19 namespace boost { namespace gil {
        -
        20 
        -
        21 //forwarded declaration (as this file is included in step_iterator.hpp)
        -
        22 template <typename Iterator>
        -
        23 class memory_based_step_iterator;
        -
        24 
        -
        27 template <typename It>
        -
        28 struct is_iterator_adaptor : public std::false_type {};
        -
        29 
        -
        31 template <typename It>
        - -
        33 
        -
        35 template <typename It, typename NewBaseIt>
        - -
        37 
        -
        39 template <typename It>
        - -
        41 
        -
        42 // The default implementation when the iterator is a C pointer is to use the standard constness semantics
        -
        43 template <typename T> struct const_iterator_type<T*> { using type = T const*; };
        -
        44 template <typename T> struct const_iterator_type<T const*> { using type = T const*; };
        -
        45 
        -
        48 template <typename It>
        - -
        50 
        -
        51 // The default implementation when the iterator is a C pointer is to use the standard constness semantics
        -
        52 template <typename T>
        -
        53 struct iterator_is_mutable<T*> : std::true_type {};
        -
        54 
        -
        55 template <typename T>
        -
        56 struct iterator_is_mutable<T const*> : std::false_type {};
        -
        57 
        -
        62 
        -
        63 
        -
        64 
        -
        66 // HasDynamicXStepTypeConcept
        -
        68 
        -
        70 template <typename Pixel>
        -
        71 struct dynamic_x_step_type<Pixel*> {
        -
        72  using type = memory_based_step_iterator<Pixel *>;
        -
        73 };
        -
        74 
        -
        76 template <typename Pixel>
        -
        77 struct dynamic_x_step_type<const Pixel*> {
        -
        78  using type = memory_based_step_iterator<const Pixel *>;
        -
        79 };
        -
        80 
        -
        81 
        -
        83 // PixelBasedConcept
        -
        85 
        -
        86 template <typename Pixel>
        -
        87 struct color_space_type<Pixel*> : color_space_type<Pixel> {};
        -
        88 
        -
        89 template <typename Pixel>
        -
        90 struct color_space_type<Pixel const*> : color_space_type<Pixel> {};
        -
        91 
        -
        92 template <typename Pixel>
        -
        93 struct channel_mapping_type<Pixel*> : channel_mapping_type<Pixel> {};
        -
        94 
        -
        95 template <typename Pixel>
        -
        96 struct channel_mapping_type<Pixel const*> : channel_mapping_type<Pixel> {};
        -
        97 
        -
        98 template <typename Pixel>
        -
        99 struct is_planar<Pixel*> : is_planar<Pixel> {};
        -
        100 
        -
        101 template <typename Pixel>
        -
        102 struct is_planar<Pixel const*> : is_planar<Pixel> {};
        -
        103 
        -
        105 // HomogeneousPixelBasedConcept
        -
        107 
        -
        108 template <typename Pixel>
        -
        109 struct channel_type<Pixel*> : channel_type<Pixel> {};
        -
        110 
        -
        111 template <typename Pixel>
        -
        112 struct channel_type<Pixel const*> : channel_type<Pixel> {};
        -
        113 
        -
        118 
        -
        120 // MemoryBasedIteratorConcept
        -
        122 
        -
        123 template <typename T>
        -
        124 struct byte_to_memunit : std::integral_constant<int, 1> {};
        -
        125 
        -
        126 template <typename P>
        -
        127 inline std::ptrdiff_t memunit_step(P const*) { return sizeof(P); }
        -
        128 
        -
        129 template <typename P>
        -
        130 inline std::ptrdiff_t memunit_distance(P const* p1, P const* p2)
        -
        131 {
        -
        132  return (
        -
        133  gil_reinterpret_cast_c<unsigned char const*>(p2) -
        -
        134  gil_reinterpret_cast_c<unsigned char const*>(p1));
        -
        135 }
        -
        136 
        -
        137 template <typename P>
        -
        138 inline void memunit_advance(P* &p, std::ptrdiff_t diff)
        -
        139 {
        -
        140  p = (P*)((unsigned char*)(p)+diff);
        -
        141 }
        -
        142 
        -
        143 template <typename P>
        -
        144 inline P* memunit_advanced(const P* p, std::ptrdiff_t diff)
        -
        145 {
        -
        146  return (P*)((char*)(p)+diff);
        -
        147 }
        -
        148 
        -
        149 // memunit_advanced_ref
        -
        150 // (shortcut to advancing a pointer by a given number of memunits and taking the reference in case the compiler is not smart enough)
        -
        151 
        -
        152 template <typename P>
        -
        153 inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
        -
        154  return *memunit_advanced(p,diff);
        -
        155 }
        -
        156 
        -
        157 } } // namespace boost::gil
        -
        158 
        -
        159 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: pixel_iterator.hpp:124
        -
        Returns the type of an iterator just like the input iterator, except operating over immutable values.
        Definition: pixel_iterator.hpp:40
        -
        metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
        Definition: pixel_iterator.hpp:28
        -
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition: metafunctions.hpp:36
        -
        Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
        Definition: pixel_iterator.hpp:36
        -
        Metafunction predicate returning whether the given iterator allows for changing its values.
        Definition: pixel_iterator.hpp:49
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_PIXEL_ITERATOR_HPP
        +
        9#define BOOST_GIL_PIXEL_ITERATOR_HPP
        +
        10
        +
        11#include <boost/gil/concepts.hpp>
        +
        12#include <boost/gil/dynamic_step.hpp>
        +
        13#include <boost/gil/utilities.hpp>
        +
        14#include <boost/gil/pixel.hpp>
        +
        15
        +
        16#include <iterator>
        +
        17#include <type_traits>
        +
        18
        +
        19namespace boost { namespace gil {
        +
        20
        +
        21//forwarded declaration (as this file is included in step_iterator.hpp)
        +
        22template <typename Iterator>
        +
        23class memory_based_step_iterator;
        +
        24
        +
        27template <typename It>
        +
        28struct is_iterator_adaptor : public std::false_type {};
        +
        29
        +
        31template <typename It>
        + +
        33
        +
        35template <typename It, typename NewBaseIt>
        + +
        37
        +
        39template <typename It>
        + +
        41
        +
        42// The default implementation when the iterator is a C pointer is to use the standard constness semantics
        +
        43template <typename T> struct const_iterator_type<T*> { using type = T const*; };
        +
        44template <typename T> struct const_iterator_type<T const*> { using type = T const*; };
        +
        45
        +
        48template <typename It>
        + +
        50
        +
        51// The default implementation when the iterator is a C pointer is to use the standard constness semantics
        +
        52template <typename T>
        +
        53struct iterator_is_mutable<T*> : std::true_type {};
        +
        54
        +
        55template <typename T>
        +
        56struct iterator_is_mutable<T const*> : std::false_type {};
        +
        57
        +
        62
        +
        63
        +
        64
        +
        66// HasDynamicXStepTypeConcept
        +
        68
        +
        70template <typename Pixel>
        +
        71struct dynamic_x_step_type<Pixel*> {
        +
        72 using type = memory_based_step_iterator<Pixel *>;
        +
        73};
        +
        74
        +
        76template <typename Pixel>
        +
        77struct dynamic_x_step_type<const Pixel*> {
        +
        78 using type = memory_based_step_iterator<const Pixel *>;
        +
        79};
        +
        80
        +
        81
        +
        83// PixelBasedConcept
        +
        85
        +
        86template <typename Pixel>
        +
        87struct color_space_type<Pixel*> : color_space_type<Pixel> {};
        +
        88
        +
        89template <typename Pixel>
        +
        90struct color_space_type<Pixel const*> : color_space_type<Pixel> {};
        +
        91
        +
        92template <typename Pixel>
        +
        93struct channel_mapping_type<Pixel*> : channel_mapping_type<Pixel> {};
        +
        94
        +
        95template <typename Pixel>
        +
        96struct channel_mapping_type<Pixel const*> : channel_mapping_type<Pixel> {};
        +
        97
        +
        98template <typename Pixel>
        +
        99struct is_planar<Pixel*> : is_planar<Pixel> {};
        +
        100
        +
        101template <typename Pixel>
        +
        102struct is_planar<Pixel const*> : is_planar<Pixel> {};
        +
        103
        +
        105// HomogeneousPixelBasedConcept
        +
        107
        +
        108template <typename Pixel>
        +
        109struct channel_type<Pixel*> : channel_type<Pixel> {};
        +
        110
        +
        111template <typename Pixel>
        +
        112struct channel_type<Pixel const*> : channel_type<Pixel> {};
        +
        113
        +
        118
        +
        120// MemoryBasedIteratorConcept
        +
        122
        +
        123template <typename T>
        +
        124struct byte_to_memunit : std::integral_constant<int, 1> {};
        +
        125
        +
        126template <typename P>
        +
        127inline std::ptrdiff_t memunit_step(P const*) { return sizeof(P); }
        +
        128
        +
        129template <typename P>
        +
        130inline std::ptrdiff_t memunit_distance(P const* p1, P const* p2)
        +
        131{
        +
        132 return (
        +
        133 gil_reinterpret_cast_c<unsigned char const*>(p2) -
        +
        134 gil_reinterpret_cast_c<unsigned char const*>(p1));
        +
        135}
        +
        136
        +
        137template <typename P>
        +
        138inline void memunit_advance(P* &p, std::ptrdiff_t diff)
        +
        139{
        +
        140 p = (P*)((unsigned char*)(p)+diff);
        +
        141}
        +
        142
        +
        143template <typename P>
        +
        144inline P* memunit_advanced(const P* p, std::ptrdiff_t diff)
        +
        145{
        +
        146 return (P*)((char*)(p)+diff);
        +
        147}
        +
        148
        +
        149// memunit_advanced_ref
        +
        150// (shortcut to advancing a pointer by a given number of memunits and taking the reference in case the compiler is not smart enough)
        +
        151
        +
        152template <typename P>
        +
        153inline P& memunit_advanced_ref(P* p, std::ptrdiff_t diff) {
        +
        154 return *memunit_advanced(p,diff);
        +
        155}
        +
        156
        +
        157} } // namespace boost::gil
        +
        158
        +
        159#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition pixel_iterator.hpp:124
        +
        Returns the type of an iterator just like the input iterator, except operating over immutable values.
        Definition pixel_iterator.hpp:40
        +
        metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
        Definition pixel_iterator.hpp:28
        +
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition metafunctions.hpp:36
        +
        Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
        Definition pixel_iterator.hpp:36
        +
        Metafunction predicate returning whether the given iterator allows for changing its values.
        Definition pixel_iterator.hpp:49
        diff --git a/html/reference/pixel__iterator__adaptor_8hpp_source.html b/html/reference/pixel__iterator__adaptor_8hpp_source.html index ed06c79e6..196c17c2b 100644 --- a/html/reference/pixel__iterator__adaptor_8hpp_source.html +++ b/html/reference/pixel__iterator__adaptor_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_iterator_adaptor.hpp Source File @@ -27,221 +27,232 @@

        - + +/* @license-end */ + +
        -
        -
        pixel_iterator_adaptor.hpp
        +
        pixel_iterator_adaptor.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP
        -
        9 #define BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts.hpp>
        -
        12 #include <boost/gil/pixel_iterator.hpp>
        -
        13 
        -
        14 #include <boost/iterator/iterator_facade.hpp>
        -
        15 
        -
        16 #include <iterator>
        -
        17 
        -
        18 namespace boost { namespace gil {
        -
        19 
        -
        23 
        -
        26 
        -
        27 template <typename Iterator, // Models Iterator
        -
        28  typename DFn> // Models Returns the result of dereferencing a given iterator of type Iterator
        -
        29 class dereference_iterator_adaptor : public iterator_adaptor<dereference_iterator_adaptor<Iterator,DFn>,
        -
        30  Iterator,
        -
        31  typename DFn::value_type,
        -
        32  typename std::iterator_traits<Iterator>::iterator_category,
        -
        33  typename DFn::reference,
        -
        34  use_default> {
        -
        35  DFn _deref_fn;
        -
        36 public:
        -
        37  using parent_t = iterator_adaptor<dereference_iterator_adaptor<Iterator,DFn>,
        -
        38  Iterator,
        -
        39  typename DFn::value_type,
        -
        40  typename std::iterator_traits<Iterator>::iterator_category,
        -
        41  typename DFn::reference,
        -
        42  use_default>;
        -
        43  using reference = typename DFn::result_type;
        -
        44  using difference_type = typename std::iterator_traits<Iterator>::difference_type;
        -
        45  using dereference_fn = DFn;
        -
        46 
        - -
        48  template <typename Iterator1>
        -
        49  dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn>& dit) : parent_t(dit.base()), _deref_fn(dit._deref_fn) {}
        -
        50  dereference_iterator_adaptor(Iterator it, DFn deref_fn=DFn()) : parent_t(it), _deref_fn(deref_fn) {}
        -
        51  template <typename Iterator1, typename DFn1>
        -
        52  dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn1>& it) : parent_t(it.base()), _deref_fn(it._deref_fn) {}
        -
        55  reference operator[](difference_type d) const { return *(*this+d);}
        -
        56 
        -
        57  // although iterator_adaptor defines these, the default implementation computes distance and compares for zero.
        -
        58  // it is often faster to just apply the relation operator to the base
        -
        59  bool operator> (const dereference_iterator_adaptor& p) const { return this->base_reference()> p.base_reference(); }
        -
        60  bool operator< (const dereference_iterator_adaptor& p) const { return this->base_reference()< p.base_reference(); }
        -
        61  bool operator>=(const dereference_iterator_adaptor& p) const { return this->base_reference()>=p.base_reference(); }
        -
        62  bool operator<=(const dereference_iterator_adaptor& p) const { return this->base_reference()<=p.base_reference(); }
        -
        63  bool operator==(const dereference_iterator_adaptor& p) const { return this->base_reference()==p.base_reference(); }
        -
        64  bool operator!=(const dereference_iterator_adaptor& p) const { return this->base_reference()!=p.base_reference(); }
        -
        65 
        -
        66  Iterator& base() { return this->base_reference(); }
        -
        67  const Iterator& base() const { return this->base_reference(); }
        -
        68  const DFn& deref_fn() const { return _deref_fn; }
        -
        69 private:
        -
        70  template <typename Iterator1, typename DFn1>
        -
        71  friend class dereference_iterator_adaptor;
        -
        72  friend class boost::iterator_core_access;
        -
        73 
        -
        74  reference dereference() const { return _deref_fn(*(this->base_reference())); }
        -
        75 };
        -
        76 
        -
        77 template <typename I, typename DFn>
        -
        78 struct const_iterator_type<dereference_iterator_adaptor<I,DFn> > {
        -
        79  using type = dereference_iterator_adaptor<typename const_iterator_type<I>::type,typename DFn::const_t>;
        -
        80 };
        -
        81 
        -
        82 template <typename I, typename DFn>
        -
        83 struct iterator_is_mutable<dereference_iterator_adaptor<I, DFn>>
        -
        84  : std::integral_constant<bool, DFn::is_mutable>
        -
        85 {};
        -
        86 
        -
        87 
        -
        88 template <typename I, typename DFn>
        -
        89 struct is_iterator_adaptor<dereference_iterator_adaptor<I, DFn>> : std::true_type {};
        -
        90 
        -
        91 template <typename I, typename DFn>
        -
        92 struct iterator_adaptor_get_base<dereference_iterator_adaptor<I, DFn>>
        -
        93 {
        -
        94  using type = I;
        -
        95 };
        -
        96 
        -
        97 template <typename I, typename DFn, typename NewBaseIterator>
        -
        98 struct iterator_adaptor_rebind<dereference_iterator_adaptor<I,DFn>,NewBaseIterator> {
        -
        99  using type = dereference_iterator_adaptor<NewBaseIterator,DFn>;
        -
        100 };
        -
        101 
        -
        103 // PixelBasedConcept
        -
        105 
        -
        106 template <typename I, typename DFn>
        -
        107 struct color_space_type<dereference_iterator_adaptor<I,DFn> > : public color_space_type<typename DFn::value_type> {};
        -
        108 
        -
        109 template <typename I, typename DFn>
        -
        110 struct channel_mapping_type<dereference_iterator_adaptor<I,DFn> > : public channel_mapping_type<typename DFn::value_type> {};
        -
        111 
        -
        112 template <typename I, typename DFn>
        -
        113 struct is_planar<dereference_iterator_adaptor<I,DFn> > : public is_planar<typename DFn::value_type> {};
        -
        114 
        -
        115 template <typename I, typename DFn>
        -
        116 struct channel_type<dereference_iterator_adaptor<I,DFn> > : public channel_type<typename DFn::value_type> {};
        -
        117 
        -
        118 
        -
        120 // MemoryBasedIteratorConcept
        -
        122 
        -
        123 template <typename Iterator, typename DFn>
        -
        124 struct byte_to_memunit<dereference_iterator_adaptor<Iterator,DFn>> : public byte_to_memunit<Iterator> {};
        -
        125 
        -
        126 template <typename Iterator, typename DFn>
        -
        127 inline auto memunit_step(dereference_iterator_adaptor<Iterator,DFn> const& p)
        -
        128  -> typename std::iterator_traits<Iterator>::difference_type
        -
        129 {
        -
        130  return memunit_step(p.base());
        -
        131 }
        -
        132 
        -
        133 template <typename Iterator, typename DFn>
        -
        134 inline auto memunit_distance(dereference_iterator_adaptor<Iterator,DFn> const& p1,
        -
        135  dereference_iterator_adaptor<Iterator,DFn> const& p2)
        -
        136  -> typename std::iterator_traits<Iterator>::difference_type
        -
        137 {
        -
        138  return memunit_distance(p1.base(),p2.base());
        -
        139 }
        -
        140 
        -
        141 template <typename Iterator, typename DFn>
        -
        142 inline void memunit_advance(dereference_iterator_adaptor<Iterator,DFn>& p,
        -
        143  typename std::iterator_traits<Iterator>::difference_type diff) {
        -
        144  memunit_advance(p.base(), diff);
        -
        145 }
        -
        146 
        -
        147 template <typename Iterator, typename DFn>
        -
        148 inline auto memunit_advanced(dereference_iterator_adaptor<Iterator,DFn> const& p,
        -
        149  typename std::iterator_traits<Iterator>::difference_type diff)
        -
        150  -> dereference_iterator_adaptor<Iterator,DFn>
        -
        151 {
        -
        152  return dereference_iterator_adaptor<Iterator,DFn>(memunit_advanced(p.base(), diff), p.deref_fn());
        -
        153 }
        -
        154 
        -
        155 
        -
        156 template <typename Iterator, typename DFn>
        -
        157 inline auto memunit_advanced_ref(dereference_iterator_adaptor<Iterator,DFn> const& p,
        -
        158  typename std::iterator_traits<Iterator>::difference_type diff)
        -
        159  -> typename std::iterator_traits<dereference_iterator_adaptor<Iterator,DFn> >::reference
        -
        160 {
        -
        161  return *memunit_advanced(p, diff);
        -
        162 }
        -
        163 
        -
        165 // HasDynamicXStepTypeConcept
        -
        167 
        -
        168 template <typename Iterator, typename DFn>
        -
        169 struct dynamic_x_step_type<dereference_iterator_adaptor<Iterator,DFn> > {
        -
        170  using type = dereference_iterator_adaptor<typename dynamic_x_step_type<Iterator>::type,DFn>;
        -
        171 };
        -
        172 
        -
        175 template <typename Iterator, typename Deref>
        - -
        177  BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
        -
        178 
        - -
        180 
        -
        181  static type make(const Iterator& it, const Deref& d) { return type(it,d); }
        -
        182 };
        -
        183 
        -
        186 template <typename Iterator, typename PREV_DEREF, typename Deref>
        -
        187 struct iterator_add_deref<dereference_iterator_adaptor<Iterator, PREV_DEREF>,Deref> {
        -
        188 // BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
        -
        189 
        - -
        191 
        -
        192  static type make(const dereference_iterator_adaptor<Iterator, PREV_DEREF>& it, const Deref& d) {
        -
        193  return type(it.base(),deref_compose<Deref,PREV_DEREF>(d,it.deref_fn()));
        -
        194  }
        -
        195 };
        -
        196 
        -
        197 }} // namespace boost::gil
        -
        198 
        -
        199 #endif
        -
        Composes two dereference function objects. Similar to std::unary_compose but needs to pull some alias...
        Definition: utilities.hpp:131
        -
        An adaptor over an existing iterator that provides for custom filter on dereferencing the object....
        Definition: pixel_iterator_adaptor.hpp:34
        -
        reference operator[](difference_type d) const
        Definition: pixel_iterator_adaptor.hpp:55
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Represents a unary function object that can be invoked upon dereferencing a pixel iterator.
        Definition: pixel_dereference.hpp:54
        -
        Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor ...
        Definition: pixel_iterator_adaptor.hpp:176
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP
        +
        9#define BOOST_GIL_PIXEL_ITERATOR_ADAPTOR_HPP
        +
        10
        +
        11#include <boost/gil/concepts.hpp>
        +
        12#include <boost/gil/pixel_iterator.hpp>
        +
        13
        +
        14#include <boost/iterator/iterator_facade.hpp>
        +
        15
        +
        16#include <iterator>
        +
        17
        +
        18namespace boost { namespace gil {
        +
        19
        +
        23
        +
        26
        +
        27template <typename Iterator, // Models Iterator
        +
        28 typename DFn> // Models Returns the result of dereferencing a given iterator of type Iterator
        +
        +
        29class dereference_iterator_adaptor : public iterator_adaptor<dereference_iterator_adaptor<Iterator,DFn>,
        +
        30 Iterator,
        +
        31 typename DFn::value_type,
        +
        32 typename std::iterator_traits<Iterator>::iterator_category,
        +
        33 typename DFn::reference,
        +
        34 use_default> {
        +
        35 DFn _deref_fn;
        +
        36public:
        +
        37 using parent_t = iterator_adaptor<dereference_iterator_adaptor<Iterator,DFn>,
        +
        38 Iterator,
        +
        39 typename DFn::value_type,
        +
        40 typename std::iterator_traits<Iterator>::iterator_category,
        +
        41 typename DFn::reference,
        +
        42 use_default>;
        +
        43 using reference = typename DFn::result_type;
        +
        44 using difference_type = typename std::iterator_traits<Iterator>::difference_type;
        +
        45 using dereference_fn = DFn;
        +
        46
        + +
        48 template <typename Iterator1>
        +
        49 dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn>& dit) : parent_t(dit.base()), _deref_fn(dit._deref_fn) {}
        +
        50 dereference_iterator_adaptor(Iterator it, DFn deref_fn=DFn()) : parent_t(it), _deref_fn(deref_fn) {}
        +
        51 template <typename Iterator1, typename DFn1>
        +
        52 dereference_iterator_adaptor(const dereference_iterator_adaptor<Iterator1,DFn1>& it) : parent_t(it.base()), _deref_fn(it._deref_fn) {}
        +
        55 reference operator[](difference_type d) const { return *(*this+d);}
        +
        56
        +
        57 // although iterator_adaptor defines these, the default implementation computes distance and compares for zero.
        +
        58 // it is often faster to just apply the relation operator to the base
        +
        59 bool operator> (const dereference_iterator_adaptor& p) const { return this->base_reference()> p.base_reference(); }
        +
        60 bool operator< (const dereference_iterator_adaptor& p) const { return this->base_reference()< p.base_reference(); }
        +
        61 bool operator>=(const dereference_iterator_adaptor& p) const { return this->base_reference()>=p.base_reference(); }
        +
        62 bool operator<=(const dereference_iterator_adaptor& p) const { return this->base_reference()<=p.base_reference(); }
        +
        63 bool operator==(const dereference_iterator_adaptor& p) const { return this->base_reference()==p.base_reference(); }
        +
        64 bool operator!=(const dereference_iterator_adaptor& p) const { return this->base_reference()!=p.base_reference(); }
        +
        65
        +
        66 Iterator& base() { return this->base_reference(); }
        +
        67 const Iterator& base() const { return this->base_reference(); }
        +
        68 const DFn& deref_fn() const { return _deref_fn; }
        +
        69private:
        +
        70 template <typename Iterator1, typename DFn1>
        +
        71 friend class dereference_iterator_adaptor;
        +
        72 friend class boost::iterator_core_access;
        +
        73
        +
        74 reference dereference() const { return _deref_fn(*(this->base_reference())); }
        +
        75};
        +
        +
        76
        +
        77template <typename I, typename DFn>
        +
        78struct const_iterator_type<dereference_iterator_adaptor<I,DFn> > {
        +
        79 using type = dereference_iterator_adaptor<typename const_iterator_type<I>::type,typename DFn::const_t>;
        +
        80};
        +
        81
        +
        82template <typename I, typename DFn>
        +
        83struct iterator_is_mutable<dereference_iterator_adaptor<I, DFn>>
        +
        84 : std::integral_constant<bool, DFn::is_mutable>
        +
        85{};
        +
        86
        +
        87
        +
        88template <typename I, typename DFn>
        +
        89struct is_iterator_adaptor<dereference_iterator_adaptor<I, DFn>> : std::true_type {};
        +
        90
        +
        91template <typename I, typename DFn>
        +
        92struct iterator_adaptor_get_base<dereference_iterator_adaptor<I, DFn>>
        +
        93{
        +
        94 using type = I;
        +
        95};
        +
        96
        +
        97template <typename I, typename DFn, typename NewBaseIterator>
        +
        98struct iterator_adaptor_rebind<dereference_iterator_adaptor<I,DFn>,NewBaseIterator> {
        +
        99 using type = dereference_iterator_adaptor<NewBaseIterator,DFn>;
        +
        100};
        +
        101
        +
        103// PixelBasedConcept
        +
        105
        +
        106template <typename I, typename DFn>
        +
        107struct color_space_type<dereference_iterator_adaptor<I,DFn> > : public color_space_type<typename DFn::value_type> {};
        +
        108
        +
        109template <typename I, typename DFn>
        +
        110struct channel_mapping_type<dereference_iterator_adaptor<I,DFn> > : public channel_mapping_type<typename DFn::value_type> {};
        +
        111
        +
        112template <typename I, typename DFn>
        +
        113struct is_planar<dereference_iterator_adaptor<I,DFn> > : public is_planar<typename DFn::value_type> {};
        +
        114
        +
        115template <typename I, typename DFn>
        +
        116struct channel_type<dereference_iterator_adaptor<I,DFn> > : public channel_type<typename DFn::value_type> {};
        +
        117
        +
        118
        +
        120// MemoryBasedIteratorConcept
        +
        122
        +
        123template <typename Iterator, typename DFn>
        +
        124struct byte_to_memunit<dereference_iterator_adaptor<Iterator,DFn>> : public byte_to_memunit<Iterator> {};
        +
        125
        +
        126template <typename Iterator, typename DFn>
        +
        127inline auto memunit_step(dereference_iterator_adaptor<Iterator,DFn> const& p)
        +
        128 -> typename std::iterator_traits<Iterator>::difference_type
        +
        129{
        +
        130 return memunit_step(p.base());
        +
        131}
        +
        132
        +
        133template <typename Iterator, typename DFn>
        +
        134inline auto memunit_distance(dereference_iterator_adaptor<Iterator,DFn> const& p1,
        +
        135 dereference_iterator_adaptor<Iterator,DFn> const& p2)
        +
        136 -> typename std::iterator_traits<Iterator>::difference_type
        +
        137{
        +
        138 return memunit_distance(p1.base(),p2.base());
        +
        139}
        +
        140
        +
        141template <typename Iterator, typename DFn>
        +
        142inline void memunit_advance(dereference_iterator_adaptor<Iterator,DFn>& p,
        +
        143 typename std::iterator_traits<Iterator>::difference_type diff) {
        +
        144 memunit_advance(p.base(), diff);
        +
        145}
        +
        146
        +
        147template <typename Iterator, typename DFn>
        +
        148inline auto memunit_advanced(dereference_iterator_adaptor<Iterator,DFn> const& p,
        +
        149 typename std::iterator_traits<Iterator>::difference_type diff)
        +
        150 -> dereference_iterator_adaptor<Iterator,DFn>
        +
        151{
        +
        152 return dereference_iterator_adaptor<Iterator,DFn>(memunit_advanced(p.base(), diff), p.deref_fn());
        +
        153}
        +
        154
        +
        155
        +
        156template <typename Iterator, typename DFn>
        +
        157inline auto memunit_advanced_ref(dereference_iterator_adaptor<Iterator,DFn> const& p,
        +
        158 typename std::iterator_traits<Iterator>::difference_type diff)
        +
        159 -> typename std::iterator_traits<dereference_iterator_adaptor<Iterator,DFn> >::reference
        +
        160{
        +
        161 return *memunit_advanced(p, diff);
        +
        162}
        +
        163
        +
        165// HasDynamicXStepTypeConcept
        +
        167
        +
        168template <typename Iterator, typename DFn>
        +
        169struct dynamic_x_step_type<dereference_iterator_adaptor<Iterator,DFn> > {
        +
        170 using type = dereference_iterator_adaptor<typename dynamic_x_step_type<Iterator>::type,DFn>;
        +
        171};
        +
        172
        +
        175template <typename Iterator, typename Deref>
        +
        + +
        177 BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
        +
        178
        + +
        180
        +
        181 static type make(const Iterator& it, const Deref& d) { return type(it,d); }
        +
        182};
        +
        +
        183
        +
        186template <typename Iterator, typename PREV_DEREF, typename Deref>
        +
        +
        187struct iterator_add_deref<dereference_iterator_adaptor<Iterator, PREV_DEREF>,Deref> {
        +
        188// BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
        +
        189
        + +
        191
        +
        192 static type make(const dereference_iterator_adaptor<Iterator, PREV_DEREF>& it, const Deref& d) {
        +
        193 return type(it.base(),deref_compose<Deref,PREV_DEREF>(d,it.deref_fn()));
        +
        194 }
        +
        195};
        +
        +
        196
        +
        197}} // namespace boost::gil
        +
        198
        +
        199#endif
        +
        Composes two dereference function objects. Similar to std::unary_compose but needs to pull some alias...
        Definition utilities.hpp:131
        +
        An adaptor over an existing iterator that provides for custom filter on dereferencing the object....
        Definition pixel_iterator_adaptor.hpp:34
        +
        reference operator[](difference_type d) const
        Definition pixel_iterator_adaptor.hpp:55
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Represents a unary function object that can be invoked upon dereferencing a pixel iterator.
        Definition pixel_dereference.hpp:54
        +
        Returns the type (and creates an instance) of an iterator that invokes the given dereference adaptor ...
        Definition pixel_iterator_adaptor.hpp:176
        diff --git a/html/reference/pixel__locator_8hpp_source.html b/html/reference/pixel__locator_8hpp_source.html index 56948e4d4..252ef8174 100644 --- a/html/reference/pixel__locator_8hpp_source.html +++ b/html/reference/pixel__locator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_locator.hpp Source File @@ -27,316 +27,335 @@

        - + +/* @license-end */ + +
        -
        -
        pixel_locator.hpp
        +
        pixel_locator.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP
        -
        9 #define BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/concepts/basic.hpp>
        -
        12 #include <boost/gil/concepts/concept_check.hpp>
        -
        13 #include <boost/gil/concepts/fwd.hpp>
        -
        14 #include <boost/gil/concepts/pixel.hpp>
        -
        15 #include <boost/gil/concepts/pixel_dereference.hpp>
        -
        16 #include <boost/gil/concepts/pixel_iterator.hpp>
        -
        17 #include <boost/gil/concepts/point.hpp>
        -
        18 #include <boost/gil/concepts/detail/utility.hpp>
        -
        19 
        -
        20 #include <cstddef>
        -
        21 #include <iterator>
        -
        22 #include <type_traits>
        -
        23 
        -
        24 #if defined(BOOST_CLANG)
        -
        25 #pragma clang diagnostic push
        -
        26 #pragma clang diagnostic ignored "-Wunknown-pragmas"
        -
        27 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
        -
        28 #endif
        -
        29 
        -
        30 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        31 #pragma GCC diagnostic push
        -
        32 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        -
        33 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
        -
        34 #endif
        -
        35 
        -
        36 namespace boost { namespace gil {
        -
        37 
        -
        41 
        -
        45 
        -
        49 
        -
        103 template <typename Loc>
        - -
        105 {
        -
        106  void constraints()
        -
        107  {
        -
        108  gil_function_requires<Regular<Loc>>();
        -
        109 
        -
        110  // TODO: Should these be concept-checked instead of ignored? --mloskot
        -
        111 
        -
        112  using value_type = typename Loc::value_type;
        -
        113  ignore_unused_variable_warning(value_type{});
        -
        114 
        -
        115  // result of dereferencing
        -
        116  using reference = typename Loc::reference;
        -
        117  //ignore_unused_variable_warning(reference{});
        -
        118 
        -
        119  // result of operator-(pixel_locator, pixel_locator)
        -
        120  using difference_type = typename Loc::difference_type;
        -
        121  ignore_unused_variable_warning(difference_type{});
        -
        122 
        -
        123  // type used to store relative location (to allow for more efficient repeated access)
        -
        124  using cached_location_t = typename Loc::cached_location_t;
        -
        125  ignore_unused_variable_warning(cached_location_t{});
        -
        126 
        -
        127  // same as this type, but over const values
        -
        128  using const_t = typename Loc::const_t;
        -
        129  ignore_unused_variable_warning(const_t{});
        -
        130 
        -
        131  // same as difference_type
        -
        132  using point_t = typename Loc::point_t;
        -
        133  ignore_unused_variable_warning(point_t{});
        -
        134 
        -
        135  static std::size_t const N = Loc::num_dimensions; ignore_unused_variable_warning(N);
        -
        136 
        -
        137  using first_it_type = typename Loc::template axis<0>::iterator;
        -
        138  using last_it_type = typename Loc::template axis<N-1>::iterator;
        -
        139  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
        -
        140  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
        -
        141 
        -
        142  // point_t must be an N-dimensional point, each dimension of which must
        -
        143  // have the same type as difference_type of the corresponding iterator
        -
        144  gil_function_requires<PointNDConcept<point_t>>();
        -
        145  static_assert(point_t::num_dimensions == N, "");
        -
        146  static_assert(std::is_same
        -
        147  <
        -
        148  typename std::iterator_traits<first_it_type>::difference_type,
        -
        149  typename point_t::template axis<0>::coord_t
        -
        150  >::value, "");
        -
        151  static_assert(std::is_same
        -
        152  <
        -
        153  typename std::iterator_traits<last_it_type>::difference_type,
        -
        154  typename point_t::template axis<N-1>::coord_t
        -
        155  >::value, "");
        -
        156 
        -
        157  difference_type d;
        -
        158  loc += d;
        -
        159  loc -= d;
        -
        160  loc = loc + d;
        -
        161  loc = loc - d;
        -
        162  reference r1 = loc[d]; ignore_unused_variable_warning(r1);
        -
        163  reference r2 = *loc; ignore_unused_variable_warning(r2);
        -
        164  cached_location_t cl = loc.cache_location(d); ignore_unused_variable_warning(cl);
        -
        165  reference r3 = loc[d]; ignore_unused_variable_warning(r3);
        -
        166 
        -
        167  first_it_type fi = loc.template axis_iterator<0>();
        -
        168  fi = loc.template axis_iterator<0>(d);
        -
        169  last_it_type li = loc.template axis_iterator<N-1>();
        -
        170  li = loc.template axis_iterator<N-1>(d);
        -
        171 
        -
        172  using deref_t = PixelDereferenceAdaptorArchetype<typename Loc::value_type>;
        -
        173  using dtype = typename Loc::template add_deref<deref_t>::type;
        -
        174  // TODO: infinite recursion - FIXME?
        -
        175  //gil_function_requires<RandomAccessNDLocatorConcept<dtype>>();
        -
        176  }
        -
        177  Loc loc;
        -
        178 };
        -
        179 
        -
        220 template <typename Loc>
        - -
        222 {
        -
        223  void constraints()
        -
        224  {
        -
        225  gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
        -
        226  static_assert(Loc::num_dimensions == 2, "");
        -
        227 
        -
        228  using dynamic_x_step_t = typename dynamic_x_step_type<Loc>::type;
        -
        229  using dynamic_y_step_t = typename dynamic_y_step_type<Loc>::type;
        -
        230  using transposed_t = typename transposed_type<Loc>::type;
        -
        231 
        -
        232  using cached_location_t = typename Loc::cached_location_t;
        -
        233  gil_function_requires<Point2DConcept<typename Loc::point_t>>();
        -
        234 
        -
        235  using x_iterator = typename Loc::x_iterator;
        -
        236  using y_iterator = typename Loc::y_iterator;
        -
        237  using x_coord_t = typename Loc::x_coord_t;
        -
        238  using y_coord_t = typename Loc::y_coord_t;
        -
        239 
        -
        240  x_coord_t xd = 0; ignore_unused_variable_warning(xd);
        -
        241  y_coord_t yd = 0; ignore_unused_variable_warning(yd);
        -
        242 
        -
        243  typename Loc::difference_type d;
        -
        244  typename Loc::reference r=loc(xd,yd); ignore_unused_variable_warning(r);
        -
        245 
        -
        246  dynamic_x_step_t loc2(dynamic_x_step_t(), yd);
        -
        247  dynamic_x_step_t loc3(dynamic_x_step_t(), xd, yd);
        -
        248 
        -
        249  using dynamic_xy_step_transposed_t = typename dynamic_y_step_type
        -
        250  <
        - -
        252  >::type;
        -
        253  dynamic_xy_step_transposed_t loc4(loc, xd,yd,true);
        -
        254 
        -
        255  bool is_contiguous = loc.is_1d_traversable(xd);
        -
        256  ignore_unused_variable_warning(is_contiguous);
        -
        257 
        -
        258  loc.y_distance_to(loc, xd);
        -
        259 
        -
        260  loc = loc.xy_at(d);
        -
        261  loc = loc.xy_at(xd, yd);
        -
        262 
        -
        263  x_iterator xit = loc.x_at(d);
        -
        264  xit = loc.x_at(xd, yd);
        -
        265  xit = loc.x();
        -
        266 
        -
        267  y_iterator yit = loc.y_at(d);
        -
        268  yit = loc.y_at(xd, yd);
        -
        269  yit = loc.y();
        -
        270 
        -
        271  cached_location_t cl = loc.cache_location(xd, yd);
        -
        272  ignore_unused_variable_warning(cl);
        -
        273  }
        -
        274  Loc loc;
        -
        275 };
        -
        276 
        -
        290 template <typename Loc>
        - -
        292 {
        -
        293  void constraints()
        -
        294  {
        -
        295  gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
        -
        296  gil_function_requires<PixelIteratorConcept<typename Loc::x_iterator>>();
        -
        297  gil_function_requires<PixelIteratorConcept<typename Loc::y_iterator>>();
        -
        298  using coord_t = typename Loc::coord_t;
        -
        299  static_assert(std::is_same<typename Loc::x_coord_t, typename Loc::y_coord_t>::value, "");
        -
        300  }
        -
        301  Loc loc;
        -
        302 };
        -
        303 
        -
        304 namespace detail {
        -
        305 
        -
        307 template <typename Loc>
        - -
        309 {
        -
        310  void constraints()
        -
        311  {
        -
        312  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        -
        313  <
        -
        314  typename Loc::template axis<0>::iterator
        -
        315  >>();
        -
        316  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        -
        317  <
        -
        318  typename Loc::template axis<Loc::num_dimensions-1>::iterator
        -
        319  >>();
        -
        320 
        -
        321  typename Loc::difference_type d; initialize_it(d);
        -
        322  typename Loc::value_type v; initialize_it(v);
        -
        323  typename Loc::cached_location_t cl = loc.cache_location(d);
        -
        324  *loc = v;
        -
        325  loc[d] = v;
        -
        326  loc[cl] = v;
        -
        327  }
        -
        328  Loc loc;
        -
        329 };
        -
        330 
        -
        331 // \tparam Loc Models RandomAccess2DLocatorConcept
        -
        332 template <typename Loc>
        -
        333 struct RandomAccess2DLocatorIsMutableConcept
        -
        334 {
        -
        335  void constraints()
        -
        336  {
        -
        337  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
        -
        338  typename Loc::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
        -
        339  typename Loc::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
        -
        340  typename Loc::value_type v; initialize_it(v);
        -
        341  loc(xd, yd) = v;
        -
        342  }
        -
        343  Loc loc;
        -
        344 };
        -
        345 
        -
        346 } // namespace detail
        -
        347 
        -
        357 template <typename Loc>
        - -
        359 {
        -
        360  void constraints()
        -
        361  {
        -
        362  gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
        -
        363  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
        -
        364  }
        -
        365 };
        -
        366 
        -
        374 template <typename Loc>
        - -
        376 {
        -
        377  void constraints()
        -
        378  {
        -
        379  gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
        -
        380  gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
        -
        381  }
        -
        382 };
        -
        383 
        -
        391 template <typename Loc>
        - -
        393 {
        -
        394  void constraints()
        -
        395  {
        -
        396  gil_function_requires<PixelLocatorConcept<Loc>>();
        -
        397  gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
        -
        398  }
        -
        399 };
        -
        400 
        -
        401 }} // namespace boost::gil
        -
        402 
        -
        403 #if defined(BOOST_CLANG)
        -
        404 #pragma clang diagnostic pop
        -
        405 #endif
        -
        406 
        -
        407 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        -
        408 #pragma GCC diagnostic pop
        -
        409 #endif
        -
        410 
        -
        411 #endif
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP
        +
        9#define BOOST_GIL_CONCEPTS_PIXEL_LOCATOR_HPP
        +
        10
        +
        11#include <boost/gil/concepts/basic.hpp>
        +
        12#include <boost/gil/concepts/concept_check.hpp>
        +
        13#include <boost/gil/concepts/fwd.hpp>
        +
        14#include <boost/gil/concepts/pixel.hpp>
        +
        15#include <boost/gil/concepts/pixel_dereference.hpp>
        +
        16#include <boost/gil/concepts/pixel_iterator.hpp>
        +
        17#include <boost/gil/concepts/point.hpp>
        +
        18#include <boost/gil/concepts/detail/utility.hpp>
        +
        19
        +
        20#include <cstddef>
        +
        21#include <iterator>
        +
        22#include <type_traits>
        +
        23
        +
        24#if defined(BOOST_CLANG)
        +
        25#pragma clang diagnostic push
        +
        26#pragma clang diagnostic ignored "-Wunknown-pragmas"
        +
        27#pragma clang diagnostic ignored "-Wunused-local-typedefs"
        +
        28#endif
        +
        29
        +
        30#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        31#pragma GCC diagnostic push
        +
        32#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
        +
        33#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
        +
        34#endif
        +
        35
        +
        36namespace boost { namespace gil {
        +
        37
        +
        41
        +
        45
        +
        49
        +
        103template <typename Loc>
        +
        + +
        105{
        +
        106 void constraints()
        +
        107 {
        +
        108 gil_function_requires<Regular<Loc>>();
        +
        109
        +
        110 // TODO: Should these be concept-checked instead of ignored? --mloskot
        +
        111
        +
        112 using value_type = typename Loc::value_type;
        +
        113 ignore_unused_variable_warning(value_type{});
        +
        114
        +
        115 // result of dereferencing
        +
        116 using reference = typename Loc::reference;
        +
        117 //ignore_unused_variable_warning(reference{});
        +
        118
        +
        119 // result of operator-(pixel_locator, pixel_locator)
        +
        120 using difference_type = typename Loc::difference_type;
        +
        121 ignore_unused_variable_warning(difference_type{});
        +
        122
        +
        123 // type used to store relative location (to allow for more efficient repeated access)
        +
        124 using cached_location_t = typename Loc::cached_location_t;
        +
        125 ignore_unused_variable_warning(cached_location_t{});
        +
        126
        +
        127 // same as this type, but over const values
        +
        128 using const_t = typename Loc::const_t;
        +
        129 ignore_unused_variable_warning(const_t{});
        +
        130
        +
        131 // same as difference_type
        +
        132 using point_t = typename Loc::point_t;
        +
        133 ignore_unused_variable_warning(point_t{});
        +
        134
        +
        135 static std::size_t const N = Loc::num_dimensions; ignore_unused_variable_warning(N);
        +
        136
        +
        137 using first_it_type = typename Loc::template axis<0>::iterator;
        +
        138 using last_it_type = typename Loc::template axis<N-1>::iterator;
        +
        139 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type>>();
        +
        140 gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type>>();
        +
        141
        +
        142 // point_t must be an N-dimensional point, each dimension of which must
        +
        143 // have the same type as difference_type of the corresponding iterator
        +
        144 gil_function_requires<PointNDConcept<point_t>>();
        +
        145 static_assert(point_t::num_dimensions == N, "");
        +
        146 static_assert(std::is_same
        +
        147 <
        +
        148 typename std::iterator_traits<first_it_type>::difference_type,
        +
        149 typename point_t::template axis<0>::coord_t
        +
        150 >::value, "");
        +
        151 static_assert(std::is_same
        +
        152 <
        +
        153 typename std::iterator_traits<last_it_type>::difference_type,
        +
        154 typename point_t::template axis<N-1>::coord_t
        +
        155 >::value, "");
        +
        156
        +
        157 difference_type d;
        +
        158 loc += d;
        +
        159 loc -= d;
        +
        160 loc = loc + d;
        +
        161 loc = loc - d;
        +
        162 reference r1 = loc[d]; ignore_unused_variable_warning(r1);
        +
        163 reference r2 = *loc; ignore_unused_variable_warning(r2);
        +
        164 cached_location_t cl = loc.cache_location(d); ignore_unused_variable_warning(cl);
        +
        165 reference r3 = loc[d]; ignore_unused_variable_warning(r3);
        +
        166
        +
        167 first_it_type fi = loc.template axis_iterator<0>();
        +
        168 fi = loc.template axis_iterator<0>(d);
        +
        169 last_it_type li = loc.template axis_iterator<N-1>();
        +
        170 li = loc.template axis_iterator<N-1>(d);
        +
        171
        +
        172 using deref_t = PixelDereferenceAdaptorArchetype<typename Loc::value_type>;
        +
        173 using dtype = typename Loc::template add_deref<deref_t>::type;
        +
        174 // TODO: infinite recursion - FIXME?
        +
        175 //gil_function_requires<RandomAccessNDLocatorConcept<dtype>>();
        +
        176 }
        +
        177 Loc loc;
        +
        178};
        +
        +
        179
        +
        220template <typename Loc>
        +
        + +
        222{
        +
        223 void constraints()
        +
        224 {
        +
        225 gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
        +
        226 static_assert(Loc::num_dimensions == 2, "");
        +
        227
        +
        228 using dynamic_x_step_t = typename dynamic_x_step_type<Loc>::type;
        +
        229 using dynamic_y_step_t = typename dynamic_y_step_type<Loc>::type;
        +
        230 using transposed_t = typename transposed_type<Loc>::type;
        +
        231
        +
        232 using cached_location_t = typename Loc::cached_location_t;
        +
        233 gil_function_requires<Point2DConcept<typename Loc::point_t>>();
        +
        234
        +
        235 using x_iterator = typename Loc::x_iterator;
        +
        236 using y_iterator = typename Loc::y_iterator;
        +
        237 using x_coord_t = typename Loc::x_coord_t;
        +
        238 using y_coord_t = typename Loc::y_coord_t;
        +
        239
        +
        240 x_coord_t xd = 0; ignore_unused_variable_warning(xd);
        +
        241 y_coord_t yd = 0; ignore_unused_variable_warning(yd);
        +
        242
        +
        243 typename Loc::difference_type d;
        +
        244 typename Loc::reference r=loc(xd,yd); ignore_unused_variable_warning(r);
        +
        245
        +
        246 dynamic_x_step_t loc2(dynamic_x_step_t(), yd);
        +
        247 dynamic_x_step_t loc3(dynamic_x_step_t(), xd, yd);
        +
        248
        +
        249 using dynamic_xy_step_transposed_t = typename dynamic_y_step_type
        +
        250 <
        + +
        252 >::type;
        +
        253 dynamic_xy_step_transposed_t loc4(loc, xd,yd,true);
        +
        254
        +
        255 bool is_contiguous = loc.is_1d_traversable(xd);
        +
        256 ignore_unused_variable_warning(is_contiguous);
        +
        257
        +
        258 loc.y_distance_to(loc, xd);
        +
        259
        +
        260 loc = loc.xy_at(d);
        +
        261 loc = loc.xy_at(xd, yd);
        +
        262
        +
        263 x_iterator xit = loc.x_at(d);
        +
        264 xit = loc.x_at(xd, yd);
        +
        265 xit = loc.x();
        +
        266
        +
        267 y_iterator yit = loc.y_at(d);
        +
        268 yit = loc.y_at(xd, yd);
        +
        269 yit = loc.y();
        +
        270
        +
        271 cached_location_t cl = loc.cache_location(xd, yd);
        +
        272 ignore_unused_variable_warning(cl);
        +
        273 }
        +
        274 Loc loc;
        +
        275};
        +
        +
        276
        +
        290template <typename Loc>
        +
        + +
        292{
        +
        293 void constraints()
        +
        294 {
        +
        295 gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
        +
        296 gil_function_requires<PixelIteratorConcept<typename Loc::x_iterator>>();
        +
        297 gil_function_requires<PixelIteratorConcept<typename Loc::y_iterator>>();
        +
        298 using coord_t = typename Loc::coord_t;
        +
        299 static_assert(std::is_same<typename Loc::x_coord_t, typename Loc::y_coord_t>::value, "");
        +
        300 }
        +
        301 Loc loc;
        +
        302};
        +
        +
        303
        +
        304namespace detail {
        +
        305
        +
        307template <typename Loc>
        +
        + +
        309{
        +
        310 void constraints()
        +
        311 {
        +
        312 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        +
        313 <
        +
        314 typename Loc::template axis<0>::iterator
        +
        315 >>();
        +
        316 gil_function_requires<detail::RandomAccessIteratorIsMutableConcept
        +
        317 <
        +
        318 typename Loc::template axis<Loc::num_dimensions-1>::iterator
        +
        319 >>();
        +
        320
        +
        321 typename Loc::difference_type d; initialize_it(d);
        +
        322 typename Loc::value_type v; initialize_it(v);
        +
        323 typename Loc::cached_location_t cl = loc.cache_location(d);
        +
        324 *loc = v;
        +
        325 loc[d] = v;
        +
        326 loc[cl] = v;
        +
        327 }
        +
        328 Loc loc;
        +
        329};
        +
        +
        330
        +
        331// \tparam Loc Models RandomAccess2DLocatorConcept
        +
        332template <typename Loc>
        +
        333struct RandomAccess2DLocatorIsMutableConcept
        +
        334{
        +
        335 void constraints()
        +
        336 {
        +
        337 gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
        +
        338 typename Loc::x_coord_t xd = 0; ignore_unused_variable_warning(xd);
        +
        339 typename Loc::y_coord_t yd = 0; ignore_unused_variable_warning(yd);
        +
        340 typename Loc::value_type v; initialize_it(v);
        +
        341 loc(xd, yd) = v;
        +
        342 }
        +
        343 Loc loc;
        +
        344};
        +
        345
        +
        346} // namespace detail
        +
        347
        +
        357template <typename Loc>
        +
        + +
        359{
        +
        360 void constraints()
        +
        361 {
        +
        362 gil_function_requires<RandomAccessNDLocatorConcept<Loc>>();
        +
        363 gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc>>();
        +
        364 }
        +
        365};
        +
        +
        366
        +
        374template <typename Loc>
        +
        + +
        376{
        +
        377 void constraints()
        +
        378 {
        +
        379 gil_function_requires<RandomAccess2DLocatorConcept<Loc>>();
        +
        380 gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
        +
        381 }
        +
        382};
        +
        +
        383
        +
        391template <typename Loc>
        +
        + +
        393{
        +
        394 void constraints()
        +
        395 {
        +
        396 gil_function_requires<PixelLocatorConcept<Loc>>();
        +
        397 gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc>>();
        +
        398 }
        +
        399};
        +
        +
        400
        +
        401}} // namespace boost::gil
        +
        402
        +
        403#if defined(BOOST_CLANG)
        +
        404#pragma clang diagnostic pop
        +
        405#endif
        +
        406
        +
        407#if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
        +
        408#pragma GCC diagnostic pop
        +
        409#endif
        +
        410
        +
        411#endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        GIL's 2-dimensional locator over mutable GIL pixels.
        Definition: pixel_locator.hpp:393
        -
        2-dimensional locator over mutable pixels
        Definition: pixel_locator.hpp:376
        -
        N-dimensional locator over mutable pixels.
        Definition: pixel_locator.hpp:359
        -
        GIL's 2-dimensional locator over immutable GIL pixels.
        Definition: pixel_locator.hpp:292
        -
        2-dimensional locator over immutable values
        Definition: pixel_locator.hpp:222
        -
        N-dimensional locator over immutable values.
        Definition: pixel_locator.hpp:105
        - -
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition: dynamic_step.hpp:17
        -
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition: dynamic_step.hpp:21
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        GIL's 2-dimensional locator over mutable GIL pixels.
        Definition pixel_locator.hpp:393
        +
        2-dimensional locator over mutable pixels
        Definition pixel_locator.hpp:376
        +
        N-dimensional locator over mutable pixels.
        Definition pixel_locator.hpp:359
        +
        GIL's 2-dimensional locator over immutable GIL pixels.
        Definition pixel_locator.hpp:292
        +
        2-dimensional locator over immutable values
        Definition pixel_locator.hpp:222
        +
        N-dimensional locator over immutable values.
        Definition pixel_locator.hpp:105
        + +
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition dynamic_step.hpp:17
        +
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition dynamic_step.hpp:21
        diff --git a/html/reference/pixel__numeric__operations_8hpp_source.html b/html/reference/pixel__numeric__operations_8hpp_source.html index 5e6f7a086..a287f8ca0 100644 --- a/html/reference/pixel__numeric__operations_8hpp_source.html +++ b/html/reference/pixel__numeric__operations_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pixel_numeric_operations.hpp Source File @@ -27,232 +27,255 @@

        - + +/* @license-end */ + +
        -
        -
        pixel_numeric_operations.hpp
        +
        pixel_numeric_operations.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 // Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        -
        4 //
        -
        5 // Distributed under the Boost Software License, Version 1.0
        -
        6 // See accompanying file LICENSE_1_0.txt or copy at
        -
        7 // http://www.boost.org/LICENSE_1_0.txt
        -
        8 //
        -
        9 #ifndef BOOST_GIL_PIXEL_NUMERIC_OPERATIONS_HPP
        -
        10 #define BOOST_GIL_PIXEL_NUMERIC_OPERATIONS_HPP
        -
        11 
        -
        12 #include <boost/gil/color_base_algorithm.hpp>
        -
        13 #include <boost/gil/pixel.hpp>
        -
        14 #include <boost/gil/channel_numeric_operations.hpp>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        18 // Function objects and utilities for pixel-wise numeric operations.
        -
        19 //
        -
        20 // List of currently defined functors:
        -
        21 // pixel_plus_t (+)
        -
        22 // pixel_minus_t (-)
        -
        23 // pixel_multiplies_scalar_t (*s)
        -
        24 // pixel_multiplies_t (*)
        -
        25 // pixel_divides_scalar_t (/s)
        -
        26 // pixel_divides_t (/)
        -
        27 // pixel_halves_t (/=2),
        -
        28 // pixel_zeros_t (=0)
        -
        29 // pixel_assigns_t (=)
        -
        30 
        -
        36 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        - -
        38 {
        -
        39  auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        -
        40  {
        -
        41  PixelResult result;
        -
        42  static_transform(p1, p2, result,
        - -
        44  <
        - - - -
        48  >());
        -
        49  return result;
        -
        50  }
        -
        51 };
        -
        52 
        -
        58 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        - -
        60 {
        -
        61  auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        -
        62  {
        -
        63  PixelResult result;
        -
        64  static_transform(p1, p2, result,
        - -
        66  <
        - - - -
        70  >());
        -
        71  return result;
        -
        72  }
        -
        73 };
        -
        74 
        -
        80 template <typename PixelRef, typename Scalar, typename PixelResult>
        - -
        82 {
        -
        83  auto operator()(PixelRef const& p, Scalar const& s) const -> PixelResult
        -
        84  {
        -
        85  PixelResult result;
        -
        86  static_transform(p, result,
        -
        87  std::bind(
        - -
        89  Scalar,
        - -
        91  std::placeholders::_1, s));
        -
        92  return result;
        -
        93  }
        -
        94 };
        -
        95 
        -
        101 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        - -
        103 {
        -
        104  auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        -
        105  {
        -
        106  PixelResult result;
        -
        107  static_transform(p1, p2, result,
        - -
        109  <
        - - - -
        113  >());
        -
        114  return result;
        -
        115  }
        -
        116 };
        -
        117 
        -
        118 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        - -
        120 
        -
        126 template <typename PixelRef, typename Scalar, typename PixelResult>
        - -
        128 {
        -
        129  auto operator()(PixelRef const& p, Scalar const& s) const -> PixelResult
        -
        130  {
        -
        131  PixelResult result;
        -
        132  static_transform(p, result,
        - -
        134  Scalar,
        - -
        136  std::placeholders::_1, s));
        -
        137  return result;
        -
        138  }
        -
        139 };
        -
        140 
        -
        146 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        - -
        148 {
        -
        149  auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        -
        150  {
        -
        151  PixelResult result;
        -
        152  static_transform(p1, p2, result,
        - -
        154  <
        - - - -
        158  >());
        -
        159  return result;
        -
        160  }
        -
        161 };
        -
        162 
        -
        163 template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        - -
        165 
        -
        169 template <typename PixelRef>
        - -
        171 {
        -
        172  auto operator()(PixelRef& p) const -> PixelRef&
        -
        173  {
        -
        174  static_for_each(p, channel_halves_t<typename channel_type<PixelRef>::type>());
        -
        175  return p;
        -
        176  }
        -
        177 };
        -
        178 
        -
        182 template <typename PixelRef>
        - -
        184 {
        -
        185  auto operator()(PixelRef& p) const -> PixelRef&
        -
        186  {
        -
        187  static_for_each(p, channel_zeros_t<typename channel_type<PixelRef>::type>());
        -
        188  return p;
        -
        189  }
        -
        190 };
        -
        191 
        -
        194 template <typename Pixel>
        -
        195 void zero_channels(Pixel& p)
        -
        196 {
        -
        197  static_for_each(p, channel_zeros_t<typename channel_type<Pixel>::type>());
        -
        198 }
        -
        199 
        -
        208 template <typename PixelRef, typename PixelResult>
        - -
        210 {
        -
        211  auto operator()(PixelRef const& src, PixelResult& dst) const -> PixelResult
        -
        212  {
        -
        213  static_for_each(src, dst,
        - -
        215  <
        - - -
        218  >());
        -
        219  return dst;
        -
        220  }
        -
        221 };
        -
        222 
        -
        223 }} // namespace boost::gil
        -
        224 
        -
        225 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: channel_numeric_operations.hpp:236
        -
        Arithmetic operation of dividing channel value by scalar.
        Definition: channel_numeric_operations.hpp:182
        -
        Arithmetic operation of division of two channel values.
        Definition: channel_numeric_operations.hpp:99
        -
        Arithmetic operation of dividing channel value by 2.
        Definition: channel_numeric_operations.hpp:203
        -
        Arithmetic operation of subtraction of two channel values.
        Definition: channel_numeric_operations.hpp:57
        -
        Arithmetic operation of channel value by a scalar.
        Definition: channel_numeric_operations.hpp:161
        -
        Arithmetic operation of multiplication of two channel values.
        Definition: channel_numeric_operations.hpp:78
        -
        Arithmetic operation of addition of two channel values.
        Definition: channel_numeric_operations.hpp:36
        -
        Definition: color_convert.hpp:31
        -
        Operation of setting channel value to zero.
        Definition: channel_numeric_operations.hpp:221
        -
        Casts and assigns a pixel to another.
        Definition: pixel_numeric_operations.hpp:210
        -
        Performs channel-wise division of pixel elements by scalar.
        Definition: pixel_numeric_operations.hpp:128
        -
        Performs channel-wise division of two pixels.
        Definition: pixel_numeric_operations.hpp:148
        -
        Performs channel-wise division by 2.
        Definition: pixel_numeric_operations.hpp:171
        -
        Performs channel-wise subtraction of two pixels.
        Definition: pixel_numeric_operations.hpp:60
        -
        Performs channel-wise multiplication of pixel elements by scalar.
        Definition: pixel_numeric_operations.hpp:82
        -
        Performs channel-wise multiplication of two pixels.
        Definition: pixel_numeric_operations.hpp:103
        -
        Performs channel-wise addition of two pixels.
        Definition: pixel_numeric_operations.hpp:38
        -
        Sets pixel elements to zero (for whatever zero means)
        Definition: pixel_numeric_operations.hpp:184
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3// Copyright 2021 Pranam Lashkari <plashkari628@gmail.com>
        +
        4//
        +
        5// Distributed under the Boost Software License, Version 1.0
        +
        6// See accompanying file LICENSE_1_0.txt or copy at
        +
        7// http://www.boost.org/LICENSE_1_0.txt
        +
        8//
        +
        9#ifndef BOOST_GIL_PIXEL_NUMERIC_OPERATIONS_HPP
        +
        10#define BOOST_GIL_PIXEL_NUMERIC_OPERATIONS_HPP
        +
        11
        +
        12#include <boost/gil/color_base_algorithm.hpp>
        +
        13#include <boost/gil/pixel.hpp>
        +
        14#include <boost/gil/channel_numeric_operations.hpp>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        18// Function objects and utilities for pixel-wise numeric operations.
        +
        19//
        +
        20// List of currently defined functors:
        +
        21// pixel_plus_t (+)
        +
        22// pixel_minus_t (-)
        +
        23// pixel_multiplies_scalar_t (*s)
        +
        24// pixel_multiplies_t (*)
        +
        25// pixel_divides_scalar_t (/s)
        +
        26// pixel_divides_t (/)
        +
        27// pixel_halves_t (/=2),
        +
        28// pixel_zeros_t (=0)
        +
        29// pixel_assigns_t (=)
        +
        30
        +
        36template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        +
        + +
        38{
        +
        39 auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        +
        40 {
        +
        41 PixelResult result;
        +
        42 static_transform(p1, p2, result,
        + +
        44 <
        + + + +
        48 >());
        +
        49 return result;
        +
        50 }
        +
        51};
        +
        +
        52
        +
        58template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        +
        + +
        60{
        +
        61 auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        +
        62 {
        +
        63 PixelResult result;
        +
        64 static_transform(p1, p2, result,
        + +
        66 <
        + + + +
        70 >());
        +
        71 return result;
        +
        72 }
        +
        73};
        +
        +
        74
        +
        80template <typename PixelRef, typename Scalar, typename PixelResult>
        +
        + +
        82{
        +
        83 auto operator()(PixelRef const& p, Scalar const& s) const -> PixelResult
        +
        84 {
        +
        85 PixelResult result;
        +
        86 static_transform(p, result,
        +
        87 std::bind(
        + +
        89 Scalar,
        + +
        91 std::placeholders::_1, s));
        +
        92 return result;
        +
        93 }
        +
        94};
        +
        +
        95
        +
        101template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        +
        + +
        103{
        +
        104 auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        +
        105 {
        +
        106 PixelResult result;
        +
        107 static_transform(p1, p2, result,
        + +
        109 <
        + + + +
        113 >());
        +
        114 return result;
        +
        115 }
        +
        116};
        +
        +
        117
        +
        118template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        + +
        120
        +
        126template <typename PixelRef, typename Scalar, typename PixelResult>
        +
        + +
        128{
        +
        129 auto operator()(PixelRef const& p, Scalar const& s) const -> PixelResult
        +
        130 {
        +
        131 PixelResult result;
        +
        132 static_transform(p, result,
        + +
        134 Scalar,
        + +
        136 std::placeholders::_1, s));
        +
        137 return result;
        +
        138 }
        +
        139};
        +
        +
        140
        +
        146template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        +
        + +
        148{
        +
        149 auto operator()(PixelRef1 const& p1, PixelRef2 const& p2) const -> PixelResult
        +
        150 {
        +
        151 PixelResult result;
        +
        152 static_transform(p1, p2, result,
        + +
        154 <
        + + + +
        158 >());
        +
        159 return result;
        +
        160 }
        +
        161};
        +
        +
        162
        +
        163template <typename PixelRef1, typename PixelRef2, typename PixelResult>
        + +
        165
        +
        169template <typename PixelRef>
        +
        + +
        171{
        +
        172 auto operator()(PixelRef& p) const -> PixelRef&
        +
        173 {
        +
        174 static_for_each(p, channel_halves_t<typename channel_type<PixelRef>::type>());
        +
        175 return p;
        +
        176 }
        +
        177};
        +
        +
        178
        +
        182template <typename PixelRef>
        +
        + +
        184{
        +
        185 auto operator()(PixelRef& p) const -> PixelRef&
        +
        186 {
        +
        187 static_for_each(p, channel_zeros_t<typename channel_type<PixelRef>::type>());
        +
        188 return p;
        +
        189 }
        +
        190};
        +
        +
        191
        +
        194template <typename Pixel>
        +
        195void zero_channels(Pixel& p)
        +
        196{
        +
        197 static_for_each(p, channel_zeros_t<typename channel_type<Pixel>::type>());
        +
        198}
        +
        199
        +
        208template <typename PixelRef, typename PixelResult>
        +
        + +
        210{
        +
        211 auto operator()(PixelRef const& src, PixelResult& dst) const -> PixelResult
        +
        212 {
        +
        213 static_for_each(src, dst,
        + +
        215 <
        + + +
        218 >());
        +
        219 return dst;
        +
        220 }
        +
        221};
        +
        +
        222
        +
        223}} // namespace boost::gil
        +
        224
        +
        225#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition channel_numeric_operations.hpp:236
        +
        Arithmetic operation of dividing channel value by scalar.
        Definition channel_numeric_operations.hpp:182
        +
        Arithmetic operation of division of two channel values.
        Definition channel_numeric_operations.hpp:99
        +
        Arithmetic operation of dividing channel value by 2.
        Definition channel_numeric_operations.hpp:203
        +
        Arithmetic operation of subtraction of two channel values.
        Definition channel_numeric_operations.hpp:57
        +
        Arithmetic operation of channel value by a scalar.
        Definition channel_numeric_operations.hpp:161
        +
        Arithmetic operation of multiplication of two channel values.
        Definition channel_numeric_operations.hpp:78
        +
        Arithmetic operation of addition of two channel values.
        Definition channel_numeric_operations.hpp:36
        +
        Definition color_convert.hpp:31
        +
        Operation of setting channel value to zero.
        Definition channel_numeric_operations.hpp:221
        +
        Casts and assigns a pixel to another.
        Definition pixel_numeric_operations.hpp:210
        +
        Performs channel-wise division of pixel elements by scalar.
        Definition pixel_numeric_operations.hpp:128
        +
        Performs channel-wise division of two pixels.
        Definition pixel_numeric_operations.hpp:148
        +
        Performs channel-wise division by 2.
        Definition pixel_numeric_operations.hpp:171
        +
        Performs channel-wise subtraction of two pixels.
        Definition pixel_numeric_operations.hpp:60
        +
        Performs channel-wise multiplication of pixel elements by scalar.
        Definition pixel_numeric_operations.hpp:82
        +
        Performs channel-wise multiplication of two pixels.
        Definition pixel_numeric_operations.hpp:103
        +
        Performs channel-wise addition of two pixels.
        Definition pixel_numeric_operations.hpp:38
        +
        Sets pixel elements to zero (for whatever zero means)
        Definition pixel_numeric_operations.hpp:184
        diff --git a/html/reference/planar__pixel__iterator_8hpp_source.html b/html/reference/planar__pixel__iterator_8hpp_source.html index c6df5d601..89719c86f 100644 --- a/html/reference/planar__pixel__iterator_8hpp_source.html +++ b/html/reference/planar__pixel__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_iterator.hpp Source File @@ -27,270 +27,278 @@

        - + +/* @license-end */ + +
        -
        -
        planar_pixel_iterator.hpp
        +
        planar_pixel_iterator.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_PLANAR_PIXEL_ITERATOR_HPP
        -
        9 #define BOOST_GIL_PLANAR_PIXEL_ITERATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/pixel.hpp>
        -
        12 #include <boost/gil/step_iterator.hpp>
        -
        13 #include <boost/gil/detail/mp11.hpp>
        -
        14 
        -
        15 #include <boost/iterator/iterator_facade.hpp>
        -
        16 
        -
        17 #include <iterator>
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        22 //forward declaration (as this file is included in planar_pixel_reference.hpp)
        -
        23 template <typename ChannelReference, typename ColorSpace>
        -
        24 struct planar_pixel_reference;
        -
        25 
        -
        30 
        -
        34 
        -
        42 template <typename ChannelPtr, typename ColorSpace>
        - -
        44  :
        -
        45  iterator_facade
        -
        46  <
        -
        47  planar_pixel_iterator<ChannelPtr, ColorSpace>,
        -
        48  pixel<typename std::iterator_traits<ChannelPtr>::value_type,layout<ColorSpace>>,
        -
        49  std::random_access_iterator_tag,
        -
        50  planar_pixel_reference<typename std::iterator_traits<ChannelPtr>::reference, ColorSpace> const
        -
        51  >,
        -
        52  detail::homogeneous_color_base
        -
        53  <
        -
        54  ChannelPtr,
        -
        55  layout<ColorSpace>,
        -
        56  mp11::mp_size<ColorSpace>::value
        -
        57  >
        -
        58 {
        -
        59 private:
        -
        60  using parent_t = iterator_facade
        -
        61  <
        - - -
        64  std::random_access_iterator_tag,
        - -
        66  >;
        -
        67 
        -
        68  using color_base_parent_t = detail::homogeneous_color_base
        -
        69  <
        -
        70  ChannelPtr,
        - -
        72  mp11::mp_size<ColorSpace>::value
        -
        73  >;
        -
        74 
        -
        75  using channel_t = typename std::iterator_traits<ChannelPtr>::value_type;
        -
        76 
        -
        77 public:
        -
        78  using value_type = typename parent_t::value_type;
        -
        79  using reference = typename parent_t::reference;
        -
        80  using difference_type = typename parent_t::difference_type;
        -
        81 
        -
        82  planar_pixel_iterator() : color_base_parent_t(0) {}
        -
        83  planar_pixel_iterator(bool) {} // constructor that does not fill with zero (for performance)
        -
        84 
        -
        85  planar_pixel_iterator(const ChannelPtr& v0, const ChannelPtr& v1) : color_base_parent_t(v0,v1) {}
        -
        86  planar_pixel_iterator(const ChannelPtr& v0, const ChannelPtr& v1, const ChannelPtr& v2) : color_base_parent_t(v0,v1,v2) {}
        -
        87  planar_pixel_iterator(const ChannelPtr& v0, const ChannelPtr& v1, const ChannelPtr& v2, const ChannelPtr& v3) : color_base_parent_t(v0,v1,v2,v3) {}
        -
        88  planar_pixel_iterator(const ChannelPtr& v0, const ChannelPtr& v1, const ChannelPtr& v2, const ChannelPtr& v3, const ChannelPtr& v4) : color_base_parent_t(v0,v1,v2,v3,v4) {}
        -
        89 
        -
        90  template <typename IC1,typename C1>
        -
        91  planar_pixel_iterator(const planar_pixel_iterator<IC1,C1>& ptr) : color_base_parent_t(ptr) {}
        -
        92 
        -
        96  template <typename P>
        -
        97  planar_pixel_iterator(P* pix) : color_base_parent_t(pix, true) {
        -
        98  function_requires<PixelsCompatibleConcept<P,value_type> >();
        -
        99  }
        -
        100 
        -
        101  struct address_of { template <typename T> T* operator()(T& t) { return &t; } };
        -
        102  template <typename P>
        -
        103  planar_pixel_iterator& operator=(P* pix) {
        -
        104  function_requires<PixelsCompatibleConcept<P,value_type> >();
        -
        105  static_transform(*pix,*this, address_of());
        -
        106 
        -
        107  // PERFORMANCE_CHECK: Compare to this:
        -
        108  //this->template semantic_at_c<0>()=&pix->template semantic_at_c<0>();
        -
        109  //this->template semantic_at_c<1>()=&pix->template semantic_at_c<1>();
        -
        110  //this->template semantic_at_c<2>()=&pix->template semantic_at_c<2>();
        -
        111  return *this;
        -
        112  }
        -
        113 
        -
        116  reference operator[](difference_type d) const { return memunit_advanced_ref(*this,d*sizeof(channel_t));}
        -
        117 
        -
        118  reference operator->() const { return **this; }
        -
        119 
        -
        120  // PERFORMANCE_CHECK: Remove?
        -
        121  bool operator< (const planar_pixel_iterator& ptr) const { return gil::at_c<0>(*this)< gil::at_c<0>(ptr); }
        -
        122  bool operator!=(const planar_pixel_iterator& ptr) const { return gil::at_c<0>(*this)!=gil::at_c<0>(ptr); }
        -
        123 private:
        -
        124  friend class boost::iterator_core_access;
        -
        125 
        -
        126  void increment() { static_transform(*this,*this,detail::inc<ChannelPtr>()); }
        -
        127  void decrement() { static_transform(*this,*this,detail::dec<ChannelPtr>()); }
        -
        128  void advance(std::ptrdiff_t d){ static_transform(*this,*this,std::bind(detail::plus_asymmetric<ChannelPtr,std::ptrdiff_t>(),std::placeholders::_1,d)); }
        -
        129  reference dereference() const { return this->template deref<reference>(); }
        -
        130 
        -
        131  std::ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return gil::at_c<0>(it)-gil::at_c<0>(*this); }
        -
        132  bool equal(const planar_pixel_iterator& it) const { return gil::at_c<0>(*this)==gil::at_c<0>(it); }
        -
        133 };
        -
        134 
        -
        135 namespace detail {
        -
        136 template <typename I>
        -
        137 struct channel_iterator_is_mutable : std::true_type {};
        -
        138 
        -
        139 template <typename I>
        -
        140 struct channel_iterator_is_mutable<I const*> : std::false_type {};
        -
        141 
        -
        142 } // namespace detail
        -
        143 
        -
        144 template <typename IC, typename C>
        -
        145 struct const_iterator_type<planar_pixel_iterator<IC,C> > {
        -
        146 private:
        -
        147  using channel_t = typename std::iterator_traits<IC>::value_type;
        -
        148 public:
        -
        149  using type = planar_pixel_iterator<typename channel_traits<channel_t>::const_pointer,C>;
        -
        150 };
        -
        151 
        -
        152 // The default implementation when the iterator is a C pointer is to use the standard constness semantics
        -
        153 template <typename IC, typename C>
        -
        154 struct iterator_is_mutable<planar_pixel_iterator<IC,C> > : public detail::channel_iterator_is_mutable<IC> {};
        -
        155 
        -
        157 // ColorBasedConcept
        -
        159 
        -
        160 template <typename IC, typename C, int K>
        -
        161 struct kth_element_type<planar_pixel_iterator<IC, C>, K>
        -
        162 {
        -
        163  using type = IC;
        -
        164 };
        -
        165 
        -
        166 template <typename IC, typename C, int K>
        -
        167 struct kth_element_reference_type<planar_pixel_iterator<IC, C>, K>
        -
        168  : std::add_lvalue_reference<IC> {};
        -
        169 
        -
        170 template <typename IC, typename C, int K>
        -
        171 struct kth_element_const_reference_type<planar_pixel_iterator<IC, C>, K>
        -
        172  : std::add_lvalue_reference<typename std::add_const<IC>::type>
        -
        173 {};
        -
        174 
        -
        176 // HomogeneousPixelBasedConcept
        -
        178 
        -
        179 template <typename IC, typename C>
        -
        180 struct color_space_type<planar_pixel_iterator<IC,C>>
        -
        181 {
        -
        182  using type = C;
        -
        183 };
        -
        184 
        -
        185 template <typename IC, typename C>
        -
        186 struct channel_mapping_type<planar_pixel_iterator<IC, C>>
        -
        187  : channel_mapping_type<typename planar_pixel_iterator<IC,C>::value_type>
        -
        188 {};
        -
        189 
        -
        190 template <typename IC, typename C>
        -
        191 struct is_planar<planar_pixel_iterator<IC, C>> : std::true_type {};
        -
        192 
        -
        193 template <typename IC, typename C>
        -
        194 struct channel_type<planar_pixel_iterator<IC, C>>
        -
        195 {
        -
        196  using type = typename std::iterator_traits<IC>::value_type;
        -
        197 };
        -
        198 
        -
        200 // MemoryBasedIteratorConcept
        -
        202 
        -
        203 template <typename IC, typename C>
        -
        204 inline auto memunit_step(planar_pixel_iterator<IC,C> const&)
        -
        205  -> std::ptrdiff_t
        -
        206 {
        -
        207  return sizeof(typename std::iterator_traits<IC>::value_type);
        -
        208 }
        -
        209 
        -
        210 template <typename IC, typename C>
        -
        211 inline auto memunit_distance(planar_pixel_iterator<IC,C> const& p1, planar_pixel_iterator<IC,C> const& p2)
        -
        212  -> std::ptrdiff_t
        -
        213 {
        -
        214  return memunit_distance(gil::at_c<0>(p1),gil::at_c<0>(p2));
        -
        215 }
        -
        216 
        -
        217 template <typename IC>
        -
        218 struct memunit_advance_fn {
        -
        219  memunit_advance_fn(std::ptrdiff_t diff) : _diff(diff) {}
        -
        220  IC operator()(const IC& p) const { return memunit_advanced(p,_diff); }
        -
        221 
        -
        222  std::ptrdiff_t _diff;
        -
        223 };
        -
        224 
        -
        225 template <typename IC, typename C>
        -
        226 inline void memunit_advance(planar_pixel_iterator<IC,C>& p, std::ptrdiff_t diff) {
        -
        227  static_transform(p, p, memunit_advance_fn<IC>(diff));
        -
        228 }
        -
        229 
        -
        230 template <typename IC, typename C>
        -
        231 inline auto memunit_advanced(planar_pixel_iterator<IC,C> const& p, std::ptrdiff_t diff)
        -
        232  -> planar_pixel_iterator<IC,C>
        -
        233 {
        -
        234  planar_pixel_iterator<IC,C> ret=p;
        -
        235  memunit_advance(ret, diff);
        -
        236  return ret;
        -
        237 }
        -
        238 
        -
        239 template <typename ChannelPtr, typename ColorSpace>
        -
        240 inline auto memunit_advanced_ref(planar_pixel_iterator<ChannelPtr,ColorSpace> const& ptr, std::ptrdiff_t diff)
        -
        241  -> planar_pixel_reference<typename std::iterator_traits<ChannelPtr>::reference,ColorSpace>
        -
        242 {
        -
        243  return planar_pixel_reference<typename std::iterator_traits<ChannelPtr>::reference,ColorSpace>(ptr, diff);
        -
        244 }
        -
        245 
        -
        247 // HasDynamicXStepTypeConcept
        -
        249 
        -
        250 template <typename IC, typename C>
        -
        251 struct dynamic_x_step_type<planar_pixel_iterator<IC,C> > {
        -
        252  using type = memory_based_step_iterator<planar_pixel_iterator<IC,C>>;
        -
        253 };
        -
        254 } } // namespace boost::gil
        -
        255 
        -
        256 #endif
        -
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition: algorithm.hpp:1087
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:268
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: pixel.hpp:106
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: planar_pixel_iterator.hpp:58
        -
        reference operator[](difference_type d) const
        Definition: planar_pixel_iterator.hpp:116
        -
        planar_pixel_iterator(P *pix)
        Definition: planar_pixel_iterator.hpp:97
        -
        A reference proxy to a planar pixel.
        Definition: planar_pixel_reference.hpp:46
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_PLANAR_PIXEL_ITERATOR_HPP
        +
        9#define BOOST_GIL_PLANAR_PIXEL_ITERATOR_HPP
        +
        10
        +
        11#include <boost/gil/pixel.hpp>
        +
        12#include <boost/gil/step_iterator.hpp>
        +
        13#include <boost/gil/detail/mp11.hpp>
        +
        14
        +
        15#include <boost/iterator/iterator_facade.hpp>
        +
        16
        +
        17#include <iterator>
        +
        18#include <type_traits>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        22//forward declaration (as this file is included in planar_pixel_reference.hpp)
        +
        23template <typename ChannelReference, typename ColorSpace>
        +
        24struct planar_pixel_reference;
        +
        25
        +
        30
        +
        34
        +
        42template <typename ChannelPtr, typename ColorSpace>
        +
        + +
        44 :
        +
        45 iterator_facade
        +
        46 <
        +
        47 planar_pixel_iterator<ChannelPtr, ColorSpace>,
        +
        48 pixel<typename std::iterator_traits<ChannelPtr>::value_type,layout<ColorSpace>>,
        +
        49 std::random_access_iterator_tag,
        +
        50 planar_pixel_reference<typename std::iterator_traits<ChannelPtr>::reference, ColorSpace> const
        +
        51 >,
        +
        52 detail::homogeneous_color_base
        +
        53 <
        +
        54 ChannelPtr,
        +
        55 layout<ColorSpace>,
        +
        56 mp11::mp_size<ColorSpace>::value
        +
        57 >
        +
        58{
        +
        59private:
        +
        60 using parent_t = iterator_facade
        +
        61 <
        + + +
        64 std::random_access_iterator_tag,
        + +
        66 >;
        +
        67
        +
        68 using color_base_parent_t = detail::homogeneous_color_base
        +
        69 <
        +
        70 ChannelPtr,
        + +
        72 mp11::mp_size<ColorSpace>::value
        +
        73 >;
        +
        74
        +
        75 using channel_t = typename std::iterator_traits<ChannelPtr>::value_type;
        +
        76
        +
        77public:
        +
        78 using value_type = typename parent_t::value_type;
        +
        79 using reference = typename parent_t::reference;
        +
        80 using difference_type = typename parent_t::difference_type;
        +
        81
        +
        82 planar_pixel_iterator() : color_base_parent_t(0) {}
        +
        83 planar_pixel_iterator(bool) {} // constructor that does not fill with zero (for performance)
        +
        84
        +
        85 planar_pixel_iterator(const ChannelPtr& v0, const ChannelPtr& v1) : color_base_parent_t(v0,v1) {}
        +
        86 planar_pixel_iterator(const ChannelPtr& v0, const ChannelPtr& v1, const ChannelPtr& v2) : color_base_parent_t(v0,v1,v2) {}
        +
        87 planar_pixel_iterator(const ChannelPtr& v0, const ChannelPtr& v1, const ChannelPtr& v2, const ChannelPtr& v3) : color_base_parent_t(v0,v1,v2,v3) {}
        +
        88 planar_pixel_iterator(const ChannelPtr& v0, const ChannelPtr& v1, const ChannelPtr& v2, const ChannelPtr& v3, const ChannelPtr& v4) : color_base_parent_t(v0,v1,v2,v3,v4) {}
        +
        89
        +
        90 template <typename IC1,typename C1>
        +
        91 planar_pixel_iterator(const planar_pixel_iterator<IC1,C1>& ptr) : color_base_parent_t(ptr) {}
        +
        92
        +
        96 template <typename P>
        +
        +
        97 planar_pixel_iterator(P* pix) : color_base_parent_t(pix, true) {
        +
        98 function_requires<PixelsCompatibleConcept<P,value_type> >();
        +
        99 }
        +
        +
        100
        +
        101 struct address_of { template <typename T> T* operator()(T& t) { return &t; } };
        +
        102 template <typename P>
        +
        103 planar_pixel_iterator& operator=(P* pix) {
        +
        104 function_requires<PixelsCompatibleConcept<P,value_type> >();
        +
        105 static_transform(*pix,*this, address_of());
        +
        106
        +
        107 // PERFORMANCE_CHECK: Compare to this:
        +
        108 //this->template semantic_at_c<0>()=&pix->template semantic_at_c<0>();
        +
        109 //this->template semantic_at_c<1>()=&pix->template semantic_at_c<1>();
        +
        110 //this->template semantic_at_c<2>()=&pix->template semantic_at_c<2>();
        +
        111 return *this;
        +
        112 }
        +
        113
        +
        116 reference operator[](difference_type d) const { return memunit_advanced_ref(*this,d*sizeof(channel_t));}
        +
        117
        +
        118 reference operator->() const { return **this; }
        +
        119
        +
        120 // PERFORMANCE_CHECK: Remove?
        +
        121 bool operator< (const planar_pixel_iterator& ptr) const { return gil::at_c<0>(*this)< gil::at_c<0>(ptr); }
        +
        122 bool operator!=(const planar_pixel_iterator& ptr) const { return gil::at_c<0>(*this)!=gil::at_c<0>(ptr); }
        +
        123private:
        +
        124 friend class boost::iterator_core_access;
        +
        125
        +
        126 void increment() { static_transform(*this,*this,detail::inc<ChannelPtr>()); }
        +
        127 void decrement() { static_transform(*this,*this,detail::dec<ChannelPtr>()); }
        +
        128 void advance(std::ptrdiff_t d){ static_transform(*this,*this,std::bind(detail::plus_asymmetric<ChannelPtr,std::ptrdiff_t>(),std::placeholders::_1,d)); }
        +
        129 reference dereference() const { return this->template deref<reference>(); }
        +
        130
        +
        131 std::ptrdiff_t distance_to(const planar_pixel_iterator& it) const { return gil::at_c<0>(it)-gil::at_c<0>(*this); }
        +
        132 bool equal(const planar_pixel_iterator& it) const { return gil::at_c<0>(*this)==gil::at_c<0>(it); }
        +
        133};
        +
        +
        134
        +
        135namespace detail {
        +
        136template <typename I>
        +
        137struct channel_iterator_is_mutable : std::true_type {};
        +
        138
        +
        139template <typename I>
        +
        140struct channel_iterator_is_mutable<I const*> : std::false_type {};
        +
        141
        +
        142} // namespace detail
        +
        143
        +
        144template <typename IC, typename C>
        +
        145struct const_iterator_type<planar_pixel_iterator<IC,C> > {
        +
        146private:
        +
        147 using channel_t = typename std::iterator_traits<IC>::value_type;
        +
        148public:
        +
        149 using type = planar_pixel_iterator<typename channel_traits<channel_t>::const_pointer,C>;
        +
        150};
        +
        151
        +
        152// The default implementation when the iterator is a C pointer is to use the standard constness semantics
        +
        153template <typename IC, typename C>
        +
        154struct iterator_is_mutable<planar_pixel_iterator<IC,C> > : public detail::channel_iterator_is_mutable<IC> {};
        +
        155
        +
        157// ColorBasedConcept
        +
        159
        +
        160template <typename IC, typename C, int K>
        +
        161struct kth_element_type<planar_pixel_iterator<IC, C>, K>
        +
        162{
        +
        163 using type = IC;
        +
        164};
        +
        165
        +
        166template <typename IC, typename C, int K>
        +
        167struct kth_element_reference_type<planar_pixel_iterator<IC, C>, K>
        +
        168 : std::add_lvalue_reference<IC> {};
        +
        169
        +
        170template <typename IC, typename C, int K>
        +
        171struct kth_element_const_reference_type<planar_pixel_iterator<IC, C>, K>
        +
        172 : std::add_lvalue_reference<typename std::add_const<IC>::type>
        +
        173{};
        +
        174
        +
        176// HomogeneousPixelBasedConcept
        +
        178
        +
        179template <typename IC, typename C>
        +
        180struct color_space_type<planar_pixel_iterator<IC,C>>
        +
        181{
        +
        182 using type = C;
        +
        183};
        +
        184
        +
        185template <typename IC, typename C>
        +
        186struct channel_mapping_type<planar_pixel_iterator<IC, C>>
        +
        187 : channel_mapping_type<typename planar_pixel_iterator<IC,C>::value_type>
        +
        188{};
        +
        189
        +
        190template <typename IC, typename C>
        +
        191struct is_planar<planar_pixel_iterator<IC, C>> : std::true_type {};
        +
        192
        +
        193template <typename IC, typename C>
        +
        194struct channel_type<planar_pixel_iterator<IC, C>>
        +
        195{
        +
        196 using type = typename std::iterator_traits<IC>::value_type;
        +
        197};
        +
        198
        +
        200// MemoryBasedIteratorConcept
        +
        202
        +
        203template <typename IC, typename C>
        +
        204inline auto memunit_step(planar_pixel_iterator<IC,C> const&)
        +
        205 -> std::ptrdiff_t
        +
        206{
        +
        207 return sizeof(typename std::iterator_traits<IC>::value_type);
        +
        208}
        +
        209
        +
        210template <typename IC, typename C>
        +
        211inline auto memunit_distance(planar_pixel_iterator<IC,C> const& p1, planar_pixel_iterator<IC,C> const& p2)
        +
        212 -> std::ptrdiff_t
        +
        213{
        +
        214 return memunit_distance(gil::at_c<0>(p1),gil::at_c<0>(p2));
        +
        215}
        +
        216
        +
        217template <typename IC>
        +
        218struct memunit_advance_fn {
        +
        219 memunit_advance_fn(std::ptrdiff_t diff) : _diff(diff) {}
        +
        220 IC operator()(const IC& p) const { return memunit_advanced(p,_diff); }
        +
        221
        +
        222 std::ptrdiff_t _diff;
        +
        223};
        +
        224
        +
        225template <typename IC, typename C>
        +
        226inline void memunit_advance(planar_pixel_iterator<IC,C>& p, std::ptrdiff_t diff) {
        +
        227 static_transform(p, p, memunit_advance_fn<IC>(diff));
        +
        228}
        +
        229
        +
        230template <typename IC, typename C>
        +
        231inline auto memunit_advanced(planar_pixel_iterator<IC,C> const& p, std::ptrdiff_t diff)
        +
        232 -> planar_pixel_iterator<IC,C>
        +
        233{
        +
        234 planar_pixel_iterator<IC,C> ret=p;
        +
        235 memunit_advance(ret, diff);
        +
        236 return ret;
        +
        237}
        +
        238
        +
        239template <typename ChannelPtr, typename ColorSpace>
        +
        240inline auto memunit_advanced_ref(planar_pixel_iterator<ChannelPtr,ColorSpace> const& ptr, std::ptrdiff_t diff)
        +
        241 -> planar_pixel_reference<typename std::iterator_traits<ChannelPtr>::reference,ColorSpace>
        +
        242{
        +
        243 return planar_pixel_reference<typename std::iterator_traits<ChannelPtr>::reference,ColorSpace>(ptr, diff);
        +
        244}
        +
        245
        +
        247// HasDynamicXStepTypeConcept
        +
        249
        +
        250template <typename IC, typename C>
        +
        251struct dynamic_x_step_type<planar_pixel_iterator<IC,C> > {
        +
        252 using type = memory_based_step_iterator<planar_pixel_iterator<IC,C>>;
        +
        253};
        +
        254} } // namespace boost::gil
        +
        255
        +
        256#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Represents a color space and ordering of channels in memory.
        Definition utilities.hpp:268
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition pixel.hpp:106
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition planar_pixel_iterator.hpp:58
        +
        reference operator[](difference_type d) const
        Definition planar_pixel_iterator.hpp:116
        +
        planar_pixel_iterator(P *pix)
        Definition planar_pixel_iterator.hpp:97
        +
        A reference proxy to a planar pixel.
        Definition planar_pixel_reference.hpp:46
        diff --git a/html/reference/planar__pixel__reference_8hpp_source.html b/html/reference/planar__pixel__reference_8hpp_source.html index fb36cc4ec..68410e769 100644 --- a/html/reference/planar__pixel__reference_8hpp_source.html +++ b/html/reference/planar__pixel__reference_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: planar_pixel_reference.hpp Source File @@ -27,266 +27,288 @@

        - + +/* @license-end */ + +
        -
        -
        planar_pixel_reference.hpp
        +
        planar_pixel_reference.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_PLANAR_PIXEL_REFERENCE_HPP
        -
        9 #define BOOST_GIL_PLANAR_PIXEL_REFERENCE_HPP
        -
        10 
        -
        11 #include <boost/gil/channel.hpp>
        -
        12 #include <boost/gil/color_base.hpp>
        -
        13 #include <boost/gil/concepts.hpp>
        -
        14 #include <boost/gil/pixel.hpp>
        -
        15 #include <boost/gil/planar_pixel_iterator.hpp>
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        26 
        -
        30 
        -
        39 template <typename ChannelReference, typename ColorSpace>
        -
        40 struct planar_pixel_reference : detail::homogeneous_color_base
        -
        41  <
        -
        42  ChannelReference,
        -
        43  layout<ColorSpace>,
        -
        44  mp11::mp_size<ColorSpace>::value
        -
        45  >
        -
        46 {
        -
        47  using parent_t =detail::homogeneous_color_base
        -
        48  <
        -
        49  ChannelReference,
        - -
        51  mp11::mp_size<ColorSpace>::value
        -
        52  >;
        -
        53 
        -
        54 private:
        -
        55  // These three are only defined for homogeneous pixels
        -
        56  using channel_t = typename channel_traits<ChannelReference>::value_type;
        -
        57  using channel_const_reference = typename channel_traits<ChannelReference>::const_reference;
        -
        58 
        -
        59 public:
        -
        60  static constexpr bool is_mutable = channel_traits<ChannelReference>::is_mutable;
        - - - -
        64 
        -
        65  planar_pixel_reference(ChannelReference v0, ChannelReference v1)
        -
        66  : parent_t(v0, v1)
        -
        67  {}
        -
        68 
        -
        69  planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2)
        -
        70  : parent_t(v0, v1, v2)
        -
        71  {}
        -
        72 
        -
        73  planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3)
        -
        74  : parent_t(v0, v1, v2, v3)
        -
        75  {}
        -
        76 
        -
        77  planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4)
        -
        78  : parent_t(v0, v1, v2, v3, v4)
        -
        79  {}
        -
        80 
        -
        81  planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4, ChannelReference v5)
        -
        82  : parent_t(v0, v1, v2, v3, v4, v5)
        -
        83  {}
        -
        84 
        -
        85  planar_pixel_reference(planar_pixel_reference const& p) : parent_t(p) {}
        -
        86 
        -
        87  // TODO: What is the purpose of returning via const reference?
        -
        88  auto operator=(planar_pixel_reference const& p) const -> planar_pixel_reference const&
        -
        89  {
        -
        90  static_copy(p, *this);
        -
        91  return *this;
        -
        92  }
        -
        93 
        -
        94  template <typename Pixel>
        -
        95  planar_pixel_reference(Pixel const& p) : parent_t(p)
        -
        96  {
        -
        97  check_compatible<Pixel>();
        -
        98  }
        -
        99 
        -
        100  // TODO: What is the purpose of returning via const reference?
        -
        101  template <typename Pixel>
        -
        102  auto operator=(Pixel const& p) const -> planar_pixel_reference const&
        -
        103  {
        -
        104  check_compatible<Pixel>();
        -
        105  static_copy(p, *this);
        -
        106  return *this;
        -
        107  }
        -
        108 
        -
        109  // PERFORMANCE_CHECK: Is this constructor necessary?
        -
        110  template <typename ChannelV, typename Mapping>
        - -
        112  : parent_t(p)
        -
        113  {
        -
        114  check_compatible<pixel<ChannelV, layout<ColorSpace, Mapping>>>();
        -
        115  }
        -
        116 
        -
        117  // Construct at offset from a given location
        -
        118  template <typename ChannelPtr>
        - -
        120  : parent_t(p, diff)
        -
        121  {}
        -
        122 
        -
        123 // This overload is necessary for a compiler implementing Core Issue 574
        -
        124 // to prevent generation of an implicit copy assignment operator (the reason
        -
        125 // for generating implicit copy assignment operator is that according to
        -
        126 // Core Issue 574, a cv-qualified assignment operator is not considered
        -
        127 // "copy assignment operator").
        -
        128 // EDG implemented Core Issue 574 starting with EDG Version 3.8. I'm not
        -
        129 // sure why they did it for a template member function as well.
        -
        130 #if BOOST_WORKAROUND(__HP_aCC, >= 61700) || BOOST_WORKAROUND(__INTEL_COMPILER, >= 1000)
        -
        131  const planar_pixel_reference& operator=(const planar_pixel_reference& p) { static_copy(p,*this); return *this; }
        -
        132  template <typename P> const planar_pixel_reference& operator=(const P& p) { check_compatible<P>(); static_copy(p,*this); return *this; }
        -
        133 #endif
        -
        134 
        -
        135  template <typename Pixel>
        -
        136  bool operator==(Pixel const& p) const
        -
        137  {
        -
        138  check_compatible<Pixel>();
        -
        139  return static_equal(*this, p);
        -
        140  }
        -
        141 
        -
        142  template <typename Pixel>
        -
        143  bool operator!=(Pixel const &p) const { return !(*this == p); }
        -
        144 
        -
        145  auto operator[](std::size_t i) const -> ChannelReference { return this->at_c_dynamic(i); }
        -
        146  auto operator->() const -> planar_pixel_reference const* { return this; }
        -
        147 
        -
        148 private:
        -
        149  template <typename Pixel>
        -
        150  static void check_compatible()
        -
        151  {
        -
        152  gil_function_requires<PixelsCompatibleConcept<Pixel, planar_pixel_reference>>();
        -
        153  }
        -
        154 };
        -
        155 
        -
        157 // ColorBasedConcept
        -
        159 
        -
        160 template <typename ChannelReference, typename ColorSpace, int K>
        -
        161 struct kth_element_type<planar_pixel_reference<ChannelReference, ColorSpace>, K>
        -
        162 {
        -
        163  using type = ChannelReference;
        -
        164 };
        -
        165 
        -
        166 template <typename ChannelReference, typename ColorSpace, int K>
        -
        167 struct kth_element_reference_type
        -
        168  <
        -
        169  planar_pixel_reference<ChannelReference, ColorSpace>,
        -
        170  K
        -
        171  >
        -
        172 {
        -
        173  using type = ChannelReference;
        -
        174 };
        -
        175 
        -
        176 template <typename ChannelReference, typename ColorSpace, int K>
        -
        177 struct kth_element_const_reference_type
        -
        178  <
        -
        179  planar_pixel_reference<ChannelReference, ColorSpace>,
        -
        180  K
        -
        181  >
        -
        182  : std::add_lvalue_reference<typename std::add_const<ChannelReference>::type>
        -
        183 {
        -
        184  // using type = typename channel_traits<ChannelReference>::const_reference;
        -
        185 };
        -
        186 
        -
        188 // PixelConcept
        -
        190 
        -
        193 template <typename ChannelReference, typename ColorSpace>
        -
        194 struct is_pixel< planar_pixel_reference<ChannelReference, ColorSpace>>
        -
        195  : std::true_type
        -
        196 {};
        -
        197 
        -
        199 // HomogeneousPixelBasedConcept
        -
        201 
        -
        204 template <typename ChannelReference, typename ColorSpace>
        -
        205 struct color_space_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
        -
        206  using type = ColorSpace;
        -
        207 };
        -
        208 
        -
        211 template <typename ChannelReference, typename ColorSpace>
        -
        212 struct channel_mapping_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
        -
        213  using type = typename layout<ColorSpace>::channel_mapping_t;
        -
        214 };
        -
        215 
        -
        218 template <typename ChannelReference, typename ColorSpace>
        -
        219 struct is_planar<planar_pixel_reference<ChannelReference, ColorSpace>>
        -
        220  : std::true_type
        -
        221 {};
        -
        222 
        -
        225 template <typename ChannelReference, typename ColorSpace>
        -
        226 struct channel_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
        -
        227  using type = typename channel_traits<ChannelReference>::value_type;
        -
        228 };
        -
        229 
        -
        230 }} // namespace boost::gil
        -
        231 
        -
        232 namespace std {
        -
        233 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
        -
        234 // swap with 'left bias':
        -
        235 // - swap between proxy and anything
        -
        236 // - swap between value type and proxy
        -
        237 // - swap between proxy and proxy
        -
        238 // Having three overloads allows us to swap between different (but compatible) models of PixelConcept
        -
        239 
        -
        242 template <typename CR, typename CS, typename R> inline
        - -
        244  boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
        -
        245 }
        -
        246 
        -
        249 template <typename CR, typename CS> inline
        - -
        251  boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
        -
        252 }
        -
        253 
        -
        256 template <typename CR, typename CS> inline
        - -
        258  boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
        -
        259 }
        -
        260 
        -
        261 } // namespace std
        -
        262 
        -
        263 #endif
        -
        void swap(const boost::gil::planar_pixel_reference< CR, CS > x, const boost::gil::planar_pixel_reference< CR, CS > y)
        swap for planar_pixel_reference
        Definition: planar_pixel_reference.hpp:257
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: color_convert.hpp:31
        -
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:268
        -
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition: pixel.hpp:106
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: planar_pixel_iterator.hpp:58
        -
        A reference proxy to a planar pixel.
        Definition: planar_pixel_reference.hpp:46
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_PLANAR_PIXEL_REFERENCE_HPP
        +
        9#define BOOST_GIL_PLANAR_PIXEL_REFERENCE_HPP
        +
        10
        +
        11#include <boost/gil/channel.hpp>
        +
        12#include <boost/gil/color_base.hpp>
        +
        13#include <boost/gil/concepts.hpp>
        +
        14#include <boost/gil/pixel.hpp>
        +
        15#include <boost/gil/planar_pixel_iterator.hpp>
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17
        +
        18#include <type_traits>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        26
        +
        30
        +
        39template <typename ChannelReference, typename ColorSpace>
        +
        +
        40struct planar_pixel_reference : detail::homogeneous_color_base
        +
        41 <
        +
        42 ChannelReference,
        +
        43 layout<ColorSpace>,
        +
        44 mp11::mp_size<ColorSpace>::value
        +
        45 >
        +
        46{
        +
        47 using parent_t =detail::homogeneous_color_base
        +
        48 <
        +
        49 ChannelReference,
        + +
        51 mp11::mp_size<ColorSpace>::value
        +
        52 >;
        +
        53
        +
        54private:
        +
        55 // These three are only defined for homogeneous pixels
        +
        56 using channel_t = typename channel_traits<ChannelReference>::value_type;
        +
        57 using channel_const_reference = typename channel_traits<ChannelReference>::const_reference;
        +
        58
        +
        59public:
        +
        60 static constexpr bool is_mutable = channel_traits<ChannelReference>::is_mutable;
        + + + +
        64
        +
        65 planar_pixel_reference(ChannelReference v0, ChannelReference v1)
        +
        66 : parent_t(v0, v1)
        +
        67 {}
        +
        68
        +
        69 planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2)
        +
        70 : parent_t(v0, v1, v2)
        +
        71 {}
        +
        72
        +
        73 planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3)
        +
        74 : parent_t(v0, v1, v2, v3)
        +
        75 {}
        +
        76
        +
        77 planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4)
        +
        78 : parent_t(v0, v1, v2, v3, v4)
        +
        79 {}
        +
        80
        +
        81 planar_pixel_reference(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4, ChannelReference v5)
        +
        82 : parent_t(v0, v1, v2, v3, v4, v5)
        +
        83 {}
        +
        84
        +
        85 planar_pixel_reference(planar_pixel_reference const& p) : parent_t(p) {}
        +
        86
        +
        87 // TODO: What is the purpose of returning via const reference?
        +
        88 auto operator=(planar_pixel_reference const& p) const -> planar_pixel_reference const&
        +
        89 {
        +
        90 static_copy(p, *this);
        +
        91 return *this;
        +
        92 }
        +
        93
        +
        94 template <typename Pixel>
        +
        95 planar_pixel_reference(Pixel const& p) : parent_t(p)
        +
        96 {
        +
        97 check_compatible<Pixel>();
        +
        98 }
        +
        99
        +
        100 // TODO: What is the purpose of returning via const reference?
        +
        101 template <typename Pixel>
        +
        102 auto operator=(Pixel const& p) const -> planar_pixel_reference const&
        +
        103 {
        +
        104 check_compatible<Pixel>();
        +
        105 static_copy(p, *this);
        +
        106 return *this;
        +
        107 }
        +
        108
        +
        109 // PERFORMANCE_CHECK: Is this constructor necessary?
        +
        110 template <typename ChannelV, typename Mapping>
        + +
        112 : parent_t(p)
        +
        113 {
        +
        114 check_compatible<pixel<ChannelV, layout<ColorSpace, Mapping>>>();
        +
        115 }
        +
        116
        +
        117 // Construct at offset from a given location
        +
        118 template <typename ChannelPtr>
        + +
        120 : parent_t(p, diff)
        +
        121 {}
        +
        122
        +
        123// This overload is necessary for a compiler implementing Core Issue 574
        +
        124// to prevent generation of an implicit copy assignment operator (the reason
        +
        125// for generating implicit copy assignment operator is that according to
        +
        126// Core Issue 574, a cv-qualified assignment operator is not considered
        +
        127// "copy assignment operator").
        +
        128// EDG implemented Core Issue 574 starting with EDG Version 3.8. I'm not
        +
        129// sure why they did it for a template member function as well.
        +
        130#if BOOST_WORKAROUND(__HP_aCC, >= 61700) || BOOST_WORKAROUND(__INTEL_COMPILER, >= 1000)
        +
        131 const planar_pixel_reference& operator=(const planar_pixel_reference& p) { static_copy(p,*this); return *this; }
        +
        132 template <typename P> const planar_pixel_reference& operator=(const P& p) { check_compatible<P>(); static_copy(p,*this); return *this; }
        +
        133#endif
        +
        134
        +
        135 template <typename Pixel>
        +
        136 bool operator==(Pixel const& p) const
        +
        137 {
        +
        138 check_compatible<Pixel>();
        +
        139 return static_equal(*this, p);
        +
        140 }
        +
        141
        +
        142 template <typename Pixel>
        +
        143 bool operator!=(Pixel const &p) const { return !(*this == p); }
        +
        144
        +
        145 auto operator[](std::size_t i) const -> ChannelReference { return this->at_c_dynamic(i); }
        +
        146 auto operator->() const -> planar_pixel_reference const* { return this; }
        +
        147
        +
        148private:
        +
        149 template <typename Pixel>
        +
        150 static void check_compatible()
        +
        151 {
        +
        152 gil_function_requires<PixelsCompatibleConcept<Pixel, planar_pixel_reference>>();
        +
        153 }
        +
        154};
        +
        +
        155
        +
        157// ColorBasedConcept
        +
        159
        +
        160template <typename ChannelReference, typename ColorSpace, int K>
        +
        161struct kth_element_type<planar_pixel_reference<ChannelReference, ColorSpace>, K>
        +
        162{
        +
        163 using type = ChannelReference;
        +
        164};
        +
        165
        +
        166template <typename ChannelReference, typename ColorSpace, int K>
        +
        167struct kth_element_reference_type
        +
        168 <
        +
        169 planar_pixel_reference<ChannelReference, ColorSpace>,
        +
        170 K
        +
        171 >
        +
        172{
        +
        173 using type = ChannelReference;
        +
        174};
        +
        175
        +
        176template <typename ChannelReference, typename ColorSpace, int K>
        +
        177struct kth_element_const_reference_type
        +
        178 <
        +
        179 planar_pixel_reference<ChannelReference, ColorSpace>,
        +
        180 K
        +
        181 >
        +
        182 : std::add_lvalue_reference<typename std::add_const<ChannelReference>::type>
        +
        183{
        +
        184 // using type = typename channel_traits<ChannelReference>::const_reference;
        +
        185};
        +
        186
        +
        188// PixelConcept
        +
        190
        +
        193template <typename ChannelReference, typename ColorSpace>
        +
        +
        194struct is_pixel< planar_pixel_reference<ChannelReference, ColorSpace>>
        +
        195 : std::true_type
        +
        196{};
        +
        +
        197
        +
        199// HomogeneousPixelBasedConcept
        +
        201
        +
        204template <typename ChannelReference, typename ColorSpace>
        +
        +
        205struct color_space_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
        +
        206 using type = ColorSpace;
        +
        207};
        +
        +
        208
        +
        211template <typename ChannelReference, typename ColorSpace>
        +
        +
        212struct channel_mapping_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
        +
        213 using type = typename layout<ColorSpace>::channel_mapping_t;
        +
        214};
        +
        +
        215
        +
        218template <typename ChannelReference, typename ColorSpace>
        +
        +
        219struct is_planar<planar_pixel_reference<ChannelReference, ColorSpace>>
        +
        220 : std::true_type
        +
        221{};
        +
        +
        222
        +
        225template <typename ChannelReference, typename ColorSpace>
        +
        +
        226struct channel_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
        +
        227 using type = typename channel_traits<ChannelReference>::value_type;
        +
        228};
        +
        +
        229
        +
        230}} // namespace boost::gil
        +
        231
        +
        232namespace std {
        +
        233// We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
        +
        234// swap with 'left bias':
        +
        235// - swap between proxy and anything
        +
        236// - swap between value type and proxy
        +
        237// - swap between proxy and proxy
        +
        238// Having three overloads allows us to swap between different (but compatible) models of PixelConcept
        +
        239
        +
        242template <typename CR, typename CS, typename R> inline
        +
        + +
        244 boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
        +
        245}
        +
        +
        246
        +
        249template <typename CR, typename CS> inline
        +
        + +
        251 boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
        +
        252}
        +
        +
        253
        +
        256template <typename CR, typename CS> inline
        +
        + +
        258 boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y);
        +
        259}
        +
        +
        260
        +
        261} // namespace std
        +
        262
        +
        263#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition color_convert.hpp:31
        +
        Represents a color space and ordering of channels in memory.
        Definition utilities.hpp:268
        +
        Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept,...
        Definition pixel.hpp:106
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition planar_pixel_iterator.hpp:58
        +
        A reference proxy to a planar pixel.
        Definition planar_pixel_reference.hpp:46
        diff --git a/html/reference/plus.svg b/html/reference/plus.svg new file mode 100644 index 000000000..075201655 --- /dev/null +++ b/html/reference/plus.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/html/reference/plusd.svg b/html/reference/plusd.svg new file mode 100644 index 000000000..0c65bfe94 --- /dev/null +++ b/html/reference/plusd.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/html/reference/png_8hpp_source.html b/html/reference/png_8hpp_source.html index 5ad09900a..08649d478 100644 --- a/html/reference/png_8hpp_source.html +++ b/html/reference/png_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: png.hpp Source File @@ -27,47 +27,52 @@

        - + +/* @license-end */ + +
        -
        -
        png.hpp
        +
        png.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_IO_PNG_HPP
        -
        9 #define BOOST_GIL_EXTENSION_IO_PNG_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/io/png/read.hpp>
        -
        12 #include <boost/gil/extension/io/png/write.hpp>
        -
        13 
        -
        14 #endif
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_IO_PNG_HPP
        +
        9#define BOOST_GIL_EXTENSION_IO_PNG_HPP
        +
        10
        +
        11#include <boost/gil/extension/io/png/read.hpp>
        +
        12#include <boost/gil/extension/io/png/write.hpp>
        +
        13
        +
        14#endif
        diff --git a/html/reference/pnm_8hpp_source.html b/html/reference/pnm_8hpp_source.html index 1e92bd1b3..5308c09ff 100644 --- a/html/reference/pnm_8hpp_source.html +++ b/html/reference/pnm_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: pnm.hpp Source File @@ -27,47 +27,52 @@

        - + +/* @license-end */ + +
        -
        -
        pnm.hpp
        +
        pnm.hpp
        -
        1 //
        -
        2 // Copyright 2008 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_IO_PNM_HPP
        -
        9 #define BOOST_GIL_EXTENSION_IO_PNM_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/io/pnm/read.hpp>
        -
        12 #include <boost/gil/extension/io/pnm/write.hpp>
        -
        13 
        -
        14 #endif
        +
        1//
        +
        2// Copyright 2008 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_IO_PNM_HPP
        +
        9#define BOOST_GIL_EXTENSION_IO_PNM_HPP
        +
        10
        +
        11#include <boost/gil/extension/io/pnm/read.hpp>
        +
        12#include <boost/gil/extension/io/pnm/write.hpp>
        +
        13
        +
        14#endif
        diff --git a/html/reference/point_8hpp_source.html b/html/reference/point_8hpp_source.html index 09be71e29..d20ef3989 100644 --- a/html/reference/point_8hpp_source.html +++ b/html/reference/point_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: point.hpp Source File @@ -27,290 +27,297 @@

        - + +/* @license-end */ + +
        -
        -
        point.hpp
        +
        point.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_POINT_HPP
        -
        9 #define BOOST_GIL_POINT_HPP
        -
        10 
        -
        11 #include <boost/gil/utilities.hpp>
        -
        12 #include <boost/gil/detail/std_common_type.hpp>
        -
        13 
        -
        14 #include <boost/config.hpp>
        -
        15 
        -
        16 #include <cstddef>
        -
        17 #include <type_traits>
        -
        18 
        -
        19 namespace boost { namespace gil {
        -
        20 
        -
        30 
        -
        34 template <typename T>
        -
        35 class point
        -
        36 {
        -
        37 public:
        -
        38  using value_type = T;
        -
        39 
        -
        40  template<std::size_t D>
        -
        41  struct axis
        -
        42  {
        -
        43  using coord_t = value_type;
        -
        44  };
        -
        45 
        -
        46  static constexpr std::size_t num_dimensions = 2;
        -
        47 
        -
        48  point() = default;
        -
        49  point(T px, T py) : x(px), y(py) {}
        -
        50 
        -
        51  point operator<<(std::ptrdiff_t shift) const
        -
        52  {
        -
        53  return point(x << shift, y << shift);
        -
        54  }
        -
        55 
        -
        56  point operator>>(std::ptrdiff_t shift) const
        -
        57  {
        -
        58  return point(x >> shift, y >> shift);
        -
        59  }
        -
        60 
        -
        61  point& operator+=(point const& p)
        -
        62  {
        -
        63  x += p.x;
        -
        64  y += p.y;
        -
        65  return *this;
        -
        66  }
        -
        67 
        -
        68  point& operator-=(point const& p)
        -
        69  {
        -
        70  x -= p.x;
        -
        71  y -= p.y;
        -
        72  return *this;
        -
        73  }
        -
        74 
        -
        75  point& operator/=(double d)
        -
        76  {
        -
        77  if (d < 0 || 0 < d)
        -
        78  {
        -
        79  x = static_cast<T>(x / d);
        -
        80  y = static_cast<T>(y / d);
        -
        81  }
        -
        82  return *this;
        -
        83  }
        -
        84 
        -
        85  point& operator*=(double d)
        -
        86  {
        -
        87  x = static_cast<T>(x * d);
        -
        88  y = static_cast<T>(y * d);
        -
        89  return *this;
        -
        90  }
        -
        91 
        -
        92  T const& operator[](std::size_t i) const
        -
        93  {
        -
        94  return this->*mem_array[i];
        -
        95  }
        -
        96 
        -
        97  T& operator[](std::size_t i)
        -
        98  {
        -
        99  return this->*mem_array[i];
        -
        100  }
        -
        101 
        -
        102  T x{0};
        -
        103  T y{0};
        -
        104 
        -
        105 private:
        -
        106  // this static array of pointers to member variables makes operator[] safe
        -
        107  // and doesn't seem to exhibit any performance penalty.
        -
        108  static T point<T>::* const mem_array[num_dimensions];
        -
        109 };
        -
        110 
        -
        112 template <typename T>
        -
        113 using point2 = point<T>;
        -
        114 
        - -
        118 
        -
        119 template <typename T>
        - -
        121 {
        -
        122  &point<T>::x,
        -
        123  &point<T>::y
        -
        124 };
        -
        125 
        -
        127 template <typename T>
        -
        128 BOOST_FORCEINLINE
        -
        129 bool operator==(const point<T>& p1, const point<T>& p2)
        -
        130 {
        -
        131  return p1.x == p2.x && p1.y == p2.y;
        -
        132 }
        -
        133 
        -
        135 template <typename T>
        -
        136 BOOST_FORCEINLINE
        -
        137 bool operator!=(const point<T>& p1, const point<T>& p2)
        -
        138 {
        -
        139  return p1.x != p2.x || p1.y != p2.y;
        -
        140 }
        -
        141 
        -
        143 template <typename T>
        -
        144 BOOST_FORCEINLINE
        -
        145 point<T> operator+(const point<T>& p1, const point<T>& p2)
        -
        146 {
        -
        147  return { p1.x + p2.x, p1.y + p2.y };
        -
        148 }
        -
        149 
        -
        151 template <typename T>
        -
        152 BOOST_FORCEINLINE
        -
        153 point<T> operator-(const point<T>& p)
        -
        154 {
        -
        155  return { -p.x, -p.y };
        -
        156 }
        -
        157 
        -
        159 template <typename T>
        -
        160 BOOST_FORCEINLINE
        -
        161 point<T> operator-(const point<T>& p1, const point<T>& p2)
        -
        162 {
        -
        163  return { p1.x - p2.x, p1.y - p2.y };
        -
        164 }
        -
        165 
        -
        167 template <typename T, typename D>
        -
        168 BOOST_FORCEINLINE
        -
        169 auto operator/(point<T> const& p, D d)
        -
        170  -> typename std::enable_if
        -
        171  <
        -
        172  std::is_arithmetic<D>::value,
        -
        173  point<typename detail::std_common_type<T, D>::type>
        -
        174  >::type
        -
        175 {
        -
        176  static_assert(std::is_arithmetic<D>::value, "denominator is not arithmetic type");
        -
        177  using result_type = typename detail::std_common_type<T, D>::type;
        -
        178  if (d < 0 || 0 < d)
        -
        179  {
        -
        180  double const x = static_cast<double>(p.x) / static_cast<double>(d);
        -
        181  double const y = static_cast<double>(p.y) / static_cast<double>(d);
        -
        182  return point<result_type>{
        -
        183  static_cast<result_type>(iround(x)),
        -
        184  static_cast<result_type>(iround(y))};
        -
        185  }
        -
        186  else
        -
        187  {
        -
        188  return point<result_type>{0, 0};
        -
        189  }
        -
        190 }
        -
        191 
        -
        193 template <typename T, typename M>
        -
        194 BOOST_FORCEINLINE
        -
        195 auto operator*(point<T> const& p, M m)
        -
        196  -> typename std::enable_if
        -
        197  <
        -
        198  std::is_arithmetic<M>::value,
        -
        199  point<typename detail::std_common_type<T, M>::type>
        -
        200  >::type
        -
        201 {
        -
        202  static_assert(std::is_arithmetic<M>::value, "multiplier is not arithmetic type");
        -
        203  using result_type = typename detail::std_common_type<T, M>::type;
        -
        204  return point<result_type>{p.x * m, p.y * m};
        -
        205 }
        -
        206 
        -
        208 template <typename T, typename M>
        -
        209 BOOST_FORCEINLINE
        -
        210 auto operator*(M m, point<T> const& p)
        -
        211  -> typename std::enable_if
        -
        212  <
        -
        213  std::is_arithmetic<M>::value,
        -
        214  point<typename detail::std_common_type<T, M>::type>
        -
        215  >::type
        -
        216 {
        -
        217  static_assert(std::is_arithmetic<M>::value, "multiplier is not arithmetic type");
        -
        218  using result_type = typename detail::std_common_type<T, M>::type;
        -
        219  return point<result_type>{p.x * m, p.y * m};
        -
        220 }
        -
        221 
        -
        223 template <std::size_t K, typename T>
        -
        224 BOOST_FORCEINLINE
        -
        225 T const& axis_value(point<T> const& p)
        -
        226 {
        -
        227  static_assert(K < point<T>::num_dimensions, "axis index out of range");
        -
        228  return p[K];
        -
        229 }
        -
        230 
        -
        232 template <std::size_t K, typename T>
        -
        233 BOOST_FORCEINLINE
        -
        234 T& axis_value(point<T>& p)
        -
        235 {
        -
        236  static_assert(K < point<T>::num_dimensions, "axis index out of range");
        -
        237  return p[K];
        -
        238 }
        -
        239 
        -
        246 
        -
        248 template <typename T>
        -
        249 inline auto iround(point<T> const& p) -> point<std::ptrdiff_t>
        -
        250 {
        -
        251  static_assert(std::is_integral<T>::value, "T is not integer");
        -
        252  return { static_cast<std::ptrdiff_t>(p.x), static_cast<std::ptrdiff_t>(p.y) };
        -
        253 }
        -
        254 
        -
        256 inline auto iround(point<float> const& p) -> point<std::ptrdiff_t>
        -
        257 {
        -
        258  return { iround(p.x), iround(p.y) };
        -
        259 }
        -
        260 
        -
        262 inline auto iround(point<double> const& p) -> point<std::ptrdiff_t>
        -
        263 {
        -
        264  return { iround(p.x), iround(p.y) };
        -
        265 }
        -
        266 
        -
        268 inline auto ifloor(point<float> const& p) -> point<std::ptrdiff_t>
        -
        269 {
        -
        270  return { ifloor(p.x), ifloor(p.y) };
        -
        271 }
        -
        272 
        -
        274 inline auto ifloor(point<double> const& p) -> point<std::ptrdiff_t>
        -
        275 {
        -
        276  return { ifloor(p.x), ifloor(p.y) };
        -
        277 }
        -
        278 
        -
        280 inline auto iceil(point<float> const& p) -> point<std::ptrdiff_t>
        -
        281 {
        -
        282  return { iceil(p.x), iceil(p.y) };
        -
        283 }
        -
        284 
        -
        286 inline auto iceil(point<double> const& p) -> point<std::ptrdiff_t>
        -
        287 {
        -
        288  return { iceil(p.x), iceil(p.y) };
        -
        289 }
        -
        290 
        -
        291 }} // namespace boost::gil
        -
        292 
        -
        293 #endif
        -
        2D point both axes of which have the same dimension typeModels: Point2DConcept
        Definition: point.hpp:36
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_POINT_HPP
        +
        9#define BOOST_GIL_POINT_HPP
        +
        10
        +
        11#include <boost/gil/utilities.hpp>
        +
        12#include <boost/gil/detail/std_common_type.hpp>
        +
        13
        +
        14#include <boost/config.hpp>
        +
        15
        +
        16#include <cstddef>
        +
        17#include <type_traits>
        +
        18
        +
        19namespace boost { namespace gil {
        +
        20
        +
        30
        +
        34template <typename T>
        +
        +
        35class point
        +
        36{
        +
        37public:
        +
        38 using value_type = T;
        +
        39
        +
        40 template<std::size_t D>
        +
        41 struct axis
        +
        42 {
        +
        43 using coord_t = value_type;
        +
        44 };
        +
        45
        +
        46 static constexpr std::size_t num_dimensions = 2;
        +
        47
        +
        48 point() = default;
        +
        49 point(T px, T py) : x(px), y(py) {}
        +
        50
        +
        51 point operator<<(std::ptrdiff_t shift) const
        +
        52 {
        +
        53 return point(x << shift, y << shift);
        +
        54 }
        +
        55
        +
        56 point operator>>(std::ptrdiff_t shift) const
        +
        57 {
        +
        58 return point(x >> shift, y >> shift);
        +
        59 }
        +
        60
        +
        61 point& operator+=(point const& p)
        +
        62 {
        +
        63 x += p.x;
        +
        64 y += p.y;
        +
        65 return *this;
        +
        66 }
        +
        67
        +
        68 point& operator-=(point const& p)
        +
        69 {
        +
        70 x -= p.x;
        +
        71 y -= p.y;
        +
        72 return *this;
        +
        73 }
        +
        74
        +
        75 point& operator/=(double d)
        +
        76 {
        +
        77 if (d < 0 || 0 < d)
        +
        78 {
        +
        79 x = static_cast<T>(x / d);
        +
        80 y = static_cast<T>(y / d);
        +
        81 }
        +
        82 return *this;
        +
        83 }
        +
        84
        +
        85 point& operator*=(double d)
        +
        86 {
        +
        87 x = static_cast<T>(x * d);
        +
        88 y = static_cast<T>(y * d);
        +
        89 return *this;
        +
        90 }
        +
        91
        +
        92 T const& operator[](std::size_t i) const
        +
        93 {
        +
        94 return this->*mem_array[i];
        +
        95 }
        +
        96
        +
        97 T& operator[](std::size_t i)
        +
        98 {
        +
        99 return this->*mem_array[i];
        +
        100 }
        +
        101
        +
        102 T x{0};
        +
        103 T y{0};
        +
        104
        +
        105private:
        +
        106 // this static array of pointers to member variables makes operator[] safe
        +
        107 // and doesn't seem to exhibit any performance penalty.
        +
        108 static T point<T>::* const mem_array[num_dimensions];
        +
        109};
        +
        +
        110
        +
        112template <typename T>
        +
        113using point2 = point<T>;
        +
        114
        + +
        118
        +
        119template <typename T>
        + +
        121{
        + + +
        124};
        +
        125
        +
        127template <typename T>
        +
        128BOOST_FORCEINLINE
        +
        129bool operator==(const point<T>& p1, const point<T>& p2)
        +
        130{
        +
        131 return p1.x == p2.x && p1.y == p2.y;
        +
        132}
        +
        133
        +
        135template <typename T>
        +
        136BOOST_FORCEINLINE
        +
        137bool operator!=(const point<T>& p1, const point<T>& p2)
        +
        138{
        +
        139 return p1.x != p2.x || p1.y != p2.y;
        +
        140}
        +
        141
        +
        143template <typename T>
        +
        144BOOST_FORCEINLINE
        +
        145point<T> operator+(const point<T>& p1, const point<T>& p2)
        +
        146{
        +
        147 return { p1.x + p2.x, p1.y + p2.y };
        +
        148}
        +
        149
        +
        151template <typename T>
        +
        152BOOST_FORCEINLINE
        +
        153point<T> operator-(const point<T>& p)
        +
        154{
        +
        155 return { -p.x, -p.y };
        +
        156}
        +
        157
        +
        159template <typename T>
        +
        160BOOST_FORCEINLINE
        +
        161point<T> operator-(const point<T>& p1, const point<T>& p2)
        +
        162{
        +
        163 return { p1.x - p2.x, p1.y - p2.y };
        +
        164}
        +
        165
        +
        167template <typename T, typename D>
        +
        168BOOST_FORCEINLINE
        +
        169auto operator/(point<T> const& p, D d)
        +
        170 -> typename std::enable_if
        +
        171 <
        +
        172 std::is_arithmetic<D>::value,
        +
        173 point<typename detail::std_common_type<T, D>::type>
        +
        174 >::type
        +
        175{
        +
        176 static_assert(std::is_arithmetic<D>::value, "denominator is not arithmetic type");
        +
        177 using result_type = typename detail::std_common_type<T, D>::type;
        +
        178 if (d < 0 || 0 < d)
        +
        179 {
        +
        180 double const x = static_cast<double>(p.x) / static_cast<double>(d);
        +
        181 double const y = static_cast<double>(p.y) / static_cast<double>(d);
        +
        182 return point<result_type>{
        +
        183 static_cast<result_type>(iround(x)),
        +
        184 static_cast<result_type>(iround(y))};
        +
        185 }
        +
        186 else
        +
        187 {
        +
        188 return point<result_type>{0, 0};
        +
        189 }
        +
        190}
        +
        191
        +
        193template <typename T, typename M>
        +
        194BOOST_FORCEINLINE
        +
        195auto operator*(point<T> const& p, M m)
        +
        196 -> typename std::enable_if
        +
        197 <
        +
        198 std::is_arithmetic<M>::value,
        +
        199 point<typename detail::std_common_type<T, M>::type>
        +
        200 >::type
        +
        201{
        +
        202 static_assert(std::is_arithmetic<M>::value, "multiplier is not arithmetic type");
        +
        203 using result_type = typename detail::std_common_type<T, M>::type;
        +
        204 return point<result_type>{p.x * m, p.y * m};
        +
        205}
        +
        206
        +
        208template <typename T, typename M>
        +
        209BOOST_FORCEINLINE
        +
        210auto operator*(M m, point<T> const& p)
        +
        211 -> typename std::enable_if
        +
        212 <
        +
        213 std::is_arithmetic<M>::value,
        +
        214 point<typename detail::std_common_type<T, M>::type>
        +
        215 >::type
        +
        216{
        +
        217 static_assert(std::is_arithmetic<M>::value, "multiplier is not arithmetic type");
        +
        218 using result_type = typename detail::std_common_type<T, M>::type;
        +
        219 return point<result_type>{p.x * m, p.y * m};
        +
        220}
        +
        221
        +
        223template <std::size_t K, typename T>
        +
        224BOOST_FORCEINLINE
        +
        225T const& axis_value(point<T> const& p)
        +
        226{
        +
        227 static_assert(K < point<T>::num_dimensions, "axis index out of range");
        +
        228 return p[K];
        +
        229}
        +
        230
        +
        232template <std::size_t K, typename T>
        +
        233BOOST_FORCEINLINE
        +
        234T& axis_value(point<T>& p)
        +
        235{
        +
        236 static_assert(K < point<T>::num_dimensions, "axis index out of range");
        +
        237 return p[K];
        +
        238}
        +
        239
        +
        246
        +
        248template <typename T>
        +
        249inline auto iround(point<T> const& p) -> point<std::ptrdiff_t>
        +
        250{
        +
        251 static_assert(std::is_integral<T>::value, "T is not integer");
        +
        252 return { static_cast<std::ptrdiff_t>(p.x), static_cast<std::ptrdiff_t>(p.y) };
        +
        253}
        +
        254
        +
        256inline auto iround(point<float> const& p) -> point<std::ptrdiff_t>
        +
        257{
        +
        258 return { iround(p.x), iround(p.y) };
        +
        259}
        +
        260
        +
        262inline auto iround(point<double> const& p) -> point<std::ptrdiff_t>
        +
        263{
        +
        264 return { iround(p.x), iround(p.y) };
        +
        265}
        +
        266
        +
        268inline auto ifloor(point<float> const& p) -> point<std::ptrdiff_t>
        +
        269{
        +
        270 return { ifloor(p.x), ifloor(p.y) };
        +
        271}
        +
        272
        +
        274inline auto ifloor(point<double> const& p) -> point<std::ptrdiff_t>
        +
        275{
        +
        276 return { ifloor(p.x), ifloor(p.y) };
        +
        277}
        +
        278
        +
        280inline auto iceil(point<float> const& p) -> point<std::ptrdiff_t>
        +
        281{
        +
        282 return { iceil(p.x), iceil(p.y) };
        +
        283}
        +
        284
        +
        286inline auto iceil(point<double> const& p) -> point<std::ptrdiff_t>
        +
        287{
        +
        288 return { iceil(p.x), iceil(p.y) };
        +
        289}
        +
        290
        +
        291}} // namespace boost::gil
        +
        292
        +
        293#endif
        +
        2D point both axes of which have the same dimension typeModels: Point2DConcept
        Definition point.hpp:36
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/position__iterator_8hpp_source.html b/html/reference/position__iterator_8hpp_source.html index 5c2cdf6b9..853660551 100644 --- a/html/reference/position__iterator_8hpp_source.html +++ b/html/reference/position__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: position_iterator.hpp Source File @@ -27,150 +27,158 @@

        - + +/* @license-end */ + +
        -
        -
        position_iterator.hpp
        +
        position_iterator.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_POSITION_ITERATOR_HPP
        -
        9 #define BOOST_GIL_POSITION_ITERATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/locator.hpp>
        -
        12 
        -
        13 #include <boost/iterator/iterator_facade.hpp>
        -
        14 
        -
        15 #include <type_traits>
        -
        16 
        -
        17 namespace boost { namespace gil {
        -
        18 
        -
        23 
        -
        30 template <typename Deref, int Dim>
        -
        31 struct position_iterator : public iterator_facade<position_iterator<Deref,Dim>,
        -
        32  typename Deref::value_type,
        -
        33  std::random_access_iterator_tag,
        -
        34  typename Deref::reference,
        -
        35  typename Deref::argument_type::template axis<Dim>::coord_t> {
        -
        36  using parent_t = iterator_facade<position_iterator<Deref,Dim>,
        -
        37  typename Deref::value_type,
        -
        38  std::random_access_iterator_tag,
        -
        39  typename Deref::reference,
        -
        40  typename Deref::argument_type::template axis<Dim>::coord_t>;
        -
        41  using difference_type = typename parent_t::difference_type;
        -
        42  using reference = typename parent_t::reference;
        -
        43  using point_t = typename Deref::argument_type;
        -
        44 
        - -
        46  position_iterator(point_t const& p, point_t const& step, Deref const& d) : _p(p), _step(step), _d(d) {}
        -
        47 
        -
        48  position_iterator(position_iterator const& p) : _p(p._p), _step(p._step), _d(p._d) {}
        -
        49 
        -
        50  template <typename D>
        -
        51  position_iterator(position_iterator<D,Dim> const& p) : _p(p._p), _step(p._step), _d(p._d) {}
        -
        52 
        -
        53  auto operator=(position_iterator const& p) -> position_iterator&
        -
        54  {
        -
        55  _p=p._p;
        -
        56  _d=p._d;
        -
        57  _step=p._step;
        -
        58  return *this;
        -
        59  }
        -
        60 
        -
        61  auto pos() const -> point_t const& { return _p; }
        -
        62  auto step() const -> point_t const& { return _step; }
        -
        63  auto deref_fn() const -> Deref const& { return _d; }
        -
        64 
        -
        65  void set_step(difference_type s) { _step[Dim]=s; }
        -
        68  auto operator[](difference_type d) const -> reference
        -
        69  {
        -
        70  point_t p=_p;
        -
        71  p[Dim]+=d*_step[Dim];
        -
        72  return _d(p);
        -
        73  }
        -
        74 
        -
        75 private:
        -
        76  point_t _p, _step;
        -
        77  Deref _d;
        -
        78 
        -
        79  template <typename DE, int DI> friend struct position_iterator;
        -
        80  friend class boost::iterator_core_access;
        -
        81  reference dereference() const { return _d(_p); }
        -
        82  void increment() { _p[Dim]+=_step[Dim]; }
        -
        83  void decrement() { _p[Dim]-=_step[Dim]; }
        -
        84  void advance(difference_type d) { _p[Dim]+=d*_step[Dim]; }
        -
        85 
        -
        86  difference_type distance_to(const position_iterator& it) const { return (it._p[Dim]-_p[Dim])/_step[Dim]; }
        -
        87  bool equal(const position_iterator& it) const { return _p==it._p; }
        -
        88 };
        -
        89 
        -
        90 template <typename Deref,int Dim>
        -
        91 struct const_iterator_type<position_iterator<Deref,Dim> > {
        -
        92  using type = position_iterator<typename Deref::const_t,Dim>;
        -
        93 };
        -
        94 
        -
        95 template <typename Deref, int Dim>
        -
        96 struct iterator_is_mutable<position_iterator<Deref, Dim>>
        -
        97  : std::integral_constant<bool, Deref::is_mutable>
        -
        98 {
        -
        99 };
        -
        100 
        -
        102 // PixelBasedConcept
        -
        104 
        -
        105 template <typename Deref,int Dim>
        -
        106 struct color_space_type<position_iterator<Deref,Dim> > : public color_space_type<typename Deref::value_type> {};
        -
        107 
        -
        108 template <typename Deref,int Dim>
        -
        109 struct channel_mapping_type<position_iterator<Deref,Dim> > : public channel_mapping_type<typename Deref::value_type> {};
        -
        110 
        -
        111 template <typename Deref,int Dim>
        -
        112 struct is_planar<position_iterator<Deref, Dim>> : std::false_type {};
        -
        113 
        -
        114 template <typename Deref,int Dim>
        -
        115 struct channel_type<position_iterator<Deref,Dim> > : public channel_type<typename Deref::value_type> {};
        -
        116 
        -
        118 // HasDynamicXStepTypeConcept
        -
        120 
        -
        121 template <typename Deref,int Dim>
        -
        122 struct dynamic_x_step_type<position_iterator<Deref,Dim> > {
        -
        123  using type = position_iterator<Deref,Dim>;
        -
        124 };
        -
        125 
        -
        126 } } // namespace boost::gil
        -
        127 
        -
        128 #endif
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_POSITION_ITERATOR_HPP
        +
        9#define BOOST_GIL_POSITION_ITERATOR_HPP
        +
        10
        +
        11#include <boost/gil/locator.hpp>
        +
        12
        +
        13#include <boost/iterator/iterator_facade.hpp>
        +
        14
        +
        15#include <type_traits>
        +
        16
        +
        17namespace boost { namespace gil {
        +
        18
        +
        23
        +
        30template <typename Deref, int Dim>
        +
        +
        31struct position_iterator : public iterator_facade<position_iterator<Deref,Dim>,
        +
        32 typename Deref::value_type,
        +
        33 std::random_access_iterator_tag,
        +
        34 typename Deref::reference,
        +
        35 typename Deref::argument_type::template axis<Dim>::coord_t> {
        +
        36 using parent_t = iterator_facade<position_iterator<Deref,Dim>,
        +
        37 typename Deref::value_type,
        +
        38 std::random_access_iterator_tag,
        +
        39 typename Deref::reference,
        +
        40 typename Deref::argument_type::template axis<Dim>::coord_t>;
        +
        41 using difference_type = typename parent_t::difference_type;
        +
        42 using reference = typename parent_t::reference;
        +
        43 using point_t = typename Deref::argument_type;
        +
        44
        + +
        46 position_iterator(point_t const& p, point_t const& step, Deref const& d) : _p(p), _step(step), _d(d) {}
        +
        47
        +
        48 position_iterator(position_iterator const& p) : _p(p._p), _step(p._step), _d(p._d) {}
        +
        49
        +
        50 template <typename D>
        +
        51 position_iterator(position_iterator<D,Dim> const& p) : _p(p._p), _step(p._step), _d(p._d) {}
        +
        52
        +
        53 auto operator=(position_iterator const& p) -> position_iterator&
        +
        54 {
        +
        55 _p=p._p;
        +
        56 _d=p._d;
        +
        57 _step=p._step;
        +
        58 return *this;
        +
        59 }
        +
        60
        +
        61 auto pos() const -> point_t const& { return _p; }
        +
        62 auto step() const -> point_t const& { return _step; }
        +
        63 auto deref_fn() const -> Deref const& { return _d; }
        +
        64
        +
        65 void set_step(difference_type s) { _step[Dim]=s; }
        +
        +
        68 auto operator[](difference_type d) const -> reference
        +
        69 {
        +
        70 point_t p=_p;
        +
        71 p[Dim]+=d*_step[Dim];
        +
        72 return _d(p);
        +
        73 }
        +
        +
        74
        +
        75private:
        +
        76 point_t _p, _step;
        +
        77 Deref _d;
        +
        78
        +
        79 template <typename DE, int DI> friend struct position_iterator;
        +
        80 friend class boost::iterator_core_access;
        +
        81 reference dereference() const { return _d(_p); }
        +
        82 void increment() { _p[Dim]+=_step[Dim]; }
        +
        83 void decrement() { _p[Dim]-=_step[Dim]; }
        +
        84 void advance(difference_type d) { _p[Dim]+=d*_step[Dim]; }
        +
        85
        +
        86 difference_type distance_to(const position_iterator& it) const { return (it._p[Dim]-_p[Dim])/_step[Dim]; }
        +
        87 bool equal(const position_iterator& it) const { return _p==it._p; }
        +
        88};
        +
        +
        89
        +
        90template <typename Deref,int Dim>
        +
        91struct const_iterator_type<position_iterator<Deref,Dim> > {
        +
        92 using type = position_iterator<typename Deref::const_t,Dim>;
        +
        93};
        +
        94
        +
        95template <typename Deref, int Dim>
        +
        96struct iterator_is_mutable<position_iterator<Deref, Dim>>
        +
        97 : std::integral_constant<bool, Deref::is_mutable>
        +
        98{
        +
        99};
        +
        100
        +
        102// PixelBasedConcept
        +
        104
        +
        105template <typename Deref,int Dim>
        +
        106struct color_space_type<position_iterator<Deref,Dim> > : public color_space_type<typename Deref::value_type> {};
        +
        107
        +
        108template <typename Deref,int Dim>
        +
        109struct channel_mapping_type<position_iterator<Deref,Dim> > : public channel_mapping_type<typename Deref::value_type> {};
        +
        110
        +
        111template <typename Deref,int Dim>
        +
        112struct is_planar<position_iterator<Deref, Dim>> : std::false_type {};
        +
        113
        +
        114template <typename Deref,int Dim>
        +
        115struct channel_type<position_iterator<Deref,Dim> > : public channel_type<typename Deref::value_type> {};
        +
        116
        +
        118// HasDynamicXStepTypeConcept
        +
        120
        +
        121template <typename Deref,int Dim>
        +
        122struct dynamic_x_step_type<position_iterator<Deref,Dim> > {
        +
        123 using type = position_iterator<Deref,Dim>;
        +
        124};
        +
        125
        +
        126} } // namespace boost::gil
        +
        127
        +
        128#endif
        -
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition: algorithm.hpp:1087
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        An iterator that remembers its current X,Y position and invokes a function object with it upon derefe...
        Definition: position_iterator.hpp:35
        -
        auto operator[](difference_type d) const -> reference
        Definition: position_iterator.hpp:68
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        An iterator that remembers its current X,Y position and invokes a function object with it upon derefe...
        Definition position_iterator.hpp:35
        +
        auto operator[](difference_type d) const -> reference
        Definition position_iterator.hpp:68
        diff --git a/html/reference/premultiply_8hpp_source.html b/html/reference/premultiply_8hpp_source.html index 604131d48..6e09ed726 100644 --- a/html/reference/premultiply_8hpp_source.html +++ b/html/reference/premultiply_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: premultiply.hpp Source File @@ -27,149 +27,154 @@

        - + +/* @license-end */ + +
        -
        -
        premultiply.hpp
        +
        premultiply.hpp
        -
        1 //
        -
        2 // Copyright 2014 Bill Gallafent
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_PREMULTIPLY_HPP
        -
        9 #define BOOST_GIL_PREMULTIPLY_HPP
        -
        10 
        -
        11 #include <boost/gil/rgba.hpp>
        -
        12 #include <boost/gil/detail/mp11.hpp>
        -
        13 
        -
        14 #include <boost/core/ignore_unused.hpp>
        -
        15 
        -
        16 #include <type_traits>
        -
        17 
        -
        18 namespace boost { namespace gil {
        -
        19 
        -
        20 template <typename SrcP, typename DstP>
        -
        21 struct channel_premultiply
        -
        22 {
        -
        23  channel_premultiply(SrcP const & src, DstP & dst)
        -
        24  : src_(src), dst_(dst)
        -
        25  {}
        -
        26 
        -
        27  template <typename Channel>
        -
        28  void operator()(Channel /* channel */) const
        -
        29  {
        -
        30  // TODO: Explain why 'channel' input paramater is not used, or used as tag only.
        -
        31 
        -
        32  // @todo: need to do a "channel_convert" too, in case the channel types aren't the same?
        -
        33  get_color(dst_, Channel()) = channel_multiply(get_color(src_,Channel()), alpha_or_max(src_));
        -
        34  }
        -
        35  SrcP const & src_;
        -
        36  DstP & dst_;
        -
        37 };
        -
        38 
        -
        39 namespace detail
        -
        40 {
        -
        41  template <typename SrcP, typename DstP>
        -
        42  void assign_alpha_if(std::true_type, SrcP const &src, DstP &dst)
        -
        43  {
        -
        44  get_color(dst,alpha_t()) = alpha_or_max(src);
        -
        45  }
        -
        46 
        -
        47  template <typename SrcP, typename DstP>
        -
        48  void assign_alpha_if(std::false_type, SrcP const& src, DstP& dst)
        -
        49  {
        -
        50  // nothing to do
        -
        51  boost::ignore_unused(src);
        -
        52  boost::ignore_unused(dst);
        -
        53  }
        -
        54 }
        -
        55 
        -
        56 struct premultiply
        -
        57 {
        -
        58  template <typename SrcP, typename DstP>
        -
        59  void operator()(const SrcP& src, DstP& dst) const
        -
        60  {
        -
        61  using src_colour_space_t = typename color_space_type<SrcP>::type;
        -
        62  using dst_colour_space_t = typename color_space_type<DstP>::type;
        -
        63  using src_colour_channels = mp11::mp_remove<src_colour_space_t, alpha_t>;
        -
        64 
        -
        65  using has_alpha_t = std::integral_constant<bool, mp11::mp_contains<dst_colour_space_t, alpha_t>::value>;
        -
        66  mp11::mp_for_each<src_colour_channels>(channel_premultiply<SrcP, DstP>(src, dst));
        -
        67  detail::assign_alpha_if(has_alpha_t(), src, dst);
        -
        68  }
        -
        69 };
        -
        70 
        -
        71 template <typename SrcConstRefP, // const reference to the source pixel
        -
        72  typename DstP> // Destination pixel value (models PixelValueConcept)
        -
        73 class premultiply_deref_fn
        -
        74 {
        -
        75 public:
        -
        76  using const_t = premultiply_deref_fn<SrcConstRefP, DstP>;
        -
        77  using value_type = DstP;
        -
        78  using reference = value_type; // read-only dereferencing
        -
        79  using const_reference = const value_type &;
        -
        80  using argument_type = SrcConstRefP;
        -
        81  using result_type = reference;
        -
        82  static constexpr bool is_mutable = false;
        -
        83 
        -
        84  result_type operator()(argument_type srcP) const
        -
        85  {
        -
        86  result_type dstP;
        -
        87  premultiply()(srcP,dstP);
        -
        88  return dstP;
        -
        89  }
        -
        90 };
        -
        91 
        -
        92 template <typename SrcView, typename DstP>
        -
        93 struct premultiplied_view_type
        -
        94 {
        -
        95 private:
        -
        96  using src_pix_ref = typename SrcView::const_t::reference; // const reference to pixel in SrcView
        -
        97  using deref_t = premultiply_deref_fn<src_pix_ref, DstP>; // the dereference adaptor that performs color conversion
        -
        98  using add_ref_t = typename SrcView::template add_deref<deref_t>;
        -
        99 public:
        -
        100  using type = typename add_ref_t::type; // the color converted view type
        -
        101  static type make(SrcView const& sv) { return add_ref_t::make(sv, deref_t()); }
        -
        102 };
        -
        103 
        -
        104 template <typename DstP, typename View>
        -
        105 inline auto premultiply_view(View const& src)
        -
        106  -> typename premultiplied_view_type<View,DstP>::type
        -
        107 {
        -
        108  return premultiplied_view_type<View,DstP>::make(src);
        -
        109 }
        -
        110 
        -
        111 }} // namespace boost::gil
        -
        112 
        -
        113 #endif
        -
        auto channel_multiply(Channel a, Channel b) -> typename channel_traits< Channel >::value_type
        A function multiplying two channels. result = a * b / max_value.
        Definition: channel_algorithm.hpp:561
        -
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition: color_base_algorithm.hpp:190
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2014 Bill Gallafent
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_PREMULTIPLY_HPP
        +
        9#define BOOST_GIL_PREMULTIPLY_HPP
        +
        10
        +
        11#include <boost/gil/rgba.hpp>
        +
        12#include <boost/gil/detail/mp11.hpp>
        +
        13
        +
        14#include <boost/core/ignore_unused.hpp>
        +
        15
        +
        16#include <type_traits>
        +
        17
        +
        18namespace boost { namespace gil {
        +
        19
        +
        20template <typename SrcP, typename DstP>
        +
        21struct channel_premultiply
        +
        22{
        +
        23 channel_premultiply(SrcP const & src, DstP & dst)
        +
        24 : src_(src), dst_(dst)
        +
        25 {}
        +
        26
        +
        27 template <typename Channel>
        +
        28 void operator()(Channel /* channel */) const
        +
        29 {
        +
        30 // TODO: Explain why 'channel' input parameter is not used, or used as tag only.
        +
        31
        +
        32 // @todo: need to do a "channel_convert" too, in case the channel types aren't the same?
        +
        33 get_color(dst_, Channel()) = channel_multiply(get_color(src_,Channel()), alpha_or_max(src_));
        +
        34 }
        +
        35 SrcP const & src_;
        +
        36 DstP & dst_;
        +
        37};
        +
        38
        +
        39namespace detail
        +
        40{
        +
        41 template <typename SrcP, typename DstP>
        +
        42 void assign_alpha_if(std::true_type, SrcP const &src, DstP &dst)
        +
        43 {
        +
        44 get_color(dst,alpha_t()) = alpha_or_max(src);
        +
        45 }
        +
        46
        +
        47 template <typename SrcP, typename DstP>
        +
        48 void assign_alpha_if(std::false_type, SrcP const& src, DstP& dst)
        +
        49 {
        +
        50 // nothing to do
        +
        51 boost::ignore_unused(src);
        +
        52 boost::ignore_unused(dst);
        +
        53 }
        +
        54}
        +
        55
        +
        56struct premultiply
        +
        57{
        +
        58 template <typename SrcP, typename DstP>
        +
        59 void operator()(const SrcP& src, DstP& dst) const
        +
        60 {
        +
        61 using src_colour_space_t = typename color_space_type<SrcP>::type;
        +
        62 using dst_colour_space_t = typename color_space_type<DstP>::type;
        +
        63 using src_colour_channels = mp11::mp_remove<src_colour_space_t, alpha_t>;
        +
        64
        +
        65 using has_alpha_t = std::integral_constant<bool, mp11::mp_contains<dst_colour_space_t, alpha_t>::value>;
        +
        66 mp11::mp_for_each<src_colour_channels>(channel_premultiply<SrcP, DstP>(src, dst));
        +
        67 detail::assign_alpha_if(has_alpha_t(), src, dst);
        +
        68 }
        +
        69};
        +
        70
        +
        71template <typename SrcConstRefP, // const reference to the source pixel
        +
        72 typename DstP> // Destination pixel value (models PixelValueConcept)
        +
        73class premultiply_deref_fn
        +
        74{
        +
        75public:
        +
        76 using const_t = premultiply_deref_fn<SrcConstRefP, DstP>;
        +
        77 using value_type = DstP;
        +
        78 using reference = value_type; // read-only dereferencing
        +
        79 using const_reference = const value_type &;
        +
        80 using argument_type = SrcConstRefP;
        +
        81 using result_type = reference;
        +
        82 static constexpr bool is_mutable = false;
        +
        83
        +
        84 result_type operator()(argument_type srcP) const
        +
        85 {
        +
        86 result_type dstP;
        +
        87 premultiply()(srcP,dstP);
        +
        88 return dstP;
        +
        89 }
        +
        90};
        +
        91
        +
        92template <typename SrcView, typename DstP>
        +
        93struct premultiplied_view_type
        +
        94{
        +
        95private:
        +
        96 using src_pix_ref = typename SrcView::const_t::reference; // const reference to pixel in SrcView
        +
        97 using deref_t = premultiply_deref_fn<src_pix_ref, DstP>; // the dereference adaptor that performs color conversion
        +
        98 using add_ref_t = typename SrcView::template add_deref<deref_t>;
        +
        99public:
        +
        100 using type = typename add_ref_t::type; // the color converted view type
        +
        101 static type make(SrcView const& sv) { return add_ref_t::make(sv, deref_t()); }
        +
        102};
        +
        103
        +
        104template <typename DstP, typename View>
        +
        105inline auto premultiply_view(View const& src)
        +
        106 -> typename premultiplied_view_type<View,DstP>::type
        +
        107{
        +
        108 return premultiplied_view_type<View,DstP>::make(src);
        +
        109}
        +
        110
        +
        111}} // namespace boost::gil
        +
        112
        +
        113#endif
        +
        auto channel_multiply(Channel a, Channel b) -> typename channel_traits< Channel >::value_type
        A function multiplying two channels. result = a * b / max_value.
        Definition channel_algorithm.hpp:561
        +
        auto get_color(ColorBase &cb, Color=Color()) -> typename color_element_reference_type< ColorBase, Color >::type
        Mutable accessor to the element associated with a given color name.
        Definition color_base_algorithm.hpp:190
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/promote__integral_8hpp_source.html b/html/reference/promote__integral_8hpp_source.html index bdeb03166..ac65174c5 100644 --- a/html/reference/promote__integral_8hpp_source.html +++ b/html/reference/promote__integral_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: promote_integral.hpp Source File @@ -27,202 +27,209 @@

        - + +/* @license-end */ + +
        -
        -
        promote_integral.hpp
        +
        promote_integral.hpp
        -
        1 // Boost.GIL (Generic Image Library)
        -
        2 //
        -
        3 // Copyright (c) 2015, Oracle and/or its affiliates.
        -
        4 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
        -
        5 //
        -
        6 // Copyright (c) 2020, Debabrata Mandal <mandaldebabrata123@gmail.com>
        -
        7 //
        -
        8 // Licensed under the Boost Software License version 1.0.
        -
        9 // http://www.boost.org/users/license.html
        -
        10 //
        -
        11 // Source: Boost.Geometry (aka GGL, Generic Geometry Library)
        -
        12 // Modifications: adapted for Boost.GIL
        -
        13 // - Rename namespace boost::geometry to boost::gil
        -
        14 // - Rename include guards
        -
        15 // - Remove support for boost::multiprecision types
        -
        16 // - Remove support for 128-bit integer types
        -
        17 // - Replace mpl meta functions with mp11 equivalents
        -
        18 //
        -
        19 #ifndef BOOST_GIL_PROMOTE_INTEGRAL_HPP
        -
        20 #define BOOST_GIL_PROMOTE_INTEGRAL_HPP
        -
        21 
        -
        22 #include <boost/mp11/list.hpp>
        -
        23 
        -
        24 #include <climits>
        -
        25 #include <cstddef>
        -
        26 #include <type_traits>
        -
        27 
        -
        28 namespace boost { namespace gil
        -
        29 {
        -
        30 
        -
        31 namespace detail { namespace promote_integral
        -
        32 {
        -
        33 
        -
        34 // meta-function that returns the bit size of a type
        -
        35 template
        -
        36 <
        -
        37  typename T,
        -
        38  bool IsFundamental = std::is_fundamental<T>::value
        -
        39 >
        -
        40 struct bit_size {};
        -
        41 
        -
        42 // for fundamental types, just return CHAR_BIT * sizeof(T)
        -
        43 template <typename T>
        -
        44 struct bit_size<T, true> : std::integral_constant<std::size_t, (CHAR_BIT * sizeof(T))> {};
        -
        45 
        -
        46 template
        -
        47 <
        -
        48  typename T,
        -
        49  typename IntegralTypes,
        -
        50  std::size_t MinSize
        -
        51 >
        -
        52 struct promote_to_larger
        -
        53 {
        -
        54  using current_type = boost::mp11::mp_first<IntegralTypes>;
        -
        55  using list_after_front = boost::mp11::mp_rest<IntegralTypes>;
        -
        56 
        -
        57  using type = typename std::conditional
        -
        58  <
        -
        59  (bit_size<current_type>::value >= MinSize),
        -
        60  current_type,
        -
        61  typename promote_to_larger
        -
        62  <
        -
        63  T,
        -
        64  list_after_front,
        -
        65  MinSize
        -
        66  >::type
        -
        67  >::type;
        -
        68 };
        -
        69 
        -
        70 // The following specialization is required to finish the loop over
        -
        71 // all list elements
        -
        72 template <typename T, std::size_t MinSize>
        -
        73 struct promote_to_larger<T, boost::mp11::mp_list<>, MinSize>
        -
        74 {
        -
        75  // if promotion fails, keep the number T
        -
        76  // (and cross fingers that overflow will not occur)
        -
        77  using type = T;
        -
        78 };
        -
        79 
        -
        80 }} // namespace detail::promote_integral
        -
        81 
        -
        114 template
        -
        115 <
        -
        116  typename T,
        -
        117  bool PromoteUnsignedToUnsigned = false,
        -
        118  bool UseCheckedInteger = false,
        -
        119  bool IsIntegral = std::is_integral<T>::value
        -
        120 >
        - -
        122 {
        -
        123 private:
        -
        124  static bool const is_unsigned = std::is_unsigned<T>::value;
        -
        125 
        -
        126  using bit_size_type = detail::promote_integral::bit_size<T>;
        -
        127 
        -
        128  // Define the minimum size (in bits) needed for the promoted type
        -
        129  // If T is the input type and P the promoted type, then the
        -
        130  // minimum number of bits for P are (below b stands for the number
        -
        131  // of bits of T):
        -
        132  // * if T is unsigned and P is unsigned: 2 * b
        -
        133  // * if T is signed and P is signed: 2 * b - 1
        -
        134  // * if T is unsigned and P is signed: 2 * b + 1
        -
        135  using min_bit_size_type = typename std::conditional
        -
        136  <
        -
        137  (PromoteUnsignedToUnsigned && is_unsigned),
        -
        138  std::integral_constant<std::size_t, (2 * bit_size_type::value)>,
        -
        139  typename std::conditional
        -
        140  <
        -
        141  is_unsigned,
        -
        142  std::integral_constant<std::size_t, (2 * bit_size_type::value + 1)>,
        -
        143  std::integral_constant<std::size_t, (2 * bit_size_type::value - 1)>
        -
        144  >::type
        -
        145  >::type;
        -
        146 
        -
        147  // Define the list of signed integral types we are going to use
        -
        148  // for promotion
        -
        149  using signed_integral_types = boost::mp11::mp_list
        -
        150  <
        -
        151  short, int, long
        -
        152 #if defined(BOOST_HAS_LONG_LONG)
        -
        153  , boost::long_long_type
        -
        154 #endif
        -
        155  >;
        -
        156 
        -
        157  // Define the list of unsigned integral types we are going to use
        -
        158  // for promotion
        -
        159  using unsigned_integral_types = boost::mp11::mp_list
        -
        160  <
        -
        161  unsigned short, unsigned int, unsigned long, std::size_t
        -
        162 #if defined(BOOST_HAS_LONG_LONG)
        -
        163  , boost::ulong_long_type
        -
        164 #endif
        -
        165  >;
        -
        166 
        -
        167  // Define the list of integral types that will be used for
        -
        168  // promotion (depending in whether we was to promote unsigned to
        -
        169  // unsigned or not)
        -
        170  using integral_types = typename std::conditional
        -
        171  <
        -
        172  (is_unsigned && PromoteUnsignedToUnsigned),
        -
        173  unsigned_integral_types,
        -
        174  signed_integral_types
        -
        175  >::type;
        -
        176 
        -
        177 public:
        -
        178  using type = typename detail::promote_integral::promote_to_larger
        -
        179  <
        -
        180  T,
        -
        181  integral_types,
        -
        182  min_bit_size_type::value
        -
        183  >::type;
        -
        184 };
        -
        185 
        -
        186 
        -
        187 template <typename T, bool PromoteUnsignedToUnsigned, bool UseCheckedInteger>
        -
        188 class promote_integral
        -
        189  <
        -
        190  T, PromoteUnsignedToUnsigned, UseCheckedInteger, false
        -
        191  >
        -
        192 {
        -
        193 public:
        -
        194  using type = T;
        -
        195 };
        -
        196 
        -
        197 }} // namespace boost::gil
        -
        198 
        -
        199 #endif // BOOST_GIL_PROMOTE_INTEGRAL_HPP
        -
        Meta-function to define an integral type with size than is (roughly) twice the bit size of T.
        Definition: promote_integral.hpp:122
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1// Boost.GIL (Generic Image Library)
        +
        2//
        +
        3// Copyright (c) 2015, Oracle and/or its affiliates.
        +
        4// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
        +
        5//
        +
        6// Copyright (c) 2020, Debabrata Mandal <mandaldebabrata123@gmail.com>
        +
        7//
        +
        8// Licensed under the Boost Software License version 1.0.
        +
        9// http://www.boost.org/users/license.html
        +
        10//
        +
        11// Source: Boost.Geometry (aka GGL, Generic Geometry Library)
        +
        12// Modifications: adapted for Boost.GIL
        +
        13// - Rename namespace boost::geometry to boost::gil
        +
        14// - Rename include guards
        +
        15// - Remove support for boost::multiprecision types
        +
        16// - Remove support for 128-bit integer types
        +
        17// - Replace mpl meta functions with mp11 equivalents
        +
        18//
        +
        19#ifndef BOOST_GIL_PROMOTE_INTEGRAL_HPP
        +
        20#define BOOST_GIL_PROMOTE_INTEGRAL_HPP
        +
        21
        +
        22#include <boost/mp11/list.hpp>
        +
        23
        +
        24#include <climits>
        +
        25#include <cstddef>
        +
        26#include <type_traits>
        +
        27
        +
        28namespace boost { namespace gil
        +
        29{
        +
        30
        +
        31namespace detail { namespace promote_integral
        +
        32{
        +
        33
        +
        34// meta-function that returns the bit size of a type
        +
        35template
        +
        36<
        +
        37 typename T,
        +
        38 bool IsFundamental = std::is_fundamental<T>::value
        +
        39>
        +
        40struct bit_size {};
        +
        41
        +
        42// for fundamental types, just return CHAR_BIT * sizeof(T)
        +
        43template <typename T>
        +
        44struct bit_size<T, true> : std::integral_constant<std::size_t, (CHAR_BIT * sizeof(T))> {};
        +
        45
        +
        46template
        +
        47<
        +
        48 typename T,
        +
        49 typename IntegralTypes,
        +
        50 std::size_t MinSize
        +
        51>
        +
        52struct promote_to_larger
        +
        53{
        +
        54 using current_type = boost::mp11::mp_first<IntegralTypes>;
        +
        55 using list_after_front = boost::mp11::mp_rest<IntegralTypes>;
        +
        56
        +
        57 using type = typename std::conditional
        +
        58 <
        +
        59 (bit_size<current_type>::value >= MinSize),
        +
        60 current_type,
        +
        61 typename promote_to_larger
        +
        62 <
        +
        63 T,
        +
        64 list_after_front,
        +
        65 MinSize
        +
        66 >::type
        +
        67 >::type;
        +
        68};
        +
        69
        +
        70// The following specialization is required to finish the loop over
        +
        71// all list elements
        +
        72template <typename T, std::size_t MinSize>
        +
        73struct promote_to_larger<T, boost::mp11::mp_list<>, MinSize>
        +
        74{
        +
        75 // if promotion fails, keep the number T
        +
        76 // (and cross fingers that overflow will not occur)
        +
        77 using type = T;
        +
        78};
        +
        79
        +
        80}} // namespace detail::promote_integral
        +
        81
        +
        114template
        +
        115<
        +
        116 typename T,
        +
        117 bool PromoteUnsignedToUnsigned = false,
        +
        118 bool UseCheckedInteger = false,
        +
        119 bool IsIntegral = std::is_integral<T>::value
        +
        120>
        +
        + +
        122{
        +
        123private:
        +
        124 static bool const is_unsigned = std::is_unsigned<T>::value;
        +
        125
        +
        126 using bit_size_type = detail::promote_integral::bit_size<T>;
        +
        127
        +
        128 // Define the minimum size (in bits) needed for the promoted type
        +
        129 // If T is the input type and P the promoted type, then the
        +
        130 // minimum number of bits for P are (below b stands for the number
        +
        131 // of bits of T):
        +
        132 // * if T is unsigned and P is unsigned: 2 * b
        +
        133 // * if T is signed and P is signed: 2 * b - 1
        +
        134 // * if T is unsigned and P is signed: 2 * b + 1
        +
        135 using min_bit_size_type = typename std::conditional
        +
        136 <
        +
        137 (PromoteUnsignedToUnsigned && is_unsigned),
        +
        138 std::integral_constant<std::size_t, (2 * bit_size_type::value)>,
        +
        139 typename std::conditional
        +
        140 <
        +
        141 is_unsigned,
        +
        142 std::integral_constant<std::size_t, (2 * bit_size_type::value + 1)>,
        +
        143 std::integral_constant<std::size_t, (2 * bit_size_type::value - 1)>
        +
        144 >::type
        +
        145 >::type;
        +
        146
        +
        147 // Define the list of signed integral types we are going to use
        +
        148 // for promotion
        +
        149 using signed_integral_types = boost::mp11::mp_list
        +
        150 <
        +
        151 short, int, long
        +
        152#if defined(BOOST_HAS_LONG_LONG)
        +
        153 , boost::long_long_type
        +
        154#endif
        +
        155 >;
        +
        156
        +
        157 // Define the list of unsigned integral types we are going to use
        +
        158 // for promotion
        +
        159 using unsigned_integral_types = boost::mp11::mp_list
        +
        160 <
        +
        161 unsigned short, unsigned int, unsigned long, std::size_t
        +
        162#if defined(BOOST_HAS_LONG_LONG)
        +
        163 , boost::ulong_long_type
        +
        164#endif
        +
        165 >;
        +
        166
        +
        167 // Define the list of integral types that will be used for
        +
        168 // promotion (depending in whether we was to promote unsigned to
        +
        169 // unsigned or not)
        +
        170 using integral_types = typename std::conditional
        +
        171 <
        +
        172 (is_unsigned && PromoteUnsignedToUnsigned),
        +
        173 unsigned_integral_types,
        +
        174 signed_integral_types
        +
        175 >::type;
        +
        176
        +
        177public:
        +
        178 using type = typename detail::promote_integral::promote_to_larger
        +
        179 <
        +
        180 T,
        +
        181 integral_types,
        +
        182 min_bit_size_type::value
        +
        183 >::type;
        +
        184};
        +
        +
        185
        +
        186
        +
        187template <typename T, bool PromoteUnsignedToUnsigned, bool UseCheckedInteger>
        + +
        189 <
        +
        190 T, PromoteUnsignedToUnsigned, UseCheckedInteger, false
        +
        191 >
        +
        192{
        +
        193public:
        +
        194 using type = T;
        +
        195};
        +
        196
        +
        197}} // namespace boost::gil
        +
        198
        +
        199#endif // BOOST_GIL_PROMOTE_INTEGRAL_HPP
        +
        Meta-function to define an integral type with size than is (roughly) twice the bit size of T.
        Definition promote_integral.hpp:122
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/raw_8hpp_source.html b/html/reference/raw_8hpp_source.html index a4feb4be7..e6f813dc9 100644 --- a/html/reference/raw_8hpp_source.html +++ b/html/reference/raw_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: raw.hpp Source File @@ -27,46 +27,51 @@

        - + +/* @license-end */ + +
        -
        -
        raw.hpp
        +
        raw.hpp
        -
        1 //
        -
        2 // Copyright 2013 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_EXTENSION_IO_RAW_HPP
        -
        9 #define BOOST_GIL_EXTENSION_IO_RAW_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/io/raw/read.hpp>
        -
        12 
        -
        13 #endif
        +
        1//
        +
        2// Copyright 2013 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_EXTENSION_IO_RAW_HPP
        +
        9#define BOOST_GIL_EXTENSION_IO_RAW_HPP
        +
        10
        +
        11#include <boost/gil/extension/io/raw/read.hpp>
        +
        12
        +
        13#endif
        diff --git a/html/reference/read__and__convert__image_8hpp_source.html b/html/reference/read__and__convert__image_8hpp_source.html index 40e5bda08..0e97ccfd3 100644 --- a/html/reference/read__and__convert__image_8hpp_source.html +++ b/html/reference/read__and__convert__image_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: read_and_convert_image.hpp Source File @@ -27,254 +27,261 @@

        - + +/* @license-end */ + +
        -
        -
        read_and_convert_image.hpp
        +
        read_and_convert_image.hpp
        -
        1 //
        -
        2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_READ_AND_CONVERT_IMAGE_HPP
        -
        9 #define BOOST_GIL_IO_READ_AND_CONVERT_IMAGE_HPP
        -
        10 
        -
        11 #include <boost/gil/io/base.hpp>
        -
        12 #include <boost/gil/io/conversion_policies.hpp>
        -
        13 #include <boost/gil/io/device.hpp>
        -
        14 #include <boost/gil/io/get_reader.hpp>
        -
        15 #include <boost/gil/io/path_spec.hpp>
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost{ namespace gil {
        -
        21 
        -
        23 
        -
        30 template <typename Reader, typename Image>
        -
        31 inline
        -
        32 void read_and_convert_image(Reader& reader, Image& img,
        -
        33  typename std::enable_if
        -
        34  <
        -
        35  mp11::mp_and
        -
        36  <
        -
        37  detail::is_reader<Reader>,
        -
        38  is_format_tag<typename Reader::format_tag_t>
        -
        39  >::value
        -
        40  >::type* /*dummy*/ = nullptr)
        -
        41 {
        -
        42  reader.init_image(img, reader._settings);
        -
        43  reader.apply(view(img));
        -
        44 }
        -
        45 
        -
        52 template <typename Device, typename Image, typename ColorConverter, typename FormatTag>
        -
        53 inline
        - -
        55  Device& device,
        -
        56  Image& img,
        -
        57  image_read_settings<FormatTag> const& settings,
        -
        58  ColorConverter const& cc,
        -
        59  typename std::enable_if
        -
        60  <
        -
        61  mp11::mp_and
        -
        62  <
        -
        63  detail::is_read_device<FormatTag, Device>,
        -
        64  is_format_tag<FormatTag>
        -
        65  >::value
        -
        66  >::type* /*dummy*/ = nullptr)
        -
        67 {
        -
        68  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        -
        69  using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        -
        70 
        -
        71  reader_t reader = make_reader(device, settings, read_and_convert_t{cc});
        -
        72  read_and_convert_image(reader, img);
        -
        73 }
        -
        74 
        -
        81 template <typename String, typename Image, typename ColorConverter, typename FormatTag>
        -
        82 inline
        - -
        84  String const& file_name,
        -
        85  Image& img,
        -
        86  image_read_settings<FormatTag> const& settings,
        -
        87  ColorConverter const& cc,
        -
        88  typename std::enable_if
        -
        89  <
        -
        90  mp11::mp_and
        -
        91  <
        -
        92  is_format_tag<FormatTag>,
        -
        93  detail::is_supported_path_spec<String>
        -
        94  >::value
        -
        95  >::type* /*dummy*/ = nullptr)
        -
        96 {
        -
        97  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        -
        98  using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        -
        99 
        -
        100  reader_t reader = make_reader(file_name, settings, read_and_convert_t{cc});
        -
        101  read_and_convert_image(reader, img);
        -
        102 }
        -
        103 
        -
        110 template <typename String, typename Image, typename ColorConverter, typename FormatTag>
        -
        111 inline
        - -
        113  String const& file_name,
        -
        114  Image& img,
        -
        115  ColorConverter const& cc,
        -
        116  FormatTag const& tag,
        -
        117  typename std::enable_if
        -
        118  <
        -
        119  mp11::mp_and
        -
        120  <
        -
        121  is_format_tag<FormatTag>,
        -
        122  detail::is_supported_path_spec<String>
        -
        123  >::value
        -
        124  >::type* /*dummy*/ = nullptr)
        -
        125 {
        -
        126  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        -
        127  using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        -
        128 
        -
        129  reader_t reader = make_reader(file_name, tag, read_and_convert_t{cc});
        -
        130  read_and_convert_image(reader, img);
        -
        131 }
        -
        132 
        -
        139 template <typename Device, typename Image, typename ColorConverter, typename FormatTag>
        -
        140 inline
        - -
        142  Device& device,
        -
        143  Image& img,
        -
        144  ColorConverter const& cc,
        -
        145  FormatTag const& tag,
        -
        146  typename std::enable_if
        -
        147  <
        -
        148  mp11::mp_and
        -
        149  <
        -
        150  detail::is_read_device<FormatTag, Device>,
        -
        151  is_format_tag<FormatTag>
        -
        152  >::value
        -
        153  >::type* /*dummy*/ = nullptr)
        -
        154 {
        -
        155  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        -
        156  using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        -
        157 
        -
        158  reader_t reader = make_reader(device, tag, read_and_convert_t{cc});
        -
        159  read_and_convert_image(reader, img);
        -
        160 }
        -
        161 
        -
        167 template <typename String, typename Image, typename FormatTag>
        -
        168 inline void read_and_convert_image(
        -
        169  String const& file_name,
        -
        170  Image& img,
        -
        171  image_read_settings<FormatTag> const& settings,
        -
        172  typename std::enable_if
        -
        173  <
        -
        174  mp11::mp_and
        -
        175  <
        -
        176  is_format_tag<FormatTag>,
        -
        177  detail::is_supported_path_spec<String>
        -
        178  >::value
        -
        179  >::type* /*dummy*/ = nullptr)
        -
        180 {
        -
        181  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        -
        182  using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        -
        183 
        -
        184  reader_t reader = make_reader(file_name, settings, read_and_convert_t{});
        -
        185  read_and_convert_image(reader, img);
        -
        186 }
        -
        187 
        -
        193 template <typename Device, typename Image, typename FormatTag>
        -
        194 inline void read_and_convert_image(
        -
        195  Device& device,
        -
        196  Image& img,
        -
        197  image_read_settings<FormatTag> const& settings,
        -
        198  typename std::enable_if
        -
        199  <
        -
        200  mp11::mp_and
        -
        201  <
        -
        202  detail::is_read_device<FormatTag, Device>,
        -
        203  is_format_tag<FormatTag>
        -
        204  >::value
        -
        205  >::type* /*dummy*/ = nullptr)
        -
        206 {
        -
        207  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        -
        208  using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        -
        209 
        -
        210  reader_t reader = make_reader(device, settings, read_and_convert_t{});
        -
        211  read_and_convert_image(reader, img);
        -
        212 }
        -
        213 
        -
        219 template <typename String, typename Image, typename FormatTag>
        -
        220 inline
        - -
        222  String const& file_name,
        -
        223  Image& img,
        -
        224  FormatTag const& tag,
        -
        225  typename std::enable_if
        -
        226  <
        -
        227  mp11::mp_and
        -
        228  <
        -
        229  is_format_tag<FormatTag>,
        -
        230  detail::is_supported_path_spec<String>
        -
        231  >::value
        -
        232  >::type* /*dummy*/ = nullptr)
        -
        233 {
        -
        234  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        -
        235  using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        -
        236 
        -
        237  reader_t reader = make_reader(file_name, tag, read_and_convert_t{});
        -
        238  read_and_convert_image(reader, img);
        -
        239 }
        -
        240 
        -
        246 template <typename Device, typename Image, typename FormatTag>
        -
        247 inline void read_and_convert_image(
        -
        248  Device& device,
        -
        249  Image& img,
        -
        250  FormatTag const& tag,
        -
        251  typename std::enable_if
        -
        252  <
        -
        253  mp11::mp_and
        -
        254  <
        -
        255  detail::is_read_device<FormatTag, Device>,
        -
        256  is_format_tag<FormatTag>
        -
        257  >::value
        -
        258  >::type* /*dummy*/ = nullptr)
        -
        259 {
        -
        260  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        -
        261  using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        -
        262 
        -
        263  reader_t reader = make_reader(device, tag, read_and_convert_t{});
        -
        264  read_and_convert_image(reader, img);
        -
        265 }
        -
        266 
        -
        267 }} // namespace boost::gil
        -
        268 
        -
        269 #endif
        -
        void read_and_convert_image(Reader &reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads and color-converts an image. Image memory is allocated.
        Definition: read_and_convert_image.hpp:32
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_READ_AND_CONVERT_IMAGE_HPP
        +
        9#define BOOST_GIL_IO_READ_AND_CONVERT_IMAGE_HPP
        +
        10
        +
        11#include <boost/gil/io/base.hpp>
        +
        12#include <boost/gil/io/conversion_policies.hpp>
        +
        13#include <boost/gil/io/device.hpp>
        +
        14#include <boost/gil/io/get_reader.hpp>
        +
        15#include <boost/gil/io/path_spec.hpp>
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17
        +
        18#include <type_traits>
        +
        19
        +
        20namespace boost{ namespace gil {
        +
        21
        +
        23
        +
        30template <typename Reader, typename Image>
        +
        31inline
        +
        +
        32void read_and_convert_image(Reader& reader, Image& img,
        +
        33 typename std::enable_if
        +
        34 <
        +
        35 mp11::mp_and
        +
        36 <
        +
        37 detail::is_reader<Reader>,
        +
        38 is_format_tag<typename Reader::format_tag_t>
        +
        39 >::value
        +
        40 >::type* /*dummy*/ = nullptr)
        +
        41{
        +
        42 reader.init_image(img, reader._settings);
        +
        43 reader.apply(view(img));
        +
        44}
        +
        +
        45
        +
        52template <typename Device, typename Image, typename ColorConverter, typename FormatTag>
        +
        53inline
        + +
        55 Device& device,
        +
        56 Image& img,
        +
        57 image_read_settings<FormatTag> const& settings,
        +
        58 ColorConverter const& cc,
        +
        59 typename std::enable_if
        +
        60 <
        +
        61 mp11::mp_and
        +
        62 <
        +
        63 detail::is_read_device<FormatTag, Device>,
        +
        64 is_format_tag<FormatTag>
        +
        65 >::value
        +
        66 >::type* /*dummy*/ = nullptr)
        +
        67{
        +
        68 using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        +
        69 using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        +
        70
        +
        71 reader_t reader = make_reader(device, settings, read_and_convert_t{cc});
        +
        72 read_and_convert_image(reader, img);
        +
        73}
        +
        74
        +
        81template <typename String, typename Image, typename ColorConverter, typename FormatTag>
        +
        82inline
        + +
        84 String const& file_name,
        +
        85 Image& img,
        +
        86 image_read_settings<FormatTag> const& settings,
        +
        87 ColorConverter const& cc,
        +
        88 typename std::enable_if
        +
        89 <
        +
        90 mp11::mp_and
        +
        91 <
        +
        92 is_format_tag<FormatTag>,
        +
        93 detail::is_supported_path_spec<String>
        +
        94 >::value
        +
        95 >::type* /*dummy*/ = nullptr)
        +
        96{
        +
        97 using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        +
        98 using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        +
        99
        +
        100 reader_t reader = make_reader(file_name, settings, read_and_convert_t{cc});
        +
        101 read_and_convert_image(reader, img);
        +
        102}
        +
        103
        +
        110template <typename String, typename Image, typename ColorConverter, typename FormatTag>
        +
        111inline
        + +
        113 String const& file_name,
        +
        114 Image& img,
        +
        115 ColorConverter const& cc,
        +
        116 FormatTag const& tag,
        +
        117 typename std::enable_if
        +
        118 <
        +
        119 mp11::mp_and
        +
        120 <
        +
        121 is_format_tag<FormatTag>,
        +
        122 detail::is_supported_path_spec<String>
        +
        123 >::value
        +
        124 >::type* /*dummy*/ = nullptr)
        +
        125{
        +
        126 using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        +
        127 using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        +
        128
        +
        129 reader_t reader = make_reader(file_name, tag, read_and_convert_t{cc});
        +
        130 read_and_convert_image(reader, img);
        +
        131}
        +
        132
        +
        139template <typename Device, typename Image, typename ColorConverter, typename FormatTag>
        +
        140inline
        + +
        142 Device& device,
        +
        143 Image& img,
        +
        144 ColorConverter const& cc,
        +
        145 FormatTag const& tag,
        +
        146 typename std::enable_if
        +
        147 <
        +
        148 mp11::mp_and
        +
        149 <
        +
        150 detail::is_read_device<FormatTag, Device>,
        +
        151 is_format_tag<FormatTag>
        +
        152 >::value
        +
        153 >::type* /*dummy*/ = nullptr)
        +
        154{
        +
        155 using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        +
        156 using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        +
        157
        +
        158 reader_t reader = make_reader(device, tag, read_and_convert_t{cc});
        +
        159 read_and_convert_image(reader, img);
        +
        160}
        +
        161
        +
        167template <typename String, typename Image, typename FormatTag>
        +
        168inline void read_and_convert_image(
        +
        169 String const& file_name,
        +
        170 Image& img,
        +
        171 image_read_settings<FormatTag> const& settings,
        +
        172 typename std::enable_if
        +
        173 <
        +
        174 mp11::mp_and
        +
        175 <
        +
        176 is_format_tag<FormatTag>,
        +
        177 detail::is_supported_path_spec<String>
        +
        178 >::value
        +
        179 >::type* /*dummy*/ = nullptr)
        +
        180{
        +
        181 using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        +
        182 using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        +
        183
        +
        184 reader_t reader = make_reader(file_name, settings, read_and_convert_t{});
        +
        185 read_and_convert_image(reader, img);
        +
        186}
        +
        187
        +
        193template <typename Device, typename Image, typename FormatTag>
        +
        194inline void read_and_convert_image(
        +
        195 Device& device,
        +
        196 Image& img,
        +
        197 image_read_settings<FormatTag> const& settings,
        +
        198 typename std::enable_if
        +
        199 <
        +
        200 mp11::mp_and
        +
        201 <
        +
        202 detail::is_read_device<FormatTag, Device>,
        +
        203 is_format_tag<FormatTag>
        +
        204 >::value
        +
        205 >::type* /*dummy*/ = nullptr)
        +
        206{
        +
        207 using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        +
        208 using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        +
        209
        +
        210 reader_t reader = make_reader(device, settings, read_and_convert_t{});
        +
        211 read_and_convert_image(reader, img);
        +
        212}
        +
        213
        +
        219template <typename String, typename Image, typename FormatTag>
        +
        220inline
        + +
        222 String const& file_name,
        +
        223 Image& img,
        +
        224 FormatTag const& tag,
        +
        225 typename std::enable_if
        +
        226 <
        +
        227 mp11::mp_and
        +
        228 <
        +
        229 is_format_tag<FormatTag>,
        +
        230 detail::is_supported_path_spec<String>
        +
        231 >::value
        +
        232 >::type* /*dummy*/ = nullptr)
        +
        233{
        +
        234 using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        +
        235 using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        +
        236
        +
        237 reader_t reader = make_reader(file_name, tag, read_and_convert_t{});
        +
        238 read_and_convert_image(reader, img);
        +
        239}
        +
        240
        +
        246template <typename Device, typename Image, typename FormatTag>
        +
        247inline void read_and_convert_image(
        +
        248 Device& device,
        +
        249 Image& img,
        +
        250 FormatTag const& tag,
        +
        251 typename std::enable_if
        +
        252 <
        +
        253 mp11::mp_and
        +
        254 <
        +
        255 detail::is_read_device<FormatTag, Device>,
        +
        256 is_format_tag<FormatTag>
        +
        257 >::value
        +
        258 >::type* /*dummy*/ = nullptr)
        +
        259{
        +
        260 using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        +
        261 using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        +
        262
        +
        263 reader_t reader = make_reader(device, tag, read_and_convert_t{});
        +
        264 read_and_convert_image(reader, img);
        +
        265}
        +
        266
        +
        267}} // namespace boost::gil
        +
        268
        +
        269#endif
        +
        void read_and_convert_image(Reader &reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads and color-converts an image. Image memory is allocated.
        Definition read_and_convert_image.hpp:32
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/read__and__convert__view_8hpp_source.html b/html/reference/read__and__convert__view_8hpp_source.html index adc6c3916..54283fcf5 100644 --- a/html/reference/read__and__convert__view_8hpp_source.html +++ b/html/reference/read__and__convert__view_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: read_and_convert_view.hpp Source File @@ -27,258 +27,265 @@

        - + +/* @license-end */ + +
        -
        -
        read_and_convert_view.hpp
        +
        read_and_convert_view.hpp
        -
        1 //
        -
        2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_READ_AND_CONVERT_VIEW_HPP
        -
        9 #define BOOST_GIL_IO_READ_AND_CONVERT_VIEW_HPP
        -
        10 
        -
        11 #include <boost/gil/io/base.hpp>
        -
        12 #include <boost/gil/io/conversion_policies.hpp>
        -
        13 #include <boost/gil/io/device.hpp>
        -
        14 #include <boost/gil/io/get_reader.hpp>
        -
        15 #include <boost/gil/io/path_spec.hpp>
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost{ namespace gil {
        -
        21 
        -
        23 
        -
        30 template <typename Reader, typename View>
        -
        31 inline
        -
        32 void read_and_convert_view(Reader& reader, View const& view,
        -
        33  typename std::enable_if
        -
        34  <
        -
        35  mp11::mp_and
        -
        36  <
        -
        37  detail::is_reader<Reader>,
        -
        38  is_format_tag<typename Reader::format_tag_t>
        -
        39  >::value
        -
        40  >::type* /*dummy*/ = nullptr)
        -
        41 {
        -
        42  reader.check_image_size(view.dimensions());
        -
        43  reader.init_view(view, reader._settings);
        -
        44  reader.apply(view);
        -
        45 }
        -
        46 
        -
        53 template <typename Device, typename View, typename ColorConverter, typename FormatTag>
        -
        54 inline
        - -
        56  Device& device,
        -
        57  View const& view,
        -
        58  image_read_settings<FormatTag> const& settings,
        -
        59  ColorConverter const& cc,
        -
        60  typename std::enable_if
        -
        61  <
        -
        62  mp11::mp_and
        -
        63  <
        -
        64  detail::is_read_device<FormatTag, Device>,
        -
        65  is_format_tag<FormatTag>
        -
        66  >::value
        -
        67  >::type* /*dummy*/ = nullptr)
        -
        68 {
        -
        69  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        -
        70  using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        -
        71 
        -
        72  reader_t reader = make_reader(device, settings, read_and_convert_t{cc});
        -
        73  read_and_convert_view(reader, view);
        -
        74 }
        -
        75 
        -
        82 template <typename String, typename View, typename ColorConverter, typename FormatTag>
        -
        83 inline
        - -
        85  String const& file_name,
        -
        86  View const& view,
        -
        87  image_read_settings<FormatTag> const& settings,
        -
        88  ColorConverter const& cc,
        -
        89  typename std::enable_if
        -
        90  <
        -
        91  mp11::mp_and
        -
        92  <
        -
        93  is_format_tag<FormatTag>,
        -
        94  detail::is_supported_path_spec<String>
        -
        95  >::value
        -
        96  >::type* /*dummy*/ = nullptr)
        -
        97 {
        -
        98  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        -
        99  using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        -
        100 
        -
        101  reader_t reader = make_reader(file_name, settings, read_and_convert_t{cc});
        -
        102  read_and_convert_view(reader, view);
        -
        103 }
        -
        104 
        -
        111 template <typename String, typename View, typename ColorConverter, typename FormatTag>
        -
        112 inline
        - -
        114  String const& file_name,
        -
        115  View const& view,
        -
        116  ColorConverter const& cc,
        -
        117  FormatTag const& tag,
        -
        118  typename std::enable_if
        -
        119  <
        -
        120  mp11::mp_and
        -
        121  <
        -
        122  is_format_tag<FormatTag>,
        -
        123  detail::is_supported_path_spec<String>
        -
        124  >::value
        -
        125  >::type* /*dummy*/ = nullptr)
        -
        126 {
        -
        127  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        -
        128  using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        -
        129 
        -
        130  reader_t reader = make_reader(file_name, tag, read_and_convert_t{cc});
        -
        131  read_and_convert_view(reader, view);
        -
        132 }
        -
        133 
        -
        140 template <typename Device, typename View, typename ColorConverter, typename FormatTag>
        -
        141 inline
        - -
        143  Device& device,
        -
        144  View const& view,
        -
        145  ColorConverter const& cc,
        -
        146  FormatTag const& tag,
        -
        147  typename std::enable_if
        -
        148  <
        -
        149  mp11::mp_and
        -
        150  <
        -
        151  detail::is_read_device<FormatTag, Device>,
        -
        152  is_format_tag<FormatTag>
        -
        153  >::value
        -
        154  >::type* /*dummy*/ = nullptr)
        -
        155 {
        -
        156  using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        -
        157  using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        -
        158 
        -
        159  reader_t reader = make_reader(device, tag, read_and_convert_t{cc});
        -
        160  read_and_convert_view(reader, view);
        -
        161 }
        -
        162 
        -
        168 template <typename String, typename View, typename FormatTag>
        -
        169 inline
        - -
        171  String const& file_name,
        -
        172  View const& view,
        -
        173  image_read_settings<FormatTag> const& settings,
        -
        174  typename std::enable_if
        -
        175  <
        -
        176  mp11::mp_and
        -
        177  <
        -
        178  is_format_tag<FormatTag>,
        -
        179  detail::is_supported_path_spec<String>
        -
        180  >::value
        -
        181  >::type* /*dummy*/ = nullptr)
        -
        182 {
        -
        183  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        -
        184  using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        -
        185 
        -
        186  reader_t reader = make_reader(file_name, settings, read_and_convert_t{});
        -
        187  read_and_convert_view(reader, view);
        -
        188 }
        -
        189 
        -
        195 template <typename Device, typename View, typename FormatTag>
        -
        196 inline
        - -
        198  Device& device,
        -
        199  View const& view,
        -
        200  image_read_settings<FormatTag> const& settings,
        -
        201  typename std::enable_if
        -
        202  <
        -
        203  mp11::mp_and
        -
        204  <
        -
        205  detail::is_read_device<FormatTag, Device>,
        -
        206  is_format_tag<FormatTag>
        -
        207  >::value
        -
        208  >::type* /*dummy*/ = nullptr)
        -
        209 {
        -
        210  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        -
        211  using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        -
        212 
        -
        213  reader_t reader = make_reader(device, settings, read_and_convert_t{});
        -
        214  read_and_convert_view(reader, view);
        -
        215 }
        -
        216 
        -
        222 template <typename String, typename View, typename FormatTag>
        -
        223 inline
        - -
        225  String const& file_name,
        -
        226  View const& view,
        -
        227  FormatTag const& tag,
        -
        228  typename std::enable_if
        -
        229  <
        -
        230  mp11::mp_and
        -
        231  <
        -
        232  is_format_tag<FormatTag>,
        -
        233  detail::is_supported_path_spec<String>
        -
        234  >::value
        -
        235  >::type* /*dummy*/ = nullptr)
        -
        236 {
        -
        237  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        -
        238  using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        -
        239 
        -
        240  reader_t reader = make_reader(file_name, tag, read_and_convert_t{});
        -
        241  read_and_convert_view(reader, view);
        -
        242 }
        -
        243 
        -
        249 template <typename Device, typename View, typename FormatTag>
        -
        250 inline
        - -
        252  Device& device,
        -
        253  View const& view,
        -
        254  FormatTag const& tag,
        -
        255  typename std::enable_if
        -
        256  <
        -
        257  mp11::mp_and
        -
        258  <
        -
        259  detail::is_read_device<FormatTag, Device>,
        -
        260  is_format_tag<FormatTag>
        -
        261  >::value
        -
        262  >::type* /*dummy*/ = nullptr)
        -
        263 {
        -
        264  using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        -
        265  using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        -
        266 
        -
        267  reader_t reader = make_reader(device, tag, read_and_convert_t{});
        -
        268  read_and_convert_view(reader, view);
        -
        269 }
        -
        270 
        -
        271 }} // namespace boost::gill
        -
        272 
        -
        273 #endif
        -
        void read_and_convert_view(Reader &reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads and color-converts an image view. No memory is allocated.
        Definition: read_and_convert_view.hpp:32
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_READ_AND_CONVERT_VIEW_HPP
        +
        9#define BOOST_GIL_IO_READ_AND_CONVERT_VIEW_HPP
        +
        10
        +
        11#include <boost/gil/io/base.hpp>
        +
        12#include <boost/gil/io/conversion_policies.hpp>
        +
        13#include <boost/gil/io/device.hpp>
        +
        14#include <boost/gil/io/get_reader.hpp>
        +
        15#include <boost/gil/io/path_spec.hpp>
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17
        +
        18#include <type_traits>
        +
        19
        +
        20namespace boost{ namespace gil {
        +
        21
        +
        23
        +
        30template <typename Reader, typename View>
        +
        31inline
        +
        +
        32void read_and_convert_view(Reader& reader, View const& view,
        +
        33 typename std::enable_if
        +
        34 <
        +
        35 mp11::mp_and
        +
        36 <
        +
        37 detail::is_reader<Reader>,
        +
        38 is_format_tag<typename Reader::format_tag_t>
        +
        39 >::value
        +
        40 >::type* /*dummy*/ = nullptr)
        +
        41{
        +
        42 reader.check_image_size(view.dimensions());
        +
        43 reader.init_view(view, reader._settings);
        +
        44 reader.apply(view);
        +
        45}
        +
        +
        46
        +
        53template <typename Device, typename View, typename ColorConverter, typename FormatTag>
        +
        54inline
        + +
        56 Device& device,
        +
        57 View const& view,
        +
        58 image_read_settings<FormatTag> const& settings,
        +
        59 ColorConverter const& cc,
        +
        60 typename std::enable_if
        +
        61 <
        +
        62 mp11::mp_and
        +
        63 <
        +
        64 detail::is_read_device<FormatTag, Device>,
        +
        65 is_format_tag<FormatTag>
        +
        66 >::value
        +
        67 >::type* /*dummy*/ = nullptr)
        +
        68{
        +
        69 using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        +
        70 using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        +
        71
        +
        72 reader_t reader = make_reader(device, settings, read_and_convert_t{cc});
        + +
        74}
        +
        75
        +
        82template <typename String, typename View, typename ColorConverter, typename FormatTag>
        +
        83inline
        + +
        85 String const& file_name,
        +
        86 View const& view,
        +
        87 image_read_settings<FormatTag> const& settings,
        +
        88 ColorConverter const& cc,
        +
        89 typename std::enable_if
        +
        90 <
        +
        91 mp11::mp_and
        +
        92 <
        +
        93 is_format_tag<FormatTag>,
        +
        94 detail::is_supported_path_spec<String>
        +
        95 >::value
        +
        96 >::type* /*dummy*/ = nullptr)
        +
        97{
        +
        98 using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        +
        99 using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        +
        100
        +
        101 reader_t reader = make_reader(file_name, settings, read_and_convert_t{cc});
        + +
        103}
        +
        104
        +
        111template <typename String, typename View, typename ColorConverter, typename FormatTag>
        +
        112inline
        + +
        114 String const& file_name,
        +
        115 View const& view,
        +
        116 ColorConverter const& cc,
        +
        117 FormatTag const& tag,
        +
        118 typename std::enable_if
        +
        119 <
        +
        120 mp11::mp_and
        +
        121 <
        +
        122 is_format_tag<FormatTag>,
        +
        123 detail::is_supported_path_spec<String>
        +
        124 >::value
        +
        125 >::type* /*dummy*/ = nullptr)
        +
        126{
        +
        127 using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        +
        128 using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        +
        129
        +
        130 reader_t reader = make_reader(file_name, tag, read_and_convert_t{cc});
        + +
        132}
        +
        133
        +
        140template <typename Device, typename View, typename ColorConverter, typename FormatTag>
        +
        141inline
        + +
        143 Device& device,
        +
        144 View const& view,
        +
        145 ColorConverter const& cc,
        +
        146 FormatTag const& tag,
        +
        147 typename std::enable_if
        +
        148 <
        +
        149 mp11::mp_and
        +
        150 <
        +
        151 detail::is_read_device<FormatTag, Device>,
        +
        152 is_format_tag<FormatTag>
        +
        153 >::value
        +
        154 >::type* /*dummy*/ = nullptr)
        +
        155{
        +
        156 using read_and_convert_t = detail::read_and_convert<ColorConverter>;
        +
        157 using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        +
        158
        +
        159 reader_t reader = make_reader(device, tag, read_and_convert_t{cc});
        + +
        161}
        +
        162
        +
        168template <typename String, typename View, typename FormatTag>
        +
        169inline
        + +
        171 String const& file_name,
        +
        172 View const& view,
        +
        173 image_read_settings<FormatTag> const& settings,
        +
        174 typename std::enable_if
        +
        175 <
        +
        176 mp11::mp_and
        +
        177 <
        +
        178 is_format_tag<FormatTag>,
        +
        179 detail::is_supported_path_spec<String>
        +
        180 >::value
        +
        181 >::type* /*dummy*/ = nullptr)
        +
        182{
        +
        183 using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        +
        184 using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        +
        185
        +
        186 reader_t reader = make_reader(file_name, settings, read_and_convert_t{});
        + +
        188}
        +
        189
        +
        195template <typename Device, typename View, typename FormatTag>
        +
        196inline
        + +
        198 Device& device,
        +
        199 View const& view,
        +
        200 image_read_settings<FormatTag> const& settings,
        +
        201 typename std::enable_if
        +
        202 <
        +
        203 mp11::mp_and
        +
        204 <
        +
        205 detail::is_read_device<FormatTag, Device>,
        +
        206 is_format_tag<FormatTag>
        +
        207 >::value
        +
        208 >::type* /*dummy*/ = nullptr)
        +
        209{
        +
        210 using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        +
        211 using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        +
        212
        +
        213 reader_t reader = make_reader(device, settings, read_and_convert_t{});
        + +
        215}
        +
        216
        +
        222template <typename String, typename View, typename FormatTag>
        +
        223inline
        + +
        225 String const& file_name,
        +
        226 View const& view,
        +
        227 FormatTag const& tag,
        +
        228 typename std::enable_if
        +
        229 <
        +
        230 mp11::mp_and
        +
        231 <
        +
        232 is_format_tag<FormatTag>,
        +
        233 detail::is_supported_path_spec<String>
        +
        234 >::value
        +
        235 >::type* /*dummy*/ = nullptr)
        +
        236{
        +
        237 using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        +
        238 using reader_t = typename get_reader<String, FormatTag, read_and_convert_t>::type;
        +
        239
        +
        240 reader_t reader = make_reader(file_name, tag, read_and_convert_t{});
        + +
        242}
        +
        243
        +
        249template <typename Device, typename View, typename FormatTag>
        +
        250inline
        + +
        252 Device& device,
        +
        253 View const& view,
        +
        254 FormatTag const& tag,
        +
        255 typename std::enable_if
        +
        256 <
        +
        257 mp11::mp_and
        +
        258 <
        +
        259 detail::is_read_device<FormatTag, Device>,
        +
        260 is_format_tag<FormatTag>
        +
        261 >::value
        +
        262 >::type* /*dummy*/ = nullptr)
        +
        263{
        +
        264 using read_and_convert_t = detail::read_and_convert<default_color_converter>;
        +
        265 using reader_t = typename get_reader<Device, FormatTag, read_and_convert_t>::type;
        +
        266
        +
        267 reader_t reader = make_reader(device, tag, read_and_convert_t{});
        + +
        269}
        +
        270
        +
        271}} // namespace boost::gill
        +
        272
        +
        273#endif
        +
        void read_and_convert_view(Reader &reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads and color-converts an image view. No memory is allocated.
        Definition read_and_convert_view.hpp:32
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/read__image_8hpp_source.html b/html/reference/read__image_8hpp_source.html index 36863ee99..40792d12f 100644 --- a/html/reference/read__image_8hpp_source.html +++ b/html/reference/read__image_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: read_image.hpp Source File @@ -27,279 +27,286 @@

        - + +/* @license-end */ + +
        -
        -
        read_image.hpp
        +
        read_image.hpp
        -
        1 //
        -
        2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_READ_IMAGE_HPP
        -
        9 #define BOOST_GIL_IO_READ_IMAGE_HPP
        -
        10 
        -
        11 #include <boost/gil/extension/toolbox/dynamic_images.hpp>
        -
        12 
        -
        13 #include <boost/gil/io/base.hpp>
        -
        14 #include <boost/gil/io/conversion_policies.hpp>
        -
        15 #include <boost/gil/io/device.hpp>
        -
        16 #include <boost/gil/io/get_reader.hpp>
        -
        17 #include <boost/gil/io/path_spec.hpp>
        -
        18 #include <boost/gil/detail/mp11.hpp>
        -
        19 
        -
        20 #include <type_traits>
        -
        21 
        -
        22 namespace boost { namespace gil {
        -
        23 
        -
        25 
        -
        30 template <typename Reader, typename Image>
        -
        31 inline
        -
        32 void read_image(Reader reader, Image& img,
        -
        33  typename std::enable_if
        -
        34  <
        -
        35  mp11::mp_and
        -
        36  <
        -
        37  detail::is_reader<Reader>,
        -
        38  is_format_tag<typename Reader::format_tag_t>,
        - -
        40  <
        -
        41  typename get_pixel_type<typename Image::view_t>::type,
        -
        42  typename Reader::format_tag_t
        -
        43  >
        -
        44  >::value
        -
        45  >::type* /*dummy*/ = nullptr)
        -
        46 {
        -
        47  reader.init_image(img, reader._settings);
        -
        48  reader.apply(view(img));
        -
        49 }
        -
        50 
        -
        56 template <typename Device, typename Image, typename FormatTag>
        -
        57 inline
        -
        58 void read_image(
        -
        59  Device& file,
        -
        60  Image& img,
        -
        61  image_read_settings<FormatTag> const& settings,
        -
        62  typename std::enable_if
        -
        63  <
        -
        64  mp11::mp_and
        -
        65  <
        -
        66  detail::is_read_device<FormatTag, Device>,
        -
        67  is_format_tag<FormatTag>,
        -
        68  is_read_supported
        -
        69  <
        -
        70  typename get_pixel_type<typename Image::view_t>::type,
        -
        71  FormatTag
        -
        72  >
        -
        73  >::value
        -
        74  >::type* /*dummy*/ = nullptr)
        -
        75 {
        -
        76  using reader_t =
        -
        77  typename get_reader<Device, FormatTag, detail::read_and_no_convert>::type;
        -
        78 
        -
        79  reader_t reader = make_reader(file, settings, detail::read_and_no_convert());
        -
        80  read_image(reader, img);
        -
        81 }
        -
        82 
        -
        88 template <typename Device, typename Image, typename FormatTag>
        -
        89 inline
        -
        90 void read_image(Device& file, Image& img, FormatTag const& tag,
        -
        91  typename std::enable_if
        -
        92  <
        -
        93  mp11::mp_and
        -
        94  <
        -
        95  detail::is_read_device<FormatTag, Device>,
        -
        96  is_format_tag<FormatTag>,
        -
        97  is_read_supported
        -
        98  <
        -
        99  typename get_pixel_type<typename Image::view_t>::type,
        -
        100  FormatTag
        -
        101  >
        -
        102  >::value
        -
        103  >::type* /*dummy*/ = nullptr)
        -
        104 {
        -
        105  using reader_t =
        -
        106  typename get_reader<Device, FormatTag, detail::read_and_no_convert>::type;
        -
        107 
        -
        108  reader_t reader = make_reader(file, tag, detail::read_and_no_convert());
        -
        109  read_image(reader, img);
        -
        110 }
        -
        111 
        -
        117 template <typename String, typename Image, typename FormatTag>
        -
        118 inline
        -
        119 void read_image(
        -
        120  String const& file_name,
        -
        121  Image& img,
        -
        122  image_read_settings<FormatTag> const& settings,
        -
        123  typename std::enable_if
        -
        124  <
        -
        125  mp11::mp_and
        -
        126  <
        -
        127  detail::is_supported_path_spec<String>,
        -
        128  is_format_tag<FormatTag>,
        -
        129  is_read_supported
        -
        130  <
        -
        131  typename get_pixel_type<typename Image::view_t>::type,
        -
        132  FormatTag
        -
        133  >
        -
        134  >::value
        -
        135  >::type* /*dummy*/ = nullptr)
        -
        136 {
        -
        137  using reader_t =
        -
        138  typename get_reader<String, FormatTag, detail::read_and_no_convert>::type;
        -
        139 
        -
        140  reader_t reader = make_reader(file_name, settings, detail::read_and_no_convert());
        -
        141  read_image(reader, img);
        -
        142 }
        -
        143 
        -
        149 template <typename String, typename Image, typename FormatTag>
        -
        150 inline
        -
        151 void read_image(String const& file_name, Image& img, FormatTag const& tag,
        -
        152  typename std::enable_if
        -
        153  <
        -
        154  mp11::mp_and<detail::is_supported_path_spec<String>,
        -
        155  is_format_tag<FormatTag>,
        -
        156  is_read_supported
        -
        157  <
        -
        158  typename get_pixel_type<typename Image::view_t>::type,
        -
        159  FormatTag
        -
        160  >
        -
        161  >::value
        -
        162 >::type* /*dummy*/ = nullptr)
        -
        163 {
        -
        164  using reader_t =
        -
        165  typename get_reader<String, FormatTag, detail::read_and_no_convert>::type;
        -
        166 
        -
        167  reader_t reader = make_reader(file_name, tag, detail::read_and_no_convert());
        -
        168  read_image(reader, img);
        -
        169 }
        -
        170 
        -
        172 
        -
        173 template <typename Reader, typename ...Images>
        -
        174 inline
        -
        175 void read_image(Reader& reader, any_image<Images...>& images,
        -
        176  typename std::enable_if
        -
        177  <
        -
        178  mp11::mp_and
        -
        179  <
        -
        180  detail::is_dynamic_image_reader<Reader>,
        -
        181  is_format_tag<typename Reader::format_tag_t>
        -
        182  >::value
        -
        183  >::type* /*dummy*/ = nullptr)
        -
        184 {
        -
        185  reader.apply(images);
        -
        186 }
        -
        187 
        -
        193 template <typename Device, typename ...Images, typename FormatTag>
        -
        194 inline
        -
        195 void read_image(
        -
        196  Device& file,
        -
        197  any_image<Images...>& images,
        -
        198  image_read_settings<FormatTag> const& settings,
        -
        199  typename std::enable_if
        -
        200  <
        -
        201  mp11::mp_and
        -
        202  <
        -
        203  detail::is_read_device<FormatTag, Device>,
        -
        204  is_format_tag<FormatTag>
        -
        205  >::value
        -
        206  >::type* /*dummy*/ = nullptr)
        -
        207 {
        -
        208  using reader_t = typename get_dynamic_image_reader<Device, FormatTag>::type;
        -
        209 
        -
        210  reader_t reader = make_dynamic_image_reader(file, settings);
        -
        211  read_image(reader, images);
        -
        212 }
        -
        213 
        -
        219 template <typename Device, typename ...Images, typename FormatTag>
        -
        220 inline
        -
        221 void read_image(Device& file, any_image<Images...>& images, FormatTag const& tag,
        -
        222  typename std::enable_if
        -
        223  <
        -
        224  mp11::mp_and
        -
        225  <
        -
        226  detail::is_read_device<FormatTag, Device>,
        -
        227  is_format_tag<FormatTag>
        -
        228  >::value
        -
        229  >::type* /*dummy*/ = nullptr)
        -
        230 {
        -
        231  using reader_t = typename get_dynamic_image_reader<Device, FormatTag>::type;
        -
        232 
        -
        233  reader_t reader = make_dynamic_image_reader(file, tag);
        -
        234  read_image(reader, images);
        -
        235 }
        -
        236 
        -
        242 template <typename String, typename ...Images, typename FormatTag>
        -
        243 inline
        -
        244 void read_image(
        -
        245  String const& file_name,
        -
        246  any_image<Images...>& images,
        -
        247  image_read_settings<FormatTag> const& settings,
        -
        248  typename std::enable_if
        -
        249  <
        -
        250  mp11::mp_and
        -
        251  <
        -
        252  detail::is_supported_path_spec<String>,
        -
        253  is_format_tag<FormatTag>
        -
        254  >::value
        -
        255  >::type* /*dummy*/ = nullptr)
        -
        256 {
        -
        257  using reader_t = typename get_dynamic_image_reader<String, FormatTag>::type;
        -
        258 
        -
        259  reader_t reader = make_dynamic_image_reader(file_name, settings);
        -
        260  read_image(reader, images);
        -
        261 }
        -
        262 
        -
        268 template <typename String, typename ...Images, typename FormatTag>
        -
        269 inline
        -
        270 void read_image(String const& file_name, any_image<Images...>& images, FormatTag const& tag,
        -
        271  typename std::enable_if
        -
        272  <
        -
        273  mp11::mp_and
        -
        274  <
        -
        275  detail::is_supported_path_spec<String>,
        -
        276  is_format_tag<FormatTag>
        -
        277  >::value
        -
        278  >::type* /*dummy*/ = nullptr)
        -
        279 {
        -
        280  using reader_t = typename get_dynamic_image_reader<String, FormatTag>::type;
        -
        281 
        -
        282  reader_t reader = make_dynamic_image_reader(file_name, tag);
        -
        283  read_image(reader, images);
        -
        284 }
        -
        285 
        -
        286 }} // namespace boost::gil
        -
        287 
        -
        288 #endif
        -
        void read_image(Reader reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t >, is_read_supported< typename get_pixel_type< typename Image::view_t >::type, typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads an image without conversion. Image memory is allocated.
        Definition: read_image.hpp:32
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: base.hpp:78
        +
        1//
        +
        2// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_READ_IMAGE_HPP
        +
        9#define BOOST_GIL_IO_READ_IMAGE_HPP
        +
        10
        +
        11#include <boost/gil/extension/toolbox/dynamic_images.hpp>
        +
        12
        +
        13#include <boost/gil/io/base.hpp>
        +
        14#include <boost/gil/io/conversion_policies.hpp>
        +
        15#include <boost/gil/io/device.hpp>
        +
        16#include <boost/gil/io/get_reader.hpp>
        +
        17#include <boost/gil/io/path_spec.hpp>
        +
        18#include <boost/gil/detail/mp11.hpp>
        +
        19
        +
        20#include <type_traits>
        +
        21
        +
        22namespace boost { namespace gil {
        +
        23
        +
        25
        +
        30template <typename Reader, typename Image>
        +
        31inline
        +
        +
        32void read_image(Reader reader, Image& img,
        +
        33 typename std::enable_if
        +
        34 <
        +
        35 mp11::mp_and
        +
        36 <
        +
        37 detail::is_reader<Reader>,
        +
        38 is_format_tag<typename Reader::format_tag_t>,
        + +
        40 <
        +
        41 typename get_pixel_type<typename Image::view_t>::type,
        +
        42 typename Reader::format_tag_t
        +
        43 >
        +
        44 >::value
        +
        45 >::type* /*dummy*/ = nullptr)
        +
        46{
        +
        47 reader.init_image(img, reader._settings);
        +
        48 reader.apply(view(img));
        +
        49}
        +
        +
        50
        +
        56template <typename Device, typename Image, typename FormatTag>
        +
        57inline
        +
        58void read_image(
        +
        59 Device& file,
        +
        60 Image& img,
        +
        61 image_read_settings<FormatTag> const& settings,
        +
        62 typename std::enable_if
        +
        63 <
        +
        64 mp11::mp_and
        +
        65 <
        +
        66 detail::is_read_device<FormatTag, Device>,
        +
        67 is_format_tag<FormatTag>,
        +
        68 is_read_supported
        +
        69 <
        +
        70 typename get_pixel_type<typename Image::view_t>::type,
        +
        71 FormatTag
        +
        72 >
        +
        73 >::value
        +
        74 >::type* /*dummy*/ = nullptr)
        +
        75{
        +
        76 using reader_t =
        +
        77 typename get_reader<Device, FormatTag, detail::read_and_no_convert>::type;
        +
        78
        +
        79 reader_t reader = make_reader(file, settings, detail::read_and_no_convert());
        +
        80 read_image(reader, img);
        +
        81}
        +
        82
        +
        88template <typename Device, typename Image, typename FormatTag>
        +
        89inline
        +
        90void read_image(Device& file, Image& img, FormatTag const& tag,
        +
        91 typename std::enable_if
        +
        92 <
        +
        93 mp11::mp_and
        +
        94 <
        +
        95 detail::is_read_device<FormatTag, Device>,
        +
        96 is_format_tag<FormatTag>,
        +
        97 is_read_supported
        +
        98 <
        +
        99 typename get_pixel_type<typename Image::view_t>::type,
        +
        100 FormatTag
        +
        101 >
        +
        102 >::value
        +
        103 >::type* /*dummy*/ = nullptr)
        +
        104{
        +
        105 using reader_t =
        +
        106 typename get_reader<Device, FormatTag, detail::read_and_no_convert>::type;
        +
        107
        +
        108 reader_t reader = make_reader(file, tag, detail::read_and_no_convert());
        +
        109 read_image(reader, img);
        +
        110}
        +
        111
        +
        117template <typename String, typename Image, typename FormatTag>
        +
        118inline
        +
        119void read_image(
        +
        120 String const& file_name,
        +
        121 Image& img,
        +
        122 image_read_settings<FormatTag> const& settings,
        +
        123 typename std::enable_if
        +
        124 <
        +
        125 mp11::mp_and
        +
        126 <
        +
        127 detail::is_supported_path_spec<String>,
        +
        128 is_format_tag<FormatTag>,
        +
        129 is_read_supported
        +
        130 <
        +
        131 typename get_pixel_type<typename Image::view_t>::type,
        +
        132 FormatTag
        +
        133 >
        +
        134 >::value
        +
        135 >::type* /*dummy*/ = nullptr)
        +
        136{
        +
        137 using reader_t =
        +
        138 typename get_reader<String, FormatTag, detail::read_and_no_convert>::type;
        +
        139
        +
        140 reader_t reader = make_reader(file_name, settings, detail::read_and_no_convert());
        +
        141 read_image(reader, img);
        +
        142}
        +
        143
        +
        149template <typename String, typename Image, typename FormatTag>
        +
        150inline
        +
        151void read_image(String const& file_name, Image& img, FormatTag const& tag,
        +
        152 typename std::enable_if
        +
        153 <
        +
        154 mp11::mp_and<detail::is_supported_path_spec<String>,
        +
        155 is_format_tag<FormatTag>,
        +
        156 is_read_supported
        +
        157 <
        +
        158 typename get_pixel_type<typename Image::view_t>::type,
        +
        159 FormatTag
        +
        160 >
        +
        161 >::value
        +
        162>::type* /*dummy*/ = nullptr)
        +
        163{
        +
        164 using reader_t =
        +
        165 typename get_reader<String, FormatTag, detail::read_and_no_convert>::type;
        +
        166
        +
        167 reader_t reader = make_reader(file_name, tag, detail::read_and_no_convert());
        +
        168 read_image(reader, img);
        +
        169}
        +
        170
        +
        172
        +
        173template <typename Reader, typename ...Images>
        +
        174inline
        +
        175void read_image(Reader& reader, any_image<Images...>& images,
        +
        176 typename std::enable_if
        +
        177 <
        +
        178 mp11::mp_and
        +
        179 <
        +
        180 detail::is_dynamic_image_reader<Reader>,
        +
        181 is_format_tag<typename Reader::format_tag_t>
        +
        182 >::value
        +
        183 >::type* /*dummy*/ = nullptr)
        +
        184{
        +
        185 reader.apply(images);
        +
        186}
        +
        187
        +
        193template <typename Device, typename ...Images, typename FormatTag>
        +
        194inline
        +
        195void read_image(
        +
        196 Device& file,
        +
        197 any_image<Images...>& images,
        +
        198 image_read_settings<FormatTag> const& settings,
        +
        199 typename std::enable_if
        +
        200 <
        +
        201 mp11::mp_and
        +
        202 <
        +
        203 detail::is_read_device<FormatTag, Device>,
        +
        204 is_format_tag<FormatTag>
        +
        205 >::value
        +
        206 >::type* /*dummy*/ = nullptr)
        +
        207{
        +
        208 using reader_t = typename get_dynamic_image_reader<Device, FormatTag>::type;
        +
        209
        +
        210 reader_t reader = make_dynamic_image_reader(file, settings);
        +
        211 read_image(reader, images);
        +
        212}
        +
        213
        +
        219template <typename Device, typename ...Images, typename FormatTag>
        +
        220inline
        +
        221void read_image(Device& file, any_image<Images...>& images, FormatTag const& tag,
        +
        222 typename std::enable_if
        +
        223 <
        +
        224 mp11::mp_and
        +
        225 <
        +
        226 detail::is_read_device<FormatTag, Device>,
        +
        227 is_format_tag<FormatTag>
        +
        228 >::value
        +
        229 >::type* /*dummy*/ = nullptr)
        +
        230{
        +
        231 using reader_t = typename get_dynamic_image_reader<Device, FormatTag>::type;
        +
        232
        +
        233 reader_t reader = make_dynamic_image_reader(file, tag);
        +
        234 read_image(reader, images);
        +
        235}
        +
        236
        +
        242template <typename String, typename ...Images, typename FormatTag>
        +
        243inline
        +
        244void read_image(
        +
        245 String const& file_name,
        +
        246 any_image<Images...>& images,
        +
        247 image_read_settings<FormatTag> const& settings,
        +
        248 typename std::enable_if
        +
        249 <
        +
        250 mp11::mp_and
        +
        251 <
        +
        252 detail::is_supported_path_spec<String>,
        +
        253 is_format_tag<FormatTag>
        +
        254 >::value
        +
        255 >::type* /*dummy*/ = nullptr)
        +
        256{
        +
        257 using reader_t = typename get_dynamic_image_reader<String, FormatTag>::type;
        +
        258
        +
        259 reader_t reader = make_dynamic_image_reader(file_name, settings);
        +
        260 read_image(reader, images);
        +
        261}
        +
        262
        +
        268template <typename String, typename ...Images, typename FormatTag>
        +
        269inline
        +
        270void read_image(String const& file_name, any_image<Images...>& images, FormatTag const& tag,
        +
        271 typename std::enable_if
        +
        272 <
        +
        273 mp11::mp_and
        +
        274 <
        +
        275 detail::is_supported_path_spec<String>,
        +
        276 is_format_tag<FormatTag>
        +
        277 >::value
        +
        278 >::type* /*dummy*/ = nullptr)
        +
        279{
        +
        280 using reader_t = typename get_dynamic_image_reader<String, FormatTag>::type;
        +
        281
        +
        282 reader_t reader = make_dynamic_image_reader(file_name, tag);
        +
        283 read_image(reader, images);
        +
        284}
        +
        285
        +
        286}} // namespace boost::gil
        +
        287
        +
        288#endif
        +
        void read_image(Reader reader, Image &img, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, is_format_tag< typename Reader::format_tag_t >, is_read_supported< typename get_pixel_type< typename Image::view_t >::type, typename Reader::format_tag_t > >::value >::type *=nullptr)
        Reads an image without conversion. Image memory is allocated.
        Definition read_image.hpp:32
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition base.hpp:78
        diff --git a/html/reference/read__image__info_8hpp_source.html b/html/reference/read__image__info_8hpp_source.html index fde89535d..c73a3eac0 100644 --- a/html/reference/read__image__info_8hpp_source.html +++ b/html/reference/read__image__info_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: read_image_info.hpp Source File @@ -27,125 +27,132 @@

        - + +/* @license-end */ + +
        -
        -
        read_image_info.hpp
        +
        read_image_info.hpp
        -
        1 //
        -
        2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_READ_IMAGE_INFO_HPP
        -
        9 #define BOOST_GIL_IO_READ_IMAGE_INFO_HPP
        -
        10 
        -
        11 #include <boost/gil/io/base.hpp>
        -
        12 #include <boost/gil/io/device.hpp>
        -
        13 #include <boost/gil/io/get_reader.hpp>
        -
        14 #include <boost/gil/io/path_spec.hpp>
        -
        15 #include <boost/gil/detail/mp11.hpp>
        -
        16 
        -
        17 #include <type_traits>
        -
        18 
        -
        19 namespace boost{ namespace gil {
        -
        20 
        -
        22 
        -
        28 template <typename Device, typename FormatTag>
        -
        29 inline
        -
        30 auto read_image_info(Device& file, image_read_settings<FormatTag> const& settings,
        -
        31  typename std::enable_if
        -
        32  <
        -
        33  mp11::mp_and
        -
        34  <
        -
        35  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        36  is_format_tag<FormatTag>
        -
        37  >::value
        -
        38  >::type* /*dummy*/ = nullptr)
        - -
        40 {
        -
        41  return make_reader_backend(file, settings);
        -
        42 }
        -
        43 
        -
        49 template <typename Device, typename FormatTag>
        -
        50 inline
        -
        51 auto read_image_info(Device& file, FormatTag const&,
        -
        52  typename std::enable_if
        -
        53  <
        -
        54  mp11::mp_and
        -
        55  <
        -
        56  detail::is_adaptable_input_device<FormatTag, Device>,
        -
        57  is_format_tag<FormatTag>
        -
        58  >::value
        -
        59  >::type* /*dummy*/ = nullptr)
        -
        60  -> typename get_reader_backend<Device, FormatTag>::type
        -
        61 {
        -
        62  return read_image_info(file, image_read_settings<FormatTag>());
        -
        63 }
        -
        64 
        -
        70 template <typename String, typename FormatTag>
        -
        71 inline
        -
        72 auto read_image_info(
        -
        73  String const& file_name, image_read_settings<FormatTag> const& settings,
        -
        74  typename std::enable_if
        -
        75  <
        -
        76  mp11::mp_and
        -
        77  <
        -
        78  is_format_tag<FormatTag>,
        -
        79  detail::is_supported_path_spec<String>
        -
        80  >::value
        -
        81  >::type* /*dummy*/ = nullptr)
        -
        82  -> typename get_reader_backend<String, FormatTag>::type
        -
        83 {
        -
        84  return make_reader_backend(file_name, settings);
        -
        85 }
        -
        86 
        -
        92 template <typename String, typename FormatTag>
        -
        93 inline
        -
        94 auto read_image_info(String const& file_name, FormatTag const&,
        -
        95  typename std::enable_if
        -
        96  <
        -
        97  mp11::mp_and
        -
        98  <
        -
        99  is_format_tag<FormatTag>,
        -
        100  detail::is_supported_path_spec<String>
        -
        101  >::value
        -
        102  >::type* /*dummy*/ = nullptr)
        -
        103  -> typename get_reader_backend<String, FormatTag>::type
        -
        104 {
        -
        105  return read_image_info(file_name, image_read_settings<FormatTag>());
        -
        106 }
        -
        107 
        -
        108 }} // namespace boost::gil
        -
        109 
        -
        110 #endif
        -
        auto read_image_info(Device &file, image_read_settings< FormatTag > const &settings, typename std::enable_if< mp11::mp_and< detail::is_adaptable_input_device< FormatTag, Device >, is_format_tag< FormatTag > >::value >::type *=nullptr) -> typename get_reader_backend< Device, FormatTag >::type
        Returns the image format backend. Backend is format specific.
        Definition: read_image_info.hpp:30
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Helper metafunction to generate image backend type.
        Definition: get_reader.hpp:115
        +
        1//
        +
        2// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_READ_IMAGE_INFO_HPP
        +
        9#define BOOST_GIL_IO_READ_IMAGE_INFO_HPP
        +
        10
        +
        11#include <boost/gil/io/base.hpp>
        +
        12#include <boost/gil/io/device.hpp>
        +
        13#include <boost/gil/io/get_reader.hpp>
        +
        14#include <boost/gil/io/path_spec.hpp>
        +
        15#include <boost/gil/detail/mp11.hpp>
        +
        16
        +
        17#include <type_traits>
        +
        18
        +
        19namespace boost{ namespace gil {
        +
        20
        +
        22
        +
        28template <typename Device, typename FormatTag>
        +
        29inline
        +
        +
        30auto read_image_info(Device& file, image_read_settings<FormatTag> const& settings,
        +
        31 typename std::enable_if
        +
        32 <
        +
        33 mp11::mp_and
        +
        34 <
        +
        35 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        36 is_format_tag<FormatTag>
        +
        37 >::value
        +
        38 >::type* /*dummy*/ = nullptr)
        + +
        40{
        +
        41 return make_reader_backend(file, settings);
        +
        42}
        +
        +
        43
        +
        49template <typename Device, typename FormatTag>
        +
        50inline
        +
        51auto read_image_info(Device& file, FormatTag const&,
        +
        52 typename std::enable_if
        +
        53 <
        +
        54 mp11::mp_and
        +
        55 <
        +
        56 detail::is_adaptable_input_device<FormatTag, Device>,
        +
        57 is_format_tag<FormatTag>
        +
        58 >::value
        +
        59 >::type* /*dummy*/ = nullptr)
        +
        60 -> typename get_reader_backend<Device, FormatTag>::type
        +
        61{
        +
        62 return read_image_info(file, image_read_settings<FormatTag>());
        +
        63}
        +
        64
        +
        70template <typename String, typename FormatTag>
        +
        71inline
        + +
        73 String const& file_name, image_read_settings<FormatTag> const& settings,
        +
        74 typename std::enable_if
        +
        75 <
        +
        76 mp11::mp_and
        +
        77 <
        +
        78 is_format_tag<FormatTag>,
        +
        79 detail::is_supported_path_spec<String>
        +
        80 >::value
        +
        81 >::type* /*dummy*/ = nullptr)
        +
        82 -> typename get_reader_backend<String, FormatTag>::type
        +
        83{
        +
        84 return make_reader_backend(file_name, settings);
        +
        85}
        +
        86
        +
        92template <typename String, typename FormatTag>
        +
        93inline
        +
        94auto read_image_info(String const& file_name, FormatTag const&,
        +
        95 typename std::enable_if
        +
        96 <
        +
        97 mp11::mp_and
        +
        98 <
        +
        99 is_format_tag<FormatTag>,
        +
        100 detail::is_supported_path_spec<String>
        +
        101 >::value
        +
        102 >::type* /*dummy*/ = nullptr)
        +
        103 -> typename get_reader_backend<String, FormatTag>::type
        +
        104{
        +
        105 return read_image_info(file_name, image_read_settings<FormatTag>());
        +
        106}
        +
        107
        +
        108}} // namespace boost::gil
        +
        109
        +
        110#endif
        +
        auto read_image_info(Device &file, image_read_settings< FormatTag > const &settings, typename std::enable_if< mp11::mp_and< detail::is_adaptable_input_device< FormatTag, Device >, is_format_tag< FormatTag > >::value >::type *=nullptr) -> typename get_reader_backend< Device, FormatTag >::type
        Returns the image format backend. Backend is format specific.
        Definition read_image_info.hpp:30
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Helper metafunction to generate image backend type.
        Definition get_reader.hpp:115
        diff --git a/html/reference/read__view_8hpp_source.html b/html/reference/read__view_8hpp_source.html index 1c91700ea..70455507d 100644 --- a/html/reference/read__view_8hpp_source.html +++ b/html/reference/read__view_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: read_view.hpp Source File @@ -27,185 +27,192 @@

        - + +/* @license-end */ + +
        -
        -
        read_view.hpp
        +
        read_view.hpp
        -
        1 //
        -
        2 // Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_READ_VIEW_HPP
        -
        9 #define BOOST_GIL_IO_READ_VIEW_HPP
        -
        10 
        -
        11 #include <boost/gil/io/base.hpp>
        -
        12 #include <boost/gil/io/conversion_policies.hpp>
        -
        13 #include <boost/gil/io/device.hpp>
        -
        14 #include <boost/gil/io/get_reader.hpp>
        -
        15 #include <boost/gil/io/path_spec.hpp>
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 
        -
        18 #include <type_traits>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        23 
        -
        29 template <typename Reader, typename View>
        -
        30 inline
        -
        31 void read_view(Reader reader, View const& view,
        -
        32  typename std::enable_if
        -
        33  <
        -
        34  mp11::mp_and
        -
        35  <
        -
        36  detail::is_reader<Reader>,
        -
        37  typename is_format_tag<typename Reader::format_tag_t>::type,
        -
        38  typename is_read_supported
        -
        39  <
        -
        40  typename get_pixel_type<View>::type,
        -
        41  typename Reader::format_tag_t
        -
        42  >::type
        -
        43  >::value
        -
        44  >::type* /*dummy*/ = nullptr)
        -
        45 {
        -
        46  reader.check_image_size(view.dimensions());
        -
        47  reader.init_view(view, reader._settings);
        -
        48  reader.apply(view);
        -
        49 }
        -
        50 
        -
        56 template <typename Device, typename View, typename FormatTag>
        -
        57 inline
        -
        58 void read_view(
        -
        59  Device& file,
        -
        60  View const& view,
        -
        61  image_read_settings<FormatTag> const& settings,
        -
        62  typename std::enable_if
        -
        63  <
        -
        64  mp11::mp_and
        -
        65  <
        -
        66  detail::is_read_device<FormatTag, Device>,
        -
        67  typename is_format_tag<FormatTag>::type,
        -
        68  typename is_read_supported
        -
        69  <
        -
        70  typename get_pixel_type<View>::type,
        -
        71  FormatTag
        -
        72  >::type
        -
        73  >::value
        -
        74  >::type* /*dummy*/ = nullptr)
        -
        75 {
        -
        76  using reader_t =
        -
        77  typename get_reader<Device, FormatTag, detail::read_and_no_convert>::type;
        -
        78 
        -
        79  reader_t reader = make_reader(file, settings, detail::read_and_no_convert());
        -
        80  read_view(reader, view);
        -
        81 }
        -
        82 
        -
        88 template <typename Device, typename View, typename FormatTag>
        -
        89 inline
        -
        90 void read_view(Device& file, View const& view, FormatTag const& tag,
        -
        91  typename std::enable_if
        -
        92  <
        -
        93  mp11::mp_and
        -
        94  <
        -
        95  typename is_format_tag<FormatTag>::type,
        -
        96  detail::is_read_device<FormatTag, Device>,
        -
        97  typename is_read_supported
        -
        98  <
        -
        99  typename get_pixel_type<View>::type,
        -
        100  FormatTag
        -
        101  >::type
        -
        102  >::value>::type* /*dummy*/ = nullptr)
        -
        103 {
        -
        104  using reader_t =
        -
        105  typename get_reader<Device, FormatTag, detail::read_and_no_convert>::type;
        -
        106 
        -
        107  reader_t reader = make_reader(file, tag, detail::read_and_no_convert());
        -
        108  read_view(reader, view);
        -
        109 }
        -
        110 
        -
        116 template <typename String, typename View, typename FormatTag>
        -
        117 inline
        -
        118 void read_view(
        -
        119  String const& file_name,
        -
        120  View const& view,
        -
        121  image_read_settings<FormatTag> const& settings,
        -
        122  typename std::enable_if
        -
        123  <
        -
        124  mp11::mp_and
        -
        125  <
        -
        126  typename detail::is_supported_path_spec<String>::type,
        -
        127  typename is_format_tag<FormatTag>::type,
        -
        128  typename is_read_supported
        -
        129  <
        -
        130  typename get_pixel_type<View>::type,
        -
        131  FormatTag
        -
        132  >::type
        -
        133  >::value
        -
        134  >::type* /*dummy*/ = nullptr)
        -
        135 {
        -
        136  using reader_t =
        -
        137  typename get_reader<String, FormatTag, detail::read_and_no_convert>::type;
        -
        138 
        -
        139  reader_t reader = make_reader(file_name, settings, detail::read_and_no_convert());
        -
        140  read_view(reader, view);
        -
        141 }
        -
        142 
        -
        148 template <typename String, typename View, typename FormatTag>
        -
        149 inline
        -
        150 void read_view(String const& file_name, View const& view, FormatTag const& tag,
        -
        151  typename std::enable_if
        -
        152  <
        -
        153  mp11::mp_and
        -
        154  <
        -
        155  typename detail::is_supported_path_spec<String>::type,
        -
        156  typename is_format_tag<FormatTag>::type,
        -
        157  typename is_read_supported
        -
        158  <
        -
        159  typename get_pixel_type<View>::type,
        -
        160  FormatTag
        -
        161  >::type
        -
        162  >::value
        -
        163  >::type* /*dummy*/ = nullptr)
        -
        164 {
        -
        165  using reader_t =
        -
        166  typename get_reader<String, FormatTag, detail::read_and_no_convert>::type;
        -
        167 
        -
        168  reader_t reader = make_reader(file_name, tag, detail::read_and_no_convert());
        -
        169  read_view(reader, view);
        -
        170 }
        -
        171 
        -
        172 }} // namespace boost::gil
        -
        173 
        -
        174 #endif
        -
        void read_view(Reader reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, typename is_format_tag< typename Reader::format_tag_t >::type, typename is_read_supported< typename get_pixel_type< View >::type, typename Reader::format_tag_t >::type >::value >::type *=nullptr)
        Reads an image view without conversion. No memory is allocated.
        Definition: read_view.hpp:31
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: base.hpp:78
        +
        1//
        +
        2// Copyright 2007-2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_READ_VIEW_HPP
        +
        9#define BOOST_GIL_IO_READ_VIEW_HPP
        +
        10
        +
        11#include <boost/gil/io/base.hpp>
        +
        12#include <boost/gil/io/conversion_policies.hpp>
        +
        13#include <boost/gil/io/device.hpp>
        +
        14#include <boost/gil/io/get_reader.hpp>
        +
        15#include <boost/gil/io/path_spec.hpp>
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17
        +
        18#include <type_traits>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        23
        +
        29template <typename Reader, typename View>
        +
        30inline
        +
        +
        31void read_view(Reader reader, View const& view,
        +
        32 typename std::enable_if
        +
        33 <
        +
        34 mp11::mp_and
        +
        35 <
        +
        36 detail::is_reader<Reader>,
        +
        37 typename is_format_tag<typename Reader::format_tag_t>::type,
        +
        38 typename is_read_supported
        +
        39 <
        +
        40 typename get_pixel_type<View>::type,
        +
        41 typename Reader::format_tag_t
        +
        42 >::type
        +
        43 >::value
        +
        44 >::type* /*dummy*/ = nullptr)
        +
        45{
        +
        46 reader.check_image_size(view.dimensions());
        +
        47 reader.init_view(view, reader._settings);
        +
        48 reader.apply(view);
        +
        49}
        +
        +
        50
        +
        56template <typename Device, typename View, typename FormatTag>
        +
        57inline
        +
        58void read_view(
        +
        59 Device& file,
        +
        60 View const& view,
        +
        61 image_read_settings<FormatTag> const& settings,
        +
        62 typename std::enable_if
        +
        63 <
        +
        64 mp11::mp_and
        +
        65 <
        +
        66 detail::is_read_device<FormatTag, Device>,
        +
        67 typename is_format_tag<FormatTag>::type,
        +
        68 typename is_read_supported
        +
        69 <
        +
        70 typename get_pixel_type<View>::type,
        +
        71 FormatTag
        +
        72 >::type
        +
        73 >::value
        +
        74 >::type* /*dummy*/ = nullptr)
        +
        75{
        +
        76 using reader_t =
        +
        77 typename get_reader<Device, FormatTag, detail::read_and_no_convert>::type;
        +
        78
        +
        79 reader_t reader = make_reader(file, settings, detail::read_and_no_convert());
        +
        80 read_view(reader, view);
        +
        81}
        +
        82
        +
        88template <typename Device, typename View, typename FormatTag>
        +
        89inline
        +
        90void read_view(Device& file, View const& view, FormatTag const& tag,
        +
        91 typename std::enable_if
        +
        92 <
        +
        93 mp11::mp_and
        +
        94 <
        +
        95 typename is_format_tag<FormatTag>::type,
        +
        96 detail::is_read_device<FormatTag, Device>,
        +
        97 typename is_read_supported
        +
        98 <
        +
        99 typename get_pixel_type<View>::type,
        +
        100 FormatTag
        +
        101 >::type
        +
        102 >::value>::type* /*dummy*/ = nullptr)
        +
        103{
        +
        104 using reader_t =
        +
        105 typename get_reader<Device, FormatTag, detail::read_and_no_convert>::type;
        +
        106
        +
        107 reader_t reader = make_reader(file, tag, detail::read_and_no_convert());
        +
        108 read_view(reader, view);
        +
        109}
        +
        110
        +
        116template <typename String, typename View, typename FormatTag>
        +
        117inline
        +
        118void read_view(
        +
        119 String const& file_name,
        +
        120 View const& view,
        +
        121 image_read_settings<FormatTag> const& settings,
        +
        122 typename std::enable_if
        +
        123 <
        +
        124 mp11::mp_and
        +
        125 <
        +
        126 typename detail::is_supported_path_spec<String>::type,
        +
        127 typename is_format_tag<FormatTag>::type,
        +
        128 typename is_read_supported
        +
        129 <
        +
        130 typename get_pixel_type<View>::type,
        +
        131 FormatTag
        +
        132 >::type
        +
        133 >::value
        +
        134 >::type* /*dummy*/ = nullptr)
        +
        135{
        +
        136 using reader_t =
        +
        137 typename get_reader<String, FormatTag, detail::read_and_no_convert>::type;
        +
        138
        +
        139 reader_t reader = make_reader(file_name, settings, detail::read_and_no_convert());
        +
        140 read_view(reader, view);
        +
        141}
        +
        142
        +
        148template <typename String, typename View, typename FormatTag>
        +
        149inline
        +
        150void read_view(String const& file_name, View const& view, FormatTag const& tag,
        +
        151 typename std::enable_if
        +
        152 <
        +
        153 mp11::mp_and
        +
        154 <
        +
        155 typename detail::is_supported_path_spec<String>::type,
        +
        156 typename is_format_tag<FormatTag>::type,
        +
        157 typename is_read_supported
        +
        158 <
        +
        159 typename get_pixel_type<View>::type,
        +
        160 FormatTag
        +
        161 >::type
        +
        162 >::value
        +
        163 >::type* /*dummy*/ = nullptr)
        +
        164{
        +
        165 using reader_t =
        +
        166 typename get_reader<String, FormatTag, detail::read_and_no_convert>::type;
        +
        167
        +
        168 reader_t reader = make_reader(file_name, tag, detail::read_and_no_convert());
        +
        169 read_view(reader, view);
        +
        170}
        +
        171
        +
        172}} // namespace boost::gil
        +
        173
        +
        174#endif
        +
        void read_view(Reader reader, View const &view, typename std::enable_if< mp11::mp_and< detail::is_reader< Reader >, typename is_format_tag< typename Reader::format_tag_t >::type, typename is_read_supported< typename get_pixel_type< View >::type, typename Reader::format_tag_t >::type >::value >::type *=nullptr)
        Reads an image view without conversion. No memory is allocated.
        Definition read_view.hpp:31
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition base.hpp:78
        diff --git a/html/reference/reader__base_8hpp_source.html b/html/reference/reader__base_8hpp_source.html index 8cfbbd3e2..98f5e6b65 100644 --- a/html/reference/reader__base_8hpp_source.html +++ b/html/reference/reader__base_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: reader_base.hpp Source File @@ -27,145 +27,158 @@

        - + +/* @license-end */ + +
        -
        -
        reader_base.hpp
        +
        reader_base.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_READER_BASE_HPP
        -
        9 #define BOOST_GIL_IO_READER_BASE_HPP
        -
        10 
        -
        11 #include <boost/gil/io/base.hpp>
        -
        12 
        -
        13 #include <boost/assert.hpp>
        -
        14 
        -
        15 namespace boost { namespace gil {
        -
        16 
        -
        25 template< typename FormatTag
        -
        26  , typename ConversionPolicy
        -
        27  >
        - -
        29 {
        -
        30 public:
        -
        31 
        - -
        36  :_cc_policy()
        -
        37  {}
        -
        38 
        -
        42  reader_base( const ConversionPolicy& cc )
        -
        43  :_cc_policy( cc )
        -
        44  {}
        -
        45 
        -
        52  template< typename Image >
        -
        53  void init_image( Image& img
        -
        54  , const image_read_settings< FormatTag >& settings
        -
        55  )
        -
        56  {
        -
        57  //setup( backend._settings._dim );
        -
        58 
        -
        59  BOOST_ASSERT(settings._dim.x && settings._dim.y);
        -
        60 
        -
        61  img.recreate( settings._dim.x
        -
        62  , settings._dim.y
        -
        63  );
        -
        64  }
        -
        65 
        -
        66  template< typename View >
        -
        67  void init_view( const View& view
        -
        68  , const image_read_settings< FormatTag >&
        -
        69  )
        -
        70  {
        -
        71  setup( view.dimensions() );
        -
        72  }
        -
        73 
        -
        74 private:
        -
        75 
        -
        76  void setup( point_t const& /* dim */ )
        -
        77  {
        -
        78  //check_coordinates( dim );
        -
        79 
        -
        80  //if( dim == point_t( 0, 0 ))
        -
        81  //{
        -
        82  // _settings._dim.x = _info._width;
        -
        83  // _settings._dim.y = _info._height;
        -
        84  //}
        -
        85  //else
        -
        86  //{
        -
        87  // _settings._dim = dim;
        -
        88  //}
        -
        89  }
        -
        90 
        -
        91  void check_coordinates( point_t const& /* dim */ )
        -
        92  {
        -
        93  //using int_t = point_t::value_type;
        -
        94 
        -
        95  //int_t width = static_cast< int_t >( _info._width );
        -
        96  //int_t height = static_cast< int_t >( _info._height );
        -
        97 
        -
        98  //io_error_if( ( _settings._top_left.x < 0
        -
        99  // || _settings._top_left.y < 0
        -
        100  // || dim.x < 0
        -
        101  // || dim.y < 0
        -
        102  // )
        -
        103  // , "User provided view has incorrect size." );
        -
        104 
        -
        105 
        -
        106  //io_error_if( ( ( width ) < _settings._top_left.x
        -
        107  // && ( width ) <= dim.x
        -
        108  // && ( height ) < _settings._top_left.y
        -
        109  // && ( height ) <= dim.y )
        -
        110  // , "User provided view has incorrect size." );
        -
        111 
        -
        112  //io_error_if( ( ( _settings._top_left.x + dim.x ) > width
        -
        113  // || ( _settings._top_left.y + dim.y ) > height
        -
        114  // )
        -
        115  // , "User provided view has incorrect size." );
        -
        116  }
        -
        117 
        -
        118 protected:
        -
        119 
        -
        120  ConversionPolicy _cc_policy;
        -
        121 };
        -
        122 
        -
        123 } // namespace gil
        -
        124 } // namespace boost
        -
        125 
        -
        126 #endif
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Definition: reader_base.hpp:29
        -
        reader_base(const ConversionPolicy &cc)
        Definition: reader_base.hpp:42
        -
        void init_image(Image &img, const image_read_settings< FormatTag > &settings)
        Definition: reader_base.hpp:53
        -
        reader_base()
        Definition: reader_base.hpp:35
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_READER_BASE_HPP
        +
        9#define BOOST_GIL_IO_READER_BASE_HPP
        +
        10
        +
        11#include <boost/gil/io/base.hpp>
        +
        12
        +
        13#include <boost/assert.hpp>
        +
        14
        +
        15namespace boost { namespace gil {
        +
        16
        +
        25template< typename FormatTag
        +
        26 , typename ConversionPolicy
        +
        27 >
        +
        + +
        29{
        +
        30public:
        +
        31
        +
        + +
        36 :_cc_policy()
        +
        37 {}
        +
        +
        38
        +
        +
        42 reader_base( const ConversionPolicy& cc )
        +
        43 :_cc_policy( cc )
        +
        44 {}
        +
        +
        45
        +
        52 template< typename Image >
        +
        +
        53 void init_image( Image& img
        +
        54 , const image_read_settings< FormatTag >& settings
        +
        55 )
        +
        56 {
        +
        57 //setup( backend._settings._dim );
        +
        58
        +
        59 BOOST_ASSERT(settings._dim.x && settings._dim.y);
        +
        60
        +
        61 img.recreate( settings._dim.x
        +
        62 , settings._dim.y
        +
        63 );
        +
        64 }
        +
        +
        65
        +
        66 template< typename View >
        +
        67 void init_view( const View& view
        +
        68 , const image_read_settings< FormatTag >&
        +
        69 )
        +
        70 {
        +
        71 setup( view.dimensions() );
        +
        72 }
        +
        73
        +
        74private:
        +
        75
        +
        76 void setup( point_t const& /* dim */ )
        +
        77 {
        +
        78 //check_coordinates( dim );
        +
        79
        +
        80 //if( dim == point_t( 0, 0 ))
        +
        81 //{
        +
        82 // _settings._dim.x = _info._width;
        +
        83 // _settings._dim.y = _info._height;
        +
        84 //}
        +
        85 //else
        +
        86 //{
        +
        87 // _settings._dim = dim;
        +
        88 //}
        +
        89 }
        +
        90
        +
        91 void check_coordinates( point_t const& /* dim */ )
        +
        92 {
        +
        93 //using int_t = point_t::value_type;
        +
        94
        +
        95 //int_t width = static_cast< int_t >( _info._width );
        +
        96 //int_t height = static_cast< int_t >( _info._height );
        +
        97
        +
        98 //io_error_if( ( _settings._top_left.x < 0
        +
        99 // || _settings._top_left.y < 0
        +
        100 // || dim.x < 0
        +
        101 // || dim.y < 0
        +
        102 // )
        +
        103 // , "User provided view has incorrect size." );
        +
        104
        +
        105
        +
        106 //io_error_if( ( ( width ) < _settings._top_left.x
        +
        107 // && ( width ) <= dim.x
        +
        108 // && ( height ) < _settings._top_left.y
        +
        109 // && ( height ) <= dim.y )
        +
        110 // , "User provided view has incorrect size." );
        +
        111
        +
        112 //io_error_if( ( ( _settings._top_left.x + dim.x ) > width
        +
        113 // || ( _settings._top_left.y + dim.y ) > height
        +
        114 // )
        +
        115 // , "User provided view has incorrect size." );
        +
        116 }
        +
        117
        +
        118protected:
        +
        119
        +
        120 ConversionPolicy _cc_policy;
        +
        121};
        +
        +
        122
        +
        123} // namespace gil
        +
        124} // namespace boost
        +
        125
        +
        126#endif
        +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Definition reader_base.hpp:29
        +
        reader_base(const ConversionPolicy &cc)
        Definition reader_base.hpp:42
        +
        void init_image(Image &img, const image_read_settings< FormatTag > &settings)
        Definition reader_base.hpp:53
        +
        reader_base()
        Definition reader_base.hpp:35
        diff --git a/html/reference/rgb_8hpp_source.html b/html/reference/rgb_8hpp_source.html index 0fd49729f..47c5d379f 100644 --- a/html/reference/rgb_8hpp_source.html +++ b/html/reference/rgb_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: rgb.hpp Source File @@ -27,92 +27,99 @@

        - + +/* @license-end */ + +
        -
        -
        rgb.hpp
        +
        rgb.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_RGB_HPP
        -
        9 #define BOOST_GIL_RGB_HPP
        -
        10 
        -
        11 #include <boost/gil/metafunctions.hpp>
        -
        12 #include <boost/gil/planar_pixel_iterator.hpp>
        -
        13 #include <boost/gil/detail/mp11.hpp>
        -
        14 
        -
        15 #include <cstddef>
        -
        16 #include <type_traits>
        -
        17 
        -
        18 namespace boost { namespace gil {
        -
        19 
        -
        22 
        -
        24 struct red_t {};
        -
        25 
        -
        27 struct green_t {};
        -
        28 
        -
        30 struct blue_t {};
        -
        32 
        -
        34 using rgb_t = mp11::mp_list<red_t, green_t, blue_t>;
        -
        35 
        - -
        38 
        - -
        41 
        -
        44 template <typename IC>
        -
        45 inline auto planar_rgb_view(
        -
        46  std::size_t width, std::size_t height,
        -
        47  IC r, IC g, IC b,
        -
        48  std::ptrdiff_t rowsize_in_bytes)
        - -
        50 {
        -
        51  using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC, rgb_t>>::view_t;
        -
        52 
        -
        53  return view_t(
        -
        54  width, height,
        -
        55  typename view_t::locator(
        - -
        57  rowsize_in_bytes));
        -
        58 }
        -
        59 
        -
        60 }} // namespace boost::gil
        -
        61 
        -
        62 #endif
        -
        auto planar_rgb_view(std::size_t width, std::size_t height, IC r, IC g, IC b, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, rgb_t > >::view_t
        from raw RGB planar data
        Definition: rgb.hpp:45
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Blue.
        Definition: rgb.hpp:30
        -
        Green.
        Definition: rgb.hpp:27
        -
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:268
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: planar_pixel_iterator.hpp:58
        -
        Red.
        Definition: rgb.hpp:24
        -
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:303
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_RGB_HPP
        +
        9#define BOOST_GIL_RGB_HPP
        +
        10
        +
        11#include <boost/gil/metafunctions.hpp>
        +
        12#include <boost/gil/planar_pixel_iterator.hpp>
        +
        13#include <boost/gil/detail/mp11.hpp>
        +
        14
        +
        15#include <cstddef>
        +
        16#include <type_traits>
        +
        17
        +
        18namespace boost { namespace gil {
        +
        19
        +
        22
        +
        24struct red_t {};
        +
        25
        +
        27struct green_t {};
        +
        28
        +
        30struct blue_t {};
        +
        32
        +
        34using rgb_t = mp11::mp_list<red_t, green_t, blue_t>;
        +
        35
        + +
        38
        + +
        41
        +
        44template <typename IC>
        +
        +
        45inline auto planar_rgb_view(
        +
        46 std::size_t width, std::size_t height,
        +
        47 IC r, IC g, IC b,
        +
        48 std::ptrdiff_t rowsize_in_bytes)
        + +
        50{
        +
        51 using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC, rgb_t>>::view_t;
        +
        52
        +
        53 return view_t(
        +
        54 width, height,
        +
        55 typename view_t::locator(
        + +
        57 rowsize_in_bytes));
        +
        58}
        +
        +
        59
        +
        60}} // namespace boost::gil
        +
        61
        +
        62#endif
        +
        auto planar_rgb_view(std::size_t width, std::size_t height, IC r, IC g, IC b, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, rgb_t > >::view_t
        from raw RGB planar data
        Definition rgb.hpp:45
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Blue.
        Definition rgb.hpp:30
        +
        Green.
        Definition rgb.hpp:27
        +
        Represents a color space and ordering of channels in memory.
        Definition utilities.hpp:268
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition planar_pixel_iterator.hpp:58
        +
        Red.
        Definition rgb.hpp:24
        +
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition metafunctions.hpp:303
        diff --git a/html/reference/rgba_8hpp_source.html b/html/reference/rgba_8hpp_source.html index 7cd37fc12..258b5c53e 100644 --- a/html/reference/rgba_8hpp_source.html +++ b/html/reference/rgba_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: rgba.hpp Source File @@ -27,88 +27,95 @@

        - + +/* @license-end */ + +
        -
        -
        rgba.hpp
        +
        rgba.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_RGBA_HPP
        -
        9 #define BOOST_GIL_RGBA_HPP
        -
        10 
        -
        11 #include <boost/gil/planar_pixel_iterator.hpp>
        -
        12 #include <boost/gil/rgb.hpp>
        -
        13 #include <boost/gil/detail/mp11.hpp>
        -
        14 
        -
        15 #include <cstddef>
        -
        16 #include <type_traits>
        -
        17 
        -
        18 namespace boost { namespace gil {
        -
        19 
        -
        22 struct alpha_t {};
        -
        23 
        -
        25 using rgba_t =mp11::mp_list<red_t, green_t, blue_t, alpha_t>;
        -
        26 
        - -
        29 
        - -
        32 
        - -
        35 
        - -
        38 
        -
        41 template <typename ChannelPtr>
        -
        42 inline auto planar_rgba_view(std::size_t width, std::size_t height,
        -
        43  ChannelPtr r, ChannelPtr g, ChannelPtr b, ChannelPtr a,
        -
        44  std::ptrdiff_t rowsize_in_bytes)
        - -
        46 {
        -
        47  using pixel_iterator_t = planar_pixel_iterator<ChannelPtr, rgba_t>;
        -
        48  using view_t = typename type_from_x_iterator<pixel_iterator_t>::view_t;
        -
        49  using locator_t = typename view_t::locator;
        -
        50 
        -
        51  locator_t loc(pixel_iterator_t(r, g, b, a), rowsize_in_bytes);
        -
        52  return view_t(width, height, loc);
        -
        53 }
        -
        54 
        -
        55 }} // namespace boost::gil
        -
        56 
        -
        57 #endif
        -
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition: image_view.hpp:54
        -
        auto planar_rgba_view(std::size_t width, std::size_t height, ChannelPtr r, ChannelPtr g, ChannelPtr b, ChannelPtr a, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< ChannelPtr, rgba_t > >::view_t
        from raw RGBA planar data
        Definition: rgba.hpp:42
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Alpha.
        Definition: rgba.hpp:22
        -
        Represents a color space and ordering of channels in memory.
        Definition: utilities.hpp:268
        -
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition: planar_pixel_iterator.hpp:58
        -
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition: metafunctions.hpp:303
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_RGBA_HPP
        +
        9#define BOOST_GIL_RGBA_HPP
        +
        10
        +
        11#include <boost/gil/planar_pixel_iterator.hpp>
        +
        12#include <boost/gil/rgb.hpp>
        +
        13#include <boost/gil/detail/mp11.hpp>
        +
        14
        +
        15#include <cstddef>
        +
        16#include <type_traits>
        +
        17
        +
        18namespace boost { namespace gil {
        +
        19
        +
        22struct alpha_t {};
        +
        23
        +
        25using rgba_t =mp11::mp_list<red_t, green_t, blue_t, alpha_t>;
        +
        26
        + +
        29
        + +
        32
        + +
        35
        + +
        38
        +
        41template <typename ChannelPtr>
        +
        +
        42inline auto planar_rgba_view(std::size_t width, std::size_t height,
        +
        43 ChannelPtr r, ChannelPtr g, ChannelPtr b, ChannelPtr a,
        +
        44 std::ptrdiff_t rowsize_in_bytes)
        + +
        46{
        +
        47 using pixel_iterator_t = planar_pixel_iterator<ChannelPtr, rgba_t>;
        + +
        49 using locator_t = typename view_t::locator;
        +
        50
        +
        51 locator_t loc(pixel_iterator_t(r, g, b, a), rowsize_in_bytes);
        +
        52 return view_t(width, height, loc);
        +
        53}
        +
        +
        54
        +
        55}} // namespace boost::gil
        +
        56
        +
        57#endif
        +
        A lightweight object that interprets memory as a 2D array of pixels. Models ImageViewConcept,...
        Definition image_view.hpp:54
        +
        auto planar_rgba_view(std::size_t width, std::size_t height, ChannelPtr r, ChannelPtr g, ChannelPtr b, ChannelPtr a, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< ChannelPtr, rgba_t > >::view_t
        from raw RGBA planar data
        Definition rgba.hpp:42
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Alpha.
        Definition rgba.hpp:22
        +
        Represents a color space and ordering of channels in memory.
        Definition utilities.hpp:268
        +
        An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
        Definition planar_pixel_iterator.hpp:58
        +
        Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
        Definition metafunctions.hpp:303
        diff --git a/html/reference/row__buffer__helper_8hpp_source.html b/html/reference/row__buffer__helper_8hpp_source.html index 13b7ca2b9..d8b5c78e6 100644 --- a/html/reference/row__buffer__helper_8hpp_source.html +++ b/html/reference/row__buffer__helper_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: row_buffer_helper.hpp Source File @@ -27,233 +27,238 @@

        - + +/* @license-end */ + +
        -
        -
        row_buffer_helper.hpp
        +
        row_buffer_helper.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_ROW_BUFFER_HELPER_HPP
        -
        9 #define BOOST_GIL_IO_ROW_BUFFER_HELPER_HPP
        -
        10 
        -
        11 // TODO: Shall we move toolbox to core?
        -
        12 #include <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
        -
        13 #include <boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp>
        -
        14 #include <boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp>
        -
        15 
        -
        16 #include <boost/gil/detail/mp11.hpp>
        -
        17 #include <boost/gil/io/typedefs.hpp>
        -
        18 
        -
        19 #include <cstddef>
        -
        20 #include <type_traits>
        -
        21 #include <vector>
        -
        22 
        -
        23 namespace boost { namespace gil { namespace detail {
        -
        24 
        -
        25 template< typename Pixel
        -
        26  , typename DummyT = void
        -
        27  >
        -
        28 struct row_buffer_helper
        -
        29 {
        -
        30  using element_t = Pixel;
        -
        31  using buffer_t = std::vector<element_t>;
        -
        32  using iterator_t = typename buffer_t::iterator;
        -
        33 
        -
        34  row_buffer_helper( std::size_t width
        -
        35  , bool
        -
        36  )
        -
        37  : _row_buffer( width )
        -
        38  {}
        -
        39 
        -
        40  element_t* data() { return &_row_buffer[0]; }
        -
        41 
        -
        42  iterator_t begin() { return _row_buffer.begin(); }
        -
        43  iterator_t end() { return _row_buffer.end(); }
        -
        44 
        -
        45  buffer_t& buffer() { return _row_buffer; }
        -
        46 
        -
        47 private:
        -
        48 
        -
        49  buffer_t _row_buffer;
        -
        50 };
        -
        51 
        -
        52 template <typename Pixel>
        -
        53 struct row_buffer_helper
        -
        54 <
        -
        55  Pixel,
        -
        56  typename std::enable_if
        -
        57  <
        -
        58  is_bit_aligned<Pixel>::value
        -
        59  >::type
        -
        60 >
        -
        61 {
        -
        62  using element_t = byte_t;
        -
        63  using buffer_t = std::vector<element_t>;
        -
        64  using pixel_type = Pixel;
        -
        65  using iterator_t = bit_aligned_pixel_iterator<pixel_type>;
        -
        66 
        -
        67  row_buffer_helper(std::size_t width, bool in_bytes)
        -
        68  : _c{( width * pixel_bit_size< pixel_type >::value) >> 3}
        -
        69  , _r{width * pixel_bit_size< pixel_type >::value - (_c << 3)}
        -
        70  {
        -
        71  if (in_bytes)
        -
        72  {
        -
        73  _row_buffer.resize(width);
        -
        74  }
        -
        75  else
        -
        76  {
        -
        77  // add one byte if there are remaining bits
        -
        78  _row_buffer.resize(_c + (_r != 0));
        -
        79  }
        -
        80  }
        -
        81 
        -
        82  element_t* data() { return &_row_buffer[0]; }
        -
        83 
        -
        84  iterator_t begin() { return iterator_t( &_row_buffer.front(),0 ); }
        -
        85  iterator_t end() { return _r == 0 ? iterator_t( &_row_buffer.back() + 1, 0 )
        -
        86  : iterator_t( &_row_buffer.back() , (int) _r );
        -
        87  }
        -
        88 
        -
        89  buffer_t& buffer() { return _row_buffer; }
        -
        90 
        -
        91 private:
        -
        92 
        -
        93  // For instance 25 pixels of rgb2 type would be:
        -
        94  // overall 25 pixels * 3 channels * 2 bits/channel = 150 bits
        -
        95  // c = 18 bytes
        -
        96  // r = 6 bits
        -
        97 
        -
        98  std::size_t _c; // number of full bytes
        -
        99  std::size_t _r; // number of remaining bits
        -
        100 
        -
        101  buffer_t _row_buffer;
        -
        102 };
        -
        103 
        -
        104 template<typename Pixel>
        -
        105 struct row_buffer_helper
        -
        106 <
        -
        107  Pixel,
        -
        108  typename std::enable_if
        -
        109  <
        -
        110  mp11::mp_and
        -
        111  <
        -
        112  typename is_bit_aligned<Pixel>::type,
        -
        113  typename is_homogeneous<Pixel>::type
        -
        114  >::value
        -
        115  >
        -
        116 >
        -
        117 {
        -
        118  using element_t = byte_t;
        -
        119  using buffer_t = std::vector<element_t>;
        -
        120  using pixel_type = Pixel;
        -
        121  using iterator_t = bit_aligned_pixel_iterator<pixel_type>;
        -
        122 
        -
        123  row_buffer_helper( std::size_t width
        -
        124  , bool in_bytes
        -
        125  )
        -
        126  : _c( ( width
        -
        127  * num_channels< pixel_type >::value
        -
        128  * channel_type< pixel_type >::type::num_bits
        -
        129  )
        -
        130  >> 3
        -
        131  )
        -
        132 
        -
        133  , _r( width
        -
        134  * num_channels< pixel_type >::value
        -
        135  * channel_type< pixel_type >::type::num_bits
        -
        136  - ( _c << 3 )
        -
        137  )
        -
        138  {
        -
        139  if( in_bytes )
        -
        140  {
        -
        141  _row_buffer.resize( width );
        -
        142  }
        -
        143  else
        -
        144  {
        -
        145  // add one byte if there are remaining bits
        -
        146  _row_buffer.resize( _c + ( _r!=0 ));
        -
        147  }
        -
        148  }
        -
        149 
        -
        150  element_t* data() { return &_row_buffer[0]; }
        -
        151 
        -
        152  iterator_t begin() { return iterator_t( &_row_buffer.front(),0 ); }
        -
        153  iterator_t end() { return _r == 0 ? iterator_t( &_row_buffer.back() + 1, 0 )
        -
        154  : iterator_t( &_row_buffer.back() , (int) _r );
        -
        155  }
        -
        156 
        -
        157  buffer_t& buffer() { return _row_buffer; }
        -
        158 
        -
        159 private:
        -
        160 
        -
        161  // For instance 25 pixels of rgb2 type would be:
        -
        162  // overall 25 pixels * 3 channels * 2 bits/channel = 150 bits
        -
        163  // c = 18 bytes
        -
        164  // r = 6 bits
        -
        165 
        -
        166  std::size_t _c; // number of full bytes
        -
        167  std::size_t _r; // number of remaining bits
        -
        168 
        -
        169  buffer_t _row_buffer;
        -
        170 };
        -
        171 
        -
        172 template <typename View, typename D = void>
        -
        173 struct row_buffer_helper_view : row_buffer_helper<typename View::value_type>
        -
        174 {
        -
        175  row_buffer_helper_view(std::size_t width, bool in_bytes)
        -
        176  : row_buffer_helper<typename View::value_type>(width, in_bytes)
        -
        177  {}
        -
        178 };
        -
        179 
        -
        180 template <typename View>
        -
        181 struct row_buffer_helper_view
        -
        182 <
        -
        183  View,
        -
        184  typename std::enable_if
        -
        185  <
        -
        186  is_bit_aligned<typename View::value_type>::value
        -
        187  >::type
        -
        188 > : row_buffer_helper<typename View::reference>
        -
        189 {
        -
        190  row_buffer_helper_view(std::size_t width, bool in_bytes)
        -
        191  : row_buffer_helper<typename View::reference>(width, in_bytes)
        -
        192  {}
        -
        193 };
        -
        194 
        -
        195 } // namespace detail
        -
        196 } // namespace gil
        -
        197 } // namespace boost
        -
        198 
        -
        199 #endif
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_ROW_BUFFER_HELPER_HPP
        +
        9#define BOOST_GIL_IO_ROW_BUFFER_HELPER_HPP
        +
        10
        +
        11// TODO: Shall we move toolbox to core?
        +
        12#include <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
        +
        13#include <boost/gil/extension/toolbox/metafunctions/is_homogeneous.hpp>
        +
        14#include <boost/gil/extension/toolbox/metafunctions/pixel_bit_size.hpp>
        +
        15
        +
        16#include <boost/gil/detail/mp11.hpp>
        +
        17#include <boost/gil/io/typedefs.hpp>
        +
        18
        +
        19#include <cstddef>
        +
        20#include <type_traits>
        +
        21#include <vector>
        +
        22
        +
        23namespace boost { namespace gil { namespace detail {
        +
        24
        +
        25template< typename Pixel
        +
        26 , typename DummyT = void
        +
        27 >
        +
        28struct row_buffer_helper
        +
        29{
        +
        30 using element_t = Pixel;
        +
        31 using buffer_t = std::vector<element_t>;
        +
        32 using iterator_t = typename buffer_t::iterator;
        +
        33
        +
        34 row_buffer_helper( std::size_t width
        +
        35 , bool
        +
        36 )
        +
        37 : _row_buffer( width )
        +
        38 {}
        +
        39
        +
        40 element_t* data() { return &_row_buffer[0]; }
        +
        41
        +
        42 iterator_t begin() { return _row_buffer.begin(); }
        +
        43 iterator_t end() { return _row_buffer.end(); }
        +
        44
        +
        45 buffer_t& buffer() { return _row_buffer; }
        +
        46
        +
        47private:
        +
        48
        +
        49 buffer_t _row_buffer;
        +
        50};
        +
        51
        +
        52template <typename Pixel>
        +
        53struct row_buffer_helper
        +
        54<
        +
        55 Pixel,
        +
        56 typename std::enable_if
        +
        57 <
        +
        58 is_bit_aligned<Pixel>::value
        +
        59 >::type
        +
        60>
        +
        61{
        +
        62 using element_t = byte_t;
        +
        63 using buffer_t = std::vector<element_t>;
        +
        64 using pixel_type = Pixel;
        +
        65 using iterator_t = bit_aligned_pixel_iterator<pixel_type>;
        +
        66
        +
        67 row_buffer_helper(std::size_t width, bool in_bytes)
        +
        68 : _c{( width * pixel_bit_size< pixel_type >::value) >> 3}
        +
        69 , _r{width * pixel_bit_size< pixel_type >::value - (_c << 3)}
        +
        70 {
        +
        71 if (in_bytes)
        +
        72 {
        +
        73 _row_buffer.resize(width);
        +
        74 }
        +
        75 else
        +
        76 {
        +
        77 // add one byte if there are remaining bits
        +
        78 _row_buffer.resize(_c + (_r != 0));
        +
        79 }
        +
        80 }
        +
        81
        +
        82 element_t* data() { return &_row_buffer[0]; }
        +
        83
        +
        84 iterator_t begin() { return iterator_t( &_row_buffer.front(),0 ); }
        +
        85 iterator_t end() { return _r == 0 ? iterator_t( &_row_buffer.back() + 1, 0 )
        +
        86 : iterator_t( &_row_buffer.back() , (int) _r );
        +
        87 }
        +
        88
        +
        89 buffer_t& buffer() { return _row_buffer; }
        +
        90
        +
        91private:
        +
        92
        +
        93 // For instance 25 pixels of rgb2 type would be:
        +
        94 // overall 25 pixels * 3 channels * 2 bits/channel = 150 bits
        +
        95 // c = 18 bytes
        +
        96 // r = 6 bits
        +
        97
        +
        98 std::size_t _c; // number of full bytes
        +
        99 std::size_t _r; // number of remaining bits
        +
        100
        +
        101 buffer_t _row_buffer;
        +
        102};
        +
        103
        +
        104template<typename Pixel>
        +
        105struct row_buffer_helper
        +
        106<
        +
        107 Pixel,
        +
        108 typename std::enable_if
        +
        109 <
        +
        110 mp11::mp_and
        +
        111 <
        +
        112 typename is_bit_aligned<Pixel>::type,
        +
        113 typename is_homogeneous<Pixel>::type
        +
        114 >::value
        +
        115 >
        +
        116>
        +
        117{
        +
        118 using element_t = byte_t;
        +
        119 using buffer_t = std::vector<element_t>;
        +
        120 using pixel_type = Pixel;
        +
        121 using iterator_t = bit_aligned_pixel_iterator<pixel_type>;
        +
        122
        +
        123 row_buffer_helper( std::size_t width
        +
        124 , bool in_bytes
        +
        125 )
        +
        126 : _c( ( width
        +
        127 * num_channels< pixel_type >::value
        +
        128 * channel_type< pixel_type >::type::num_bits
        +
        129 )
        +
        130 >> 3
        +
        131 )
        +
        132
        +
        133 , _r( width
        +
        134 * num_channels< pixel_type >::value
        +
        135 * channel_type< pixel_type >::type::num_bits
        +
        136 - ( _c << 3 )
        +
        137 )
        +
        138 {
        +
        139 if( in_bytes )
        +
        140 {
        +
        141 _row_buffer.resize( width );
        +
        142 }
        +
        143 else
        +
        144 {
        +
        145 // add one byte if there are remaining bits
        +
        146 _row_buffer.resize( _c + ( _r!=0 ));
        +
        147 }
        +
        148 }
        +
        149
        +
        150 element_t* data() { return &_row_buffer[0]; }
        +
        151
        +
        152 iterator_t begin() { return iterator_t( &_row_buffer.front(),0 ); }
        +
        153 iterator_t end() { return _r == 0 ? iterator_t( &_row_buffer.back() + 1, 0 )
        +
        154 : iterator_t( &_row_buffer.back() , (int) _r );
        +
        155 }
        +
        156
        +
        157 buffer_t& buffer() { return _row_buffer; }
        +
        158
        +
        159private:
        +
        160
        +
        161 // For instance 25 pixels of rgb2 type would be:
        +
        162 // overall 25 pixels * 3 channels * 2 bits/channel = 150 bits
        +
        163 // c = 18 bytes
        +
        164 // r = 6 bits
        +
        165
        +
        166 std::size_t _c; // number of full bytes
        +
        167 std::size_t _r; // number of remaining bits
        +
        168
        +
        169 buffer_t _row_buffer;
        +
        170};
        +
        171
        +
        172template <typename View, typename D = void>
        +
        173struct row_buffer_helper_view : row_buffer_helper<typename View::value_type>
        +
        174{
        +
        175 row_buffer_helper_view(std::size_t width, bool in_bytes)
        +
        176 : row_buffer_helper<typename View::value_type>(width, in_bytes)
        +
        177 {}
        +
        178};
        +
        179
        +
        180template <typename View>
        +
        181struct row_buffer_helper_view
        +
        182<
        +
        183 View,
        +
        184 typename std::enable_if
        +
        185 <
        +
        186 is_bit_aligned<typename View::value_type>::value
        +
        187 >::type
        +
        188> : row_buffer_helper<typename View::reference>
        +
        189{
        +
        190 row_buffer_helper_view(std::size_t width, bool in_bytes)
        +
        191 : row_buffer_helper<typename View::reference>(width, in_bytes)
        +
        192 {}
        +
        193};
        +
        194
        +
        195} // namespace detail
        +
        196} // namespace gil
        +
        197} // namespace boost
        +
        198
        +
        199#endif
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/scaling_8hpp_source.html b/html/reference/scaling_8hpp_source.html index e0fc498a7..1f4208b82 100644 --- a/html/reference/scaling_8hpp_source.html +++ b/html/reference/scaling_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: scaling.hpp Source File @@ -27,124 +27,131 @@

        - + +/* @license-end */ + +
        -
        -
        scaling.hpp
        +
        scaling.hpp
        -
        1 //
        -
        2 // Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
        -
        3 //
        -
        4 // Use, modification and distribution are subject to the Boost Software License,
        -
        5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt)
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IMAGE_PROCESSING_SCALING_HPP
        -
        9 #define BOOST_GIL_IMAGE_PROCESSING_SCALING_HPP
        -
        10 
        -
        11 #include <boost/gil/image_view.hpp>
        -
        12 #include <boost/gil/rgb.hpp>
        -
        13 #include <boost/gil/pixel.hpp>
        -
        14 #include <boost/gil/image_processing/numeric.hpp>
        -
        15 
        -
        16 namespace boost { namespace gil {
        -
        17 
        -
        36 template <typename ImageView>
        -
        37 void lanczos_at(
        -
        38  ImageView input_view,
        -
        39  ImageView output_view,
        -
        40  typename ImageView::x_coord_t source_x,
        -
        41  typename ImageView::y_coord_t source_y,
        -
        42  typename ImageView::x_coord_t target_x,
        -
        43  typename ImageView::y_coord_t target_y,
        -
        44  std::ptrdiff_t a)
        -
        45 {
        -
        46  using x_coord_t = typename ImageView::x_coord_t;
        -
        47  using y_coord_t = typename ImageView::y_coord_t;
        -
        48  using pixel_t = typename std::remove_reference<decltype(std::declval<ImageView>()(0, 0))>::type;
        -
        49 
        -
        50  // C++11 doesn't allow auto in lambdas
        -
        51  using channel_t = typename std::remove_reference
        -
        52  <
        -
        53  decltype(std::declval<pixel_t>().at(std::integral_constant<int, 0>{}))
        -
        54  >::type;
        -
        55 
        -
        56  pixel_t result_pixel;
        -
        57  static_transform(result_pixel, result_pixel, [](channel_t) {
        -
        58  return static_cast<channel_t>(0);
        -
        59  });
        -
        60  auto x_zero = static_cast<x_coord_t>(0);
        -
        61  auto x_one = static_cast<x_coord_t>(1);
        -
        62  auto y_zero = static_cast<y_coord_t>(0);
        -
        63  auto y_one = static_cast<y_coord_t>(1);
        -
        64 
        -
        65  for (y_coord_t y_i = (std::max)(source_y - static_cast<y_coord_t>(a) + y_one, y_zero);
        -
        66  y_i <= (std::min)(source_y + static_cast<y_coord_t>(a), input_view.height() - y_one);
        -
        67  ++y_i)
        -
        68  {
        -
        69  for (x_coord_t x_i = (std::max)(source_x - static_cast<x_coord_t>(a) + x_one, x_zero);
        -
        70  x_i <= (std::min)(source_x + static_cast<x_coord_t>(a), input_view.width() - x_one);
        -
        71  ++x_i)
        -
        72  {
        -
        73  double lanczos_response = lanczos(source_x - x_i, a) * lanczos(source_y - y_i, a);
        -
        74  auto op = [lanczos_response](channel_t prev, channel_t next)
        -
        75  {
        -
        76  return static_cast<channel_t>(prev + next * lanczos_response);
        -
        77  };
        -
        78  static_transform(result_pixel, input_view(source_x, source_y), result_pixel, op);
        -
        79  }
        -
        80  }
        -
        81 
        -
        82  output_view(target_x, target_y) = result_pixel;
        -
        83 }
        -
        84 
        -
        94 template <typename ImageView>
        -
        95 void scale_lanczos(ImageView input_view, ImageView output_view, std::ptrdiff_t a)
        -
        96 {
        -
        97  double scale_x = (static_cast<double>(output_view.width()))
        -
        98  / static_cast<double>(input_view.width());
        -
        99  double scale_y = (static_cast<double>(output_view.height()))
        -
        100  / static_cast<double>(input_view.height());
        -
        101 
        -
        102  using x_coord_t = typename ImageView::x_coord_t;
        -
        103  using y_coord_t = typename ImageView::y_coord_t;
        -
        104  for (y_coord_t y = 0; y < output_view.height(); ++y)
        -
        105  {
        -
        106  for (x_coord_t x = 0; x < output_view.width(); ++x)
        -
        107  {
        -
        108  lanczos_at(input_view, output_view, x / scale_x, y / scale_y, x, y, a);
        -
        109  }
        -
        110  }
        -
        111 }
        -
        112 
        -
        113 }} // namespace boost::gil
        -
        114 
        -
        115 #endif
        -
        void scale_lanczos(ImageView input_view, ImageView output_view, std::ptrdiff_t a)
        Complete Lanczos algorithm.
        Definition: scaling.hpp:95
        -
        double lanczos(double x, std::ptrdiff_t a)
        Lanczos response at point x.
        Definition: numeric.hpp:46
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
        +
        3//
        +
        4// Use, modification and distribution are subject to the Boost Software License,
        +
        5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt)
        +
        7//
        +
        8#ifndef BOOST_GIL_IMAGE_PROCESSING_SCALING_HPP
        +
        9#define BOOST_GIL_IMAGE_PROCESSING_SCALING_HPP
        +
        10
        +
        11#include <boost/gil/image_view.hpp>
        +
        12#include <boost/gil/rgb.hpp>
        +
        13#include <boost/gil/pixel.hpp>
        +
        14#include <boost/gil/image_processing/numeric.hpp>
        +
        15
        +
        16namespace boost { namespace gil {
        +
        17
        +
        36template <typename ImageView>
        +
        37void lanczos_at(
        +
        38 ImageView input_view,
        +
        39 ImageView output_view,
        +
        40 typename ImageView::x_coord_t source_x,
        +
        41 typename ImageView::y_coord_t source_y,
        +
        42 typename ImageView::x_coord_t target_x,
        +
        43 typename ImageView::y_coord_t target_y,
        +
        44 std::ptrdiff_t a)
        +
        45{
        +
        46 using x_coord_t = typename ImageView::x_coord_t;
        +
        47 using y_coord_t = typename ImageView::y_coord_t;
        +
        48 using pixel_t = typename std::remove_reference<decltype(std::declval<ImageView>()(0, 0))>::type;
        +
        49
        +
        50 // C++11 doesn't allow auto in lambdas
        +
        51 using channel_t = typename std::remove_reference
        +
        52 <
        +
        53 decltype(std::declval<pixel_t>().at(std::integral_constant<int, 0>{}))
        +
        54 >::type;
        +
        55
        +
        56 pixel_t result_pixel;
        +
        57 static_transform(result_pixel, result_pixel, [](channel_t) {
        +
        58 return static_cast<channel_t>(0);
        +
        59 });
        +
        60 auto x_zero = static_cast<x_coord_t>(0);
        +
        61 auto x_one = static_cast<x_coord_t>(1);
        +
        62 auto y_zero = static_cast<y_coord_t>(0);
        +
        63 auto y_one = static_cast<y_coord_t>(1);
        +
        64
        +
        65 for (y_coord_t y_i = (std::max)(source_y - static_cast<y_coord_t>(a) + y_one, y_zero);
        +
        66 y_i <= (std::min)(source_y + static_cast<y_coord_t>(a), input_view.height() - y_one);
        +
        67 ++y_i)
        +
        68 {
        +
        69 for (x_coord_t x_i = (std::max)(source_x - static_cast<x_coord_t>(a) + x_one, x_zero);
        +
        70 x_i <= (std::min)(source_x + static_cast<x_coord_t>(a), input_view.width() - x_one);
        +
        71 ++x_i)
        +
        72 {
        +
        73 double lanczos_response = lanczos(source_x - x_i, a) * lanczos(source_y - y_i, a);
        +
        74 auto op = [lanczos_response](channel_t prev, channel_t next)
        +
        75 {
        +
        76 return static_cast<channel_t>(prev + next * lanczos_response);
        +
        77 };
        +
        78 static_transform(result_pixel, input_view(source_x, source_y), result_pixel, op);
        +
        79 }
        +
        80 }
        +
        81
        +
        82 output_view(target_x, target_y) = result_pixel;
        +
        83}
        +
        84
        +
        94template <typename ImageView>
        +
        +
        95void scale_lanczos(ImageView input_view, ImageView output_view, std::ptrdiff_t a)
        +
        96{
        +
        97 double scale_x = (static_cast<double>(output_view.width()))
        +
        98 / static_cast<double>(input_view.width());
        +
        99 double scale_y = (static_cast<double>(output_view.height()))
        +
        100 / static_cast<double>(input_view.height());
        +
        101
        +
        102 using x_coord_t = typename ImageView::x_coord_t;
        +
        103 using y_coord_t = typename ImageView::y_coord_t;
        +
        104 for (y_coord_t y = 0; y < output_view.height(); ++y)
        +
        105 {
        +
        106 for (x_coord_t x = 0; x < output_view.width(); ++x)
        +
        107 {
        +
        108 lanczos_at(input_view, output_view, x / scale_x, y / scale_y, x, y, a);
        +
        109 }
        +
        110 }
        +
        111}
        +
        +
        112
        +
        113}} // namespace boost::gil
        +
        114
        +
        115#endif
        +
        void scale_lanczos(ImageView input_view, ImageView output_view, std::ptrdiff_t a)
        Complete Lanczos algorithm.
        Definition scaling.hpp:95
        +
        double lanczos(double x, std::ptrdiff_t a)
        Lanczos response at point x.
        Definition numeric.hpp:46
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/scanline__read__iterator_8hpp_source.html b/html/reference/scanline__read__iterator_8hpp_source.html index 8e7d718b2..b3c15a7c8 100644 --- a/html/reference/scanline__read__iterator_8hpp_source.html +++ b/html/reference/scanline__read__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: scanline_read_iterator.hpp Source File @@ -27,135 +27,141 @@

        - + +/* @license-end */ + +
        -
        -
        scanline_read_iterator.hpp
        +
        scanline_read_iterator.hpp
        -
        1 //
        -
        2 // Copyright 2007-2008 Christian Henning
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_IO_SCANLINE_READ_ITERATOR_HPP
        -
        9 #define BOOST_GIL_IO_SCANLINE_READ_ITERATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/io/error.hpp>
        -
        12 #include <boost/gil/io/typedefs.hpp>
        -
        13 
        -
        14 #include <boost/iterator/iterator_facade.hpp>
        -
        15 
        -
        16 #include <iterator>
        -
        17 #include <memory>
        -
        18 #include <vector>
        -
        19 
        -
        20 namespace boost { namespace gil {
        -
        21 
        -
        22 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        23 #pragma warning(push)
        -
        24 #pragma warning(disable:4512) //assignment operator could not be generated
        -
        25 #endif
        -
        26 
        -
        28 template <typename Reader>
        - -
        30  : public boost::iterator_facade<scanline_read_iterator<Reader>, byte_t*, std::input_iterator_tag>
        -
        31 {
        -
        32 private:
        -
        33  using base_t = boost::iterator_facade
        -
        34  <
        - -
        36  byte_t*,
        -
        37  std::input_iterator_tag
        -
        38  >;
        -
        39 public:
        -
        40  scanline_read_iterator(Reader& reader, int pos = 0)
        -
        41  : reader_(reader), pos_(pos)
        -
        42  {
        -
        43  buffer_ = std::make_shared<buffer_t>(buffer_t(reader_._scanline_length));
        -
        44  buffer_start_ = &buffer_->front();
        -
        45  }
        -
        46 
        -
        47 private:
        -
        48  friend class boost::iterator_core_access;
        -
        49 
        -
        50  void increment()
        -
        51  {
        -
        52  if (skip_scanline_)
        -
        53  {
        -
        54  reader_.skip(buffer_start_, pos_);
        -
        55  }
        -
        56 
        -
        57  ++pos_;
        -
        58 
        -
        59  skip_scanline_ = true;
        -
        60  read_scanline_ = true;
        -
        61  }
        -
        62 
        -
        63  bool equal(scanline_read_iterator const& rhs) const
        -
        64  {
        -
        65  return pos_ == rhs.pos_;
        -
        66  }
        -
        67 
        -
        68  typename base_t::reference dereference() const
        -
        69  {
        -
        70  if (read_scanline_)
        -
        71  {
        -
        72  reader_.read(buffer_start_, pos_);
        -
        73  }
        -
        74  skip_scanline_ = false;
        -
        75  read_scanline_ = false;
        -
        76 
        -
        77  return buffer_start_;
        -
        78  }
        -
        79 
        -
        80 private:
        -
        81  Reader& reader_;
        -
        82 
        -
        83  mutable int pos_ = 0;
        -
        84  mutable bool read_scanline_ = true;
        -
        85  mutable bool skip_scanline_ = true;
        -
        86 
        -
        87  using buffer_t = std::vector<byte_t>;
        -
        88  using buffer_ptr_t = std::shared_ptr<buffer_t>;
        -
        89  buffer_ptr_t buffer_;
        -
        90  mutable byte_t* buffer_start_ = nullptr;
        -
        91 };
        -
        92 
        -
        93 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        -
        94 #pragma warning(pop)
        -
        95 #endif
        -
        96 
        -
        97 } // namespace gil
        -
        98 } // namespace boost
        -
        99 
        -
        100 #endif
        -
        Input iterator to read images.
        Definition: scanline_read_iterator.hpp:31
        -
        BOOST_FORCEINLINE bool equal(boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
        std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
        Definition: algorithm.hpp:1087
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        +
        1//
        +
        2// Copyright 2007-2008 Christian Henning
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_IO_SCANLINE_READ_ITERATOR_HPP
        +
        9#define BOOST_GIL_IO_SCANLINE_READ_ITERATOR_HPP
        +
        10
        +
        11#include <boost/gil/io/error.hpp>
        +
        12#include <boost/gil/io/typedefs.hpp>
        +
        13
        +
        14#include <boost/iterator/iterator_facade.hpp>
        +
        15
        +
        16#include <iterator>
        +
        17#include <memory>
        +
        18#include <vector>
        +
        19
        +
        20namespace boost { namespace gil {
        +
        21
        +
        22#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        23#pragma warning(push)
        +
        24#pragma warning(disable:4512) //assignment operator could not be generated
        +
        25#endif
        +
        26
        +
        28template <typename Reader>
        +
        + +
        30 : public boost::iterator_facade<scanline_read_iterator<Reader>, byte_t*, std::input_iterator_tag>
        +
        31{
        +
        32private:
        +
        33 using base_t = boost::iterator_facade
        +
        34 <
        + +
        36 byte_t*,
        +
        37 std::input_iterator_tag
        +
        38 >;
        +
        39public:
        +
        40 scanline_read_iterator(Reader& reader, int pos = 0)
        +
        41 : reader_(reader), pos_(pos)
        +
        42 {
        +
        43 buffer_ = std::make_shared<buffer_t>(buffer_t(reader_._scanline_length));
        +
        44 buffer_start_ = &buffer_->front();
        +
        45 }
        +
        46
        +
        47private:
        +
        48 friend class boost::iterator_core_access;
        +
        49
        +
        50 void increment()
        +
        51 {
        +
        52 if (skip_scanline_)
        +
        53 {
        +
        54 reader_.skip(buffer_start_, pos_);
        +
        55 }
        +
        56
        +
        57 ++pos_;
        +
        58
        +
        59 skip_scanline_ = true;
        +
        60 read_scanline_ = true;
        +
        61 }
        +
        62
        +
        63 bool equal(scanline_read_iterator const& rhs) const
        +
        64 {
        +
        65 return pos_ == rhs.pos_;
        +
        66 }
        +
        67
        +
        68 typename base_t::reference dereference() const
        +
        69 {
        +
        70 if (read_scanline_)
        +
        71 {
        +
        72 reader_.read(buffer_start_, pos_);
        +
        73 }
        +
        74 skip_scanline_ = false;
        +
        75 read_scanline_ = false;
        +
        76
        +
        77 return buffer_start_;
        +
        78 }
        +
        79
        +
        80private:
        +
        81 Reader& reader_;
        +
        82
        +
        83 mutable int pos_ = 0;
        +
        84 mutable bool read_scanline_ = true;
        +
        85 mutable bool skip_scanline_ = true;
        +
        86
        +
        87 using buffer_t = std::vector<byte_t>;
        +
        88 using buffer_ptr_t = std::shared_ptr<buffer_t>;
        +
        89 buffer_ptr_t buffer_;
        +
        90 mutable byte_t* buffer_start_ = nullptr;
        +
        91};
        +
        +
        92
        +
        93#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
        +
        94#pragma warning(pop)
        +
        95#endif
        +
        96
        +
        97} // namespace gil
        +
        98} // namespace boost
        +
        99
        +
        100#endif
        +
        Input iterator to read images.
        Definition scanline_read_iterator.hpp:31
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        diff --git a/html/reference/splitbard.png b/html/reference/splitbard.png new file mode 100644 index 000000000..8367416d7 Binary files /dev/null and b/html/reference/splitbard.png differ diff --git a/html/reference/step__iterator_8hpp_source.html b/html/reference/step__iterator_8hpp_source.html index 192a57683..f4c78fee3 100644 --- a/html/reference/step__iterator_8hpp_source.html +++ b/html/reference/step__iterator_8hpp_source.html @@ -4,7 +4,7 @@ - + Generic Image Library: step_iterator.hpp Source File @@ -27,320 +27,331 @@

        - + +/* @license-end */ + +
        -
        -
        step_iterator.hpp
        +
        step_iterator.hpp
        -
        1 //
        -
        2 // Copyright 2005-2007 Adobe Systems Incorporated
        -
        3 //
        -
        4 // Distributed under the Boost Software License, Version 1.0
        -
        5 // See accompanying file LICENSE_1_0.txt or copy at
        -
        6 // http://www.boost.org/LICENSE_1_0.txt
        -
        7 //
        -
        8 #ifndef BOOST_GIL_STEP_ITERATOR_HPP
        -
        9 #define BOOST_GIL_STEP_ITERATOR_HPP
        -
        10 
        -
        11 #include <boost/gil/dynamic_step.hpp>
        -
        12 #include <boost/gil/pixel_iterator.hpp>
        -
        13 #include <boost/gil/pixel_iterator_adaptor.hpp>
        -
        14 #include <boost/gil/utilities.hpp>
        -
        15 
        -
        16 #include <boost/iterator/iterator_facade.hpp>
        -
        17 
        -
        18 #include <cstddef>
        -
        19 #include <iterator>
        -
        20 #include <type_traits>
        -
        21 
        -
        22 namespace boost { namespace gil {
        -
        23 
        -
        27 
        -
        28 namespace detail {
        -
        29 
        -
        36 
        -
        37 template <typename Derived, // type of the derived class
        -
        38  typename Iterator, // Models Iterator
        -
        39  typename SFn> // A policy object that can compute the distance between two iterators of type Iterator
        -
        40  // and can advance an iterator of type Iterator a given number of Iterator's units
        -
        41 class step_iterator_adaptor : public iterator_adaptor<Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type>
        -
        42 {
        -
        43 public:
        -
        44  using parent_t = iterator_adaptor<Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type>;
        -
        45  using base_difference_type = typename std::iterator_traits<Iterator>::difference_type;
        -
        46  using difference_type = typename SFn::difference_type;
        -
        47  using reference = typename std::iterator_traits<Iterator>::reference;
        -
        48 
        - -
        50  step_iterator_adaptor(Iterator const& it, SFn step_fn=SFn()) : parent_t(it), _step_fn(step_fn) {}
        -
        51 
        -
        52  auto step() const -> difference_type { return _step_fn.step(); }
        -
        53 
        -
        54 protected:
        -
        55  SFn _step_fn;
        -
        56 private:
        -
        57  friend class boost::iterator_core_access;
        -
        58 
        -
        59  void increment() { _step_fn.advance(this->base_reference(),1); }
        -
        60  void decrement() { _step_fn.advance(this->base_reference(),-1); }
        -
        61  void advance(base_difference_type d) { _step_fn.advance(this->base_reference(),d); }
        -
        62 
        -
        63  auto distance_to(step_iterator_adaptor const& it) const -> difference_type
        -
        64  {
        -
        65  return _step_fn.difference(this->base_reference(),it.base_reference());
        -
        66  }
        -
        67 };
        -
        68 
        -
        69 // although iterator_adaptor defines these, the default implementation computes distance and compares for zero.
        -
        70 // it is often faster to just apply the relation operator to the base
        -
        71 template <typename D,typename Iterator,typename SFn> inline
        - -
        73  return p1.step()>0 ? p1.base()> p2.base() : p1.base()< p2.base();
        -
        74 }
        -
        75 
        -
        76 template <typename D,typename Iterator,typename SFn> inline
        -
        77 bool operator<(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        -
        78  return p1.step()>0 ? p1.base()< p2.base() : p1.base()> p2.base();
        -
        79 }
        -
        80 
        -
        81 template <typename D,typename Iterator,typename SFn> inline
        -
        82 bool operator>=(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        -
        83  return p1.step()>0 ? p1.base()>=p2.base() : p1.base()<=p2.base();
        -
        84 }
        -
        85 
        -
        86 template <typename D,typename Iterator,typename SFn> inline
        -
        87 bool operator<=(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        -
        88  return p1.step()>0 ? p1.base()<=p2.base() : p1.base()>=p2.base();
        -
        89 }
        -
        90 
        -
        91 template <typename D,typename Iterator,typename SFn> inline
        -
        92 bool operator==(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        -
        93  return p1.base()==p2.base();
        -
        94 }
        -
        95 
        -
        96 template <typename D,typename Iterator,typename SFn> inline
        -
        97 bool operator!=(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        -
        98  return p1.base()!=p2.base();
        -
        99 }
        -
        100 
        -
        101 } // namespace detail
        -
        102 
        -
        106 
        -
        122 
        -
        125 template <typename Iterator>
        - -
        127  using difference_type = std::ptrdiff_t;
        -
        128 
        -
        129  memunit_step_fn(difference_type step=memunit_step(Iterator())) : _step(step) {}
        -
        130 
        -
        131  auto difference(Iterator const& it1, Iterator const& it2) const -> difference_type
        -
        132  {
        -
        133  return memunit_distance(it1,it2)/_step;
        -
        134  }
        -
        135 
        -
        136  void advance(Iterator& it, difference_type d) const { memunit_advance(it,d*_step); }
        -
        137  auto step() const -> difference_type { return _step; }
        -
        138 
        -
        139  void set_step(std::ptrdiff_t step) { _step=step; }
        -
        140 private:
        -
        141  BOOST_GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
        -
        142  difference_type _step;
        -
        143 };
        -
        144 
        -
        145 template <typename Iterator>
        -
        146 class memory_based_step_iterator : public detail::step_iterator_adaptor<memory_based_step_iterator<Iterator>,
        -
        147  Iterator,
        -
        148  memunit_step_fn<Iterator>>
        -
        149 {
        -
        150  BOOST_GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
        -
        151 public:
        - -
        153  Iterator,
        - -
        155  using reference = typename parent_t::reference;
        -
        156  using difference_type = typename parent_t::difference_type;
        -
        157  using x_iterator = Iterator;
        -
        158 
        -
        159  memory_based_step_iterator() : parent_t(Iterator()) {}
        -
        160  memory_based_step_iterator(Iterator it, std::ptrdiff_t memunit_step) : parent_t(it, memunit_step_fn<Iterator>(memunit_step)) {}
        -
        161  template <typename I2>
        - -
        163  : parent_t(it.base(), memunit_step_fn<Iterator>(it.step())) {}
        -
        164 
        -
        167  auto operator[](difference_type d) const -> reference { return *(*this+d); }
        -
        168 
        -
        169  void set_step(std::ptrdiff_t memunit_step) { this->_step_fn.set_step(memunit_step); }
        -
        170 
        -
        171  auto base() -> x_iterator& { return parent_t::base_reference(); }
        -
        172  auto base() const -> x_iterator const& { return parent_t::base_reference(); }
        -
        173 };
        -
        174 
        -
        175 template <typename Iterator>
        -
        176 struct const_iterator_type<memory_based_step_iterator<Iterator>> {
        -
        177  using type = memory_based_step_iterator<typename const_iterator_type<Iterator>::type>;
        -
        178 };
        -
        179 
        -
        180 template <typename Iterator>
        -
        181 struct iterator_is_mutable<memory_based_step_iterator<Iterator>> : public iterator_is_mutable<Iterator> {};
        -
        182 
        -
        183 
        -
        185 // IteratorAdaptorConcept
        -
        187 
        -
        188 template <typename Iterator>
        -
        189 struct is_iterator_adaptor<memory_based_step_iterator<Iterator>> : std::true_type {};
        -
        190 
        -
        191 template <typename Iterator>
        -
        192 struct iterator_adaptor_get_base<memory_based_step_iterator<Iterator>>
        -
        193 {
        -
        194  using type = Iterator;
        -
        195 };
        -
        196 
        -
        197 template <typename Iterator, typename NewBaseIterator>
        -
        198 struct iterator_adaptor_rebind<memory_based_step_iterator<Iterator>, NewBaseIterator>
        -
        199 {
        -
        200  using type = memory_based_step_iterator<NewBaseIterator>;
        -
        201 };
        -
        202 
        -
        204 // PixelBasedConcept
        -
        206 
        -
        207 template <typename Iterator>
        -
        208 struct color_space_type<memory_based_step_iterator<Iterator>> : public color_space_type<Iterator> {};
        -
        209 
        -
        210 template <typename Iterator>
        -
        211 struct channel_mapping_type<memory_based_step_iterator<Iterator>> : public channel_mapping_type<Iterator> {};
        -
        212 
        -
        213 template <typename Iterator>
        -
        214 struct is_planar<memory_based_step_iterator<Iterator>> : public is_planar<Iterator> {};
        -
        215 
        -
        216 template <typename Iterator>
        -
        217 struct channel_type<memory_based_step_iterator<Iterator>> : public channel_type<Iterator> {};
        -
        218 
        -
        220 // MemoryBasedIteratorConcept
        -
        222 template <typename Iterator>
        -
        223 struct byte_to_memunit<memory_based_step_iterator<Iterator>> : public byte_to_memunit<Iterator> {};
        -
        224 
        -
        225 template <typename Iterator>
        -
        226 inline auto memunit_step(memory_based_step_iterator<Iterator> const& p) -> std::ptrdiff_t { return p.step(); }
        -
        227 
        -
        228 template <typename Iterator>
        -
        229 inline auto memunit_distance(memory_based_step_iterator<Iterator> const& p1, memory_based_step_iterator<Iterator> const& p2)
        -
        230  -> std::ptrdiff_t
        -
        231 {
        -
        232  return memunit_distance(p1.base(),p2.base());
        -
        233 }
        -
        234 
        -
        235 template <typename Iterator>
        -
        236 inline void memunit_advance(memory_based_step_iterator<Iterator>& p,
        -
        237  std::ptrdiff_t diff) {
        -
        238  memunit_advance(p.base(), diff);
        -
        239 }
        -
        240 
        -
        241 template <typename Iterator>
        -
        242 inline auto memunit_advanced(const memory_based_step_iterator<Iterator>& p, std::ptrdiff_t diff)
        -
        243  -> memory_based_step_iterator<Iterator>
        -
        244 {
        -
        245  return memory_based_step_iterator<Iterator>(memunit_advanced(p.base(), diff),p.step());
        -
        246 }
        -
        247 
        -
        248 template <typename Iterator>
        -
        249 inline auto memunit_advanced_ref(const memory_based_step_iterator<Iterator>& p, std::ptrdiff_t diff)
        -
        250  -> typename std::iterator_traits<Iterator>::reference
        -
        251 {
        -
        252  return memunit_advanced_ref(p.base(), diff);
        -
        253 }
        -
        254 
        -
        256 // HasDynamicXStepTypeConcept
        -
        258 
        -
        259 template <typename Iterator>
        -
        260 struct dynamic_x_step_type<memory_based_step_iterator<Iterator>> {
        -
        261  using type = memory_based_step_iterator<Iterator>;
        -
        262 };
        -
        263 
        -
        264 // For step iterators, pass the function object to the base
        -
        265 template <typename Iterator, typename Deref>
        -
        266 struct iterator_add_deref<memory_based_step_iterator<Iterator>,Deref> {
        -
        267  BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
        -
        268 
        -
        269  using type = memory_based_step_iterator<typename iterator_add_deref<Iterator, Deref>::type>;
        -
        270 
        -
        271  static type make(const memory_based_step_iterator<Iterator>& it, const Deref& d)
        -
        272  {
        -
        273  return type(iterator_add_deref<Iterator, Deref>::make(it.base(),d),it.step());
        -
        274  }
        -
        275 };
        -
        276 
        -
        280 
        -
        281 template <typename I> typename dynamic_x_step_type<I>::type make_step_iterator(const I& it, std::ptrdiff_t step);
        -
        282 
        -
        283 namespace detail {
        -
        284 
        -
        285 // if the iterator is a plain base iterator (non-adaptor), wraps it in memory_based_step_iterator
        -
        286 template <typename I>
        -
        287 auto make_step_iterator_impl(I const& it, std::ptrdiff_t step, std::false_type)
        -
        288  -> typename dynamic_x_step_type<I>::type
        -
        289 {
        -
        290  return memory_based_step_iterator<I>(it, step);
        -
        291 }
        -
        292 
        -
        293 // If the iterator is compound, put the step in its base
        -
        294 template <typename I>
        -
        295 auto make_step_iterator_impl(I const& it, std::ptrdiff_t step, std::true_type)
        -
        296  -> typename dynamic_x_step_type<I>::type
        -
        297 {
        -
        298  return make_step_iterator(it.base(), step);
        -
        299 }
        -
        300 
        -
        301 // If the iterator is memory_based_step_iterator, change the step
        -
        302 template <typename BaseIt>
        -
        303 auto make_step_iterator_impl(
        -
        304  memory_based_step_iterator<BaseIt> const& it,
        -
        305  std::ptrdiff_t step,
        -
        306  std::true_type)
        -
        307  -> memory_based_step_iterator<BaseIt>
        -
        308 {
        -
        309  return memory_based_step_iterator<BaseIt>(it.base(), step);
        -
        310 }
        -
        311 
        -
        312 } // namespace detail
        -
        313 
        -
        327 template <typename I> // Models MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
        -
        328 inline auto make_step_iterator(I const& it, std::ptrdiff_t step)
        -
        329  -> typename dynamic_x_step_type<I>::type
        -
        330 {
        -
        331  return detail::make_step_iterator_impl(it, step, typename is_iterator_adaptor<I>::type());
        -
        332 }
        -
        333 
        -
        334 }} // namespace boost::gil
        -
        335 
        -
        336 #endif
        -
        An adaptor over an existing iterator that changes the step unit.
        Definition: step_iterator.hpp:42
        -
        MEMORY-BASED STEP ITERATOR.
        Definition: step_iterator.hpp:149
        -
        auto operator[](difference_type d) const -> reference
        Definition: step_iterator.hpp:167
        -
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition: algorithm.hpp:36
        -
        Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
        Definition: concepts/pixel_iterator.hpp:237
        -
        function object that returns the memory unit distance between two iterators and advances a given iter...
        Definition: step_iterator.hpp:126
        +
        1//
        +
        2// Copyright 2005-2007 Adobe Systems Incorporated
        +
        3//
        +
        4// Distributed under the Boost Software License, Version 1.0
        +
        5// See accompanying file LICENSE_1_0.txt or copy at
        +
        6// http://www.boost.org/LICENSE_1_0.txt
        +
        7//
        +
        8#ifndef BOOST_GIL_STEP_ITERATOR_HPP
        +
        9#define BOOST_GIL_STEP_ITERATOR_HPP
        +
        10
        +
        11#include <boost/gil/dynamic_step.hpp>
        +
        12#include <boost/gil/pixel_iterator.hpp>
        +
        13#include <boost/gil/pixel_iterator_adaptor.hpp>
        +
        14#include <boost/gil/utilities.hpp>
        +
        15
        +
        16#include <boost/iterator/iterator_facade.hpp>
        +
        17
        +
        18#include <cstddef>
        +
        19#include <iterator>
        +
        20#include <type_traits>
        +
        21
        +
        22namespace boost { namespace gil {
        +
        23
        +
        27
        +
        28namespace detail {
        +
        29
        +
        36
        +
        37template <typename Derived, // type of the derived class
        +
        38 typename Iterator, // Models Iterator
        +
        39 typename SFn> // A policy object that can compute the distance between two iterators of type Iterator
        +
        40 // and can advance an iterator of type Iterator a given number of Iterator's units
        +
        +
        41class step_iterator_adaptor : public iterator_adaptor<Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type>
        +
        42{
        +
        43public:
        +
        44 using parent_t = iterator_adaptor<Derived, Iterator, use_default, use_default, use_default, typename SFn::difference_type>;
        +
        45 using base_difference_type = typename std::iterator_traits<Iterator>::difference_type;
        +
        46 using difference_type = typename SFn::difference_type;
        +
        47 using reference = typename std::iterator_traits<Iterator>::reference;
        +
        48
        + +
        50 step_iterator_adaptor(Iterator const& it, SFn step_fn=SFn()) : parent_t(it), _step_fn(step_fn) {}
        +
        51
        +
        52 auto step() const -> difference_type { return _step_fn.step(); }
        +
        53
        +
        54protected:
        +
        55 SFn _step_fn;
        +
        56private:
        +
        57 friend class boost::iterator_core_access;
        +
        58
        +
        59 void increment() { _step_fn.advance(this->base_reference(),1); }
        +
        60 void decrement() { _step_fn.advance(this->base_reference(),-1); }
        +
        61 void advance(base_difference_type d) { _step_fn.advance(this->base_reference(),d); }
        +
        62
        +
        63 auto distance_to(step_iterator_adaptor const& it) const -> difference_type
        +
        64 {
        +
        65 return _step_fn.difference(this->base_reference(),it.base_reference());
        +
        66 }
        +
        67};
        +
        +
        68
        +
        69// although iterator_adaptor defines these, the default implementation computes distance and compares for zero.
        +
        70// it is often faster to just apply the relation operator to the base
        +
        71template <typename D,typename Iterator,typename SFn> inline
        + +
        73 return p1.step()>0 ? p1.base()> p2.base() : p1.base()< p2.base();
        +
        74}
        +
        75
        +
        76template <typename D,typename Iterator,typename SFn> inline
        +
        77bool operator<(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        +
        78 return p1.step()>0 ? p1.base()< p2.base() : p1.base()> p2.base();
        +
        79}
        +
        80
        +
        81template <typename D,typename Iterator,typename SFn> inline
        +
        82bool operator>=(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        +
        83 return p1.step()>0 ? p1.base()>=p2.base() : p1.base()<=p2.base();
        +
        84}
        +
        85
        +
        86template <typename D,typename Iterator,typename SFn> inline
        +
        87bool operator<=(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        +
        88 return p1.step()>0 ? p1.base()<=p2.base() : p1.base()>=p2.base();
        +
        89}
        +
        90
        +
        91template <typename D,typename Iterator,typename SFn> inline
        +
        92bool operator==(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        +
        93 return p1.base()==p2.base();
        +
        94}
        +
        95
        +
        96template <typename D,typename Iterator,typename SFn> inline
        +
        97bool operator!=(const step_iterator_adaptor<D,Iterator,SFn>& p1, const step_iterator_adaptor<D,Iterator,SFn>& p2) {
        +
        98 return p1.base()!=p2.base();
        +
        99}
        +
        100
        +
        101} // namespace detail
        +
        102
        +
        106
        +
        122
        +
        125template <typename Iterator>
        +
        + +
        127 using difference_type = std::ptrdiff_t;
        +
        128
        +
        129 memunit_step_fn(difference_type step=memunit_step(Iterator())) : _step(step) {}
        +
        130
        +
        131 auto difference(Iterator const& it1, Iterator const& it2) const -> difference_type
        +
        132 {
        +
        133 return memunit_distance(it1,it2)/_step;
        +
        134 }
        +
        135
        +
        136 void advance(Iterator& it, difference_type d) const { memunit_advance(it,d*_step); }
        +
        137 auto step() const -> difference_type { return _step; }
        +
        138
        +
        139 void set_step(std::ptrdiff_t step) { _step=step; }
        +
        140private:
        +
        141 BOOST_GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
        +
        142 difference_type _step;
        +
        143};
        +
        +
        144
        +
        145template <typename Iterator>
        +
        +
        146class memory_based_step_iterator : public detail::step_iterator_adaptor<memory_based_step_iterator<Iterator>,
        +
        147 Iterator,
        +
        148 memunit_step_fn<Iterator>>
        +
        149{
        +
        150 BOOST_GIL_CLASS_REQUIRE(Iterator, boost::gil, MemoryBasedIteratorConcept)
        +
        151public:
        + +
        153 Iterator,
        + +
        155 using reference = typename parent_t::reference;
        +
        156 using difference_type = typename parent_t::difference_type;
        +
        157 using x_iterator = Iterator;
        +
        158
        +
        159 memory_based_step_iterator() : parent_t(Iterator()) {}
        +
        160 memory_based_step_iterator(Iterator it, std::ptrdiff_t memunit_step) : parent_t(it, memunit_step_fn<Iterator>(memunit_step)) {}
        +
        161 template <typename I2>
        + +
        163 : parent_t(it.base(), memunit_step_fn<Iterator>(it.step())) {}
        +
        164
        +
        167 auto operator[](difference_type d) const -> reference { return *(*this+d); }
        +
        168
        +
        169 void set_step(std::ptrdiff_t memunit_step) { this->_step_fn.set_step(memunit_step); }
        +
        170
        +
        171 auto base() -> x_iterator& { return parent_t::base_reference(); }
        +
        172 auto base() const -> x_iterator const& { return parent_t::base_reference(); }
        +
        173};
        +
        +
        174
        +
        175template <typename Iterator>
        +
        176struct const_iterator_type<memory_based_step_iterator<Iterator>> {
        +
        177 using type = memory_based_step_iterator<typename const_iterator_type<Iterator>::type>;
        +
        178};
        +
        179
        +
        180template <typename Iterator>
        +
        181struct iterator_is_mutable<memory_based_step_iterator<Iterator>> : public iterator_is_mutable<Iterator> {};
        +
        182
        +
        183
        +
        185// IteratorAdaptorConcept
        +
        187
        +
        188template <typename Iterator>
        +
        189struct is_iterator_adaptor<memory_based_step_iterator<Iterator>> : std::true_type {};
        +
        190
        +
        191template <typename Iterator>
        +
        192struct iterator_adaptor_get_base<memory_based_step_iterator<Iterator>>
        +
        193{
        +
        194 using type = Iterator;
        +
        195};
        +
        196
        +
        197template <typename Iterator, typename NewBaseIterator>
        +
        198struct iterator_adaptor_rebind<memory_based_step_iterator<Iterator>, NewBaseIterator>
        +
        199{
        +
        200 using type = memory_based_step_iterator<NewBaseIterator>;
        +
        201};
        +
        202
        +
        204// PixelBasedConcept
        +
        206
        +
        207template <typename Iterator>
        +
        208struct color_space_type<memory_based_step_iterator<Iterator>> : public color_space_type<Iterator> {};
        +
        209
        +
        210template <typename Iterator>
        +
        211struct channel_mapping_type<memory_based_step_iterator<Iterator>> : public channel_mapping_type<Iterator> {};
        +
        212
        +
        213template <typename Iterator>
        +
        214struct is_planar<memory_based_step_iterator<Iterator>> : public is_planar<Iterator> {};
        +
        215
        +
        216template <typename Iterator>
        +
        217struct channel_type<memory_based_step_iterator<Iterator>> : public channel_type<Iterator> {};
        +
        218
        +
        220// MemoryBasedIteratorConcept
        +
        222template <typename Iterator>
        +
        223struct byte_to_memunit<memory_based_step_iterator<Iterator>> : public byte_to_memunit<Iterator> {};
        +
        224
        +
        225template <typename Iterator>
        +
        226inline auto memunit_step(memory_based_step_iterator<Iterator> const& p) -> std::ptrdiff_t { return p.step(); }
        +
        227
        +
        228template <typename Iterator>
        +
        229inline auto memunit_distance(memory_based_step_iterator<Iterator> const& p1, memory_based_step_iterator<Iterator> const& p2)
        +
        230 -> std::ptrdiff_t
        +
        231{
        +
        232 return memunit_distance(p1.base(),p2.base());
        +
        233}
        +
        234
        +
        235template <typename Iterator>
        +
        236inline void memunit_advance(memory_based_step_iterator<Iterator>& p,
        +
        237 std::ptrdiff_t diff) {
        +
        238 memunit_advance(p.base(), diff);
        +
        239}
        +
        240
        +
        241template <typename Iterator>
        +
        242inline auto memunit_advanced(const memory_based_step_iterator<Iterator>& p, std::ptrdiff_t diff)
        +
        243 -> memory_based_step_iterator<Iterator>
        +
        244{
        +
        245 return memory_based_step_iterator<Iterator>(memunit_advanced(p.base(), diff),p.step());
        +
        246}
        +
        247
        +
        248template <typename Iterator>
        +
        249inline auto memunit_advanced_ref(const memory_based_step_iterator<Iterator>& p, std::ptrdiff_t diff)
        +
        250 -> typename std::iterator_traits<Iterator>::reference
        +
        251{
        +
        252 return memunit_advanced_ref(p.base(), diff);
        +
        253}
        +
        254
        +
        256// HasDynamicXStepTypeConcept
        +
        258
        +
        259template <typename Iterator>
        +
        260struct dynamic_x_step_type<memory_based_step_iterator<Iterator>> {
        +
        261 using type = memory_based_step_iterator<Iterator>;
        +
        262};
        +
        263
        +
        264// For step iterators, pass the function object to the base
        +
        265template <typename Iterator, typename Deref>
        +
        266struct iterator_add_deref<memory_based_step_iterator<Iterator>,Deref> {
        +
        267 BOOST_GIL_CLASS_REQUIRE(Deref, boost::gil, PixelDereferenceAdaptorConcept)
        +
        268
        +
        269 using type = memory_based_step_iterator<typename iterator_add_deref<Iterator, Deref>::type>;
        +
        270
        +
        271 static type make(const memory_based_step_iterator<Iterator>& it, const Deref& d)
        +
        272 {
        +
        273 return type(iterator_add_deref<Iterator, Deref>::make(it.base(),d),it.step());
        +
        274 }
        +
        275};
        +
        276
        +
        280
        +
        281template <typename I> typename dynamic_x_step_type<I>::type make_step_iterator(const I& it, std::ptrdiff_t step);
        +
        282
        +
        283namespace detail {
        +
        284
        +
        285// if the iterator is a plain base iterator (non-adaptor), wraps it in memory_based_step_iterator
        +
        286template <typename I>
        +
        287auto make_step_iterator_impl(I const& it, std::ptrdiff_t step, std::false_type)
        +
        288 -> typename dynamic_x_step_type<I>::type
        +
        289{
        +
        290 return memory_based_step_iterator<I>(it, step);
        +
        291}
        +
        292
        +
        293// If the iterator is compound, put the step in its base
        +
        294template <typename I>
        +
        295auto make_step_iterator_impl(I const& it, std::ptrdiff_t step, std::true_type)
        +
        296 -> typename dynamic_x_step_type<I>::type
        +
        297{
        +
        298 return make_step_iterator(it.base(), step);
        +
        299}
        +
        300
        +
        301// If the iterator is memory_based_step_iterator, change the step
        +
        302template <typename BaseIt>
        +
        303auto make_step_iterator_impl(
        +
        304 memory_based_step_iterator<BaseIt> const& it,
        +
        305 std::ptrdiff_t step,
        +
        306 std::true_type)
        +
        307 -> memory_based_step_iterator<BaseIt>
        +
        308{
        +
        309 return memory_based_step_iterator<BaseIt>(it.base(), step);
        +
        310}
        +
        311
        +
        312} // namespace detail
        +
        313
        +
        327template <typename I> // Models MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept
        +
        328inline auto make_step_iterator(I const& it, std::ptrdiff_t step)
        +
        329 -> typename dynamic_x_step_type<I>::type
        +
        330{
        +
        331 return detail::make_step_iterator_impl(it, step, typename is_iterator_adaptor<I>::type());
        +
        332}
        +
        333
        +
        334}} // namespace boost::gil
        +
        335
        +
        336#endif
        +
        An adaptor over an existing iterator that changes the step unit.
        Definition step_iterator.hpp:42
        +
        MEMORY-BASED STEP ITERATOR.
        Definition step_iterator.hpp:149
        +
        auto operator[](difference_type d) const -> reference
        Definition step_iterator.hpp:167
        +
        defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
        Definition algorithm.hpp:36
        +
        Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
        Definition concepts/pixel_iterator.hpp:237
        +
        function object that returns the memory unit distance between two iterators and advances a given iter...
        Definition step_iterator.hpp:126
        diff --git a/html/reference/structboost_1_1gil_1_1_assignable-members.html b/html/reference/structboost_1_1gil_1_1_assignable-members.html index 7998ed4a8..0bb320721 100644 --- a/html/reference/structboost_1_1gil_1_1_assignable-members.html +++ b/html/reference/structboost_1_1gil_1_1_assignable-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        Assignable< T > Member List
        +
        Assignable< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_assignable.html b/html/reference/structboost_1_1gil_1_1_assignable.html index f9ccc164c..8ed221a06 100644 --- a/html/reference/structboost_1_1gil_1_1_assignable.html +++ b/html/reference/structboost_1_1gil_1_1_assignable.html @@ -4,7 +4,7 @@ - + Generic Image Library: Assignable< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,22 +56,21 @@ $(function() {

        #include <basic.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::Assignable< T >

        - -

        Concept of copy assignment requirement.

        -
        auto concept Assignable<typename T, typename U = T>
        +
        template<typename T>
        +struct boost::gil::Assignable< T >

        Concept of copy assignment requirement.

        +
        auto concept Assignable<typename T, typename U = T>
        {
        typename result_type;
        result_type operator=(T&, U);
        };
        +
        Concept of copy assignment requirement.
        Definition basic.hpp:82

        The documentation for this struct was generated from the following file: @@ -81,7 +80,7 @@ struct boost::gil::Assignable< T > diff --git a/html/reference/structboost_1_1gil_1_1_channel_concept-members.html b/html/reference/structboost_1_1gil_1_1_channel_concept-members.html index 51d921b9d..2bd799942 100644 --- a/html/reference/structboost_1_1gil_1_1_channel_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_channel_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ChannelConcept< T > Member List
        +
        ChannelConcept< T > Member List

        This is the complete list of members for ChannelConcept< T >, including all inherited members.

        - +
        c (defined in ChannelConcept< T >)ChannelConcept< T >
        constraints() (defined in ChannelConcept< T >)ChannelConcept< T >inline
        constraints() (defined in ChannelConcept< T >)ChannelConcept< T >inline
        diff --git a/html/reference/structboost_1_1gil_1_1_channel_concept.html b/html/reference/structboost_1_1gil_1_1_channel_concept.html index 8503e60c5..66e314d04 100644 --- a/html/reference/structboost_1_1gil_1_1_channel_concept.html +++ b/html/reference/structboost_1_1gil_1_1_channel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ChannelConcept< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        ChannelConcept< T > Struct Template Reference
        +
        ChannelConcept< T > Struct Template Reference
        @@ -57,29 +57,27 @@ $(function() {

        #include <channel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        c
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::ChannelConcept< T >

        - -

        A channel is the building block of a color. Color is defined as a mixture of primary colors and a channel defines the degree to which each primary color is used in the mixture.

        +
        template<typename T>
        +struct boost::gil::ChannelConcept< T >

        A channel is the building block of a color. Color is defined as a mixture of primary colors and a channel defines the degree to which each primary color is used in the mixture.

        For example, in the RGB color space, using 8-bit unsigned channels, the color red is defined as [255 0 0], which means maximum of Red, and no Green and Blue.

        Built-in scalar types, such as int and float, are valid GIL channels. In more complex scenarios, channels may be represented as bit ranges or even individual bits. In such cases special classes are needed to represent the value and reference to a channel.

        Channels have a traits class, channel_traits, which defines their associated types as well as their operating ranges.

        -
        concept ChannelConcept<typename T> : EqualityComparable<T>
        +
        concept ChannelConcept<typename T> : EqualityComparable<T>
        {
        -
        typename value_type = T; // use channel_traits<T>::value_type to access it
        +
        typename value_type = T; // use channel_traits<T>::value_type to access it
        typename reference = T&; // use channel_traits<T>::reference to access it
        typename pointer = T*; // use channel_traits<T>::pointer to access it
        typename const_reference = const T&; // use channel_traits<T>::const_reference to access it
        @@ -89,6 +87,8 @@ struct boost::gil::ChannelConcept< T >
        static T min_value(); // use channel_traits<T>::min_value to access it
        static T max_value(); // use channel_traits<T>::max_value to access it
        };
        +
        A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
        Definition concepts/channel.hpp:75
        +
        Concept of == and != comparability requirement.
        Definition basic.hpp:101

        The documentation for this struct was generated from the following file: @@ -98,7 +98,7 @@ struct boost::gil::ChannelConcept< T > diff --git a/html/reference/structboost_1_1gil_1_1_channel_convertible_concept-members.html b/html/reference/structboost_1_1gil_1_1_channel_convertible_concept-members.html index 7d4284b3f..5ec5f12af 100644 --- a/html/reference/structboost_1_1gil_1_1_channel_convertible_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_channel_convertible_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ChannelConvertibleConcept< SrcChannel, DstChannel > Member List
        +
        ChannelConvertibleConcept< SrcChannel, DstChannel > Member List
        @@ -59,7 +59,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_channel_convertible_concept.html b/html/reference/structboost_1_1gil_1_1_channel_convertible_concept.html index 7180a2068..e33a86b99 100644 --- a/html/reference/structboost_1_1gil_1_1_channel_convertible_concept.html +++ b/html/reference/structboost_1_1gil_1_1_channel_convertible_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ChannelConvertibleConcept< SrcChannel, DstChannel > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        ChannelConvertibleConcept< SrcChannel, DstChannel > Struct Template Reference
        +
        ChannelConvertibleConcept< SrcChannel, DstChannel > Struct Template Reference
        @@ -57,28 +57,26 @@ $(function() {

        #include <channel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - - -

        +

        Public Attributes

        +
        SrcChannel src
         
        +
        DstChannel dst
         

        Detailed Description

        -

        template<typename SrcChannel, typename DstChannel>
        -struct boost::gil::ChannelConvertibleConcept< SrcChannel, DstChannel >

        - -

        A channel is convertible to another one if the channel_convert algorithm is defined for the two channels.

        +
        template<typename SrcChannel, typename DstChannel>
        +struct boost::gil::ChannelConvertibleConcept< SrcChannel, DstChannel >

        A channel is convertible to another one if the channel_convert algorithm is defined for the two channels.

        Convertibility is non-symmetric and implies that one channel can be converted to another. Conversion is explicit and often lossy operation.

        -

        concept ChannelConvertibleConcept<ChannelConcept SrcChannel, ChannelValueConcept DstChannel> { DstChannel channel_convert(const SrcChannel&); };

        +

        concept ChannelConvertibleConcept<ChannelConcept SrcChannel, ChannelValueConcept DstChannel> { DstChannel channel_convert(const SrcChannel&); };


        The documentation for this struct was generated from the following file: @@ -88,7 +86,7 @@ struct boost::gil::ChannelConvertibleConcept< SrcChannel, DstChannel > diff --git a/html/reference/structboost_1_1gil_1_1_channel_mapping_concept-members.html b/html/reference/structboost_1_1gil_1_1_channel_mapping_concept-members.html index d21882b30..006df2524 100644 --- a/html/reference/structboost_1_1gil_1_1_channel_mapping_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_channel_mapping_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ChannelMappingConcept< CM > Member List
        +
        ChannelMappingConcept< CM > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_channel_mapping_concept.html b/html/reference/structboost_1_1gil_1_1_channel_mapping_concept.html index ce35b0d16..0ba05c2bc 100644 --- a/html/reference/structboost_1_1gil_1_1_channel_mapping_concept.html +++ b/html/reference/structboost_1_1gil_1_1_channel_mapping_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ChannelMappingConcept< CM > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,22 +56,21 @@ $(function() {

        #include <color.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename CM>
        -struct boost::gil::ChannelMappingConcept< CM >

        - -

        Channel mapping concept.

        -
        concept ChannelMappingConcept<MPLRandomAccessSequence CM>
        +
        template<typename CM>
        +struct boost::gil::ChannelMappingConcept< CM >

        Channel mapping concept.

        +
        concept ChannelMappingConcept<MPLRandomAccessSequence CM>
        {
        // Boost.MP11-compatible list, whose elements
        // model MPLIntegralConstant representing a permutation
        };
        +
        Channel mapping concept.
        Definition color.hpp:79

        The documentation for this struct was generated from the following file: @@ -81,7 +80,7 @@ struct boost::gil::ChannelMappingConcept< CM > diff --git a/html/reference/structboost_1_1gil_1_1_channel_value_concept-members.html b/html/reference/structboost_1_1gil_1_1_channel_value_concept-members.html index 147cd106a..ffc6cad51 100644 --- a/html/reference/structboost_1_1gil_1_1_channel_value_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_channel_value_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ChannelValueConcept< T > Member List
        +
        ChannelValueConcept< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_channel_value_concept.html b/html/reference/structboost_1_1gil_1_1_channel_value_concept.html index bc82c54b3..fe3d22a61 100644 --- a/html/reference/structboost_1_1gil_1_1_channel_value_concept.html +++ b/html/reference/structboost_1_1gil_1_1_channel_value_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ChannelValueConcept< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,18 +56,19 @@ $(function() {

        #include <channel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::ChannelValueConcept< T >

        - -

        A channel that supports default construction.

        -
        concept ChannelValueConcept<ChannelConcept T> : Regular<T> {};
        +
        template<typename T>
        +struct boost::gil::ChannelValueConcept< T >

        A channel that supports default construction.

        +
        +
        A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
        Definition concepts/channel.hpp:75
        +
        A channel that supports default construction.
        Definition concepts/channel.hpp:134
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142

        The documentation for this struct was generated from the following file: @@ -77,7 +78,7 @@ struct boost::gil::ChannelValueConcept< T > diff --git a/html/reference/structboost_1_1gil_1_1_channels_compatible_concept-members.html b/html/reference/structboost_1_1gil_1_1_channels_compatible_concept-members.html index b1376de6f..857fe0026 100644 --- a/html/reference/structboost_1_1gil_1_1_channels_compatible_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_channels_compatible_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ChannelsCompatibleConcept< Channel1, Channel2 > Member List
        +
        ChannelsCompatibleConcept< Channel1, Channel2 > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_channels_compatible_concept.html b/html/reference/structboost_1_1gil_1_1_channels_compatible_concept.html index f00b19707..2eaf91f27 100644 --- a/html/reference/structboost_1_1gil_1_1_channels_compatible_concept.html +++ b/html/reference/structboost_1_1gil_1_1_channels_compatible_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ChannelsCompatibleConcept< Channel1, Channel2 > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,22 @@ $(function() {

        #include <channel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename Channel1, typename Channel2>
        -struct boost::gil::ChannelsCompatibleConcept< Channel1, Channel2 >

        - -

        Channels are compatible if their associated value types (ignoring constness and references) are the same.

        -
        concept ChannelsCompatibleConcept<ChannelConcept T1, ChannelConcept T2>
        +
        template<typename Channel1, typename Channel2>
        +struct boost::gil::ChannelsCompatibleConcept< Channel1, Channel2 >

        Channels are compatible if their associated value types (ignoring constness and references) are the same.

        +
        {
        -
        where SameType<T1::value_type, T2::value_type>;
        +
        where SameType<T1::value_type, T2::value_type>;
        };
        +
        A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
        Definition concepts/channel.hpp:75
        +
        Channels are compatible if their associated value types (ignoring constness and references) are the s...
        Definition concepts/channel.hpp:174
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -80,7 +81,7 @@ struct boost::gil::ChannelsCompatibleConcept< Channel1, Channel2 > diff --git a/html/reference/structboost_1_1gil_1_1_collection_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_collection_image_view_concept-members.html index a9e3688ce..14abb759a 100644 --- a/html/reference/structboost_1_1gil_1_1_collection_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_collection_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        CollectionImageViewConcept< View > Member List
        +
        CollectionImageViewConcept< View > Member List
        @@ -59,7 +59,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_collection_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_collection_image_view_concept.html index 824985c24..4cd5c63fe 100644 --- a/html/reference/structboost_1_1gil_1_1_collection_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_collection_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: CollectionImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        CollectionImageViewConcept< View > Struct Template Reference
        +
        CollectionImageViewConcept< View > Struct Template Reference
        @@ -57,26 +57,24 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - - -

        +

        Public Attributes

        +
        View view1
         
        +
        View view2
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::CollectionImageViewConcept< View >

        - -

        GIL view as Collection.

        +
        template<typename View>
        +struct boost::gil::CollectionImageViewConcept< View >

        GIL view as Collection.

        See also
        https://www.boost.org/libs/utility/Collection.html

        The documentation for this struct was generated from the following file:
        • concepts/image_view.hpp
        • @@ -87,7 +85,7 @@ struct boost::gil::CollectionImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_color_base_concept-members.html b/html/reference/structboost_1_1gil_1_1_color_base_concept-members.html index 7826d4a12..c9b01b251 100644 --- a/html/reference/structboost_1_1gil_1_1_color_base_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_color_base_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ColorBaseConcept< ColorBase > Member List
        +
        ColorBaseConcept< ColorBase > Member List

        This is the complete list of members for ColorBaseConcept< ColorBase >, including all inherited members.

        - +
        cb (defined in ColorBaseConcept< ColorBase >)ColorBaseConcept< ColorBase >
        constraints() (defined in ColorBaseConcept< ColorBase >)ColorBaseConcept< ColorBase >inline
        constraints() (defined in ColorBaseConcept< ColorBase >)ColorBaseConcept< ColorBase >inline
        diff --git a/html/reference/structboost_1_1gil_1_1_color_base_concept.html b/html/reference/structboost_1_1gil_1_1_color_base_concept.html index 2a6615c4c..5f0f22f35 100644 --- a/html/reference/structboost_1_1gil_1_1_color_base_concept.html +++ b/html/reference/structboost_1_1gil_1_1_color_base_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ColorBaseConcept< ColorBase > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        ColorBaseConcept< ColorBase > Struct Template Reference
        +
        ColorBaseConcept< ColorBase > Struct Template Reference
        @@ -57,52 +57,54 @@ $(function() {

        #include <color_base.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        ColorBase cb
         

        Detailed Description

        -

        template<typename ColorBase>
        -struct boost::gil::ColorBaseConcept< ColorBase >

        - -

        A color base is a container of color elements (such as channels, channel references or channel pointers).

        +
        template<typename ColorBase>
        +struct boost::gil::ColorBaseConcept< ColorBase >

        A color base is a container of color elements (such as channels, channel references or channel pointers).

        The most common use of color base is in the implementation of a pixel, in which case the color elements are channel values. The color base concept, however, can be used in other scenarios. For example, a planar pixel has channels that are not contiguous in memory. Its reference is a proxy class that uses a color base whose elements are channel references. Its iterator uses a color base whose elements are channel iterators.

        A color base must have an associated layout (which consists of a color space, as well as an ordering of the channels). There are two ways to index the elements of a color base: A physical index corresponds to the way they are ordered in memory, and a semantic index corresponds to the way the elements are ordered in their color space. For example, in the RGB color space the elements are ordered as {red_t, green_t, blue_t}. For a color base with a BGR layout, the first element in physical ordering is the blue element, whereas the first semantic element is the red one. Models of ColorBaseConcept are required to provide the at_c<K>(ColorBase) function, which allows for accessing the elements based on their physical order. GIL provides a semantic_at_c<K>(ColorBase) function (described later) which can operate on any model of ColorBaseConcept and returns the corresponding semantic element.

        -
        concept ColorBaseConcept<typename T> : CopyConstructible<T>, EqualityComparable<T>
        +
        {
        // a GIL layout (the color space and element permutation)
        -
        typename layout_t;
        +
        typename layout_t;
        // The type of K-th element
        -
        template <int K>
        -
        struct kth_element_type;
        -
        where Metafunction<kth_element_type>;
        +
        template <int K>
        +
        struct kth_element_type;
        +
        where Metafunction<kth_element_type>;
        // The result of at_c
        -
        template <int K>
        -
        struct kth_element_const_reference_type;
        -
        where Metafunction<kth_element_const_reference_type>;
        +
        template <int K>
        +
        struct kth_element_const_reference_type;
        +
        where Metafunction<kth_element_const_reference_type>;
        -
        template <int K>
        -
        kth_element_const_reference_type<T,K>::type at_c(T);
        +
        template <int K>
        +
        kth_element_const_reference_type<T,K>::type at_c(T);
        // Copy-constructible and equality comparable with other compatible color bases
        -
        template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
        +
        template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
        T::T(T2);
        -
        template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
        -
        bool operator==(const T&, const T2&);
        -
        template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
        +
        template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
        +
        bool operator==(const T&, const T2&);
        +
        template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
        bool operator!=(const T&, const T2&);
        };
        -
        auto at_c(detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
        Provides mutable access to the K-th element, in physical order.
        Definition: color_base.hpp:632
        +
        A color base is a container of color elements (such as channels, channel references or channel pointe...
        Definition concepts/color_base.hpp:138
        +
        Two color bases are compatible if they have the same color space and their elements are compatible,...
        Definition concepts/color_base.hpp:304
        +
        Concept of copy construction requirement.
        Definition basic.hpp:63
        +
        Concept of == and != comparability requirement.
        Definition basic.hpp:101
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164

        The documentation for this struct was generated from the following file: @@ -112,7 +114,7 @@ struct boost::gil::ColorBaseConcept< ColorBase > diff --git a/html/reference/structboost_1_1gil_1_1_color_base_value_concept-members.html b/html/reference/structboost_1_1gil_1_1_color_base_value_concept-members.html index 40758434c..f3d67101e 100644 --- a/html/reference/structboost_1_1gil_1_1_color_base_value_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_color_base_value_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ColorBaseValueConcept< ColorBase > Member List
        +
        ColorBaseValueConcept< ColorBase > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_color_base_value_concept.html b/html/reference/structboost_1_1gil_1_1_color_base_value_concept.html index 7acea116f..4617c2ade 100644 --- a/html/reference/structboost_1_1gil_1_1_color_base_value_concept.html +++ b/html/reference/structboost_1_1gil_1_1_color_base_value_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ColorBaseValueConcept< ColorBase > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,20 +56,21 @@ $(function() {

        #include <color_base.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename ColorBase>
        -struct boost::gil::ColorBaseValueConcept< ColorBase >

        - -

        Color base that also has a default-constructor. Refines Regular.

        -
        concept ColorBaseValueConcept<typename T> : MutableColorBaseConcept<T>, Regular<T>
        +
        template<typename ColorBase>
        +struct boost::gil::ColorBaseValueConcept< ColorBase >

        Color base that also has a default-constructor. Refines Regular.

        +
        {
        };
        +
        Color base that also has a default-constructor. Refines Regular.
        Definition concepts/color_base.hpp:208
        +
        Color base which allows for modifying its elements.
        Definition concepts/color_base.hpp:184
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142

        The documentation for this struct was generated from the following file: @@ -79,7 +80,7 @@ struct boost::gil::ColorBaseValueConcept< ColorBase > diff --git a/html/reference/structboost_1_1gil_1_1_color_bases_compatible_concept-members.html b/html/reference/structboost_1_1gil_1_1_color_bases_compatible_concept-members.html index 16a9adbf8..c0b9066f9 100644 --- a/html/reference/structboost_1_1gil_1_1_color_bases_compatible_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_color_bases_compatible_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ColorBasesCompatibleConcept< ColorBase1, ColorBase2 > Member List
        +
        ColorBasesCompatibleConcept< ColorBase1, ColorBase2 > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_color_bases_compatible_concept.html b/html/reference/structboost_1_1gil_1_1_color_bases_compatible_concept.html index 5a95e6676..57444e815 100644 --- a/html/reference/structboost_1_1gil_1_1_color_bases_compatible_concept.html +++ b/html/reference/structboost_1_1gil_1_1_color_bases_compatible_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ColorBasesCompatibleConcept< ColorBase1, ColorBase2 > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,24 +56,25 @@ $(function() {

        #include <color_base.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename ColorBase1, typename ColorBase2>
        -struct boost::gil::ColorBasesCompatibleConcept< ColorBase1, ColorBase2 >

        - -

        Two color bases are compatible if they have the same color space and their elements are compatible, semantic-pairwise.

        -
        concept ColorBasesCompatibleConcept<ColorBaseConcept C1, ColorBaseConcept C2>
        +
        template<typename ColorBase1, typename ColorBase2>
        +struct boost::gil::ColorBasesCompatibleConcept< ColorBase1, ColorBase2 >

        Two color bases are compatible if they have the same color space and their elements are compatible, semantic-pairwise.

        +
        {
        -
        where SameType<C1::layout_t::color_space_t, C2::layout_t::color_space_t>;
        +
        where SameType<C1::layout_t::color_space_t, C2::layout_t::color_space_t>;
        // also, for all K in [0 ... size<C1>::value):
        // where Convertible<kth_semantic_element_type<C1,K>::type, kth_semantic_element_type<C2,K>::type>;
        // where Convertible<kth_semantic_element_type<C2,K>::type, kth_semantic_element_type<C1,K>::type>;
        };
        +
        A color base is a container of color elements (such as channels, channel references or channel pointe...
        Definition concepts/color_base.hpp:138
        +
        Two color bases are compatible if they have the same color space and their elements are compatible,...
        Definition concepts/color_base.hpp:304
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -83,7 +84,7 @@ struct boost::gil::ColorBasesCompatibleConcept< ColorBase1, ColorBase2 > diff --git a/html/reference/structboost_1_1gil_1_1_color_space_concept-members.html b/html/reference/structboost_1_1gil_1_1_color_space_concept-members.html index c1d7d898b..ff85bdde8 100644 --- a/html/reference/structboost_1_1gil_1_1_color_space_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_color_space_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ColorSpaceConcept< CS > Member List
        +
        ColorSpaceConcept< CS > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_color_space_concept.html b/html/reference/structboost_1_1gil_1_1_color_space_concept.html index 682b862d4..d25be7bcf 100644 --- a/html/reference/structboost_1_1gil_1_1_color_space_concept.html +++ b/html/reference/structboost_1_1gil_1_1_color_space_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ColorSpaceConcept< CS > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,20 @@ $(function() {

        #include <color.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename CS>
        -struct boost::gil::ColorSpaceConcept< CS >

        - -

        Color space type concept.

        -
        concept ColorSpaceConcept<MPLRandomAccessSequence CS>
        +
        template<typename CS>
        +struct boost::gil::ColorSpaceConcept< CS >

        Color space type concept.

        +
        concept ColorSpaceConcept<MPLRandomAccessSequence CS>
        {
        // Boost.MP11-compatible list, whose elements are color tags.
        };
        +
        Color space type concept.
        Definition color.hpp:38

        The documentation for this struct was generated from the following file: @@ -80,7 +79,7 @@ struct boost::gil::ColorSpaceConcept< CS > diff --git a/html/reference/structboost_1_1gil_1_1_color_spaces_compatible_concept-members.html b/html/reference/structboost_1_1gil_1_1_color_spaces_compatible_concept-members.html index c7c58e642..e02e56466 100644 --- a/html/reference/structboost_1_1gil_1_1_color_spaces_compatible_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_color_spaces_compatible_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ColorSpacesCompatibleConcept< CS1, CS2 > Member List
        +
        ColorSpacesCompatibleConcept< CS1, CS2 > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_color_spaces_compatible_concept.html b/html/reference/structboost_1_1gil_1_1_color_spaces_compatible_concept.html index 1c42d1146..2bc1547df 100644 --- a/html/reference/structboost_1_1gil_1_1_color_spaces_compatible_concept.html +++ b/html/reference/structboost_1_1gil_1_1_color_spaces_compatible_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ColorSpacesCompatibleConcept< CS1, CS2 > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,22 @@ $(function() {

        #include <color.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename CS1, typename CS2>
        -struct boost::gil::ColorSpacesCompatibleConcept< CS1, CS2 >

        - -

        Two color spaces are compatible if they are the same.

        -
        concept ColorSpacesCompatibleConcept<ColorSpaceConcept CS1, ColorSpaceConcept CS2>
        +
        template<typename CS1, typename CS2>
        +struct boost::gil::ColorSpacesCompatibleConcept< CS1, CS2 >

        Two color spaces are compatible if they are the same.

        +
        {
        -
        where SameType<CS1, CS2>;
        +
        where SameType<CS1, CS2>;
        };
        +
        Color space type concept.
        Definition color.hpp:38
        +
        Two color spaces are compatible if they are the same.
        Definition color.hpp:61
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -80,7 +81,7 @@ struct boost::gil::ColorSpacesCompatibleConcept< CS1, CS2 > diff --git a/html/reference/structboost_1_1gil_1_1_copy_constructible-members.html b/html/reference/structboost_1_1gil_1_1_copy_constructible-members.html index d96ecfca6..83c52be4c 100644 --- a/html/reference/structboost_1_1gil_1_1_copy_constructible-members.html +++ b/html/reference/structboost_1_1gil_1_1_copy_constructible-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        CopyConstructible< T > Member List
        +
        CopyConstructible< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_copy_constructible.html b/html/reference/structboost_1_1gil_1_1_copy_constructible.html index f74c9c999..855052ff1 100644 --- a/html/reference/structboost_1_1gil_1_1_copy_constructible.html +++ b/html/reference/structboost_1_1gil_1_1_copy_constructible.html @@ -4,7 +4,7 @@ - + Generic Image Library: CopyConstructible< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,22 +56,21 @@ $(function() {

        #include <basic.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::CopyConstructible< T >

        - -

        Concept of copy construction requirement.

        -
        auto concept CopyConstructible<typename T>
        +
        template<typename T>
        +struct boost::gil::CopyConstructible< T >

        Concept of copy construction requirement.

        +
        auto concept CopyConstructible<typename T>
        {
        T::T(T);
        T::~T();
        };
        +
        Concept of copy construction requirement.
        Definition basic.hpp:63

        The documentation for this struct was generated from the following file: @@ -81,7 +80,7 @@ struct boost::gil::CopyConstructible< T > diff --git a/html/reference/structboost_1_1gil_1_1_default_constructible-members.html b/html/reference/structboost_1_1gil_1_1_default_constructible-members.html index a06a81926..c07436fd8 100644 --- a/html/reference/structboost_1_1gil_1_1_default_constructible-members.html +++ b/html/reference/structboost_1_1gil_1_1_default_constructible-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        DefaultConstructible< T > Member List
        +
        DefaultConstructible< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_default_constructible.html b/html/reference/structboost_1_1gil_1_1_default_constructible.html index ee8652bc8..4232edb70 100644 --- a/html/reference/structboost_1_1gil_1_1_default_constructible.html +++ b/html/reference/structboost_1_1gil_1_1_default_constructible.html @@ -4,7 +4,7 @@ - + Generic Image Library: DefaultConstructible< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,20 @@ $(function() {

        #include <basic.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::DefaultConstructible< T >

        - -

        Concept of default construction requirement.

        -
        auto concept DefaultConstructible<typename T>
        +
        template<typename T>
        +struct boost::gil::DefaultConstructible< T >

        Concept of default construction requirement.

        +
        auto concept DefaultConstructible<typename T>
        {
        T::T();
        };
        +
        Concept of default construction requirement.
        Definition basic.hpp:44

        The documentation for this struct was generated from the following file: @@ -80,7 +79,7 @@ struct boost::gil::DefaultConstructible< T > diff --git a/html/reference/structboost_1_1gil_1_1_equality_comparable-members.html b/html/reference/structboost_1_1gil_1_1_equality_comparable-members.html index 9e837ae40..e5d6f193b 100644 --- a/html/reference/structboost_1_1gil_1_1_equality_comparable-members.html +++ b/html/reference/structboost_1_1gil_1_1_equality_comparable-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        EqualityComparable< T > Member List
        +
        EqualityComparable< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_equality_comparable.html b/html/reference/structboost_1_1gil_1_1_equality_comparable.html index fb32f6477..386d63ca6 100644 --- a/html/reference/structboost_1_1gil_1_1_equality_comparable.html +++ b/html/reference/structboost_1_1gil_1_1_equality_comparable.html @@ -4,7 +4,7 @@ - + Generic Image Library: EqualityComparable< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,22 +56,21 @@ $(function() {

        #include <basic.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::EqualityComparable< T >

        - -

        Concept of == and != comparability requirement.

        -
        auto concept EqualityComparable<typename T, typename U = T>
        +
        template<typename T>
        +struct boost::gil::EqualityComparable< T >

        Concept of == and != comparability requirement.

        +
        auto concept EqualityComparable<typename T, typename U = T>
        {
        bool operator==(T x, T y);
        bool operator!=(T x, T y) { return !(x==y); }
        };
        +
        Concept of == and != comparability requirement.
        Definition basic.hpp:101

        The documentation for this struct was generated from the following file: @@ -81,7 +80,7 @@ struct boost::gil::EqualityComparable< T > diff --git a/html/reference/structboost_1_1gil_1_1_forward_collection_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_forward_collection_image_view_concept-members.html index 3c51f8c40..d0894fbae 100644 --- a/html/reference/structboost_1_1gil_1_1_forward_collection_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_forward_collection_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ForwardCollectionImageViewConcept< View > Member List
        +
        ForwardCollectionImageViewConcept< View > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_forward_collection_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_forward_collection_image_view_concept.html index 4abef0c6f..6308a42ec 100644 --- a/html/reference/structboost_1_1gil_1_1_forward_collection_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_forward_collection_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ForwardCollectionImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        ForwardCollectionImageViewConcept< View > Struct Template Reference
        +
        ForwardCollectionImageViewConcept< View > Struct Template Reference
        @@ -57,23 +57,21 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        View view
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::ForwardCollectionImageViewConcept< View >

        - -

        GIL view as ForwardCollection.

        +
        template<typename View>
        +struct boost::gil::ForwardCollectionImageViewConcept< View >

        GIL view as ForwardCollection.

        See also
        https://www.boost.org/libs/utility/Collection.html

        The documentation for this struct was generated from the following file:
        • concepts/image_view.hpp
        • @@ -84,7 +82,7 @@ struct boost::gil::ForwardCollectionImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_has_dynamic_x_step_type_concept-members.html b/html/reference/structboost_1_1gil_1_1_has_dynamic_x_step_type_concept-members.html index 34b2a52a7..c402222a8 100644 --- a/html/reference/structboost_1_1gil_1_1_has_dynamic_x_step_type_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_has_dynamic_x_step_type_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        HasDynamicXStepTypeConcept< T > Member List
        +
        HasDynamicXStepTypeConcept< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_has_dynamic_x_step_type_concept.html b/html/reference/structboost_1_1gil_1_1_has_dynamic_x_step_type_concept.html index 9b8a47c41..b7a38343e 100644 --- a/html/reference/structboost_1_1gil_1_1_has_dynamic_x_step_type_concept.html +++ b/html/reference/structboost_1_1gil_1_1_has_dynamic_x_step_type_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: HasDynamicXStepTypeConcept< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,22 +56,23 @@ $(function() {

        #include <dynamic_step.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::HasDynamicXStepTypeConcept< T >

        - -

        Concept for iterators, locators and views that can define a type just like the given iterator, locator or view, except it supports runtime specified step along the X navigation.

        -
        concept HasDynamicXStepTypeConcept<typename T>
        +
        template<typename T>
        +struct boost::gil::HasDynamicXStepTypeConcept< T >

        Concept for iterators, locators and views that can define a type just like the given iterator, locator or view, except it supports runtime specified step along the X navigation.

        +
        concept HasDynamicXStepTypeConcept<typename T>
        {
        -
        typename dynamic_x_step_type<T>;
        -
        where Metafunction<dynamic_x_step_type<T> >;
        +
        typename dynamic_x_step_type<T>;
        +
        };
        +
        Concept for iterators, locators and views that can define a type just like the given iterator,...
        Definition concepts/dynamic_step.hpp:40
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        Base template for types that model HasDynamicXStepTypeConcept.
        Definition dynamic_step.hpp:17

        The documentation for this struct was generated from the following file: @@ -81,7 +82,7 @@ struct boost::gil::HasDynamicXStepTypeConcept< T > diff --git a/html/reference/structboost_1_1gil_1_1_has_dynamic_y_step_type_concept-members.html b/html/reference/structboost_1_1gil_1_1_has_dynamic_y_step_type_concept-members.html index 15ce93f4f..72b832491 100644 --- a/html/reference/structboost_1_1gil_1_1_has_dynamic_y_step_type_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_has_dynamic_y_step_type_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        HasDynamicYStepTypeConcept< T > Member List
        +
        HasDynamicYStepTypeConcept< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_has_dynamic_y_step_type_concept.html b/html/reference/structboost_1_1gil_1_1_has_dynamic_y_step_type_concept.html index 1aaa72e36..4256e5358 100644 --- a/html/reference/structboost_1_1gil_1_1_has_dynamic_y_step_type_concept.html +++ b/html/reference/structboost_1_1gil_1_1_has_dynamic_y_step_type_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: HasDynamicYStepTypeConcept< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,22 +56,23 @@ $(function() {

        #include <dynamic_step.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::HasDynamicYStepTypeConcept< T >

        - -

        Concept for locators and views that can define a type just like the given locator or view, except it supports runtime specified step along the Y navigation.

        -
        concept HasDynamicYStepTypeConcept<typename T>
        +
        template<typename T>
        +struct boost::gil::HasDynamicYStepTypeConcept< T >

        Concept for locators and views that can define a type just like the given locator or view, except it supports runtime specified step along the Y navigation.

        +
        concept HasDynamicYStepTypeConcept<typename T>
        {
        -
        typename dynamic_y_step_type<T>;
        -
        where Metafunction<dynamic_y_step_type<T> >;
        +
        typename dynamic_y_step_type<T>;
        +
        };
        +
        Concept for locators and views that can define a type just like the given locator or view,...
        Definition concepts/dynamic_step.hpp:60
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        Base template for types that model HasDynamicYStepTypeConcept.
        Definition dynamic_step.hpp:21

        The documentation for this struct was generated from the following file: @@ -81,7 +82,7 @@ struct boost::gil::HasDynamicYStepTypeConcept< T > diff --git a/html/reference/structboost_1_1gil_1_1_has_transposed_type_concept-members.html b/html/reference/structboost_1_1gil_1_1_has_transposed_type_concept-members.html index 17db64d33..7bde32089 100644 --- a/html/reference/structboost_1_1gil_1_1_has_transposed_type_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_has_transposed_type_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        HasTransposedTypeConcept< T > Member List
        +
        HasTransposedTypeConcept< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_has_transposed_type_concept.html b/html/reference/structboost_1_1gil_1_1_has_transposed_type_concept.html index 15ed21d5a..9d8bad62b 100644 --- a/html/reference/structboost_1_1gil_1_1_has_transposed_type_concept.html +++ b/html/reference/structboost_1_1gil_1_1_has_transposed_type_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: HasTransposedTypeConcept< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,22 +56,23 @@ $(function() {

        #include <pixel_iterator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::HasTransposedTypeConcept< T >

        - -

        Concept for locators and views that can define a type just like the given locator or view, except X and Y is swapped.

        -
        concept HasTransposedTypeConcept<typename T>
        +
        template<typename T>
        +struct boost::gil::HasTransposedTypeConcept< T >

        Concept for locators and views that can define a type just like the given locator or view, except X and Y is swapped.

        +
        concept HasTransposedTypeConcept<typename T>
        {
        -
        typename transposed_type<T>;
        -
        where Metafunction<transposed_type<T> >;
        +
        typename transposed_type<T>;
        +
        };
        +
        Concept for locators and views that can define a type just like the given locator or view,...
        Definition concepts/pixel_iterator.hpp:138
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        Definition locator.hpp:44

        The documentation for this struct was generated from the following file: @@ -81,7 +82,7 @@ struct boost::gil::HasTransposedTypeConcept< T > diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_concept-members.html b/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_concept-members.html index 37d31be4c..622e9814e 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        HomogeneousColorBaseConcept< ColorBase > Member List
        +
        HomogeneousColorBaseConcept< ColorBase > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_concept.html b/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_concept.html index 5dd0490dc..01f7a3e7c 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_concept.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: HomogeneousColorBaseConcept< ColorBase > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        HomogeneousColorBaseConcept< ColorBase > Struct Template Reference
        +
        HomogeneousColorBaseConcept< ColorBase > Struct Template Reference
        @@ -57,29 +57,29 @@ $(function() {

        #include <color_base.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        ColorBase cb
         

        Detailed Description

        -

        template<typename ColorBase>
        -struct boost::gil::HomogeneousColorBaseConcept< ColorBase >

        - -

        Color base whose elements all have the same type.

        -
        concept HomogeneousColorBaseConcept<ColorBaseConcept CB>
        +
        template<typename ColorBase>
        +struct boost::gil::HomogeneousColorBaseConcept< ColorBase >

        Color base whose elements all have the same type.

        +
        {
        // For all K in [0 ... size<C1>::value-1):
        // where SameType<kth_element_type<CB,K>::type, kth_element_type<CB,K+1>::type>;
        -
        kth_element_const_reference_type<CB,0>::type dynamic_at_c(CB const&, std::size_t n) const;
        +
        kth_element_const_reference_type<CB,0>::type dynamic_at_c(CB const&, std::size_t n) const;
        };
        +
        A color base is a container of color elements (such as channels, channel references or channel pointe...
        Definition concepts/color_base.hpp:138
        +
        Color base whose elements all have the same type.
        Definition concepts/color_base.hpp:228

        The documentation for this struct was generated from the following file: @@ -89,7 +89,7 @@ struct boost::gil::HomogeneousColorBaseConcept< ColorBase > diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_value_concept-members.html b/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_value_concept-members.html index 94471cad5..ef0b46d1f 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_value_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_value_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        HomogeneousColorBaseValueConcept< ColorBase > Member List
        +
        HomogeneousColorBaseValueConcept< ColorBase > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_value_concept.html b/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_value_concept.html index 49562529a..2604fba6f 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_value_concept.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_color_base_value_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: HomogeneousColorBaseValueConcept< ColorBase > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,22 @@ $(function() {

        #include <color_base.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename ColorBase>
        -struct boost::gil::HomogeneousColorBaseValueConcept< ColorBase >

        - -

        Homogeneous color base that also has a default constructor. Refines Regular.

        -
        concept HomogeneousColorBaseValueConcept<typename T>
        -
        : MutableHomogeneousColorBaseConcept<T>, Regular<T>
        +
        template<typename ColorBase>
        +struct boost::gil::HomogeneousColorBaseValueConcept< ColorBase >

        Homogeneous color base that also has a default constructor. Refines Regular.

        +
        +
        {
        };
        +
        Homogeneous color base that also has a default constructor. Refines Regular.
        Definition concepts/color_base.hpp:283
        +
        Homogeneous color base that allows for modifying its elements.
        Definition concepts/color_base.hpp:258
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142

        The documentation for this struct was generated from the following file: @@ -80,7 +81,7 @@ struct boost::gil::HomogeneousColorBaseValueConcept< ColorBase > diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_based_concept-members.html b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_based_concept-members.html index 1c84a12fd..c9515725f 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_based_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_based_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        HomogeneousPixelBasedConcept< P > Member List
        +
        HomogeneousPixelBasedConcept< P > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_based_concept.html b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_based_concept.html index 474db37cb..f12a78fcc 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_based_concept.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_based_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: HomogeneousPixelBasedConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,23 +56,26 @@ $(function() {

        #include <pixel_based.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::HomogeneousPixelBasedConcept< P >

        - -

        Concept for homogeneous pixel-based GIL constructs.

        -
        concept HomogeneousPixelBasedConcept<PixelBasedConcept T>
        +
        template<typename P>
        +struct boost::gil::HomogeneousPixelBasedConcept< P >

        Concept for homogeneous pixel-based GIL constructs.

        +
        {
        -
        typename channel_type<T>;
        -
        where Metafunction<channel_type<T>>;
        -
        where ChannelConcept<channel_type<T>::type>;
        +
        typename channel_type<T>;
        + +
        where ChannelConcept<channel_type<T>::type>;
        };
        +
        A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
        Definition concepts/channel.hpp:75
        +
        Concept for homogeneous pixel-based GIL constructs.
        Definition pixel_based.hpp:84
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        Concept for all pixel-based GIL constructs.
        Definition pixel_based.hpp:54
        +
        Definition color_convert.hpp:31

        The documentation for this struct was generated from the following file: @@ -82,7 +85,7 @@ struct boost::gil::HomogeneousPixelBasedConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_concept-members.html b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_concept-members.html index 91aceaf37..fb2408341 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        HomogeneousPixelConcept< P > Member List
        +
        HomogeneousPixelConcept< P > Member List

        This is the complete list of members for HomogeneousPixelConcept< P >, including all inherited members.

        - +
        constraints() (defined in HomogeneousPixelConcept< P >)HomogeneousPixelConcept< P >inline
        p (defined in HomogeneousPixelConcept< P >)HomogeneousPixelConcept< P >
        p (defined in HomogeneousPixelConcept< P >)HomogeneousPixelConcept< P >
        diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_concept.html b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_concept.html index dbfe0b758..a12cee73a 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_concept.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: HomogeneousPixelConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        HomogeneousPixelConcept< P > Struct Template Reference
        +
        HomogeneousPixelConcept< P > Struct Template Reference
        @@ -57,31 +57,34 @@ $(function() {

        #include <pixel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        p
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::HomogeneousPixelConcept< P >

        - -

        Homogeneous pixel concept.

        -
        concept HomogeneousPixelConcept<PixelConcept P>
        -
        : HomogeneousColorBaseConcept<P>, HomogeneousPixelBasedConcept<P>
        +
        template<typename P>
        +struct boost::gil::HomogeneousPixelConcept< P >

        Homogeneous pixel concept.

        +
        +
        {
        -
        P::template element_const_reference_type<P>::type operator[](P p, std::size_t i) const
        -
        {
        -
        return dynamic_at_c(p,i);
        +
        P::template element_const_reference_type<P>::type operator[](P p, std::size_t i) const
        +
        {
        +
        return dynamic_at_c(p,i);
        }
        };
        +
        Color base whose elements all have the same type.
        Definition concepts/color_base.hpp:228
        +
        Concept for homogeneous pixel-based GIL constructs.
        Definition pixel_based.hpp:84
        +
        Homogeneous pixel concept.
        Definition concepts/pixel.hpp:124
        +
        Pixel concept - A color base whose elements are channels.
        Definition concepts/pixel.hpp:64
        +
        Specifies the return type of the constant element accessor at_c of a homogeneous color base.
        Definition color_base_algorithm.hpp:235

        The documentation for this struct was generated from the following file: @@ -91,7 +94,7 @@ struct boost::gil::HomogeneousPixelConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_value_concept-members.html b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_value_concept-members.html index 3057f6de1..89d56f7b5 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_value_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_value_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        HomogeneousPixelValueConcept< P > Member List
        +
        HomogeneousPixelValueConcept< P > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_value_concept.html b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_value_concept.html index f32c0994c..d72864eeb 100644 --- a/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_value_concept.html +++ b/html/reference/structboost_1_1gil_1_1_homogeneous_pixel_value_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: HomogeneousPixelValueConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,23 @@ $(function() {

        #include <pixel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::HomogeneousPixelValueConcept< P >

        - -

        Homogeneous pixel concept that is a Regular type.

        -
        concept HomogeneousPixelValueConcept<HomogeneousPixelConcept P> : Regular<P>
        +
        template<typename P>
        +struct boost::gil::HomogeneousPixelValueConcept< P >

        Homogeneous pixel concept that is a Regular type.

        +
        {
        -
        where SameType<value_type,P>;
        +
        where SameType<value_type,P>;
        };
        +
        Homogeneous pixel concept.
        Definition concepts/pixel.hpp:124
        +
        Homogeneous pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:189
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -80,7 +82,7 @@ struct boost::gil::HomogeneousPixelValueConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_image_concept-members.html b/html/reference/structboost_1_1gil_1_1_image_concept-members.html index 5e591e263..f14a6e9db 100644 --- a/html/reference/structboost_1_1gil_1_1_image_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_image_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ImageConcept< Image > Member List
        +
        ImageConcept< Image > Member List

        This is the complete list of members for ImageConcept< Image >, including all inherited members.

        - +
        constraints() (defined in ImageConcept< Image >)ImageConcept< Image >inline
        image (defined in ImageConcept< Image >)ImageConcept< Image >
        image (defined in ImageConcept< Image >)ImageConcept< Image >
        diff --git a/html/reference/structboost_1_1gil_1_1_image_concept.html b/html/reference/structboost_1_1gil_1_1_image_concept.html index 90a524239..3e2010f5b 100644 --- a/html/reference/structboost_1_1gil_1_1_image_concept.html +++ b/html/reference/structboost_1_1gil_1_1_image_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageConcept< Image > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        ImageConcept< Image > Struct Template Reference
        +
        ImageConcept< Image > Struct Template Reference
        @@ -57,28 +57,29 @@ $(function() {

        #include <image.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        Image image
         

        Detailed Description

        -

        template<typename Image>
        -struct boost::gil::ImageConcept< Image >

        - -

        2-dimensional image whose value type models PixelValueConcept

        -
        concept ImageConcept<RandomAccess2DImageConcept Image>
        +
        template<typename Image>
        +struct boost::gil::ImageConcept< Image >

        2-dimensional image whose value type models PixelValueConcept

        +
        {
        -
        where MutableImageViewConcept<view_t>;
        -
        typename coord_t = view_t::coord_t;
        +
        where MutableImageViewConcept<view_t>;
        +
        typename coord_t = view_t::coord_t;
        };
        +
        2-dimensional image whose value type models PixelValueConcept
        Definition concepts/image.hpp:145
        +
        GIL's 2-dimensional view over mutable GIL pixels.
        Definition concepts/image_view.hpp:505
        +
        2-dimensional container of values
        Definition concepts/image.hpp:110

        The documentation for this struct was generated from the following file: @@ -88,7 +89,7 @@ struct boost::gil::ImageConcept< Image > diff --git a/html/reference/structboost_1_1gil_1_1_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_image_view_concept-members.html index fce06ffea..408a5bc4a 100644 --- a/html/reference/structboost_1_1gil_1_1_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ImageViewConcept< View > Member List
        +
        ImageViewConcept< View > Member List

        This is the complete list of members for ImageViewConcept< View >, including all inherited members.

        - +
        constraints() (defined in ImageViewConcept< View >)ImageViewConcept< View >inline
        view (defined in ImageViewConcept< View >)ImageViewConcept< View >
        view (defined in ImageViewConcept< View >)ImageViewConcept< View >
        diff --git a/html/reference/structboost_1_1gil_1_1_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_image_view_concept.html index b7dc0fdd0..909685c9d 100644 --- a/html/reference/structboost_1_1gil_1_1_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        ImageViewConcept< View > Struct Template Reference
        +
        ImageViewConcept< View > Struct Template Reference
        @@ -57,34 +57,36 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        View view
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::ImageViewConcept< View >

        - -

        GIL's 2-dimensional view over immutable GIL pixels.

        -
        concept ImageViewConcept<RandomAccess2DImageViewConcept View>
        +
        template<typename View>
        +struct boost::gil::ImageViewConcept< View >

        GIL's 2-dimensional view over immutable GIL pixels.

        +
        {
        -
        where PixelValueConcept<value_type>;
        -
        where PixelIteratorConcept<x_iterator>;
        -
        where PixelIteratorConcept<y_iterator>;
        +
        where PixelValueConcept<value_type>;
        +
        where PixelIteratorConcept<x_iterator>;
        +
        where PixelIteratorConcept<y_iterator>;
        where x_coord_t == y_coord_t;
        typename coord_t = x_coord_t;
        std::size_t View::num_channels() const;
        };
        +
        GIL's 2-dimensional view over immutable GIL pixels.
        Definition concepts/image_view.hpp:376
        +
        An STL random access traversal iterator over a model of PixelConcept.
        Definition concepts/pixel_iterator.hpp:171
        +
        Pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:171
        +
        2-dimensional view over immutable values
        Definition concepts/image_view.hpp:222

        The documentation for this struct was generated from the following file: @@ -94,7 +96,7 @@ struct boost::gil::ImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_iterator_adaptor_concept-members.html b/html/reference/structboost_1_1gil_1_1_iterator_adaptor_concept-members.html index 5ab836f6d..95df119df 100644 --- a/html/reference/structboost_1_1gil_1_1_iterator_adaptor_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_iterator_adaptor_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        IteratorAdaptorConcept< Iterator > Member List
        +
        IteratorAdaptorConcept< Iterator > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_iterator_adaptor_concept.html b/html/reference/structboost_1_1gil_1_1_iterator_adaptor_concept.html index d41a88919..d8e8803ab 100644 --- a/html/reference/structboost_1_1gil_1_1_iterator_adaptor_concept.html +++ b/html/reference/structboost_1_1gil_1_1_iterator_adaptor_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: IteratorAdaptorConcept< Iterator > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        IteratorAdaptorConcept< Iterator > Struct Template Reference
        +
        IteratorAdaptorConcept< Iterator > Struct Template Reference
        @@ -57,44 +57,48 @@ $(function() {

        #include <pixel_iterator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        Iterator it
         

        Detailed Description

        -

        template<typename Iterator>
        -struct boost::gil::IteratorAdaptorConcept< Iterator >

        - -

        Iterator adaptor is a forward iterator adapting another forward iterator.

        +
        template<typename Iterator>
        +struct boost::gil::IteratorAdaptorConcept< Iterator >

        Iterator adaptor is a forward iterator adapting another forward iterator.

        In addition to GIL iterator requirements, GIL iterator adaptors must provide the following metafunctions:

        • is_iterator_adaptor<Iterator>: Returns std::true_type
        • iterator_adaptor_get_base<Iterator>: Returns the base iterator type
        • iterator_adaptor_rebind<Iterator,NewBase>: Replaces the base iterator with the new one

        The adaptee can be obtained from the iterator via the "base()" method.

        -
        concept IteratorAdaptorConcept<boost_concepts::ForwardTraversalConcept Iterator>
        +
        concept IteratorAdaptorConcept<boost_concepts::ForwardTraversalConcept Iterator>
        {
        -
        where SameType<is_iterator_adaptor<Iterator>::type, std::true_type>;
        +
        where SameType<is_iterator_adaptor<Iterator>::type, std::true_type>;
        -
        typename iterator_adaptor_get_base<Iterator>;
        -
        where Metafunction<iterator_adaptor_get_base<Iterator> >;
        -
        where boost_concepts::ForwardTraversalConcept<iterator_adaptor_get_base<Iterator>::type>;
        +
        typename iterator_adaptor_get_base<Iterator>;
        + +
        where boost_concepts::ForwardTraversalConcept<iterator_adaptor_get_base<Iterator>::type>;
        -
        typename another_iterator;
        -
        typename iterator_adaptor_rebind<Iterator,another_iterator>::type;
        +
        typename another_iterator;
        +
        typename iterator_adaptor_rebind<Iterator,another_iterator>::type;
        where boost_concepts::ForwardTraversalConcept<another_iterator>;
        -
        where IteratorAdaptorConcept<iterator_adaptor_rebind<Iterator,another_iterator>::type>;
        +
        where IteratorAdaptorConcept<iterator_adaptor_rebind<Iterator,another_iterator>::type>;
        -
        const iterator_adaptor_get_base<Iterator>::type& Iterator::base() const;
        +
        const iterator_adaptor_get_base<Iterator>::type& Iterator::base() const;
        };
        +
        Iterator adaptor is a forward iterator adapting another forward iterator.
        Definition concepts/pixel_iterator.hpp:318
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179
        +
        metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
        Definition pixel_iterator.hpp:28
        +
        returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
        Definition metafunctions.hpp:36
        +
        Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
        Definition pixel_iterator.hpp:36

        The documentation for this struct was generated from the following file: @@ -104,7 +108,7 @@ struct boost::gil::IteratorAdaptorConcept< Iterator > diff --git a/html/reference/structboost_1_1gil_1_1_memory_based_iterator_concept-members.html b/html/reference/structboost_1_1gil_1_1_memory_based_iterator_concept-members.html index 1892efe39..ea9792dc4 100644 --- a/html/reference/structboost_1_1gil_1_1_memory_based_iterator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_memory_based_iterator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MemoryBasedIteratorConcept< Iterator > Member List
        +
        MemoryBasedIteratorConcept< Iterator > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_memory_based_iterator_concept.html b/html/reference/structboost_1_1gil_1_1_memory_based_iterator_concept.html index e12c89c19..ed045c9a6 100644 --- a/html/reference/structboost_1_1gil_1_1_memory_based_iterator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_memory_based_iterator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MemoryBasedIteratorConcept< Iterator > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,26 +56,26 @@ $(function() {

        #include <pixel_iterator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename Iterator>
        -struct boost::gil::MemoryBasedIteratorConcept< Iterator >

        - -

        Concept of a random-access iterator that can be advanced in memory units (bytes or bits)

        -
        concept MemoryBasedIteratorConcept<boost_concepts::RandomAccessTraversalConcept Iterator>
        +
        template<typename Iterator>
        +struct boost::gil::MemoryBasedIteratorConcept< Iterator >

        Concept of a random-access iterator that can be advanced in memory units (bytes or bits)

        +
        concept MemoryBasedIteratorConcept<boost_concepts::RandomAccessTraversalConcept Iterator>
        {
        -
        typename byte_to_memunit<Iterator>; where metafunction<byte_to_memunit<Iterator> >;
        -
        std::ptrdiff_t memunit_step(const Iterator&);
        -
        std::ptrdiff_t memunit_distance(const Iterator& , const Iterator&);
        -
        void memunit_advance(Iterator&, std::ptrdiff_t diff);
        -
        Iterator memunit_advanced(const Iterator& p, std::ptrdiff_t diff) { Iterator tmp; memunit_advance(tmp,diff); return tmp; }
        -
        Iterator::reference memunit_advanced_ref(const Iterator& p, std::ptrdiff_t diff) { return *memunit_advanced(p,diff); }
        +
        typename byte_to_memunit<Iterator>; where metafunction<byte_to_memunit<Iterator> >;
        +
        std::ptrdiff_t memunit_step(const Iterator&);
        +
        std::ptrdiff_t memunit_distance(const Iterator& , const Iterator&);
        +
        void memunit_advance(Iterator&, std::ptrdiff_t diff);
        +
        Iterator memunit_advanced(const Iterator& p, std::ptrdiff_t diff) { Iterator tmp; memunit_advance(tmp,diff); return tmp; }
        +
        Iterator::reference memunit_advanced_ref(const Iterator& p, std::ptrdiff_t diff) { return *memunit_advanced(p,diff); }
        };
        +
        Concept of a random-access iterator that can be advanced in memory units (bytes or bits)
        Definition concepts/pixel_iterator.hpp:237
        +
        Definition pixel_iterator.hpp:124

        The documentation for this struct was generated from the following file: @@ -85,7 +85,7 @@ struct boost::gil::MemoryBasedIteratorConcept< Iterator > diff --git a/html/reference/structboost_1_1gil_1_1_metafunction-members.html b/html/reference/structboost_1_1gil_1_1_metafunction-members.html index 5b59769eb..f9d658f04 100644 --- a/html/reference/structboost_1_1gil_1_1_metafunction-members.html +++ b/html/reference/structboost_1_1gil_1_1_metafunction-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        Metafunction< T > Member List
        +
        Metafunction< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_metafunction.html b/html/reference/structboost_1_1gil_1_1_metafunction.html index bd10de3ea..d4e88daaa 100644 --- a/html/reference/structboost_1_1gil_1_1_metafunction.html +++ b/html/reference/structboost_1_1gil_1_1_metafunction.html @@ -4,7 +4,7 @@ - + Generic Image Library: Metafunction< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,20 @@ $(function() {

        #include <basic.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::Metafunction< T >

        - -

        Concept for type as metafunction requirement.

        -
        auto concept Metafunction<typename T>
        +
        template<typename T>
        +struct boost::gil::Metafunction< T >

        Concept for type as metafunction requirement.

        +
        auto concept Metafunction<typename T>
        {
        -
        typename type;
        +
        typename type;
        };
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164

        The documentation for this struct was generated from the following file: @@ -80,7 +79,7 @@ struct boost::gil::Metafunction< T > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_channel_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_channel_concept-members.html index e20c7a97d..e3007d733 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_channel_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_channel_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableChannelConcept< T > Member List
        +
        MutableChannelConcept< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_channel_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_channel_concept.html index 0d9e729af..782777fd6 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_channel_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_channel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableChannelConcept< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,18 +56,20 @@ $(function() {

        #include <channel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::MutableChannelConcept< T >

        - -

        A channel that allows for modifying its value.

        -
        concept MutableChannelConcept<ChannelConcept T> : Assignable<T>, Swappable<T> {};
        +
        template<typename T>
        +struct boost::gil::MutableChannelConcept< T >

        A channel that allows for modifying its value.

        +
        +
        Concept of copy assignment requirement.
        Definition basic.hpp:82
        +
        A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
        Definition concepts/channel.hpp:75
        +
        A channel that allows for modifying its value.
        Definition concepts/channel.hpp:119
        +
        Concept of swap operation requirement.
        Definition basic.hpp:119

        The documentation for this struct was generated from the following file: @@ -77,7 +79,7 @@ struct boost::gil::MutableChannelConcept< T > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_color_base_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_color_base_concept-members.html index f51d10ba3..43836d56b 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_color_base_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_color_base_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableColorBaseConcept< ColorBase > Member List
        +
        MutableColorBaseConcept< ColorBase > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_mutable_color_base_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_color_base_concept.html index 69b7faf1a..e7f72ad13 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_color_base_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_color_base_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableColorBaseConcept< ColorBase > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        MutableColorBaseConcept< ColorBase > Struct Template Reference
        +
        MutableColorBaseConcept< ColorBase > Struct Template Reference
        @@ -57,35 +57,38 @@ $(function() {

        #include <color_base.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        ColorBase cb
         

        Detailed Description

        -

        template<typename ColorBase>
        -struct boost::gil::MutableColorBaseConcept< ColorBase >

        - -

        Color base which allows for modifying its elements.

        -
        concept MutableColorBaseConcept<ColorBaseConcept T> : Assignable<T>, Swappable<T>
        +
        template<typename ColorBase>
        +struct boost::gil::MutableColorBaseConcept< ColorBase >

        Color base which allows for modifying its elements.

        +
        {
        -
        template <int K>
        -
        struct kth_element_reference_type; where Metafunction<kth_element_reference_type>;
        +
        template <int K>
        +
        struct kth_element_reference_type; where Metafunction<kth_element_reference_type>;
        -
        template <int K>
        -
        kth_element_reference_type<kth_element_type<T,K>::type>::type at_c(T);
        +
        template <int K>
        +
        kth_element_reference_type<kth_element_type<T,K>::type>::type at_c(T);
        -
        template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
        +
        template <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> }
        T& operator=(T&, const T2&);
        };
        -
        auto at_c(detail::homogeneous_color_base< E, L, N > &p) -> typename std::add_lvalue_reference< E >::type
        Provides mutable access to the K-th element, in physical order.
        Definition: color_base.hpp:632
        +
        Concept of copy assignment requirement.
        Definition basic.hpp:82
        +
        A color base is a container of color elements (such as channels, channel references or channel pointe...
        Definition concepts/color_base.hpp:138
        +
        Two color bases are compatible if they have the same color space and their elements are compatible,...
        Definition concepts/color_base.hpp:304
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        Color base which allows for modifying its elements.
        Definition concepts/color_base.hpp:184
        +
        Concept of swap operation requirement.
        Definition basic.hpp:119

        The documentation for this struct was generated from the following file: @@ -95,7 +98,7 @@ struct boost::gil::MutableColorBaseConcept< ColorBase > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_color_base_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_color_base_concept-members.html index 98500f23a..0445ce681 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_color_base_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_color_base_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableHomogeneousColorBaseConcept< ColorBase > Member List
        +
        MutableHomogeneousColorBaseConcept< ColorBase > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_color_base_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_color_base_concept.html index 7666d6a75..c4eeb4b6a 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_color_base_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_color_base_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableHomogeneousColorBaseConcept< ColorBase > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        MutableHomogeneousColorBaseConcept< ColorBase > Struct Template Reference
        +
        MutableHomogeneousColorBaseConcept< ColorBase > Struct Template Reference
        @@ -57,28 +57,29 @@ $(function() {

        #include <color_base.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        ColorBase cb
         

        Detailed Description

        -

        template<typename ColorBase>
        -struct boost::gil::MutableHomogeneousColorBaseConcept< ColorBase >

        - -

        Homogeneous color base that allows for modifying its elements.

        -
        concept MutableHomogeneousColorBaseConcept<ColorBaseConcept CB>
        -
        : HomogeneousColorBaseConcept<CB>
        +
        template<typename ColorBase>
        +struct boost::gil::MutableHomogeneousColorBaseConcept< ColorBase >

        Homogeneous color base that allows for modifying its elements.

        +
        +
        {
        kth_element_reference_type<CB, 0>::type dynamic_at_c(CB&, std::size_t n);
        };
        +
        A color base is a container of color elements (such as channels, channel references or channel pointe...
        Definition concepts/color_base.hpp:138
        +
        Color base whose elements all have the same type.
        Definition concepts/color_base.hpp:228
        +
        Homogeneous color base that allows for modifying its elements.
        Definition concepts/color_base.hpp:258

        The documentation for this struct was generated from the following file: @@ -88,7 +89,7 @@ struct boost::gil::MutableHomogeneousColorBaseConcept< ColorBase > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_pixel_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_pixel_concept-members.html index 3386b1d4a..d9f01fa59 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_pixel_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_pixel_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableHomogeneousPixelConcept< P > Member List
        +
        MutableHomogeneousPixelConcept< P > Member List
        @@ -59,7 +59,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_pixel_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_pixel_concept.html index 88b5ac4cd..3f7054186 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_pixel_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_homogeneous_pixel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableHomogeneousPixelConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        MutableHomogeneousPixelConcept< P > Struct Template Reference
        +
        MutableHomogeneousPixelConcept< P > Struct Template Reference
        @@ -57,34 +57,36 @@ $(function() {

        #include <pixel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - - -

        +

        Public Attributes

        +
        P::template element_type< P >::type v
         
        +
        p
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::MutableHomogeneousPixelConcept< P >

        - -

        Homogeneous pixel concept that allows for changing its channels.

        -
        concept MutableHomogeneousPixelConcept<HomogeneousPixelConcept P>
        -
        : MutableHomogeneousColorBaseConcept<P>
        +
        template<typename P>
        +struct boost::gil::MutableHomogeneousPixelConcept< P >

        Homogeneous pixel concept that allows for changing its channels.

        +
        +
        {
        -
        P::template element_reference_type<P>::type operator[](P p, std::size_t i)
        +
        P::template element_reference_type<P>::type operator[](P p, std::size_t i)
        {
        -
        return dynamic_at_c(p, i);
        +
        return dynamic_at_c(p, i);
        }
        };
        +
        Homogeneous pixel concept.
        Definition concepts/pixel.hpp:124
        +
        Homogeneous color base that allows for modifying its elements.
        Definition concepts/color_base.hpp:258
        +
        Homogeneous pixel concept that allows for changing its channels.
        Definition concepts/pixel.hpp:149
        +
        Specifies the return type of the mutable element accessor at_c of a homogeneous color base.
        Definition color_base_algorithm.hpp:230

        The documentation for this struct was generated from the following file: @@ -94,7 +96,7 @@ struct boost::gil::MutableHomogeneousPixelConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_image_view_concept-members.html index 8dad47ffb..81163d7b3 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableImageViewConcept< View > Member List
        +
        MutableImageViewConcept< View > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_image_view_concept.html index 14ae5cec1..4a4ec03c3 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,19 +56,20 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::MutableImageViewConcept< View >

        - -

        GIL's 2-dimensional view over mutable GIL pixels.

        -
        concept MutableImageViewConcept<ImageViewConcept View>
        -
        : MutableRandomAccess2DImageViewConcept<View> {};
        +
        template<typename View>
        +struct boost::gil::MutableImageViewConcept< View >

        GIL's 2-dimensional view over mutable GIL pixels.

        +
        + +
        GIL's 2-dimensional view over immutable GIL pixels.
        Definition concepts/image_view.hpp:376
        +
        GIL's 2-dimensional view over mutable GIL pixels.
        Definition concepts/image_view.hpp:505
        +
        2-dimensional view over mutable values
        Definition concepts/image_view.hpp:488

        The documentation for this struct was generated from the following file: @@ -78,7 +79,7 @@ struct boost::gil::MutableImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_iterator_adaptor_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_iterator_adaptor_concept-members.html index cc5ed2d2e..36e7fa476 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_iterator_adaptor_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_iterator_adaptor_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableIteratorAdaptorConcept< Iterator > Member List
        +
        MutableIteratorAdaptorConcept< Iterator > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_iterator_adaptor_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_iterator_adaptor_concept.html index 5b047a9c0..2b88d0fb8 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_iterator_adaptor_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_iterator_adaptor_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableIteratorAdaptorConcept< Iterator > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,19 +56,19 @@ $(function() {

        #include <pixel_iterator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename Iterator>
        -struct boost::gil::MutableIteratorAdaptorConcept< Iterator >

        - -

        Iterator adaptor that is mutable.

        -
        concept MutableIteratorAdaptorConcept<Mutable_ForwardIteratorConcept Iterator>
        -
        : IteratorAdaptorConcept<Iterator> {};
        +
        template<typename Iterator>
        +struct boost::gil::MutableIteratorAdaptorConcept< Iterator >

        Iterator adaptor that is mutable.

        +
        concept MutableIteratorAdaptorConcept<Mutable_ForwardIteratorConcept Iterator>
        +
        : IteratorAdaptorConcept<Iterator> {};
        +
        Iterator adaptor is a forward iterator adapting another forward iterator.
        Definition concepts/pixel_iterator.hpp:318
        +
        Iterator adaptor that is mutable.
        Definition concepts/pixel_iterator.hpp:343

        The documentation for this struct was generated from the following file: @@ -78,7 +78,7 @@ struct boost::gil::MutableIteratorAdaptorConcept< Iterator > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_pixel_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_pixel_concept-members.html index 596b6397c..c70bfbb07 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_pixel_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_pixel_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutablePixelConcept< P > Member List
        +
        MutablePixelConcept< P > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_pixel_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_pixel_concept.html index 39d74e166..322a22d89 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_pixel_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_pixel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutablePixelConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,22 @@ $(function() {

        #include <pixel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::MutablePixelConcept< P >

        - -

        Pixel concept that allows for changing its channels.

        -
        concept MutablePixelConcept<PixelConcept P> : MutableColorBaseConcept<P>
        +
        template<typename P>
        +struct boost::gil::MutablePixelConcept< P >

        Pixel concept that allows for changing its channels.

        +
        {
        where is_mutable==true;
        };
        +
        Color base which allows for modifying its elements.
        Definition concepts/color_base.hpp:184
        +
        Pixel concept that allows for changing its channels.
        Definition concepts/pixel.hpp:102
        +
        Pixel concept - A color base whose elements are channels.
        Definition concepts/pixel.hpp:64

        The documentation for this struct was generated from the following file: @@ -80,7 +81,7 @@ struct boost::gil::MutablePixelConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_pixel_iterator_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_pixel_iterator_concept-members.html index 729826758..fc8f5d904 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_pixel_iterator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_pixel_iterator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutablePixelIteratorConcept< Iterator > Member List
        +
        MutablePixelIteratorConcept< Iterator > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_pixel_iterator_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_pixel_iterator_concept.html index 297e30939..2f8925094 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_pixel_iterator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_pixel_iterator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutablePixelIteratorConcept< Iterator > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,19 +56,19 @@ $(function() {

        #include <pixel_iterator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename Iterator>
        -struct boost::gil::MutablePixelIteratorConcept< Iterator >

        - -

        Pixel iterator that allows for changing its pixel.

        -
        concept MutablePixelIteratorConcept<PixelIteratorConcept Iterator>
        +
        template<typename Iterator>
        +struct boost::gil::MutablePixelIteratorConcept< Iterator >

        Pixel iterator that allows for changing its pixel.

        +
        : MutableRandomAccessIteratorConcept<Iterator> {};
        +
        Pixel iterator that allows for changing its pixel.
        Definition concepts/pixel_iterator.hpp:210
        +
        An STL random access traversal iterator over a model of PixelConcept.
        Definition concepts/pixel_iterator.hpp:171

        The documentation for this struct was generated from the following file: @@ -78,7 +78,7 @@ struct boost::gil::MutablePixelIteratorConcept< Iterator > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_pixel_locator_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_pixel_locator_concept-members.html index da0586af7..9decf94fb 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_pixel_locator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_pixel_locator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutablePixelLocatorConcept< Loc > Member List
        +
        MutablePixelLocatorConcept< Loc > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_pixel_locator_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_pixel_locator_concept.html index 6a7f49bb6..4162d21b4 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_pixel_locator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_pixel_locator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutablePixelLocatorConcept< Loc > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,19 +56,20 @@ $(function() {

        #include <pixel_locator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename Loc>
        -struct boost::gil::MutablePixelLocatorConcept< Loc >

        - -

        GIL's 2-dimensional locator over mutable GIL pixels.

        -
        concept MutablePixelLocatorConcept<PixelLocatorConcept Loc>
        -
        : MutableRandomAccess2DLocatorConcept<Loc> {};
        +
        template<typename Loc>
        +struct boost::gil::MutablePixelLocatorConcept< Loc >

        GIL's 2-dimensional locator over mutable GIL pixels.

        +
        + +
        GIL's 2-dimensional locator over mutable GIL pixels.
        Definition pixel_locator.hpp:393
        +
        2-dimensional locator over mutable pixels
        Definition pixel_locator.hpp:376
        +
        GIL's 2-dimensional locator over immutable GIL pixels.
        Definition pixel_locator.hpp:292

        The documentation for this struct was generated from the following file: @@ -78,7 +79,7 @@ struct boost::gil::MutablePixelLocatorConcept< Loc > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_image_view_concept-members.html index d878f4e6a..4cbe9c4fd 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableRandomAccess2DImageViewConcept< View > Member List
        +
        MutableRandomAccess2DImageViewConcept< View > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_image_view_concept.html index f74b8e488..d2862157d 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableRandomAccess2DImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,19 +56,20 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::MutableRandomAccess2DImageViewConcept< View >

        - -

        2-dimensional view over mutable values

        -
        concept MutableRandomAccess2DImageViewConcept<RandomAccess2DImageViewConcept View>
        -
        : MutableRandomAccessNDImageViewConcept<View> {};
        +
        template<typename View>
        +struct boost::gil::MutableRandomAccess2DImageViewConcept< View >

        2-dimensional view over mutable values

        +
        + +
        2-dimensional view over mutable values
        Definition concepts/image_view.hpp:488
        +
        N-dimensional view over mutable values.
        Definition concepts/image_view.hpp:471
        +
        2-dimensional view over immutable values
        Definition concepts/image_view.hpp:222

        The documentation for this struct was generated from the following file: @@ -78,7 +79,7 @@ struct boost::gil::MutableRandomAccess2DImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_locator_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_locator_concept-members.html index a731adfae..739b3997f 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_locator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_locator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableRandomAccess2DLocatorConcept< Loc > Member List
        +
        MutableRandomAccess2DLocatorConcept< Loc > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_locator_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_locator_concept.html index ceb106a8b..c31ecf0b7 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_locator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_random_access2_d_locator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableRandomAccess2DLocatorConcept< Loc > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,19 +56,20 @@ $(function() {

        #include <pixel_locator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename Loc>
        -struct boost::gil::MutableRandomAccess2DLocatorConcept< Loc >

        - -

        2-dimensional locator over mutable pixels

        -
        concept MutableRandomAccess2DLocatorConcept<RandomAccess2DLocatorConcept Loc>
        -
        : MutableRandomAccessNDLocatorConcept<Loc> {};
        +
        template<typename Loc>
        +struct boost::gil::MutableRandomAccess2DLocatorConcept< Loc >

        2-dimensional locator over mutable pixels

        +
        + +
        2-dimensional locator over mutable pixels
        Definition pixel_locator.hpp:376
        +
        N-dimensional locator over mutable pixels.
        Definition pixel_locator.hpp:359
        +
        2-dimensional locator over immutable values
        Definition pixel_locator.hpp:222

        The documentation for this struct was generated from the following file: @@ -78,7 +79,7 @@ struct boost::gil::MutableRandomAccess2DLocatorConcept< Loc > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_image_view_concept-members.html index 389d82eb6..d5d2cd5e2 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableRandomAccessNDImageViewConcept< View > Member List
        +
        MutableRandomAccessNDImageViewConcept< View > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_image_view_concept.html index b6c0283cd..f1c63467b 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableRandomAccessNDImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,21 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::MutableRandomAccessNDImageViewConcept< View >

        - -

        N-dimensional view over mutable values.

        -
        concept MutableRandomAccessNDImageViewConcept<RandomAccessNDImageViewConcept View>
        +
        template<typename View>
        +struct boost::gil::MutableRandomAccessNDImageViewConcept< View >

        N-dimensional view over mutable values.

        +
        {
        where Mutable<reference>;
        };
        +
        N-dimensional view over mutable values.
        Definition concepts/image_view.hpp:471
        +
        N-dimensional view over immutable values.
        Definition concepts/image_view.hpp:104

        The documentation for this struct was generated from the following file: @@ -80,7 +80,7 @@ struct boost::gil::MutableRandomAccessNDImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_locator_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_locator_concept-members.html index 0532b06f9..f7b4edbae 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_locator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_locator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableRandomAccessNDLocatorConcept< Loc > Member List
        +
        MutableRandomAccessNDLocatorConcept< Loc > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_locator_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_locator_concept.html index 6e6ed6ac5..f3e87e71f 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_locator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_random_access_n_d_locator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableRandomAccessNDLocatorConcept< Loc > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,21 @@ $(function() {

        #include <pixel_locator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename Loc>
        -struct boost::gil::MutableRandomAccessNDLocatorConcept< Loc >

        - -

        N-dimensional locator over mutable pixels.

        -
        concept MutableRandomAccessNDLocatorConcept<RandomAccessNDLocatorConcept Loc>
        +
        template<typename Loc>
        +struct boost::gil::MutableRandomAccessNDLocatorConcept< Loc >

        N-dimensional locator over mutable pixels.

        +
        {
        where Mutable<reference>;
        };
        +
        N-dimensional locator over mutable pixels.
        Definition pixel_locator.hpp:359
        +
        N-dimensional locator over immutable values.
        Definition pixel_locator.hpp:105

        The documentation for this struct was generated from the following file: @@ -80,7 +80,7 @@ struct boost::gil::MutableRandomAccessNDLocatorConcept< Loc > diff --git a/html/reference/structboost_1_1gil_1_1_mutable_step_iterator_concept-members.html b/html/reference/structboost_1_1gil_1_1_mutable_step_iterator_concept-members.html index e6f845f93..82bf7abd5 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_step_iterator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_step_iterator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        MutableStepIteratorConcept< Iterator > Member List
        +
        MutableStepIteratorConcept< Iterator > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_mutable_step_iterator_concept.html b/html/reference/structboost_1_1gil_1_1_mutable_step_iterator_concept.html index 715ca9dcf..b6fa0d9cc 100644 --- a/html/reference/structboost_1_1gil_1_1_mutable_step_iterator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_mutable_step_iterator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: MutableStepIteratorConcept< Iterator > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,19 +56,19 @@ $(function() {

        #include <pixel_iterator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename Iterator>
        -struct boost::gil::MutableStepIteratorConcept< Iterator >

        - -

        Step iterator that allows for modifying its current value.

        -
        concept MutableStepIteratorConcept<Mutable_ForwardIteratorConcept Iterator>
        -
        : StepIteratorConcept<Iterator> {};
        +
        template<typename Iterator>
        +struct boost::gil::MutableStepIteratorConcept< Iterator >

        Step iterator that allows for modifying its current value.

        +
        concept MutableStepIteratorConcept<Mutable_ForwardIteratorConcept Iterator>
        +
        : StepIteratorConcept<Iterator> {};
        +
        Step iterator that allows for modifying its current value.
        Definition concepts/pixel_iterator.hpp:276
        +
        Step iterator concept.
        Definition concepts/pixel_iterator.hpp:258

        The documentation for this struct was generated from the following file: @@ -78,7 +78,7 @@ struct boost::gil::MutableStepIteratorConcept< Iterator > diff --git a/html/reference/structboost_1_1gil_1_1_pixel_based_concept-members.html b/html/reference/structboost_1_1gil_1_1_pixel_based_concept-members.html index 601d0f96c..7e54b009c 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_based_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_based_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PixelBasedConcept< P > Member List
        +
        PixelBasedConcept< P > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_pixel_based_concept.html b/html/reference/structboost_1_1gil_1_1_pixel_based_concept.html index e3624b314..5e9af66bb 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_based_concept.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_based_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelBasedConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,30 +56,33 @@ $(function() {

        #include <pixel_based.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::PixelBasedConcept< P >

        - -

        Concept for all pixel-based GIL constructs.

        +
        template<typename P>
        +struct boost::gil::PixelBasedConcept< P >

        Concept for all pixel-based GIL constructs.

        Pixel-based constructs include pixels, iterators, locators, views and images whose value type is a pixel.

        -
        concept PixelBasedConcept<typename T>
        +
        concept PixelBasedConcept<typename T>
        {
        -
        typename color_space_type<T>;
        -
        where Metafunction<color_space_type<T> >;
        -
        where ColorSpaceConcept<color_space_type<T>::type>;
        -
        typename channel_mapping_type<T>;
        -
        where Metafunction<channel_mapping_type<T> >;
        -
        where ChannelMappingConcept<channel_mapping_type<T>::type>;
        -
        typename is_planar<T>;
        -
        where Metafunction<is_planar<T> >;
        -
        where SameType<is_planar<T>::type, bool>;
        +
        typename color_space_type<T>;
        +
        where Metafunction<color_space_type<T> >;
        +
        where ColorSpaceConcept<color_space_type<T>::type>;
        +
        typename channel_mapping_type<T>;
        +
        where Metafunction<channel_mapping_type<T> >;
        +
        where ChannelMappingConcept<channel_mapping_type<T>::type>;
        +
        typename is_planar<T>;
        +
        where Metafunction<is_planar<T> >;
        +
        where SameType<is_planar<T>::type, bool>;
        };
        +
        Channel mapping concept.
        Definition color.hpp:79
        +
        Color space type concept.
        Definition color.hpp:38
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        Concept for all pixel-based GIL constructs.
        Definition pixel_based.hpp:54
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -89,7 +92,7 @@ struct boost::gil::PixelBasedConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_pixel_concept-members.html b/html/reference/structboost_1_1gil_1_1_pixel_concept-members.html index d0a4109fa..ca17c9ded 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PixelConcept< P > Member List
        +
        PixelConcept< P > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_pixel_concept.html b/html/reference/structboost_1_1gil_1_1_pixel_concept.html index 8c6343ec4..78f290462 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_concept.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,38 +56,40 @@ $(function() {

        #include <pixel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::PixelConcept< P >

        - -

        Pixel concept - A color base whose elements are channels.

        -
        concept PixelConcept<typename P> : ColorBaseConcept<P>, PixelBasedConcept<P>
        +
        template<typename P>
        +struct boost::gil::PixelConcept< P >

        Pixel concept - A color base whose elements are channels.

        +
        concept PixelConcept<typename P> : ColorBaseConcept<P>, PixelBasedConcept<P>
        {
        where is_pixel<P>::value == true;
        // where for each K [0..size<P>::value - 1]:
        // ChannelConcept<kth_element_type<P, K>>;
        typename P::value_type;
        -
        where PixelValueConcept<value_type>;
        +
        typename P::reference;
        -
        where PixelConcept<reference>;
        +
        typename P::const_reference;
        -
        where PixelConcept<const_reference>;
        +
        static const bool P::is_mutable;
        -
        template <PixelConcept P2> where { PixelConcept<P, P2> }
        +
        template <PixelConcept P2> where { PixelConcept<P, P2> }
        P::P(P2);
        -
        template <PixelConcept P2> where { PixelConcept<P, P2> }
        +
        template <PixelConcept P2> where { PixelConcept<P, P2> }
        bool operator==(const P&, const P2&);
        template <PixelConcept P2> where { PixelConcept<P, P2> }
        bool operator!=(const P&, const P2&);
        };
        +
        A color base is a container of color elements (such as channels, channel references or channel pointe...
        Definition concepts/color_base.hpp:138
        +
        Concept for all pixel-based GIL constructs.
        Definition pixel_based.hpp:54
        +
        Pixel concept - A color base whose elements are channels.
        Definition concepts/pixel.hpp:64
        +
        Pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:171

        The documentation for this struct was generated from the following file: @@ -97,7 +99,7 @@ struct boost::gil::PixelConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_pixel_convertible_concept-members.html b/html/reference/structboost_1_1gil_1_1_pixel_convertible_concept-members.html index 6d05d064d..81c67c6c8 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_convertible_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_convertible_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PixelConvertibleConcept< SrcP, DstP > Member List
        +
        PixelConvertibleConcept< SrcP, DstP > Member List
        @@ -59,7 +59,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_pixel_convertible_concept.html b/html/reference/structboost_1_1gil_1_1_pixel_convertible_concept.html index c82c3fc2a..e23966a0a 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_convertible_concept.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_convertible_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelConvertibleConcept< SrcP, DstP > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        PixelConvertibleConcept< SrcP, DstP > Struct Template Reference
        +
        PixelConvertibleConcept< SrcP, DstP > Struct Template Reference
        @@ -57,32 +57,31 @@ $(function() {

        #include <pixel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - - -

        +

        Public Attributes

        +
        SrcP src
         
        +
        DstP dst
         

        Detailed Description

        -

        template<typename SrcP, typename DstP>
        -struct boost::gil::PixelConvertibleConcept< SrcP, DstP >

        - -

        Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted to another, approximating the color. Conversion is explicit and sometimes lossy.

        +
        template<typename SrcP, typename DstP>
        +struct boost::gil::PixelConvertibleConcept< SrcP, DstP >

        Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted to another, approximating the color. Conversion is explicit and sometimes lossy.

        template <PixelConcept SrcPixel, MutablePixelConcept DstPixel>
        -
        concept PixelConvertibleConcept
        +
        {
        -
        void color_convert(const SrcPixel&, DstPixel&);
        +
        void color_convert(const SrcPixel&, DstPixel&);
        };
        -
        void color_convert(const SrcP &src, DstP &dst)
        helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
        Definition: color_convert.hpp:342
        +
        void color_convert(const SrcP &src, DstP &dst)
        helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
        Definition color_convert.hpp:342
        +
        Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
        Definition concepts/pixel.hpp:278

        The documentation for this struct was generated from the following file: @@ -92,7 +91,7 @@ struct boost::gil::PixelConvertibleConcept< SrcP, DstP > diff --git a/html/reference/structboost_1_1gil_1_1_pixel_dereference_adaptor_concept-members.html b/html/reference/structboost_1_1gil_1_1_pixel_dereference_adaptor_concept-members.html index 78b854401..3bbe76eb1 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_dereference_adaptor_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_dereference_adaptor_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PixelDereferenceAdaptorConcept< D > Member List
        +
        PixelDereferenceAdaptorConcept< D > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_pixel_dereference_adaptor_concept.html b/html/reference/structboost_1_1gil_1_1_pixel_dereference_adaptor_concept.html index a0e01af2c..953f26115 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_dereference_adaptor_concept.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_dereference_adaptor_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelDereferenceAdaptorConcept< D > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        PixelDereferenceAdaptorConcept< D > Struct Template Reference
        +
        PixelDereferenceAdaptorConcept< D > Struct Template Reference
        @@ -57,34 +57,34 @@ $(function() {

        #include <pixel_dereference.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        d
         

        Detailed Description

        -

        template<typename D>
        -struct boost::gil::PixelDereferenceAdaptorConcept< D >

        - -

        Represents a unary function object that can be invoked upon dereferencing a pixel iterator.

        -

        This can perform an arbitrary computation, such as color conversion or table lookup.

        concept PixelDereferenceAdaptorConcept<boost::UnaryFunctionConcept D>
        +
        template<typename D>
        +struct boost::gil::PixelDereferenceAdaptorConcept< D >

        Represents a unary function object that can be invoked upon dereferencing a pixel iterator.

        +

        This can perform an arbitrary computation, such as color conversion or table lookup.

        concept PixelDereferenceAdaptorConcept<boost::UnaryFunctionConcept D>
        : DefaultConstructibleConcept<D>, CopyConstructibleConcept<D>, AssignableConcept<D>
        {
        -
        typename const_t; where PixelDereferenceAdaptorConcept<const_t>;
        -
        typename value_type; where PixelValueConcept<value_type>;
        -
        typename reference; // may be mutable
        -
        typename const_reference; // must not be mutable
        -
        static const bool D::is_mutable;
        +
        typename const_t; where PixelDereferenceAdaptorConcept<const_t>;
        +
        typename value_type; where PixelValueConcept<value_type>;
        +
        typename reference; // may be mutable
        +
        typename const_reference; // must not be mutable
        +
        static const bool D::is_mutable;
        where Convertible<value_type,result_type>;
        };
        +
        Represents a unary function object that can be invoked upon dereferencing a pixel iterator.
        Definition pixel_dereference.hpp:54
        +
        Pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:171

        The documentation for this struct was generated from the following file: @@ -94,7 +94,7 @@ struct boost::gil::PixelDereferenceAdaptorConcept< D > diff --git a/html/reference/structboost_1_1gil_1_1_pixel_iterator_concept-members.html b/html/reference/structboost_1_1gil_1_1_pixel_iterator_concept-members.html index ef6f26cc8..674f05cb6 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_iterator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_iterator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PixelIteratorConcept< Iterator > Member List
        +
        PixelIteratorConcept< Iterator > Member List

        This is the complete list of members for PixelIteratorConcept< Iterator >, including all inherited members.

        - + - +
        check_base(std::false_type) (defined in PixelIteratorConcept< Iterator >)PixelIteratorConcept< Iterator >inline
        check_base(std::true_type) (defined in PixelIteratorConcept< Iterator >)PixelIteratorConcept< Iterator >inline
        check_base(std::true_type) (defined in PixelIteratorConcept< Iterator >)PixelIteratorConcept< Iterator >inline
        constraints() (defined in PixelIteratorConcept< Iterator >)PixelIteratorConcept< Iterator >inline
        it (defined in PixelIteratorConcept< Iterator >)PixelIteratorConcept< Iterator >
        it (defined in PixelIteratorConcept< Iterator >)PixelIteratorConcept< Iterator >
        diff --git a/html/reference/structboost_1_1gil_1_1_pixel_iterator_concept.html b/html/reference/structboost_1_1gil_1_1_pixel_iterator_concept.html index 000e7ba66..81c7dda0f 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_iterator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_iterator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelIteratorConcept< Iterator > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        PixelIteratorConcept< Iterator > Struct Template Reference
        +
        PixelIteratorConcept< Iterator > Struct Template Reference
        @@ -57,43 +57,47 @@ $(function() {

        #include <pixel_iterator.hpp>

        - - - -

        +

        Public Member Functions

        +
        void constraints ()
         
        +
        void check_base (std::false_type)
         
        +
        void check_base (std::true_type)
         
        - -

        +

        Public Attributes

        +
        Iterator it
         

        Detailed Description

        -

        template<typename Iterator>
        -struct boost::gil::PixelIteratorConcept< Iterator >

        - -

        An STL random access traversal iterator over a model of PixelConcept.

        +
        template<typename Iterator>
        +struct boost::gil::PixelIteratorConcept< Iterator >

        An STL random access traversal iterator over a model of PixelConcept.

        GIL's iterators must also provide the following metafunctions:

        • const_iterator_type<Iterator>: Returns a read-only equivalent of Iterator
        • iterator_is_mutable<Iterator>: Returns whether the given iterator is read-only or mutable
        • is_iterator_adaptor<Iterator>: Returns whether the given iterator is an adaptor over another iterator. See IteratorAdaptorConcept for additional requirements of adaptors.
        -
        concept PixelIteratorConcept<typename Iterator>
        -
        : boost_concepts::RandomAccessTraversalConcept<Iterator>, PixelBasedConcept<Iterator>
        +
        concept PixelIteratorConcept<typename Iterator>
        +
        : boost_concepts::RandomAccessTraversalConcept<Iterator>, PixelBasedConcept<Iterator>
        {
        -
        where PixelValueConcept<value_type>;
        -
        typename const_iterator_type<It>::type;
        -
        where PixelIteratorConcept<const_iterator_type<It>::type>;
        -
        static const bool iterator_is_mutable<It>::value;
        -
        static const bool is_iterator_adaptor<It>::value; // is it an iterator adaptor
        +
        where PixelValueConcept<value_type>;
        +
        typename const_iterator_type<It>::type;
        + +
        static const bool iterator_is_mutable<It>::value;
        +
        static const bool is_iterator_adaptor<It>::value; // is it an iterator adaptor
        };
        +
        Concept for all pixel-based GIL constructs.
        Definition pixel_based.hpp:54
        +
        An STL random access traversal iterator over a model of PixelConcept.
        Definition concepts/pixel_iterator.hpp:171
        +
        Pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:171
        +
        Returns the type of an iterator just like the input iterator, except operating over immutable values.
        Definition pixel_iterator.hpp:40
        +
        metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
        Definition pixel_iterator.hpp:28
        +
        Metafunction predicate returning whether the given iterator allows for changing its values.
        Definition pixel_iterator.hpp:49

        The documentation for this struct was generated from the following file: @@ -103,7 +107,7 @@ struct boost::gil::PixelIteratorConcept< Iterator > diff --git a/html/reference/structboost_1_1gil_1_1_pixel_locator_concept-members.html b/html/reference/structboost_1_1gil_1_1_pixel_locator_concept-members.html index 6411f45c3..f05243323 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_locator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_locator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PixelLocatorConcept< Loc > Member List
        +
        PixelLocatorConcept< Loc > Member List

        This is the complete list of members for PixelLocatorConcept< Loc >, including all inherited members.

        - +
        constraints() (defined in PixelLocatorConcept< Loc >)PixelLocatorConcept< Loc >inline
        loc (defined in PixelLocatorConcept< Loc >)PixelLocatorConcept< Loc >
        loc (defined in PixelLocatorConcept< Loc >)PixelLocatorConcept< Loc >
        diff --git a/html/reference/structboost_1_1gil_1_1_pixel_locator_concept.html b/html/reference/structboost_1_1gil_1_1_pixel_locator_concept.html index 933feda39..7fde59c1a 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_locator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_locator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelLocatorConcept< Loc > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        PixelLocatorConcept< Loc > Struct Template Reference
        +
        PixelLocatorConcept< Loc > Struct Template Reference
        @@ -57,32 +57,34 @@ $(function() {

        #include <pixel_locator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        Loc loc
         

        Detailed Description

        -

        template<typename Loc>
        -struct boost::gil::PixelLocatorConcept< Loc >

        - -

        GIL's 2-dimensional locator over immutable GIL pixels.

        -
        concept PixelLocatorConcept<RandomAccess2DLocatorConcept Loc>
        +
        template<typename Loc>
        +struct boost::gil::PixelLocatorConcept< Loc >

        GIL's 2-dimensional locator over immutable GIL pixels.

        +
        {
        -
        where PixelValueConcept<value_type>;
        -
        where PixelIteratorConcept<x_iterator>;
        -
        where PixelIteratorConcept<y_iterator>;
        +
        where PixelValueConcept<value_type>;
        +
        where PixelIteratorConcept<x_iterator>;
        +
        where PixelIteratorConcept<y_iterator>;
        where x_coord_t == y_coord_t;
        typename coord_t = x_coord_t;
        };
        +
        An STL random access traversal iterator over a model of PixelConcept.
        Definition concepts/pixel_iterator.hpp:171
        +
        GIL's 2-dimensional locator over immutable GIL pixels.
        Definition pixel_locator.hpp:292
        +
        Pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:171
        +
        2-dimensional locator over immutable values
        Definition pixel_locator.hpp:222

        The documentation for this struct was generated from the following file: @@ -92,7 +94,7 @@ struct boost::gil::PixelLocatorConcept< Loc > diff --git a/html/reference/structboost_1_1gil_1_1_pixel_value_concept-members.html b/html/reference/structboost_1_1gil_1_1_pixel_value_concept-members.html index 89827aad5..6ca2a899e 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_value_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_value_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PixelValueConcept< P > Member List
        +
        PixelValueConcept< P > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_pixel_value_concept.html b/html/reference/structboost_1_1gil_1_1_pixel_value_concept.html index 69fea35a5..338552f1b 100644 --- a/html/reference/structboost_1_1gil_1_1_pixel_value_concept.html +++ b/html/reference/structboost_1_1gil_1_1_pixel_value_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelValueConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,21 +56,23 @@ $(function() {

        #include <pixel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::PixelValueConcept< P >

        - -

        Pixel concept that is a Regular type.

        -
        concept PixelValueConcept<PixelConcept P> : Regular<P>
        +
        template<typename P>
        +struct boost::gil::PixelValueConcept< P >

        Pixel concept that is a Regular type.

        +
        {
        -
        where SameType<value_type,P>;
        +
        where SameType<value_type,P>;
        };
        +
        Pixel concept - A color base whose elements are channels.
        Definition concepts/pixel.hpp:64
        +
        Pixel concept that is a Regular type.
        Definition concepts/pixel.hpp:171
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -80,7 +82,7 @@ struct boost::gil::PixelValueConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_pixels_compatible_concept-members.html b/html/reference/structboost_1_1gil_1_1_pixels_compatible_concept-members.html index b4a213e3f..d4fc50739 100644 --- a/html/reference/structboost_1_1gil_1_1_pixels_compatible_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_pixels_compatible_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PixelsCompatibleConcept< P1, P2 > Member List
        +
        PixelsCompatibleConcept< P1, P2 > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_pixels_compatible_concept.html b/html/reference/structboost_1_1gil_1_1_pixels_compatible_concept.html index ddcb2e34d..881b1d472 100644 --- a/html/reference/structboost_1_1gil_1_1_pixels_compatible_concept.html +++ b/html/reference/structboost_1_1gil_1_1_pixels_compatible_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PixelsCompatibleConcept< P1, P2 > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,25 +56,26 @@ $(function() {

        #include <pixel.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename P1, typename P2>
        -struct boost::gil::PixelsCompatibleConcept< P1, P2 >

        - -

        Concept for pixel compatibility Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another.

        +
        template<typename P1, typename P2>
        +struct boost::gil::PixelsCompatibleConcept< P1, P2 >

        Concept for pixel compatibility Pixels are compatible if their channels and color space types are compatible. Compatible pixels can be assigned and copy constructed from one another.

        Template Parameters
        -
        P1Models PixelConcept
        P2Models PixelConcept
        concept PixelsCompatibleConcept<PixelConcept P1, PixelConcept P2>
        -
        : ColorBasesCompatibleConcept<P1,P2> {
        +
        P2Models PixelConcept
        +
        // where for each K [0..size<P1>::value):
        // ChannelsCompatibleConcept<kth_semantic_element_type<P1,K>::type, kth_semantic_element_type<P2,K>::type>;
        };
        +
        Two color bases are compatible if they have the same color space and their elements are compatible,...
        Definition concepts/color_base.hpp:304
        +
        Pixel concept - A color base whose elements are channels.
        Definition concepts/pixel.hpp:64
        +
        Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
        Definition concepts/pixel.hpp:257
        @@ -88,7 +89,7 @@ struct boost::gil::PixelsCompatibleConcept< P1, P2 > diff --git a/html/reference/structboost_1_1gil_1_1_point2_d_concept-members.html b/html/reference/structboost_1_1gil_1_1_point2_d_concept-members.html index 4cdc5b346..1d63917fc 100644 --- a/html/reference/structboost_1_1gil_1_1_point2_d_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_point2_d_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        Point2DConcept< P > Member List
        +
        Point2DConcept< P > Member List

        This is the complete list of members for Point2DConcept< P >, including all inherited members.

        - +
        constraints() (defined in Point2DConcept< P >)Point2DConcept< P >inline
        point (defined in Point2DConcept< P >)Point2DConcept< P >
        point (defined in Point2DConcept< P >)Point2DConcept< P >
        diff --git a/html/reference/structboost_1_1gil_1_1_point2_d_concept.html b/html/reference/structboost_1_1gil_1_1_point2_d_concept.html index 9c7ea5476..969c1d366 100644 --- a/html/reference/structboost_1_1gil_1_1_point2_d_concept.html +++ b/html/reference/structboost_1_1gil_1_1_point2_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: Point2DConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        Point2DConcept< P > Struct Template Reference
        +
        Point2DConcept< P > Struct Template Reference
        @@ -57,27 +57,25 @@ $(function() {

        #include <point.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        point
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::Point2DConcept< P >

        - -

        2-dimensional point concept

        -
        concept Point2DConcept<typename T> : PointNDConcept<T>
        +
        template<typename P>
        +struct boost::gil::Point2DConcept< P >

        2-dimensional point concept

        +
        concept Point2DConcept<typename T> : PointNDConcept<T>
        {
        where num_dimensions == 2;
        -
        where SameType<axis<0>::type, axis<1>::type>;
        +
        where SameType<axis<0>::type, axis<1>::type>;
        typename value_type = axis<0>::type;
        @@ -86,6 +84,9 @@ struct boost::gil::Point2DConcept< P >
        value_type x,y;
        };
        +
        2-dimensional point concept
        Definition concepts/point.hpp:104
        +
        N-dimensional point concept.
        Definition concepts/point.hpp:62
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -95,7 +96,7 @@ struct boost::gil::Point2DConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_point_n_d_concept-members.html b/html/reference/structboost_1_1gil_1_1_point_n_d_concept-members.html index 0129def75..0a8bcec26 100644 --- a/html/reference/structboost_1_1gil_1_1_point_n_d_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_point_n_d_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        PointNDConcept< P > Member List
        +
        PointNDConcept< P > Member List

        This is the complete list of members for PointNDConcept< P >, including all inherited members.

        - +
        constraints() (defined in PointNDConcept< P >)PointNDConcept< P >inline
        point (defined in PointNDConcept< P >)PointNDConcept< P >
        point (defined in PointNDConcept< P >)PointNDConcept< P >
        diff --git a/html/reference/structboost_1_1gil_1_1_point_n_d_concept.html b/html/reference/structboost_1_1gil_1_1_point_n_d_concept.html index 81d8a67ed..17ca8138f 100644 --- a/html/reference/structboost_1_1gil_1_1_point_n_d_concept.html +++ b/html/reference/structboost_1_1gil_1_1_point_n_d_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: PointNDConcept< P > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        PointNDConcept< P > Struct Template Reference
        +
        PointNDConcept< P > Struct Template Reference
        @@ -57,39 +57,40 @@ $(function() {

        #include <point.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        point
         

        Detailed Description

        -

        template<typename P>
        -struct boost::gil::PointNDConcept< P >

        - -

        N-dimensional point concept.

        -
        concept PointNDConcept<typename T> : Regular<T>
        +
        template<typename P>
        +struct boost::gil::PointNDConcept< P >

        N-dimensional point concept.

        +
        concept PointNDConcept<typename T> : Regular<T>
        {
        // the type of a coordinate along each axis
        -
        template <size_t K>
        -
        struct axis; where Metafunction<axis>;
        +
        template <size_t K>
        +
        struct axis; where Metafunction<axis>;
        -
        const size_t num_dimensions;
        +
        const size_t num_dimensions;
        // accessor/modifier of the value of each axis.
        -
        template <size_t K>
        -
        typename axis<K>::type const& T::axis_value() const;
        +
        template <size_t K>
        +
        typename axis<K>::type const& T::axis_value() const;
        -
        template <size_t K>
        -
        typename axis<K>::type& T::axis_value();
        +
        template <size_t K>
        +
        typename axis<K>::type& T::axis_value();
        };
        +
        Concept for type as metafunction requirement.
        Definition basic.hpp:164
        +
        N-dimensional point concept.
        Definition concepts/point.hpp:62
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142

        The documentation for this struct was generated from the following file: @@ -99,7 +100,7 @@ struct boost::gil::PointNDConcept< P > diff --git a/html/reference/structboost_1_1gil_1_1_random_access2_d_image_concept-members.html b/html/reference/structboost_1_1gil_1_1_random_access2_d_image_concept-members.html index 603cc0f48..e75232a31 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access2_d_image_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_random_access2_d_image_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        RandomAccess2DImageConcept< Image > Member List
        +
        RandomAccess2DImageConcept< Image > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_random_access2_d_image_concept.html b/html/reference/structboost_1_1gil_1_1_random_access2_d_image_concept.html index 0cc670c55..bf3e2adc9 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access2_d_image_concept.html +++ b/html/reference/structboost_1_1gil_1_1_random_access2_d_image_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccess2DImageConcept< Image > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        RandomAccess2DImageConcept< Image > Struct Template Reference
        +
        RandomAccess2DImageConcept< Image > Struct Template Reference
        @@ -57,26 +57,24 @@ $(function() {

        #include <image.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        Image image
         

        Detailed Description

        -

        template<typename Image>
        -struct boost::gil::RandomAccess2DImageConcept< Image >

        - -

        2-dimensional container of values

        -
        concept RandomAccess2DImageConcept<RandomAccessNDImageConcept Image>
        +
        template<typename Image>
        +struct boost::gil::RandomAccess2DImageConcept< Image >

        2-dimensional container of values

        +
        {
        -
        typename x_coord_t = const_view_t::x_coord_t;
        +
        typename x_coord_t = const_view_t::x_coord_t;
        typename y_coord_t = const_view_t::y_coord_t;
        Image::Image(x_coord_t width, y_coord_t height, std::size_t alignment=1);
        @@ -88,6 +86,8 @@ struct boost::gil::RandomAccess2DImageConcept< Image >
        void Image::recreate(x_coord_t width, y_coord_t height, std::size_t alignment=1);
        void Image::recreate(x_coord_t width, y_coord_t height, value_type fill_value, std::size_t alignment);
        };
        +
        2-dimensional container of values
        Definition concepts/image.hpp:110
        +
        N-dimensional container of values.
        Definition concepts/image.hpp:58

        The documentation for this struct was generated from the following file: @@ -97,7 +97,7 @@ struct boost::gil::RandomAccess2DImageConcept< Image > diff --git a/html/reference/structboost_1_1gil_1_1_random_access2_d_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_random_access2_d_image_view_concept-members.html index 5c08d6d36..c2c2a1f5c 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access2_d_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_random_access2_d_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        RandomAccess2DImageViewConcept< View > Member List
        +
        RandomAccess2DImageViewConcept< View > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_random_access2_d_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_random_access2_d_image_view_concept.html index bef5d983c..38d84ea50 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access2_d_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_random_access2_d_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccess2DImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        RandomAccess2DImageViewConcept< View > Struct Template Reference
        +
        RandomAccess2DImageViewConcept< View > Struct Template Reference
        @@ -57,24 +57,22 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        View view
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::RandomAccess2DImageViewConcept< View >

        - -

        2-dimensional view over immutable values

        -
        concept RandomAccess2DImageViewConcept<RandomAccessNDImageViewConcept View> {
        +
        template<typename View>
        +struct boost::gil::RandomAccess2DImageViewConcept< View >

        2-dimensional view over immutable values

        +
        where num_dimensions==2;
        typename x_iterator = axis<0>::iterator;
        @@ -87,17 +85,17 @@ struct boost::gil::RandomAccess2DImageViewConcept< View >
        y_coord_t View::height() const;
        // X-navigation
        -
        x_iterator View::x_at(point_t const&) const;
        +
        x_iterator View::x_at(point_t const&) const;
        x_iterator View::row_begin(y_coord_t) const;
        x_iterator View::row_end (y_coord_t) const;
        // Y-navigation
        -
        y_iterator View::y_at(point_t const&) const;
        +
        y_iterator View::y_at(point_t const&) const;
        y_iterator View::col_begin(x_coord_t) const;
        y_iterator View::col_end (x_coord_t) const;
        // navigating in 2D
        -
        xy_locator View::xy_at(point_t const&) const;
        +
        xy_locator View::xy_at(point_t const&) const;
        // (x,y) versions of all methods taking point_t
        View::View(x_coord_t,y_coord_t,const locator&);
        @@ -107,6 +105,9 @@ struct boost::gil::RandomAccess2DImageViewConcept< View >
        x_iterator View::x_at(x_coord_t,y_coord_t) const;
        y_iterator View::y_at(x_coord_t,y_coord_t) const;
        };
        + +
        2-dimensional view over immutable values
        Definition concepts/image_view.hpp:222
        +
        N-dimensional view over immutable values.
        Definition concepts/image_view.hpp:104

        The documentation for this struct was generated from the following file: @@ -116,7 +117,7 @@ struct boost::gil::RandomAccess2DImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_random_access2_d_locator_concept-members.html b/html/reference/structboost_1_1gil_1_1_random_access2_d_locator_concept-members.html index e38f104ce..e5afd289a 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access2_d_locator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_random_access2_d_locator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        RandomAccess2DLocatorConcept< Loc > Member List
        +
        RandomAccess2DLocatorConcept< Loc > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_random_access2_d_locator_concept.html b/html/reference/structboost_1_1gil_1_1_random_access2_d_locator_concept.html index fe770ce7c..6276038b0 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access2_d_locator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_random_access2_d_locator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccess2DLocatorConcept< Loc > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        RandomAccess2DLocatorConcept< Loc > Struct Template Reference
        +
        RandomAccess2DLocatorConcept< Loc > Struct Template Reference
        @@ -57,27 +57,25 @@ $(function() {

        #include <pixel_locator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        Loc loc
         

        Detailed Description

        -

        template<typename Loc>
        -struct boost::gil::RandomAccess2DLocatorConcept< Loc >

        - -

        2-dimensional locator over immutable values

        -
        concept RandomAccess2DLocatorConcept<RandomAccessNDLocatorConcept Loc>
        +
        template<typename Loc>
        +struct boost::gil::RandomAccess2DLocatorConcept< Loc >

        2-dimensional locator over immutable values

        +
        {
        where num_dimensions==2;
        -
        where Point2DConcept<point_t>;
        +
        typename x_iterator = axis<0>::iterator;
        typename y_iterator = axis<1>::iterator;
        @@ -109,6 +107,9 @@ struct boost::gil::RandomAccess2DLocatorConcept< Loc >
        bool Loc::is_1d_traversable(x_coord_t width) const;
        y_coord_t Loc::y_distance_to(const Loc& loc2, x_coord_t x_diff) const;
        };
        +
        2-dimensional point concept
        Definition concepts/point.hpp:104
        +
        2-dimensional locator over immutable values
        Definition pixel_locator.hpp:222
        +
        N-dimensional locator over immutable values.
        Definition pixel_locator.hpp:105

        The documentation for this struct was generated from the following file: @@ -118,7 +119,7 @@ struct boost::gil::RandomAccess2DLocatorConcept< Loc > diff --git a/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept-members.html b/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept-members.html index 7d6947cc4..800807c4a 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        RandomAccessNDImageConcept< Image > Member List
        +
        RandomAccessNDImageConcept< Image > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept.html b/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept.html index 6efec0c00..9e9e8a507 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept.html +++ b/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccessNDImageConcept< Image > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        RandomAccessNDImageConcept< Image > Struct Template Reference
        +
        RandomAccessNDImageConcept< Image > Struct Template Reference
        @@ -57,43 +57,45 @@ $(function() {

        #include <image.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        Image image
         

        Detailed Description

        -

        template<typename Image>
        -struct boost::gil::RandomAccessNDImageConcept< Image >

        - -

        N-dimensional container of values.

        -
        concept RandomAccessNDImageConcept<typename Image> : Regular<Image>
        +
        template<typename Image>
        +struct boost::gil::RandomAccessNDImageConcept< Image >

        N-dimensional container of values.

        +
        concept RandomAccessNDImageConcept<typename Image> : Regular<Image>
        {
        -
        typename view_t; where MutableRandomAccessNDImageViewConcept<view_t>;
        -
        typename const_view_t = view_t::const_t;
        -
        typename point_t = view_t::point_t;
        +
        typename view_t; where MutableRandomAccessNDImageViewConcept<view_t>;
        +
        typename const_view_t = view_t::const_t;
        +
        typename point_t = view_t::point_t;
        typename value_type = view_t::value_type;
        typename allocator_type;
        -
        Image::Image(point_t dims, std::size_t alignment=1);
        -
        Image::Image(point_t dims, value_type fill_value, std::size_t alignment);
        +
        Image::Image(point_t dims, std::size_t alignment=1);
        +
        Image::Image(point_t dims, value_type fill_value, std::size_t alignment);
        -
        void Image::recreate(point_t new_dims, std::size_t alignment=1);
        -
        void Image::recreate(point_t new_dims, value_type fill_value, std::size_t alignment);
        +
        void Image::recreate(point_t new_dims, std::size_t alignment=1);
        +
        void Image::recreate(point_t new_dims, value_type fill_value, std::size_t alignment);
        -
        point_t const& Image::dimensions() const;
        -
        const const_view_t& const_view(const Image&);
        -
        const view_t& view(Image&);
        +
        point_t const& Image::dimensions() const;
        +
        const const_view_t& const_view(const Image&);
        +
        const view_t& view(Image&);
        };
        -
        auto const_view(const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
        Returns the constant-pixel view of an image.
        Definition: image.hpp:573
        -
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition: image.hpp:565
        + +
        auto view(image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::view_t const &
        Returns the non-constant-pixel view of an image.
        Definition image.hpp:565
        +
        auto const_view(const image< Pixel, IsPlanar, Alloc > &img) -> typename image< Pixel, IsPlanar, Alloc >::const_view_t const
        Returns the constant-pixel view of an image.
        Definition image.hpp:573
        +
        N-dimensional view over mutable values.
        Definition concepts/image_view.hpp:471
        +
        N-dimensional container of values.
        Definition concepts/image.hpp:58
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142

        The documentation for this struct was generated from the following file: @@ -103,7 +105,7 @@ struct boost::gil::RandomAccessNDImageConcept< Image > diff --git a/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_view_concept-members.html index 10955a80c..2429b7f60 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        RandomAccessNDImageViewConcept< View > Member List
        +
        RandomAccessNDImageViewConcept< View > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_view_concept.html index c8570249d..397bd1a25 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_random_access_n_d_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccessNDImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        RandomAccessNDImageViewConcept< View > Struct Template Reference
        +
        RandomAccessNDImageViewConcept< View > Struct Template Reference
        @@ -57,46 +57,44 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        View view
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::RandomAccessNDImageViewConcept< View >

        - -

        N-dimensional view over immutable values.

        -
        concept RandomAccessNDImageViewConcept<Regular View>
        +
        template<typename View>
        +struct boost::gil::RandomAccessNDImageViewConcept< View >

        N-dimensional view over immutable values.

        +
        {
        -
        typename value_type;
        -
        typename reference; // result of dereferencing
        -
        typename difference_type; // result of operator-(iterator,iterator) (1-dimensional!)
        -
        typename const_t; where RandomAccessNDImageViewConcept<View>; // same as View, but over immutable values
        -
        typename point_t; where PointNDConcept<point_t>; // N-dimensional point
        -
        typename locator; where RandomAccessNDLocatorConcept<locator>; // N-dimensional locator.
        -
        typename iterator; where RandomAccessTraversalConcept<iterator>; // 1-dimensional iterator over all values
        -
        typename reverse_iterator; where RandomAccessTraversalConcept<reverse_iterator>;
        -
        typename size_type; // the return value of size()
        +
        typename value_type;
        +
        typename reference; // result of dereferencing
        +
        typename difference_type; // result of operator-(iterator,iterator) (1-dimensional!)
        +
        typename const_t; where RandomAccessNDImageViewConcept<View>; // same as View, but over immutable values
        +
        typename point_t; where PointNDConcept<point_t>; // N-dimensional point
        +
        typename locator; where RandomAccessNDLocatorConcept<locator>; // N-dimensional locator.
        +
        typename iterator; where RandomAccessTraversalConcept<iterator>; // 1-dimensional iterator over all values
        +
        typename reverse_iterator; where RandomAccessTraversalConcept<reverse_iterator>;
        +
        typename size_type; // the return value of size()
        // Equivalent to RandomAccessNDLocatorConcept::axis
        -
        template <size_t D> struct axis {
        -
        typename coord_t = point_t::axis<D>::coord_t;
        +
        template <size_t D> struct axis {
        +
        typename coord_t = point_t::axis<D>::coord_t;
        typename iterator; where RandomAccessTraversalConcept<iterator>; // iterator along D-th axis.
        -
        where SameType<coord_t, iterator::difference_type>;
        -
        where SameType<iterator::value_type,value_type>;
        + +
        };
        // Defines the type of a view similar to this type, except it invokes Deref upon dereferencing
        template <PixelDereferenceAdaptorConcept Deref> struct add_deref {
        -
        typename type; where RandomAccessNDImageViewConcept<type>;
        +
        static type make(const View& v, const Deref& deref);
        };
        @@ -120,6 +118,12 @@ struct boost::gil::RandomAccessNDImageViewConcept< View >
        reference operator()(View,point_t const&) const;
        };
        + +
        N-dimensional point concept.
        Definition concepts/point.hpp:62
        +
        N-dimensional view over immutable values.
        Definition concepts/image_view.hpp:104
        +
        N-dimensional locator over immutable values.
        Definition pixel_locator.hpp:105
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -129,7 +133,7 @@ struct boost::gil::RandomAccessNDImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_random_access_n_d_locator_concept-members.html b/html/reference/structboost_1_1gil_1_1_random_access_n_d_locator_concept-members.html index 908aa4998..d4e9d7126 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access_n_d_locator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_random_access_n_d_locator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        RandomAccessNDLocatorConcept< Loc > Member List
        +
        RandomAccessNDLocatorConcept< Loc > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_random_access_n_d_locator_concept.html b/html/reference/structboost_1_1gil_1_1_random_access_n_d_locator_concept.html index 231d1f54b..2119e0d3c 100644 --- a/html/reference/structboost_1_1gil_1_1_random_access_n_d_locator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_random_access_n_d_locator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: RandomAccessNDLocatorConcept< Loc > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        RandomAccessNDLocatorConcept< Loc > Struct Template Reference
        +
        RandomAccessNDLocatorConcept< Loc > Struct Template Reference
        @@ -57,31 +57,29 @@ $(function() {

        #include <pixel_locator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        Loc loc
         

        Detailed Description

        -

        template<typename Loc>
        -struct boost::gil::RandomAccessNDLocatorConcept< Loc >

        - -

        N-dimensional locator over immutable values.

        -
        concept RandomAccessNDLocatorConcept<Regular Loc>
        +
        template<typename Loc>
        +struct boost::gil::RandomAccessNDLocatorConcept< Loc >

        N-dimensional locator over immutable values.

        +
        {
        -
        typename value_type; // value over which the locator navigates
        -
        typename reference; // result of dereferencing
        -
        typename difference_type; where PointNDConcept<difference_type>; // return value of operator-.
        -
        typename const_t; // same as Loc, but operating over immutable values
        -
        typename cached_location_t; // type to store relative location (for efficient repeated access)
        -
        typename point_t = difference_type;
        +
        typename value_type; // value over which the locator navigates
        +
        typename reference; // result of dereferencing
        +
        typename difference_type; where PointNDConcept<difference_type>; // return value of operator-.
        +
        typename const_t; // same as Loc, but operating over immutable values
        +
        typename cached_location_t; // type to store relative location (for efficient repeated access)
        +
        typename point_t = difference_type;
        static const size_t num_dimensions; // dimensionality of the locator
        where num_dimensions = point_t::num_dimensions;
        @@ -101,7 +99,7 @@ struct boost::gil::RandomAccessNDLocatorConcept< Loc >
        struct add_deref
        {
        typename type;
        -
        where RandomAccessNDLocatorConcept<type>;
        +
        static type make(const Loc& loc, const Deref& deref);
        };
        @@ -122,6 +120,10 @@ struct boost::gil::RandomAccessNDLocatorConcept< Loc >
        template <size_t D> axis<D>::iterator const& Loc::axis_iterator() const;
        template <size_t D> axis<D>::iterator Loc::axis_iterator(const difference_type&) const;
        };
        + +
        N-dimensional point concept.
        Definition concepts/point.hpp:62
        +
        N-dimensional locator over immutable values.
        Definition pixel_locator.hpp:105
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142

        The documentation for this struct was generated from the following file: @@ -131,7 +133,7 @@ struct boost::gil::RandomAccessNDLocatorConcept< Loc > diff --git a/html/reference/structboost_1_1gil_1_1_regular-members.html b/html/reference/structboost_1_1gil_1_1_regular-members.html index fc10cd8b7..7b2c13374 100644 --- a/html/reference/structboost_1_1gil_1_1_regular-members.html +++ b/html/reference/structboost_1_1gil_1_1_regular-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        Regular< T > Member List
        +
        Regular< T > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_regular.html b/html/reference/structboost_1_1gil_1_1_regular.html index cbbbee386..cecff4679 100644 --- a/html/reference/structboost_1_1gil_1_1_regular.html +++ b/html/reference/structboost_1_1gil_1_1_regular.html @@ -4,7 +4,7 @@ - + Generic Image Library: Regular< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,24 +56,28 @@ $(function() {

        #include <basic.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::Regular< T >

        - -

        Concept for type regularity requirement.

        -
        auto concept Regular<typename T>
        -
        : DefaultConstructible<T>
        -
        , CopyConstructible<T>
        -
        , EqualityComparable<T>
        -
        , Assignable<T>
        -
        , Swappable<T>
        +
        template<typename T>
        +struct boost::gil::Regular< T >

        Concept for type regularity requirement.

        +
        auto concept Regular<typename T>
        + + + + +
        , Swappable<T>
        {};
        +
        Concept of copy assignment requirement.
        Definition basic.hpp:82
        +
        Concept of copy construction requirement.
        Definition basic.hpp:63
        +
        Concept of default construction requirement.
        Definition basic.hpp:44
        +
        Concept of == and != comparability requirement.
        Definition basic.hpp:101
        +
        Concept for type regularity requirement.
        Definition basic.hpp:142
        +
        Concept of swap operation requirement.
        Definition basic.hpp:119

        The documentation for this struct was generated from the following file: @@ -83,7 +87,7 @@ struct boost::gil::Regular< T > diff --git a/html/reference/structboost_1_1gil_1_1_reversible_collection_image_view_concept-members.html b/html/reference/structboost_1_1gil_1_1_reversible_collection_image_view_concept-members.html index 84702e48c..780e1165a 100644 --- a/html/reference/structboost_1_1gil_1_1_reversible_collection_image_view_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_reversible_collection_image_view_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ReversibleCollectionImageViewConcept< View > Member List
        +
        ReversibleCollectionImageViewConcept< View > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1_reversible_collection_image_view_concept.html b/html/reference/structboost_1_1gil_1_1_reversible_collection_image_view_concept.html index 602405476..221476e3b 100644 --- a/html/reference/structboost_1_1gil_1_1_reversible_collection_image_view_concept.html +++ b/html/reference/structboost_1_1gil_1_1_reversible_collection_image_view_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ReversibleCollectionImageViewConcept< View > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        ReversibleCollectionImageViewConcept< View > Struct Template Reference
        +
        ReversibleCollectionImageViewConcept< View > Struct Template Reference
        @@ -57,23 +57,21 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        View view
         

        Detailed Description

        -

        template<typename View>
        -struct boost::gil::ReversibleCollectionImageViewConcept< View >

        - -

        GIL view as ReversibleCollection.

        +
        template<typename View>
        +struct boost::gil::ReversibleCollectionImageViewConcept< View >

        GIL view as ReversibleCollection.

        See also
        https://www.boost.org/libs/utility/Collection.html

        The documentation for this struct was generated from the following file:
        • concepts/image_view.hpp
        • @@ -84,7 +82,7 @@ struct boost::gil::ReversibleCollectionImageViewConcept< View > diff --git a/html/reference/structboost_1_1gil_1_1_same_type-members.html b/html/reference/structboost_1_1gil_1_1_same_type-members.html index a7349bab7..81fd75bf0 100644 --- a/html/reference/structboost_1_1gil_1_1_same_type-members.html +++ b/html/reference/structboost_1_1gil_1_1_same_type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        SameType< T, U > Member List
        +
        SameType< T, U > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_same_type.html b/html/reference/structboost_1_1gil_1_1_same_type.html index bf1366bd7..ef8608665 100644 --- a/html/reference/structboost_1_1gil_1_1_same_type.html +++ b/html/reference/structboost_1_1gil_1_1_same_type.html @@ -4,7 +4,7 @@ - + Generic Image Library: SameType< T, U > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,18 +56,17 @@ $(function() {

        #include <basic.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename T, typename U>
        -struct boost::gil::SameType< T, U >

        - -

        Concept of types equivalence requirement.

        -
        auto concept SameType<typename T, typename U>; // unspecified
        +
        template<typename T, typename U>
        +struct boost::gil::SameType< T, U >

        Concept of types equivalence requirement.

        +
        auto concept SameType<typename T, typename U>; // unspecified
        +
        Concept of types equivalence requirement.
        Definition basic.hpp:179

        The documentation for this struct was generated from the following file: @@ -77,7 +76,7 @@ struct boost::gil::SameType< T, U > diff --git a/html/reference/structboost_1_1gil_1_1_step_iterator_concept-members.html b/html/reference/structboost_1_1gil_1_1_step_iterator_concept-members.html index 23a95e007..0ab445ce9 100644 --- a/html/reference/structboost_1_1gil_1_1_step_iterator_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_step_iterator_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        StepIteratorConcept< Iterator > Member List
        +
        StepIteratorConcept< Iterator > Member List

        This is the complete list of members for StepIteratorConcept< Iterator >, including all inherited members.

        - +
        constraints() (defined in StepIteratorConcept< Iterator >)StepIteratorConcept< Iterator >inline
        it (defined in StepIteratorConcept< Iterator >)StepIteratorConcept< Iterator >
        it (defined in StepIteratorConcept< Iterator >)StepIteratorConcept< Iterator >
        diff --git a/html/reference/structboost_1_1gil_1_1_step_iterator_concept.html b/html/reference/structboost_1_1gil_1_1_step_iterator_concept.html index 50bbe8e86..ca4fc8574 100644 --- a/html/reference/structboost_1_1gil_1_1_step_iterator_concept.html +++ b/html/reference/structboost_1_1gil_1_1_step_iterator_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: StepIteratorConcept< Iterator > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        StepIteratorConcept< Iterator > Struct Template Reference
        +
        StepIteratorConcept< Iterator > Struct Template Reference
        @@ -57,28 +57,27 @@ $(function() {

        #include <pixel_iterator.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - -

        +

        Public Attributes

        +
        Iterator it
         

        Detailed Description

        -

        template<typename Iterator>
        -struct boost::gil::StepIteratorConcept< Iterator >

        - -

        Step iterator concept.

        -

        Step iterators are iterators that have a set_step method

        concept StepIteratorConcept<boost_concepts::ForwardTraversalConcept Iterator>
        +
        template<typename Iterator>
        +struct boost::gil::StepIteratorConcept< Iterator >

        Step iterator concept.

        +

        Step iterators are iterators that have a set_step method

        concept StepIteratorConcept<boost_concepts::ForwardTraversalConcept Iterator>
        {
        -
        template <Integral D>
        -
        void Iterator::set_step(D step);
        +
        template <Integral D>
        +
        void Iterator::set_step(D step);
        };
        +
        Step iterator concept.
        Definition concepts/pixel_iterator.hpp:258

        The documentation for this struct was generated from the following file: @@ -88,7 +87,7 @@ struct boost::gil::StepIteratorConcept< Iterator > diff --git a/html/reference/structboost_1_1gil_1_1_swappable-members.html b/html/reference/structboost_1_1gil_1_1_swappable-members.html index 9a164c037..694a9da8c 100644 --- a/html/reference/structboost_1_1gil_1_1_swappable-members.html +++ b/html/reference/structboost_1_1gil_1_1_swappable-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        Swappable< T > Member List
        +
        Swappable< T > Member List

        This is the complete list of members for Swappable< T >, including all inherited members.

        - +
        constraints() (defined in Swappable< T >)Swappable< T >inline
        x (defined in Swappable< T >)Swappable< T >
        x (defined in Swappable< T >)Swappable< T >
        y (defined in Swappable< T >)Swappable< T >
        @@ -59,7 +59,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_swappable.html b/html/reference/structboost_1_1gil_1_1_swappable.html index faf9e5c93..c150a6028 100644 --- a/html/reference/structboost_1_1gil_1_1_swappable.html +++ b/html/reference/structboost_1_1gil_1_1_swappable.html @@ -4,7 +4,7 @@ - + Generic Image Library: Swappable< T > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        Swappable< T > Struct Template Reference
        +
        Swappable< T > Struct Template Reference
        @@ -57,31 +57,29 @@ $(function() {

        #include <basic.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         
        - - -

        +

        Public Attributes

        +
        x
         
        +
        y
         

        Detailed Description

        -

        template<typename T>
        -struct boost::gil::Swappable< T >

        - -

        Concept of swap operation requirement.

        -
        auto concept Swappable<typename T>
        +
        template<typename T>
        +struct boost::gil::Swappable< T >

        Concept of swap operation requirement.

        +
        auto concept Swappable<typename T>
        {
        -
        void swap(T&,T&);
        +
        void swap(T&,T&);
        };
        -
        void swap(boost::gil::packed_channel_reference< BF, FB, NB, M > const x, R &y)
        swap for packed_channel_reference
        Definition: channel.hpp:583
        +
        Concept of swap operation requirement.
        Definition basic.hpp:119

        The documentation for this struct was generated from the following file: @@ -91,7 +89,7 @@ struct boost::gil::Swappable< T > diff --git a/html/reference/structboost_1_1gil_1_1_views_compatible_concept-members.html b/html/reference/structboost_1_1gil_1_1_views_compatible_concept-members.html index 01b166388..1cad18eb9 100644 --- a/html/reference/structboost_1_1gil_1_1_views_compatible_concept-members.html +++ b/html/reference/structboost_1_1gil_1_1_views_compatible_concept-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        ViewsCompatibleConcept< V1, V2 > Member List
        +
        ViewsCompatibleConcept< V1, V2 > Member List
        @@ -57,7 +57,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1_views_compatible_concept.html b/html/reference/structboost_1_1gil_1_1_views_compatible_concept.html index 64c80163b..6adc25ed3 100644 --- a/html/reference/structboost_1_1gil_1_1_views_compatible_concept.html +++ b/html/reference/structboost_1_1gil_1_1_views_compatible_concept.html @@ -4,7 +4,7 @@ - + Generic Image Library: ViewsCompatibleConcept< V1, V2 > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        @@ -56,22 +56,23 @@ $(function() {

        #include <image_view.hpp>

        - -

        +

        Public Member Functions

        +
        void constraints ()
         

        Detailed Description

        -

        template<typename V1, typename V2>
        -struct boost::gil::ViewsCompatibleConcept< V1, V2 >

        - -

        Views are compatible if they have the same color spaces and compatible channel values.

        +
        template<typename V1, typename V2>
        +struct boost::gil::ViewsCompatibleConcept< V1, V2 >

        Views are compatible if they have the same color spaces and compatible channel values.

        Constness and layout are not important for compatibility.

        -
        concept ViewsCompatibleConcept<ImageViewConcept V1, ImageViewConcept V2>
        +
        {
        -
        where PixelsCompatibleConcept<V1::value_type, P2::value_type>;
        +
        where PixelsCompatibleConcept<V1::value_type, P2::value_type>;
        };
        +
        GIL's 2-dimensional view over immutable GIL pixels.
        Definition concepts/image_view.hpp:376
        +
        Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
        Definition concepts/pixel.hpp:257
        +
        Views are compatible if they have the same color spaces and compatible channel values.
        Definition concepts/image_view.hpp:540

        The documentation for this struct was generated from the following file: @@ -81,7 +82,7 @@ struct boost::gil::ViewsCompatibleConcept< V1, V2 > diff --git a/html/reference/structboost_1_1gil_1_1alpha__t.html b/html/reference/structboost_1_1gil_1_1alpha__t.html index db1bf48d0..3901aa4c9 100644 --- a/html/reference/structboost_1_1gil_1_1alpha__t.html +++ b/html/reference/structboost_1_1gil_1_1alpha__t.html @@ -4,7 +4,7 @@ - + Generic Image Library: alpha_t Struct Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        alpha_t Struct Reference
        +
        alpha_t Struct Reference
        @@ -63,7 +63,7 @@ $(function() { diff --git a/html/reference/structboost_1_1gil_1_1binary__operation__obj-members.html b/html/reference/structboost_1_1gil_1_1binary__operation__obj-members.html index f292c9e7a..5dbcb6bf2 100644 --- a/html/reference/structboost_1_1gil_1_1binary__operation__obj-members.html +++ b/html/reference/structboost_1_1gil_1_1binary__operation__obj-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        binary_operation_obj< Derived, Result > Member List
        +
        binary_operation_obj< Derived, Result > Member List

        This is the complete list of members for binary_operation_obj< Derived, Result >, including all inherited members.

        - + - +
        operator()(const std::pair< const V1 *, const V2 * > &p) const -> result_type (defined in binary_operation_obj< Derived, Result >)binary_operation_obj< Derived, Result >inline
        operator()(const V1 &v1, const V2 &v2) const -> result_type (defined in binary_operation_obj< Derived, Result >)binary_operation_obj< Derived, Result >inline
        operator()(const V1 &v1, const V2 &v2) const -> result_type (defined in binary_operation_obj< Derived, Result >)binary_operation_obj< Derived, Result >inline
        operator()(const error_t &) const -> result_type (defined in binary_operation_obj< Derived, Result >)binary_operation_obj< Derived, Result >inline
        result_type typedef (defined in binary_operation_obj< Derived, Result >)binary_operation_obj< Derived, Result >
        result_type typedef (defined in binary_operation_obj< Derived, Result >)binary_operation_obj< Derived, Result >
        diff --git a/html/reference/structboost_1_1gil_1_1binary__operation__obj.html b/html/reference/structboost_1_1gil_1_1binary__operation__obj.html index 018b06a6c..c8ad70bdb 100644 --- a/html/reference/structboost_1_1gil_1_1binary__operation__obj.html +++ b/html/reference/structboost_1_1gil_1_1binary__operation__obj.html @@ -4,7 +4,7 @@ - + Generic Image Library: binary_operation_obj< Derived, Result > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + -
        -
        binary_operation_obj< Derived, Result > Struct Template Reference
        +
        binary_operation_obj< Derived, Result > Struct Template Reference
        @@ -57,31 +57,29 @@ $(function() {

        #include <algorithm.hpp>

        - -

        +

        Public Types

        +
        using result_type = Result
         
        - - - -

        +

        Public Member Functions

        +
        template<typename V1 , typename V2 >
        BOOST_FORCEINLINE auto operator() (const std::pair< const V1 *, const V2 * > &p) const -> result_type
         
        +
        template<typename V1 , typename V2 >
        BOOST_FORCEINLINE auto operator() (const V1 &v1, const V2 &v2) const -> result_type
         
        +
        auto operator() (const error_t &) const -> result_type
         

        Detailed Description

        -

        template<typename Derived, typename Result = void>
        -struct boost::gil::binary_operation_obj< Derived, Result >

        - -

        A generic binary operation on views.

        +
        template<typename Derived, typename Result = void>
        +struct boost::gil::binary_operation_obj< Derived, Result >

        A generic binary operation on views.

        Use this class as a convenience superclass when defining an operation for any image views. Many operations have different behavior when the two views are compatible. This class checks for compatibility and invokes apply_compatible(V1,V2) or apply_incompatible(V1,V2) of the subclass. You must provide apply_compatible(V1,V2) method in your subclass, but apply_incompatible(V1,V2) is not required and the default throws std::bad_cast.


        The documentation for this struct was generated from the following file:
        • algorithm.hpp
        • @@ -92,7 +90,7 @@ struct boost::gil::binary_operation_obj< Derived, Result > diff --git a/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type-members.html b/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type-members.html index 67f621833..b390a15c8 100644 --- a/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type-members.html +++ b/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        bit_aligned_image1_type< Size1, Layout, Alloc > Member List
        +
        bit_aligned_image1_type< Size1, Layout, Alloc > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type.html b/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type.html index 8ae02e954..ac6b8179d 100644 --- a/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type.html +++ b/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_image1_type< Size1, Layout, Alloc > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ + - - - + +

        +

        Additional Inherited Members

        - Public Types inherited from bit_aligned_image_type< mp11::mp_list_c< unsigned, Size1 >, Layout, std::allocator< unsigned char > >
        -using type = image< bit_alignedref_t, false, std::allocator< unsigned char > >
        - Public Types inherited from bit_aligned_image_type< ChannelBitSizes, Layout, Alloc >
        +using type = image< bit_alignedref_t, false, Alloc >
         

        Detailed Description

        -

        template<unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        -struct boost::gil::bit_aligned_image1_type< Size1, Layout, Alloc >

        - -

        Returns the type of a single-channel bit-aligned image given the bit size of its channel and its layout.

        +
        template<unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
        +struct boost::gil::bit_aligned_image1_type< Size1, Layout, Alloc >

        Returns the type of a single-channel bit-aligned image given the bit size of its channel and its layout.


        The documentation for this struct was generated from the following file: @@ -85,7 +83,7 @@ struct boost::gil::bit_aligned_image1_type< Size1, Layout, Alloc > diff --git a/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type.png b/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type.png index 027d9f86e..21241e4af 100644 Binary files a/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type.png and b/html/reference/structboost_1_1gil_1_1bit__aligned__image1__type.png differ diff --git a/html/reference/structboost_1_1gil_1_1bit__aligned__image2__type-members.html b/html/reference/structboost_1_1gil_1_1bit__aligned__image2__type-members.html index 1b451d7fc..b5db5ad95 100644 --- a/html/reference/structboost_1_1gil_1_1bit__aligned__image2__type-members.html +++ b/html/reference/structboost_1_1gil_1_1bit__aligned__image2__type-members.html @@ -4,7 +4,7 @@ - + Generic Image Library: Member List @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        -
        -
        bit_aligned_image2_type< Size1, Size2, Layout, Alloc > Member List
        +
        bit_aligned_image2_type< Size1, Size2, Layout, Alloc > Member List
        diff --git a/html/reference/structboost_1_1gil_1_1bit__aligned__image2__type.html b/html/reference/structboost_1_1gil_1_1bit__aligned__image2__type.html index 9fbab7655..7d973ec97 100644 --- a/html/reference/structboost_1_1gil_1_1bit__aligned__image2__type.html +++ b/html/reference/structboost_1_1gil_1_1bit__aligned__image2__type.html @@ -4,7 +4,7 @@ - + Generic Image Library: bit_aligned_image2_type< Size1, Size2, Layout, Alloc > Struct Template Reference @@ -27,15 +27,16 @@

        - + +/* @license-end */ +
        - + +/* @license-end */ +
        - + +/* @license-end */ +
        - + +/* @license-end */ +